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 | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 151 insertions(+), 27 deletions(-) diff --git a/src/views/IndustrialSoftware.vue b/src/views/IndustrialSoftware.vue index 78a87ae..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" @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" @click="handleCertificateClick(app)"> + <div class="link-btn text-nowrap" v-if="false"> <svg t="1739503834540" class="svg-size-style" @@ -167,7 +191,8 @@ fill="#1989FA" p-id="34746" class="icon-path" - ></path></svg>璇佷功 + ></path></svg + >鎶ュ憡 </div> </div> </div> @@ -192,9 +217,12 @@ </div> </div> - <el-dialog v-model="dialogVisibleCertifcate" title="" align-center fullscreen> + <el-dialog v-model="dialogVisibleCertifcate" title="" :show-close="false" align-center fullscreen> <div class="h-full flex justify-center"> - <img :src="m_curCertificatePath" /> + <div style="position: relative"> + <img :src="m_curCertificatePath" /> + <span @click="dialogVisibleCertifcate = false" class="close-icon-style"> 脳 </span> + </div> </div> <template #footer> <div class="dialog-footer"> @@ -208,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 = [ @@ -219,8 +259,6 @@ { name: '瀹圭Н寮忕┖鍘嬫満', tag: 2 }, { name: '閫氶鏈�', tag: 3 }, { name: '鍐锋按鏈虹粍', tag: 4 }, - { name: '鐢靛姏鍙樺帇鍣�', tag: 5 }, - { name: '宸ヤ笟閿呯倝', tag: 6 }, { name: '鐢垫満', tag: 7 }, ]; const factory = ref([]); @@ -247,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() }, }; // 婧愭暟鎹� @@ -267,6 +305,9 @@ currentPage: 1, pageSize: 12, }); + +// 鎼滅储鐩稿叧 +const searchQuery = ref(''); onMounted(() => { initComanyData(); @@ -301,8 +342,18 @@ .then((res) => { m_PageLoading.value = false; let result = res.data; + let arr = []; - result.forEach((item: any) => { + result.forEach((item: any, index: number) => { + if (typeSelect.value === 2) { + item.Price = item.Price * 10; + } + if (typeSelect.value === 4) { + item.Price = item.Price * 5; + } + let incrementFactor = 0.1 * (index + 1); // 鏍规嵁绱㈠紩璁$畻閫掑绯绘暟 + let newPrice = parseFloat(item.Price) + parseFloat((item.Price * incrementFactor).toFixed(1)); // 璁$畻鏂扮殑Price鍊� + let node = { Id: item.Id, Type: item.Type, @@ -312,13 +363,14 @@ RecordNumber: item.RecordNumber, EnergyEfficiencyClass: item.EnergyEfficiencyClass, RecordTime: item.RecordTime, - Price: item.Price, + Price: newPrice, PhysicalPicturePath: 'static/EecProductData/' + item.PhysicalPicturePath, CertificatePath: `static/EecProductData/${item.CertificatePath}`, Tip: `澶囨鏃堕棿锛�${item.RecordTime} \n 澶囨鍙凤細${item.RecordNumber}`, }; arr.push(node); }); + allEecProduct.value = arr; filterProduct(); }) @@ -327,20 +379,59 @@ }); }; 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'); + const bContainsDSWQ = b.Model.includes('DSWQ'); + const aContainsDRLOrDP = a.Model.substring(0, 3).includes('DRL') || a.Model.substring(0, 2).includes('DP'); + const bContainsDRLOrDP = b.Model.substring(0, 3).includes('DRL') || b.Model.substring(0, 2).includes('DP'); + + if (aContainsDSWQ && !bContainsDSWQ) { + return -1; + } else if (!aContainsDSWQ && bContainsDSWQ) { + return 1; + } else if (aContainsDRLOrDP && !bContainsDRLOrDP) { + return -1; + } else if (!aContainsDRLOrDP && bContainsDRLOrDP) { + return 1; + } else { + return 0; + } + }); + } + dispEecProduct.value = getSelectPageData(filterProductData.value); }; const handleCurrentChange = (val: number) => { @@ -377,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; @@ -390,6 +489,10 @@ }; const handleEecLevel = (tag: number) => { EecSelect.value = tag; + filterProduct(); +}; + +const handleSearch = () => { filterProduct(); }; </script> @@ -468,7 +571,7 @@ .goods-name { position: relative; width: 100%; - height: 42px; + height: auto; line-height: 150%; margin-top: 5px; color: #333; @@ -504,6 +607,7 @@ margin-top: 3px; box-sizing: border-box; padding: 0 25px; + justify-content: center; align-items: center; gap: 15px; } @@ -513,7 +617,7 @@ color: #fff; cursor: pointer; - .icon-path{ + .icon-path { fill: #fff; } } @@ -642,6 +746,26 @@ width: 16px; height: 16px; } + +.close-icon-style { + position: absolute; + right: -15px; + top: -15px; + font-size: 30px; + background-color: #196dd938; + width: 30px; + height: 30px; + border-radius: 50%; + display: inline-flex; + justify-content: center; + align-items: center; + cursor: pointer; + color: #196dd9; + &:hover { + color: #fff; + background-color: #196dd9; + } +} :deep(.el-button--default) { --el-button-bg-color: transparent; --el-button-border-color: transparent; -- Gitblit v1.9.3