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 |   64 ++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx
index 5d5f785..e1a70b1 100644
--- a/src/views/tabledesign/menuform/index.jsx
+++ b/src/views/tabledesign/menuform/index.jsx
@@ -1,13 +1,15 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Select, notification, Radio, Tooltip, Switch } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+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 = {
@@ -26,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 = () => {
@@ -77,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 = []
@@ -193,16 +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 === 'timeUnit') {
-      this.props.updateConfig({...config, timeUnit: value})
-    } else if (key === 'OpenType') {
-      this.props.updateConfig({...config, OpenType: value})
-    } else if (key === 'hidden') {
-      this.props.updateConfig({...config, hidden: value})
-    } else if (key === 'permission') {
-      this.props.updateConfig({...config, permission: value})
+    } else {
+      if (key === 'process') {
+        window.GLOB.process = value === 'true'
+      }
+
+      this.props.updateConfig({...config, [key]: value})
     }
   }
 
@@ -329,24 +331,20 @@
                   }
                 ]
               })(
-                <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}>
-                  <Radio value="newtab">鏍囩椤�</Radio>
-                  <Radio value="newpage">鏂伴〉闈�</Radio>
-                </Radio.Group>
+                <Select onChange={(value) => {this.selectChange('OpenType', value)}}>
+                  <Select.Option value="newtab">鏍囩椤�</Select.Option>
+                  <Select.Option value="newpage">鏂伴〉闈紙鏍囩椤碉級</Select.Option>
+                  <Select.Option value="view">鏂伴〉闈紙鍏ㄥ睆锛�</Select.Option>
+                </Select>
               )}
             </Form.Item>
           </Col>
           <Col span={24}>
-            <Form.Item label={
-              <Tooltip placement="topLeft" title="璺宠繃鏉冮檺楠岃瘉鏃讹紝椤甸潰涓粍浠跺強鎸夐挳涓嶅湪杩涜鏉冮檺鎺у埗銆�">
-                <QuestionCircleOutlined className="mk-form-tip" />
-                鏉冮檺楠岃瘉
-              </Tooltip>
-            }>
-              {getFieldDecorator('permission', {
-                initialValue: config.permission || 'true'
+            <Form.Item label="宸ヤ綔娴�">
+              {getFieldDecorator('process', {
+                initialValue: config.process || 'false'
               })(
-                <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}>
+                <Radio.Group onChange={(e) => {this.selectChange('process', e.target.value)}}>
                   <Radio value="true">浣跨敤</Radio>
                   <Radio value="false">涓嶄娇鐢�</Radio>
                 </Radio.Group>
@@ -367,7 +365,7 @@
               })(<Input placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>)}
             </Form.Item>
           </Col>
-          <Col span={24}>
+          <Col span={24} className="red-font">
             <Form.Item label="澶囨敞">
               {getFieldDecorator('Remark', {
                 initialValue: config.Remark || '',
@@ -380,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