From ffd044cf75ae896187b938e91dbd8fb83abd3615 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 28 三月 2023 20:58:11 +0800 Subject: [PATCH] 2023-03-28 --- src/menu/components/form/simple-form/index.jsx | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index 28dcb23..6d372ff 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -125,6 +125,7 @@ card.width = card.wrap.width card.name = card.wrap.name card.errors = [] + let idCtrl = false if (card.wrap.datatype !== 'static') { let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' @@ -151,6 +152,9 @@ card.subcards.forEach(item => { item.fields.forEach(m => { + if (m.dataSource && /@ID@/ig.test(m.dataSource)) { + idCtrl = true + } if (m.type === 'linkMain' && !supModule) { card.errors.push({ level: 1, detail: `璇锋鏌ュ叧鑱斾富琛ㄢ��${m.label}鈥濇槸鍚︽湁鏁坄}) } @@ -163,12 +167,17 @@ card.subcards.forEach(item => { item.fields.forEach(m => { + if (m.dataSource && /@ID@/ig.test(m.dataSource)) { + idCtrl = true + } if (m.type === 'linkMain' && !supModule) { card.errors.push({ level: 1, detail: `璇锋鏌ュ叧鑱斾富琛ㄢ��${m.label}鈥濇槸鍚︽湁鏁坄}) } }) }) } + + card.idCtrl = idCtrl this.setState({ card: card @@ -334,7 +343,6 @@ let _tabfields = [] let _linkableFields = [] let _linksupFields = [] - let _allFields = [] let standardform = null let uniq = new Map() @@ -344,13 +352,6 @@ card.subcards[0].fields.forEach((item, i) => { if (_form.uuid === item.uuid) { index = i - } - - if (item.field) { - _allFields.push({ - field: item.field, - label: item.label - }) } if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) { @@ -422,7 +423,7 @@ standardform, visible: true, editform: _form, - formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, _allFields, card.columns) + formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, card.columns) }) } @@ -461,6 +462,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -605,6 +608,13 @@ updateWrap = (res) => { let _card = fromJS(this.state.card).toJS() + let buttons = res.buttons + + delete res.buttons + + res.enable = buttons.includes('enable') ? 'true' : 'false' + res.closeEnable = buttons.includes('closeEnable') ? 'true' : 'false' + _card.wrap = res if (res.datatype === 'static') { @@ -621,6 +631,8 @@ _card.subcards[0].setting.enable = _card.wrap.enable _card.subcards[0].setting.verticalSpace = _card.wrap.verticalSpace + + if (_card.wrap.closeEnable === 'true' && !_card.subcards[0].closeButton) { _card.subcards[0].closeButton = {label: '鍏抽棴', enable: 'true', type: 'close', style: {backgroundColor: '#ffffff', color: 'rgba(0,0,0,0.65)', borderColor: '#d9d9d9', borderWidth: '1px', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px', marginLeft: '10px'}} } else if (_card.subcards[0].closeButton) { -- Gitblit v1.8.0