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 | 45 +++++++++++++++------------------------------ 1 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index c687f65..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,10 +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.encrypt(param.secretkey, param.timestamp, true) // 浜戠鏁版嵁楠岃瘉 + param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 Api.getSystemConfig(param).then(res => { if (res.status) { @@ -170,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 @@ -309,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} @@ -336,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} @@ -352,7 +332,12 @@ </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"> -- Gitblit v1.8.0