From c4143d291e70b3ccff023a5a3e09f49889f5daa0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 十一月 2023 21:48:34 +0800 Subject: [PATCH] 2023-11-03 --- src/views/tabledesign/menuform/index.jsx | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx index 06fedc7..e1a70b1 100644 --- a/src/views/tabledesign/menuform/index.jsx +++ b/src/views/tabledesign/menuform/index.jsx @@ -1,12 +1,15 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, notification, Switch } from 'antd' +import { Form, Row, Col, Input, Select, notification, Switch, Radio } from 'antd' import Api from '@/api' -import options from '@/store/options.js' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { TextArea } = Input + +const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) +const SysColorSketch = asyncComponent(() => import('@/menu/stylecontroller/syscolorsketch')) class CustomMenuForm extends Component { static propTpyes = { @@ -25,11 +28,15 @@ } UNSAFE_componentWillMount () { + const { config } = this.props + if (sessionStorage.getItem('thdMenuList') && sessionStorage.getItem('fstMenuList')) { this.setMenus() } else { this.getMenus() } + + window.GLOB.process = config.process === 'true' } setMenus = () => { @@ -76,7 +83,7 @@ getMenus = () => { const { MenuId, config } = this.props - Api.getSystemConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { + Api.getCloudConfig({func: 's_get_pc_menus', systemType: window.GLOB.sysType, debug: 'Y'}).then(result => { if (result.status) { let thdMenu = null let thdMenuList = [] @@ -192,12 +199,12 @@ this.props.form.setFieldsValue({parentId: _id}) this.props.updateConfig({...config, fstMenuId: value, parentId: _id}) }) - } else if (key === 'parentId') { - this.props.updateConfig({...config, parentId: value}) - } else if (key === 'OpenType') { - this.props.updateConfig({...config, OpenType: value}) - } else if (key === 'hidden') { - this.props.updateConfig({...config, hidden: value}) + } else { + if (key === 'process') { + window.GLOB.process = value === 'true' + } + + this.props.updateConfig({...config, [key]: value}) } } @@ -333,6 +340,18 @@ </Form.Item> </Col> <Col span={24}> + <Form.Item label="宸ヤ綔娴�"> + {getFieldDecorator('process', { + initialValue: config.process || 'false' + })( + <Radio.Group onChange={(e) => {this.selectChange('process', e.target.value)}}> + <Radio value="true">浣跨敤</Radio> + <Radio value="false">涓嶄娇鐢�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={24}> <Form.Item label={'闅愯棌鑿滃崟'}> <Switch checkedChildren={'鏄�'} checked={config.hidden === 'true'} unCheckedChildren={'鍚�'} onChange={(value) => { this.selectChange('hidden', value + '') @@ -359,6 +378,16 @@ })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} </Form.Item> </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="鑿滃崟棰滆壊"> + <ColorSketch allowClear={true} value={config.menuColor || ''} onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="绯荤粺鑹�"> + <SysColorSketch onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> </Row> </Form> ) -- Gitblit v1.8.0