[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)
|
||||
// 一般检索(标题)——资源类型改变获取下面筛选项统计数据
|
||||
@@ -9,12 +9,6 @@ const generalSearchTitleSearch = (params) => getAction('/home/lawsHomeSearch/get
|
||||
const getSearchParamNumFullText = (params) => getAction('/home/lawsHomeSearch/getNormalSearchAllCount', 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)
|
||||
@@ -36,9 +30,6 @@ export {
|
||||
generalSearchTitleSearch,
|
||||
getSearchParamNumFullText,
|
||||
generalSearchFullTextSearch,
|
||||
getDomesticStandardField,
|
||||
getOverseasStandardField,
|
||||
getEnterpriseStandardField,
|
||||
getDomesticStandardQuery,
|
||||
getOverseasStandardQuery,
|
||||
getEnterStandardQuery,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<a-card :bordered="false">
|
||||
<!-- 一般检索和高级检索的tab切换 -->
|
||||
<div class="tab-wrapper">
|
||||
<span class="tab-title">一般检索</span>
|
||||
<span class="tab-title" @click="clickGeneralSearch">一般检索</span>
|
||||
<span class="tab-title tab-title-curr">高级检索</span>
|
||||
<a @click="handleToggleChange">{{ toggleSearchStatus ? '收起条件' : '展开条件' }}</a>
|
||||
</div>
|
||||
@@ -25,8 +25,8 @@
|
||||
:key="item.id"
|
||||
style="line-height: 48px">
|
||||
<!-- 树形选择器 -->
|
||||
<template v-if="item.fieldShowType === FieldType.TREE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<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]"
|
||||
@@ -36,11 +36,9 @@
|
||||
tree-checkable
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 树形选择器(单选) -->
|
||||
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</template>
|
||||
<!-- 树形选择器(单选) -->
|
||||
<template v-if="item.fieldShowType === FieldType.TREE_SINGLE.value">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
@@ -49,55 +47,38 @@
|
||||
:tree-data="optionsData[item.dbFieldName]"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 输入框 -->
|
||||
<template
|
||||
v-if="[FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value,FieldType.USER_SINGLE.value,
|
||||
</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-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
|
||||
v-model="queryParam[item.dbFieldName]"></a-input>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 数字输入框 -->
|
||||
<!-- <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">
|
||||
</template>
|
||||
<!-- 日期区间 -->
|
||||
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
|
||||
<a-range-picker v-model="queryParam[item.dbFieldName]"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="onChange(item.dbFieldName)"></a-range-picker>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 字典单选框 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</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" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 字典多选框 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</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"/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 组织机构选择 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</template>
|
||||
<!-- 组织机构选择 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
@@ -109,11 +90,9 @@
|
||||
:tree-data="categoryTreeList"
|
||||
:placeholder="$t('pleaseSelect') + item.dbFieldTxt"
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 组织机构多选 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</template>
|
||||
<!-- 组织机构多选 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
v-model="queryParam[item.dbFieldName]"
|
||||
@@ -127,26 +106,23 @@
|
||||
treeCheckable
|
||||
treeCheckStrictly
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<!-- 年份选择 -->
|
||||
<template
|
||||
v-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
|
||||
<a-form-item :label="item.dbFieldTxt" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</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" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</template>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</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>
|
||||
<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>
|
||||
<j-table
|
||||
:can-drag="true"
|
||||
@@ -243,6 +219,12 @@ export default {
|
||||
this.getSysCategoryTree()
|
||||
},
|
||||
methods: {
|
||||
// 点击一般检索
|
||||
clickGeneralSearch () {
|
||||
this.$router.push({
|
||||
path: '/generalSearch'
|
||||
})
|
||||
},
|
||||
// 标准类型改变
|
||||
standardTypeChange (value) {
|
||||
this.currStandardType = value
|
||||
@@ -447,5 +429,6 @@ export default {
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,96 +1,102 @@
|
||||
<template>
|
||||
<a-card :bordered="false" :loading="loading">
|
||||
<!-- 搜索框部分 -->
|
||||
<div class="top-search-div">
|
||||
<div class="top-search-div-content">
|
||||
<a-input-search class="input-search"
|
||||
:placeholder="$t('pleaseEnter')+$t('dashboard.generalSearch.queryCondition')"
|
||||
v-model="searchValue"
|
||||
@search="onSearch">
|
||||
<a-button type="primary" slot="enterButton">
|
||||
<i class="iconfont icon-Searchbar_Search_icon"></i>
|
||||
</a-button>
|
||||
</a-input-search>
|
||||
<a class="search-link" @click="clickAdvancedSearch">{{ $t('dashboard.generalSearch.advancedSearch') }}</a>
|
||||
<a class="search-link">{{ $t('dashboard.generalSearch.homePage') }}</a>
|
||||
<a class="search-link" @click="clickSearchHistory">{{ $t('dashboard.generalSearch.searchHistory') }}</a>
|
||||
</div>
|
||||
</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>
|
||||
<a-card :bordered="false" :loading="loading">
|
||||
<!-- 搜索框部分 -->
|
||||
<div class="top-search-div">
|
||||
<div class="top-search-div-content">
|
||||
<a-input-search class="input-search"
|
||||
:placeholder="$t('pleaseEnter')+$t('dashboard.generalSearch.queryCondition')"
|
||||
v-model="searchValue"
|
||||
@search="onSearch">
|
||||
<a-button type="primary" slot="enterButton">
|
||||
<i class="iconfont icon-Searchbar_Search_icon"></i>
|
||||
</a-button>
|
||||
</a-input-search>
|
||||
<a class="search-link" @click="clickAdvancedSearch">{{ $t('dashboard.generalSearch.advancedSearch') }}</a>
|
||||
<a class="search-link" @click="clickHomePage">{{ $t('dashboard.generalSearch.homePage') }}</a>
|
||||
<a class="search-link" @click="clickSearchHistory">{{ $t('dashboard.generalSearch.searchHistory') }}</a>
|
||||
</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"
|
||||
/>
|
||||
</template>
|
||||
<a-empty class="empty-content" v-else />
|
||||
<!-- 筛选区域 -->
|
||||
<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">
|
||||
<!-- 正在搜索,标题根据搜索内容高亮显示 -->
|
||||
<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>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -99,10 +105,7 @@ import {
|
||||
getSearchParamNum,
|
||||
getSearchParamNumFullText,
|
||||
generalSearchTitleSearch,
|
||||
generalSearchFullTextSearch,
|
||||
getDomesticStandardField,
|
||||
getOverseasStandardField,
|
||||
getEnterpriseStandardField
|
||||
generalSearchFullTextSearch
|
||||
} from '@/api/dashboard'
|
||||
|
||||
export default {
|
||||
@@ -129,16 +132,7 @@ export default {
|
||||
],
|
||||
resourceTypeCurrent: 'all', // 资源类型当前选中项
|
||||
selectOptions: {}, // 其他筛选条件
|
||||
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: [], // 企标字段值
|
||||
dataSource: [],
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
@@ -149,14 +143,11 @@ export default {
|
||||
total: 0,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true
|
||||
},
|
||||
isSearch: false // 是否正在展示又搜索内容的搜索结果,是的话,标题搜索内容高亮显示
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initFilterData()
|
||||
// 获取要展示的字段,看后端返回的查询结果决定查不查
|
||||
this.initFormInline()
|
||||
},
|
||||
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 () {
|
||||
const param = {}
|
||||
// 检索方式
|
||||
param.searchMode = this.retrievalModeCurrent
|
||||
// 资源类型
|
||||
param.resourceType = this.resourceTypeCurrent === 'all' ? null : this.resourceTypeCurrent
|
||||
// 检索内容
|
||||
@@ -292,10 +266,16 @@ export default {
|
||||
for (const item in this.selectOptions) {
|
||||
param[item] = this.selectOptions[item].current
|
||||
}
|
||||
// 分页
|
||||
param.pageNo = this.ipagination.current
|
||||
param.pageSize = this.ipagination.pageSize
|
||||
return param
|
||||
},
|
||||
// 查询
|
||||
onSearch () {
|
||||
onSearch (arg) {
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
const param = this.getSearchParam()
|
||||
let func
|
||||
if (this.retrievalModeCurrent === '1') {
|
||||
@@ -308,12 +288,11 @@ export default {
|
||||
this.loading = true
|
||||
func(param).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result
|
||||
if (this.searchValue) {
|
||||
// 设置正在搜索,标题设置搜索字高亮
|
||||
this.isSearch = true
|
||||
this.dataSource = res.result.records
|
||||
if (res.result.total) {
|
||||
this.ipagination.total = res.result.total
|
||||
} else {
|
||||
this.isSearch = false
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
@@ -322,17 +301,30 @@ export default {
|
||||
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) {
|
||||
this.retrievalModeCurrent = key
|
||||
// 更新其他筛选项的数据
|
||||
this.initFilterData()
|
||||
this.onSearch()
|
||||
},
|
||||
// 资源类型改变
|
||||
resourceTypeChange (key) {
|
||||
this.resourceTypeCurrent = key
|
||||
// 更新其他筛选项的数据
|
||||
this.initFilterData()
|
||||
this.onSearch()
|
||||
},
|
||||
// 其他检索条件改变
|
||||
selectOptionsChange (changeKey, value) {
|
||||
@@ -349,6 +341,12 @@ export default {
|
||||
path: '/advancedSearch'
|
||||
})
|
||||
},
|
||||
// 点击首页按钮
|
||||
clickHomePage () {
|
||||
this.$router.push({
|
||||
path: '/dashboard/analysis'
|
||||
})
|
||||
},
|
||||
// 点击检索历史
|
||||
clickSearchHistory () {
|
||||
this.$refs.searchHistoryModal.open()
|
||||
@@ -456,8 +454,10 @@ export default {
|
||||
}
|
||||
|
||||
// 标题高亮样式
|
||||
.title-high-light {
|
||||
color: @primary-color;
|
||||
.result-title {
|
||||
/deep/ .highlight-Es-class {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 单个查询结果
|
||||
@@ -479,8 +479,17 @@ export default {
|
||||
font-weight: 600;
|
||||
line-height: 28px;
|
||||
margin-right: 20px;
|
||||
max-height: calc(100% - 340px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.result-source-wrapper {
|
||||
min-width: 100px;
|
||||
}
|
||||
.result-source {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
background: @primary-color;
|
||||
@@ -492,13 +501,15 @@ export default {
|
||||
padding: 0 8px;
|
||||
}
|
||||
.result-date {
|
||||
min-width: 200px !important;
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #86909C;
|
||||
line-height: 19px;
|
||||
flex: auto;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.result-content-wrapper {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSearchHistoryData } from '../../../../api/dashboard'
|
||||
import { getSearchHistoryData } from '@/api/dashboard'
|
||||
|
||||
export default {
|
||||
name: 'SearchHistoryModal',
|
||||
@@ -41,11 +41,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
open () {
|
||||
this.initData()
|
||||
this.visible = true
|
||||
},
|
||||
// 获取列表数据
|
||||
|
||||
Reference in New Issue
Block a user