From 7a6874905fa9c6cec03040b29c455db7e81fb22e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 01 十二月 2023 16:04:50 +0800
Subject: [PATCH] 2023-12-01

---
 src/tabviews/zshare/mutilform/index.jsx   |    2 +-
 public/manifest.json                      |    2 +-
 src/tabviews/zshare/fileupload/index.jsx  |   15 +++++++++++----
 src/tabviews/zshare/fileupload/index.scss |    3 +++
 src/views/menudesign/index.jsx            |    4 ++++
 src/utils/utils.js                        |   13 +++++++++++--
 6 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/public/manifest.json b/public/manifest.json
index d3654ec..63c5ebb 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -6,5 +6,5 @@
   "display": "standalone",
   "theme_color": "#000000",
   "background_color": "#ffffff",
-  "mk_version": "20230712"
+  "mk_version": "20231201"
 }
diff --git a/src/tabviews/zshare/fileupload/index.jsx b/src/tabviews/zshare/fileupload/index.jsx
index 704ea1e..ebf75f0 100644
--- a/src/tabviews/zshare/fileupload/index.jsx
+++ b/src/tabviews/zshare/fileupload/index.jsx
@@ -12,8 +12,9 @@
 
 class FileUpload extends Component {
   static propTpyes = {
-    config: PropTypes.object,  // 琛ㄥ崟淇℃伅
-    onChange: PropTypes.func,  // 琛ㄥ崟鍙樺寲
+    data: PropTypes.any,
+    config: PropTypes.object,
+    onChange: PropTypes.func,
   }
 
   state = {
@@ -31,7 +32,7 @@
   }
 
   UNSAFE_componentWillMount () {
-    const { config } = this.props
+    const { config, data } = this.props
 
     let filelist = []
     if (config.initval) {
@@ -56,6 +57,12 @@
           })
         } catch (e) {
           filelist = []
+        }
+
+        if (data && config.subFields && config.subFields.length === 1 && filelist.length === 1) {
+          if (data[config.subFields[0].field]) {
+            filelist[0].name = data[config.subFields[0].field]
+          }
         }
       }
     }
@@ -270,7 +277,7 @@
       percent: 0
     })
 
-    let file_name = file.name.replace(/\.{1}[^.]*$/ig, '')
+    let file_name = file.name
 
     if (compress === 'true' || compress === 'base64') {
       let reader = new FileReader()
diff --git a/src/tabviews/zshare/fileupload/index.scss b/src/tabviews/zshare/fileupload/index.scss
index 86f8505..79b4608 100644
--- a/src/tabviews/zshare/fileupload/index.scss
+++ b/src/tabviews/zshare/fileupload/index.scss
@@ -34,6 +34,9 @@
       display: none;
     }
   }
+  .ant-upload-list-item-card-actions {
+    opacity: 1;
+  }
 }
 .fileupload-form-container.limit-fileupload {
   > .ant-upload {
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 82eb85d..970a9c0 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -1244,7 +1244,7 @@
         } else if (item.type === 'fileupload') {
           className = item.readonly ? 'readonly' : ''
           className += item.fileType === 'picture-card' ? ' file-upload' : ''
-          content = (<MKFileUpload config={item} onChange={(val, other = {}) => this.recordChange({[item.field]: val, ...other})} />)
+          content = (<MKFileUpload config={item} data={this.record} onChange={(val, other = {}) => this.recordChange({[item.field]: val, ...other})} />)
         } else if (item.type === 'textarea') {
           content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>)
         } else if (item.type === 'rate') {
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 438788a..6754540 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1118,10 +1118,19 @@
 
     let _insert = ''
     if (btn.default !== 'false') {
+      let _fields = []
+      btn.columns.forEach(col => {
+        if (col.import === 'false' || col.import === 'init') return
+
+        _fields.push(col.Column)
+      })
+
+      _fields = _fields.join(',')
+
       _insert = `
       /* 榛樿sql */
-      Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) 
-      Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet}
+      Insert into ${database}${sheet} (${_fields},createuserid,createuser,createstaff,bid) 
+      Select ${_fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet}
       `
     }
 
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 6b757ea..81fa513 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -749,6 +749,10 @@
         config.components = this.resetSyncQuery(config.components)
       }
 
+      if (config.MenuID === 'home_page_id') {
+        config.permission = 'false'
+      }
+
       let tbs = []
       let btns = this.getMenuMessage(config, tbs)
       let arr = []

--
Gitblit v1.8.0