From 1bec8d69cf14bd88591eee5b0320c5c8f6c25a08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 三月 2024 21:19:31 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 182 +++++++++++++++++++++++++++------------------ 1 files changed, 109 insertions(+), 73 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 2afb057..21d53fe 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -67,7 +67,8 @@ inputType: 'select', editable: true, required: false, - width: '12%', + keyCol: true, + width: '8%', render: (text) => { if (text === 'image') { return '鍥剧墖' @@ -84,44 +85,12 @@ ] }, { - title: '鍙栫粷瀵瑰��', - dataIndex: 'abs', - inputType: 'radio', - editable: true, - required: false, - width: '12%', - render: (text, record) => { - if (record.type !== 'number') return '' - - if (text === 'true') { - return '鏄�' - } else { - return '鍚�' - } - }, - options: [ - {value: 'true', text: '鏄�'}, - {value: 'false', text: '鍚�'} - ] - }, - { - title: '灏忔暟浣�', - dataIndex: 'decimal', - inputType: 'number', - min: 0, - max: 18, - editable: true, - required: false, - width: '12%', - render: (text, record) => record.type === 'number' ? text : '' - }, - { title: '瀵煎嚭', dataIndex: 'output', inputType: 'radio', editable: true, required: false, - width: '12%', + width: '10%', render: (text) => { if (text !== 'false') { return '鏄�' @@ -146,6 +115,62 @@ {value: 'false', text: '鍚�'} ] }, + { + title: '鍙栫粷瀵瑰��', + dataIndex: 'abs', + inputType: 'radio', + editable: true, + required: false, + keyVals: ['number'], + width: '10%', + render: (text, record) => { + if (record.type !== 'number') return '' + + if (text === 'true') { + return '鏄�' + } else { + return '鍚�' + } + }, + options: [ + {value: 'true', text: '鏄�'}, + {value: 'false', text: '鍚�'} + ] + }, + { + title: '0鍊煎鍑�', + dataIndex: 'noValue', + inputType: 'radio', + editable: true, + required: false, + keyVals: ['number'], + width: '10%', + render: (text, record) => { + if (record.type !== 'number') return '' + + if (text !== 'false') { + return '鏄�' + } else { + return '鍚�' + } + }, + options: [ + {value: 'true', text: '鏄�'}, + {value: 'false', text: '鍚�'} + ] + }, + { + title: '灏忔暟浣�', + dataIndex: 'decimal', + inputType: 'number', + min: 0, + max: 18, + editable: true, + required: false, + keyVals: ['number'], + width: '12%', + render: (text, record) => record.type === 'number' ? text : '' + } ], scriptsColumns: [ { @@ -232,6 +257,7 @@ col.type = col.type || 'text' col.output = col.output || 'true' col.required = col.required || 'false' + col.noValue = col.noValue || 'true' if (!['text', 'image', 'number'].includes(col.type)) { if (/^Decimal/ig.test(col.type)) { @@ -408,7 +434,7 @@ }) } - columnChange = (values) => { + columnChange = (values, callback) => { let verify = JSON.parse(JSON.stringify(this.state.verify)) let fields = verify.columns.map(item => item.Column) @@ -419,6 +445,8 @@ duration: 5 }) return + } else { + callback() } values.uuid = Utils.getuuid() values.abs = 'false' @@ -525,6 +553,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) @@ -582,15 +630,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 { @@ -609,15 +648,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({ @@ -772,6 +802,8 @@ col.type = col.type || 'text' col.output = col.output || 'true' col.required = col.required || 'false' + col.noValue = col.noValue || 'true' + col.Width = col.Width || 20 if (!['text', 'image', 'number'].includes(col.type)) { if (/^Decimal/ig.test(col.type)) { @@ -808,28 +840,32 @@ const { card } = this.props const { activeKey, verify } = this.state - if (card.intertype !== 'system' || verify.dataType !== 'custom') { + if (activeKey === 'setting') { + this.settingForm.handleConfirm().then(res => { + if (card.intertype !== 'system' || verify.dataType !== 'custom') { + this.setState({activeKey: val, verify: {...verify, ...res}}) + } else { + this.setState({ + verify: {...verify, ...res} + }, () => { + this.setState({loading: true}) + this.sqlverify(() => { // 楠岃瘉鎴愬姛 + this.setState({ + activeKey: val, + loading: false + }) + }, () => { // 楠岃瘉澶辫触 + this.setState({ + activeKey: val, + loading: false + }) + }, verify.scripts) + }) + } + }) + } else if (card.intertype !== 'system' || verify.dataType !== 'custom') { this.setState({activeKey: val}) return - } else if (activeKey === 'setting') { - this.settingForm.handleConfirm().then(res => { - this.setState({ - verify: {...verify, ...res} - }, () => { - this.setState({loading: true}) - this.sqlverify(() => { // 楠岃瘉鎴愬姛 - this.setState({ - activeKey: val, - loading: false - }) - }, () => { // 楠岃瘉澶辫触 - this.setState({ - activeKey: val, - loading: false - }) - }, verify.scripts) - }) - }) } else if (activeKey === 'columns') { if (this.columnRef && this.columnRef.state.editingKey) { notification.warning({ -- Gitblit v1.8.0