From 253b9f511a074aa86b22b75b2f51e84933d9f84d Mon Sep 17 00:00:00 2001 From: guoyue Date: Mon, 19 Sep 2022 19:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E9=9B=86=E5=B8=82-=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=8D=E5=8A=A1=EF=BC=9A=E6=99=BA=E8=83=BD=E7=AE=97?= =?UTF-8?q?=E6=B3=95=E6=94=AF=E6=8C=81=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/public/static/config/location.js | 6 +- front/src/views/home/DetailsPageconetent.vue | 170 +++++++++++-------- 2 files changed, 101 insertions(+), 75 deletions(-) diff --git a/front/public/static/config/location.js b/front/public/static/config/location.js index 1fc10673..c5ec6ba9 100644 --- a/front/public/static/config/location.js +++ b/front/public/static/config/location.js @@ -26,6 +26,10 @@ const footerDataList = {} // qingdao if (newLocation !== 'baotou' && newLocation !== 'xihaian') { whoShow.itShowQingDao = true + if (newLocation == 'zhanTingDev' || newLocation == 'dev') { + whoShow.itShowZhanTingDev = true + } + infrastructure.deptName = '青岛市大数据发展管理局' infrastructure.deptId = '1067246875800000066' navListManagement.navList = [ @@ -527,4 +531,4 @@ else if (newLocation === 'xihaian') { }, ], } -} +} \ No newline at end of file diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue index f1d89e99..1d49c640 100644 --- a/front/src/views/home/DetailsPageconetent.vue +++ b/front/src/views/home/DetailsPageconetent.vue @@ -450,17 +450,6 @@ import { } from './constantData/showData.js' export default defineComponent({ - beforeRouteEnter(to, from, next) { - console.log('to---DetailsPageconetent--beforeRouteEnter------->', to) - console.log('from---DetailsPageconetent--beforeRouteEnter------->', from) - console.log('next---DetailsPageconetent--beforeRouteEnter------->', next) - // 返回按钮,刷新页面,所以from.name为undefined - // if (from.name || from.name !== 'details') { - // console.log('清空------------>') - // localStorage.removeItem('DetailsPageconetent') - // } - next() - }, beforeRouteLeave(to, from, next) { console.log('to---DetailsPageconetent--beforeRouteLeave------->', to) console.log('from---DetailsPageconetent--beforeRouteLeave------->', from) @@ -473,7 +462,7 @@ export default defineComponent({ setup() { //会议室传的标识6 const flag = ref('') - + let componentTypeArray = ['组件类型', '应用领域'] const handleAdd = (value) => { flag.value = value } @@ -642,19 +631,41 @@ 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) + ) + } + } + ListContent.records.forEach((val) => { + + if (!val) { + return; + } if (val.name === name) { paramsGetResources.infoList = paramsGetResources.infoList.filter( (item) => item.attrType !== name ) - if (val.selectedTags.indexOf(tag.dict_label) == -1) { + if (val.selectedTags && val.selectedTags.indexOf(tag.dict_label) == -1) { val.selectedTags = [tag.dict_label] paramsGetResources.infoList.push({ attrType: name, attrValue: tag.dict_label, }) } else { - val.selectedTags.splice(val.selectedTags.indexOf(tag.dict_label), 1) + 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 = [] + } } } }) @@ -670,13 +681,12 @@ export default defineComponent({ } selectDicStoreAll(params).then((res) => { console.log('selectDicStoreAll============>', res) - const { data } = res.data - ListContent.records = [] - ListContent.records = data + const { data } = res.data; + let dataCopy = data tecHnosphere = router.currentRoute.value.query.tecHnosphere appLiCation = router.currentRoute.value.query.appLiCation mybus.emit('getDeptList') - ListContent.records.forEach((val) => { + dataCopy.forEach((val) => { val.selectedTags = [] if (val.name == '应用领域' && appLiCation) { val.selectedTags[0] = [] @@ -720,16 +730,27 @@ export default defineComponent({ val.shrinkFlag = true } - // todo--赋值 if (storageSearchInfo) { - // name let obj = (storageSearchInfo.infoList || []).find( (x) => x.attrType === val.name - ) || {} - val.selectedTags = obj.attrValue || [] + ); + if (obj) { + val.selectedTags = [obj.attrValue] || [] + } } }) + ListContentCopy.value = [] + ListContentCopy.value = JSON.parse(JSON.stringify(dataCopy)); + ListContent.records = [] + ListContent.records = JSON.parse(JSON.stringify(dataCopy)); + + // 智能算法-特殊处理 + if (!storageSearchInfo) { + let _tag_list = dataCopy.filter(v => componentTypeArray.includes(v.name)) + ListContent.records = _tag_list + } + listKey.value++ listKey2.value++ }) @@ -739,6 +760,7 @@ export default defineComponent({ let ListContent = reactive({ records: [], }) + let ListContentCopy = ref([]) const resourceList = reactive({ data: [] }) const videoList = reactive({ data: [] }) const resourceTotal = ref('') @@ -870,32 +892,18 @@ export default defineComponent({ pageSize: paramsGetResources.pageSize, //分页大小 } getDataResource(dataResourceParams).then((res) => { + loading.value = false + console.log('res.data.data----874-------->', res.data.data); if (whoShow1.value.itShowQingDao) { - res.data.data.data.forEach((val) => { - val.id = val.guid // id - val.name = val.zyname // 名字 - val.sjlCount = val.sjcczl // 数据量 - val.applyCount = val.syqk // 申请量 - val.deptName = val.TGBM // 部门 - val.createDate = val.fbrq // 发布时间 - val.description = val.xgxt // 描述 - }) - resourceList.data = res.data.data.data || [] - resourceTotal.value = res.data.data.rows || '' - loading.value = false + if (whoShow1.value.itShowZhanTingDev) { + // 注意:!!!!!itShowZhanTingDev: 研发环境除数据资源用西海岸,其他配置跟青岛市局一样 + console.log('999----->', res.data.data.list) + getXiHaiAn(res) + } else { + getQingDao(res) + } } else if (whoShow1.value.itShowXiHaiAn) { - res.data.data.list.forEach((val) => { - val.id = val.serviceId // id - val.name = val.serviceName // 名字 - val.sjlCount = val.requestQuantity // 数据量 - val.applyCount = val.requestCount // 申请量 - val.deptName = val.departmentName // 部门 - val.createTime = val.createTime.split('.')[0] - val.createDate = val.createTime // 发布时间 - }) - resourceList.data = res.data.data.list || [] - resourceTotal.value = res.data.data.total || '' - loading.value = false + getXiHaiAn(res) } }) } else if ( @@ -958,31 +966,16 @@ export default defineComponent({ pageSize: paramsGetResources.pageSize, //分页大小 } getDataResource(dataResourceParams).then((res) => { + loading.value = false + console.log('res.data.data----982-------->', res.data.data); if (whoShow1.value.itShowQingDao) { - (res.data && res.data.data && res.data.data.data || []).forEach((val) => { - val.id = val.guid // id - val.name = val.zyname // 名字 - val.sjlCount = val.sjcczl // 数据量 - val.applyCount = val.syqk // 申请量 - val.deptName = val.TGBM // 部门 - val.createDate = val.fbrq // 发布时间 - val.description = val.xgxt // 描述 - }) - resourceList.data = res.data.data.data || [] - resourceTotal.value = res.data.data.rows || '' - loading.value = false + if (whoShow1.value.itShowZhanTingDev) { + getXiHaiAn(res) + } else { + getQingDao(res) + } } else if (whoShow1.value.itShowXiHaiAn) { - (res.data && res.data.data && res.data.data.list || []).forEach((val) => { - val.id = val.serviceId // id - val.name = val.serviceName // 名字 - val.sjlCount = val.requestQuantity // 数据量 - val.applyCount = val.requestCount // 申请量 - val.deptName = val.departmentName // 部门 - val.createTime = val.createTime.split('.')[0] - val.createDate = val.createTime // 发布时间 - }) - resourceList.data = res.data.data.list || [] - resourceTotal.value = res.data.data.total || '' + getXiHaiAn(res) loading.value = false } }) @@ -1020,6 +1013,35 @@ export default defineComponent({ } } + // 青岛-数据处理 + const getQingDao = (res) => { + (res.data && res.data.data && res.data.data.data || []).forEach((val) => { + val.id = val.guid // id + val.name = val.zyname // 名字 + val.sjlCount = val.sjcczl // 数据量 + val.applyCount = val.syqk // 申请量 + val.deptName = val.TGBM // 部门 + val.createDate = val.fbrq // 发布时间 + val.description = val.xgxt // 描述 + }) + resourceList.data = res.data.data.data || [] + resourceTotal.value = res.data.data.rows || '' + } + // 青岛-西海岸处理 + const getXiHaiAn = (res) => { + (res.data && res.data.data && res.data.data.list || []).forEach((val) => { + val.id = val.serviceId // id + val.name = val.serviceName // 名字 + val.sjlCount = val.requestQuantity // 数据量 + val.applyCount = val.requestCount // 申请量 + val.deptName = val.departmentName // 部门 + val.createTime = val.createTime.split('.')[0] + val.createDate = val.createTime // 发布时间 + }) + resourceList.data = res.data.data.list || [] + resourceTotal.value = res.data.data.total || '' + } + let shoppingCartList = ref([]) // 获取申购车列表 const getShoppingCartList = (list) => { @@ -1274,7 +1296,6 @@ export default defineComponent({ saveSearchCodition, searchResultListDom, handleSetSearchData, // todo - // refreshList, } }, components: { @@ -1645,7 +1666,7 @@ export default defineComponent({ margin-top: 0.05rem; .ant-tag-checkable { - width: 0.83rem; + width: 1rem; height: 0.25rem; display: flex; justify-content: center; @@ -1670,7 +1691,8 @@ export default defineComponent({ .ant-tag-checkable:active, .ant-tag-checkable-checked { - width: 0.85rem; + // width: 0.85rem; + width: 1rem; font-family: 'Alibaba PuHuiTi'; font-weight: 500; background-color: #0087ff; @@ -1855,14 +1877,14 @@ export default defineComponent({ } .leixingsum { - width: 0.93rem; + // width: 1rem; display: inline-block; cursor: pointer; text-align: center; margin-top: 0.05rem; .ant-tag-checkable { - width: 0.85rem; + width: 1rem; height: 0.25rem; display: flex; justify-content: center;