| | |
| | | margin-left: 12px; |
| | | padding: 10px 12px; |
| | | cursor: pointer; |
| | | font-size: 18px; |
| | | font-size: 1.5vw; |
| | | } |
| | | .mk-image-preview-operations-operation-disabled { |
| | | color: rgba(255, 255, 255, 0.25); |
| | |
| | | config.absFields = null |
| | | } |
| | | |
| | | if (!config.setting.primaryKey && config.columns.length > 0) { |
| | | config.columns.forEach(col => { |
| | | if (col.field.toLowerCase() === 'id') { |
| | | config.setting.primaryKey = col.field |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.updateComponent(config) |
| | | } |
| | | |
| | |
| | | <Modal |
| | | wrapClassName="mk-pop-modal" |
| | | visible={visible} |
| | | width={'75vw'} |
| | | width={'80vw'} |
| | | maskClosable={false} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | editItem: null, |
| | | usefulfields: null, |
| | | loading: false, |
| | | skip: false, |
| | | verifySql: '' |
| | | } |
| | | |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem } = this.state |
| | | const { editItem, skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (skip) { |
| | | this.setState({ |
| | | editItem: null, |
| | | skip: false |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { systemScripts, btn, type } = this.props |
| | | const { usefulfields, editItem } = this.state |
| | | const { usefulfields, editItem, skip } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!type ? <Col span={10}> |
| | | {!type ? <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={'快捷添加'}> |
| | | <Select |
| | | showSearch |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | <Col span={5} style={{paddingTop: '3px', whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 15}}> |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '12px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | {getFieldDecorator('sql', { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Button, notification, Select, Tooltip, Modal } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Select, Tooltip, Modal, Switch } from 'antd' |
| | | import Toast from 'antd-mobile/es/components/toast' |
| | | import Dialog from 'antd-mobile/es/components/dialog' |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | skip: false, |
| | | editItem: null, |
| | | loading: false, |
| | | usefulFields: '' |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | | this.props.scriptsChange(values).then(() => { |
| | | if (skip) { |
| | | this.setState({ |
| | | editItem: null, |
| | | loading: false |
| | | skip: false |
| | | }) |
| | | |
| | | if (values.uuid) { |
| | |
| | | sql: ' ' |
| | | }) |
| | | this.props.scriptSubmit(values) |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | } else { |
| | | this.setState({loading: true}) |
| | | this.props.scriptsChange(values).then(() => { |
| | | this.setState({ |
| | | editItem: null, |
| | | loading: false |
| | | }) |
| | | |
| | | if (values.uuid) { |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | } |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | this.props.scriptSubmit(values) |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | render() { |
| | | const { systemScripts, setting, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { usefulFields } = this.state |
| | | const { usefulFields, skip } = this.state |
| | | |
| | | let urlFields = window.GLOB.urlFields ? window.GLOB.urlFields.join(', ') : '' |
| | | |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6} className="add"> |
| | | <Col span={5} style={{whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginTop: 5, marginBottom: 15, marginLeft: 30}}> |
| | | 保存 |
| | | </Button> |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | editItem: null, |
| | | usefulfields: null, |
| | | loading: false, |
| | | skip: false, |
| | | verifySql: '' |
| | | } |
| | | |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem } = this.state |
| | | const { editItem, skip } = this.state |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (skip) { |
| | | this.setState({ |
| | | skip: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { systemScripts, btn, type } = this.props |
| | | const { usefulfields, editItem } = this.state |
| | | const { usefulfields, editItem, skip } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!type ? <Col span={10}> |
| | | {!type ? <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={'快捷添加'}> |
| | | <Select |
| | | showSearch |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Col span={5} className="add" style={{paddingTop: '2px', whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | {getFieldDecorator('sql', { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Button, notification, Tooltip, Select } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Tooltip, Select, Switch } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | systemScripts: [], |
| | | usefulfields: null, |
| | | loading: false, |
| | | skip: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | |
| | | this.props.scriptsChange(values, (status) => { |
| | | if (status) { |
| | | this.setState({ |
| | | skip: false, |
| | | loading: false, |
| | | editItem: null |
| | | }) |
| | |
| | | loading: false |
| | | }) |
| | | } |
| | | }) |
| | | }, skip) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | selectScript = (value, option) => { |
| | | const { usefulfields, sheet } = this.props |
| | | |
| | | let _value = '' |
| | | if (value === 'default') { |
| | | let fields = usefulfields.filter(item => item.import !== 'false') |
| | | fields = fields.map(col => col.Column).join(',') |
| | | |
| | | let _sheet = sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | |
| | | _value = `Select ${fields} From ${_sheet}` |
| | | } else { |
| | | _value = value |
| | | } |
| | | |
| | | let _value = value |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (/^\s+$/.test(_sql)) { |
| | | _sql = '' |
| | |
| | | |
| | | render() { |
| | | const { sheet, linefields } = this.props |
| | | const { usefulfields, systemScripts } = this.state |
| | | const { usefulfields, systemScripts, skip } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | onSelect={this.selectScript} |
| | | getPopupContainer={() => document.getElementById('verify-excelin-custom-scripts')} |
| | | > |
| | | <Select.Option key="default" value={'default'}> |
| | | 默认sql |
| | | </Select.Option> |
| | | <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='测试断点' goto aaa`}> |
| | | 测试断点 |
| | | </Select.Option> |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6} className="add"> |
| | | <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | </Button> |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | } |
| | | } |
| | | |
| | | scriptsChange = (values, callback) => { |
| | | scriptsChange = (values, callback, skip) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | if (values.uuid) { |
| | |
| | | verify.scripts.push(values) |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | | |
| | | this.sqlverify(() => { // 验证成功 |
| | | if (skip) { |
| | | this.setState({ |
| | | loading: false, |
| | | verify: verify |
| | | }) |
| | | callback(true) |
| | | }, () => { // 验证失败 |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | callback(false) |
| | | }, verify.scripts) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | |
| | | this.sqlverify(() => { // 验证成功 |
| | | this.setState({ |
| | | loading: false, |
| | | verify: verify |
| | | }) |
| | | callback(true) |
| | | }, () => { // 验证失败 |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | callback(false) |
| | | }, verify.scripts) |
| | | } |
| | | } |
| | | |
| | | sqlverify = (_resolve, _reject, scripts) => { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | |
| | | state = { |
| | | editItem: null, |
| | | loading: false |
| | | loading: false, |
| | | skip: false |
| | | } |
| | | |
| | | edit = (record) => { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { editItem } = this.state |
| | | const { editItem, skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (skip) { |
| | | this.setState({ |
| | | skip: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | selectScript = (value, option) => { |
| | | if (!value || !option) return |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (/^\s+$/.test(_sql)) { |
| | | _sql = '' |
| | | } |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { skip } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | <Col span={8}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Select |
| | | allowClear |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6} className="add"> |
| | | <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | </Button> |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | |
| | | state = { |
| | | editItem: null, |
| | | loading: false |
| | | loading: false, |
| | | skip: false |
| | | } |
| | | |
| | | edit = (record) => { |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem } = this.state |
| | | const { editItem, skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (skip) { |
| | | this.setState({ |
| | | skip: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (!value || !option) return |
| | | |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (/^\s+$/.test(_sql)) { |
| | | _sql = '' |
| | | } |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { editItem } = this.state |
| | | const { editItem, skip } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | {usefulfields ? <span>, {usefulfields}</span> : ''} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ?<Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | {!_type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ?<Col span={10}> |
| | | {!_type ? <Col span={8}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Select |
| | | showSearch |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 30}}> |
| | | {_type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | {!_type ? <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> : null} |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" overlayStyle={{width: '320px', maxWidth: '320px'}} title={<><div>{'调试替换符 /*$breakpoint_begin_xxxx@ 、@breakpoint_end_xxxx$*/,在控制台中输入 window.debug = \'xxxx\' 会启用对应的调试语句,快捷键 ctrl+c 或在控制台中输入 window.debug = false 关闭调试。注:调试时字符 $breakpoint_proc@ 将被替换。'}</div><div style={{height: '5px'}}></div><div>{'数据检查替换符 $check@ -> \'\'、 @check$ -> \'\',ErrorCode等于C时会询问是否继续执行,确定时 $check@ -> /*、 @check$ -> */。注:1、需使用系统接口 2、行设置为“选择多行”时无效。'}</div></>}> |
| | |
| | | // value = window.atob(value) |
| | | // value = value.replace('minKe', '') |
| | | // value = window.decodeURIComponent(window.atob(value)) |
| | | |
| | | // // 外联数据库替换 |
| | | // if (window.GLOB.externalDatabase !== null && window.GLOB.externalDatabase) { |
| | | // value = value.replace(window.GLOB.externalDatabase, '@db@') |
| | | // } |
| | | |
| | | // value = value.replace(/ mpercent /ig, '%') |
| | | |
| | | // // 替换关键字 |
| | |
| | | // value = value.replace(reg, ' ' + item.key + ' ') |
| | | // }) |
| | | |
| | | // // value = value.replace(/\n/ig, ' \n ') |
| | | // value = value.replace(/ \n /ig, '\n') |
| | | |
| | | // return value |
| | | // } |
| | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import ImgScale from '@/components/imgScale' |
| | | import './index.scss' |
| | | |
| | | const CustomPage = asyncComponent(() => import('@/tabviews/custom')) |
| | |
| | | {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | </ConfigProvider> |
| | | <ImgScale /> |
| | | </div> |
| | | ) |
| | | } |