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/commontable/index.jsx | 80 +++++++++++++++++++++++++++------------- 1 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index b378b02..fd44f5c 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -126,34 +126,53 @@ return } - // 鍏煎鏍囩 - if (!config.tabgroups) { - config.tabgroups = [{ uuid: 'tabs', sublist: [] }] - } else if (typeof(config.tabgroups[0]) === 'string') { - let _tabgroups = [] - config.tabgroups.forEach(groupId => { - let _group = { - uuid: groupId, - sublist: fromJS(config[groupId]).toJS() - } + if (!config.version || config.version < '1.0') { + // 鍏煎鏍囩 + if (!config.tabgroups) { + config.tabgroups = [{ uuid: 'tabs', sublist: [] }] + } else if (typeof(config.tabgroups[0]) === 'string') { + let _tabgroups = [] + config.tabgroups.forEach(groupId => { + let _group = { + uuid: groupId, + sublist: fromJS(config[groupId]).toJS() + } + + delete config[groupId] + + _tabgroups.push(_group) + }) + + config.tabgroups = _tabgroups + } + + // 鍏煎鍥捐〃 + 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 - delete config[groupId] - - _tabgroups.push(_group) - }) - - config.tabgroups = _tabgroups + return _cell + }) + } + }) + } } - - // 鍏煎鍥捐〃 - 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 - } - chartId = config.charts[0].uuid // 鏉冮檺杩囨护 if (this.props.menuType !== 'HS') { @@ -196,6 +215,7 @@ if (config.charts.length <= 1) { config.expand = true } + let chartId = config.charts[0] ? config.charts[0].uuid : '' // 瀛楁鏉冮檺榛戝悕鍗� config.search = config.search.filter(item => { @@ -524,6 +544,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 => { res.search = item @@ -789,6 +813,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