From 8c3d15eae99d51193e20ff222dedf96cdba57b33 Mon Sep 17 00:00:00 2001 From: tanghaolin <1723298894@qq.com> Date: 星期二, 15 四月 2025 09:21:43 +0800 Subject: [PATCH] 删除多余照片 --- src/views/IndustrialSoftware.vue | 109 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 90 insertions(+), 19 deletions(-) diff --git a/src/views/IndustrialSoftware.vue b/src/views/IndustrialSoftware.vue index adb95cf..3e3d3da 100644 --- a/src/views/IndustrialSoftware.vue +++ b/src/views/IndustrialSoftware.vue @@ -7,6 +7,25 @@ <div class="w-100 h-100" style="background-color: #fff"> <!-- 椤堕儴鍒嗙被鑿滃崟 --> <div class="rounded-lg shadow" style="background-color: #f6f7f9; margin-bottom: 10px"> + <!-- 鎼滅储妗� --> + <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px"> + + <div class="flex items-center gap-4"> + <span class="text-gray-500" >鏌ヨ锛�</span> + <el-input + v-model="searchQuery" + placeholder="璇疯緭鍏ュ叕鍙稿悕绉�/鍨嬪彿/浜у搧鍚嶇О" + class="!w-[300px]" + clearable + @input="handleSearch" + > + <template #prefix> + <el-icon><Search /></el-icon> + </template> + </el-input> + </div> + </div> + <!-- 绫诲瀷 --> <div class="border-b p-4 border-bottom-dashed-1 box-border" style="padding: 10px"> <div class="flex items-center"> @@ -69,9 +88,12 @@ <div class="flex flex-col h-full" style="cursor: pointer"> <div style="position: relative; display: flex"> <img :src="app.PhysicalPicturePath" :alt="app.Model" class="object-contain mx-auto goods-img" /> - <div class="goods-company">{{ app.CompanyName }}</div> + <!-- <div class="goods-company">{{ app.CompanyName }}</div> --> </div> - <div class="goods-name" :title="app.Model">{{ app.ModelType }}</div> + <div class="goods-name" style="font-size: 14px; font-weight: bold" :title="app.Model">浜у搧鍚嶇О:{{ app.ModelType }}</div> + <!-- 浜у搧 --> + <div class="goods-name" :title="app.Model">鍘傚鍚嶇О锛歿{ app.CompanyName }}</div> + <!-- 鍨嬪彿 --> <div class="metertitle mb-2"> <span>鍨嬪彿锛歿{ app.Model }}</span> </div> @@ -79,12 +101,14 @@ <div class="flex gap-2" style="justify-content: space-between; align-items: center"> <!-- <el-tag size="small" type="success">{{ app.CompanyName }}</el-tag> --> <div class="goods-price"> - <span class="goods-price-selling"> 楼{{ app.Price }}</span> + <span class="goods-price-selling">闈㈣</span> </div> <div class="flex items-center eec-level-div"> <img :src="EecLevelEnum[app.EnergyEfficiencyClass].icon" /> <span class="eec-numb">{{ app.EnergyEfficiencyClass }}</span> - <span class="eec-level-name">{{ EecLevelEnum[app.EnergyEfficiencyClass].name }}</span> + <span class="eec-level-name" @click="handleCertificateClick(app)">{{ + EecLevelEnum[app.EnergyEfficiencyClass].name + }}</span> </div> </div> @@ -93,7 +117,7 @@ <span class="text-gray-400 text-sm">{{ app.date }}</span> </div> --> <div class="flex justify-between gap-4"> - <div class="link-btn text-nowrap" @click="handleBuyClick(app.id)"> + <div class="link-btn text-nowrap" @click="handleBuyClick(app.Id)"> <svg t="1739504206748" class="svg-size-style" @@ -118,9 +142,9 @@ class="icon-path" ></path> </svg> - 璇︾粏 + 绔嬪嵆璐拱 </div> - <div class="link-btn text-nowrap" @click="handleCertificateClick(app)"> + <div class="link-btn text-nowrap" v-if="false"> <svg t="1739503834540" class="svg-size-style" @@ -212,10 +236,22 @@ <script setup lang="ts"> import EecLevel1 from '@/assets/icons/energy_level_1.svg'; import EecLevel2 from '@/assets/icons/energy_level_2.svg'; -import { onMounted, ref } from 'vue'; -import { useRouter } from 'vue-router'; +import { onMounted, ref, computed } from 'vue'; +import { useRouter, useRoute } from 'vue-router'; +import { useLogin } from '@/stores/useLogin'; import axios from 'axios'; +import { ElMessage } from 'element-plus'; +import { Search } from '@element-plus/icons-vue'; + const router = useRouter(); +const route = useRoute(); +const loginStore = useLogin(); + +// 鑾峰彇鐢ㄦ埛淇℃伅 +const userInfo = computed(() => { + const UserInfo = loginStore.getUserInfo(); + return UserInfo ? UserInfo : null; +}); // 鍒嗙被閫夐」 const type = [ @@ -249,13 +285,13 @@ }; const m_RequestDataObj = { - 1: { requestPath: 'static/EecProductData/Pump.json' }, - 2: { requestPath: 'static/EecProductData/AirCompressor.json' }, - 3: { requestPath: 'static/EecProductData/Fan.json' }, - 4: { requestPath: 'static/EecProductData/WaterChiller.json' }, - 5: { requestPath: 'static/EecProductData/PowerTransformer.json' }, - 6: { requestPath: 'static/EecProductData/IndustrialBoiler.json' }, - 7: { requestPath: 'static/EecProductData/ElectricMachinery.json' }, + 1: { requestPath: 'static/EecProductData/Pump.json?v=' + new Date().getTime() }, + 2: { requestPath: 'static/EecProductData/AirCompressor.json?v=' + new Date().getTime() }, + 3: { requestPath: 'static/EecProductData/Fan.json?v=' + new Date().getTime() }, + 4: { requestPath: 'static/EecProductData/WaterChiller.json?v=' + new Date().getTime() }, + 5: { requestPath: 'static/EecProductData/PowerTransformer.json?v=' + new Date().getTime() }, + 6: { requestPath: 'static/EecProductData/IndustrialBoiler.json?v=' + new Date().getTime() }, + 7: { requestPath: 'static/EecProductData/ElectricMachinery.json?v=' + new Date().getTime() }, }; // 婧愭暟鎹� @@ -269,6 +305,9 @@ currentPage: 1, pageSize: 12, }); + +// 鎼滅储鐩稿叧 +const searchQuery = ref(''); onMounted(() => { initComanyData(); @@ -340,20 +379,38 @@ }); }; const filterProduct = () => { + // 鍏堟寜绫诲瀷绛涢�� filterProductData.value = allEecProduct.value.filter((item) => { return item.Type === typeSelect.value; }); + // 鎼滅储绛涢�� + if (searchQuery.value) { + const query = searchQuery.value.toLowerCase(); + filterProductData.value = filterProductData.value.filter((item) => { + return ( + item.CompanyName.toLowerCase().includes(query) || + item.Model.toLowerCase().includes(query) || + item.ModelType.toLowerCase().includes(query) + ); + }); + } + + // 鑳芥晥绛夌骇绛涢�� if (EecSelect.value !== 0) { filterProductData.value = filterProductData.value.filter((item) => { return item.EnergyEfficiencyClass === EecSelect.value; }); } + + // 鍘傚晢绛涢�� if (factorySelect.value !== '-99') { filterProductData.value = filterProductData.value.filter((item) => { return factoryIncludeType.value.includes(item.Type); }); } + + // 娉电被鍨嬬壒娈婃帓搴� if (typeSelect.value === 1) { filterProductData.value.sort((a: any, b: any) => { const aContainsDSWQ = a.Model.includes('DSWQ'); @@ -374,6 +431,7 @@ } }); } + dispEecProduct.value = getSelectPageData(filterProductData.value); }; const handleCurrentChange = (val: number) => { @@ -410,12 +468,20 @@ const handleBuyClick = (productId: string) => { // 鎵惧埌褰撳墠鐐瑰嚮鐨勪骇鍝� - const currentProduct = dispEecProduct.value.find((item) => item.id === productId); + const currentProduct = dispEecProduct.value.find((item) => item.Id === productId); if (currentProduct) { // 淇濆瓨浜у搧淇℃伅鍒發ocalStorage localStorage.setItem('currentProduct', JSON.stringify(currentProduct)); } - router.push(`/product/${currentProduct.Id}`); + if (userInfo.value&& userInfo.value.Token) { + router.push(`/product/${currentProduct.Id}`); + } else { + loginStore.logOut(); + router.replace({ + path: '/login', + query: { redirectPath: route.fullPath }, + }); + } }; const handleCertificateClick = (row: any) => { dialogVisibleCertifcate.value = true; @@ -423,6 +489,10 @@ }; const handleEecLevel = (tag: number) => { EecSelect.value = tag; + filterProduct(); +}; + +const handleSearch = () => { filterProduct(); }; </script> @@ -501,7 +571,7 @@ .goods-name { position: relative; width: 100%; - height: 42px; + height: auto; line-height: 150%; margin-top: 5px; color: #333; @@ -537,6 +607,7 @@ margin-top: 3px; box-sizing: border-box; padding: 0 25px; + justify-content: center; align-items: center; gap: 15px; } -- Gitblit v1.9.3