| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Radio } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | |
| | | import UniqueForm from './uniqueform' |
| | |
| | | |
| | | state = { |
| | | verify: {}, |
| | | systemScripts: [], |
| | | excelColumns: [ |
| | | { |
| | | title: 'Column', |
| | |
| | | { |
| | | title: 'SQL', |
| | | dataIndex: 'sql', |
| | | width: '70%' |
| | | width: '60%' |
| | | }, |
| | | { |
| | | title: '执行位置', |
| | | dataIndex: 'position', |
| | | width: '10%', |
| | | render: (text, record) => record.position !== 'front' ? 'sql后' : 'sql前' |
| | | }, |
| | | { |
| | | title: '状态', |
| | |
| | | columns: _columns, |
| | | scripts: _verify.scripts || [], |
| | | uniques: _verify.uniques || [] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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` |
| | | |
| | | _scriptSql = Utils.formatOptions(_scriptSql) |
| | | |
| | | let _sParam = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: _scriptSql, |
| | | obj_name: 'data', |
| | | arr_field: 'funcname,longparam' |
| | | } |
| | | |
| | | _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | systemScripts: res.data.map(item => { |
| | | return { |
| | | name: item.funcname, |
| | | value: Utils.formatOptions(item.longparam, true) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | isdefault={verify.default} |
| | | usefulfields={verify.columns} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | | /> |