From 81c3fd3ac5017591d987d9c9fe42042fae5c7d7d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 30 十一月 2021 14:30:47 +0800
Subject: [PATCH] 2021-11-30

---
 src/tabviews/zshare/mutilform/mkSelect/index.jsx                 |   30 +++++++
 src/views/design/header/index.jsx                                |   56 +++++++------
 src/tabviews/custom/components/card/balcony/index.jsx            |    2 
 src/templates/sharecomponent/actioncomponent/index.scss          |    6 +
 src/views/appmanage/submutilform/index.jsx                       |    2 
 src/views/mobdesign/index.jsx                                    |   86 +++++++++++++++++++--
 src/templates/sharecomponent/actioncomponent/dragaction/card.jsx |    9 ++
 src/views/login/index.jsx                                        |    7 +
 8 files changed, 158 insertions(+), 40 deletions(-)

diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx
index 8f0c7e6..72ad28f 100644
--- a/src/tabviews/custom/components/card/balcony/index.jsx
+++ b/src/tabviews/custom/components/card/balcony/index.jsx
@@ -100,7 +100,7 @@
       config: _config,
       arr_field: _config.columns.map(col => col.field).join(','),
     }, () => {
-      if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') {
+      if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true') {
         this.loadData()
       }
     })
diff --git a/src/tabviews/zshare/mutilform/mkSelect/index.jsx b/src/tabviews/zshare/mutilform/mkSelect/index.jsx
index 192ddd4..86ff5c5 100644
--- a/src/tabviews/zshare/mutilform/mkSelect/index.jsx
+++ b/src/tabviews/zshare/mutilform/mkSelect/index.jsx
@@ -17,6 +17,19 @@
       } else {
         value = []
       }
+    } else if (value) {
+      let option = null
+      if (config.setAll === 'true') {
+        option= config.oriOptions[1]
+      } else {
+        option= config.oriOptions[0]
+      }
+      if (typeof(value) === 'string' && option && typeof(option.value) === 'number') {
+        value = +value
+        if (isNaN(value)) {
+          value = config.initval
+        }
+      }
     }
 
     this.state = {
@@ -40,7 +53,7 @@
   }
 
   UNSAFE_componentWillReceiveProps (nextProps) {
-    const { config } = this.state
+    const { config, value } = this.state
 
     if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) {
       this.setState({
@@ -52,6 +65,21 @@
         this.setState({
           value: nextProps.config.initval,
         })
+      } else {
+        let option = null
+        if (config.setAll === 'true') {
+          option= nextProps.config.oriOptions[1]
+        } else {
+          option= nextProps.config.oriOptions[0]
+        }
+        if (option && typeof(option.value) === 'number') {
+          let val = +value
+          if (!isNaN(val)) {
+            this.setState({
+              value: val
+            })
+          }
+        }
       }
     }
   }
diff --git a/src/templates/sharecomponent/actioncomponent/dragaction/card.jsx b/src/templates/sharecomponent/actioncomponent/dragaction/card.jsx
index 7f983f0..6fde75c 100644
--- a/src/templates/sharecomponent/actioncomponent/dragaction/card.jsx
+++ b/src/templates/sharecomponent/actioncomponent/dragaction/card.jsx
@@ -28,10 +28,17 @@
   const opacity = isDragging ? 0 : 1
 
   let hasProfile = false
+  let forbidSql = false
   if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
     hasProfile = true
+    if (card.verify && card.verify.default === 'false') {
+      forbidSql = true
+    }
   } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') {
     hasProfile = true
+    if (card.verify && card.verify.default === 'false') {
+      forbidSql = true
+    }
   } else if (card.funcType === 'print') {
     hasProfile = true
   }
@@ -53,7 +60,7 @@
             key={card.uuid}
             onDoubleClick={() => doubleClickCard(id)}
           >
-            {card.label}{card.position === 'grid' && <Icon type="table" />}
+            {card.label}{card.position === 'grid' && <Icon type="table" />}{forbidSql && <Icon type="disconnect" />}
           </Button>
         </div>
       </div>
diff --git a/src/templates/sharecomponent/actioncomponent/index.scss b/src/templates/sharecomponent/actioncomponent/index.scss
index 6a0e1f5..cfa9c43 100644
--- a/src/templates/sharecomponent/actioncomponent/index.scss
+++ b/src/templates/sharecomponent/actioncomponent/index.scss
@@ -23,6 +23,12 @@
         right: 1px;
         bottom: 0px;
       }
+      .anticon-disconnect {
+        font-size: 10px;
+        position: absolute;
+        right: 1px;
+        top: 0px;
+      }
     }
   }
 }
diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx
index e782e76..96b98d8 100644
--- a/src/views/appmanage/submutilform/index.jsx
+++ b/src/views/appmanage/submutilform/index.jsx
@@ -158,7 +158,7 @@
           </Col>
           {typename !== 'pc' ? <Col span={12}>
             <Form.Item label={
-              <Tooltip placement="topLeft" title="浣跨敤鍏紬鍙锋巿鏉冪櫥褰曟椂锛屾槸鍚﹂渶瑕佺粦瀹氱敤鎴枫��">
+              <Tooltip placement="topLeft" title="浣跨敤鍏紬鍙锋巿鏉冪櫥褰曟垨浣跨敤灏忕▼搴忔椂锛屾槸鍚﹂渶瑕佺粦瀹氱敤鎴枫��">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鐢ㄦ埛缁戝畾
               </Tooltip>
diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx
index 80eec5c..8e60745 100644
--- a/src/views/design/header/index.jsx
+++ b/src/views/design/header/index.jsx
@@ -241,34 +241,36 @@
 
   componentDidMount () {
     if (window.GLOB.systemType !== 'production') {
-      Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
-        if (res.status) {
-          let _permFuncField = []
-          let _sysRoles = []
-
-          if (res.Roles && res.Roles.length > 0) {
-            _sysRoles = res.Roles.map(role => {
-              return {
-                uuid: Utils.getuuid(),
-                value: role.RoleID,
-                text: role.RoleName
-              }
-            })
+      setTimeout(() => {
+        Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
+          if (res.status) {
+            let _permFuncField = []
+            let _sysRoles = []
+  
+            if (res.Roles && res.Roles.length > 0) {
+              _sysRoles = res.Roles.map(role => {
+                return {
+                  uuid: Utils.getuuid(),
+                  value: role.RoleID,
+                  text: role.RoleName
+                }
+              })
+            }
+  
+            if (res.sModular && res.sModular.length > 0) {
+              res.sModular.forEach(field => {
+                if (field.ModularNo) {
+                  _permFuncField.push(field.ModularNo)
+                }
+              })
+              _permFuncField = _permFuncField.sort()
+            }
+  
+            sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles))
+            sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField))
           }
-
-          if (res.sModular && res.sModular.length > 0) {
-            res.sModular.forEach(field => {
-              if (field.ModularNo) {
-                _permFuncField.push(field.ModularNo)
-              }
-            })
-            _permFuncField = _permFuncField.sort()
-          }
-
-          sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles))
-          sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField))
-        }
-      })
+        })
+      }, 50)
     } else if (window.GLOB.systemType === 'production') {
       this.props.resetEditLevel('HS')
       this.props.modifyMainMenu({
diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx
index c333d44..ee716bc 100644
--- a/src/views/login/index.jsx
+++ b/src/views/login/index.jsx
@@ -390,6 +390,13 @@
             this.setState({
               auth: true
             })
+
+            if (res.warning_day && res.warning_day < 20) {
+              Modal.warning({
+                title: `璺濈鎺堟潈鍒版湡杩樺墿${res.warning_day}澶╋紝璇疯仈绯荤鐞嗗憳銆俙,
+                okText: '鐭ラ亾浜�'
+              })
+            }
           } else {
             localStorage.removeItem(_authUrl)
             this.setState({
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 0de7b33..d4474f5 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -734,14 +734,6 @@
                 title: cell.label,
               })
             })
-            card.backElements && card.backElements.forEach(cell => {
-              if (cell.eleType !== 'button') return
-              this.checkBtn(cell)
-              m.children.push({
-                key: cell.uuid,
-                title: cell.label,
-              })
-            })
           })
         } else if (item.type === 'carousel' || item.type === 'timeline') {
           item.subcards.forEach(card => {
@@ -835,10 +827,86 @@
   }
 
   getMiniStyle = (config) => {
-    console.log(config)
+    config.miniStyle = this.transferStyle(config.style)
+
+    let traversal = (components) => {
+      return components.map(item => {
+        if (item.style) {
+          item.miniStyle = this.transferStyle(item.style)
+        }
+        if (item.headerStyle) {
+          item.miniHeaderStyle = this.transferStyle(item.headerStyle)
+        }
+
+        if (item.action && item.action.length > 0) {
+          item.action = item.action.map(btn => {
+            btn.miniStyle = this.transferStyle(btn.style)
+            return btn
+          })
+        }
+
+        if (item.type === 'tabs') {
+          item.subtabs.forEach(tab => {
+            tab.components = traversal(tab.components)
+          })
+        } else if (item.type === 'group') {
+          item.components = traversal(item.components)
+        } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) {
+          item.subcards.forEach(card => {
+            card.miniStyle = this.transferStyle(card.style)
+            card.elements = card.elements.map(cell => {
+              cell.miniStyle = this.transferStyle(cell.style)
+              return cell
+            })
+          })
+        } else if (item.type === 'balcony') {
+          item.elements && item.elements.forEach(cell => {
+            cell.miniStyle = this.transferStyle(cell.style)
+          })
+        } else if (item.type === 'menubar') {
+          item.subMenus = item.subMenus.map(menu => {
+            menu.miniStyle = this.transferStyle(menu.style)
+            return menu
+          })
+        } else if (item.type === 'table' && item.subtype === 'normaltable') {
+          let getCols = (cols) => {
+            return cols.map(col => {
+              if (col.type === 'colspan') {
+                col.subcols = getCols(col.subcols || [])
+              } else if (col.type === 'custom' || col.type === 'action') {
+                col.elements = col.elements.map(cell => {
+                  cell.miniStyle = this.transferStyle(cell.style)
+                  return cell
+                })
+              }
+  
+              return col
+            })
+          }
+          
+          item.cols = getCols(item.cols)
+        }
+
+        return item
+      })
+    }
+
+    config.components = traversal(config.components)
+
     return config
   }
 
+  transferStyle = (style = {}) => {
+    let _style = ''
+    Object.keys(style).forEach(key => {
+      if (['hShadow', 'vShadow', 'shadowBlur', 'shadowColor'].includes(key)) return
+      if (!style[key]) return
+      _style += `${key.replace(/[A-Z]/g, m => '-' + m.toLowerCase())}:${style[key]};`
+    })
+
+    return _style
+  }
+
   submitConfig = () => {
     let config = fromJS(this.state.config).toJS()
 

--
Gitblit v1.8.0