From 0c1a33a33b45fc3265cb7fef20beb48407cd6c98 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 八月 2023 14:54:06 +0800
Subject: [PATCH] 2023-08-24

---
 src/menu/datasource/verifycard/settingform/index.jsx |  502 ++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 324 insertions(+), 178 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index 3a761bb..6d5fa3e 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -1,38 +1,51 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification, Select, InputNumber, Cascader } from 'antd'
+import { fromJS } from 'immutable'
+import { Form, Row, Col, Input, Radio, Tooltip, notification, Select, InputNumber, Cascader } from 'antd'
+import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import { formRule } from '@/utils/option.js'
 import Utils from '@/utils/utils.js'
+import MenuUtils from '@/utils/utils-custom.js'
 import CodeMirror from '@/templates/zshare/codemirror'
+import KeyInterface from '@/components/keyInterface'
 import './index.scss'
+
+const { TextArea } = Input
 
 class SettingForm extends Component {
   static propTpyes = {
-    dict: PropTypes.object,       // 瀛楀吀椤�
-    menu: PropTypes.any,          // 鑿滃崟閰嶇疆淇℃伅
+    updateStatus: PropTypes.func,
     config: PropTypes.object,     // 缁勪欢閰嶇疆
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
-    modules: PropTypes.array,     // 鍒楄缃�
     columns: PropTypes.array,     // 鍒楄缃�
     scripts: PropTypes.array,     // 鑷畾涔夎剼鏈�
   }
 
   state = {
-    interType: this.props.setting.interType || 'system',
-    laypage: this.props.setting.laypage || 'true',
+    setting: null,
     modules: [],
-    usefulFields: [],
-    useMSearch: this.props.setting.useMSearch || 'false',
-    supModule: this.props.setting.supModule || []
+    innerRules: [],
+    innertip: '',
+    MenuType: '',
+    ismain: false
   }
 
   UNSAFE_componentWillMount () {
-    const { menu, config } = this.props
+    const { config, setting } = this.props
 
-    let modules = this.getModules(menu.components, config.uuid)
-    if (!modules) {
-      modules = []
+    let menu = window.GLOB.customMenu
+    let MenuType = ''
+  
+    if (menu.parentId === 'BillPrintTemp') {
+      MenuType = 'billPrint'
+    }
+
+    let modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces)
+    let ismain = false
+
+    if (menu.Template === 'BaseTable') {
+      ismain = config.name === '涓昏〃'
     }
 
     modules.unshift({
@@ -41,85 +54,63 @@
     })
 
     let usefulFields = sessionStorage.getItem('permFuncField')
+    let innerRules = []
+    let innertip = ''
     if (usefulFields) {
       try {
         usefulFields = JSON.parse(usefulFields)
-      } catch {
-        usefulFields = []
-      }
-    } else {
-      usefulFields = []
-    }
 
-    this.setState({modules, usefulFields})
-  }
-
-  getModules = (components, selfId) => {
-    let modules = components.map(item => {
-      if (item.uuid === selfId) {
-        return {
-          children: null
-        }
-      } else if (item.switchable) {
-        return {
-          value: item.uuid,
-          label: item.name
-        }
-      } else if (item.type === 'tabs') {
-        let _item = {
-          value: item.uuid,
-          label: item.name,
-          children: item.subtabs.map(f_tab => {
-            let subItem = {
-              value: f_tab.uuid,
-              label: f_tab.label,
-              children: this.getModules(f_tab.components, selfId)
-            }
-
-            if (!subItem.children || subItem.children.length === 0) {
-              return {children: null}
-            }
-            return subItem
+        if (usefulFields.length > 0) {
+          innertip = '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ')
+          let str = '^(' + usefulFields.join('|') + ')'
+          let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
+    
+          innerRules.push({
+            pattern: _patten,
+            message: formRule.func.innerMessage
           })
         }
-
-        _item.children = _item.children.filter(t => t.children !== null)
-
-        if (_item.children.length === 0) {
-          return {children: null}
-        }
-
-        return _item
-      } else {
-        return {
-          children: null
-        }
+      } catch (e) {
+        innerRules = []
       }
-    })
-
-    modules = modules.filter(mod => mod.children !== null)
-
-    if (modules.length === 0) {
-      return null
     }
-    return modules
+
+    let _setting = fromJS(setting).toJS()
+    _setting.interType = setting.interType || 'system'
+    _setting.laypage = setting.laypage || 'true'
+    _setting.useMSearch = setting.useMSearch || 'false'
+    _setting.sysInterface = setting.sysInterface || 'false'
+    _setting.supModule = setting.supModule || []
+    _setting.execute = setting.execute || 'true'
+
+    if (_setting.supModule.length > 0 && _setting.supModule[0] !== 'empty') {
+      let has = MenuUtils.checkSupModules(modules, _setting.supModule.slice(-1)[0])
+      if (!has) {
+        _setting.supModule = []
+      }
+    }
+
+    this.setState({modules, innerRules, innertip, setting: _setting, ismain, MenuType})
   }
 
   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.onload === 'false') {
+            values.sync = 'false'
+          }
+
           // 鏁版嵁婧愬墠绔獙璇�
-          if (values.interType === 'system' && values.execute !== 'false' && !values.dataresource) {
-            notification.warning({
-              top: 92,
-              message: '璇峰~鍐欏唴閮ㄥ嚱鏁版垨鏁版嵁婧愶紒',
-              duration: 5
-            })
-            reject()
-            return
-          } else if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) {
+          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)
@@ -152,6 +143,14 @@
               })
               reject()
               return
+            } else if (/,,/ig.test(values.dataresource)) {
+              notification.warning({
+                top: 92,
+                message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�',
+                duration: 5
+              })
+              reject()
+              return
             }
 
             let error = Utils.verifySql(values.dataresource)
@@ -175,24 +174,22 @@
     })
   }
 
-  onRadioChange = (e, key) => {
-    let value = e.target.value
+  onOptionChange = (value, key) => {
+    let setting = fromJS(this.state.setting).toJS()
+    setting[key] = value
 
-    if (key === 'interType') {
-      this.setState({
-        interType: value
-      })
+    this.setState({setting})
+
+    if (key === 'sysInterface' && value === 'true') {
+      this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi})
     }
-  }
-
-  changeSupModule = (val) => {
-    this.setState({supModule: val})
+    this.props.updateStatus(setting)
   }
 
   render() {
-    const { setting, columns, config } = this.props
+    const { columns, config } = this.props
     const { getFieldDecorator } = this.props.form
-    const { interType, modules, useMSearch, laypage, supModule, usefulFields } = this.state
+    const { setting, modules, innerRules, innertip, MenuType } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -205,24 +202,23 @@
       }
     }
 
-    let tooltip = null
-    let rules = []
-
-    if (usefulFields.length > 0) {
-      tooltip = '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ')
-      let str = '^(' + usefulFields.join('|') + ')'
-      let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
-
-      rules.push({
-        pattern: _patten,
-        message: formRule.func.innerMessage
-      })
-    }
-
     return (
       <div className="model-datasource-setting-form-box">
         <Form {...formItemLayout} className="model-setting-form">
           <Row gutter={24}>
+            {config.type === 'interface' ? <Col span={8}>
+              <Form.Item label="鏁版嵁婧愬悕绉�">
+                {getFieldDecorator('name', {
+                  initialValue: setting.name,
+                  rules: [
+                    {
+                      required: true,
+                      message: '璇疯緭鍏ユ暟鎹簮鍚嶇О!'
+                    }
+                  ]
+                })(<Input placeholder={''} autoComplete="off" />)}
+              </Form.Item>
+            </Col> : null}
             <Col span={8}>
               <Form.Item label="琛ㄥ悕">
                 {getFieldDecorator('tableName', {
@@ -230,8 +226,16 @@
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.input'] + '琛ㄥ悕!'
+                      message: '璇疯緭鍏ヨ〃鍚�!'
                     },
+                    {
+                      max: 50,
+                      message: '琛ㄥ悕鏈�闀夸负50涓瓧绗�!'
+                    },
+                    {
+                      pattern: /^[a-zA-Z0-9@_]+$/,
+                      message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝銆佹暟瀛椾互鍙奯'
+                    }
                   ]
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
@@ -239,47 +243,48 @@
             <Col span={8}>
               <Form.Item label="鎺ュ彛绫诲瀷">
                 {getFieldDecorator('interType', {
-                  initialValue: interType,
+                  initialValue: setting.interType,
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.select'] + '鎺ュ彛绫诲瀷!'
+                      message: '璇烽�夋嫨鎺ュ彛绫诲瀷!'
                     },
                   ]
                 })(
-                <Radio.Group onChange={(e) => {this.onRadioChange(e, 'interType')}}>
+                <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'interType')}}>
                   <Radio value="system">绯荤粺</Radio>
                   <Radio value="inner">鍐呴儴</Radio>
                   <Radio value="outer">澶栭儴</Radio>
                 </Radio.Group>)}
               </Form.Item>
             </Col>
-            {interType === 'system' ? <Col span={8}>
+            {setting.interType === 'outer' ? <Col span={8}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title={'鑷畾涔夎剼鏈腑鐨勫彉閲忥紙闄ゆ姤閿欏強鍙敤瀛楁澶栵級锛岄渶浠ユ鏍囪瘑寮�澶淬��'}>
-                  <Icon type="question-circle" />
-                  鍙橀噺鏍囪瘑
+                <Tooltip placement="topLeft" title="涓氬姟绯荤粺鎸囧悓涓�sso涓嬬殑鍏朵粬涓氬姟绯荤粺锛屽閮ㄧ郴缁熸寚涓嶅悓sso涓嬬殑鍏朵粬涓氬姟绯荤粺銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  绯荤粺绫诲瀷
                 </Tooltip>
               }>
-                {getFieldDecorator('varMark', {
-                  initialValue: setting.varMark || '',
+                {getFieldDecorator('sysInterface', {
+                  initialValue: setting.sysInterface,
                   rules: [
                     {
-                      pattern: /^[a-zA-Z_]*$/ig,
-                      message: '璇蜂娇鐢ㄥ瓧姣嶆垨_'
-                    },
-                    {
-                      max: 3,
-                      message: '鏈�澶氫笁涓瓧绗︺��'
+                      required: true,
+                      message: '璇烽�夋嫨绯荤粺绫诲瀷!'
                     }
                   ]
-                })(<Input placeholder={''} autoComplete="off" />)}
+                })(
+                <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'sysInterface')}}>
+                  <Radio value="false">涓氬姟</Radio>
+                  <Radio value="true">鍗曠偣</Radio>
+                  <Radio value="external">澶栭儴</Radio>
+                </Radio.Group>)}
               </Form.Item>
             </Col> : null}
-            {interType === 'inner' ? <Col span={8}>
-              <Form.Item label={tooltip ?
-                <Tooltip placement="topLeft" title={tooltip}>
-                  <Icon type="question-circle" />
+            {setting.interType === 'inner' ? <Col span={8}>
+              <Form.Item label={innertip ?
+                <Tooltip placement="topLeft" title={innertip}>
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   鍐呴儴鍑芥暟
                 </Tooltip> : '鍐呴儴鍑芥暟'
               }>
@@ -288,52 +293,90 @@
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.input'] + '鍐呴儴鍑芥暟!'
+                      message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!'
                     },
-                    ...rules
+                    ...innerRules
                   ]
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'outer' ? <Col span={8}>
+            {setting.interType === 'outer' && setting.sysInterface !== 'external' ? <Col className="outer-interface" span={24}>
               <Form.Item label="鎺ュ彛鍦板潃">
                 {getFieldDecorator('interface', {
-                  initialValue: setting.interface || '',
+                  initialValue: setting.interface || (setting.sysInterface === 'true' ? window.GLOB.mainSystemApi : ''),
+                  rules: [
+                    {
+                      required: setting.sysInterface !== 'true' ? true : false,
+                      message: '璇疯緭鍏ユ帴鍙e湴鍧�!'
+                    }
+                  ]
+                })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)}
+              </Form.Item>
+            </Col> : null}
+            {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}>
+              <Form.Item label="鎺ュ彛鍦板潃">
+                {getFieldDecorator('exInterface', {
+                  initialValue: setting.exInterface,
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!'
+                      message: '璇风紪杈戞帴鍙e湴鍧�!'
                     }
                   ]
-                })(<Input placeholder={''} autoComplete="off" />)}
+                })(<KeyInterface type="develop"/>)}
               </Form.Item>
             </Col> : null}
-            {interType === 'outer' ? <Col span={8}>
+            {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}>
+              <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  姝e紡鍦板潃
+                </Tooltip>
+              }>
+                {getFieldDecorator('proInterface', {
+                  initialValue: setting.proInterface || ''
+                })(<TextArea rows={2}/>)}
+              </Form.Item>
+            </Col> : null}
+            {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}>
+              <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  姝e紡鍦板潃
+                </Tooltip>
+              }>
+                {getFieldDecorator('exProInterface', {
+                  initialValue: setting.exProInterface || ''
+                })(<KeyInterface type="product"/>)}
+              </Form.Item>
+            </Col> : null}
+            {setting.interType === 'outer' ? <Col span={8}>
               <Form.Item label="澶栭儴鍑芥暟">
                 {getFieldDecorator('outerFunc', {
-                  initialValue: setting.outerFunc || '',
-                  rules: [
-
-                  ]
+                  initialValue: setting.outerFunc || ''
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
+            {setting.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" />
+                <Tooltip placement="topLeft" title={`浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愩�傛敞锛氭暟鎹潈闄愭浛鎹㈢ $@ -> /* 鎴� ''銆� @$ -> */ 鎴� ''銆俙}>
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   鏁版嵁婧�
                 </Tooltip>
               }>
                 {getFieldDecorator('dataresource', {
-                  initialValue: setting.dataresource || ''
+                  initialValue: setting.dataresource || '',
+                  rules: [
+                    {
+                      required: setting.execute !== 'false' ? true : false,
+                      message: '璇疯緭鍏ユ暟鎹簮!'
+                    }
+                  ]
                 })(<CodeMirror />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'system' ? <Col span={8}>
+            {setting.interType === 'system' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鏌ヨ鏃讹紝鎼滅储鏉′欢浠here鏉′欢鎷兼帴杩涘叆sql锛岀粺璁℃椂锛屽皢鏁版嵁婧愪腑浠モ�淍+鎼滅储瀛楁+@鈥濈殑鍐呭锛屼互鎼滅储鏉′欢涓殑鍊艰繘琛屾浛鎹㈠悗锛屾彁浜ゆ煡璇紝娉細鏌ヨ绫诲瀷浠呭湪浣跨敤绯荤粺鍑芥暟鏃舵湁鏁堛��'}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   鏌ヨ绫诲瀷
                 </Tooltip>
               }>
@@ -363,65 +406,70 @@
             </Col>
             {/* 鏁扮粍鏁版嵁锛岄渶璁剧疆鎺掑簭瑙勫垯 */}
             {config.format === 'array' ? <Col span={8}>
-              <Form.Item label="榛樿鎺掑簭">
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="濡傛灉鍦ㄨ嚜瀹氫箟鑴氭湰涓娇鐢ㄤ簡@pageSize@鎴朄orderBy@锛岃鍦ㄦ暟鎹簮涓崟鐙啓鎺掑簭璇彞銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  榛樿鎺掑簭
+                </Tooltip>
+              }>
                 {getFieldDecorator('order', {
-                  initialValue: setting.order || '',
+                  initialValue: setting.order || 'ID desc',
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.input'] + '榛樿鎺掑簭!'
+                      message: '璇疯緭鍏ラ粯璁ゆ帓搴�!'
                     }
                   ]
                 })(<Input placeholder={'ID asc, UID desc'} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'system' ? <Col span={8}>
+            {setting.interType === 'system' ? <Col span={8}>
               <Form.Item label="榛樿sql">
                 {getFieldDecorator('execute', {
-                  initialValue: setting.execute || 'true'
+                  initialValue: setting.execute
                 })(
-                <Radio.Group>
+                <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'execute')}}>
                   <Radio value="true">鎵ц</Radio>
                   <Radio value="false">涓嶆墽琛�</Radio>
                 </Radio.Group>)}
               </Form.Item>
             </Col> : null}
-            <Col span={8}>
+            {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') && MenuType !== 'billPrint' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'璇ョ粍浠跺鏋滃彈鍏朵粬缁勪欢鎺у埗锛岃閫夐」鐩稿簲鐨勭粍浠讹紝娌℃湁鏃堕�夆�滄棤鈥濄��'}>
-                  <Icon type="question-circle" />
-                  涓婄骇妯″潡
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  涓婄骇缁勪欢
                 </Tooltip>
               }>
                 {getFieldDecorator('supModule', {
-                  initialValue: supModule,
+                  initialValue: setting.supModule,
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.select'] + '涓婄骇妯″潡!'
+                      message: '璇烽�夋嫨涓婄骇缁勪欢!'
                     }
                   ]
                 })(
-                  <Cascader options={modules} onChange={this.changeSupModule} expandTrigger="hover" placeholder="" />
+                  <Cascader options={modules} onChange={(val) => {this.onOptionChange(val, 'supModule')}} expandTrigger="hover" placeholder="" />
                 )}
               </Form.Item>
-            </Col>
+            </Col> : null}
             {config.pageable ? <Col span={8}>
               <Form.Item label="鍒嗛〉">
                 {getFieldDecorator('laypage', {
                   initialValue: setting.laypage || 'true'
                 })(
-                  <Radio.Group onChange={(e) => this.setState({laypage: e.target.value})}>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'laypage')}}>
                     <Radio value="true">鏄�</Radio>
                     <Radio value="false">鍚�</Radio>
                   </Radio.Group>
                 )}
               </Form.Item>
             </Col> : null}
-            {config.pageable && laypage !== 'false' ? <Col span={8}>
+            {config.pageable && setting.laypage !== 'false' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="閫夋嫨鍒嗛〉鏃舵湁鏁堛��">
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   姣忛〉鏁伴噺
                 </Tooltip>
               }>
@@ -430,17 +478,17 @@
                   rules: [
                     {
                       required: true,
-                      message: this.props.dict['form.required.input'] + '姣忛〉鏁伴噺!'
+                      message: '璇疯緭鍏ユ瘡椤垫暟閲�!'
                     }
                   ]
                 })(<InputNumber min={1} max={500} precision={0} />)}
               </Form.Item>
             </Col> : null}
             {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */}
-            {(!config.pageable || (config.pageable && laypage === 'false')) && (!supModule || supModule.length === 0 || supModule[0] === 'empty') ? <Col span={8}>
+            {!['navbar', 'interface', 'calendar'].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' && setting.onload !== 'false' ? <Col span={8}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}>
-                  <Icon type="question-circle" />
+                <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細濡傝彍鍗曟湭浣跨敤鍚庣缂撳瓨锛屽垯鏌ヨ璇彞澶т簬8000瀛楃鏃舵棤鏁堛��'}>
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   鍚屾鏌ヨ
                 </Tooltip>
               }>
@@ -454,52 +502,150 @@
                 )}
               </Form.Item>
             </Col> : null}
-            <Col span={8}>
+            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && !['basetable'].includes(config.subtype) ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'浼樺厛浣跨敤鍚岀骇鐨勬悳绱㈡潯浠剁粍浠讹紝鍚岀骇鎼滅储涓嶅瓨鍦ㄦ椂锛屼緷娆″悜涓婇�夊彇锛屼笌褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵竴鍚岀敤浣滄暟鎹繃婊わ紙褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵紭鍏堬級銆�'}>
-                  <Icon type="question-circle" />
-                  澶栧眰鎼滅储
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  澶栭儴鎼滅储
                 </Tooltip>
               }>
                 {getFieldDecorator('useMSearch', {
-                  initialValue: setting.useMSearch || 'false'
+                  initialValue: setting.useMSearch || 'true'
                 })(
-                  <Radio.Group onChange={(e) => this.setState({useMSearch: e.target.value})}>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}>
                     <Radio value="true">浣跨敤</Radio>
                     <Radio value="false">涓嶄娇鐢�</Radio>
                   </Radio.Group>
                 )}
               </Form.Item>
-            </Col>
-            {useMSearch === 'true' ? <Col span={8}>
+            </Col> : null}
+            {config.subtype === 'basetable' && !this.state.ismain ? <Col span={8}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title={'澶栧眰鎼滅储鏉′欢鏀瑰彉鏃讹紝鏄惁鍒锋柊褰撳墠缁勪欢鏁版嵁銆�'}>
-                  <Icon type="question-circle" />
-                  鍚屾鍒锋柊
+                <Tooltip placement="topLeft" title="鏄惁浣跨敤涓昏〃鐨勬悳绱㈡潯浠�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  涓昏〃鎼滅储
                 </Tooltip>
               }>
-                {getFieldDecorator('syncRefresh', {
-                  initialValue: setting.syncRefresh || 'true'
+                {getFieldDecorator('useMSearch', {
+                  initialValue: setting.useMSearch || 'false'
                 })(
-                  <Radio.Group>
-                    <Radio value="true">鏄�</Radio>
-                    <Radio value="false">鍚�</Radio>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}>
+                    <Radio value="true">浣跨敤</Radio>
+                    <Radio value="false">涓嶄娇鐢�</Radio>
                   </Radio.Group>
                 )}
               </Form.Item>
             </Col> : null}
-            <Col span={8}>
+            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}>
               <Form.Item label="鍒濆鍖栨暟鎹�">
                 {getFieldDecorator('onload', {
                   initialValue: setting.onload || 'true'
                 })(
-                  <Radio.Group>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}>
                     <Radio value="true">鍔犺浇</Radio>
                     <Radio value="false">涓嶅姞杞�</Radio>
                   </Radio.Group>
                 )}
               </Form.Item>
-            </Col>
+            </Col> : null}
+            {config.type === 'interface' && ((setting.supModule && setting.supModule[0] === 'empty') || MenuType === 'billPrint') ? <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="鍒濆鍖栧姞杞藉皢鍦ㄩ〉闈㈠姞杞藉墠鎵ц銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  鍔犺浇鏂瑰紡
+                </Tooltip>
+              }>
+                {getFieldDecorator('loadlevel', {
+                  initialValue: setting.loadlevel || 'default'
+                })(
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'loadlevel')}}>
+                    <Radio value="default">榛樿</Radio>
+                    <Radio value="init">鍒濆鍖�</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col> : null}
+            {config.type === 'interface' && MenuType !== 'billPrint' ? <Col span={8}>
+              <Form.Item label="瀹氭椂鍣�">
+                {getFieldDecorator('timer', {
+                  initialValue: setting.timer || ''
+                })(
+                  <Select onChange={(value) => {this.onOptionChange(value, 'timer')}}>
+                    <Select.Option value=""> 鏃� </Select.Option>
+                    <Select.Option value="2s"> 2绉� </Select.Option>
+                    <Select.Option value="5s"> 5绉� </Select.Option>
+                    <Select.Option value="15s"> 15绉� </Select.Option>
+                    <Select.Option value="30s"> 30绉� </Select.Option>
+                    <Select.Option value="1min"> 1鍒嗛挓 </Select.Option>
+                    <Select.Option value="5min"> 5鍒嗛挓 </Select.Option>
+                    <Select.Option value="10min"> 10鍒嗛挓 </Select.Option>
+                    <Select.Option value="15min"> 15鍒嗛挓 </Select.Option>
+                    <Select.Option value="30min"> 30鍒嗛挓 </Select.Option>
+                    <Select.Option value="1hour"> 1灏忔椂 </Select.Option>
+                  </Select>
+                )}
+              </Form.Item>
+            </Col> : null}
+            {config.type === 'interface' && setting.timer ? <Col span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="瀹氭椂鍣ㄦ墽琛屾鏁般�傛敞锛�0琛ㄧず娌℃湁闄愬埗銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  鎵ц娆℃暟
+                </Tooltip>
+              }>
+                {getFieldDecorator('timerRepeats', {
+                  initialValue: setting.timerRepeats || 0
+                })(<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