From 2a3cc4e6cecfc6dab8b60adf93f7fde898ddc939 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 25 七月 2023 16:36:23 +0800
Subject: [PATCH] 2023-07-25

---
 src/views/mobdesign/menuform/index.jsx |   57 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx
index b6371cf..49d4013 100644
--- a/src/views/mobdesign/menuform/index.jsx
+++ b/src/views/mobdesign/menuform/index.jsx
@@ -22,34 +22,23 @@
 
   // 涓�浜岀骇鑿滃崟鍒囨崲
   selectChange = (key, value, hex) => {
+    if (key === 'cacheTime' || key === 'localCacheTime') {
+      if (typeof(value) !== 'number') {
+        value = ''
+      }
+    }
+
     let _config = {...this.props.config, [key]: value}
 
-    if (key === 'statusBarbgColor' && hex) {
-      _config.statusBarHexColor = hex
+    if (key === 'statusBarbgColor') { // 灏忕▼搴忕姸鎬佹爮
+      if (hex) {
+        _config.statusBarHexColor = hex
+      } else {
+        delete _config.statusBarHexColor
+      }
     }
 
     this.props.updateConfig(_config)
-  }
-
-  // 鑿滃崟鍚嶇О
-  changeName = (e) => {
-    this.props.updateConfig({...this.props.config, MenuName: e.target.value})
-  }
-
-  // 鑿滃崟鍙傛暟
-  changeNo = (e) => {
-    this.props.updateConfig({...this.props.config, MenuNo: e.target.value})
-  }
-
-  changeRemark = (e) => {
-    this.props.updateConfig({...this.props.config, Remark: e.target.value})
-  }
-
-  changeCacheDay = (val) => {
-    if (typeof(val) !== 'number') {
-      val = ''
-    }
-    this.props.updateConfig({...this.props.config, cacheTime: val})
   }
 
   render() {
@@ -79,7 +68,7 @@
                     message: '璇疯緭鍏ヨ彍鍗曞悕绉�!'
                   }
                 ]
-              })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)}
+              })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('MenuName', e.target.value)}}/>)}
             </Form.Item>
           </Col>
           <Col span={24}>
@@ -92,7 +81,7 @@
                     message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!'
                   }
                 ]
-              })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)}
+              })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('MenuNo', e.target.value)}}/>)}
             </Form.Item>
           </Col>
           <Col span={24}>
@@ -112,6 +101,20 @@
               )}
             </Form.Item>
           </Col>
+          {config.cacheLocal === 'true' ? <Col span={24}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="璁剧疆鏈湴缂撳瓨鏃堕暱鍚庯紝鍦ㄧ紦瀛樻湡闄愬唴涓嶅悜鍚庡彴璇锋眰鏁版嵁锛屾椂闀挎渶澶т负5澶╋紙鍗�7200鍒嗛挓锛夈�傛敞锛氭椂闀夸负绌烘椂缂撳瓨鏁版嵁鍙敤浜庨〉闈㈠揩閫熷憟鐜帮紝涓嶅奖鍝嶆帴鍙h姹傘��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鏃堕暱(鍒�)
+              </Tooltip>
+            }>
+              {getFieldDecorator('localCacheTime', {
+                initialValue: config.localCacheTime
+              })(
+                <InputNumber min={1} max={7200} precision={0} onChange={(val) => {this.selectChange('localCacheTime', val)}}/>
+              )}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="瀵逛簬涓嶇粡甯告�у彉鍔ㄧ殑淇℃伅锛岀紦瀛樻暟鎹湁鍔╀簬鎻愰珮鏌ヨ鏁堢巼銆�">
@@ -187,7 +190,7 @@
                   }
                 ]
               })(
-                <InputNumber min={1} max={config.timeUnit === 'day' ? 7 : (config.timeUnit === 'hour' ? 23 : 59)} precision={0} onChange={this.changeCacheDay}/>
+                <InputNumber min={1} max={config.timeUnit === 'day' ? 7 : (config.timeUnit === 'hour' ? 23 : 59)} precision={0} onChange={(val) => {this.selectChange('cacheTime', val)}}/>
               )}
             </Form.Item>
           </Col> : null}
@@ -342,7 +345,7 @@
                     message: '澶囨敞鏈�澶�512涓瓧绗︼紒'
                   }
                 ]
-              })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)}
+              })(<TextArea rows={2} placeholder={''} onChange={(e) => {this.selectChange('Remark', e.target.value)}}/>)}
             </Form.Item>
           </Col>
         </Row>

--
Gitblit v1.8.0