From 4f2e4e84fd2cdca1407ac06c1b44319518be39b9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十二月 2020 19:11:05 +0800 Subject: [PATCH] 2020-12-21 --- src/views/menudesign/index.jsx | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 4509604..54c8363 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -227,6 +227,7 @@ }) } else if (item.type === 'table' && item.subtype === 'normaltable') { item.action && item.action.forEach(btn => { + if (btn.origin) return buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) _sort++ }) @@ -246,8 +247,24 @@ return buttons } + filterConfig = (components) => { + return components.map(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + tab.components = this.filterConfig(tab.components) + }) + } else if (item.type === 'table' && item.subtype === 'normaltable') { + item.search = item.search.filter(a => !a.origin) + item.action = item.action.filter(a => !a.origin) + item.cols = item.cols.filter(a => !a.origin) + } + return item + }) + } + submitConfig = () => { - const { config, openEdition } = this.state + const { openEdition } = this.state + let config = fromJS(this.state.config).toJS() if (config.MenuType === 'billPrint' && (!config.firstCount || !config.everyPCount)) { notification.warning({ @@ -271,6 +288,8 @@ }) return } + + config.components = this.filterConfig(config.components) if (config.enabled && this.verifyConfig()) { config.enabled = false @@ -406,7 +425,12 @@ if (res.status) { this.setState({ - menuloading: false + menuloading: false, + config: {...config, components: []} + }, () => { + this.setState({ + config: {...this.state.config, components: this.state.oriConfig.components} + }) }) notification.success({ top: 92, -- Gitblit v1.8.0