From 4fc1eb4913f3302679d88ec01099fc8dd3a80f81 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 08 三月 2023 23:27:21 +0800
Subject: [PATCH] 2023-03-08

---
 src/menu/datasource/verifycard/settingform/index.jsx |   63 +++++++++++++++++++++++++++++--
 1 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index 9081182..de02f21 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -15,6 +15,7 @@
 
 class SettingForm extends Component {
   static propTpyes = {
+    updateStatus: PropTypes.func,
     config: PropTypes.object,     // 缁勪欢閰嶇疆
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
     columns: PropTypes.array,     // 鍒楄缃�
@@ -85,11 +86,16 @@
   }
 
   handleConfirm = () => {
+    const { config } = this.props
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
           values.sync = values.sync || 'false'
+
+          if (['navbar', 'balcony', 'menubar', 'interface'].includes(config.type)) {
+            values.onload = 'true'
+          }
 
           // 鏁版嵁婧愬墠绔獙璇�
           if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) {
@@ -157,6 +163,7 @@
     if (key === 'sysInterface' && value === 'true') {
       this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi})
     }
+    this.props.updateStatus(setting)
   }
 
   render() {
@@ -206,8 +213,8 @@
                       message: '琛ㄥ悕鏈�闀夸负50涓瓧绗�!'
                     },
                     {
-                      pattern: /^[a-zA-Z@_]+$/,
-                      message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝浠ュ強_'
+                      pattern: /^[a-zA-Z0-9@_]+$/,
+                      message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝銆佹暟瀛椾互鍙奯'
                     }
                   ]
                 })(<Input placeholder={''} autoComplete="off" />)}
@@ -402,7 +409,7 @@
                 </Radio.Group>)}
               </Form.Item>
             </Col> : null}
-            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') ? <Col span={8}>
+            {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'璇ョ粍浠跺鏋滃彈鍏朵粬缁勪欢鎺у埗锛岃閫夐」鐩稿簲鐨勭粍浠讹紝娌℃湁鏃堕�夆�滄棤鈥濄��'}>
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -453,7 +460,7 @@
               </Form.Item>
             </Col> : null}
             {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */}
-            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}>
+            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}>
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -549,6 +556,54 @@
                 })(<InputNumber min={0} max={500} precision={0} />)}
               </Form.Item>
             </Col> : null}
+            {config.subtype === 'dualdatacard' ? <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="瀛愯〃鍦ㄤ富琛ㄤ腑鐨勬暟鎹泦鍚嶇О銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  瀛愯〃瀛楁
+                </Tooltip>
+              }>
+                {getFieldDecorator('subdata', {
+                  initialValue: setting.subdata || 'sub_data',
+                  rules: [
+                    {
+                      required: true,
+                      message: '璇疯緭鍏ラ粯璁ゆ帓搴�!'
+                    }
+                  ]
+                })(<Input placeholder={''} autoComplete="off" />)}
+              </Form.Item>
+            </Col> : null}
+            {config.subtype === 'dualdatacard' ? <Col span={8}>
+              <Form.Item label="瀛愯〃涓婚敭">
+                {getFieldDecorator('subKey', {
+                  initialValue: setting.subKey || ''
+                })(
+                  <Select>
+                    {this.props.subColumns.map((option, i) =>
+                      <Select.Option key={i} value={option.field}>
+                        {option.label}
+                      </Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
+            </Col> : null}
+            {config.subtype === 'dualdatacard' ? <Col span={8}>
+              <Form.Item label="瀛愯〃BID">
+                {getFieldDecorator('subBID', {
+                  initialValue: setting.subBID || ''
+                })(
+                  <Select>
+                    {this.props.subColumns.map((option, i) =>
+                      <Select.Option key={i} value={option.field}>
+                        {option.label}
+                      </Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
+            </Col> : null}
           </Row>
         </Form>
       </div>

--
Gitblit v1.8.0