diff --git a/src/views/dashboard/search/AdvancedSearch.vue b/src/views/dashboard/search/AdvancedSearch.vue index dddfdc0..f935479 100644 --- a/src/views/dashboard/search/AdvancedSearch.vue +++ b/src/views/dashboard/search/AdvancedSearch.vue @@ -159,7 +159,7 @@ :scroll="{x: '100%'}" ref="table" rowKey="id" - :columns="columns" + :columns="showColumns" :dataSource="dataSource" :pagination="ipagination" @change="handleTableChange"> @@ -224,25 +224,20 @@ import { StandardSource, FieldType, EnterpriseStandardStatus, - StandardStatus, DisplayAreaManagement } from '@/enums/commonEnums' import { getAction } from '@/api/manage' import { getFormDictTreeList, queryDepartTreeList, getFileInfo } from '@/api/api' import { getDomesticStandardList, - getOverseasStandardList, getEnterStandardList, getDomesticStandardQuery, - getOverseasStandardQuery, getEnterStandardQuery, getAdvancedSearchAll, getAdvancedSearchClause, exportAdvancedSearch } from '@/api/dashboard' import JTable from '@/components/jero/JTable' import { getDomesticStandardFormModal, - getDomesticStandardDetail, - getOverseasStandardForm, - getOverseasStandardDocumentInfo + getDomesticStandardDetail } from '../../../api/standardRegulationLibraryApi' import { getEnterpriseStandardAddForm, getEnterpriseStandardInfoById } from '../../../api/enterpriseStandardLibraryApi' import Vue from 'vue' @@ -259,7 +254,7 @@ export default { FieldType, loading: false, toggleSearchStatus: true, // 检索条件的展开和收起,false收缩状态 - currStandardType: '1', + currStandardType: '1', // 1外部 3企标 4条款 5全部 standardTypeOptions: [ // 全部 { label: this.$t('dashboard.advancedSearch.all'), value: '5' }, @@ -309,13 +304,17 @@ export default { dataIndex: 'standard_name', scopedSlots: { customRender: 'toDetail' } }, - // { // 发布日期 - // title: this.$t('dashboard.advancedSearch.releaseDate'), - // align: 'center', - // width: 180, - // dataIndex: 'release_date', - // scopedSlots: { customRender: 'text' } - // }, + { // 发布日期 + title: this.$t('dashboard.advancedSearch.releaseDate'), + align: 'center', + width: 180, + dataIndex: 'release_date', + show: () => { + // 全部和企标显示 + return ['5', StandardSource.ENTERPRISE.value].includes(this.currStandardType) + }, + scopedSlots: { customRender: 'text' } + }, { // 实施日期 title: this.$t('dashboard.advancedSearch.materialDate'), align: 'center', @@ -328,6 +327,10 @@ export default { align: 'center', width: 180, dataIndex: 'new_product_impl_date', + show: () => { + // 全部和外部显示 + return ['5', StandardSource.FOREIGN.value].includes(this.currStandardType) + }, scopedSlots: { customRender: 'text' } }, { // 新认证车实施日期 @@ -335,6 +338,10 @@ export default { align: 'center', width: 180, dataIndex: 'new_auth_impl_date', + show: () => { + // 全部和外部显示 + return ['5', StandardSource.FOREIGN.value].includes(this.currStandardType) + }, scopedSlots: { customRender: 'text' } }, { // 标准状态 @@ -495,31 +502,37 @@ export default { defaultEnStandardStatus: `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value}` } }, + computed: { + // 真实显示的表格(全部\企标\外部) + showColumns () { + return this.columns.filter(item => { + if (typeof item.show === 'function') { + return item.show() + } + return true + }) + } + }, watch: { currStandardType: { immediate: true, handler (val) { - if (val === '1') { + if (val === '1') { // 外来标准 this.getQueryConditionFunc = getDomesticStandardQuery this.getDataListFunc = getDomesticStandardList this.getFormFunc = getDomesticStandardFormModal this.getDocumentInfoFunc = getDomesticStandardDetail - } else if (val === '2') { - this.getQueryConditionFunc = getOverseasStandardQuery - this.getDataListFunc = getOverseasStandardList - this.getFormFunc = getOverseasStandardForm - this.getDocumentInfoFunc = getOverseasStandardDocumentInfo - } else if (val === '3') { + } else if (val === '3') { // 企标 this.getQueryConditionFunc = getEnterStandardQuery this.getDataListFunc = getEnterStandardList this.getFormFunc = getEnterpriseStandardAddForm this.getDocumentInfoFunc = getEnterpriseStandardInfoById - } else if (val === '5') { + } else if (val === '5') { // 全部 this.getQueryConditionFunc = getDomesticStandardQuery this.getDataListFunc = getAdvancedSearchAll this.getFormFunc = getEnterpriseStandardAddForm this.getDocumentInfoFunc = getEnterpriseStandardInfoById - } else if (val === '4') { + } else if (val === '4') { // 条款 this.getQueryConditionFunc = getDomesticStandardQuery this.getDataListFunc = getAdvancedSearchClause this.getFormFunc = getEnterpriseStandardAddForm