cfel-base-components 2.5.41 → 2.5.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/universal-pages/cpcRole/AddModal/index.tsx +29 -31
- package/src/components/universal-pages/cpcRole/api.ts +2 -0
- package/src/components/universal-pages/cpcRole/index.tsx +13 -10
- package/src/components/universal-pages/cpcRoleInfo/api.ts +2 -0
- package/src/components/universal-pages/cpcRoleInfo/index.tsx +12 -15
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { Button, Modal, Form, Input, Checkbox } from 'antd'
|
|
2
|
+
import { Button, Modal, Form, Input, Checkbox, Space, Radio } from 'antd'
|
|
3
3
|
export default function Index({
|
|
4
4
|
ModalOpen, //弹框状态
|
|
5
5
|
editOpenStatus, //关闭弹框
|
|
@@ -28,12 +28,8 @@ export default function Index({
|
|
|
28
28
|
})
|
|
29
29
|
if (isCustomer && editingData.metaData) {
|
|
30
30
|
form.setFieldsValue({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return key
|
|
34
|
-
}
|
|
35
|
-
return null
|
|
36
|
-
})
|
|
31
|
+
readOnly: editingData?.metaData?.readOnly,
|
|
32
|
+
hypervisorManager: editingData?.metaData?.hypervisorManager
|
|
37
33
|
})
|
|
38
34
|
}
|
|
39
35
|
}
|
|
@@ -74,15 +70,10 @@ export default function Index({
|
|
|
74
70
|
value.roleCode = editingData.roleCode
|
|
75
71
|
}
|
|
76
72
|
if (isCustomer) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} else {
|
|
82
|
-
myMeta[item] = false
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
value.metaData = myMeta
|
|
73
|
+
value.metaData = {
|
|
74
|
+
readOnly: value.readOnly,
|
|
75
|
+
hypervisorManager: value.hypervisorManager
|
|
76
|
+
}
|
|
86
77
|
}
|
|
87
78
|
actionFunc(value, editingData ? 'edit' : 'add').then(() => {
|
|
88
79
|
form.resetFields()
|
|
@@ -119,21 +110,28 @@ export default function Index({
|
|
|
119
110
|
>
|
|
120
111
|
<Form form={form} layout={'vertical'} initialValues={{ remember: true }} autoComplete='off'>
|
|
121
112
|
{isCustomer && (
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
113
|
+
<Space size={50}>
|
|
114
|
+
<Form.Item
|
|
115
|
+
label='读写规则'
|
|
116
|
+
name='readOnly'
|
|
117
|
+
rules={[{ required: true, message: '请选择读写规则' }]}
|
|
118
|
+
>
|
|
119
|
+
<Radio.Group>
|
|
120
|
+
<Radio value='false'>只读</Radio>
|
|
121
|
+
<Radio value='true'>读写</Radio>
|
|
122
|
+
</Radio.Group>
|
|
123
|
+
</Form.Item>
|
|
124
|
+
<Form.Item
|
|
125
|
+
label='云厂商/租户规则'
|
|
126
|
+
name='hypervisorManager'
|
|
127
|
+
rules={[{ required: true, message: '请选择云厂商/租户规则' }]}
|
|
128
|
+
>
|
|
129
|
+
<Radio.Group>
|
|
130
|
+
<Radio value='true'>云厂商</Radio>
|
|
131
|
+
<Radio value='false'>租户</Radio>
|
|
132
|
+
</Radio.Group>
|
|
133
|
+
</Form.Item>
|
|
134
|
+
</Space>
|
|
137
135
|
)}
|
|
138
136
|
{formDom.map((item: any, index: number) => {
|
|
139
137
|
return <div key={index}>{showCom(item)}</div>
|
|
@@ -6,6 +6,7 @@ import ProTable from '../../base-component/ProTable'
|
|
|
6
6
|
import Pagination from '../../base-component/Pagination'
|
|
7
7
|
import useTableHooks from '../../../hooks/useTableHooks'
|
|
8
8
|
import DocumentEntry from '../../document-entry/index'
|
|
9
|
+
|
|
9
10
|
import { timeFormatter, getUrlParams } from '../../../utils'
|
|
10
11
|
|
|
11
12
|
import { get } from 'lodash'
|
|
@@ -43,11 +44,12 @@ export default function Role({ historyAction }: RoleProps) {
|
|
|
43
44
|
const [openJson, setOpenJson] = useState({})
|
|
44
45
|
|
|
45
46
|
const lookMoreJson = (data: any) => {
|
|
46
|
-
const translatedData: Record<string,
|
|
47
|
+
const translatedData: Record<string, string> = {}
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
console.log(data)
|
|
50
|
+
|
|
51
|
+
translatedData['读写规则'] = data.readOnly === 'true' ? '读写' : '只读'
|
|
52
|
+
translatedData['云厂商/租户规则'] = data.hypervisorManager === 'true' ? '云厂商' : '租户'
|
|
51
53
|
|
|
52
54
|
setOpen(true)
|
|
53
55
|
setOpenJson(translatedData)
|
|
@@ -127,9 +129,10 @@ export default function Role({ historyAction }: RoleProps) {
|
|
|
127
129
|
onClick={() => {
|
|
128
130
|
let initialValues: Record<string, boolean> = {}
|
|
129
131
|
if (record.metaData === null) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
initialValues = {
|
|
133
|
+
readOnly: false,
|
|
134
|
+
hypervisorManager: false,
|
|
135
|
+
}
|
|
133
136
|
} else {
|
|
134
137
|
initialValues = record.metaData
|
|
135
138
|
}
|
|
@@ -276,9 +279,9 @@ export default function Role({ historyAction }: RoleProps) {
|
|
|
276
279
|
return (
|
|
277
280
|
<PageContainer>
|
|
278
281
|
<JsonViewDialog open={open} jsonData={openJson} closeModel={() => setOpen(false)} />
|
|
279
|
-
<QueryFilter onReset={handleOnReset} onFinish={handleOnFinish}>
|
|
280
|
-
<ProFormText name=
|
|
281
|
-
</QueryFilter>
|
|
282
|
+
{/* <QueryFilter onReset={handleOnReset} onFinish={handleOnFinish}>
|
|
283
|
+
<ProFormText name='roleName' label='角色名称' />
|
|
284
|
+
</QueryFilter> */}
|
|
282
285
|
|
|
283
286
|
<ProTable
|
|
284
287
|
columnsState={{
|
|
@@ -66,23 +66,20 @@ export default function RoleInfo({ isShowTab, getAuthTree, getRoleAuthTree, empo
|
|
|
66
66
|
const renderMetaData = () => {
|
|
67
67
|
//如果详情为的metadata为null则显示false
|
|
68
68
|
if (roleInfo?.metaData === null) {
|
|
69
|
-
return Object.keys(metaData).map((key) => {
|
|
70
|
-
return (
|
|
71
|
-
<Descriptions.Item key={key} label={metaData[key]}>
|
|
72
|
-
false
|
|
73
|
-
</Descriptions.Item>
|
|
74
|
-
)
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
//如果有数据则根据metadata翻译成中文
|
|
79
|
-
return Object.keys(metaData).map((key) => {
|
|
80
69
|
return (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
<>
|
|
71
|
+
<Descriptions.Item label="读写规则">只读</Descriptions.Item>
|
|
72
|
+
<Descriptions.Item label="云厂商/租户规则">租户</Descriptions.Item>
|
|
73
|
+
</>
|
|
84
74
|
)
|
|
85
|
-
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<>
|
|
79
|
+
<Descriptions.Item label="读写规则">{roleInfo?.metaData?.readOnly === 'true' ? '读写' : '只读'}</Descriptions.Item>
|
|
80
|
+
<Descriptions.Item label="云厂商/租户规则">{roleInfo?.metaData?.hypervisorManager === 'true' ? '云厂商' : '租户'}</Descriptions.Item>
|
|
81
|
+
</>
|
|
82
|
+
)
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
const columns: any = [
|