From 31499a3e864ca1229493fd7ec901659c0cb54159 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 07 三月 2020 11:49:16 +0800 Subject: [PATCH] 2020-03-07 --- src/templates/comtableconfig/index.jsx | 52 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index bd48173..c65fdc2 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -44,7 +44,6 @@ static propTpyes = { menu: PropTypes.any, optionLibs: PropTypes.any, - supMenuList: PropTypes.array, reloadmenu: PropTypes.func, handleView: PropTypes.func } @@ -171,15 +170,15 @@ originMenu: JSON.parse(JSON.stringify(menu)), selectedTables: _config.tables || [], menuformlist: [ - // { - // type: 'select', - // key: 'firparentId', - // label: '涓�绾ц彍鍗�', - // initVal: menu.ParentID, - // required: true, - // readonly: false, - // options: this.props.supMenuList - // }, + { + type: 'select', + key: 'fstMenuId', + label: '涓�绾ц彍鍗�', + initVal: menu.fstMenuId, + required: true, + readonly: false, + options: menu.fstMenuList + }, { type: 'select', key: 'parentId', @@ -187,7 +186,7 @@ initVal: menu.ParentID, required: true, readonly: false, - options: this.props.supMenuList + options: menu.supMenuList }, { type: 'text', @@ -1540,7 +1539,6 @@ getFuncNames = (data, funcNames, tableNames) => { data.forEach(item => { - console.log(item) if (item.subfuncs) { this.getFuncNames(item.subfuncs, funcNames, tableNames) } else { @@ -1548,12 +1546,11 @@ tableNames.push(item.tableName) } if (item.innerFunc) { - // funcNames.push({func: item.innerFunc, label: item}) - funcNames.push(item.innerFunc) + funcNames.push({func: item.innerFunc, label: item.label || ''}) } if (item.callbackFunc) { - funcNames.push(item.callbackFunc) + funcNames.push({func: item.callbackFunc, label: item.label || ''}) } } }) @@ -1574,7 +1571,6 @@ let config = JSON.parse(JSON.stringify(this.state.config)) this.menuformRef.handleConfirm().then(res => { - if (config.isAdd) { if (config.search[0] && config.search[0].origin) { config.search = config.search.filter(item => !item.origin) @@ -1784,20 +1780,22 @@ tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) let _vals = this.getFuncNames(_config.funcs, [], []) - let _funcs = Array.from(new Set(_vals.func)) + // let _funcs = Array.from(new Set(_vals.func)) let _tables = Array.from(new Set(_vals.table)) let param = { func: 'sPC_TrdMenu_AddUpt', + FstID: res.fstMenuId, + SndID: res.parentId, ParentID: res.parentId, MenuID: menu.MenuID, MenuNo: res.menuNo, Template: menu.PageParam.Template || '', MenuName: res.menuName, - Sort: (this.props.supMenuList.length + 1) * 10, + // Sort: (this.props.supMenuList.length + 1) * 10, PageParam: JSON.stringify(_pageParam), LongParam: _LongParam, - LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as ProcName,'${item}' as MenuName`), + LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`), LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`) } @@ -1914,6 +1912,12 @@ Api.getSystemConfig(param).then(response => { if (response.status) { + let _FMenu = originMenu.fstMenuList.filter(fstM => fstM.MenuID === res.fstMenuId)[0] + let _supMenuList = [] + if (_FMenu) { + _supMenuList = _FMenu.options + } + this.setState({ config: _config, originMenu: { @@ -1922,7 +1926,9 @@ PageParam: _pageParam, MenuName: res.menuName, MenuNo: res.menuNo, - ParentID: res.parentId + ParentID: res.parentId, + fstMenuId: res.fstMenuId, + supMenuList: _supMenuList } }) @@ -2156,7 +2162,8 @@ PageParam: _pageParam, MenuName: res.menuName, MenuNo: res.menuNo, - ParentID: res.parentId + ParentID: res.parentId, + fstMenuId: res.fstMenuId } if (!is(fromJS(originMenu), fromJS(_originMenu))) { @@ -2515,7 +2522,8 @@ PageParam: _pageParam, MenuName: res.menuName, MenuNo: res.menuNo, - ParentID: res.parentId + ParentID: res.parentId, + fstMenuId: res.fstMenuId } if (!is(fromJS(originMenu), fromJS(_originMenu))) { // 鑿滃崟淇℃伅鍙樺寲鏃讹紝鎻愮ず淇濆瓨 -- Gitblit v1.8.0