| | |
| | | |
| | | let result = await Api.getSystemConfig(_param) |
| | | if (result.status) { |
| | | if (this.props.editState && this.props.editLevel) return |
| | | |
| | | if (result.data.length === 0) { // 查询菜单为空 |
| | | this.setState({ |
| | | subMenulist: [], |
| | |
| | | */ |
| | | actionTrigger = (item) => { |
| | | const { data } = this.props |
| | | |
| | | let _this = this |
| | | |
| | | if (item.btnType !== 'cancel') { |
| | |
| | | value: _value |
| | | }) |
| | | }) |
| | | // resolve(search) |
| | | resolve(search) |
| | | } else { |
| | | reject(err) |
| | | } |
| | |
| | | ], |
| | | groups:[], |
| | | fields:[ |
| | | {"label":"函数","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, |
| | | {"label":"函数","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, |
| | | {"label":"排序","field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"15870101796149403f2pqfpviuo415m2"}, |
| | | {"label":"描述","field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"}, |
| | | {"label":"脚本","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"} |
| | |
| | | tables: [{"TbName":"s_custom_script","Remark":"自定义脚本"}], |
| | | groups: [], |
| | | fields: [ |
| | | {"label":"函数","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, |
| | | {"label":"函数","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, |
| | | {"label":"排序","field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"1587010196675i9m6ie3tv9kg2rhgfi0"}, |
| | | {"label":"描述","field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"}, |
| | | {"label":"脚本","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"} |
| | |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | | message: formRule.input.letternummsg |
| | | }] |
| | | } else if (item.regular === 'funcname') { |
| | | _rules = [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | | message: formRule.input.funcname |
| | | }] |
| | | } |
| | | } |
| | | fields.push( |
| | |
| | | visible={this.state.profileVisible} |
| | | width={'75vw'} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={this.state.dict['header.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | destroyOnClose |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | |
| | | let error = Utils.verifySql(values.dataresource) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | resolve(values) |
| | | } |
| | | } else { |
| | |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={this.state.dict['header.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | destroyOnClose |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification, InputNumber } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | let error = Utils.verifySql(values.dataresource) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={this.state.dict['header.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | destroyOnClose |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | let error = Utils.verifySql(values.dataresource) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | resolve(values) |
| | | } |
| | | } else { |
| | |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, notification, InputNumber, Tooltip } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import { dateOptions } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import EditTable from '../modaleditable' |
| | | import './index.scss' |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | let error = Utils.verifySql(values.dataSource) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (isvalid) { |
| | | resolve(values) |
| | | } |
| | |
| | | import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd' |
| | | import { dateOptions, matchReg, formRule } from '@/utils/option.js' |
| | | import EditTable from '../searcheditable' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | } |
| | | }) |
| | | |
| | | let error = Utils.verifySql(values.dataSource) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | | notification.warning({ |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | {type === '1' ? <Col span={7}> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} type="primary" className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | <Col span={7}> |
| | |
| | | return |
| | | } |
| | | |
| | | let error = Utils.verifySql(values.sql) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: this.props.initsql + values.sql |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" className="add-row"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | <Col span={7}> |
| | |
| | | return |
| | | } |
| | | |
| | | let error = Utils.verifySql(values.sql, 'customscript') |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let tail = ` |
| | | aaa: |
| | | ` |
| | |
| | | }) |
| | | } |
| | | |
| | | selectScript = (val) => { |
| | | selectScript = (val, option) => { |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | | ` |
| | | } |
| | | |
| | | _sql = _sql.replace(/\s{6}$/, '') |
| | | _sql = _sql + `/*${option.props.title}*/ |
| | | ` |
| | | _sql = _sql.replace(/\s{4}$/, '') |
| | | _sql = _sql + val |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: val |
| | | sql: _sql |
| | | }) |
| | | } |
| | | |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verifycard2"> |
| | | <Row gutter={24}> |
| | | {usefulfields ? <Col span={21} className="sqlfield"> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | {usefulfields} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={20} className="sql"> |
| | | <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 执行位置 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('position', { |
| | | initialValue: 'back' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="front">sql前</Radio> |
| | | <Radio value="back">sql后</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'从系统函数集中选择需要的函数,可快速添加至sql中。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 快捷添加 |
| | | </Tooltip> |
| | | }> |
| | | <Select value="" onChange={this.selectScript}> |
| | | {systemScripts.map((option, i) => |
| | | <Select.Option title={option.name} key={i} value={option.value}> |
| | | {option.name} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | {getFieldDecorator('sql', { |
| | | initialValue: '', |
| | |
| | | } |
| | | ] |
| | | })(<TextArea rows={15} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" style={{marginBottom: 20}}> |
| | | 确定 |
| | | </Button> |
| | | <Form.Item labelAlign="left" label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 执行位置 |
| | | </Tooltip> |
| | | } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> |
| | | {getFieldDecorator('position', { |
| | | initialValue: 'back' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="front">sql前</Radio> |
| | | <Radio value="back">sql后</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | <Form.Item labelAlign="left" label={ |
| | | <Tooltip placement="bottomLeft" title={'从系统函数集中选择需要的函数,可快速添加至sql中。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 快捷添加 |
| | | </Tooltip> |
| | | } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> |
| | | <Select onChange={this.selectScript}> |
| | | {systemScripts.map((option, i) => |
| | | <Select.Option title={option.name} key={i} value={option.value}> |
| | | {option.name} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | |
| | | }) |
| | | }) |
| | | |
| | | let _scriptSql = `Select distinct func+Remark as funcname,longparam from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end` |
| | | let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort` |
| | | |
| | | _scriptSql = Utils.formatOptions(_scriptSql) |
| | | |
| | |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verifycard1"> |
| | | <Row gutter={24}> |
| | | <Col span={10}> |
| | | <Col span={8}> |
| | | <Form.Item label={'字段名'}> |
| | | {getFieldDecorator('field', { |
| | | initialValue: [], |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={2} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | </Row> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} type="primary" className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | <Col span={7}> |
| | |
| | | return |
| | | } |
| | | |
| | | let error = Utils.verifySql(values.sql, 'customscript') |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中不可使用' + error, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let tail = ` |
| | | aaa: |
| | | ` |
| | |
| | | }) |
| | | } |
| | | |
| | | selectScript = (val) => { |
| | | selectScript = (val, option) => { |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | | ` |
| | | } |
| | | |
| | | _sql = _sql.replace(/\s{6}$/, '') |
| | | _sql = _sql + `/*${option.props.title}*/ |
| | | ` |
| | | _sql = _sql.replace(/\s{4}$/, '') |
| | | _sql = _sql + val |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: val |
| | | sql: _sql |
| | | }) |
| | | } |
| | | |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verifycard2"> |
| | | <Row gutter={24}> |
| | | {usefulfields ? <Col span={21} className="sqlfield"> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | {usefulfields} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={20} className="sql"> |
| | | <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 执行位置 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('position', { |
| | | initialValue: 'back' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="front">sql前</Radio> |
| | | <Radio value="back">sql后</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'从系统函数集中选择需要的函数,可快速添加至sql中。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 快捷添加 |
| | | </Tooltip> |
| | | }> |
| | | <Select value="" onChange={this.selectScript}> |
| | | {systemScripts.map((option, i) => |
| | | <Select.Option title={option.name} key={i} value={option.value}> |
| | | {option.name} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label={'sql'}> |
| | | {getFieldDecorator('sql', { |
| | | initialValue: '', |
| | |
| | | } |
| | | ] |
| | | })(<TextArea rows={15} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" style={{marginBottom: 20}}> |
| | | 确定 |
| | | </Button> |
| | | <Form.Item labelAlign="left" label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 执行位置 |
| | | </Tooltip> |
| | | } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> |
| | | {getFieldDecorator('position', { |
| | | initialValue: 'back' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="front">sql前</Radio> |
| | | <Radio value="back">sql后</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | <Form.Item labelAlign="left" label={ |
| | | <Tooltip placement="bottomLeft" title={'从系统函数集中选择需要的函数,可快速添加至sql中。'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | | 快捷添加 |
| | | </Tooltip> |
| | | } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> |
| | | <Select onChange={this.selectScript}> |
| | | {systemScripts.map((option, i) => |
| | | <Select.Option title={option.name} key={i} value={option.value}> |
| | | {option.name} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | let _scriptSql = `Select distinct func+Remark as funcname,longparam from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end` |
| | | let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort` |
| | | |
| | | _scriptSql = Utils.formatOptions(_scriptSql) |
| | | |
| | |
| | | columnChange={this.columnChange} |
| | | wrappedComponentRef={(inst) => this.columnForm = inst} |
| | | /> |
| | | <Button className="excel-col-add" title="添加显示列字段" onClick={this.columnFieldInput} type="primary"> |
| | | <Button className="excel-col-add mk-green" title="添加显示列字段" onClick={this.columnFieldInput}> |
| | | 快捷添加 |
| | | </Button> |
| | | <Table |
| | |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={2} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | </Row> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | <Button onClick={this.handleConfirm} type="primary" className="mk-green"> |
| | | 保存 |
| | | </Button> |
| | | </Col> |
| | | {/* <Col span={7}> |
| | |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | |
| | | }) |
| | | return ( |
| | | <div className="print-verify-edit-table"> |
| | | <Button onClick={this.handleAdd} type="primary" className="add-row"> |
| | | <Button onClick={this.handleAdd} className="add-row mk-green"> |
| | | 添加 |
| | | </Button> |
| | | <Table |
| | |
| | | formMessage: '最多@max个字符。', // 文本表单最大提示 |
| | | numbermsg: '请输入数字!', |
| | | lettermsg: '请输入字母!', |
| | | letternummsg: '请输入数字或字母!' |
| | | letternummsg: '请输入数字或字母!', |
| | | funcname: '请输入数字、字母、汉字以及_' |
| | | }, |
| | | field: { // 字段名 |
| | | max: 50, |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description sql语法验证 |
| | | * @return {String} sql sql语句 |
| | | * @return {String} type 验证类型 |
| | | */ |
| | | static verifySql (sql, type) { |
| | | if (!sql) return '' |
| | | let chars = [ |
| | | {key: 'create', reg: '(^|\\s)create\\s'}, |
| | | {key: 'insert', reg: '(^|\\s)insert\\s'}, |
| | | {key: 'delete', reg: '(^|\\s)delete\\s'}, |
| | | {key: 'update', reg: '(^|\\s)update\\s'}, |
| | | {key: 'set', reg: '(^|\\s)set\\s'}, |
| | | {key: 'drop', reg: '(^|\\s)drop\\s'}, |
| | | {key: 'alter', reg: '(^|\\s)alter\\s'}, |
| | | {key: 'truncate', reg: '(^|\\s)truncate\\s'}, |
| | | {key: 'if', reg: '(^|\\s)if\\s'}, |
| | | {key: 'exec', reg: 'exec'}, |
| | | {key: 'OBJECT', reg: 'OBJECT'}, |
| | | {key: 'sys.', reg: 'sys.'}, |
| | | {key: 'kill', reg: 'kill'}, |
| | | ] |
| | | |
| | | if (type === 'customscript') { |
| | | chars = chars.map(char => !['insert', 'delete', 'update', 'set', 'if', 'exec'].includes(char.key)) |
| | | } |
| | | |
| | | let error = '' |
| | | chars.forEach(char => { |
| | | if (!error && new RegExp(char.reg, 'ig').test(sql)) { |
| | | error = char.key |
| | | } |
| | | }) |
| | | |
| | | return error |
| | | } |
| | | |
| | | /** |
| | | * @description sql加密 |
| | | * @return {String} value |
| | | */ |
| | |
| | | }] |
| | | |
| | | if (!isUnFormat) { // 加密 |
| | | value = value.replace(/\n/ig, ' \n ') |
| | | // 替换关键字 |
| | | format.forEach(item => { |
| | | let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') |
| | |
| | | |
| | | // 1、替换%符(数据库中解析后sql报错) |
| | | value = value.replace(/%/ig, ' mpercent ') |
| | | |
| | | |
| | | // 1、encode编码(中文字符超出base64加密范围),2、base64加密 |
| | | value = window.btoa(window.encodeURIComponent(value)) |
| | | |
| | |
| | | value = window.atob(value) |
| | | value = value.replace(salt, '') |
| | | value = window.decodeURIComponent(window.atob(value)) |
| | | |
| | | value = value.replace(/\smpercent\s/g, '%') |
| | | |
| | | format.forEach(item => { |
| | | let reg = new RegExp(item.value, 'g') |
| | | value = value.replace(reg, ' ' + item.key + ' ') |
| | | }) |
| | | |
| | | |
| | | value = value.replace(/\s\n\s/ig, '\n') |
| | | value = value.replace(/(^\s+|\s+$)/ig, '') |
| | | } catch { |
| | | console.warn('UnFormat Failure') |