From d2fd67a1bcec35db7870f55a83a25c043ae854f8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 06 九月 2023 15:58:16 +0800
Subject: [PATCH] 2023-09-06

---
 src/index.js                                                           |   24 +++---
 src/menu/components/card/double-data-card/options.jsx                  |   13 +++
 src/menu/components/table/normal-table/options.jsx                     |   13 +++
 src/menu/components/card/data-card/options.jsx                         |   13 +++
 src/tabviews/zshare/topSearch/index.jsx                                |   15 +++
 src/menu/components/table/base-table/options.jsx                       |   14 +++
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx  |   56 +++++++++++--
 src/tabviews/custom/components/table/edit-table/normalTable/index.scss |    3 
 src/menu/components/table/edit-table/options.jsx                       |   15 +++
 src/views/systemfunc/index.jsx                                         |    6 +
 src/menu/components/search/main-search/options.jsx                     |   13 +++
 src/menu/components/table/edit-table/index.jsx                         |    2 
 src/menu/components/calendar/options.jsx                               |   13 +++
 src/utils/utils.js                                                     |    8 ++
 14 files changed, 180 insertions(+), 28 deletions(-)

diff --git a/src/index.js b/src/index.js
index d95a353..addc05c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -110,18 +110,6 @@
       GLOB.mainSystemApi = ''
     }
 
-    if (/#\/hs$/.test(window.location.href)) { // hs涓嬩笉鎵撳嵃鑴氭湰
-      GLOB.debugger = false
-
-      if (GLOB.mainSystemApi) {
-        GLOB.localSystemApi = GLOB.mainSystemApi
-        GLOB.mainSystemApi = ''
-      }
-      if (GLOB.cloudServiceApi) {
-        GLOB.mainSystemApi = GLOB.cloudServiceApi
-      }
-    }
-
     if (GLOB.sysType !== 'cloud') {
       if (config.appkey === options.cakey) {
         document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">涓嶅彲浣跨敤浜戠appkey锛岃鑱旂郴绠$悊鍛橈紒</div>'
@@ -153,6 +141,18 @@
       }
     }
 
+    if (/#\/hs$/.test(window.location.href)) { // hs涓嬩笉鎵撳嵃鑴氭湰
+      GLOB.debugger = false
+
+      if (GLOB.mainSystemApi) {
+        GLOB.localSystemApi = GLOB.mainSystemApi
+        GLOB.mainSystemApi = ''
+      }
+      if (GLOB.cloudServiceApi) {
+        GLOB.mainSystemApi = GLOB.cloudServiceApi
+      }
+    }
+
     let _href = window.location.href.split('#')[0]
     let _systemMsg = localStorage.getItem(_href + 'system')
     let className = 'mk-blue-black'
diff --git a/src/menu/components/calendar/options.jsx b/src/menu/components/calendar/options.jsx
index 3ab3730..f7ae8e9 100644
--- a/src/menu/components/calendar/options.jsx
+++ b/src/menu/components/calendar/options.jsx
@@ -131,6 +131,19 @@
     },
     {
       type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !!appType || isprint
+    },
+    {
+      type: 'radio',
       field: 'click',
       label: '鐐瑰嚮浜嬩欢',
       initval: wrap.click || '',
diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 519af8e..adc2931 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -564,6 +564,19 @@
       forbid: ispop || isprint
     },
     {
+      type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !!appType || isprint
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/menu/components/card/double-data-card/options.jsx b/src/menu/components/card/double-data-card/options.jsx
index 82a6258..dac4c9e 100644
--- a/src/menu/components/card/double-data-card/options.jsx
+++ b/src/menu/components/card/double-data-card/options.jsx
@@ -240,6 +240,19 @@
       forbid: ispop || isprint
     },
     {
+      type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !!appType || isprint
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/menu/components/search/main-search/options.jsx b/src/menu/components/search/main-search/options.jsx
index c1cd29d..8228b2b 100644
--- a/src/menu/components/search/main-search/options.jsx
+++ b/src/menu/components/search/main-search/options.jsx
@@ -155,6 +155,19 @@
       forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
     },
     {
+      type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !!appType
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/menu/components/table/base-table/options.jsx b/src/menu/components/table/base-table/options.jsx
index 3db5e1e..775a39c 100644
--- a/src/menu/components/table/base-table/options.jsx
+++ b/src/menu/components/table/base-table/options.jsx
@@ -199,7 +199,19 @@
       initval: wrap.controlVal || '',
       tooltip: '褰撳瓧娈靛�间笌绂佺敤鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�',
       required: false
-    }
+    },
+    {
+      type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ]
+    },
   ]
 
   return wrapForm
diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx
index 9aed6ca..f211286 100644
--- a/src/menu/components/table/edit-table/index.jsx
+++ b/src/menu/components/table/edit-table/index.jsx
@@ -323,7 +323,7 @@
             <PlusOutlined className="plus" title="娣诲姞鍒�" onClick={this.addColumns}/>
             {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null}
             <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/>
-            <NormalForm title="琛ㄦ牸璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
+            <NormalForm title="琛ㄦ牸璁剧疆" width={900} update={this.updateWrap} getForms={this.getWrapForms}>
               <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
             </NormalForm>
             <CopyComponent type="editable" card={card}/>
diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx
index 9fd58b0..18fc7a4 100644
--- a/src/menu/components/table/edit-table/options.jsx
+++ b/src/menu/components/table/edit-table/options.jsx
@@ -111,6 +111,9 @@
         {value: 'all', label: '鍏ㄩ儴'},
         {value: 'change', label: '淇敼椤�'},
         {value: 'simple', label: '鍗曢」'},
+      ],
+      controlFields: [
+        {field: 'standard', values: ['change', 'simple']},
       ]
     },
     // {
@@ -139,6 +142,18 @@
     },
     {
       type: 'radio',
+      field: 'standard',
+      label: '淇敼鏍囧噯',
+      initval: wrap.standard || 'init',
+      tooltip: '濡備綍鍒ゆ柇琛屼俊鎭槸鍚﹀簲璇ユ彁浜ゃ��',
+      required: false,
+      options: [
+        {value: 'init', label: '涓庡垵濮嬪�间笉鍚�'},
+        {value: 'change', label: '瀛樺湪缂栬緫鐥曡抗'},
+      ]
+    },
+    {
+      type: 'radio',
       field: 'cache',
       label: '缂撳瓨',
       initval: wrap.cache || 'true',
diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx
index 8ab9460..8b1eae1 100644
--- a/src/menu/components/table/normal-table/options.jsx
+++ b/src/menu/components/table/normal-table/options.jsx
@@ -293,6 +293,19 @@
       forbid: ispop || isprint
     },
     {
+      type: 'radio',
+      field: 'cacheSearch',
+      label: '鎼滅储缂撳瓨',
+      initval: wrap.cacheSearch || 'false',
+      tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !!appType || isprint
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 71db29c..4ce4d1b 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -4,6 +4,7 @@
 import { Table, Typography, Modal, Input, InputNumber, Button, notification, message, Select } from 'antd'
 import { EditOutlined, QuestionCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
+import md5 from 'md5'
 
 import Api from '@/api'
 import asyncComponent from '@/utils/asyncComponent'
@@ -947,6 +948,7 @@
     pageSize: 10,         // 姣忛〉鏁版嵁鏉℃暟
     columns: null,        // 鏄剧ず鍒�
     forms: [],
+    signForms: [],
     orderfields: {},      // 鎺掑簭id涓巉ield杞崲
     loading: false,
     pageOptions: [],
@@ -963,6 +965,7 @@
     let deForms = []
     let _forms = {}
     let hasBid = false
+    let signForms = []
 
     let getColumns = (cols) => {
       return cols.map(item => {
@@ -974,6 +977,8 @@
         } else {
           if (item.editable === 'true') {
             _forms[item.field] = item
+
+            signForms.push(item.field)
 
             if (item.ctrlField) {
               item.ctrlValue = item.ctrlValue.split(',')
@@ -1046,6 +1051,7 @@
 
     this.setState({
       forms,
+      signForms,
       pageSize: setting.pageSize || 10,
       pageOptions,
       columns: _columns,
@@ -1108,10 +1114,28 @@
   }
 
   transferData = (menuid, data, type) => {
-    const { MenuID } = this.props
-    const { edData } = this.state
+    const { MenuID, setting } = this.props
+    const { edData, signForms } = this.state
 
     if (menuid !== MenuID) return
+
+    if (setting.commit !== 'all' && setting.standard !== 'change') {
+      if (type !== 'line') {
+        data.forEach(item => {
+          let value = ''
+          signForms.forEach(field => {
+            value += item[field]
+          })
+          item.$sign = md5(value)
+        })
+      } else {
+        let value = ''
+        signForms.forEach(field => {
+          value += data[field]
+        })
+        data.$sign = md5(value)
+      }
+    }
 
     if (type !== 'line') {
       let index = edData.findIndex(item => !item.$origin && !item.$forbid)
@@ -1461,19 +1485,31 @@
 
   changeRecord = (id, record) => {
     const { setting } = this.props
-    const { tableId } = this.state
+    const { tableId, signForms } = this.state
 
     if (id !== tableId) return
 
-    let lock = record.$lock
+    if (!record.$sign) {
+      record.$origin = false
+      record.$lock = true
+      delete record.$forbid
+    } else {
+      let value = ''
+      signForms.forEach(field => {
+        value += record[field]
+      })
+
+      if (record.$sign !== md5(value)) {
+        record.$origin = false
+        record.$lock = true
+      } else {
+        record.$origin = true
+        record.$lock = false
+      }
+    }
 
     let _data = this.state.edData.map(item => {
       if (item.$$uuid === record.$$uuid) {
-        record.$origin = false
-        record.$lock = true
-
-        delete record.$forbid
-
         return record
       } else {
         return item
@@ -1481,7 +1517,7 @@
     })
 
     this.setState({edData: _data}, () => {
-      if (setting.tableType && setting.hasAction && !lock && this.state.selectedRowKeys.includes(record.$$uuid)) {
+      if (setting.tableType && setting.hasAction && this.state.selectedRowKeys.includes(record.$$uuid)) {
         this.selectdata(this.state.selectedRowKeys)
       }
     })
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
index 9fcaf63..873f7e7 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -254,6 +254,9 @@
     border-color: var(--mk-table-border-color)!important;
   }
   table tr {
+    th .ant-table-column-title {
+      position: unset!important;
+    }
     th .ant-table-column-title, th .ant-table-column-title span:not(.anticon) {
       font-size: var(--mk-table-font-size)!important;
       font-weight: var(--mk-table-font-weight)!important;
diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index 6666d61..7b3a720 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -669,6 +669,8 @@
   }
 
   handleSubmit = () => {
+    const { config } = this.props
+
     this.setState({}, () => {
       this.props.form.validateFields((err, values) => {
         if (err) return
@@ -706,11 +708,20 @@
           this.sign = ''
         }, 2000)
         
+        if (config.wrap && config.wrap.cacheSearch === 'true') {
+          let _values = {}
+          searches.forEach(item => {
+            _values[item.key] = item.value
+          })
+  
+          window.GLOB.SearchBox.set(config.$searchId + 'cache', _values)
+        }
+
         if (this.props.refreshdata) {
           this.props.refreshdata(searches)
         } else {
-          window.GLOB.SearchBox.set(this.props.config.$searchId, searches)
-          MKEmitter.emit('searchRefresh', this.props.config.$searchId)
+          window.GLOB.SearchBox.set(config.$searchId, searches)
+          MKEmitter.emit('searchRefresh', config.$searchId)
         }
       })
     })
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 44c6a54..247f4b3 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -275,6 +275,10 @@
     let roleId = sessionStorage.getItem('role_id') || ''
     let required = false
     let keys = []
+    let values = null
+    if (config.wrap && config.wrap.cacheSearch === 'true') {
+      values = window.GLOB.SearchBox.get(config.$searchId + 'cache')
+    }
 
     config.search = config.search.map(item => {
       item.hidden = item.Hide === 'true'
@@ -387,6 +391,10 @@
       
       item.oriInitval = item.initval
 
+      if (values) {
+        item.initval = values[item.field] || ''
+      }
+
       if (item.blacklist && item.blacklist.length > 0 && !item.hidden) {
         if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
           item.hidden = true
diff --git a/src/views/systemfunc/index.jsx b/src/views/systemfunc/index.jsx
index 109d291..63bee5f 100644
--- a/src/views/systemfunc/index.jsx
+++ b/src/views/systemfunc/index.jsx
@@ -17,8 +17,10 @@
     if (!sessionStorage.getItem('UserID')) {
       this.props.history.replace('/login')
     } else {
-      sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID'))
-      sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID'))
+      if (!sessionStorage.getItem('LocalUserID')) {
+        sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID'))
+        sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID'))
+      }
       sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id'))
       sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM'))
       sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName'))

--
Gitblit v1.8.0