From e36eb1999794bd71e76482b92a0b0b20f49d0032 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 05 三月 2021 19:37:03 +0800 Subject: [PATCH] 2021-03-05 --- src/templates/sharecomponent/fieldscomponent/index.jsx | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index a3e69bd..a828bf7 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -14,20 +14,19 @@ static propTpyes = { type: PropTypes.string, // 鎼滅储鏉′欢娣诲姞銆佹樉绀哄垪娣诲姞 config: PropTypes.object, // 瀹瑰櫒Id - tableFields: PropTypes.string, // 宸查�夎〃瀛楁闆� updatefield: PropTypes.func } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, fields: [], // 瀛楁闆� tableVisible: false, // 妯℃�佹鎺у埗 } queryField = () => { - const { type, config, tableFields } = this.props + const { type, config } = this.props // 鍒ゆ柇鏄惁宸查�夋嫨琛ㄥ悕 - if (!tableFields || tableFields.length === 0) { + if (!window.GLOB.tableFields || window.GLOB.tableFields.length === 0) { notification.warning({ top: 92, message: '璇烽�夋嫨琛ㄥ悕锛�', @@ -38,7 +37,7 @@ // 琛ㄥ瓧娈甸泦杞负map鏁版嵁 let columns = new Map() - tableFields.forEach(table => { + window.GLOB.tableFields.forEach(table => { table.columns.forEach(column => { columns.set(column.field.toLowerCase(), column) }) @@ -242,23 +241,24 @@ } else if (type === 'form') { if (config.groups.length > 1) { config.groups.forEach(group => { + let _items = [] group.sublist.forEach(item => { if (columnsMap.has(item.field.toLowerCase())) { let cell = columnsMap.get(item.field.toLowerCase()) if (cell.selected && cell.type === item.type) { // 鏁版嵁閫夋嫨鐘舵�佸強绫诲瀷鏈慨鏀规椂锛岀洿鎺ユ坊鍔� - items.push(item) + _items.push(item) } else if (cell.selected) { // 鏁版嵁绫诲瀷淇敼鏃讹紝閲嶇疆绫诲瀷鍙婂垵濮嬪�� item.type = cell.type item.initval = '' - items.push(item) + _items.push(item) } columnsMap.delete(item.field.toLowerCase()) } else if (!item.origin) { // 杩囨护绀轰緥椤� - items.push(item) + _items.push(item) } }) - group.sublist = items + group.sublist = _items }) let _columns = [...columnsMap.values()] -- Gitblit v1.8.0