From 7f884528e9a952b391db4a04625925270d9ad938 Mon Sep 17 00:00:00 2001 From: guoyue Date: Tue, 20 Sep 2022 13:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8-=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=9C=8D=E5=8A=A1-=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/DetailsPageconetent.vue | 85 ++++++------ .../home/components/ComponentServiceTag.vue | 46 +++++++ .../home/components/searchResultList.vue | 121 ++++-------------- 3 files changed, 117 insertions(+), 135 deletions(-) create mode 100644 front/src/views/home/components/ComponentServiceTag.vue diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue index 1d49c640..75b853ec 100644 --- a/front/src/views/home/DetailsPageconetent.vue +++ b/front/src/views/home/DetailsPageconetent.vue @@ -513,31 +513,35 @@ export default defineComponent({ } const searchResultListDom = ref(null) - // 读取本地存储查询条件 - const storageSearchInfo = localStorage.getItem('DetailsPageconetent') && JSON.parse( - localStorage.getItem('DetailsPageconetent') - ) - const handleSetSearchData = () => { - console.log('storageSearchInfo------------>', storageSearchInfo) - // 读取本地存储:表单赋值 - if (storageSearchInfo) { - paramsGetResources = Object.assign({}, paramsGetResources, storageSearchInfo) - // 搜索名称 - searchValue.value = storageSearchInfo.name; - currentPage.value = storageSearchInfo.pageNum; - currentPageSize.value = storageSearchInfo.pageSize; - paramsGetResources.pageNum = storageSearchInfo.pageNum; - paramsGetResources.pageSize = storageSearchInfo.pageSize; - paramsGetResources.deptIds = storageSearchInfo.deptIds; - paramsGetResources.districtId = storageSearchInfo.districtId; - // 延迟使用,因为还没有返回跟挂载 - nextTick(() => { - searchResultListDom.value.changeCondition({ - value: storageSearchInfo.orderField, - orderType: storageSearchInfo.orderType, - }, true) - }) + // 读取本地存储查询条件 + let storageSearchInfo = null + const handleSetSearchData = () => { + if (whoShow1.value.itShowXiHaiAn) { + if (localStorage.getItem('DetailsPageconetent')) { + storageSearchInfo = JSON.parse(localStorage.getItem('DetailsPageconetent')); + } + console.log('storageSearchInfo------------>', storageSearchInfo) + // 读取本地存储:表单赋值 + if (storageSearchInfo) { + paramsGetResources = Object.assign({}, paramsGetResources, storageSearchInfo) + // 搜索名称 + searchValue.value = storageSearchInfo.name; + currentPage.value = storageSearchInfo.pageNum; + currentPageSize.value = storageSearchInfo.pageSize; + paramsGetResources.pageNum = storageSearchInfo.pageNum; + paramsGetResources.pageSize = storageSearchInfo.pageSize; + paramsGetResources.deptIds = storageSearchInfo.deptIds; + paramsGetResources.districtId = storageSearchInfo.districtId; + + // 延迟使用,因为还没有返回跟挂载 + nextTick(() => { + searchResultListDom.value.changeCondition({ + value: storageSearchInfo.orderField, + orderType: storageSearchInfo.orderType, + }, true) + }) + } } } @@ -631,20 +635,22 @@ export default defineComponent({ paramsGetResources.pageNum = 1 currentPage.value = 1 console.log('点击筛选条件=================>', tag, checked, name) - // 智能算法 特殊处理 - if (tag.dict_label == '智能算法' && checked) { - ListContent.records.splice(2, 1, ListContentCopy.value[2]) - } else { - if (name == '组件类型') { - ListContent.records.splice(2, 1) - paramsGetResources.infoList = paramsGetResources.infoList.filter( - (item) => componentTypeArray.includes(item.attrType) - ) + + // 西海岸-智能算法 特殊处理 + if (whoShow1.value.itShowXiHaiAn) { + if (tag.dict_label == '智能算法' && checked) { + ListContent.records.splice(2, 1, ListContentCopy.value[2]) + } else { + if (name == '组件类型') { + ListContent.records.splice(2, 1) + paramsGetResources.infoList = paramsGetResources.infoList.filter( + (item) => componentTypeArray.includes(item.attrType) + ) + } } } ListContent.records.forEach((val) => { - if (!val) { return; } @@ -661,10 +667,13 @@ export default defineComponent({ } else { val.selectedTags && val.selectedTags.splice(val.selectedTags.indexOf(tag.dict_label), 1) } - // - if ((val.selectedTags.length == 0 && tag.dict_label == '智能算法' && !checked) || (tag.dict_label !== '智能算法' && name == '组件类型')) { - if (ListContentCopy.value[2]) { - ListContentCopy.value[2].selectedTags = [] + + // 西海岸-智能算法 特殊处理 + if (whoShow1.value.itShowXiHaiAn) { + if ((val.selectedTags.length == 0 && tag.dict_label == '智能算法' && !checked) || (tag.dict_label !== '智能算法' && name == '组件类型')) { + if (ListContentCopy.value[2]) { + ListContentCopy.value[2].selectedTags = [] + } } } } diff --git a/front/src/views/home/components/ComponentServiceTag.vue b/front/src/views/home/components/ComponentServiceTag.vue new file mode 100644 index 00000000..029b6035 --- /dev/null +++ b/front/src/views/home/components/ComponentServiceTag.vue @@ -0,0 +1,46 @@ + + + + \ No newline at end of file diff --git a/front/src/views/home/components/searchResultList.vue b/front/src/views/home/components/searchResultList.vue index 0fd2870a..b6c5ed53 100644 --- a/front/src/views/home/components/searchResultList.vue +++ b/front/src/views/home/components/searchResultList.vue @@ -19,10 +19,6 @@ selectCardsname !== '数据资源' "> {{ item.name }} - - - - -
@@ -95,6 +90,8 @@
{{ item.name }} + +
- +