|
@@ -17,8 +17,6 @@ import RoleMenu from '../System/components/RoleMenu'
|
|
|
import ConnectModal from '../System/components/ConnectModal'
|
|
|
import FormItem from 'antd/lib/form/FormItem'
|
|
|
import { permData } from '../Customer'
|
|
|
-import styles from './index.less'
|
|
|
-import classNames from 'classnames'
|
|
|
import { PageContainer } from '@ant-design/pro-layout'
|
|
|
|
|
|
const Product = () => {
|
|
@@ -65,20 +63,20 @@ const Product = () => {
|
|
|
...formatPermission('init', result.permission)
|
|
|
}
|
|
|
// 特殊处理云版switch
|
|
|
- if (values.showBuilding || values.showCuring || values.showHighway || values.showGs) {
|
|
|
- values.showCloud = true
|
|
|
- delete values.showBuilding
|
|
|
- delete values.showCuring
|
|
|
- delete values.showHighway
|
|
|
- delete values.showGs
|
|
|
- }
|
|
|
+ // if (values.showBuilding || values.showCuring || values.showHighway || values.showGs) {
|
|
|
+ // values.showCloud = true
|
|
|
+ // delete values.showBuilding
|
|
|
+ // delete values.showCuring
|
|
|
+ // delete values.showHighway
|
|
|
+ // delete values.showGs
|
|
|
+ // }
|
|
|
|
|
|
// 特殊处理大司空2.0
|
|
|
- if (values.showPersonal || values.showEnterprise) {
|
|
|
- values.showRoad = true
|
|
|
- delete values.showPersonal
|
|
|
- delete values.showEnterprise
|
|
|
- }
|
|
|
+ // if (values.showPersonal || values.showEnterprise) {
|
|
|
+ // values.showRoad = true
|
|
|
+ // delete values.showPersonal
|
|
|
+ // delete values.showEnterprise
|
|
|
+ // }
|
|
|
|
|
|
setState({
|
|
|
...state,
|
|
@@ -237,87 +235,166 @@ const Product = () => {
|
|
|
/>
|
|
|
)}
|
|
|
</ProFormDependency>
|
|
|
- <ProFormSwitch
|
|
|
- fieldProps={{
|
|
|
- onChange(checked) {
|
|
|
- if (!checked) {
|
|
|
- formRef.current?.setFieldsValue({
|
|
|
- building: [],
|
|
|
- curing: [],
|
|
|
- highway: [],
|
|
|
- gs: []
|
|
|
- })
|
|
|
+ <div className="text-lg font-bold">云版管理</div>
|
|
|
+ <div className="ml-6">
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({
|
|
|
+ building: []
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }}
|
|
|
- name="showCloud"
|
|
|
- label={<span className="flex items-center">云版管理</span>}
|
|
|
- />
|
|
|
- <div className={classNames('ml-6', styles.laberContent)}>
|
|
|
- <ProFormDependency name={['showCloud']}>
|
|
|
- {({ showCloud }) => (
|
|
|
- <>
|
|
|
+ }}
|
|
|
+ name="showBuilding"
|
|
|
+ label={<span className="flex items-center">大司空云计价</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showBuilding']}>
|
|
|
+ {({ showBuilding }) => (
|
|
|
<ProFormCheckbox.Group
|
|
|
wrapperCol={{ offset: 1 }}
|
|
|
name="building"
|
|
|
- label="大司空云计价"
|
|
|
- options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
|
|
|
+ options={[
|
|
|
+ { value: 'access', label: '查看', disabled: !showBuilding }
|
|
|
+ ]}
|
|
|
/>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({
|
|
|
+ curing: []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ name="showCuring"
|
|
|
+ label={<span className="flex items-center">养护云造价</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showCuring']}>
|
|
|
+ {({ showCuring }) => (
|
|
|
<ProFormCheckbox.Group
|
|
|
wrapperCol={{ offset: 1 }}
|
|
|
name="curing"
|
|
|
- label="养护云造价"
|
|
|
- options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
|
|
|
+ options={[
|
|
|
+ { value: 'access', label: '查看', disabled: !showCuring }
|
|
|
+ ]}
|
|
|
/>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({
|
|
|
+ highway: []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ name="showHighway"
|
|
|
+ label={<span className="flex items-center">公路云计价</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showHighway']}>
|
|
|
+ {({ showHighway }) => (
|
|
|
<ProFormCheckbox.Group
|
|
|
wrapperCol={{ offset: 1 }}
|
|
|
name="highway"
|
|
|
- label="公路云计价"
|
|
|
- options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
|
|
|
- />
|
|
|
- <ProFormCheckbox.Group
|
|
|
- wrapperCol={{ offset: 1 }}
|
|
|
- name="gs"
|
|
|
- label="大司空概算"
|
|
|
- options={[{ value: 'access', label: '查看', disabled: !showCloud }]}
|
|
|
+ options={[
|
|
|
+ { value: 'access', label: '查看', disabled: !showHighway }
|
|
|
+ ]}
|
|
|
/>
|
|
|
- </>
|
|
|
- )}
|
|
|
- </ProFormDependency>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({
|
|
|
+ gs: []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ name="showGs"
|
|
|
+ label={<span className="flex items-center">大司空概算</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showGs']}>
|
|
|
+ {({ showGs }) => (
|
|
|
+ <>
|
|
|
+ <ProFormCheckbox.Group
|
|
|
+ wrapperCol={{ offset: 1 }}
|
|
|
+ name="gs"
|
|
|
+ options={[{ value: 'access', label: '查看', disabled: !showGs }]}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <ProFormSwitch
|
|
|
- fieldProps={{
|
|
|
- onChange(checked) {
|
|
|
- if (!checked) {
|
|
|
- formRef.current?.setFieldsValue({ personal: [], enterprise: [] })
|
|
|
+ <div className="text-lg font-bold">大司空2.0</div>
|
|
|
+ <div className="ml-6">
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({ personal: [] })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }}
|
|
|
- name="showRoad"
|
|
|
- label={<span className="flex items-center">大司空2.0</span>}
|
|
|
- />
|
|
|
- <div className={['ml-6', styles.laberContent].join(' ')}>
|
|
|
- <ProFormDependency name={['showRoad']}>
|
|
|
- {({ showRoad }) => (
|
|
|
- <>
|
|
|
+ }}
|
|
|
+ name="showPersonal"
|
|
|
+ label={<span className="flex items-center">个人版</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showPersonal']}>
|
|
|
+ {({ showPersonal }) => (
|
|
|
<ProFormCheckbox.Group
|
|
|
wrapperCol={{ offset: 1 }}
|
|
|
name="personal"
|
|
|
- label="个人版"
|
|
|
- options={[{ value: 'access', label: '查看', disabled: !showRoad }]}
|
|
|
- />
|
|
|
- <ProFormCheckbox.Group
|
|
|
- wrapperCol={{ offset: 1 }}
|
|
|
- name="enterprise"
|
|
|
- label="企业版"
|
|
|
options={[
|
|
|
- { value: 'access', label: '查看', disabled: !showRoad },
|
|
|
- { value: 'add', label: '添加企业', disabled: !showRoad }
|
|
|
+ { value: 'access', label: '查看', disabled: !showPersonal }
|
|
|
]}
|
|
|
/>
|
|
|
- </>
|
|
|
- )}
|
|
|
- </ProFormDependency>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
+ <ProFormSwitch
|
|
|
+ fieldProps={{
|
|
|
+ onChange(checked) {
|
|
|
+ if (!checked) {
|
|
|
+ formRef.current?.setFieldsValue({ enterprise: [] })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ name="showEnterprise"
|
|
|
+ label={<span className="flex items-center">企业版</span>}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <ProFormDependency name={['showEnterprise']}>
|
|
|
+ {({ showEnterprise }) => (
|
|
|
+ <>
|
|
|
+ <ProFormCheckbox.Group
|
|
|
+ wrapperCol={{ offset: 1 }}
|
|
|
+ name="enterprise"
|
|
|
+ options={[
|
|
|
+ { value: 'access', label: '查看', disabled: !showEnterprise },
|
|
|
+ { value: 'add', label: '添加企业', disabled: !showEnterprise }
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </ProFormDependency>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</ProForm>
|
|
|
)}
|