| | |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) |
| | | const { TextArea } = Input |
| | | |
| | | class ActionForm extends Component { |
| | |
| | | // if (this.record.execSuccess === 'never' && this.record.resetForms && this.record.resetForms[0]) { |
| | | // shows.push('returnValue') |
| | | // } |
| | | } |
| | | |
| | | if (this.record.syncComponent && this.record.syncComponent[0] === 'multiComponent') { |
| | | shows.push('syncComponents') |
| | | } |
| | | |
| | | if (this.record.linkmenu && this.record.linkmenu !== 'goback') { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={label} className="textarea"> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: item.required, |
| | | message: '请添加' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<MKTable columns={item.columns || []} actions={item.actions}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | |
| | | initVal: card.syncComponent, |
| | | tooltip: '执行成功后(或执行失败且存在刷新项时)需要刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。', |
| | | required: false, |
| | | options: modules |
| | | options: modules.length ? [...modules, {value: 'multiComponent', label: '多组件'}] : [] |
| | | // options: modules |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | value: 'true', |
| | | text: '刷新' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'table', |
| | | key: 'syncComponents', |
| | | label: '组件列表', |
| | | initVal: card.syncComponents || [], |
| | | required: true, |
| | | actions: ['edit', 'del', 'add', 'move'], |
| | | columns: [ |
| | | { |
| | | title: '组件', |
| | | dataIndex: 'syncComId', |
| | | inputType: 'cascader', |
| | | editable: true, |
| | | unique: true, |
| | | required: true, |
| | | extends: [{key: 'label', value: 'label'}], |
| | | width: '70%', |
| | | render: (text, record) => record.label, |
| | | options: modules |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | if (btn.syncComponentId) { |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | |
| | | |
| | | if (btn.syncComponentId) { |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |