Commit 9b41f9e4bfa803bae9e2d1790d232fafaa7fbe8b
1 parent
65377341
1.修复用户权限多语言翻译
Showing
3 changed files
with
81 additions
and
71 deletions
src/components/Common/CommonJurisdictionNewEvent.js
| ... | ... | @@ -348,6 +348,8 @@ export default (ChildComponent) => { |
| 348 | 348 | } |
| 349 | 349 | // 模拟config的 gdsconfigformslave 配置 |
| 350 | 350 | imitateTableConfig = (title, dataIndex, width) => { |
| 351 | + console.log('222app',this.props.app); | |
| 352 | + const {userinfo} = this.props.app; | |
| 351 | 353 | return { |
| 352 | 354 | bCanInput: false, |
| 353 | 355 | bFilter: false, |
| ... | ... | @@ -370,8 +372,8 @@ export default (ChildComponent) => { |
| 370 | 372 | sId: commonUtils.createSid(), |
| 371 | 373 | sParentId: '11811781131121915102156308120', |
| 372 | 374 | sSubsidiaryId: '1111111111', |
| 373 | - showName: title, | |
| 374 | - sName: dataIndex, | |
| 375 | + showName: dataIndex, | |
| 376 | + sName: userinfo.sLanguage === 'sEnglish' ? dataIndex : title, | |
| 375 | 377 | }; |
| 376 | 378 | } |
| 377 | 379 | // 根据模拟列,模拟列配置 | ... | ... |
src/components/Common/Tree/StaticTree.js
| ... | ... | @@ -12,6 +12,7 @@ import StaticEditTable from '../CommonTable';/* 可编辑表格 */ |
| 12 | 12 | import * as commonUtils from '../../../utils/utils'; |
| 13 | 13 | import styles from './Tree.css'; |
| 14 | 14 | import AntdDraggableModal from '../AntdDraggableModal'; |
| 15 | +import * as commonFunc from "@/components/Common/commonFunc"; | |
| 15 | 16 | |
| 16 | 17 | |
| 17 | 18 | const SearchModule = Input.Search; |
| ... | ... | @@ -324,6 +325,8 @@ class TreeComponent extends Component { |
| 324 | 325 | }; |
| 325 | 326 | render() { |
| 326 | 327 | const treeProps = this.getTreeProps(); |
| 328 | + const PermissionContent = commonFunc.showLocalMessage(this.props, 'PermissionContent', '权限内容'); | |
| 329 | + | |
| 327 | 330 | return ( |
| 328 | 331 | <FormItem className={styles.subForm}> |
| 329 | 332 | <div className={styles.tableOption}> |
| ... | ... | @@ -344,7 +347,7 @@ class TreeComponent extends Component { |
| 344 | 347 | { |
| 345 | 348 | this.props.isSearch ? |
| 346 | 349 | <div className={styles.advColTitle} > |
| 347 | - <div className={styles.advColCt}> <Checkbox style={{ marginRight:'5px' }} onChange={e => this.handleButtonClick(e,e.target.checked ? 'checkedAll' : 'unChecked')} /> 权限内容</div> | |
| 350 | + <div className={styles.advColCt}> <Checkbox style={{ marginRight:'5px' }} onChange={e => this.handleButtonClick(e,e.target.checked ? 'checkedAll' : 'unChecked')} /> {PermissionContent}</div> | |
| 348 | 351 | <div className={styles.advColExpand}> |
| 349 | 352 | <button |
| 350 | 353 | className={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? 'ant-table-row-expand-icon-collapsed' : ''}`} | ... | ... |
src/components/JurisdictionAllotEvent/SystemPermissionInfo.js
| ... | ... | @@ -115,6 +115,11 @@ const SystemPermissionComponent = Form.create({ |
| 115 | 115 | const sCopyGroup = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sCopyGroup')) ? commonFunc.showMessage(app.commonConst, 'sCopyGroup') : '复制组权限';/* 复制组权限 */ |
| 116 | 116 | const sCopyUser = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sCopyUser')) ? commonFunc.showMessage(app.commonConst, 'sCopyUser') : '复制人员权限';/* 复制组权限 */ |
| 117 | 117 | |
| 118 | + const tabLookUserPermission = commonFunc.showLocalMessage(props, 'tabLookUserPermission', '查看用户权限'); | |
| 119 | + const searchUserPermission = commonFunc.showLocalMessage(props, 'searchUserPermission', '查询用户权限'); | |
| 120 | + const searchGroupPermission = commonFunc.showLocalMessage(props, 'searchGroupPermission', '查询用户权限'); | |
| 121 | + const GroupPermisson = commonFunc.showLocalMessage(props, 'GroupPermisson', '组权限'); | |
| 122 | + | |
| 118 | 123 | /* 回带表单 */ |
| 119 | 124 | onReturnForm(form); |
| 120 | 125 | return ( |
| ... | ... | @@ -123,7 +128,7 @@ const SystemPermissionComponent = Form.create({ |
| 123 | 128 | <Header className={styles.header}> |
| 124 | 129 | <Toolbar {...props} /> |
| 125 | 130 | </Header> |
| 126 | - <Layout className={selfstyles.clayout} > | |
| 131 | + <Layout className={selfstyles.clayout}> | |
| 127 | 132 | <Content className={styles.content}> |
| 128 | 133 | <Layout className={styles.clayoutJur} id="SysPermissionList"> |
| 129 | 134 | <div style={{ |
| ... | ... | @@ -133,32 +138,32 @@ const SystemPermissionComponent = Form.create({ |
| 133 | 138 | <Row type="flex" justify="space-between"> |
| 134 | 139 | <Col span={9} style={{ }}> |
| 135 | 140 | <div id="slaveTabs"> |
| 136 | - <Tabs onChange={props.onTabChange} className={styles.slaveTabs} size="large" tabBarStyle={{ margin: '10 0px' }}> | |
| 137 | - <TabPane tab="组权限" key={2} > | |
| 141 | + <Tabs onChange={props.onTabChange} className={styles.slaveTabs} size="large" tabBarStyle={{ margin: "10 0px" }}> | |
| 142 | + <TabPane tab={GroupPermisson} key={2}> | |
| 138 | 143 | <Row> |
| 139 | - <Search placeholder="查询组权限" allowClear onSearch={props.onSearchGroup} style={{ width: '64%', margin: '10px 1px' }} /> | |
| 144 | + <Search placeholder={searchGroupPermission} allowClear onSearch={props.onSearchGroup} style={{ width: "64%", margin: "10px 1px" }} /> | |
| 140 | 145 | </Row> |
| 141 | 146 | <Row> |
| 142 | - <Col span={24} key="1" > | |
| 147 | + <Col span={24} key="1"> | |
| 143 | 148 | <div className="xly-bill-list"> |
| 144 | 149 | <StaticEditTable {...groupProps} noVlist footer="hidden" /> |
| 145 | 150 | </div> |
| 146 | 151 | </Col> |
| 147 | 152 | </Row> |
| 148 | - <Row style={{ marginTop: '8px' }}> | |
| 149 | - <Col span={24} key="2" > | |
| 153 | + <Row style={{ marginTop: "8px" }}> | |
| 154 | + <Col span={24} key="2"> | |
| 150 | 155 | <div className="xly-bill-list"> |
| 151 | 156 | <StaticEditTable {...userGroupProps} footer="hidden" /> |
| 152 | 157 | </div> |
| 153 | 158 | </Col> |
| 154 | 159 | </Row> |
| 155 | 160 | </TabPane> |
| 156 | - <TabPane tab="查看用户权限" key={3} > | |
| 161 | + <TabPane tab={tabLookUserPermission} key={3}> | |
| 157 | 162 | <Row> |
| 158 | - <Search placeholder="查询用户权限" allowClear onSearch={props.onSearchUser} style={{ width: '64%', margin: '10px 1px' }} /> | |
| 163 | + <Search placeholder={searchUserPermission} allowClear onSearch={props.onSearchUser} style={{ width: "64%", margin: "10px 1px" }} /> | |
| 159 | 164 | </Row> |
| 160 | 165 | <Row> |
| 161 | - <Col span={24} key="3" > | |
| 166 | + <Col span={24} key="3"> | |
| 162 | 167 | <div className="xly-bill-list"> |
| 163 | 168 | <StaticEditTable {...userProps} footer="hidden" /> |
| 164 | 169 | </div> |
| ... | ... | @@ -173,9 +178,9 @@ const SystemPermissionComponent = Form.create({ |
| 173 | 178 | </Tabs> |
| 174 | 179 | </div> |
| 175 | 180 | </Col> |
| 176 | - <Col span={15} style={{ marginTop: 40, paddingLeft: '17px' }}> | |
| 181 | + <Col span={15} style={{ marginTop: 40, paddingLeft: "17px" }}> | |
| 177 | 182 | <Row> |
| 178 | - <Col span={24} className="xly-jurisdiction" > | |
| 183 | + <Col span={24} className="xly-jurisdiction"> | |
| 179 | 184 | <StaticEditTree {...treeProps} /> |
| 180 | 185 | </Col> |
| 181 | 186 | </Row> |
| ... | ... | @@ -184,23 +189,22 @@ const SystemPermissionComponent = Form.create({ |
| 184 | 189 | </Layout> |
| 185 | 190 | </Content> |
| 186 | 191 | <div> |
| 187 | - { | |
| 188 | - (groupModalVisible) ? | |
| 189 | - <AntdDraggableModal | |
| 190 | - title={sCopyGroup} | |
| 191 | - visible={groupModalVisible} | |
| 192 | - onOk={props.onCopyGroupModalOk} | |
| 193 | - onCancel={props.onModalCance.bind(this, 'groupModalVisible')} | |
| 194 | - width={800} | |
| 195 | - bodyStyle={{ height: 350, zIndex: 2000 }} | |
| 196 | - okButtonProps={{ style: { marginRight: '5px' } }} | |
| 197 | - > | |
| 198 | - <div className="contextMenuStyle" > | |
| 199 | - <FormItem className="searchMainForm"> | |
| 200 | - <Row type="flex" style={{ height: 'auto', overflow: 'hidden' }}> | |
| 201 | - { commonUtils.isNotEmptyArr(sToGroupConfig) ? | |
| 202 | - sToGroupConfig.map((child) => { | |
| 203 | - const sMemo = child.sName.toLowerCase().endsWith('memo'); | |
| 192 | + {groupModalVisible ? ( | |
| 193 | + <AntdDraggableModal | |
| 194 | + title={sCopyGroup} | |
| 195 | + visible={groupModalVisible} | |
| 196 | + onOk={props.onCopyGroupModalOk} | |
| 197 | + onCancel={props.onModalCance.bind(this, "groupModalVisible")} | |
| 198 | + width={800} | |
| 199 | + bodyStyle={{ height: 350, zIndex: 2000 }} | |
| 200 | + okButtonProps={{ style: { marginRight: "5px" } }} | |
| 201 | + > | |
| 202 | + <div className="contextMenuStyle"> | |
| 203 | + <FormItem className="searchMainForm"> | |
| 204 | + <Row type="flex" style={{ height: "auto", overflow: "hidden" }}> | |
| 205 | + {commonUtils.isNotEmptyArr(sToGroupConfig) | |
| 206 | + ? sToGroupConfig.map(child => { | |
| 207 | + const sMemo = child.sName.toLowerCase().endsWith("memo"); | |
| 204 | 208 | let enabledNew = !child.bReadonly; |
| 205 | 209 | if (child.iTag === 1) { |
| 206 | 210 | enabledNew = false; |
| ... | ... | @@ -208,7 +212,7 @@ const SystemPermissionComponent = Form.create({ |
| 208 | 212 | enabledNew = true; |
| 209 | 213 | } |
| 210 | 214 | const showTypeProps = { |
| 211 | - name: 'slave', | |
| 215 | + name: "slave", | |
| 212 | 216 | form, |
| 213 | 217 | record: {}, |
| 214 | 218 | sId: commonUtils.createSid(), |
| ... | ... | @@ -221,42 +225,42 @@ const SystemPermissionComponent = Form.create({ |
| 221 | 225 | showConfig: child, |
| 222 | 226 | textArea: sMemo, |
| 223 | 227 | enabled: enabledNew, |
| 224 | - dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : '', | |
| 228 | + dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : "", | |
| 225 | 229 | bTable: true, |
| 226 | 230 | formRoute: props.formRoute, |
| 227 | 231 | formItemLayout: {}, |
| 228 | 232 | }; |
| 229 | 233 | return ( |
| 230 | - <Col key={child.sId} span={24} order={child.iOrder} className="ContextMenuCol" style={{ border: '1px solid #d3d3d3' }}> | |
| 234 | + <Col key={child.sId} span={24} order={child.iOrder} className="ContextMenuCol" style={{ border: "1px solid #d3d3d3" }}> | |
| 231 | 235 | <ShowType {...showTypeProps} /> |
| 232 | 236 | </Col> |
| 233 | 237 | ); |
| 234 | - }) : '' | |
| 235 | - } | |
| 236 | - </Row> | |
| 237 | - </FormItem> | |
| 238 | - </div> | |
| 239 | - </AntdDraggableModal> | |
| 240 | - : '' | |
| 241 | - } | |
| 238 | + }) | |
| 239 | + : ""} | |
| 240 | + </Row> | |
| 241 | + </FormItem> | |
| 242 | + </div> | |
| 243 | + </AntdDraggableModal> | |
| 244 | + ) : ( | |
| 245 | + "" | |
| 246 | + )} | |
| 242 | 247 | |
| 243 | - { | |
| 244 | - (userModalVisible) ? | |
| 245 | - <AntdDraggableModal | |
| 246 | - title={sCopyUser} | |
| 247 | - visible={userModalVisible} | |
| 248 | - onOk={props.onCopyUserModalOk} | |
| 249 | - onCancel={props.onModalCance.bind(this, 'userModalVisible')} | |
| 250 | - width={800} | |
| 251 | - bodyStyle={{ height: 350, zIndex: 2000 }} | |
| 252 | - okButtonProps={{ style: { marginRight: '5px' } }} | |
| 253 | - > | |
| 254 | - <div className="contextMenuStyle" > | |
| 255 | - <FormItem className="searchMainForm"> | |
| 256 | - <Row type="flex" style={{ height: 'auto', overflow: 'hidden' }}> | |
| 257 | - { commonUtils.isNotEmptyArr(sToUserConfig) ? | |
| 258 | - sToUserConfig.map((child) => { | |
| 259 | - const sMemo = child.sName.toLowerCase().endsWith('memo'); | |
| 248 | + {userModalVisible ? ( | |
| 249 | + <AntdDraggableModal | |
| 250 | + title={sCopyUser} | |
| 251 | + visible={userModalVisible} | |
| 252 | + onOk={props.onCopyUserModalOk} | |
| 253 | + onCancel={props.onModalCance.bind(this, "userModalVisible")} | |
| 254 | + width={800} | |
| 255 | + bodyStyle={{ height: 350, zIndex: 2000 }} | |
| 256 | + okButtonProps={{ style: { marginRight: "5px" } }} | |
| 257 | + > | |
| 258 | + <div className="contextMenuStyle"> | |
| 259 | + <FormItem className="searchMainForm"> | |
| 260 | + <Row type="flex" style={{ height: "auto", overflow: "hidden" }}> | |
| 261 | + {commonUtils.isNotEmptyArr(sToUserConfig) | |
| 262 | + ? sToUserConfig.map(child => { | |
| 263 | + const sMemo = child.sName.toLowerCase().endsWith("memo"); | |
| 260 | 264 | let enabledNew = !child.bReadonly; |
| 261 | 265 | if (child.iTag === 1) { |
| 262 | 266 | enabledNew = false; |
| ... | ... | @@ -264,7 +268,7 @@ const SystemPermissionComponent = Form.create({ |
| 264 | 268 | enabledNew = true; |
| 265 | 269 | } |
| 266 | 270 | const showTypeProps = { |
| 267 | - name: 'slave', | |
| 271 | + name: "slave", | |
| 268 | 272 | form, |
| 269 | 273 | record: {}, |
| 270 | 274 | sId: commonUtils.createSid(), |
| ... | ... | @@ -277,24 +281,25 @@ const SystemPermissionComponent = Form.create({ |
| 277 | 281 | showConfig: child, |
| 278 | 282 | textArea: sMemo, |
| 279 | 283 | enabled: enabledNew, |
| 280 | - dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : '', | |
| 284 | + dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : "", | |
| 281 | 285 | bTable: true, |
| 282 | 286 | formRoute: props.formRoute, |
| 283 | 287 | formItemLayout: {}, |
| 284 | 288 | }; |
| 285 | 289 | return ( |
| 286 | - <Col key={child.sId} span={24} order={child.iOrder} className="ContextMenuCol" style={{ border: '1px solid #d3d3d3' }}> | |
| 290 | + <Col key={child.sId} span={24} order={child.iOrder} className="ContextMenuCol" style={{ border: "1px solid #d3d3d3" }}> | |
| 287 | 291 | <ShowType {...showTypeProps} /> |
| 288 | 292 | </Col> |
| 289 | 293 | ); |
| 290 | - }) : '' | |
| 291 | - } | |
| 292 | - </Row> | |
| 293 | - </FormItem> | |
| 294 | - </div> | |
| 295 | - </AntdDraggableModal> | |
| 296 | - : '' | |
| 297 | - } | |
| 294 | + }) | |
| 295 | + : ""} | |
| 296 | + </Row> | |
| 297 | + </FormItem> | |
| 298 | + </div> | |
| 299 | + </AntdDraggableModal> | |
| 300 | + ) : ( | |
| 301 | + "" | |
| 302 | + )} | |
| 298 | 303 | </div> |
| 299 | 304 | |
| 300 | 305 | ... | ... |