From 2652a3c1485dbbf3b003e13e5c5d1c0205e7c324 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 九月 2020 09:19:46 +0800 Subject: [PATCH] 2020-09-09 --- src/templates/comtableconfig/index.jsx | 80 +-------------------------------------- 1 files changed, 3 insertions(+), 77 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 2793a2e..c3f085b 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -9,6 +9,7 @@ import Api from '@/api' import Utils from '@/utils/utils.js' +import UtilsUpdate from '@/utils/utils-update.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' @@ -107,83 +108,8 @@ _config.OpenType = menu.PageParam ? menu.PageParam.OpenType : '' _config.easyCode = _config.easyCode || '' - if (!_config.version || _config.version < '1.0') { - // 閰嶇疆榛樿鍊硷紝鍏煎 - _config.version = '1.0' - _config.Template = 'CommonTable' - - 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 = false - _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 => { - if (!_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.bold === 'true') { - _cell.fontWeight = 'normal' - } - - if (!_cell.height) { - _cell.height = 1 - } - - return _cell - }) - - if (card.widthType === 'ratio' && card.avatar && card.avatar.widthType !== 'ratio') { - card.avatar.widthType = 'ratio' - card.avatar.width = 32 - } - } - }) - } - - // // 鍏煎鎺ュ彛绫诲瀷 - // _config.action = _config.action.map(item => { - // if (item.intertype === 'inner' && !item.innerFunc) { - // item.intertype = 'system' - // } - // return item - // }) - } + // 鐗堟湰鍏煎 + _config = UtilsUpdate.updateCommonTable(_config) let _oriActions = [] if (_config.type === 'user') { -- Gitblit v1.8.0