| | |
| | | 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, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import UniqueForm from './uniqueform' |
| | | import CustomScript from './customscript' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | state = { |
| | | verify: {}, |
| | | fields: [], |
| | | modules: [], |
| | | fieldLabel: {}, |
| | | systemScripts: [], |
| | | activeKey: 'basemsg', |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { columns, card, setting } = this.props |
| | | let _verify = fromJS(card).toJS() |
| | | const { columns, submit, setting, uuid } = this.props.config |
| | | let _verify = fromJS(submit).toJS() |
| | | _verify.sheet = _verify.sheet || setting.tableName |
| | | |
| | | let fieldLabel = {} |
| | | // let _columns = [] |
| | | // let _fields = {} |
| | | |
| | | columns.forEach(col => { |
| | | fieldLabel[col.field] = col.label |
| | | // _fields[col.field] = col |
| | | }) |
| | | // cols.forEach(col => { |
| | | // if (!col.field || col.type === 'index' || !_fields[col.field]) return |
| | | |
| | | // _columns.push(_fields[col.field]) |
| | | // }) |
| | | |
| | | let supId = '' |
| | | if (setting && setting.supModule) { |
| | | let pid = setting.supModule[setting.supModule.length - 1] |
| | | if (pid && pid !== 'empty') { |
| | | supId = pid |
| | | } else { |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, uuid, supId) |
| | | |
| | | this.setState({ |
| | | fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), |
| | | fieldLabel, |
| | | modules: modules, |
| | | verify: _verify |
| | | }, () => { |
| | | this.resetUniqueColumns() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields } = this.state |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields, modules } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“上级(行)”。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 刷新组件 |
| | | </Tooltip> |
| | | }> |
| | | <Cascader options={modules} value={verify.syncComponent || []} expandTrigger="hover" allowClear placeholder="" onChange={(val) => this.onOptionChange(val, 'syncComponent')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </TabPane> |
| | |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> S </span> |
| | | <Button onClick={() => {this.showError('S')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label={'停留时间'}> |
| | | <Form.Item label="停留时间"> |
| | | <InputNumber defaultValue={verify.stime || 2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> Y </span> |
| | | <Button onClick={() => {this.showError('Y')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> -1 </span> |
| | | 执行成功无提示。 |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> N </span> |
| | | <Button onClick={() => {this.showError('N')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label={'停留时间'}> |
| | | <Form.Item label="停留时间"> |
| | | <InputNumber defaultValue={verify.ntime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> F </span> |
| | | <Button onClick={() => {this.showError('F')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label={'停留时间'}> |
| | | <Form.Item label="停留时间"> |
| | | <InputNumber defaultValue={verify.ftime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> E </span> |
| | | <Button onClick={() => {this.showError('E')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> NM </span> |
| | | <Button onClick={() => {this.showError('NM')}} type="primary" size="small"> |
| | | 查看 |
| | |
| | | </Row> |
| | | <Row gutter={24}> |
| | | <Col offset={6} span={6}> |
| | | <Form.Item label={'提示编码'}> |
| | | <span className="errorval"> -1 </span> |
| | | 不提示 |
| | | <Form.Item label="提示编码"> |
| | | <span className="errorval"> -2 </span> |
| | | 执行失败无提示 |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |