| | |
| | | import { Form, Row, Col, Button, notification, Modal, Drawer } from 'antd' |
| | | import { CloseOutlined, DownOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | |
| | | } |
| | | |
| | | record = {} |
| | | sign = '' |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, searchlist, setting } = this.props |
| | |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | let all = false |
| | | result[item.field].forEach(cell => { |
| | | let _item = { |
| | | key: Utils.getuuid(), |
| | |
| | | _item.Value = cell[item.valueField] |
| | | _item.Text = cell[item.valueText] + '' |
| | | |
| | | if (!_item.Text || map.has(_item.ParentID + _item.Value)) return |
| | | if (map.has(_item.ParentID + _item.Value)) return |
| | | if (!_item.Text) { |
| | | if (!all) { |
| | | _item.Text = '全部' |
| | | all = true |
| | | } else { |
| | | return |
| | | } |
| | | } |
| | | |
| | | map.set(_item.ParentID + _item.Value, 0) |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item = {..._item, ...cell} |
| | | |
| | | if (item.urlField) { |
| | | _item.$url = cell[item.urlField] || '' |
| | | } else if (item.colorField) { |
| | | _item.$color = cell[item.colorField] || '' |
| | | } |
| | | |
| | | if (map.has(_item.ParentID + _item.$value)) return |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let sign = md5(JSON.stringify(searches)) |
| | | |
| | | if (sign === this.sign) return |
| | | |
| | | this.sign = sign |
| | | setTimeout(() => { |
| | | this.sign = '' |
| | | }, 2000) |
| | | |
| | | this.props.refreshdata(searches) |
| | | }) |
| | | }) |