[update] 修改高级检索

This commit is contained in:
lideqin
2023-11-30 10:32:51 +08:00
parent 047d1a988c
commit 303364b65a
3 changed files with 152 additions and 147 deletions
+5 -5
View File
@@ -15,16 +15,16 @@ const getSearchParamNumFullText = (params) => getAction('/home/lawsHomeSearch/ge
const generalSearchFullTextSearch = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllPage', params)
// 国内标准的高级搜索,查询搜索条件
const getDomesticStandardQuery = (params) => getAction('/laws/standard/domestic/getQueryCondition', params)
const getDomesticStandardQuery = (params) => getAction('/laws/standard/domestic/getAdvancedQueryCondition', params)
// 国外标准的高级搜索,查询搜索条件
const getOverseasStandardQuery = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
const getOverseasStandardQuery = (params) => getAction('/laws/standard/overseas/getAdvancedQueryCondition', params)
// 企业标准的高级搜索,查询搜索条件
const getEnterStandardQuery = (params) => getAction('/laws/standard/enterprise/getQueryCondition', params)
const getEnterStandardQuery = (params) => getAction('/laws/standard/enterprise/getAdvancedQueryCondition', params)
// 国内标准的高级搜索,查询列表数据
const getDomesticStandardList = (params) => postAction('/laws//standard/domestic/getCommonPage', params)
const getDomesticStandardList = (params) => postAction('/laws/standard/domestic/getCommonPage', params)
// 国外标准的高级搜索,查询列表数据
const getOverseasStandardList = (params) => postAction('/laws//standard/overseas/getCommonPage', params)
const getOverseasStandardList = (params) => postAction('/laws/standard/overseas/getCommonPage', params)
// 企标的高级搜索,查询列表数据
const getEnterStandardList = (params) => postAction('/laws/standard/enterprise/getCommonPage', params)
+145 -140
View File
@@ -1,141 +1,142 @@
<template>
<a-card :bordered="false">
<!-- 一般检索和高级检索的tab切换 -->
<div class="tab-wrapper">
<span class="tab-title" @click="clickGeneralSearch">一般检索</span>
<span class="tab-title tab-title-curr">高级检索</span>
<a @click="handleToggleChange">{{ toggleSearchStatus ? '收起条件' : '展开条件' }}</a>
</div>
<a-divider>检索类别</a-divider>
<div class="filter-area-div" ref="filterArea">
<a-row :gutter="24" class="filter-row">
<a-col :md="2" class="label-col"><span class="search_label">标准类型</span></a-col>
<a-col :md="18" class="option-col">
<div v-for="item in standardTypeOptions" :key="item.value" class="option-div" :class="currStandardType === item.value ? 'option-curr' : ''" @click="standardTypeChange(item.value)">
{{ item.label }}
</div>
</a-col>
</a-row>
</div>
<a-form v-if="toggleSearchStatus" layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="(24 / (minLength + 1))"
:sm="(24 / minLength)"
v-for="(item) in searchList"
:key="item.id"
style="line-height: 48px">
<!-- 树形选择器 -->
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol" :colon="false">
<template v-if="item.fieldShowType === FieldType.TREE.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]"
tree-checkable
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
/>
</template>
<!-- 树形选择器单选 -->
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.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]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
/>
</template>
<!-- 输入框 -->
<template
v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
<a-spin :spinning="loading">
<!-- 一般检索和高级检索的tab切换 -->
<div class="tab-wrapper">
<span class="tab-title" @click="clickGeneralSearch">一般检索</span>
<span class="tab-title tab-title-curr">高级检索</span>
<a @click="handleToggleChange">{{ toggleSearchStatus ? '收起条件' : '展开条件' }}</a>
</div>
<a-divider>检索类别</a-divider>
<div class="filter-area-div" ref="filterArea">
<a-row :gutter="24" class="filter-row">
<a-col :md="2" class="label-col"><span class="search_label">标准类型</span></a-col>
<a-col :md="18" class="option-col">
<div v-for="item in standardTypeOptions" :key="item.value" class="option-div" :class="currStandardType === item.value ? 'option-curr' : ''" @click="standardTypeChange(item.value)">
{{ item.label }}
</div>
</a-col>
</a-row>
</div>
<a-form v-if="toggleSearchStatus" layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="(24 / (minLength + 1))"
:sm="(24 / minLength)"
v-for="(item) in searchList"
:key="item.id"
style="line-height: 48px">
<!-- 树形选择器 -->
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol" :colon="false">
<template v-if="item.fieldShowType === FieldType.TREE.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]"
tree-checkable
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
/>
</template>
<!-- 树形选择器单选 -->
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.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]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
/>
</template>
<!-- 输入框 -->
<template
v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
FieldType.STANDARD_MORE.value,FieldType.TREE_MODAL_SELECT.value]
.includes(item.fieldShowType)">
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
v-model="queryParam[item.dbFieldName]"></a-input>
</template>
<!-- 日期区间 -->
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
<a-range-picker v-model="queryParam[item.dbFieldName]"
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="onChange(item.dbFieldName)"></a-range-picker>
</template>
<!-- 字典单选框 -->
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
<j-dict-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dictField" />
</template>
<!-- 字典多选框 -->
<template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
<j-multi-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'" :maxTagCount="1"
:triggerChange="false" :dictCode="item.dictField"/>
</template>
<!-- 组织机构选择 -->
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam[item.dbFieldName]"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
/>
</template>
<!-- 组织机构多选 -->
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam[item.dbFieldName]"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
treeCheckable
treeCheckStrictly
/>
</template>
<!-- 年份选择 -->
<template v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
<j-date show-type="year"
:allowClear="false"
v-model="queryParam[item.dbFieldName]"
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
</template>
</a-form-item>
</a-col>
</a-row>
</a-form>
<div class="table-page-search-submitButtons">
<a-button icon="search" type="primary" @click="searchQuery" :loading="loading">{{ $t('query') }}</a-button>
<a-button icon="reload" type="primary" ghost style="margin-left: 8px" @click="searchReset" :loading="loading">{{ $t('reset') }}</a-button>
</div>
<div class="table-wrapper">
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
v-model="queryParam[item.dbFieldName]"></a-input>
</template>
<!-- 日期区间 -->
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
<a-range-picker v-model="queryParam[item.dbFieldName]"
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="onChange(item.dbFieldName)"></a-range-picker>
</template>
<!-- 字典单选框 -->
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
<j-dict-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dictField" />
</template>
<!-- 字典多选框 -->
<template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
<j-multi-select-tag v-model="queryParam[item.dbFieldName]"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'" :maxTagCount="1"
:triggerChange="false" :dictCode="item.dictField"/>
</template>
<!-- 组织机构选择 -->
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam[item.dbFieldName]"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
/>
</template>
<!-- 组织机构多选 -->
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam[item.dbFieldName]"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
treeCheckable
treeCheckStrictly
/>
</template>
<!-- 年份选择 -->
<template v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
<j-date show-type="year"
:allowClear="false"
v-model="queryParam[item.dbFieldName]"
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
</template>
</a-form-item>
</a-col>
</a-row>
</a-form>
<div class="table-page-search-submitButtons">
<a-button icon="search" type="primary" @click="searchQuery" :loading="loading">{{ $t('query') }}</a-button>
<a-button icon="reload" type="primary" ghost style="margin-left: 8px" @click="searchReset" :loading="loading">{{ $t('reset') }}</a-button>
</div>
<div class="table-wrapper">
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
@change="handleTableChange">
</j-table>
</div>
</j-table>
</div>
</a-spin>
</a-card>
</template>
@@ -297,11 +298,14 @@ export default {
const params = {
module: this.currStandardType
}
this.loading = true
this.getQueryConditionFunc(params).then((res) => {
if (res.success) {
this.searchList = res.result
this.getOptionsData() // 获取下拉数据
}
}).finally(() => {
this.loading = false
})
},
/**
@@ -346,12 +350,6 @@ export default {
return filterObj(param)
},
loadData (arg) {
const flag = Object.values(this.queryParam).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
if (arg === 1) {
this.ipagination.current = 1
}
@@ -387,12 +385,19 @@ export default {
},
// 查询
searchQuery () {
const flag = Object.values(this.queryParam).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
this.loadData(1)
},
// 重置
searchReset () {
this.queryParam = {}
this.loadData(1)
this.dataSource = []
this.ipagination.total = 0
}
}
}
@@ -173,11 +173,11 @@
</a-col>
</template>
<!--其它模块展示-->
<template>
<template v-if="isSearch">
<p class="tag-info">{{ $t('system.tag.displayOtherModules') }}</p>
<a-divider dashed />
<!--搜索中心展示-->
<a-col :span="24">
<a-col :span="24" v-if="isSearch">
<a-form-model-item :label="$t('system.tag.searchCenterDisplay')" prop="isShowSearch">
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn"
:placeholder="$t('system.tag.selectSearchCenterDisplayed')" />