From 26d0fa42ea8c63a87e8ef93d0915f75f46fb1f9c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 三月 2022 11:09:53 +0800
Subject: [PATCH] 2022-03-24

---
 public/options.json                                         |   14 ++--
 src/tabviews/custom/components/card/table-card/index.jsx    |    2 
 src/tabviews/custom/components/carousel/data-card/index.jsx |    2 
 src/tabviews/zshare/mutilform/index.jsx                     |   58 +++++++++---------
 src/tabviews/custom/components/card/prop-card/index.jsx     |   14 ++--
 src/tabviews/custom/components/carousel/prop-card/index.jsx |   14 ++--
 src/components/normalform/modalform/index.jsx               |    4 +
 src/menu/components/carousel/data-card/options.jsx          |   16 +++++
 src/menu/components/card/data-card/options.jsx              |    3 
 9 files changed, 77 insertions(+), 50 deletions(-)

diff --git a/public/options.json b/public/options.json
index f317ad5..792a858 100644
--- a/public/options.json
+++ b/public/options.json
@@ -1,17 +1,17 @@
 {
-  "appId": "201912040924165801464FF1788654BC5AC73",
-  "appkey": "20191106103859640976D6E924E464D029CF0",
+  "appId": "202108312122504607B107A83F55B40C98CCF",
+  "appkey": "20210831212235413F287EC3BF489424496C8",
   "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
   "systemType": "",
   "externalDatabase": "false",
   "lineColor": "",
   "filter": "false",
-  "defaultApp": "mk",
+  "defaultApp": "mkindustry",
   "defaultLang": "zh-CN",
   "WXAppID": "",
   "debugger": false,
-  "licenseKey": "",
-  "probation": "",
-  "host": "http://qingqiumarket.cn",
-  "service": "MKWMS/"
+  "licenseKey": "7EFE13KIKLILIJB64C12",
+  "probation": "2021-12-31",
+  "host": "http://demo.mk9h.cn",
+  "service": "erp_new/"
 }
\ No newline at end of file
diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx
index 7162b0c..4c2f73a 100644
--- a/src/components/normalform/modalform/index.jsx
+++ b/src/components/normalform/modalform/index.jsx
@@ -109,7 +109,9 @@
 
         if (cell.hidden) return
 
-        if (supItem.hidden) {
+        if (cell.skip && supItem.forbid) { // 涓婄骇琛ㄥ崟绂佺敤鏃讹紝姝よ〃鍗曚笉鍙楁帶鍒�
+
+        } else if (supItem.hidden) {
           cell.hidden = true
         } else if (supItem.type === 'checkbox') {
           let vals = [...supItem.initval, ...item.values]
diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 4584b22..67d8f47 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -70,6 +70,7 @@
       linkFields: ['priKeyType'],
       controlFields: [
         {field: 'goback', values: ['dynamic']},
+        {field: 'empty', values: ['dynamic']},
         {field: 'supModule', values: ['static']},
       ],
       forbid: subtype !== 'propcard'
@@ -233,11 +234,11 @@
       initval: wrap.empty || 'show',
       tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
+      skip: true,
       options: [
         {value: 'show', label: '鍚�'},
         {value: 'hidden', label: '鏄�'},
       ],
-      forbid: subtype !== 'datacard'
     },
     {
       type: 'radio',
diff --git a/src/menu/components/carousel/data-card/options.jsx b/src/menu/components/carousel/data-card/options.jsx
index 6aa1852..a770500 100644
--- a/src/menu/components/carousel/data-card/options.jsx
+++ b/src/menu/components/carousel/data-card/options.jsx
@@ -46,6 +46,9 @@
         {value: 'dynamic', label: '鍔ㄦ��'},
         {value: 'static', label: '闈欐��'},
       ],
+      controlFields: [
+        {field: 'empty', values: ['dynamic']},
+      ],
       forbid: subtype !== 'propcard'
     },
     {
@@ -120,6 +123,19 @@
       forbid: appType === 'mob'
     },
     {
+      type: 'radio',
+      field: 'empty',
+      label: '绌哄�奸殣钘�',
+      initval: wrap.empty || 'show',
+      tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
+      required: false,
+      skip: true,
+      options: [
+        {value: 'show', label: '鍚�'},
+        {value: 'hidden', label: '鏄�'},
+      ],
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx
index 200b8db..a639f5f 100644
--- a/src/tabviews/custom/components/card/prop-card/index.jsx
+++ b/src/tabviews/custom/components/card/prop-card/index.jsx
@@ -47,15 +47,15 @@
       _sync = _config.setting.sync === 'true'
 
       if (_sync && data) {
-        _data = data[_config.dataName] || {}
+        _data = data[_config.dataName] || {$$empty: true}
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
         _sync = false
       } else if (_sync && initdata) {
-        _data = initdata || {}
+        _data = initdata || {$$empty: true}
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
         _sync = false
       }
@@ -167,9 +167,9 @@
     if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) {
       let _data = { $$empty: true }
       if (nextProps.data && nextProps.data[config.dataName]) {
-        _data = nextProps.data[config.dataName] || {}
+        _data = nextProps.data[config.dataName]
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
       }
 
@@ -399,6 +399,8 @@
   render() {
     const { config, loading, data, activeKey } = this.state
 
+    if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
+
     return (
       <div className="custom-prop-card-box" style={config.style}>
         {loading ?
diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx
index ff08851..723ca1f 100644
--- a/src/tabviews/custom/components/card/table-card/index.jsx
+++ b/src/tabviews/custom/components/card/table-card/index.jsx
@@ -412,6 +412,8 @@
   render() {
     const { config, loading, data, BID, pageIndex, total } = this.state
 
+    if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null
+    
     return (
       <div className="custom-table-card-box" style={{...config.style}}>
         {loading ?
diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx
index 7154c9e..78d7fdd 100644
--- a/src/tabviews/custom/components/carousel/data-card/index.jsx
+++ b/src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -248,6 +248,8 @@
   render() {
     const { config, loading, data, card } = this.state
 
+    if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null
+    
     return (
       <div className="custom-data-carousel-box" style={config.style}>
         {loading ?
diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx
index af669f7..22a2df9 100644
--- a/src/tabviews/custom/components/carousel/prop-card/index.jsx
+++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx
@@ -41,15 +41,15 @@
       _sync = _config.setting.sync === 'true'
 
       if (_sync && data) {
-        _data = data[_config.dataName] || {}
+        _data = data[_config.dataName] || {$$empty: true}
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
         _sync = false
       } else if (_sync && initdata) {
-        _data = initdata || {}
+        _data = initdata
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
         _sync = false
       }
@@ -122,9 +122,9 @@
     if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) {
       let _data = {$$empty: true}
       if (nextProps.data && nextProps.data[config.dataName]) {
-        _data = nextProps.data[config.dataName] || {}
+        _data = nextProps.data[config.dataName]
         if (Array.isArray(_data)) {
-          _data = _data[0] || {}
+          _data = _data[0] || {$$empty: true}
         }
       }
 
@@ -245,6 +245,8 @@
   render() {
     const { config, loading, data } = this.state
 
+    if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
+
     return (
       <div className="custom-prop-carousel-box" style={config.style}>
         {loading ?
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 21981c0..dc188ee 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -735,43 +735,43 @@
   recordChange = (values, item) => {
     this.record = {...this.record, ...values}
 
-    if (item && item.controlFields) {
-      let map = new Map()
-      this.state.formlist.forEach(cell => {
-        if (!cell.field) return
-        map.set(cell.field, cell)
-      })
+    if (!item || !item.controlFields) return
 
-      let reset = (current) => {
-        let val = this.record[current.field]
+    let map = new Map()
+    this.state.formlist.forEach(cell => {
+      if (!cell.field) return
+      map.set(cell.field, cell)
+    })
 
-        current.controlFields.forEach(cell => {
-          let m = map.get(cell.field)
-          m.hidden = current.hidden || !cell.values.includes(val)
+    let reset = (current) => {
+      let val = this.record[current.field]
 
-          if (m.hidden) {
-            m.initval = this.record[m.field]
-          }
+      current.controlFields.forEach(cell => {
+        let m = map.get(cell.field)
+        m.hidden = current.hidden || !cell.values.includes(val)
 
-          map.set(cell.field, m)
+        if (m.hidden) {
+          m.initval = this.record[m.field]
+        }
 
-          if (m.controlFields) {
-            reset(m)
-          }
-        })
-      }
+        map.set(cell.field, m)
 
-      reset(item)
-
-      this.setState({
-        formlist: this.state.formlist.map(cell => {
-          if (cell.field) {
-            return map.get(cell.field)
-          }
-          return cell
-        })
+        if (m.controlFields) {
+          reset(m)
+        }
       })
     }
+
+    reset(item)
+
+    this.setState({
+      formlist: this.state.formlist.map(cell => {
+        if (cell.field) {
+          return map.get(cell.field)
+        }
+        return cell
+      })
+    })
   }
 
   getFields() {

--
Gitblit v1.8.0