| | |
| | | sign = '' |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, BID } = this.props |
| | | const { config } = this.props |
| | | |
| | | let _searchlist = [] |
| | | let fieldMap = new Map() |
| | |
| | | let record = {} |
| | | let forbid = false // header中不设置高级搜索 |
| | | let _setting = {showAdv: false, show: false, style: null} |
| | | let BID = this.props.BID |
| | | |
| | | if (config.wrap) { |
| | | _setting.show = config.wrap.show !== 'false' |
| | |
| | | _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} |
| | | _setting.borderRadius = config.wrap.borderRadius |
| | | _setting.resetContrl = config.wrap.resetContrl || 'init' |
| | | |
| | | if (config.wrap.searchBtn === 'show') { |
| | | _setting.showBtn = true |
| | | } |
| | | |
| | | if (config.wrap.supModule) { |
| | | let BData = window.GLOB.CacheData.get(config.wrap.supModule) |
| | | BID = BData ? (BData.$BID || '') : '' |
| | | } |
| | | } |
| | | |
| | | if (config.type === 'search') { |
| | |
| | | searchlist: _list |
| | | }, () => { |
| | | if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | this.improveSimpleSearch(deForms, false) |
| | | this.improveSimpleSearch(deForms, false, null, BID) |
| | | } else if (mainItems.length > 0 || localItems.length > 0) { |
| | | this.improveSearch(mainItems, localItems) |
| | | this.improveSearch(mainItems, localItems, BID) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { config } = this.props |
| | | |
| | | if (config.type === 'search' && config.wrap.supModule) { |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { config, BID } = this.props |
| | | |
| | | if (config.checkBid && nextProps.BID !== BID) { |
| | | if (config.checkBid && config.type !== 'search' && nextProps.BID !== BID) { |
| | | this.resetOptions(nextProps.BID) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | | const { config } = this.props |
| | | |
| | | if (config.wrap.supModule !== MenuID) return |
| | | |
| | | this.resetOptions(id) |
| | | } |
| | | |
| | | resetOptions = (BID) => { |
| | |
| | | }) |
| | | |
| | | if (deForms.length > 0) { |
| | | this.improveSimpleSearch(deForms, true, searchlist) |
| | | this.improveSimpleSearch(deForms, true, searchlist, BID) |
| | | } else { |
| | | this.setState({ |
| | | searchlist: searchlist |
| | |
| | | } |
| | | |
| | | // 查询下拉菜单 |
| | | improveSearch = (mainItems, localItems) => { |
| | | const { BID } = this.props |
| | | improveSearch = (mainItems, localItems, BID) => { |
| | | let deffers = [] |
| | | |
| | | // 本地请求 |
| | |
| | | } |
| | | |
| | | // 测试系统单个请求下拉选项 |
| | | improveSimpleSearch = (deForms, trigger, searchlist) => { |
| | | improveSimpleSearch = (deForms, trigger, searchlist, BID) => { |
| | | if (deForms.length === 0) return |
| | | |
| | | let deffers = deForms.map((item, index) => { |
| | |
| | | arr_field: item.arr_field |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | if (BID) { |
| | | param.BID = BID |
| | | } |
| | | |
| | | if (window.GLOB.execType === 'x') { |
| | |
| | | } |
| | | |
| | | if (item.linkField) { |
| | | _item.ParentID = cell[item.linkField] |
| | | _item.ParentID = cell[item.linkField] + '' |
| | | } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _item.Value = cell[item.valueField] |
| | | _item.Value = cell[item.valueField] + '' |
| | | _item.Text = cell[item.valueText] + '' |
| | | |
| | | if (map.has(_item.ParentID + _item.Value)) return |
| | |
| | | |
| | | map.set(_item.ParentID + _item.Value, 0) |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item.$value = cell[item.cardValField] + '' |
| | | _item = {..._item, ...cell} |
| | | |
| | | if (item.urlField) { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (setting.showBtn) { |
| | | fields.push( |
| | | <Col className="mk-search-col search-button" key="actions"> |
| | | <Form.Item> |
| | | <Button type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | </Button> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | |
| | | return fields |