From 5ff2ee3b46a584368a6d2cebbe180abb1947f927 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 06 八月 2020 00:21:42 +0800 Subject: [PATCH] 2020-08-06 --- src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 28 ++++------------------------ 1 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index c687f65..0cb8e27 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,8 +43,6 @@ printMode: _verify.printMode, printFunc: _verify.printFunc || '// Function(data, form, printer, notification) data-鎵撳嵃鏁版嵁鍒楄〃锛宖orm-琛ㄥ崟淇℃伅锛堜笉瀛樺湪鏃朵负{}锛夛紝printer-鎵撳嵃璁剧疆锛宯otification-淇℃伅鎻愮ず鎺т欢' }) - - _printFunc = _verify.printFunc || '' } componentDidMount() { @@ -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} -- Gitblit v1.8.0