From 5df578ff69f6b02e821d59a8883bc75d78695a62 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 十一月 2020 11:07:31 +0800
Subject: [PATCH] 2020-11-10

---
 src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx |   50 +++++++++++++++++++-------------------------------
 1 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
index 452d7ed..006c55d 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
@@ -2,21 +2,15 @@
 import PropTypes from 'prop-types'
 import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Input, Select, Radio } from 'antd'
 import moment from 'moment'
-import {UnControlled as CodeMirror} from 'react-codemirror2'
-import 'codemirror/mode/javascript/javascript'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
+import CodeMirror from '@/templates/zshare/codemirror'
 import EditTable from './editable'
-
-import 'codemirror/lib/codemirror.css'
-// import 'codemirror/theme/solarized.css'
-import 'codemirror/theme/cobalt.css'
 
 import './index.scss'
 
 const { TabPane } = Tabs
-let _printFunc = null // antd 鏃犳硶鑾峰彇 codemirror 鍐呭锛屾墜鍔ㄦ帶鍒�
 
 class VerifyCard extends Component {
   static propTpyes = {
@@ -49,16 +43,14 @@
       printMode: _verify.printMode,
       printFunc: _verify.printFunc || '// Function(data, form, printer, notification) data-鎵撳嵃鏁版嵁鍒楄〃锛宖orm-琛ㄥ崟淇℃伅锛堜笉瀛樺湪鏃朵负{}锛夛紝printer-鎵撳嵃璁剧疆锛宯otification-淇℃伅鎻愮ず鎺т欢'
     })
-
-    _printFunc = _verify.printFunc || ''
   }
 
   componentDidMount() {
     let _sql = `select PrintTempNO,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate 
-    where appkey= @appkey@ and Deleted=0 
+    where appkey= @appkey@ and Deleted=0  and typechartwo=''
     union select ID,Images,a.PrintTempNO+PrintTempName as PN 
-    from (select * from sPrintTemplate where appkey= '' and Deleted=0 ) a 
-    left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b 
+    from (select * from sPrintTemplate where appkey= '' and Deleted=0  and typechartwo='') a 
+    left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@  and Deleted=0 ) b 
     on a.PrintTempNO=b.PrintTempNO 
     left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c 
     on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null`
@@ -70,8 +62,10 @@
       arr_field: 'PN,PrintTempNO,Images'
     }
 
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
     param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+
+    param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉
 
     Api.getSystemConfig(param).then(res => {
       if (res.status) {
@@ -168,7 +162,7 @@
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
-          let _verify = {...verify, ...values, printFunc: _printFunc}
+          let _verify = {...verify, ...values}
 
           if (this.refs.editTable && this.refs.editTable.state) {
             let printTypes = this.refs.editTable.state.dataSource
@@ -307,19 +301,7 @@
                         }
                       ]
                     })(
-                      <CodeMirror
-                        className="code-mirror-area"
-                        options={{
-                          mode: 'text/javascript',
-                          theme: 'cobalt',
-                          lineNumbers: true,
-                          lineWrapping: true
-                        }}
-                        onBeforeChange={() => {}}
-                        onBlur={(editor) => {
-                          _printFunc = editor.getValue()
-                        }}
-                      />
+                      <CodeMirror mode="text/javascript"/>
                     )} 
                   </Form.Item>
                 </Col> : null}
@@ -334,7 +316,7 @@
                         }
                       ]
                     })(
-                      <Select onChange={this.changeTemplate}>
+                      <Select dropdownClassName="print-template-setting" onChange={this.changeTemplate}>
                         {this.state.templates.map((option, key) =>
                           <Select.Option id={key} key={key} value={option.value}>
                             {option.text}
@@ -350,13 +332,19 @@
               </Row>
             </Form>
           </TabPane>
-          <TabPane tab="鎵撳嵃绫诲瀷" key="2">
+          <TabPane tab={
+            <span>
+              鎵撳嵃绫诲瀷
+              {verify.printerTypeList.length ? <span className="count-tip">{verify.printerTypeList.length}</span> : null}
+            </span>
+          } key="2">
             <Form {...formItemLayout}>
               <Row gutter={24}>
                 <Col span={24} className="print-tip">
                   <Form.Item label={'鎻愮ず'}>
-                    濡傛灉姝ゆ寜閽殑鎵撳嵃鍔熻兘娑夊強澶氱鎵撳嵃绫诲瀷锛屼笖涓嶅悓绫诲瀷闇�瑕佽缃笉鍚岀殑鎵撳嵃鏈烘椂锛屽彲浠ユ坊鍔犳墦鍗扮被鍨嬫帶鍒朵俊鎭紝
-                    璁剧疆瀹屾垚鍚庯紝鐢ㄦ埛鍙拡瀵逛笉鍚岀殑绫诲瀷璁剧疆瀵瑰簲鐨勬墦鍗版満銆傛敞锛氬湪杩斿洖鏁版嵁椤跺眰缁撴瀯涓坊鍔� printType銆乸rintCount銆乼emplateID 瀛楁锛屽彲鍒嗗埆鎺у埗鎵撳嵃绫诲瀷銆佹墦鍗版暟閲忓拰鎵撳嵃妯℃澘銆�
+                    濡傛灉姝ゆ寜閽秹鍙婂绉嶆暟鎹被鍨嬬殑鎵撳嵃锛岄渶瑕佽缃笉鍚岀殑鎵撳嵃鏈烘椂锛岃娣诲姞鎵撳嵃绫诲瀷鎺у埗淇℃伅锛岀敤鎴峰湪鑷畾涔夎缃腑锛屽彲鏍规嵁鎵撳嵃绫诲瀷璁剧疆瀵瑰簲鐨勬墦鍗版満銆�
+                    鎵撳嵃鏃讹紝鏁版嵁鐨勬墦鍗扮被鍨嬪彇鍐充簬杩斿洖鍊硷紙鍐呴儴鎴栧閮ㄦ帴鍙o級涓殑 printType 瀛楁銆�
+                    娉細杩斿洖鍊间腑鐨� printCount銆乼emplateID 瀛楁锛屽彲鍒嗗埆鎺у埗鎵撳嵃鏁伴噺鍜屾墦鍗版ā鏉裤��
                   </Form.Item>
                 </Col>
                 <Col span={24}>

--
Gitblit v1.8.0