From 326aa6b3effaccc71cfe0775d47b0f29eb3695a6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 25 八月 2024 00:36:40 +0800 Subject: [PATCH] 2024-08-25 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 67 +++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 9986355..f22a3ef 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -259,12 +259,8 @@ let _sheet = this.props.card.sheet - if (window.GLOB.externalDatabase !== null) { - _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase) - } - - let database = _sheet.match(/(.*)\.(.*)\./ig) - let sheet = _sheet.replace(/(.*)\.(.*)\./ig, '') + let database = _sheet.match(/(.*)\.(.*)\.|@db@/ig) || '' + let sheet = _sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') database = database ? (database[0] || '') : '' @@ -403,6 +399,16 @@ _verify.columns = _columns _verify.scripts = _verify.scripts || [] _verify.uniques = _verify.uniques || [] + + if (window.GLOB.process && card.intertype === 'system') { + _verify.workFlow = _verify.workFlow || 'false' + _verify.flowType = 'start' + _verify.flowSql = _verify.flowSql || 'true' + } else { + delete _verify.workFlow + delete _verify.flowType + delete _verify.flowSql + } this.setState({ searchKey: '', @@ -590,18 +596,18 @@ clearField = () => { const { verify } = this.state - const _this = this + const that = this confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, onOk() { - _this.setState({ + that.setState({ verify: { ...verify, columns: [] } }, () => { - _this.resetUniqueColumns() + that.resetUniqueColumns() }) }, onCancel() {} @@ -879,21 +885,11 @@ }) } - onOptionChange = (e) => { + onOptionChange = (value, key) => { const { verify } = this.state - let value = e.target.value this.setState({ - verify: {...verify, default: value} - }) - } - - onHandleChange = (e) => { - const { verify } = this.state - let value = e.target.value - - this.setState({ - verify: {...verify, excelHandle: value} + verify: {...verify, [key]: value} }) } @@ -975,8 +971,8 @@ <Form {...formItemLayout}> <Row gutter={24}> {card.intertype === 'system' ? <Col span={8}> - <Form.Item label={'榛樿sql'}> - <Radio.Group value={verify.default} onChange={this.onOptionChange}> + <Form.Item label="榛樿sql"> + <Radio.Group value={verify.default} onChange={(e) => this.onOptionChange(e.target.value, 'default')}> <Radio value="true">鎵ц</Radio> <Radio value="false">涓嶆墽琛�</Radio> </Radio.Group> @@ -992,7 +988,7 @@ {getFieldDecorator('excelHandle', { initialValue: verify.excelHandle })( - <Radio.Group onChange={this.onHandleChange}> + <Radio.Group onChange={(e) => this.onOptionChange(e.target.value, 'excelHandle')}> <Radio value="false">榛樿</Radio> <Radio value="true">鑷畾涔�</Radio> </Radio.Group>)} @@ -1041,6 +1037,27 @@ })(<CodeMirror mode="text/javascript" theme="cobalt" />)} </Form.Item> </Col> : null} + {window.GLOB.process && card.intertype === 'system' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="瀵煎叆Excel宸ヤ綔娴佷粎鏀寔鍙戣捣娴佺▼銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 宸ヤ綔娴� + </Tooltip> + }> + <Radio.Group value={verify.workFlow} onChange={(e) => {this.onOptionChange(e.target.value, 'workFlow')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} + {verify.workFlow === 'true' ? <Col span={8}> + <Form.Item label="榛樿sql锛堝伐浣滄祦锛�"> + <Radio.Group value={verify.flowSql} onChange={(e) => {this.onOptionChange(e.target.value, 'flowSql')}}> + <Radio value="true">鎵ц</Radio> + <Radio value="false">涓嶆墽琛�</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} </Row> </Form> </TabPane> @@ -1087,6 +1104,7 @@ btn={this.props.card} usefulfields={verify.columns} scripts={verify.scripts} + workFlow={verify.workFlow} systemScripts={this.state.systemScripts} scriptsChange={this.scriptsChange} wrappedComponentRef={(inst) => this.scriptsFullForm = inst} @@ -1096,6 +1114,7 @@ btn={this.props.card} usefulfields={verify.columns} scripts={verify.scripts} + workFlow={verify.workFlow} systemScripts={this.state.systemScripts} scriptsChange={this.scriptsChange} wrappedComponentRef={(inst) => this.scriptsForm = inst} -- Gitblit v1.8.0