[update] 联调一般检索
This commit is contained in:
+1
-10
@@ -1,4 +1,4 @@
|
|||||||
import { getAction, postAction } from './manage'
|
import { getAction } from './manage'
|
||||||
// 获取检索历史数据
|
// 获取检索历史数据
|
||||||
const getSearchHistoryData = (params) => getAction('/home/lawsHomeNormalSearchHistory/page', params)
|
const getSearchHistoryData = (params) => getAction('/home/lawsHomeNormalSearchHistory/page', params)
|
||||||
// 一般检索(标题)——资源类型改变获取下面筛选项统计数据
|
// 一般检索(标题)——资源类型改变获取下面筛选项统计数据
|
||||||
@@ -9,12 +9,6 @@ const generalSearchTitleSearch = (params) => getAction('/home/lawsHomeSearch/get
|
|||||||
const getSearchParamNumFullText = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllCount', params)
|
const getSearchParamNumFullText = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllCount', params)
|
||||||
// 一般检索(全文)—— 查询
|
// 一般检索(全文)—— 查询
|
||||||
const generalSearchFullTextSearch = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllPage', params)
|
const generalSearchFullTextSearch = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllPage', params)
|
||||||
// 一般检索-国内标准获取展示字段
|
|
||||||
const getDomesticStandardField = (params) => getAction('/laws/standard/domestic/getFormModel', params)
|
|
||||||
// 一般检索-国外标准获取展示字段
|
|
||||||
const getOverseasStandardField = (params) => getAction('/laws/standard/overseas/getFormModel', params)
|
|
||||||
// 一般检索-企标获取展示字段
|
|
||||||
const getEnterpriseStandardField = (params) => getAction('/laws/standard/enterprise/getFormModel', params)
|
|
||||||
|
|
||||||
// 国内标准的高级搜索,查询搜索条件
|
// 国内标准的高级搜索,查询搜索条件
|
||||||
const getDomesticStandardQuery = (params) => getAction('/laws/standard/domestic/getQueryCondition', params)
|
const getDomesticStandardQuery = (params) => getAction('/laws/standard/domestic/getQueryCondition', params)
|
||||||
@@ -36,9 +30,6 @@ export {
|
|||||||
generalSearchTitleSearch,
|
generalSearchTitleSearch,
|
||||||
getSearchParamNumFullText,
|
getSearchParamNumFullText,
|
||||||
generalSearchFullTextSearch,
|
generalSearchFullTextSearch,
|
||||||
getDomesticStandardField,
|
|
||||||
getOverseasStandardField,
|
|
||||||
getEnterpriseStandardField,
|
|
||||||
getDomesticStandardQuery,
|
getDomesticStandardQuery,
|
||||||
getOverseasStandardQuery,
|
getOverseasStandardQuery,
|
||||||
getEnterStandardQuery,
|
getEnterStandardQuery,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<!-- 一般检索和高级检索的tab切换 -->
|
<!-- 一般检索和高级检索的tab切换 -->
|
||||||
<div class="tab-wrapper">
|
<div class="tab-wrapper">
|
||||||
<span class="tab-title">一般检索</span>
|
<span class="tab-title" @click="clickGeneralSearch">一般检索</span>
|
||||||
<span class="tab-title tab-title-curr">高级检索</span>
|
<span class="tab-title tab-title-curr">高级检索</span>
|
||||||
<a @click="handleToggleChange">{{ toggleSearchStatus ? '收起条件' : '展开条件' }}</a>
|
<a @click="handleToggleChange">{{ toggleSearchStatus ? '收起条件' : '展开条件' }}</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
:key="item.id"
|
:key="item.id"
|
||||||
style="line-height: 48px">
|
style="line-height: 48px">
|
||||||
<!-- 树形选择器 -->
|
<!-- 树形选择器 -->
|
||||||
<template v-if="item.fieldShowType === FieldType.TREE.value">
|
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol" :colon="false">
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<template v-if="item.fieldShowType === FieldType.TREE.value">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
tree-node-filter-prop="title"
|
tree-node-filter-prop="title"
|
||||||
v-model="queryParam[item.dbFieldName]"
|
v-model="queryParam[item.dbFieldName]"
|
||||||
@@ -36,11 +36,9 @@
|
|||||||
tree-checkable
|
tree-checkable
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 树形选择器(单选) -->
|
||||||
<!-- 树形选择器(单选) -->
|
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.value">
|
||||||
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
tree-node-filter-prop="title"
|
tree-node-filter-prop="title"
|
||||||
v-model="queryParam[item.dbFieldName]"
|
v-model="queryParam[item.dbFieldName]"
|
||||||
@@ -49,55 +47,38 @@
|
|||||||
:tree-data="optionsData[item.dbFieldName]"
|
:tree-data="optionsData[item.dbFieldName]"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 输入框 -->
|
||||||
<!-- 输入框 -->
|
<template
|
||||||
<template
|
v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
|
||||||
v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
|
|
||||||
FieldType.STANDARD_MORE.value,FieldType.TREE_MODAL_SELECT.value]
|
FieldType.STANDARD_MORE.value,FieldType.TREE_MODAL_SELECT.value]
|
||||||
.includes(item.fieldShowType)">
|
.includes(item.fieldShowType)">
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
|
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
|
||||||
v-model="queryParam[item.dbFieldName]"></a-input>
|
v-model="queryParam[item.dbFieldName]"></a-input>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 日期区间 -->
|
||||||
<!-- 数字输入框 -->
|
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
|
||||||
<!-- <template v-else-if="item.fieldShowType === FieldType.TEXT_NUMBER.value">-->
|
|
||||||
<!-- <a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
|
|
||||||
<!-- <a-input-number :placeholder="$t('pleaseEnter')+item.dbFieldTxt"-->
|
|
||||||
<!-- v-model="queryParam[item.dbFieldName]" :min="1" :max="99999999"/>-->
|
|
||||||
<!-- </a-form-item>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- 日期区间 -->
|
|
||||||
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<a-range-picker v-model="queryParam[item.dbFieldName]"
|
<a-range-picker v-model="queryParam[item.dbFieldName]"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||||
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||||
@change="onChange(item.dbFieldName)"></a-range-picker>
|
@change="onChange(item.dbFieldName)"></a-range-picker>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 字典单选框 -->
|
||||||
<!-- 字典单选框 -->
|
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
|
||||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<j-dict-select-tag v-model="queryParam[item.dbFieldName]"
|
<j-dict-select-tag v-model="queryParam[item.dbFieldName]"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||||
:type="'select'"
|
:type="'select'"
|
||||||
:triggerChange="false" :dictCode="item.dictField" />
|
:triggerChange="false" :dictCode="item.dictField" />
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 字典多选框 -->
|
||||||
<!-- 字典多选框 -->
|
<template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
|
||||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<j-multi-select-tag v-model="queryParam[item.dbFieldName]"
|
<j-multi-select-tag v-model="queryParam[item.dbFieldName]"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||||
:type="'select'" :maxTagCount="1"
|
:type="'select'" :maxTagCount="1"
|
||||||
:triggerChange="false" :dictCode="item.dictField"/>
|
:triggerChange="false" :dictCode="item.dictField"/>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 组织机构选择 -->
|
||||||
<!-- 组织机构选择 -->
|
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
|
||||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
tree-node-filter-prop="title"
|
tree-node-filter-prop="title"
|
||||||
v-model="queryParam[item.dbFieldName]"
|
v-model="queryParam[item.dbFieldName]"
|
||||||
@@ -109,11 +90,9 @@
|
|||||||
:tree-data="categoryTreeList"
|
:tree-data="categoryTreeList"
|
||||||
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
|
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 组织机构多选 -->
|
||||||
<!-- 组织机构多选 -->
|
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
|
||||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
tree-node-filter-prop="title"
|
tree-node-filter-prop="title"
|
||||||
v-model="queryParam[item.dbFieldName]"
|
v-model="queryParam[item.dbFieldName]"
|
||||||
@@ -127,26 +106,23 @@
|
|||||||
treeCheckable
|
treeCheckable
|
||||||
treeCheckStrictly
|
treeCheckStrictly
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
<!-- 年份选择 -->
|
||||||
<!-- 年份选择 -->
|
<template v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
|
||||||
<template
|
|
||||||
v-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
|
|
||||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<j-date show-type="year"
|
<j-date show-type="year"
|
||||||
:allowClear="false"
|
:allowClear="false"
|
||||||
v-model="queryParam[item.dbFieldName]"
|
v-model="queryParam[item.dbFieldName]"
|
||||||
date-format="YYYY"
|
date-format="YYYY"
|
||||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
|
||||||
</a-form-item>
|
</template>
|
||||||
</template>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<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>
|
|
||||||
</a-form>
|
</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>
|
<div>
|
||||||
<j-table
|
<j-table
|
||||||
:can-drag="true"
|
:can-drag="true"
|
||||||
@@ -243,6 +219,12 @@ export default {
|
|||||||
this.getSysCategoryTree()
|
this.getSysCategoryTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 点击一般检索
|
||||||
|
clickGeneralSearch () {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/generalSearch'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 标准类型改变
|
// 标准类型改变
|
||||||
standardTypeChange (value) {
|
standardTypeChange (value) {
|
||||||
this.currStandardType = value
|
this.currStandardType = value
|
||||||
@@ -447,5 +429,6 @@ export default {
|
|||||||
|
|
||||||
.table-page-search-submitButtons {
|
.table-page-search-submitButtons {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,96 +1,102 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" :loading="loading">
|
<div>
|
||||||
<!-- 搜索框部分 -->
|
<a-card :bordered="false" :loading="loading">
|
||||||
<div class="top-search-div">
|
<!-- 搜索框部分 -->
|
||||||
<div class="top-search-div-content">
|
<div class="top-search-div">
|
||||||
<a-input-search class="input-search"
|
<div class="top-search-div-content">
|
||||||
:placeholder="$t('pleaseEnter')+$t('dashboard.generalSearch.queryCondition')"
|
<a-input-search class="input-search"
|
||||||
v-model="searchValue"
|
:placeholder="$t('pleaseEnter')+$t('dashboard.generalSearch.queryCondition')"
|
||||||
@search="onSearch">
|
v-model="searchValue"
|
||||||
<a-button type="primary" slot="enterButton">
|
@search="onSearch">
|
||||||
<i class="iconfont icon-Searchbar_Search_icon"></i>
|
<a-button type="primary" slot="enterButton">
|
||||||
</a-button>
|
<i class="iconfont icon-Searchbar_Search_icon"></i>
|
||||||
</a-input-search>
|
</a-button>
|
||||||
<a class="search-link" @click="clickAdvancedSearch">{{ $t('dashboard.generalSearch.advancedSearch') }}</a>
|
</a-input-search>
|
||||||
<a class="search-link">{{ $t('dashboard.generalSearch.homePage') }}</a>
|
<a class="search-link" @click="clickAdvancedSearch">{{ $t('dashboard.generalSearch.advancedSearch') }}</a>
|
||||||
<a class="search-link" @click="clickSearchHistory">{{ $t('dashboard.generalSearch.searchHistory') }}</a>
|
<a class="search-link" @click="clickHomePage">{{ $t('dashboard.generalSearch.homePage') }}</a>
|
||||||
</div>
|
<a class="search-link" @click="clickSearchHistory">{{ $t('dashboard.generalSearch.searchHistory') }}</a>
|
||||||
</div>
|
|
||||||
<!-- 筛选区域 -->
|
|
||||||
<div class="filter-area-div" ref="filterArea">
|
|
||||||
<!-- 检索方式 -->
|
|
||||||
<a-row :gutter="24" class="filter-row">
|
|
||||||
<a-col :md="6" class="label-col"><span class="search_label">{{ $t('dashboard.generalSearch.retrievalMode') }}</span></a-col>
|
|
||||||
<a-col :md="18" class="option-col">
|
|
||||||
<div v-for="item in retrievalModeOptions" :key="item.key" class="option-div" :class="retrievalModeCurrent === item.key ? 'option-curr' : ''" @click="retrievalModeChange(item.key)">
|
|
||||||
{{ item.label }}
|
|
||||||
</div>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<!-- 资源类型 -->
|
|
||||||
<a-row :gutter="24" class="filter-row">
|
|
||||||
<a-col :md="6" class="label-col"><span class="search_label">{{ $t('dashboard.generalSearch.resourceType') }}</span></a-col>
|
|
||||||
<a-col :md="18" class="option-col">
|
|
||||||
<div v-for="item in resourceTypeOptions" :key="item.key" class="option-div" :class="resourceTypeCurrent === item.key ? 'option-curr' : ''" @click="resourceTypeChange(item.key)">
|
|
||||||
{{ item.label }}
|
|
||||||
</div>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<!-- 其他筛选条件 -->
|
|
||||||
<template v-if="toggleSearchStatus">
|
|
||||||
<template v-for="(value, key) in selectOptions">
|
|
||||||
<div :key="key" :gutter="24" class="filter-row">
|
|
||||||
<div class="label-col"><span class="search_label">{{ value.label }}</span></div>
|
|
||||||
<div class="option-col">
|
|
||||||
<div v-for="item in value.options" :key="item.itemValue" class="option-div" :class="value.current === item.itemValue ? 'option-curr' : ''" @click="selectOptionsChange(key, item.itemValue)">
|
|
||||||
<span>{{ item.itemText }}<span v-if="item.statisticsCount || item.statisticsCount === 0">(<span class="option-span-num">{{ item.statisticsCount }}</span>)</span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<div class="toggle-div" @click="handleToggleChange" v-if="selectOptions && Object.keys(selectOptions).length !== 0">
|
|
||||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
|
||||||
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<template v-if="dataSource && dataSource.length > 0">
|
|
||||||
<!-- 查询结果展示区域 -->
|
|
||||||
<div class="result-wrapper">
|
|
||||||
<div class="result-div" v-for="item in dataSource" :key="item.standardNumber">
|
|
||||||
<div class="result-title-wrapper">
|
|
||||||
<!-- 正在搜索,标题根据搜索内容高亮显示 -->
|
|
||||||
<p v-if="isSearch" class="result-title">
|
|
||||||
<span v-if="(item.standard_number + ' ' + item.standard_name).indexOf(searchValue) > -1">
|
|
||||||
{{ (item.standard_number + ' ' + item.standard_name).substr(0, (item.standard_number + ' ' + item.standard_name).indexOf(searchValue)) }}<span class="title-high-light">{{ searchValue }}</span>{{ (item.standard_number + ' ' + item.standard_name).substr((item.standard_number + ' ' + item.standard_name).indexOf(searchValue) + searchValue.length) }}
|
|
||||||
</span>
|
|
||||||
<span v-else>{{ item.standard_number + ' ' + item.standard_name }}</span>
|
|
||||||
</p>
|
|
||||||
<p v-else class="result-title">{{ item.standard_number + ' ' + item.standard_name }}</p>
|
|
||||||
<p class="result-source">{{ item.source }}</p>
|
|
||||||
<p class="result-date">{{ $t('dashboard.generalSearch.releaseDate') }} {{ item.publishDate }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="result-content-wrapper">
|
|
||||||
<span class="result-field-span" v-for="field in formInLine" :key="field.dbFieldName">{{field.dbFieldTxt}}: {{ item[field.dbFieldName] || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-pagination
|
<!-- 筛选区域 -->
|
||||||
v-if="dataSource && dataSource.length > 0"
|
<div class="filter-area-div" ref="filterArea">
|
||||||
class="page-content"
|
<!-- 检索方式 -->
|
||||||
show-quick-jumper
|
<a-row :gutter="24" class="filter-row">
|
||||||
show-size-changer
|
<a-col :md="6" class="label-col"><span class="search_label">{{ $t('dashboard.generalSearch.retrievalMode') }}</span></a-col>
|
||||||
v-model="ipagination.current"
|
<a-col :md="18" class="option-col">
|
||||||
:pageSize="ipagination.pageSize"
|
<div v-for="item in retrievalModeOptions" :key="item.key" class="option-div" :class="retrievalModeCurrent === item.key ? 'option-curr' : ''" @click="retrievalModeChange(item.key)">
|
||||||
:pageSizeOptions="ipagination.pageSizeOptions"
|
{{ item.label }}
|
||||||
:total="ipagination.total"
|
</div>
|
||||||
:showTotal="ipagination.showTotal"
|
</a-col>
|
||||||
/>
|
</a-row>
|
||||||
</template>
|
<!-- 资源类型 -->
|
||||||
<a-empty class="empty-content" v-else />
|
<a-row :gutter="24" class="filter-row">
|
||||||
|
<a-col :md="6" class="label-col"><span class="search_label">{{ $t('dashboard.generalSearch.resourceType') }}</span></a-col>
|
||||||
|
<a-col :md="18" class="option-col">
|
||||||
|
<div v-for="item in resourceTypeOptions" :key="item.key" class="option-div" :class="resourceTypeCurrent === item.key ? 'option-curr' : ''" @click="resourceTypeChange(item.key)">
|
||||||
|
{{ item.label }}
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<!-- 其他筛选条件 -->
|
||||||
|
<template v-if="toggleSearchStatus">
|
||||||
|
<template v-for="(value, key) in selectOptions">
|
||||||
|
<div :key="key" :gutter="24" class="filter-row">
|
||||||
|
<div class="label-col"><span class="search_label">{{ value.label }}</span></div>
|
||||||
|
<div class="option-col">
|
||||||
|
<div v-for="item in value.options" :key="item.itemValue" class="option-div" :class="value.current === item.itemValue ? 'option-curr' : ''" @click="selectOptionsChange(key, item.itemValue)">
|
||||||
|
<span>{{ item.itemText }}<span v-if="item.statisticsCount || item.statisticsCount === 0">(<span class="option-span-num">{{ item.statisticsCount }}</span>)</span></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<div class="toggle-div" @click="handleToggleChange" v-if="selectOptions && Object.keys(selectOptions).length !== 0">
|
||||||
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||||
|
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template v-if="dataSource && dataSource.length > 0">
|
||||||
|
<!-- 查询结果展示区域 -->
|
||||||
|
<div class="result-wrapper">
|
||||||
|
<div class="result-div" v-for="item in dataSource" :key="item.standardNumber">
|
||||||
|
<div class="result-title-wrapper">
|
||||||
|
<!-- 正在搜索,标题根据搜索内容高亮显示 -->
|
||||||
|
<a-tooltip>
|
||||||
|
<template #title>
|
||||||
|
<span v-html="item.title"></span>
|
||||||
|
</template>
|
||||||
|
<p class="result-title" v-html="item.title"></p>
|
||||||
|
</a-tooltip>
|
||||||
|
<div class="result-source-wrapper">
|
||||||
|
<p class="result-source">{{ resourceTypeOptions.find(i => i.key === item.resourceType).label }}</p>
|
||||||
|
</div>
|
||||||
|
<p class="result-date">{{ $t('dashboard.generalSearch.releaseDate') }} {{ item.releaseDate || global.emptyLine }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="result-content-wrapper">
|
||||||
|
{{ item.content }}
|
||||||
|
<!--<span class="result-field-span" v-for="field in formInLine" :key="field.dbFieldName">{{field.dbFieldTxt}}: {{ item[field.dbFieldName] || '--' }}</span>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a-pagination
|
||||||
|
v-if="dataSource && dataSource.length > 0"
|
||||||
|
class="page-content"
|
||||||
|
show-quick-jumper
|
||||||
|
show-size-changer
|
||||||
|
v-model="ipagination.current"
|
||||||
|
:pageSize="ipagination.pageSize"
|
||||||
|
:pageSizeOptions="ipagination.pageSizeOptions"
|
||||||
|
:total="ipagination.total"
|
||||||
|
:showTotal="ipagination.showTotal"
|
||||||
|
@change="pageChange"
|
||||||
|
@showSizeChange="pageSizeChange"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<a-empty class="empty-content" v-else />
|
||||||
|
</a-card>
|
||||||
|
|
||||||
<search-history-modal ref="searchHistoryModal"></search-history-modal>
|
<search-history-modal ref="searchHistoryModal"></search-history-modal>
|
||||||
</a-card>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -99,10 +105,7 @@ import {
|
|||||||
getSearchParamNum,
|
getSearchParamNum,
|
||||||
getSearchParamNumFullText,
|
getSearchParamNumFullText,
|
||||||
generalSearchTitleSearch,
|
generalSearchTitleSearch,
|
||||||
generalSearchFullTextSearch,
|
generalSearchFullTextSearch
|
||||||
getDomesticStandardField,
|
|
||||||
getOverseasStandardField,
|
|
||||||
getEnterpriseStandardField
|
|
||||||
} from '@/api/dashboard'
|
} from '@/api/dashboard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -129,16 +132,7 @@ export default {
|
|||||||
],
|
],
|
||||||
resourceTypeCurrent: 'all', // 资源类型当前选中项
|
resourceTypeCurrent: 'all', // 资源类型当前选中项
|
||||||
selectOptions: {}, // 其他筛选条件
|
selectOptions: {}, // 其他筛选条件
|
||||||
dataSource: [
|
dataSource: [],
|
||||||
// { standard_number: 'GB 7258-12', standard_name: '机动车安全', source: '国内标准法规', publishDate: '2023-08-25' },
|
|
||||||
// { standard_number: 'GB 7258-12', standard_name: '机动车安全', source: '国内标准法规', publishDate: '2023-08-25' },
|
|
||||||
// { standard_number: 'GB 7258-12', standard_name: '机动车安全', source: '国内标准法规', publishDate: '2023-08-25' },
|
|
||||||
// { standard_number: 'GB 7258-12', standard_name: '机动车安全', source: '国内标准法规', publishDate: '2023-08-25' },
|
|
||||||
// { standard_number: 'GB 7258-12', standard_name: '机动车安全', source: '国内标准法规', publishDate: '2023-08-25' }
|
|
||||||
],
|
|
||||||
domesticFormInLine: [], // 国内标准字段值
|
|
||||||
overseasFormInLine: [], // 海外标准字段值
|
|
||||||
enterpriseFormInline: [], // 企标字段值
|
|
||||||
ipagination: {
|
ipagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -149,14 +143,11 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
showQuickJumper: true,
|
showQuickJumper: true,
|
||||||
showSizeChanger: true
|
showSizeChanger: true
|
||||||
},
|
}
|
||||||
isSearch: false // 是否正在展示又搜索内容的搜索结果,是的话,标题搜索内容高亮显示
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.initFilterData()
|
this.initFilterData()
|
||||||
// 获取要展示的字段,看后端返回的查询结果决定查不查
|
|
||||||
this.initFormInline()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取要显示数量的筛选条件的数据
|
// 获取要显示数量的筛选条件的数据
|
||||||
@@ -262,28 +253,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取查询结果中要展示的字段值
|
|
||||||
initFormInline () {
|
|
||||||
const param = { type: 1 }
|
|
||||||
getDomesticStandardField(param).then(res => {
|
|
||||||
if (res.success) {
|
|
||||||
this.domesticFormInLine = res.result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
getOverseasStandardField(param).then(res => {
|
|
||||||
if (res.success) {
|
|
||||||
this.overseasFormInLine = res.result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
getEnterpriseStandardField(param).then(res => {
|
|
||||||
if (res.success) {
|
|
||||||
this.enterpriseFormInline = res.result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 查询时获取参数
|
// 查询时获取参数
|
||||||
getSearchParam () {
|
getSearchParam () {
|
||||||
const param = {}
|
const param = {}
|
||||||
|
// 检索方式
|
||||||
|
param.searchMode = this.retrievalModeCurrent
|
||||||
// 资源类型
|
// 资源类型
|
||||||
param.resourceType = this.resourceTypeCurrent === 'all' ? null : this.resourceTypeCurrent
|
param.resourceType = this.resourceTypeCurrent === 'all' ? null : this.resourceTypeCurrent
|
||||||
// 检索内容
|
// 检索内容
|
||||||
@@ -292,10 +266,16 @@ export default {
|
|||||||
for (const item in this.selectOptions) {
|
for (const item in this.selectOptions) {
|
||||||
param[item] = this.selectOptions[item].current
|
param[item] = this.selectOptions[item].current
|
||||||
}
|
}
|
||||||
|
// 分页
|
||||||
|
param.pageNo = this.ipagination.current
|
||||||
|
param.pageSize = this.ipagination.pageSize
|
||||||
return param
|
return param
|
||||||
},
|
},
|
||||||
// 查询
|
// 查询
|
||||||
onSearch () {
|
onSearch (arg) {
|
||||||
|
if (arg === 1) {
|
||||||
|
this.ipagination.current = 1
|
||||||
|
}
|
||||||
const param = this.getSearchParam()
|
const param = this.getSearchParam()
|
||||||
let func
|
let func
|
||||||
if (this.retrievalModeCurrent === '1') {
|
if (this.retrievalModeCurrent === '1') {
|
||||||
@@ -308,12 +288,11 @@ export default {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
func(param).then(res => {
|
func(param).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.dataSource = res.result
|
this.dataSource = res.result.records
|
||||||
if (this.searchValue) {
|
if (res.result.total) {
|
||||||
// 设置正在搜索,标题设置搜索字高亮
|
this.ipagination.total = res.result.total
|
||||||
this.isSearch = true
|
|
||||||
} else {
|
} else {
|
||||||
this.isSearch = false
|
this.ipagination.total = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
@@ -322,17 +301,30 @@ export default {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 分页改变
|
||||||
|
pageChange (page) {
|
||||||
|
this.ipagination.current = page
|
||||||
|
this.onSearch()
|
||||||
|
},
|
||||||
|
pageSizeChange (current, size) {
|
||||||
|
console.log(current, size)
|
||||||
|
this.ipagination.current = current
|
||||||
|
this.ipagination.pageSize = size
|
||||||
|
this.onSearch()
|
||||||
|
},
|
||||||
// 检索方式改变
|
// 检索方式改变
|
||||||
retrievalModeChange (key) {
|
retrievalModeChange (key) {
|
||||||
this.retrievalModeCurrent = key
|
this.retrievalModeCurrent = key
|
||||||
// 更新其他筛选项的数据
|
// 更新其他筛选项的数据
|
||||||
this.initFilterData()
|
this.initFilterData()
|
||||||
|
this.onSearch()
|
||||||
},
|
},
|
||||||
// 资源类型改变
|
// 资源类型改变
|
||||||
resourceTypeChange (key) {
|
resourceTypeChange (key) {
|
||||||
this.resourceTypeCurrent = key
|
this.resourceTypeCurrent = key
|
||||||
// 更新其他筛选项的数据
|
// 更新其他筛选项的数据
|
||||||
this.initFilterData()
|
this.initFilterData()
|
||||||
|
this.onSearch()
|
||||||
},
|
},
|
||||||
// 其他检索条件改变
|
// 其他检索条件改变
|
||||||
selectOptionsChange (changeKey, value) {
|
selectOptionsChange (changeKey, value) {
|
||||||
@@ -349,6 +341,12 @@ export default {
|
|||||||
path: '/advancedSearch'
|
path: '/advancedSearch'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 点击首页按钮
|
||||||
|
clickHomePage () {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/dashboard/analysis'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 点击检索历史
|
// 点击检索历史
|
||||||
clickSearchHistory () {
|
clickSearchHistory () {
|
||||||
this.$refs.searchHistoryModal.open()
|
this.$refs.searchHistoryModal.open()
|
||||||
@@ -456,8 +454,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 标题高亮样式
|
// 标题高亮样式
|
||||||
.title-high-light {
|
.result-title {
|
||||||
color: @primary-color;
|
/deep/ .highlight-Es-class {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单个查询结果
|
// 单个查询结果
|
||||||
@@ -479,8 +479,17 @@ export default {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
max-height: calc(100% - 340px);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.result-source-wrapper {
|
||||||
|
min-width: 100px;
|
||||||
}
|
}
|
||||||
.result-source {
|
.result-source {
|
||||||
|
display: inline-block;
|
||||||
|
width: auto;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
background: @primary-color;
|
background: @primary-color;
|
||||||
@@ -492,13 +501,15 @@ export default {
|
|||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
.result-date {
|
.result-date {
|
||||||
|
min-width: 200px !important;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #86909C;
|
color: #86909C;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
flex: auto;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
white-space: nowrap;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.result-content-wrapper {
|
.result-content-wrapper {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getSearchHistoryData } from '../../../../api/dashboard'
|
import { getSearchHistoryData } from '@/api/dashboard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SearchHistoryModal',
|
name: 'SearchHistoryModal',
|
||||||
@@ -41,11 +41,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
this.initData()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
open () {
|
open () {
|
||||||
|
this.initData()
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
|
|||||||
Reference in New Issue
Block a user