From ffc81ccbf6493386824f020c77869a737ce6fce5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 27 二月 2024 16:48:50 +0800 Subject: [PATCH] 2024-02-27 --- src/components/normalform/modalform/mkRadio/index.jsx | 11 ----- src/menu/datasource/verifycard/index.jsx | 38 ++++++++++--------- src/components/normalform/modalform/mkSelect/index.jsx | 11 ----- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 39 ++++++++++--------- 4 files changed, 41 insertions(+), 58 deletions(-) diff --git a/src/components/normalform/modalform/mkRadio/index.jsx b/src/components/normalform/modalform/mkRadio/index.jsx index 587fef6..ddebf3e 100644 --- a/src/components/normalform/modalform/mkRadio/index.jsx +++ b/src/components/normalform/modalform/mkRadio/index.jsx @@ -26,17 +26,6 @@ return !is(fromJS(this.state), fromJS(nextState)) } - UNSAFE_componentWillReceiveProps (nextProps) { - const { config } = this.state - - if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { - this.setState({ - config: fromJS(nextProps.config).toJS(), - options: fromJS(nextProps.config.options).toJS() - }) - } - } - componentWillUnmount () { this.setState = () => { return diff --git a/src/components/normalform/modalform/mkSelect/index.jsx b/src/components/normalform/modalform/mkSelect/index.jsx index a1b4479..39b5546 100644 --- a/src/components/normalform/modalform/mkSelect/index.jsx +++ b/src/components/normalform/modalform/mkSelect/index.jsx @@ -31,17 +31,6 @@ MKEmitter.addListener('mkFC', this.mkFormControl) } - UNSAFE_componentWillReceiveProps (nextProps) { - const { config } = this.state - - if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { - this.setState({ - config: fromJS(nextProps.config).toJS(), - options: fromJS(nextProps.config.options).toJS() - }) - } - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index e103038..ceabb28 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -545,7 +545,7 @@ submitDataSource = () => { const { config, mainSearch } = this.props - const { activeKey, setting, columns, subColumns, scripts, cols } = this.state + const { activeKey, setting, columns, subColumns, scripts, cols, median } = this.state if (config.subtype === 'dualdatacard') { let arr = columns.map(col => col.field.toLowerCase()) @@ -579,6 +579,25 @@ message: '瀛楁闆嗕腑涓嶅彲浣跨敤' + _arr.join('銆�') + '锛佹敞锛氭瀛楁涓烘彁浜ゆ椂鐨勭郴缁熷瓧娈点��', duration: 5 }) + return Promise.reject() + } + } + + if (median.interType === 'system') { + let _loading = false + if (this.scriptsForm && this.scriptsForm.state.editItem) { + _loading = true + } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { + _loading = true + } + + if (_loading) { + notification.warning({ + top: 92, + message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒', + duration: 5 + }) + this.setState({activeKey: 'scripts'}) return Promise.reject() } } @@ -624,23 +643,6 @@ } this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit') } else if (activeKey === 'scripts') { - let _loading = false - if (this.scriptsForm && this.scriptsForm.state.editItem) { - _loading = true - } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { - _loading = true - } - - if (_loading) { - notification.warning({ - top: 92, - message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒', - duration: 5 - }) - reject() - return - } - this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit') } }) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 94b0c9a..11c9431 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -530,6 +530,26 @@ return } + if (verify.dataType === 'custom') { + if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { + notification.warning({ + top: 92, + message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒', + duration: 5 + }) + this.setState({activeKey: 'scripts'}) + return + } + } + if (this.columnRef && this.columnRef.state.editingKey) { + notification.warning({ + top: 92, + message: '瀛楁鏈繚瀛橈紒', + duration: 5 + }) + return + } + if (card.intertype === 'system' && verify.dataType !== 'custom' && verify.columns.length > 0 && config.$c_ds && config.setting.interType === 'system' && config.columns && config.columns.length > 0) { let cols = [] let columns = config.columns.map(c => c.field) @@ -587,15 +607,6 @@ }) }) } else if (activeKey === 'columns') { - if (this.columnRef && this.columnRef.state.editingKey) { - notification.warning({ - top: 92, - message: '瀛楁鏈繚瀛橈紒', - duration: 5 - }) - return - } - if (this.props.card.intertype !== 'system' || verify.dataType !== 'custom') { resolve(verify) } else { @@ -614,15 +625,6 @@ }, verify.scripts) } } else if (activeKey === 'scripts') { - if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { - notification.warning({ - top: 92, - message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒', - duration: 5 - }) - return - } - this.setState({loading: true}) this.sqlverify(() => { // 楠岃瘉鎴愬姛 this.setState({ @@ -777,6 +779,7 @@ col.type = col.type || 'text' col.output = col.output || 'true' col.required = col.required || 'false' + col.Width = col.Width || 20 if (!['text', 'image', 'number'].includes(col.type)) { if (/^Decimal/ig.test(col.type)) { -- Gitblit v1.8.0