| | |
| | | return |
| | | } |
| | | |
| | | let getMsearch = (components) => { |
| | | let val = null |
| | | components.forEach(com => { |
| | | if (com.type !== 'search') return |
| | | |
| | | if (com.wrap && com.wrap.supModule && com.wrap.supModule.length > 0) { |
| | | let supModule = com.wrap.supModule[com.wrap.supModule.length - 1]; |
| | | |
| | | (com.search || []).forEach(item => { |
| | | if (item.type === 'datemonth') { |
| | | if (item.initval && item.dateShift) { |
| | | val = {supModule: supModule, name: com.name} |
| | | } |
| | | } else if (item.type === 'daterange') { |
| | | if (item.initval && item.dateShift) { |
| | | val = {supModule: supModule, name: com.name} |
| | | } |
| | | } else if ((item.type === 'select' || item.type === 'link') && item.resourceType === '1') { |
| | | if (/@BID@/ig.test(item.dataSource)) { |
| | | val = {supModule: supModule, name: com.name} |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | return val |
| | | } |
| | | |
| | | let checkSearch = (components, mSearch) => { |
| | | components.forEach(item => { |
| | | if (error) return |
| | | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | let _ms = getMsearch(tab.components) |
| | | |
| | | if (_ms) { |
| | | checkSearch(tab.components, _ms) |
| | | } else { |
| | | checkSearch(tab.components, mSearch) |
| | | } |
| | | }) |
| | | return |
| | | } else if (item.type === 'group') { |
| | | checkSearch(item.components, mSearch) |
| | | return |
| | | } else if (!mSearch || !item.setting) { |
| | | return |
| | | } else if (!(item.type === 'table' || (item.type === 'card' && ['datacard', 'dualdatacard'].includes(item.subtype)))) { |
| | | return |
| | | } |
| | | |
| | | if (item.setting.useMSearch === 'true' && item.setting.supModule && item.setting.supModule[0] !== 'empty') { |
| | | let id = item.setting.supModule[item.setting.supModule.length - 1] |
| | | if (mSearch.supModule !== id) { |
| | | error = `${item.name} 使用了外部搜索,但与外部搜索(${mSearch.name})的上级组件不一致。` |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | checkSearch(config.components, getMsearch(config.components)) |
| | | |
| | | if (error) { |
| | | Modal.warning({ |
| | | title: error, |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.sqlList = [] |
| | | this.linkMain = [] |
| | | |