[update 高级搜索] 增加树型弹框搜索

This commit is contained in:
danshihao
2024-07-31 18:37:01 +08:00
parent 92b6515e80
commit 4f969bd632
+23 -3
View File
@@ -123,6 +123,22 @@
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
</template>
<!-- 树形弹框(带出子集和单线父级) -->
<template v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam[item.dbFieldName]"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
:tree-data="optionsData[item.dbFieldName]"
:replaceFields="{key: 'id', value: 'id', title: 'name', children: 'childPartNameList'}"
tree-checkable
show-search
allowClear
:filterTreeNode="filterTreeOption"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
/>
</template>
</a-form-item>
</a-col>
</a-row>
@@ -474,7 +490,7 @@ export default {
getFormFunc: getDomesticStandardFormModal,
getDocumentInfoFunc: getDomesticStandardDetail,
// 国标和外标的默认标准状态
defaultStandardStatus: `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.BE_IMPLEMENTED_SOON.value},${StandardStatus.RELEASE.value}`,
defaultStandardStatus: ``,
// 企标的默认标准状态
defaultEnStandardStatus: `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value}`
}
@@ -793,12 +809,12 @@ export default {
getOptionsData () {
const formList = Object.values(this.searchList).reduce((acc, cur) => acc.concat(cur), [])
formList.forEach(item => {
if (item.fieldShowType === FieldType.TREE.value || item.fieldShowType === FieldType.TREE_SINGLE.value) {
if (item.fieldShowType === FieldType.TREE.value || item.fieldShowType === FieldType.TREE_SINGLE.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value) {
// 展示类型是树选择,且有接口的
if (item.fieldHref) {
getAction(item.fieldHref).then(res => {
if (res.success) {
this.$set(this.optionsData, item.dbFieldName, res.result)
this.$set(this.optionsData, item.dbFieldName, res.result.records || res.result)
}
})
} else if (item.dictId) {
@@ -892,6 +908,10 @@ export default {
this.clauseDataSource = []
this.currStandardId = ''
this.ipagination.total = 0
},
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}