From 2aa5ab63b4bbce5c36dbb3511b205b3b5f6af9bd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 07 五月 2024 11:34:20 +0800
Subject: [PATCH] 2024-05-07

---
 src/templates/zshare/verifycard/baseform/index.jsx |  400 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 344 insertions(+), 56 deletions(-)

diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx
index 49dbd06..3e4403f 100644
--- a/src/templates/zshare/verifycard/baseform/index.jsx
+++ b/src/templates/zshare/verifycard/baseform/index.jsx
@@ -5,10 +5,11 @@
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
-import asyncComponent from '@/utils/asyncComponent'
+import MkPrintTemps from '@/menu/components/share/actioncomponent/actionform/mkPrintTemps'
+import CodeMirror from '@/templates/zshare/codemirror'
 import './index.scss'
 
-const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
+const sysTempsIds = ['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok']
 
 class BillCodeForm extends Component {
   static propTpyes = {
@@ -16,20 +17,21 @@
     verify: PropTypes.object,
     unionFields: PropTypes.array,
     notes: PropTypes.array,
+    emailCodes: PropTypes.array,
+    appType: PropTypes.any,
     onChange: PropTypes.func
   }
 
   state = {
     wxTemps: [],
     selectTemp: null,
-    miniTemps: [],
+    miniTemps: []
   }
 
   componentDidMount() {
-    const { verify } = this.props
     let wxTemps = sessionStorage.getItem('wxTemplates')
 
-    if (window.GLOB.WXAppID && !wxTemps) {
+    if (window.GLOB.WXAppID && window.GLOB.nginx && !wxTemps) {
       Api.wxAccessToken().then(res => {
         let wxtoken = res.oa_access_token || ''
         // let minitoken = res.mini_access_token || ''
@@ -38,21 +40,22 @@
           Api.wxNginxRequest(`cgi-bin/template/get_all_private_template?access_token=${wxtoken}`, 'get').then(res => {
             let temps = []
             if (res.template_list) {
-              temps = res.template_list.filter(item => item.primary_industry)
-              let selectTemp = temps.filter(item => item.template_id === verify.wxTemplateId)[0]
+              temps = res.template_list.filter(item => {
+                if (!item.primary_industry || sysTempsIds.includes(item.template_id)) return false
+                if (item.content) {
+                  item.content = item.content.replace('{{first.DATA}}\n', '').replace('\n{{remark.DATA}}', '')
+                }
 
-              if (selectTemp) {
-                selectTemp.content = selectTemp.content.replace(/\r\n|\n/g, '<br/>')
-                selectTemp.example = selectTemp.example.replace(/\r\n|\n/g, '<br/>')
-              }
-
-              this.setState({wxTemps: temps, selectTemp})
+                return true
+              })
             }
-
+            
             sessionStorage.setItem('wxTemplates', JSON.stringify(temps))
             localStorage.setItem('wxTemplates', JSON.stringify(temps))
 
             localStorage.removeItem('wxTemplates')
+
+            this.resetTemps(temps)
           })
         } else {
           sessionStorage.setItem('wxTemplates', JSON.stringify([]))
@@ -75,15 +78,50 @@
     } else if (wxTemps) {
       wxTemps = JSON.parse(wxTemps)
 
-      let selectTemp = wxTemps.filter(item => item.template_id === verify.wxTemplateId)[0]
-
-      if (selectTemp) {
-        selectTemp.content = selectTemp.content.replace(/\r\n|\n/g, '<br/>')
-        selectTemp.example = selectTemp.example.replace(/\r\n|\n/g, '<br/>')
-      }
-  
-      this.setState({wxTemps, selectTemp})
+      this.resetTemps(wxTemps)
     }
+  }
+
+  resetTemps = (wxTemps) => {
+    const { verify } = this.props
+
+    let sysTemps = [
+      {
+        template_id: '8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo',
+        title: '璁㈠崟鍙楃悊閫氱煡锛堟槑绉戜簯锛�',
+        primary_industry: 'IT绉戞妧',
+        deputy_industry: 'IT杞欢涓庢湇鍔�',
+        content: '璁㈠崟鍙凤細{{keyword1.DATA}}\n璁㈠崟绫诲瀷锛歿{keyword2.DATA}}\n璁㈠崟鐘舵�侊細{{keyword3.DATA}}\n閫氱煡鏃堕棿锛歿{keyword4.DATA}}',
+        example: '璁㈠崟鍙凤細20190101001\r\n璁㈠崟绫诲瀷锛氳。鏌淺r\n璁㈠崟鐘舵�侊細璁捐瀹屾垚\r\n閫氱煡鏃堕棿锛�2019骞�1鏈�1鏃�12:30'
+      },
+      {
+        template_id: 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok',
+        title: '璁㈠崟杩涘害鎻愰啋锛堟槑绉戜簯锛�',
+        primary_industry: 'IT绉戞妧',
+        deputy_industry: 'IT杞欢涓庢湇鍔�',
+        content: '璁㈠崟绫诲瀷锛歿{keyword1.DATA}}\n璁㈠崟鍙凤細{{keyword2.DATA}}\n璁㈠崟鐘舵�侊細{{keyword3.DATA}}',
+        example: '璁㈠崟绫诲瀷锛氶��绉熺敵璇穃r\n璁㈠崟鍙凤細TZ16101909\r\n璁㈠崟鐘舵�侊細寰呭彇璐�'
+      },
+      {
+        template_id: 'mk_category_temp',
+        title: '绫荤洰妯℃澘',
+        primary_industry: '',
+        deputy_industry: '',
+        content: '',
+        example: ''
+      }
+    ]
+    
+    let _wxTemps = [...wxTemps, ...sysTemps]
+
+    let selectTemp = _wxTemps.filter(item => item.template_id === verify.wxTemplateId)[0]
+
+    if (selectTemp) {
+      selectTemp.content = selectTemp.content.replace(/\r\n|\n/g, '<br/>')
+      selectTemp.example = selectTemp.example.replace(/\r\n|\n/g, '<br/>')
+    }
+
+    this.setState({wxTemps: _wxTemps, selectTemp})
   }
 
   handleConfirm = () => {
@@ -92,15 +130,22 @@
     let error = ''
     if (verify.noteEnable === 'true' && !verify.noteCode) { // 寮�鍚煭淇℃椂锛岄渶瑕佹ā鏉跨紪鐮�
       error = '寮�鍚煭淇℃椂锛岄渶瑕侀�夋嫨鐭俊妯℃澘锛�'
+    } else if (verify.emailEnable === 'true' && !verify.emailCode) {
+      error = '寮�鍚偖浠跺彂閫佹椂锛岄渶瑕侀�夋嫨閭欢妯℃澘锛�'
+    } else if (verify.printEnable === 'true' && !verify.printTempId) {
+      error = '浣跨敤鍗曟嵁鎵撳嵃鏃讹紝闇�瑕侀�夋嫨鎵撳嵃妯℃澘锛�'
     } else if (verify.accountdate === 'true' && !verify.accountfield) {
       error = '寮�鍚处鏈熸椂锛岄渶瑕侀�夋嫨楠岃瘉鍏徃锛�'
+    } else if (verify.preHandle === 'true' && !verify.pre_func) {
+      error = '寮�鍚嚜瀹氫箟鑴氭湰鏃讹紝闇�瑕佸~鍐欏鐞嗗嚱鏁帮紒'
     } else if (verify.wxNote === 'true') {
       if (!verify.wxTemplateId) {
         error = '寮�鍚叕浼楀彿娑堟伅鎺ㄩ�佹椂锛岄渶瑕侀�夋嫨娑堟伅妯℃澘锛�'
+      } else if (verify.wxTemplateId === 'mk_category_temp' && !verify.wxCustomTempId) {
+        error = '寮�鍚叕浼楀彿娑堟伅鎺ㄩ�佹椂锛岄渶瑕佸~鍐欐秷鎭ā鏉縄D锛�'
       } else if (verify.wxNoteLink === 'url' && !verify.wxNoteLinkUrl) {
         error = '璇峰~鍐欑綉鍧�锛�'
       }
-
     }
 
     return error
@@ -113,10 +158,21 @@
 
     if (_verify.noteEnable !== 'true') {
       _verify.noteCode = ''
+      _verify.noteId = ''
+    }
+    if (_verify.emailEnable !== 'true') {
+      _verify.emailCode = ''
+      _verify.emailId = ''
+    }
+    if (_verify.printEnable !== 'true') {
+      _verify.printTempId = ''
     }
     if (_verify.accountdate !== 'true') {
       _verify.accountfield = ''
       _verify.voucherdate = ''
+    }
+    if (_verify.preHandle !== 'true') {
+      _verify.pre_func = ''
     }
     if (_verify.wxNote !== 'true') {
       _verify.wxTemplateId = ''
@@ -125,6 +181,8 @@
       _verify.wxNoteLinkMenuId = ''
       _verify.wxNoteCallback = 'false'
       _verify.wxNoteKeys = null
+
+      delete _verify.wxCustomTempId
 
       if (this.state.selectTemp) {
         this.setState({selectTemp: null})
@@ -142,11 +200,27 @@
     this.props.onChange(_verify)
   }
 
+  onEmailCodeChange = (val, option) => {
+    const { verify } = this.props
+
+    let _verify = {...verify, emailCode: val, emailId: option.props.id}
+
+    this.props.onChange(_verify)
+  }
+
+  onPrintIdChange = (val) => {
+    const { verify } = this.props
+
+    let _verify = {...verify, printTempId: val}
+
+    this.props.onChange(_verify)
+  }
+
   onWxTemplateChange = (val, option) => {
     const { verify } = this.props
 
     let _verify = {...verify, wxTemplateId: val}
-    let selectTemp = {content: option.props.content.replace(/\r\n|\n/g, '<br/>'), example: option.props.example.replace(/\r\n|\n/g, '<br/>')}
+    let selectTemp = {template_id: val, content: option.props.content.replace(/\r\n|\n/g, '<br/>'), example: option.props.example.replace(/\r\n|\n/g, '<br/>')}
 
     let keys = []
     if (option.props.content) {
@@ -154,26 +228,27 @@
       keys = keys.map(key => key.replace(/{{|\.DATA}}/g, ''))
     }
 
-    let index = 1
-    _verify.wxNoteKeys = keys.map(key => {
-      let item = {
-        key: key,
-        color: '#000000',
-        readonly: false
+    delete _verify.wxCustomTempId
+
+    if (selectTemp.template_id === 'mk_category_temp') {
+      _verify.wxNoteKeys = []
+      for (let i = 1; i <= 10; i++) {
+        _verify.wxNoteKeys.push({
+          key: '',
+          value: 'p' + i
+        })
       }
-      if (key === 'first') {
-        item.value = 'first'
-        item.readonly = true
-      } else if (key === 'remark') {
-        item.value = 'remark'
-        item.readonly = true
-      } else {
+    } else {
+      let index = 1
+      _verify.wxNoteKeys = keys.map(key => {
+        let item = { key: key }
+        
         item.value = 'p' + index
         index++
-      }
-
-      return item
-    })
+  
+        return item
+      })
+    }
 
     this.setState({selectTemp})
 
@@ -194,12 +269,12 @@
     this.props.onChange(_verify)
   }
 
-  onWxNoteColorChange = (key, val) => {
+  onWxNoteValueChange = (value, val) => {
     let _verify = fromJS(this.props.verify).toJS()
 
     _verify.wxNoteKeys = _verify.wxNoteKeys.map(m => {
-      if (m.key === key) {
-        m.color = val
+      if (m.value === value) {
+        m.key = val.replace(/\s+/ig, '')
       }
 
       return m
@@ -208,8 +283,16 @@
     this.props.onChange(_verify)
   }
 
+  onWxNoteTempIdChange = (value) => {
+    let _verify = fromJS(this.props.verify).toJS()
+
+    _verify.wxCustomTempId = value.replace(/\s+/ig, '')
+
+    this.props.onChange(_verify)
+  }
+
   render() {
-    const { unionFields, verify, notes, card } = this.props
+    const { unionFields, verify, notes, emailCodes, card, appType, columns, fields } = this.props
     const { wxTemps, selectTemp } = this.state
     const formItemLayout = {
       labelCol: {
@@ -220,6 +303,28 @@
         xs: { span: 24 },
         sm: { span: 16 }
       }
+    }
+
+    let _columns = []
+    if (window.GLOB.process && card.intertype !== 'inner') {
+      let cols = []
+      fields.forEach(col => {
+        if (!col.field) return
+
+        cols.push(col.field.toLowerCase())
+        _columns.push(col)
+      })
+
+      columns.forEach(col => {
+        if (!col.field) return
+
+        let key = col.field.toLowerCase()
+
+        if (key === 'id' || cols.includes(key)) return
+        if (col.type === 'text' && col.fieldlength > 100)  return
+  
+        _columns.push(col)
+      })
     }
 
     return (
@@ -239,8 +344,13 @@
             </Form.Item>
           </Col> : null}
           {card.intertype !== 'inner' ? <Col span={8}>
-            <Form.Item label={'澶辨晥楠岃瘉'}>
-              <Radio.Group value={verify.invalid} onChange={(e) => {this.onOptionChange(e.target.value, 'invalid')}}>
+            <Form.Item label={
+              verify.limitText ? <Tooltip placement="bottomLeft" title={verify.limitText}>
+                <QuestionCircleOutlined className="mk-form-tip" />
+                澶辨晥楠岃瘉
+              </Tooltip> : '澶辨晥楠岃瘉'
+            }>
+              <Radio.Group value={verify.invalid} disabled={verify.limitInvalid} onChange={(e) => {this.onOptionChange(e.target.value, 'invalid')}}>
                 <Radio value="true">寮�鍚�</Radio>
                 <Radio value="false">涓嶅紑鍚�</Radio>
               </Radio.Group>
@@ -302,7 +412,7 @@
                 鐭俊妯℃澘
               </Tooltip>
             } required>
-              <Select value={verify.noteCode} onSelect={this.onNoteCodeChange}>
+              <Select value={verify.noteCode || ''} onSelect={this.onNoteCodeChange}>
                 {notes.map(option =>
                   <Select.Option key={option.value} id={option.id} value={option.value}>
                     {option.name}
@@ -318,7 +428,7 @@
                 鍙戦�佹柟寮�
               </Tooltip>
             }>
-              <Radio.Group value={verify.noteType} onChange={(e) => {this.onOptionChange(e.target.value, 'noteType')}}>
+              <Radio.Group value={verify.noteType || 'N'} onChange={(e) => {this.onOptionChange(e.target.value, 'noteType')}}>
                 <Radio value="Y">瀹炴椂</Radio>
                 <Radio value="N">瀹氭椂</Radio>
               </Radio.Group>
@@ -331,10 +441,149 @@
                 鐭俊鍐呭
               </Tooltip>
             }>
-              <Radio.Group value={verify.noteTemp} onChange={(e) => {this.onOptionChange(e.target.value, 'noteTemp')}}>
+              <Radio.Group value={verify.noteTemp || 'Y'} onChange={(e) => {this.onOptionChange(e.target.value, 'noteTemp')}}>
                 <Radio value="Y">鐩稿悓</Radio>
                 <Radio value="N">涓嶅悓</Radio>
               </Radio.Group>
+            </Form.Item>
+          </Col> : null}
+          <Col span={24}></Col>
+          <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title={'閫夋嫨鍙戦�侀偖浠舵椂锛岄渶瀹屽杽閭欢璁剧疆銆�'}>
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍙戦�侀偖浠�
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.emailEnable} onChange={(e) => {this.onOptionChange(e.target.value, 'emailEnable')}}>
+                <Radio value="true">寮�鍚�</Radio>
+                <Radio value="false">涓嶅紑鍚�</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col>
+          {verify.emailEnable === 'true' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title={<span>閭欢妯℃澘娣诲姞鍦板潃锛�<a target="_blank" rel="noopener noreferrer" href="https://cloud.mk9h.cn/admin/index.html">浜戜腑蹇�</a>-&gt;搴旂敤鏈嶅姟-&gt;寮�鍙戣�呬腑蹇�-&gt;閭欢妯℃澘銆�</span>}>
+                <QuestionCircleOutlined className="mk-form-tip" />
+                閭欢妯℃澘
+              </Tooltip>
+            } required>
+              <Select value={verify.emailCode || ''} onSelect={this.onEmailCodeChange}>
+                {emailCodes.map(option =>
+                  <Select.Option key={option.value} id={option.id} value={option.value}>
+                    {option.name}
+                  </Select.Option>
+                )}
+              </Select>
+            </Form.Item>
+          </Col> : null}
+          {verify.emailEnable === 'true' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title={'瀹炴椂鍙戦�佹渶澶氬悓鏃跺彂閫�5涓敤鎴凤紝瀹氭椂鍙戦�佹渶澶氬悓鏃跺彂閫�100涓敤鎴枫��'}>
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍙戦�佹柟寮�
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.emailType || 'N'} onChange={(e) => {this.onOptionChange(e.target.value, 'emailType')}}>
+                <Radio value="Y">瀹炴椂</Radio>
+                <Radio value="N">瀹氭椂</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col> : null}
+          {verify.emailEnable === 'true' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title={'褰撳悜澶氫釜鐢ㄦ埛鍙戦�佺煭淇℃椂锛岀煭淇″唴瀹规槸鍚︾浉鍚屻��'}>
+                <QuestionCircleOutlined className="mk-form-tip" />
+                閭欢鍐呭
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.emailTemp || 'Y'} onChange={(e) => {this.onOptionChange(e.target.value, 'emailTemp')}}>
+                <Radio value="Y">鐩稿悓</Radio>
+                <Radio value="N">涓嶅悓</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col> : null}
+          <Col span={24}></Col>
+          {appType !== 'mob' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="浣跨敤鍗曟嵁鎵撳嵃鏃堕渶閫夋嫨鎵撳嵃妯℃澘锛岃烦杞墦鍗扮晫闈㈡椂ID浼樺厛浠庤繑鍥炲�间腑鑾峰彇锛岃繑鍥炲�兼病鏈夋椂浠庤閲岃幏鍙栥��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍗曟嵁鎵撳嵃
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.printEnable} onChange={(e) => {this.onOptionChange(e.target.value, 'printEnable')}}>
+                <Radio value="true">寮�鍚�</Radio>
+                <Radio value="false">涓嶅紑鍚�</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col> : null}
+          {verify.printEnable === 'true' ? <Col span={8}>
+            <Form.Item label="鎵撳嵃妯℃澘" required help={(() => {
+              if (verify.printTempId) {
+                return <span onClick={() => {
+                  sessionStorage.setItem('mk-print-temp', verify.printTempId)
+                  window.open('#/hs')
+
+                  setTimeout(() => {
+                    sessionStorage.removeItem('mk-print-temp')
+                  }, 50)
+                }} style={{color: '#1890ff', cursor: 'pointer', fontSize: '13px'}}>#鏌ョ湅妯℃澘</span>
+              }
+              return null
+            })()}>
+              <MkPrintTemps value={verify.printTempId} onChange={this.onPrintIdChange}/>
+            </Form.Item>
+          </Col> : null}
+          <Col span={24}></Col>
+          {window.GLOB.process && card.intertype !== 'inner' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="鍦ㄨ彍鍗曞紑鍚伐浣滄祦鏃舵湁鏁堛��">
+                <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}
+          {window.GLOB.process && card.intertype !== 'inner' && verify.workFlow === 'true' ? <Col span={8}>
+            <Form.Item label="绫诲瀷">
+              <Radio.Group value={verify.flowType} onChange={(e) => {this.onOptionChange(e.target.value, 'flowType')}}>
+                <Radio value="start">鍙戣捣</Radio>
+                <Radio value="approval">瀹℃壒</Radio>
+                <Radio value="reject">椹冲洖</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col> : null}
+          {window.GLOB.process && card.intertype !== 'inner' && verify.workFlow === 'true' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="鎵ц浣嶇疆鍦ㄧ郴缁熼粯璁ql涔嬪悗銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                榛樿sql锛堝伐浣滄祦锛�
+              </Tooltip>
+            }>
+              <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}
+          {window.GLOB.process && card.intertype !== 'inner' && verify.workFlow === 'true' && verify.flowType === 'approval' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="濡傛灉瀹℃壒瀛樺湪澶氭潯鍒嗘敮锛屽彲娣诲姞瀹℃壒娴佺▼鐨勬帶鍒跺瓧娈碉紝閫氳繃琛ㄥ崟淇℃伅鎴栬淇℃伅鎺у埗娴佺▼璧板悜銆傛敞锛氶渶鍦ㄦ祦绋嬪浘涓畬鍠勫垎鏀殑鎵ц鏉′欢銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                娴佺▼鎺у埗
+              </Tooltip>
+            }>
+              <Select allowClear value={verify.flowBranch} onChange={(val) => {this.onOptionChange(val || '', 'flowBranch')}}>
+                {_columns.map(option =>
+                  <Select.Option key={option.field} value={option.field}>
+                    {option.label}
+                  </Select.Option>
+                )}
+              </Select>
             </Form.Item>
           </Col> : null}
           <Col span={24}></Col>
@@ -404,9 +653,9 @@
               <Input placeholder="" autoComplete="off" value={verify.wxNoteLinkMenuId || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteLinkMenuId')}}/>
             </Form.Item>
           </Col> : null}
-          {verify.wxNote === 'true' && verify.wxNoteKeys ? verify.wxNoteKeys.map(item => <Col span={8} key={item.key}>
-            <Form.Item className="mk-note-keyword" label={item.key} required>
-              <Select value={item.value} disabled={item.readonly} onSelect={(val) => this.onWxNoteKeyChange(item.key, val)}>
+          {verify.wxNote === 'true' && verify.wxNoteKeys && (!selectTemp || selectTemp.template_id !== 'mk_category_temp') ? verify.wxNoteKeys.map((item, index) => <Col span={8} key={'mk' + index}>
+            <Form.Item label={item.key} required>
+              <Select value={item.value} onSelect={(val) => this.onWxNoteKeyChange(item.key, val)}>
                 <Select.Option value="p1">p1</Select.Option>
                 <Select.Option value="p2">p2</Select.Option>
                 <Select.Option value="p3">p3</Select.Option>
@@ -418,10 +667,19 @@
                 <Select.Option value="p9">p9</Select.Option>
                 <Select.Option value="p10">p10</Select.Option>
               </Select>
-              <ColorSketch value={item.color || '#ffffff'} onChange={(val, hex) => {this.onWxNoteColorChange(item.key, hex)}} />
             </Form.Item>
           </Col>) : null}
-          {selectTemp && verify.wxNoteKeys ? <Col span={24} className="wx-note">
+          {verify.wxNote === 'true' && verify.wxNoteKeys && (selectTemp && selectTemp.template_id === 'mk_category_temp') ? <Col span={8}>
+            <Form.Item label="妯℃澘ID" required>
+              <Input placeholder="" defaultValue={verify.wxCustomTempId} autoComplete="off" onChange={(e) => {this.onWxNoteTempIdChange(e.target.value)}}/>
+            </Form.Item>
+          </Col> : null}
+          {verify.wxNote === 'true' && verify.wxNoteKeys && (selectTemp && selectTemp.template_id === 'mk_category_temp') ? verify.wxNoteKeys.map((item, index) => <Col span={8} key={'mk' + index}>
+            <Form.Item label={item.value}>
+              <Input placeholder="" defaultValue={item.key} autoComplete="off" onChange={(e) => {this.onWxNoteValueChange(item.value, e.target.value)}}/>
+            </Form.Item>
+          </Col>) : null}
+          {selectTemp && selectTemp.template_id !== 'mk_category_temp' && verify.wxNoteKeys ? <Col span={24} className="wx-note">
             <div className="note-wrap">
               <div className="note">
                 <p>鍐呭绀轰緥</p>
@@ -440,12 +698,42 @@
                 <div>
                   <p>openid:&nbsp;&nbsp;"鎺ユ敹鑰卭penid",</p>
                   <p>send_id:&nbsp;&nbsp;"闃查噸鍏d",</p>
-                  {verify.wxNoteKeys.map(item => <p>{item.value}:&nbsp;&nbsp;"=&gt; {item.key}",</p>)}
+                  {verify.wxNoteKeys.map((item, i) => <p key={'index' + i}>{item.value}:&nbsp;&nbsp;"=&gt; {item.key}",</p>)}
                   <p>bid:&nbsp;&nbsp;"璺宠浆灏忕▼搴忔椂锛屽彲浣滀负BID銆�"</p>
                 </div>
               </div>
             </div>
           </Col> : null}
+          {selectTemp && selectTemp.template_id === 'mk_category_temp' && verify.wxNoteKeys ? <Col span={24} className="wx-note">
+            <div className="note-wrap">
+              <div className="note">
+                <p>娑堟伅浣�</p>
+                <div>
+                  <p>openid:&nbsp;&nbsp;"鎺ユ敹鑰卭penid",</p>
+                  <p>send_id:&nbsp;&nbsp;"闃查噸鍏d",</p>
+                  <p>bid:&nbsp;&nbsp;"璺宠浆灏忕▼搴忔椂锛屽彲浣滀负BID銆�"</p>
+                  <p style={{color: '#1890ff'}}>璇峰湪閫氱敤瀛楁涓紙p1~p10锛夊~鍏ユā鏉夸腑瀵瑰簲鐨勫瓧娈靛悕锛屽 time1.DATA 鍒欏~鍐� time1銆�</p>
+                </div>
+              </div>
+            </div>
+          </Col> : null}
+          <Col span={24}></Col>
+          <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="topRight" title="杩愯鏃朵慨鏀规寜閽弬鏁帮紝鍏ュ弬涓猴紙btn, position, systemType锛�,鏍囪#position-(init,inner,outer,callback)">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鑷畾涔夎剼鏈�
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.preHandle || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'preHandle')}}>
+                <Radio value="true">寮�鍚�</Radio>
+                <Radio value="false">涓嶅紑鍚�</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col>
+          {verify.preHandle === 'true' ? <Col span={24} style={{paddingLeft: '50px'}}>
+            <CodeMirror mode="text/javascript" theme="cobalt" value={verify.pre_func || ''} onChange={(val) => {this.onOptionChange(val, 'pre_func')}} />
+          </Col> : null}
         </Row>
       </Form>
     )

--
Gitblit v1.8.0