weixin_52219567 1 hete
szülő
commit
0df6e3d3fd

+ 1 - 1
src/layout/components/search.vue

@@ -15,7 +15,7 @@
       <div class="search-box">
         <div class="search-div flex-row-start">
           <div class="search-input flex-row-center">
-            <el-input class="el-input" v-model="input" placeholder="搜索商品、品牌、分类..." />
+            <el-input class="el-input" v-model="input" placeholder="搜索商品、品牌、分类..." @change="onPath('/search?type=1&input=' + input)" />
             <div class="bnt flex-row-center" @click="onPath('/search?type=1&input=' + input)">
               <el-icon color="#ffffff" size="20">
                 <Search />

+ 23 - 5
src/layout/index.vue

@@ -1,12 +1,18 @@
 <template>
   <div class="app-wrapper">
     <!-- 根据 permission.ts 的判断逻辑决定显示哪个header -->
-    <template v-if="meta.header != 'hide'">
-      <dataHeader :userInfo="userStore.userInfo" v-if="headerType == 'dataHeader'" />
-      <jdHeader v-else-if="headerType == 'jdHeader'" />
-      <Header v-else />
+    <template v-if="headerType == 'dataHeader'">
+      <dataHeader :userInfo="userStore.userInfo" v-if="whiteList.indexOf(route.path) == -1" />
+    </template>
+    <template v-else-if="headerType == 'jdHeader'">
+      <jdHeader v-if="whiteList.indexOf(route.path) == -1" />
+    </template>
+    <template v-else-if="headerType == 'default'">
+      <template v-if="whiteList.indexOf(route.path) == -1">
+        <Header v-if="meta.header != 'hide'" />
+        <Search v-if="meta.search != 'hide'" :meta="meta" />
+      </template>
     </template>
-    <Search v-if="meta.search != 'hide' && headerType == 'default'" :meta="meta" />
     <Nav v-if="meta.nav" :meta="meta" />
     <Breadcrumb v-if="meta.breadcrumb" />
     <div class="pages-bos" :class="meta.workbench ? 'pages-bos1' : 'pages-bos2'" :style="{ minHeight: boxHeight }">
@@ -30,6 +36,18 @@ const WorkbenchRef = ref<any>(null);
 const boxHeight = ref<any>('0px');
 const station = stationStore();
 const userStore = useUserStore();
+const whiteList = [
+  '/index',
+  '/',
+  '/indexDiy',
+  '/indexMro',
+  '/indexMroDiy',
+  '/indexFuli',
+  '/indexFuliDiy',
+  '/indexData',
+  '/indexDataDiy',
+  '/indexEnterprise'
+];
 
 // 根据 permission.ts 中的逻辑判断应该显示哪个 Header
 const headerType = computed(() => {

+ 40 - 40
src/utils/request.ts

@@ -125,47 +125,47 @@ service.interceptors.response.use(
       return res.data;
     }
     if (code === 401) {
-      if (!isRelogin.show) {
-        isRelogin.show = true;
-        // let url = `https://${import.meta.env.VITE_DOMAIN_WWW}`;
-        let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
-        if (import.meta.env.PROD) {
-          url = `${url}/login`;
-        } else {
-          const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
-          url = `${url}:${devPort}/login`;
-        }
-        useUserStore()
-          .logout()
-          .then(() => {
-            window.location.href = url;
-            isRelogin.show = false;
-          });
-        // ElMessageBox.confirm('登录状态已过期,请重新登录', '登录提示', {
-        //   confirmButtonText: '重新登录',
-        //   type: 'warning'
-        // })
-        //   .then(() => {
-        //     isRelogin.show = false;
-        //     useUserStore()
-        //       .logout()
-        //       .then(() => {
-        //         let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
+      // if (!isRelogin.show) {
+      //   isRelogin.show = true;
+      //   // let url = `https://${import.meta.env.VITE_DOMAIN_WWW}`;
+      //   let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
+      //   if (import.meta.env.PROD) {
+      //     url = `${url}/login`;
+      //   } else {
+      //     const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+      //     url = `${url}:${devPort}/login`;
+      //   }
+      //   useUserStore()
+      //     .logout()
+      //     .then(() => {
+      //       window.location.href = url;
+      //       isRelogin.show = false;
+      //     });
+      //   // ElMessageBox.confirm('登录状态已过期,请重新登录', '登录提示', {
+      //   //   confirmButtonText: '重新登录',
+      //   //   type: 'warning'
+      //   // })
+      //   //   .then(() => {
+      //   //     isRelogin.show = false;
+      //   //     useUserStore()
+      //   //       .logout()
+      //   //       .then(() => {
+      //   //         let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
 
-        //         if (import.meta.env.PROD) {
-        //           url = `${url}/login`;
-        //         } else {
-        //           const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
-        //           url = `${url}:${devPort}/login`;
-        //         }
-        //         window.location.href = url;
-        //       });
-        //   })
-        //   .catch(() => {
-        //     isRelogin.show = false;
-        //   });
-      }
-      return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
+      //   //         if (import.meta.env.PROD) {
+      //   //           url = `${url}/login`;
+      //   //         } else {
+      //   //           const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+      //   //           url = `${url}:${devPort}/login`;
+      //   //         }
+      //   //         window.location.href = url;
+      //   //       });
+      //   //   })
+      //   //   .catch(() => {
+      //   //     isRelogin.show = false;
+      //   //   });
+      // }
+      // return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
     } else if (code === HttpStatus.SERVER_ERROR) {
       ElMessage({ message: msg, type: 'error' });
       // return Promise.reject(new Error(msg));

+ 1 - 0
src/views/home/datacomponents/JDHeader.vue

@@ -149,6 +149,7 @@
                 v-model="userSearchValue"
                 @focus="isSearchInputFocused = true"
                 @blur="handleSearchInputBlur"
+                @change="onPath('/search?type=1&input=' + userSearchValue)"
                 ref="searchInput"
                 style="width: 100%; height: 100%; border: none; outline: none; background: transparent"
               />

+ 2 - 1
src/views/home/index-fuli.vue

@@ -92,7 +92,8 @@ const getHead = async () => {
     if (datas3.code == 200) {
       datas3.data.forEach((item: any) => {
         headData.value.carouselList.push({
-          imageUrl: item.imageUrl
+          imageUrl: item.imageUrl,
+          url: item.link ? item.link : ''
         });
       });
     }

+ 2 - 1
src/views/home/index-mro.vue

@@ -93,7 +93,8 @@ const getHead = async () => {
     if (datas3.code == 200) {
       datas3.data.forEach((item: any) => {
         headData.value.carouselList.push({
-          imageUrl: item.imageUrl
+          imageUrl: item.imageUrl,
+          url: item.link ? item.link : ''
         });
       });
     }

+ 40 - 1
src/views/home/index.vue

@@ -5,7 +5,18 @@
 
     <!-- 热门方案 -->
     <indexTitle :datas="hotTitle"></indexTitle>
-    <navigation v-if="hotList.length > 0" :datas="hotList" :row="{ aspectRatio: 170 / 112, imageHeight: 112, number: 5 }"></navigation>
+    <div class="hot-bos">
+      <div v-for="(item, index) in hotList" :key="index" class="data-list flex-column-center hover-color" @click="onPath(item.url)">
+        <div class="zi-hover color-[#101828] font-size-[16px] fw-600">{{ item.title || '' }}</div>
+        <div class="mt-[2px] mb-[12px] color-[#364153] font-size-[14px]">{{ item.subtitle || '' }}</div>
+        <el-image
+          class="img"
+          :src="item.imageUrl ? item.imageUrl : figure"
+          :fit="item.imgType == 1 ? 'fill' : item.imgType == 2 ? 'contain' : 'cover'"
+        />
+      </div>
+    </div>
+    <!-- <navigation v-if="hotList.length > 0" :datas="hotList" :row="{ aspectRatio: 170 / 112, imageHeight: 112, number: 5 }"></navigation> -->
 
     <!-- 场景采购 -->
     <indexTitle :datas="sceneTitle"></indexTitle>
@@ -38,6 +49,7 @@
 </template>
 
 <script setup lang="ts">
+import { onPath } from '@/utils/siteConfig';
 import indexTitle from '@/views/home/pccomponents/pages/indexTitle.vue';
 import comHead from '@/views/home/pccomponents/pages/head.vue';
 import navigation from '@/views/home/pccomponents/pages/navigation.vue';
@@ -47,6 +59,7 @@ import comGoods from '@/views/home/pccomponents/pages/goods.vue';
 import advert from '@/views/home/pccomponents/pages/advert.vue';
 import discover from '@/views/home/pccomponents/pages/discover.vue';
 import comArticle from '@/views/home/pccomponents/pages/article.vue';
+import figure from '@/assets/images/figure.png';
 import {
   getSearchTitle,
   getHomeAdList,
@@ -373,5 +386,31 @@ getProjectCaseList({}).then((res) => {
       }
     }
   }
+
+  .hot-bos {
+    display: flex;
+    gap: 10px;
+    width: 100%;
+    max-width: 1500px;
+    min-width: 1200px;
+    margin: 0 auto;
+    overflow: hidden;
+    .data-list {
+      min-height: 170px;
+      cursor: pointer;
+      flex: 0 0 calc((100% - 30px) / 4);
+      background-color: #ffffff;
+      border-radius: 5px;
+      padding: 15px 10px;
+      @media (min-width: 1320px) {
+        flex: 0 0 calc((100% - 40px) / 5);
+      }
+
+      .img {
+        height: 112px;
+        aspect-ratio: 170 / 112;
+      }
+    }
+  }
 }
 </style>

+ 1 - 1
src/views/home/jdcomponents/JDHeader.vue

@@ -45,7 +45,7 @@
         <div class="search-box-wrap flex-1">
           <div class="search-bar flex" :style="{ borderColor: config.themeColor }">
             <div class="input-group flex-1 flex">
-              <input v-model="input" type="text" />
+              <input v-model="input" type="text" @change="onPath('/search?type=1&input=' + input)" />
               <div class="carousel-bos" v-if="placeholderList.length > 0 && input.length === 0">
                 <el-carousel height="34px" direction="vertical" autoplay loop :interval="4000">
                   <el-carousel-item v-for="item in placeholderList" :key="item">

+ 6 - 1
src/views/home/pccomponents/pages/head.vue

@@ -14,7 +14,12 @@
         <div class="search-box">
           <div class="search-div flex-row-start">
             <div class="search-input flex-row-center">
-              <el-input class="el-input" v-model="input" placeholder="搜索商品、品牌、分类..." />
+              <el-input
+                class="el-input"
+                v-model="input"
+                placeholder="搜索商品、品牌、分类..."
+                @change="onPath('/search?type=1&input=' + input + '&cType=' + componentData.headType)"
+              />
               <div class="bnt flex-row-center" @click="onPath('/search?type=1&input=' + input + '&cType=' + componentData.headType)">
                 <el-icon color="#ffffff" size="20">
                   <Search />

+ 3 - 0
src/views/plan/project.vue

@@ -37,6 +37,9 @@
           </div>
         </div>
       </div>
+      <div class="flex-row-center w100%" v-if="dataList.length === 0">
+        <el-empty description="暂无数据" />
+      </div>
     </div>
     <!-- 游标分页控制 -->
     <div class="table-pagination flex-row-between">