| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Button, notification, Modal, Icon } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Modal } from 'antd' |
| | | import { CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | import './index.scss' |
| | | |
| | | const MutilForm = asyncSpinComponent(() => import('./advanceform')) |
| | | const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/checkCard')) |
| | | const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheckCard')) |
| | | const MKSelect = asyncComponent(() => import('./mkSelect')) |
| | | const DateGroup = asyncComponent(() => import('./dategroup')) |
| | | const MKDatePicker = asyncComponent(() => import('./mkDatePicker')) |
| | |
| | | } |
| | | |
| | | _searchlist.forEach(item => { |
| | | if (item.type === 'link') { |
| | | // if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | linkFields[item.linkField] = linkFields[item.linkField] || [] |
| | | linkFields[item.linkField].push({field: item.field, uuid: item.uuid}) |
| | | } |
| | |
| | | item.options.unshift({ |
| | | key: Utils.getuuid(), |
| | | Value: '', |
| | | Text: this.state.dict['main.all'] |
| | | Text: '全部', |
| | | ParentID: '' |
| | | }) |
| | | } |
| | | |
| | |
| | | let _list = _searchlist.map(item => { |
| | | if (item.hidden) return item |
| | | |
| | | if (linkFields[item.field]) { |
| | | if (linkFields[item.field] && (item.type === 'select' || item.type === 'link' || (item.type === 'checkcard' && item.multiple !== 'true'))) { |
| | | item.linkFields = linkFields[item.field] |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | let supItem = fieldMap.get(item.linkField) |
| | | |
| | | if (!supItem) { |
| | |
| | | _item = {..._item, ...cell} |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | _item.ParentID = cell[item.linkField] |
| | | } |
| | | |
| | |
| | | item.oriOptions = [...item.oriOptions, ...options] |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | if (item.supInitVal) { |
| | | item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '') |
| | | } else { |
| | | item.options = item.oriOptions |
| | | } |
| | | } else if (item.type === 'select' || item.type === 'multiselect' || item.type === 'checkcard') { |
| | | } else if (item.oriOptions) { |
| | | item.options = item.oriOptions |
| | | } |
| | | |
| | |
| | | this.handleSubmit() |
| | | }, 1000) |
| | | } else { |
| | | setTimeout(() => { |
| | | this.handleSubmit() |
| | | }, 10) |
| | | } |
| | | } |
| | | |
| | |
| | | this.record[item.field] = type |
| | | |
| | | this.handleSubmit() |
| | | } |
| | | |
| | | cardChange = (val, item) => { |
| | | this.record[item.field] = val |
| | | |
| | | if (!item.linkFields) { |
| | | setTimeout(() => { |
| | | this.handleSubmit() |
| | | }, 10) |
| | | } |
| | | } |
| | | |
| | | getFields() { |
| | |
| | | content = <DateGroup position={index} config={item} onChange={(val, type) => this.dateGroupChange(val, type, item)} /> |
| | | } else if (item.type === 'checkcard') { |
| | | className = 'checkcard' |
| | | content = <MKCheckCard card={item} onChange={this.handleSubmit} /> |
| | | content = <MKCheckCard config={item} onChange={(val) => this.cardChange(val, item)} /> |
| | | } |
| | | |
| | | if (content) { |
| | |
| | | <div key={index}> |
| | | <span>{item.label}: </span> |
| | | <span className="advance-value">{item.value}</span> |
| | | <Icon type="close" onClick={() => this.closeAdvanceForm(item)} /> |
| | | <CloseOutlined onClick={() => this.closeAdvanceForm(item)} /> |
| | | </div>) |
| | | })} |
| | | </div> : null} |