| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Select, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, uuid, supId) |
| | | let modules = MenuUtils.getSubModules(menu.components, uuid, supId, menu.interfaces || null) |
| | | |
| | | this.setState({ |
| | | fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), |
| | |
| | | |
| | | 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) |
| | | _scriptSql = Utils.formatOptions(_scriptSql, 'x') |
| | | |
| | | let _sParam = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: _scriptSql, |
| | | obj_name: 'data', |
| | | arr_field: 'funcname,longparam' |
| | | arr_field: 'funcname,longparam', |
| | | exec_type: 'x' |
| | | } |
| | | |
| | | _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | |
| | | _sParam.secretkey = Utils.encrypt('', _sParam.timestamp) |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields, modules } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | <Input value={verify.innerFunc} placeholder="" autoComplete="off" onChange={(e) => this.onOptionChange(e.target.value, 'innerFunc')}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.intertype === 'inner' ? <Col span={8}> |
| | | <Form.Item required label="记录用户"> |
| | | <Radio.Group value={verify.recordUser || 'false'} onChange={(e) => this.onOptionChange(e.target.value, 'recordUser')}> |
| | | <Radio value="false">否</Radio> |
| | | <Radio value="true">是</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.intertype === 'system' ? <Col span={8}> |
| | | <Form.Item required label={'默认sql'}> |
| | | <Form.Item required label="默认sql"> |
| | | <Radio.Group value={verify.default} onChange={(e) => this.onOptionChange(e.target.value, 'default')}> |
| | | <Radio value="true">执行</Radio> |
| | | <Radio value="false">不执行</Radio> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8}> |
| | | <Form.Item label={'成功后'}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.execSuccess} onChange={(e) => this.onOptionChange(e.target.value, 'execSuccess')}> |
| | | <Radio value="never">不刷新</Radio> |
| | | <Radio value="grid">刷新表格</Radio> |
| | | <Radio value="mainline">上级(行)</Radio> |
| | | </Radio.Group> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="《刷新行》与《刷新行 / 组件》只在数据提交为 修改项 时有效。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 成功后 |
| | | </Tooltip> |
| | | }> |
| | | <Select value={verify.execSuccess} onChange={(val) => this.onOptionChange(val, 'execSuccess')}> |
| | | <Select.Option value="never">不刷新</Select.Option> |
| | | <Select.Option value="line" disabled={config.wrap.commit !== 'change'}>刷新行</Select.Option> |
| | | <Select.Option value="grid">刷新组件</Select.Option> |
| | | <Select.Option value="line_grid" disabled={config.wrap.commit !== 'change'}>刷新行 / 组件</Select.Option> |
| | | <Select.Option value="mainline">上级(行)</Select.Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label={'失败后'}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.execError} onChange={(e) => this.onOptionChange(e.target.value, 'execError')}> |
| | | <Radio value="never">不刷新</Radio> |
| | | <Radio value="grid">刷新表格</Radio> |
| | | <Radio value="mainline">上级(行)</Radio> |
| | | </Radio.Group> |
| | | <Form.Item label="失败后"> |
| | | <Select value={verify.execError} onChange={(val) => this.onOptionChange(val, 'execError')}> |
| | | <Select.Option value="never">不刷新</Select.Option> |
| | | <Select.Option value="line" disabled={config.wrap.commit !== 'change'}>刷新行</Select.Option> |
| | | <Select.Option value="grid">刷新组件</Select.Option> |
| | | <Select.Option value="line_grid" disabled={config.wrap.commit !== 'change'}>刷新行 / 组件</Select.Option> |
| | | <Select.Option value="mainline">上级(行)</Select.Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | {isPop ? <Col span={8}> |
| | | <Form.Item label={'成功后'}> |
| | | <Form.Item label="成功后"> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.closetab || 'false'} onChange={(e) => this.onOptionChange(e.target.value, 'closetab')}> |
| | | <Radio value="false">标签不关闭</Radio> |
| | | <Radio value="true">标签关闭</Radio> |
| | |
| | | </span> |
| | | } key="scripts"> |
| | | <FullScripts |
| | | verify={verify} |
| | | scripts={verify.scripts} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |