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/menudesign/homeform/index.jsx |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/views/menudesign/homeform/index.jsx b/src/views/menudesign/homeform/index.jsx
index 4454c32..2b253e7 100644
--- a/src/views/menudesign/homeform/index.jsx
+++ b/src/views/menudesign/homeform/index.jsx
@@ -99,20 +99,13 @@
   selectChange = (key, value) => {
     const { config } = this.props
 
-    if (key === 'cacheUseful') {
-      this.props.updateConfig({...config, cacheUseful: value})
-    } else if (key === 'timeUnit') {
-      this.props.updateConfig({...config, timeUnit: value})
-    } else if (key === 'cacheLocal') {
-      this.props.updateConfig({...config, cacheLocal: value})
+    if (key === 'cacheTime' || key === 'localCacheTime') {
+      if (typeof(value) !== 'number') {
+        value = ''
+      }
     }
-  }
-
-  changeCacheDay = (val) => {
-    if (typeof(val) !== 'number') {
-      val = ''
-    }
-    this.props.updateConfig({...this.props.config, cacheTime: val})
+    
+    this.props.updateConfig({...config, [key]: value})
   }
 
   render() {
@@ -149,6 +142,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="瀵逛簬涓嶇粡甯告�у彉鍔ㄧ殑淇℃伅锛岀紦瀛樻暟鎹湁鍔╀簬鎻愰珮鏌ヨ鏁堢巼銆�">
@@ -190,7 +197,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}

--
Gitblit v1.8.0