소스 검색

feat:云版的权限

outaozhen 3 년 전
부모
커밋
f016fac445
1개의 변경된 파일79개의 추가작업 그리고 10개의 파일을 삭제
  1. 79 10
      src/pages/Role/Product/index.tsx

+ 79 - 10
src/pages/Role/Product/index.tsx

@@ -54,9 +54,11 @@ const Product = () => {
     manual: true,
     onSuccess: (result: API.GetRolePermissionResultModel) => {
       const values = {
-        client: [],
-        company: [],
-        business: [],
+        building: [],
+        curing: [],
+        highway: [],
+        gs: [],
+        personal: [],
         enterprise: [],
         ...formatPermission('init', result.permission)
       }
@@ -223,21 +225,88 @@ const Product = () => {
                       fieldProps={{
                         onChange(checked) {
                           if (!checked) {
-                            formRef.current?.setFieldsValue({ enterprise: [] })
+                            formRef.current?.setFieldsValue({
+                              building: [],
+                              curing: [],
+                              highway: [],
+                              gs: []
+                            })
                           }
                         }
                       }}
-                      name="showEnterprise"
-                      label={<span className="flex items-center">企业版</span>}
+                      name="showCloud"
+                      label={<span className="flex items-center">云版管理</span>}
                     />
-                    <ProFormDependency name={['showEnterprise']}>
-                      {({ showEnterprise }) => (
+                    <ProFormDependency name={['showCloud']}>
+                      {({ showCloud }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="building"
+                          label="大司空云计价"
+                          options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormDependency name={['showCloud']}>
+                      {({ showCloud }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="curing"
+                          label="养护云造价"
+                          options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormDependency name={['showCloud']}>
+                      {({ showCloud }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="highway"
+                          label="公路云计价"
+                          options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormDependency name={['showCloud']}>
+                      {({ showCloud }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="gs"
+                          label="大司空概算"
+                          options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormSwitch
+                      fieldProps={{
+                        onChange(checked) {
+                          if (!checked) {
+                            formRef.current?.setFieldsValue({ personal: [], enterprise: [] })
+                          }
+                        }
+                      }}
+                      name="showRoad"
+                      label={<span className="flex items-center">大司空2.0</span>}
+                    />
+                    <ProFormDependency name={['showRoad']}>
+                      {({ showRoad }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="personal"
+                          label="个人版"
+                          options={[{ value: 'access', label: '查看', disabled: !showRoad }]}
+                        />
+                      )}
+                    </ProFormDependency>
+                    <ProFormDependency name={['showRoad']}>
+                      {({ showRoad }) => (
                         <ProFormCheckbox.Group
                           wrapperCol={{ offset: 1 }}
                           name="enterprise"
+                          label="企业版"
                           options={[
-                            { value: 'access', label: '查看', disabled: !showEnterprise },
-                            { value: 'add', label: '添加企业', disabled: !showEnterprise }
+                            { value: 'access', label: '查看', disabled: !showRoad },
+                            { value: 'add', label: '添加企业', disabled: !showRoad }
                           ]}
                         />
                       )}