From 8745fff935a11993f22a9bd6a0dd00619c9e2f3d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 九月 2024 11:18:54 +0800
Subject: [PATCH] 2024-09-10

---
 src/templates/zshare/verifycard/baseform/index.jsx |  605 +++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 503 insertions(+), 102 deletions(-)

diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx
index 606b0a8..f3fd9b2 100644
--- a/src/templates/zshare/verifycard/baseform/index.jsx
+++ b/src/templates/zshare/verifycard/baseform/index.jsx
@@ -1,10 +1,12 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Select, Radio, Tooltip, Input, notification } from 'antd'
+import { Form, Row, Col, Select, Radio, Tooltip, Input, message } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
+import MkPrintTemps from '@/menu/components/share/actioncomponent/actionform/mkPrintTemps'
+import CodeMirror from '@/templates/zshare/codemirror'
 import './index.scss'
 
 const sysTempsIds = ['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok']
@@ -15,89 +17,95 @@
     verify: PropTypes.object,
     unionFields: PropTypes.array,
     notes: PropTypes.array,
+    emailCodes: PropTypes.array,
+    appType: PropTypes.any,
     onChange: PropTypes.func
   }
 
   state = {
     wxTemps: [],
     selectTemp: null,
-    miniTemps: [],
+    WXApps: null
   }
 
   componentDidMount() {
-    let wxTemps = sessionStorage.getItem('wxTemplates')
+    const { appType, verify } = this.props
 
-    if (window.GLOB.WXAppID && window.GLOB.nginx && !wxTemps) {
-      Api.wxAccessToken().then(res => {
-        let wxtoken = res.oa_access_token || ''
-        // let minitoken = res.mini_access_token || ''
-  
-        if (wxtoken) {
-          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 => {
-                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}}', '')
-                }
+    let appId = window.GLOB.WXAppID || ''
 
-                return true
-              })
-            }
-            
-            sessionStorage.setItem('wxTemplates', JSON.stringify(temps))
-            localStorage.setItem('wxTemplates', JSON.stringify(temps))
+    if (window.GLOB.WXApps && !appType) {
+      let apps = window.GLOB.WXApps.filter(app => app.appType === 'public')
 
-            localStorage.removeItem('wxTemplates')
+      if (apps.length > 0) {
+        this.setState({WXApps: apps})
+      }
 
-            this.resetTemps(temps)
-          })
-        } else {
-          sessionStorage.setItem('wxTemplates', JSON.stringify([]))
-          localStorage.setItem('wxTemplates', JSON.stringify([]))
+      if (verify.wxAppId && apps.findIndex(item => item.appId === verify.wxAppId) > -1) {
+        appId = verify.wxAppId
+      }
+    }
 
-          localStorage.removeItem('wxTemplates')
-        }
-        // if (minitoken) {
-        //   Api.wxNginxRequest(`wxaapi/newtmpl/gettemplate?access_token=${minitoken}`, 'get').then(res => {
-        //     if (res.errmsg === 'ok' && res.data) {
-        //       sessionStorage.setItem('wxMiniTemplates', JSON.stringify(res.data))
-        //     } else {
-        //       sessionStorage.setItem('wxMiniTemplates', JSON.stringify([]))
-        //     }
-        //   })
-        // } else {
-        //   sessionStorage.setItem('wxMiniTemplates', JSON.stringify([]))
-        // }
-      })
+    let wxTemps = sessionStorage.getItem('wxTemplates' + appId)
+
+    if (appId && !wxTemps) {
+      if (verify.wxNote === 'true') {
+        this.getTemps(appId)
+      }
     } else if (wxTemps) {
       wxTemps = JSON.parse(wxTemps)
 
       this.resetTemps(wxTemps)
+    } else {
+      this.resetTemps([])
     }
+  }
+
+  getTemps = (appId) => {
+    // cgi-bin/template/get_all_private_template
+    Api.directRequest({
+      url: window.GLOB.baseurl + 'wechat/get_all_private_template?appid=' + appId,
+      method: 'get',
+    }).then(res => {
+      let temps = []
+      if (res.template_list) {
+        temps = res.template_list.filter(item => {
+          if (!item.content || item.content.length < 25 || sysTempsIds.includes(item.template_id)) return false
+          if (item.content) {
+            item.content = item.content.replace('{{first.DATA}}\n', '').replace('\n{{remark.DATA}}', '')
+          }
+
+          return true
+        })
+      } else if (res.errcode && res.errmsg) {
+        message.warning(res.errcode + ': ' + res.errmsg)
+      }
+      
+      sessionStorage.setItem('wxTemplates' + appId, JSON.stringify(temps))
+
+      this.resetTemps(temps)
+    })
   }
 
   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: '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: '绫荤洰妯℃澘',
@@ -126,11 +134,21 @@
     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.linkEnable === 'true' && !verify.linkUrl) {
+      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 = '璇峰~鍐欑綉鍧�锛�'
       }
@@ -140,46 +158,84 @@
   }
 
   onOptionChange = (value, key) => {
-    const { verify, setting } = this.props
+    const { verify } = this.props
 
     let _verify = {...verify, [key]: value}
 
     if (_verify.noteEnable !== 'true') {
-      _verify.noteCode = ''
+      delete _verify.noteCode
+      delete _verify.noteId
+    }
+    if (_verify.emailEnable !== 'true') {
+      delete _verify.emailCode
+      delete _verify.emailId
+    }
+    if (_verify.printEnable !== 'true') {
+      delete _verify.printTempId
+    }
+    if (_verify.linkEnable !== 'true') {
+      delete _verify.linkUrl
+      delete _verify.linkProUrl
     }
     if (_verify.accountdate !== 'true') {
-      _verify.accountfield = ''
-      _verify.voucherdate = ''
+      delete _verify.accountfield
+      delete _verify.voucherdate
+    }
+    if (_verify.preHandle !== 'true') {
+      delete _verify.pre_func
     }
     if (_verify.wxNote !== 'true') {
-      _verify.wxTemplateId = ''
-      _verify.wxNoteLink = ''
-      _verify.wxNoteLinkUrl = ''
-      _verify.wxNoteLinkMenuId = ''
-      _verify.wxNoteCallback = 'false'
-      _verify.wxNoteKeys = null
+      delete _verify.wxAppId
+      delete _verify.wxTemplateId
+      delete _verify.wxNoteLink
+      delete _verify.wxNoteLinkUrl
+      delete _verify.wxNoteMiniId
+      delete _verify.wxNoteLinkMenuId
+      delete _verify.wxNoteCallback
+      delete _verify.wxCustomTempId
 
+      _verify.wxNoteKeys = null
+      
       if (this.state.selectTemp) {
         this.setState({selectTemp: null})
       }
     }
 
-    if (verify.invalid !== 'true' && _verify.invalid === 'true' && setting.maxScript && setting.maxScript >= 300) {
-      notification.warning({
-        top: 92,
-        message: '鏁版嵁婧愪腑鑷畾涔夎剼鏈繃浜庡鏉傦紝涓嶈兘浣跨敤澶辨晥楠岃瘉锛�',
-        duration: 5
-      })
-      return
-    }
-
     this.props.onChange(_verify)
+
+    if (key === 'wxNote' && value === 'true' && window.GLOB.WXAppID) {
+      let wxTemps = sessionStorage.getItem('wxTemplates' + window.GLOB.WXAppID)
+
+      if (wxTemps) {
+        wxTemps = JSON.parse(wxTemps)
+
+        this.resetTemps(wxTemps)
+      } else {
+        this.getTemps(window.GLOB.WXAppID)
+      }
+    }
   }
 
   onNoteCodeChange = (val, option) => {
     const { verify } = this.props
 
     let _verify = {...verify, noteCode: val, noteId: option.props.id}
+
+    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)
   }
@@ -192,23 +248,74 @@
 
     let keys = []
     if (option.props.content) {
-      keys = option.props.content.match(/{{[a-zA-Z0-9]+\.DATA}}/g)
+      keys = option.props.content.match(/{{[a-zA-Z0-9_]+\.DATA}}/g)
       keys = keys.map(key => key.replace(/{{|\.DATA}}/g, ''))
     }
 
-    let index = 1
-    _verify.wxNoteKeys = keys.map(key => {
-      let item = { key: key }
-      
-      item.value = 'p' + index
-      index++
+    delete _verify.wxCustomTempId
 
-      return item
-    })
+    if (selectTemp.template_id === 'mk_category_temp') {
+      _verify.wxNoteKeys = []
+      for (let i = 1; i <= 10; i++) {
+        _verify.wxNoteKeys.push({
+          key: '',
+          value: 'p' + i
+        })
+      }
+    } else {
+      let index = 1
+      _verify.wxNoteKeys = keys.map(key => {
+        let item = { key: key }
+        
+        item.value = 'p' + index
+        index++
+  
+        return item
+      })
+    }
 
     this.setState({selectTemp})
 
     this.props.onChange(_verify)
+  }
+
+  onWxAppChange = (val) => {
+    const { verify } = this.props
+
+    let _verify = {...verify, wxAppId: val, wxNote: 'false'}
+
+    delete _verify.wxTemplateId
+    delete _verify.wxNoteLink
+    delete _verify.wxNoteLinkUrl
+    delete _verify.wxNoteMiniId
+    delete _verify.wxNoteLinkMenuId
+    delete _verify.wxNoteCallback
+    delete _verify.wxCustomTempId
+
+    _verify.wxNoteKeys = null
+    
+    if (this.state.selectTemp) {
+      this.setState({selectTemp: null})
+    }
+
+    let _verify_ = fromJS(_verify).toJS()
+    _verify_.wxNote = 'true'
+
+    this.props.onChange(_verify)
+
+    setTimeout(() => {
+      this.props.onChange(_verify_)
+
+      let wxTemps = sessionStorage.getItem('wxTemplates' + val)
+
+      if (wxTemps) {
+        wxTemps = JSON.parse(wxTemps)
+
+        this.resetTemps(wxTemps)
+      } else {
+        this.getTemps(val)
+      }
+    }, 20)
   }
 
   onWxNoteKeyChange = (key, val) => {
@@ -225,9 +332,31 @@
     this.props.onChange(_verify)
   }
 
+  onWxNoteValueChange = (value, val) => {
+    let _verify = fromJS(this.props.verify).toJS()
+
+    _verify.wxNoteKeys = _verify.wxNoteKeys.map(m => {
+      if (m.value === value) {
+        m.key = val.replace(/\s+/ig, '')
+      }
+
+      return m
+    })
+
+    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 { wxTemps, selectTemp } = this.state
+    const { unionFields, verify, notes, emailCodes, card, appType, columns, fields } = this.props
+    const { wxTemps, selectTemp, WXApps } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -239,16 +368,38 @@
       }
     }
 
+    let _columns = []
+    let remarks = []
+    if (window.GLOB.process && card.intertype !== 'inner') {
+      let cols = []
+      fields.forEach(col => {
+        if (!col.field) return
+
+        cols.push(col.field.toLowerCase())
+        _columns.push(col)
+
+        if ((col.type === 'text' || col.type === 'textarea') && col.field !== 'BID') {
+          remarks.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 (
       <Form {...formItemLayout}>
         <Row gutter={24}>
           {card.sqlType !== 'custom' && card.intertype !== 'inner' ? <Col span={8}>
-            <Form.Item label={
-              <Tooltip placement="bottomLeft" title={'榛樿sql鎵ц椤哄簭涓鸿嚜瀹氫箟鑴氭湰涔嬪墠'}>
-                <QuestionCircleOutlined className="mk-form-tip" />
-                榛樿sql
-              </Tooltip>
-            }>
+            <Form.Item label="榛樿sql">
               <Radio.Group value={verify.default} onChange={(e) => {this.onOptionChange(e.target.value, 'default')}}>
                 <Radio value="true">鎵ц</Radio>
                 <Radio value="false">涓嶆墽琛�</Radio>
@@ -256,8 +407,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>
@@ -319,7 +475,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}
@@ -335,7 +491,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>
@@ -348,7 +504,7 @@
                 鐭俊鍐呭
               </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>
@@ -357,7 +513,186 @@
           <Col span={24}></Col>
           <Col span={8}>
             <Form.Item label={
-              <Tooltip placement="bottomLeft" title={'璇峰湪鏈嶅姟鍣ㄥ畬鎴愬叕浼楀彿閰嶇疆銆�'}>
+              <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>
+          <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" overlayStyle={{maxWidth: 350}} title="鎸夐挳鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勯摼鎺ュ湴鍧�銆傚鏋滃湴鍧�涓嶆槸http寮�濮嬶紝浼氭嫾鎺ュ綋鍓嶇郴缁熷煙鍚嶏紝渚嬪锛氬湴鍧�涓� /xxxx 鏃讹紝浼氭墦寮� http://***.***.**/xxxx銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鎵撳紑閾炬帴
+              </Tooltip>
+            }>
+              <Radio.Group value={verify.linkEnable || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'linkEnable')}}>
+                <Radio value="true">寮�鍚�</Radio>
+                <Radio value="false">涓嶅紑鍚�</Radio>
+              </Radio.Group>
+            </Form.Item>
+          </Col>
+          {verify.linkEnable === 'true' ? <Col span={24} className="dz-link">
+            <Form.Item label="閾炬帴鍦板潃" required>
+              <Input.TextArea autoComplete="off" value={verify.linkUrl || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'linkUrl')}}/>
+            </Form.Item>
+          </Col> : null}
+          {verify.linkEnable === 'true' ? <Col span={24} className="dz-link">
+            <Form.Item label="姝e紡鍦板潃">
+              <Input.TextArea autoComplete="off" value={verify.linkProUrl || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'linkProUrl')}}/>
+            </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}
+          {window.GLOB.process && card.intertype !== 'inner' && verify.workFlow === 'true' && verify.flowType !== 'start' ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="鍙�氳繃琛ㄥ崟瀛楁濉啓瀹℃壒鎴栭┏鍥炵殑澶囨敞淇℃伅銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                澶囨敞瀛楁
+              </Tooltip>
+            }>
+              <Select allowClear value={verify.flowRemark} onChange={(val) => {this.onOptionChange(val || '', 'flowRemark')}}>
+                {remarks.map(option =>
+                  <Select.Option key={option.field} value={option.field}>
+                    {option.label}
+                  </Select.Option>
+                )}
+              </Select>
+            </Form.Item>
+          </Col> : null}
+          <Col span={24}></Col>
+          <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="璇峰湪鏈嶅姟鍣ㄥ畬鎴愬叕浼楀彿閰嶇疆銆�">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鍏紬鍙锋秷鎭�
               </Tooltip>
@@ -368,6 +703,22 @@
               </Radio.Group>
             </Form.Item>
           </Col>
+          {verify.wxNote === 'true' && WXApps ? <Col span={8}>
+            <Form.Item label={
+              <Tooltip placement="bottomLeft" title="璇烽�夋嫨鍙戦�佹秷鎭殑鍏紬鍙枫��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍏紬鍙�
+              </Tooltip>
+            } required>
+              <Select value={verify.wxAppId || window.GLOB.WXAppID} onSelect={this.onWxAppChange}>
+                {WXApps.map(option =>
+                  <Select.Option key={option.appId} value={option.appId}>
+                    {option.appName}
+                  </Select.Option>
+                )}
+              </Select>
+            </Form.Item>
+          </Col> : null}
           {verify.wxNote === 'true' ? <Col span={8}>
             <Form.Item label="娑堟伅妯℃澘" required>
               <Select value={verify.wxTemplateId} onSelect={this.onWxTemplateChange}>
@@ -413,6 +764,16 @@
           </Col> : null}
           {verify.wxNoteLink === 'miniProgram' ? <Col span={8}>
             <Form.Item label={
+              <Tooltip placement="top" title="鍙寚瀹氳烦杞皬绋嬪簭鐨処D锛屾湭璁剧疆鏃堕粯璁や娇鐢ㄩ厤缃枃浠朵腑鐨勫皬绋嬪簭ID銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                灏忕▼搴廔D
+              </Tooltip>
+            }>
+              <Input placeholder="" autoComplete="off" value={verify.wxNoteMiniId || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteMiniId')}}/>
+            </Form.Item>
+          </Col> : null}
+          {verify.wxNoteLink === 'miniProgram' ? <Col span={8}>
+            <Form.Item label={
               <Tooltip placement="top" title="娣诲姞鑿滃崟ID鍙烦杞嚦灏忕▼搴忔寚瀹氶〉闈紝绌哄�奸粯璁よ烦杞嚦灏忕▼搴忛椤点�傛敞锛氭暟鎹噷涓鏋滄湁bid瀛楁锛堝�间笉涓虹┖锛夛紝鎵撳紑灏忕▼搴忔椂浼氬仛涓築ID浼犲叆椤甸潰涓��">
                 <QuestionCircleOutlined className="mk-form-tip" />
                 鑿滃崟ID
@@ -421,7 +782,7 @@
               <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, index) => <Col span={8} key={'mk' + index}>
+          {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>
@@ -435,6 +796,16 @@
                 <Select.Option value="p9">p9</Select.Option>
                 <Select.Option value="p10">p10</Select.Option>
               </Select>
+            </Form.Item>
+          </Col>) : null}
+          {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">
@@ -462,6 +833,36 @@
               </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