| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MKInput from './mkInput' |
| | | import './index.scss' |
| | | |
| | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id,用于查询下拉选择项 |
| | | config: PropTypes.object, // 组件配置信息(自定义页面) |
| | | refreshdata: PropTypes.func // 刷新数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | } |
| | | |
| | | state = { |
| | |
| | | let advanceValues = [] |
| | | let linkFields = {} |
| | | let record = {} |
| | | let hasReqFields = false |
| | | |
| | | let forbid = false // header中不设置高级搜索 |
| | | let _setting = {showAdv: false, show: false, style: null} |
| | | |
| | |
| | | |
| | | if (fieldMap.has(item.field)) { |
| | | item.field = item.field + '@tail@' |
| | | } |
| | | |
| | | if (item.required) { |
| | | hasReqFields = true |
| | | } |
| | | |
| | | if (item.advanced && !forbid) { |
| | |
| | | |
| | | this.setState({ |
| | | setting: _setting, |
| | | hasReqFields, |
| | | hasReqFields: config.$s_req, |
| | | advanceValues, |
| | | searchlist: _list |
| | | }, () => { |
| | |
| | | this.sign = '' |
| | | }, 2000) |
| | | |
| | | this.props.refreshdata(searches) |
| | | if (this.props.refreshdata) { |
| | | this.props.refreshdata(searches) |
| | | } else { |
| | | window.GLOB.SearchBox.set(this.props.config.$searchId, searches) |
| | | MKEmitter.emit('searchRefresh', this.props.config.$searchId) |
| | | } |
| | | }) |
| | | }) |
| | | } |