From af02b8f3c3ec9e5684be1084904d673429421d2b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 03 九月 2020 16:40:47 +0800
Subject: [PATCH] 2020-09-03

---
 src/menu/datasourcecomponent/verifycard/settingform/index.jsx |   87 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 72 insertions(+), 15 deletions(-)

diff --git a/src/menu/datasourcecomponent/verifycard/settingform/index.jsx b/src/menu/datasourcecomponent/verifycard/settingform/index.jsx
index 5458009..9cdeb01 100644
--- a/src/menu/datasourcecomponent/verifycard/settingform/index.jsx
+++ b/src/menu/datasourcecomponent/verifycard/settingform/index.jsx
@@ -14,13 +14,14 @@
     dict: PropTypes.object,       // 瀛楀吀椤�
     menuId: PropTypes.string,     // 鑿滃崟Id
     permFuncField: PropTypes.any, // 鑿滃崟Id
+    config: PropTypes.object,     // 缁勪欢閰嶇疆
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
     columns: PropTypes.array,     // 鍒楄缃�
     scripts: PropTypes.array,     // 鑷畾涔夎剼鏈�
   }
 
   state = {
-    interType: this.props.setting.interType || 'inner',
+    interType: this.props.setting.interType || 'system',
   }
 
   handleConfirm = () => {
@@ -30,7 +31,7 @@
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
           // 鏁版嵁婧愬墠绔獙璇�
-          if (values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' && !values.dataresource) {
+          if (values.interType === 'system' && values.execute !== 'false' && !values.dataresource) {
             notification.warning({
               top: 92,
               message: '璇峰~鍐欏唴閮ㄥ嚱鏁版垨鏁版嵁婧愶紒',
@@ -38,7 +39,7 @@
             })
             reject()
             return
-          } else if (values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' && values.dataresource) {
+          } else if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) {
             let _quot = values.dataresource.match(/'{1}/g)
             let _lparen = values.dataresource.match(/\({1}/g)
             let _rparen = values.dataresource.match(/\){1}/g)
@@ -88,7 +89,7 @@
 
           // 鏁版嵁婧愪繚瀛�
           if (
-            values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' &&
+            values.interType === 'system' && values.execute !== 'false' &&
             /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource
           ) {
             let param = {
@@ -123,7 +124,7 @@
   }
 
   render() {
-    const { setting, permFuncField, columns } = this.props
+    const { setting, permFuncField, columns, config } = this.props
     const { getFieldDecorator } = this.props.form
     const { interType } = this.state
 
@@ -224,6 +225,7 @@
                   ]
                 })(
                 <Radio.Group onChange={(e) => {this.onRadioChange(e, 'interType')}}>
+                  <Radio value="system">绯荤粺</Radio>
                   <Radio value="inner">鍐呴儴</Radio>
                   <Radio value="outer">澶栭儴</Radio>
                 </Radio.Group>)}
@@ -238,7 +240,13 @@
               }>
                 {getFieldDecorator('innerFunc', {
                   initialValue: setting.innerFunc || '',
-                  rules: rules
+                  rules: [
+                    {
+                      required: true,
+                      message: this.props.dict['form.required.input'] + '鍐呴儴鍑芥暟!'
+                    },
+                    ...rules
+                  ]
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
@@ -250,7 +258,7 @@
                     {
                       required: true,
                       message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!'
-                    },
+                    }
                   ]
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
@@ -265,7 +273,7 @@
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'inner' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
+            {interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
               <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={
                 <Tooltip placement="topLeft" title={'浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愩�傛敞锛氭暟鎹潈闄愭浛鎹㈢ $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\''}>
                   <Icon type="question-circle" />
@@ -289,7 +297,7 @@
                 })(<InputNumber min={150} max={1500} precision={0} />)}
               </Form.Item>
             </Col>
-            {interType === 'inner' ? <Col span={8}>
+            {interType === 'system' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鏌ヨ鏃讹紝鎼滅储鏉′欢浠here鏉′欢鎷兼帴杩涘叆sql锛岀粺璁℃椂锛屽皢鏁版嵁婧愪腑浠モ�淍+鎼滅储瀛楁+@鈥濈殑鍐呭锛屼互鎼滅储鏉′欢涓殑鍊艰繘琛屾浛鎹㈠悗锛屾彁浜ゆ煡璇紝娉細鏌ヨ绫诲瀷浠呭湪浣跨敤绯荤粺鍑芥暟鏃舵湁鏁堛��'}>
                   <Icon type="question-circle" />
@@ -320,7 +328,21 @@
                 )}
               </Form.Item>
             </Col>
-            {interType === 'inner' ? <Col span={8}>
+            {/* 鏁扮粍鏁版嵁锛岄渶璁剧疆鎺掑簭瑙勫垯 */}
+            {config.format === 'array' ? <Col span={8}>
+              <Form.Item label="榛樿鎺掑簭">
+                {getFieldDecorator('order', {
+                  initialValue: setting.order || '',
+                  rules: [
+                    {
+                      required: true,
+                      message: this.props.dict['form.required.input'] + '榛樿鎺掑簭!'
+                    }
+                  ]
+                })(<Input placeholder={'ID asc, UID desc'} autoComplete="off" />)}
+              </Form.Item>
+            </Col> : null}
+            {interType === 'system' ? <Col span={8}>
               <Form.Item label="榛樿sql">
                 {getFieldDecorator('execute', {
                   initialValue: setting.execute || 'true'
@@ -332,14 +354,49 @@
               </Form.Item>
             </Col> : null}
             <Col span={8}>
-              <Form.Item label="鍒濆鍖栨暟鎹�">
+              <Form.Item label="鍒濆鍖�">
                 {getFieldDecorator('onload', {
                   initialValue: setting.onload || 'true'
                 })(
-                <Radio.Group>
-                  <Radio value="true">鍔犺浇</Radio>
-                  <Radio value="false">涓嶅姞杞�</Radio>
-                </Radio.Group>)}
+                  <Radio.Group>
+                    <Radio value="true">鍔犺浇鏁版嵁</Radio>
+                    <Radio value="false">涓嶅姞杞芥暟鎹�</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col>
+            {!config.laypage ? <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥銆�'}>
+                  <Icon type="question-circle" />
+                  鍚屾鏌ヨ
+                </Tooltip>
+              }>
+                {getFieldDecorator('sync', {
+                  initialValue: setting.sync || 'true'
+                })(
+                  <Radio.Group>
+                    <Radio value="true">鏄�</Radio>
+                    <Radio value="false">鍚�</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col> : null}
+            <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title={'浣跨敤涓绘悳绱㈡潯浠讹紙瀛樺湪鏃讹級锛屼富鎼滅储鏉′欢涓庣粍浠剁殑鎼滅储鏉′欢浼氫竴鍚岀敤浣滄暟鎹繃婊わ紙缁勪欢鐨勬悳绱㈡潯浠朵紭鍏堬級銆�'}>
+                  <Icon type="question-circle" />
+                  涓绘悳绱�
+                </Tooltip>
+              }>
+                {getFieldDecorator('useMSearch', {
+                  initialValue: setting.useMSearch || 'false'
+                })(
+                  <Radio.Group>
+                    <Radio value="true">浣跨敤</Radio>
+                    <Radio value="false">涓嶄娇鐢�</Radio>
+                  </Radio.Group>
+                )}
               </Form.Item>
             </Col>
           </Row>

--
Gitblit v1.8.0