From 6c16e43cd6521460c804391c042348dbb14086fc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 16 六月 2020 09:44:40 +0800
Subject: [PATCH] 2020-06-16

---
 src/tabviews/subtable/index.jsx |   54 ++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index b40d2df..78d939a 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -142,23 +142,35 @@
       let _hideCol = []      // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆�
       let colMap = new Map()
 
-      // 鍏煎鍥捐〃
-      let chartId = ''
-      if (!config.charts) {
-        config.expand = true
-        config.charts = [{
-          uuid: Utils.getuuid(),
-          label: '',
-          title: '',
-          chartType: 'table',
-          icon: 'table',
-          Hide: 'false',
-          blacklist: []
-        }]
-      } else if (config.charts.length === 1) {
-        config.expand = true
+      // 鏃х増鏈吋瀹�
+      if (!config.version || config.version < '1.0') {
+        // 鍏煎鍥捐〃
+        if (!config.charts) {
+          config.expand = true
+          config.charts = [{ uuid: Utils.getuuid(), label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }]
+        } else {
+          config.charts.forEach(card => {
+            if (card.chartType === 'card') {
+              card.details = card.details.map(_cell => {
+                _cell.fontSize = _cell.fontSize || 14
+                if (!_cell.width) {
+                  _cell.width = 100
+                } else if (_cell.width === 'helf') {
+                  _cell.width = 50
+                } else if (_cell.width === 'third') {
+                  _cell.width = 33
+                }
+                if (!_cell.fontWeight && _cell.bold === 'true') {
+                  _cell.fontWeight = 'normal'
+                }
+                _cell.height = _cell.height || 1
+  
+                return _cell
+              })
+            }
+          })
+        }
       }
-      chartId = config.charts[0].uuid
 
       // 鏉冮檺杩囨护
       if (this.props.menuType !== 'HS') {
@@ -216,6 +228,8 @@
       if (config.charts.length <= 1) {
         config.expand = true
       }
+
+      let chartId = config.charts[0] ? config.charts[0].uuid : ''
 
       if (userConfig) {
         config.setting.tableType = userConfig.setting.tableType
@@ -402,6 +416,10 @@
 
         param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
         param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+
+        if (this.props.menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉
+          param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true)
+        }
 
         let defer = new Promise(resolve => {
           Api.getSystemCacheConfig(param, isSSO).then(res => {
@@ -697,6 +715,10 @@
     param.secretkey = Utils.encrypt(param.LText, param.timestamp)
     param.DateCount = Utils.formatOptions(DateCount)
 
+    if (this.props.menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉
+      param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true)
+    }
+
     return param
   }
 

--
Gitblit v1.8.0