From db4ef847383cf2bb24fd242ff46a211ee0459e7a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 20 六月 2023 00:09:31 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/zshare/topSearch/index.jsx | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 deletions(-) diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index bb8561d..bdaf619 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -15,7 +15,7 @@ import './index.scss' const MutilForm = asyncSpinComponent(() => import('./advanceform')) -const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheckCard')) +const MKCheckCard = asyncComponent(() => import('./mkCheckCard')) const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck')) const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch')) const MKSelect = asyncComponent(() => import('./mkSelect')) @@ -156,6 +156,9 @@ // 鏁版嵁婧愭煡璇㈣鍙� if (item.resourceType === '1' && item.dataSource) { + if (item.multiple === 'dropdown') { + item.parentField = 'pid' + } let _option = Utils.getSelectQueryOptions(item) if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { @@ -178,6 +181,10 @@ } } item.oriOptions = fromJS(item.options).toJS() + + if (item.type === 'checkcard' && item.multiple === 'dropdown' && item.resourceType === '0') { + this.resetCheckcard(item) + } } fieldMap.set(item.field, item) @@ -223,6 +230,37 @@ this.improveSearch(mainItems, localItems) } }) + } + + resetCheckcard = (item) => { + let _options = [] + let _others = [] + item.oriOptions.forEach(op => { + if (op.pid === item.mark) { + _options.push(op) + } else { + _others.push(op) + } + }) + + _options = _options.map(op => { + op.children = [] + + _others = _others.filter(cell => { + if (cell.pid === op.$value) { + op.children.push(cell) + return false + } + return true + }) + + op.subIds = op.children.map(cell => cell.$value) + + return op + }) + + item.oriOptions = _options + item.options = _options } // 鏌ヨ涓嬫媺鑿滃崟 @@ -432,6 +470,10 @@ }) item.oriOptions = [...item.oriOptions, ...options] + + if (item.type === 'checkcard' && item.multiple === 'dropdown') { + this.resetCheckcard(item) + } } if (item.linkField) { -- Gitblit v1.8.0