From 997082a283ee77f89bc5f2243fd160200c8c10fa Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 24 三月 2025 18:10:10 +0800
Subject: [PATCH] Merge branch 'positec' into bms

---
 src/menu/components/card/cardsimplecomponent/index.jsx |   12 +++++
 src/menu/datasource/index.jsx                          |   10 ++--
 src/tabviews/zshare/mutilform/index.jsx                |    3 +
 src/templates/zshare/modalform/index.jsx               |    1 
 src/tabviews/zshare/actionList/normalbutton/index.jsx  |    9 +++-
 src/templates/zshare/verifycard/index.jsx              |    2 
 src/templates/zshare/codemirror/index.jsx              |    3 +
 src/menu/components/card/doublecardcomponent/index.jsx |   12 +++++
 src/menu/components/card/cardcomponent/index.jsx       |   12 +++++
 src/menu/datasource/verifycard/index.jsx               |   12 +++---
 src/assets/css/main.scss                               |    4 +
 src/tabviews/zshare/actionList/printbutton/index.jsx   |    9 +++-
 12 files changed, 69 insertions(+), 20 deletions(-)

diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss
index b7610c8..45a87cf 100644
--- a/src/assets/css/main.scss
+++ b/src/assets/css/main.scss
@@ -680,7 +680,9 @@
   }
 
   .ant-calendar-selected-day .ant-calendar-date {
-    background: var(--mk-sys-color2);
+    background: var(--mk-sys-color1);
+    color: var(--mk-sys-color);
+    border-color: var(--mk-sys-color);
   }
   .ant-calendar-today-btn {
     color: var(--mk-sys-color);
diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx
index ea2add7..c5d5222 100644
--- a/src/menu/components/card/cardcomponent/index.jsx
+++ b/src/menu/components/card/cardcomponent/index.jsx
@@ -294,12 +294,22 @@
           field: item.field || '',
           width: item.span || 12,
           value: '',
-          style: {marginBottom: '15px'}
+          style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}
         }
 
         if (item.type === 'number') {
           cell.eleType = 'number'
           cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : ''
+        } else if (item.type === 'split') {
+          cell.width = 24
+          cell.prefix = ''
+          cell.value = item.label || ''
+          cell.style = {
+            color: '#1890ff',
+            marginBottom: '15px',
+            borderBottomWidth: '1px',
+            borderBottomColor: '#e9e9e9'
+          }
         }
 
         items.push(cell)
diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx
index c30754d..e22187a 100644
--- a/src/menu/components/card/cardsimplecomponent/index.jsx
+++ b/src/menu/components/card/cardsimplecomponent/index.jsx
@@ -210,12 +210,22 @@
           field: item.field || '',
           width: item.span || 12,
           value: '',
-          style: {marginBottom: '15px'}
+          style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}
         }
 
         if (item.type === 'number') {
           cell.eleType = 'number'
           cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : ''
+        } else if (item.type === 'split') {
+          cell.width = 24
+          cell.prefix = ''
+          cell.value = item.label || ''
+          cell.style = {
+            color: '#1890ff',
+            marginBottom: '15px',
+            borderBottomWidth: '1px',
+            borderBottomColor: '#e9e9e9'
+          }
         }
 
         items.push(cell)
diff --git a/src/menu/components/card/doublecardcomponent/index.jsx b/src/menu/components/card/doublecardcomponent/index.jsx
index 0507417..ae09b62 100644
--- a/src/menu/components/card/doublecardcomponent/index.jsx
+++ b/src/menu/components/card/doublecardcomponent/index.jsx
@@ -231,12 +231,22 @@
           field: item.field || '',
           width: item.span || 12,
           value: '',
-          style: {marginBottom: '15px'}
+          style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}
         }
 
         if (item.type === 'number') {
           cell.eleType = 'number'
           cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : ''
+        } else if (item.type === 'split') {
+          cell.width = 24
+          cell.prefix = ''
+          cell.value = item.label || ''
+          cell.style = {
+            color: '#1890ff',
+            marginBottom: '15px',
+            borderBottomWidth: '1px',
+            borderBottomColor: '#e9e9e9'
+          }
         }
 
         items.push(cell)
diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx
index 661db31..591a092 100644
--- a/src/menu/datasource/index.jsx
+++ b/src/menu/datasource/index.jsx
@@ -93,13 +93,13 @@
     } else if (config.type === 'interface') {
       menu.components.forEach(item => {
         if (item.type !== 'search') return
-        search = item.search
+        search = item.search || []
       })
     } else {
       let filterComponent = (box, mainSearch) => {
         box.components.forEach(item => {
           if (item.type !== 'search') return
-          mainSearch = item.search
+          mainSearch = item.search || []
         })
         let has = false
         box.components.forEach(item => {
@@ -136,10 +136,10 @@
   }
 
   verifySubmit = () => {
-    const { config } = this.props
+    const { config, mainSearch } = this.props
 
     this.setState({loading: true})
-    this.verifyRef.submitDataSource().then((res, hasMSearch) => {
+    this.verifyRef.submitDataSource().then((res) => {
 
       let MenuType = sessionStorage.getItem('MenuType')
 
@@ -340,7 +340,7 @@
         }, 150)
       }
 
-      if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && !hasMSearch) {
+      if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && mainSearch.length === 0) {
         Modal.warning({
           title: '鏁版嵁婧愪腑浣跨敤浜嗗閮ㄦ悳绱紝浣嗘悳绱㈡潯浠跺皻鏈坊鍔狅紒',
           centered: true
diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 3e7cbd2..5877c89 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -270,7 +270,7 @@
       searches: formatSearch(search),
       searchKey: '',
       debugId: _setting.debugId || '',
-      hasMainSearch: mainSearch && mainSearch.length,
+      hasMainSearch: mainSearch && mainSearch.length > 0,
       oriConfig: fromJS({
         scripts,
         columns: columns,
@@ -574,7 +574,7 @@
 
   submitDataSource = () => {
     const { config, mainSearch } = this.props
-    const { activeKey, setting, columns, subColumns, scripts, cols, median, searches, hasMainSearch } = this.state
+    const { activeKey, setting, columns, subColumns, scripts, cols, median, searches } = this.state
 
     if (config.subtype === 'dualdatacard') {
       let arr = columns.map(col => col.field.toLowerCase())
@@ -645,7 +645,7 @@
             searches: _searches,
             setting: res
           }, () => {
-            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }, hasMainSearch) }, reject, 'submit')
+            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }) }, reject, 'submit')
           })
         }, () => {
           reject()
@@ -660,7 +660,7 @@
           reject()
           return
         }
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       } else if (activeKey === 'subcolumns') {
         if (this.subdatasource && this.subdatasource.state.editingKey) {
           notification.warning({
@@ -671,9 +671,9 @@
           reject()
           return
         }
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       } else if (activeKey === 'scripts') {
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       }
     })
   }
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index d903d9e..fcd5a10 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -4131,8 +4131,13 @@
             _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
           }
         }
-        if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲
-          _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || ''))
+        if (_item.type === 'text') {
+          if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲
+            _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || ''))
+          }
+          if (/@currentYear@/ig.test(_item.value)) { // 绯荤粺鍙橀噺鏇挎崲
+            _item.value = _item.value.replace(/@currentYear@/ig, moment().format('YYYY'))
+          }
         }
         if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') {
           if (item.lenControl === 'left') {
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 2414f0c..547bf77 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2354,8 +2354,13 @@
             _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
           }
         }
-        if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲
-          _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || ''))
+        if (_item.type === 'text') {
+          if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲
+            _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || ''))
+          }
+          if (/@currentYear@/ig.test(_item.value)) { // 绯荤粺鍙橀噺鏇挎崲
+            _item.value = _item.value.replace(/@currentYear@/ig, moment().format('YYYY'))
+          }
         }
         if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') {
           if (item.lenControl === 'left') {
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index b604438..731fcbf 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -357,6 +357,9 @@
       item.rules = []
       if (item.type === 'text') {
         item.initval = item.initval + ''
+        if (/@currentYear@/ig.test(item.initval)) { // 绯荤粺鍙橀噺鏇挎崲
+          item.initval = item.initval.replace(/@currentYear@/ig, moment().format('YYYY'))
+        }
 
         if (item.required === 'true') {
           item.rules.push({
diff --git a/src/templates/zshare/codemirror/index.jsx b/src/templates/zshare/codemirror/index.jsx
index dfe9c2b..8f26976 100644
--- a/src/templates/zshare/codemirror/index.jsx
+++ b/src/templates/zshare/codemirror/index.jsx
@@ -145,6 +145,9 @@
     })
 
     _sql = _sql.replace(/,\n\s*/g, ',')
+    _sql = _sql.replace(/@db@\s+[a-zA-Z]/g, (w) => {
+      return w.replace(/\s+/g, '')
+    })
 
     this.setState({display: false, defaultVal: _sql}, () => {
       this.setState({display: true})
diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx
index 63636ae..6f8dced 100644
--- a/src/templates/zshare/modalform/index.jsx
+++ b/src/templates/zshare/modalform/index.jsx
@@ -152,6 +152,7 @@
       if (this.record.interception === 'func') {
         shows.push('func')
       }
+      reTooltip.initval = '绯荤粺鍙橀噺锛欯currentYear@锛堝綋鍓嶅勾浠斤級'
     } else if (type === 'number') {
       reTypes.initval = 'number'
       reRequired.initval = true
diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index 18b2f08..c77060b 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -1510,7 +1510,7 @@
       let keys = []
       let values = []
   
-      formdata.forEach(item => {
+      formdata && formdata.forEach(item => {
         if (item.writein === false) return
         let _key = item.field.toLowerCase()
   

--
Gitblit v1.8.0