| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox, Typography } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const { Paragraph } = Typography |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) |
| | | const acTyOptions = { |
| | |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden', 'openTab'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden'] |
| | |
| | | reOptions.intertype = this.state.interTypeOptions |
| | | |
| | | if (intertype === 'custom') { |
| | | shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify') |
| | | shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify', 'ContentType', 'outerBlacklist') |
| | | if (this.record.procMode === 'system') { |
| | | shows.push('sql', 'sqlType') |
| | | } else if (this.record.procMode === 'inner') { |
| | |
| | | shows.push('innerFunc') |
| | | } |
| | | if (this.record.callbackType === 'func') { |
| | | shows.push('callbackFunc') |
| | | shows.push('callbackFunc', 'output') |
| | | } else if (this.record.callbackType === 'script') { |
| | | shows.push('cbTable', 'output') |
| | | } else if (this.record.callbackType !== 'none') { |
| | | shows.push('cbTable') |
| | | } |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | } else if (intertype === 'outer') { |
| | | shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType', 'output') |
| | | shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType') |
| | | if (this.record.procMode === 'system') { |
| | | shows.push('sql', 'sqlType') |
| | | } else if (this.record.procMode === 'inner') { |
| | |
| | | shows.push('innerFunc') |
| | | } |
| | | if (this.record.callbackType === 'func') { |
| | | shows.push('callbackFunc') |
| | | shows.push('callbackFunc', 'output') |
| | | } else if (this.record.callbackType === 'script') { |
| | | shows.push('cbTable', 'output') |
| | | } else if (this.record.callbackType !== 'none') { |
| | | shows.push('cbTable') |
| | | } |
| | | |
| | | reRequired.outerFunc = false |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('cbTable') |
| | | } |
| | | |
| | | reRequired.outerFunc = false |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'drawer') { |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'modal') { |
| | | shows.push('popshow') |
| | | } |
| | | if (this.record.popClose === 'grid') { |
| | | shows.push('resetPageIndex') |
| | |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.pageTemplate === 'custom') { |
| | | shows.push('url', 'joint', 'open') |
| | | shows.push('url', 'proUrl', 'joint', 'open') |
| | | } else if (this.record.pageTemplate === 'linkpage') { |
| | | shows.push('linkmenu', 'open') |
| | | |
| | |
| | | reTooltip.linkmenu = '' |
| | | } else if (this.record.pageTemplate === 'billprint') { |
| | | shows.push('printTemp') |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value)) |
| | | reOptions.Ot = requireOptions |
| | | } else if (this.record.pageTemplate === 'pay') { |
| | | reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') |
| | | } |
| | |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | reRequired.outerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | reRequired.outerFunc = true |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | |
| | | } |
| | | |
| | | if (appType === 'mob') { |
| | | if (Ot !== 'notRequired' && openType !== 'excelOut') { |
| | | if (openType !== 'excelOut') { |
| | | shows.push('control') |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (Ot !== 'notRequired' && openType !== 'excelOut') { |
| | | if (openType !== 'excelOut') { |
| | | reOptions.control = [ |
| | | { value: '', text: '无' }, |
| | | { value: 'disabled', text: '禁用' }, |
| | |
| | | { pattern: formRule.func.pattern, message: formRule.func.message }, |
| | | { max: formRule.func.max, message: formRule.func.maxMessage } |
| | | ) |
| | | } else if (item.key === 'outerBlacklist') { |
| | | rules.push( |
| | | { max: 512, message: '最多512个字符' } |
| | | ) |
| | | } else if (item.key === 'output') { |
| | | if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) { |
| | | rules = [{ |
| | |
| | | { required: item.readonly ? false : item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | if (item.key === 'url' || item.key === 'proUrl') { |
| | | rules.push({ |
| | | pattern: /^[^\s]*$/, |
| | | message: '地址中不可使用空格!' |
| | | }) |
| | | } |
| | | |
| | | content = <TextArea rows={2} readOnly={item.readonly}/> |
| | | } else if (item.type === 'keyinterface') { |
| | | span = 24 |
| | |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} help={item.help} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | |
| | | </Col> |
| | | ) |
| | | }) |
| | | |
| | | if (window.debugger && this.props.card.uuid) { |
| | | fields.push( |
| | | <Col span={12} key="uuid"> |
| | | <Form.Item label="按钮ID"> |
| | | <Paragraph copyable>{this.props.card.uuid}</Paragraph> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | |
| | | return fields |
| | | } |
| | |
| | | values.verify = card.verify || null |
| | | values.modal = card.modal || null |
| | | values.config = card.config || null |
| | | values.$fixed = card.$fixed || false |
| | | |
| | | if (card.OpenType === 'excelOut' && values.OpenType === 'excelIn') { |
| | | if (values.verify && values.verify.columns && values.verify.columns.length > 0) { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (values.outerBlacklist) { |
| | | values.outerBlacklist = values.outerBlacklist.replace(/\s/ig, '') |
| | | } |
| | | |
| | | if (values.openmenu && Array.isArray(values.openmenu) && values.openmenu.length > 0) { |
| | | let list = null |