From 6ee201b2f734c9e704fb989aca0dabd09890c724 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 23 二月 2024 18:07:18 +0800
Subject: [PATCH] Merge branch 'positec' into dms

---
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx |   90 ++++++++++++++++++++++++++++++++------------
 1 files changed, 65 insertions(+), 25 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
index 5dd577b..a8733e8 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -19,7 +19,9 @@
 const { confirm } = Modal
 const { Search } = Input
 const { Paragraph } = Typography
+
 const EditTable = asyncComponent(() => import('@/templates/zshare/editTable'))
+const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror'))
 const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts'))
 
 class VerifyCard extends Component {
@@ -307,17 +309,17 @@
       _verify.range = 1
     }
 
+    _verify.excelHandle = _verify.excelHandle || 'false'
+    _verify.default = _verify.default || 'true'
+    _verify.sheet = _verify.sheet || 'Sheet1'
+    _verify.range = _verify.range || 0
+    _verify.columns = _columns
+    _verify.scripts = _verify.scripts || []
+    _verify.uniques = _verify.uniques || []
+
     this.setState({
       searchKey: '',
-      verify: {
-        ..._verify,
-        default: _verify.default || 'true',
-        sheet: _verify.sheet || 'Sheet1',
-        range: _verify.range || 0,
-        columns: _columns,
-        scripts: _verify.scripts || [],
-        uniques: _verify.uniques || []
-      }
+      verify: _verify
     }, () => {
       this.resetUniqueColumns()
     })
@@ -712,6 +714,10 @@
         if (!err) {
           let _verify = {...verify, ...values}
 
+          if (_verify.excelHandle !== 'true') {
+            delete _verify.excel_func
+          }
+
           let cols = _verify.columns.map(col => col.Column.toLowerCase())
           cols = Array.from(new Set(cols))
 
@@ -771,22 +777,27 @@
             resolve(_verify)
           }
         } else {
-          notification.warning({
-            top: 92,
-            message: '璇疯缃瓻xcel琛ㄥ悕!',
-            duration: 5
-          })
+          this.setState({activeKey: 'basemsg'})
         }
       })
     })
   }
 
-  onOptionChange = (e, key) => {
+  onOptionChange = (e) => {
     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}
     })
   }
 
@@ -867,7 +878,44 @@
           <TabPane tab="鍩虹楠岃瘉" key="basemsg">
             <Form {...formItemLayout}>
               <Row gutter={24}>
+                {card.intertype === 'system' ? <Col span={8}>
+                  <Form.Item label={'榛樿sql'}>
+                    <Radio.Group value={verify.default} onChange={this.onOptionChange}>
+                      <Radio value="true">鎵ц</Radio>
+                      <Radio value="false">涓嶆墽琛�</Radio>
+                    </Radio.Group>
+                  </Form.Item>
+                </Col> : null}
                 <Col span={8}>
+                  <Form.Item label={
+                    <Tooltip placement="topRight" title="鑷畾涔夐獙璇丒xcel鏍煎紡锛屽彲鐢ㄥ弬鏁颁负 XLSX銆亀orkbook銆乥tn銆乧allback銆�">
+                      <QuestionCircleOutlined className="mk-form-tip" />
+                      瀵煎叆鏍煎紡
+                    </Tooltip>
+                  }>
+                    {getFieldDecorator('excelHandle', {
+                      initialValue: verify.excelHandle
+                    })(
+                    <Radio.Group onChange={this.onHandleChange}>
+                      <Radio value="false">榛樿</Radio>
+                      <Radio value="true">鑷畾涔�</Radio>
+                    </Radio.Group>)}
+                  </Form.Item>
+                </Col>
+                {verify.excelHandle === 'true' ? <Col span={24} style={{paddingLeft: '30px'}}>
+                  <Form.Item wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} } label="">
+                    {getFieldDecorator('excel_func', {
+                      initialValue: verify.excel_func || '',
+                      rules: [
+                        {
+                          required: true,
+                          message: '璇峰~鍐欒嚜瀹氫箟閫昏緫!'
+                        }
+                      ]
+                    })(<CodeMirror mode="text/javascript" theme="cobalt" />)}
+                  </Form.Item>
+                </Col> : null}
+                {verify.excelHandle !== 'true' ? <Col span={8}>
                   <Form.Item label={
                     <Tooltip placement="bottomLeft" title="瀵煎叆鏃跺伐浣滆〃鍚嶄笌excel涓繀椤讳竴鑷达紝娉細宸ヤ綔琛ㄥ悕涓篠heet1涓攅xcel涓粎鏈変竴涓伐浣滆〃鏃朵笉杩涜琛ㄥ悕楠岃瘉銆�">
                       <QuestionCircleOutlined className="mk-form-tip" />
@@ -884,8 +932,8 @@
                       ]
                     })(<Input placeholder="" autoComplete="off" />)}
                   </Form.Item>
-                </Col>
-                <Col span={8}>
+                </Col> : null}
+                {verify.excelHandle !== 'true' ? <Col span={8}>
                   <Form.Item label={
                     <Tooltip placement="bottomLeft" title="蹇界暐棣栬鏃讹紝浼氭牎楠宔xcel涓〃澶村悕绉颁笌excel鍒楄缃槸鍚︿竴鑷淬��">
                       <QuestionCircleOutlined className="mk-form-tip" />
@@ -895,14 +943,6 @@
                     {getFieldDecorator('range', {
                       initialValue: verify.range || 0
                     })(<InputNumber min={0} max={100} precision={0} />)}
-                  </Form.Item>
-                </Col>
-                {card.intertype === 'system' ? <Col span={8}>
-                  <Form.Item label={'榛樿sql'}>
-                    <Radio.Group value={verify.default} onChange={this.onOptionChange}>
-                      <Radio value="true">鎵ц</Radio>
-                      <Radio value="false">涓嶆墽琛�</Radio>
-                    </Radio.Group>
                   </Form.Item>
                 </Col> : null}
               </Row>

--
Gitblit v1.8.0