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,6 +348,8 @@ export default (ChildComponent) => { | ||
| 348 | } | 348 | } |
| 349 | // 模拟config的 gdsconfigformslave 配置 | 349 | // 模拟config的 gdsconfigformslave 配置 |
| 350 | imitateTableConfig = (title, dataIndex, width) => { | 350 | imitateTableConfig = (title, dataIndex, width) => { |
| 351 | + console.log('222app',this.props.app); | ||
| 352 | + const {userinfo} = this.props.app; | ||
| 351 | return { | 353 | return { |
| 352 | bCanInput: false, | 354 | bCanInput: false, |
| 353 | bFilter: false, | 355 | bFilter: false, |
| @@ -370,8 +372,8 @@ export default (ChildComponent) => { | @@ -370,8 +372,8 @@ export default (ChildComponent) => { | ||
| 370 | sId: commonUtils.createSid(), | 372 | sId: commonUtils.createSid(), |
| 371 | sParentId: '11811781131121915102156308120', | 373 | sParentId: '11811781131121915102156308120', |
| 372 | sSubsidiaryId: '1111111111', | 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,6 +12,7 @@ import StaticEditTable from '../CommonTable';/* 可编辑表格 */ | ||
| 12 | import * as commonUtils from '../../../utils/utils'; | 12 | import * as commonUtils from '../../../utils/utils'; |
| 13 | import styles from './Tree.css'; | 13 | import styles from './Tree.css'; |
| 14 | import AntdDraggableModal from '../AntdDraggableModal'; | 14 | import AntdDraggableModal from '../AntdDraggableModal'; |
| 15 | +import * as commonFunc from "@/components/Common/commonFunc"; | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | const SearchModule = Input.Search; | 18 | const SearchModule = Input.Search; |
| @@ -324,6 +325,8 @@ class TreeComponent extends Component { | @@ -324,6 +325,8 @@ class TreeComponent extends Component { | ||
| 324 | }; | 325 | }; |
| 325 | render() { | 326 | render() { |
| 326 | const treeProps = this.getTreeProps(); | 327 | const treeProps = this.getTreeProps(); |
| 328 | + const PermissionContent = commonFunc.showLocalMessage(this.props, 'PermissionContent', '权限内容'); | ||
| 329 | + | ||
| 327 | return ( | 330 | return ( |
| 328 | <FormItem className={styles.subForm}> | 331 | <FormItem className={styles.subForm}> |
| 329 | <div className={styles.tableOption}> | 332 | <div className={styles.tableOption}> |
| @@ -344,7 +347,7 @@ class TreeComponent extends Component { | @@ -344,7 +347,7 @@ class TreeComponent extends Component { | ||
| 344 | { | 347 | { |
| 345 | this.props.isSearch ? | 348 | this.props.isSearch ? |
| 346 | <div className={styles.advColTitle} > | 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 | <div className={styles.advColExpand}> | 351 | <div className={styles.advColExpand}> |
| 349 | <button | 352 | <button |
| 350 | className={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? 'ant-table-row-expand-icon-collapsed' : ''}`} | 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,6 +115,11 @@ const SystemPermissionComponent = Form.create({ | ||
| 115 | const sCopyGroup = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sCopyGroup')) ? commonFunc.showMessage(app.commonConst, 'sCopyGroup') : '复制组权限';/* 复制组权限 */ | 115 | const sCopyGroup = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sCopyGroup')) ? commonFunc.showMessage(app.commonConst, 'sCopyGroup') : '复制组权限';/* 复制组权限 */ |
| 116 | const sCopyUser = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, 'sCopyUser')) ? commonFunc.showMessage(app.commonConst, 'sCopyUser') : '复制人员权限';/* 复制组权限 */ | 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 | onReturnForm(form); | 124 | onReturnForm(form); |
| 120 | return ( | 125 | return ( |
| @@ -123,7 +128,7 @@ const SystemPermissionComponent = Form.create({ | @@ -123,7 +128,7 @@ const SystemPermissionComponent = Form.create({ | ||
| 123 | <Header className={styles.header}> | 128 | <Header className={styles.header}> |
| 124 | <Toolbar {...props} /> | 129 | <Toolbar {...props} /> |
| 125 | </Header> | 130 | </Header> |
| 126 | - <Layout className={selfstyles.clayout} > | 131 | + <Layout className={selfstyles.clayout}> |
| 127 | <Content className={styles.content}> | 132 | <Content className={styles.content}> |
| 128 | <Layout className={styles.clayoutJur} id="SysPermissionList"> | 133 | <Layout className={styles.clayoutJur} id="SysPermissionList"> |
| 129 | <div style={{ | 134 | <div style={{ |
| @@ -133,32 +138,32 @@ const SystemPermissionComponent = Form.create({ | @@ -133,32 +138,32 @@ const SystemPermissionComponent = Form.create({ | ||
| 133 | <Row type="flex" justify="space-between"> | 138 | <Row type="flex" justify="space-between"> |
| 134 | <Col span={9} style={{ }}> | 139 | <Col span={9} style={{ }}> |
| 135 | <div id="slaveTabs"> | 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 | <Row> | 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 | </Row> | 145 | </Row> |
| 141 | <Row> | 146 | <Row> |
| 142 | - <Col span={24} key="1" > | 147 | + <Col span={24} key="1"> |
| 143 | <div className="xly-bill-list"> | 148 | <div className="xly-bill-list"> |
| 144 | <StaticEditTable {...groupProps} noVlist footer="hidden" /> | 149 | <StaticEditTable {...groupProps} noVlist footer="hidden" /> |
| 145 | </div> | 150 | </div> |
| 146 | </Col> | 151 | </Col> |
| 147 | </Row> | 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 | <div className="xly-bill-list"> | 155 | <div className="xly-bill-list"> |
| 151 | <StaticEditTable {...userGroupProps} footer="hidden" /> | 156 | <StaticEditTable {...userGroupProps} footer="hidden" /> |
| 152 | </div> | 157 | </div> |
| 153 | </Col> | 158 | </Col> |
| 154 | </Row> | 159 | </Row> |
| 155 | </TabPane> | 160 | </TabPane> |
| 156 | - <TabPane tab="查看用户权限" key={3} > | 161 | + <TabPane tab={tabLookUserPermission} key={3}> |
| 157 | <Row> | 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 | </Row> | 164 | </Row> |
| 160 | <Row> | 165 | <Row> |
| 161 | - <Col span={24} key="3" > | 166 | + <Col span={24} key="3"> |
| 162 | <div className="xly-bill-list"> | 167 | <div className="xly-bill-list"> |
| 163 | <StaticEditTable {...userProps} footer="hidden" /> | 168 | <StaticEditTable {...userProps} footer="hidden" /> |
| 164 | </div> | 169 | </div> |
| @@ -173,9 +178,9 @@ const SystemPermissionComponent = Form.create({ | @@ -173,9 +178,9 @@ const SystemPermissionComponent = Form.create({ | ||
| 173 | </Tabs> | 178 | </Tabs> |
| 174 | </div> | 179 | </div> |
| 175 | </Col> | 180 | </Col> |
| 176 | - <Col span={15} style={{ marginTop: 40, paddingLeft: '17px' }}> | 181 | + <Col span={15} style={{ marginTop: 40, paddingLeft: "17px" }}> |
| 177 | <Row> | 182 | <Row> |
| 178 | - <Col span={24} className="xly-jurisdiction" > | 183 | + <Col span={24} className="xly-jurisdiction"> |
| 179 | <StaticEditTree {...treeProps} /> | 184 | <StaticEditTree {...treeProps} /> |
| 180 | </Col> | 185 | </Col> |
| 181 | </Row> | 186 | </Row> |
| @@ -184,23 +189,22 @@ const SystemPermissionComponent = Form.create({ | @@ -184,23 +189,22 @@ const SystemPermissionComponent = Form.create({ | ||
| 184 | </Layout> | 189 | </Layout> |
| 185 | </Content> | 190 | </Content> |
| 186 | <div> | 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 | let enabledNew = !child.bReadonly; | 208 | let enabledNew = !child.bReadonly; |
| 205 | if (child.iTag === 1) { | 209 | if (child.iTag === 1) { |
| 206 | enabledNew = false; | 210 | enabledNew = false; |
| @@ -208,7 +212,7 @@ const SystemPermissionComponent = Form.create({ | @@ -208,7 +212,7 @@ const SystemPermissionComponent = Form.create({ | ||
| 208 | enabledNew = true; | 212 | enabledNew = true; |
| 209 | } | 213 | } |
| 210 | const showTypeProps = { | 214 | const showTypeProps = { |
| 211 | - name: 'slave', | 215 | + name: "slave", |
| 212 | form, | 216 | form, |
| 213 | record: {}, | 217 | record: {}, |
| 214 | sId: commonUtils.createSid(), | 218 | sId: commonUtils.createSid(), |
| @@ -221,42 +225,42 @@ const SystemPermissionComponent = Form.create({ | @@ -221,42 +225,42 @@ const SystemPermissionComponent = Form.create({ | ||
| 221 | showConfig: child, | 225 | showConfig: child, |
| 222 | textArea: sMemo, | 226 | textArea: sMemo, |
| 223 | enabled: enabledNew, | 227 | enabled: enabledNew, |
| 224 | - dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : '', | 228 | + dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : "", |
| 225 | bTable: true, | 229 | bTable: true, |
| 226 | formRoute: props.formRoute, | 230 | formRoute: props.formRoute, |
| 227 | formItemLayout: {}, | 231 | formItemLayout: {}, |
| 228 | }; | 232 | }; |
| 229 | return ( | 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 | <ShowType {...showTypeProps} /> | 235 | <ShowType {...showTypeProps} /> |
| 232 | </Col> | 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 | let enabledNew = !child.bReadonly; | 264 | let enabledNew = !child.bReadonly; |
| 261 | if (child.iTag === 1) { | 265 | if (child.iTag === 1) { |
| 262 | enabledNew = false; | 266 | enabledNew = false; |
| @@ -264,7 +268,7 @@ const SystemPermissionComponent = Form.create({ | @@ -264,7 +268,7 @@ const SystemPermissionComponent = Form.create({ | ||
| 264 | enabledNew = true; | 268 | enabledNew = true; |
| 265 | } | 269 | } |
| 266 | const showTypeProps = { | 270 | const showTypeProps = { |
| 267 | - name: 'slave', | 271 | + name: "slave", |
| 268 | form, | 272 | form, |
| 269 | record: {}, | 273 | record: {}, |
| 270 | sId: commonUtils.createSid(), | 274 | sId: commonUtils.createSid(), |
| @@ -277,24 +281,25 @@ const SystemPermissionComponent = Form.create({ | @@ -277,24 +281,25 @@ const SystemPermissionComponent = Form.create({ | ||
| 277 | showConfig: child, | 281 | showConfig: child, |
| 278 | textArea: sMemo, | 282 | textArea: sMemo, |
| 279 | enabled: enabledNew, | 283 | enabled: enabledNew, |
| 280 | - dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : '', | 284 | + dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[child.sName] : "", |
| 281 | bTable: true, | 285 | bTable: true, |
| 282 | formRoute: props.formRoute, | 286 | formRoute: props.formRoute, |
| 283 | formItemLayout: {}, | 287 | formItemLayout: {}, |
| 284 | }; | 288 | }; |
| 285 | return ( | 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 | <ShowType {...showTypeProps} /> | 291 | <ShowType {...showTypeProps} /> |
| 288 | </Col> | 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 | </div> | 303 | </div> |
| 299 | 304 | ||
| 300 | 305 |