[update 高级搜索] 增加树型弹框搜索
This commit is contained in:
@@ -123,6 +123,22 @@
|
|||||||
date-format="YYYY"
|
date-format="YYYY"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
||||||
</template>
|
</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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -474,7 +490,7 @@ export default {
|
|||||||
getFormFunc: getDomesticStandardFormModal,
|
getFormFunc: getDomesticStandardFormModal,
|
||||||
getDocumentInfoFunc: getDomesticStandardDetail,
|
getDocumentInfoFunc: getDomesticStandardDetail,
|
||||||
// 国标和外标的默认标准状态
|
// 国标和外标的默认标准状态
|
||||||
defaultStandardStatus: `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.BE_IMPLEMENTED_SOON.value},${StandardStatus.RELEASE.value}`,
|
defaultStandardStatus: ``,
|
||||||
// 企标的默认标准状态
|
// 企标的默认标准状态
|
||||||
defaultEnStandardStatus: `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value}`
|
defaultEnStandardStatus: `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value}`
|
||||||
}
|
}
|
||||||
@@ -793,12 +809,12 @@ export default {
|
|||||||
getOptionsData () {
|
getOptionsData () {
|
||||||
const formList = Object.values(this.searchList).reduce((acc, cur) => acc.concat(cur), [])
|
const formList = Object.values(this.searchList).reduce((acc, cur) => acc.concat(cur), [])
|
||||||
formList.forEach(item => {
|
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) {
|
if (item.fieldHref) {
|
||||||
getAction(item.fieldHref).then(res => {
|
getAction(item.fieldHref).then(res => {
|
||||||
if (res.success) {
|
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) {
|
} else if (item.dictId) {
|
||||||
@@ -892,6 +908,10 @@ export default {
|
|||||||
this.clauseDataSource = []
|
this.clauseDataSource = []
|
||||||
this.currStandardId = ''
|
this.currStandardId = ''
|
||||||
this.ipagination.total = 0
|
this.ipagination.total = 0
|
||||||
|
},
|
||||||
|
filterTreeOption (input, option) {
|
||||||
|
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
|
||||||
|
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user