From 191d6d48a282479c02ea212ca33789ad34137361 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 11 一月 2021 16:21:17 +0800 Subject: [PATCH] 2021-01-11 --- src/templates/comtableconfig/index.jsx | 101 +++++++++++++------------------------------------- 1 files changed, 27 insertions(+), 74 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index a6d10ff..df83c9e 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -202,20 +202,37 @@ }) } - getFuncNames = (data) => { + getFuncNames = (config) => { let funcNames = [] let tableNames = [] - data.forEach(item => { - if (item.tableName) { - tableNames.push(item.tableName) - } - if (item.innerFunc) { - funcNames.push({func: item.innerFunc, label: item.label || ''}) + if (config.setting.tableName) { + tableNames.push(config.setting.tableName) + } + if (config.setting.innerFunc) { + funcNames.push({func: config.setting.innerFunc, label: config.MenuName || ''}) + } + if (config.setting.outerFunc) { + funcNames.push({func: config.setting.outerFunc, label: config.MenuName || ''}) + } + + config.action.forEach(item => { + let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '') + + if (item.OpenType === 'excelOut' && item.intertype === 'system') { + tablename = config.setting.tableName || '' } - if (item.callbackFunc) { - funcNames.push({func: item.callbackFunc, label: item.label || ''}) + if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut', 'funcbutton'].includes(item.OpenType)) { + if (tablename) { + tableNames.push(tablename) + } + if (item.innerFunc) { + funcNames.push({func: item.innerFunc, label: item.label || ''}) + } + if (item.callbackFunc) { + funcNames.push({func: item.callbackFunc, label: item.label || ''}) + } } }) @@ -279,70 +296,6 @@ if (vresult !== true) { _config.enabled = false } - - _config.funcs = [] // 椤甸潰鍙婂瓙椤甸潰瀛樺偍杩囩▼闆� - - _config.funcs.push({ - type: 'view', - subtype: 'view', - uuid: menu.MenuID, - intertype: _config.setting.interType || 'system', - interface: _config.setting.interface || '', - tableName: _config.setting.tableName || '', - innerFunc: _config.setting.innerFunc || '', - outerFunc: _config.setting.outerFunc || '' - }) - - _config.action.forEach(item => { - let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '') - - if (item.OpenType === 'excelOut' && item.intertype === 'system') { - tablename = _config.setting.tableName || '' - } - - if (item.OpenType === 'tab' || item.OpenType === 'blank') { - _config.funcs.push({ - type: 'tab', - subtype: 'btn', - uuid: item.uuid, - label: item.label, - linkTab: item.uuid - }) - } else if (item.OpenType === 'popview') { - _config.funcs.push({ - type: 'tab', - subtype: 'btn', - uuid: item.uuid, - label: item.label, - linkTab: item.linkTab - }) - } else if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(item.OpenType)) { - _config.funcs.push({ - type: 'button', - subtype: 'btn', - uuid: item.uuid, - label: item.label, - tableName: tablename, - intertype: item.intertype, - interface: item.interface || '', - innerFunc: item.innerFunc || '', - outerFunc: item.outerFunc || '', - callbackFunc: item.callbackFunc || '' - }) - } - }) - - _config.tabgroups.forEach(group => { - group.sublist.forEach(tab => { - _config.funcs.push({ - type: 'tab', - subtype: 'tab', - uuid: tab.uuid, - label: tab.label, - linkTab: tab.linkTab - }) - }) - }) if (this.state.closeVisible) { // 鏄剧ず鍏抽棴瀵硅瘽妗嗘椂锛屾ā鎬佹涓繚瀛樻寜閽紝鏄剧ず淇濆瓨涓姸鎬� this.setState({ @@ -436,7 +389,7 @@ tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) - let _vals = this.getFuncNames(_config.funcs) + let _vals = this.getFuncNames(_config) let param = { func: 'sPC_TrdMenu_AddUpt', -- Gitblit v1.8.0