From a02fc6a77fa1b35c6516b2d37108d80e260c6c85 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 十一月 2024 22:05:08 +0800
Subject: [PATCH] 2024-11-07

---
 src/views/menudesign/menuform/index.jsx |   80 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 72 insertions(+), 8 deletions(-)

diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx
index 0a0e3ba..d8b2366 100644
--- a/src/views/menudesign/menuform/index.jsx
+++ b/src/views/menudesign/menuform/index.jsx
@@ -4,9 +4,13 @@
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
+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 +29,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 = () => {
@@ -42,6 +50,7 @@
     thdMenuList = JSON.parse(thdMenuList)
 
     let thdMenu = null
+    let firstId = ''
 
     thdMenuList.forEach(trd => {
       if (MenuId === trd.MenuID) {
@@ -57,17 +66,21 @@
           smenulist = item.children
         }
       })
+
+      firstId = thdMenu.FstId || ''
     }
 
-    this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''})
+    if (firstId !== config.fstMenuId) {
+      this.props.updateConfig({...config, fstMenuId: firstId})
+    }
 
     this.setState({
-      fstMenuId: thdMenu ? thdMenu.FstId : '',
+      fstMenuId: firstId,
       menulist,
       smenulist
     }, () => {
       this.props.form.setFieldsValue({
-        fstMenuId: thdMenu ? thdMenu.FstId : '',
+        fstMenuId: firstId,
         parentId: thdMenu ? thdMenu.ParentId : ''
       })
     })
@@ -112,14 +125,14 @@
                     EasyCode: trd.EasyCode,
                     value: trd.MenuID,
                     label: trd.MenuName,
-                    type: 'CommonTable',
+                    type: 'CustomPage',
                     disabled: false
                   }
 
                   if (trd.PageParam) {
                     try {
                       trd.PageParam = JSON.parse(trd.PageParam)
-                      trdItem.type = trd.PageParam.Template || 'CommonTable'
+                      trdItem.type = trd.PageParam.Template || 'CustomPage'
                     } catch (e) {
 
                     }
@@ -141,24 +154,29 @@
         })
 
         let smenulist = []
+        let firstId = ''
         if (thdMenu) {
           menulist.forEach(item => {
             if (item.MenuID === thdMenu.FstId) {
               smenulist = item.children
             }
           })
+          firstId = thdMenu.FstId || ''
         }
         sessionStorage.setItem('fstMenuList', JSON.stringify(menulist))
         sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList))
-        this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''})
+
+        if (firstId !== config.fstMenuId) {
+          this.props.updateConfig({...config, fstMenuId: firstId})
+        }
 
         this.setState({
-          fstMenuId: thdMenu ? thdMenu.FstId : '',
+          fstMenuId: firstId,
           menulist,
           smenulist
         }, () => {
           this.props.form.setFieldsValue({
-            fstMenuId: thdMenu ? thdMenu.FstId : '',
+            fstMenuId: firstId,
             parentId: thdMenu ? thdMenu.ParentId : ''
           })
         })
@@ -196,6 +214,8 @@
         if (typeof(value) !== 'number') {
           value = ''
         }
+      } else if (key === 'process') {
+        window.GLOB.process = value === 'true'
       }
       this.props.updateConfig({...config, [key]: value})
     }
@@ -318,6 +338,23 @@
               )}
             </Form.Item>
           </Col>
+          {config.permission !== 'false' ? <Col span={24}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="鏄惁妫�楠屽悗绔痵ql鐨勬潈闄愶紝浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                sql楠岃瘉
+              </Tooltip>
+            }>
+              {getFieldDecorator('sqlperm', {
+                initialValue: config.sqlperm || 'true'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('sqlperm', e.target.value)}}>
+                  <Radio value="true">浣跨敤</Radio>
+                  <Radio value="false">涓嶄娇鐢�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鏁版嵁浼氱紦瀛樺埌鐢ㄦ埛鏈湴锛屾柟渚块〉闈㈠揩閫熷憟鐜般��">
@@ -396,6 +433,23 @@
           </Col> : null}
           <Col span={24}>
             <Form.Item label={
+              <Tooltip placement="topLeft" title="寮�鍚悗鍙湪鎸夐挳鍙婃暟鎹簮璁剧疆娴佺▼鍙傛暟銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                宸ヤ綔娴�
+              </Tooltip>
+            }>
+              {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={
               <Tooltip placement="topLeft" title="鏁版嵁鍔犺浇鏃剁殑閬僵鏄惁鏄剧ず銆�">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鍔犺浇閬僵
@@ -452,6 +506,16 @@
               })(<TextArea rows={2} placeholder={''} onChange={(e) => {this.selectChange('Remark', e.target.value)}}/>)}
             </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