From f20a554bdb24e9dfde9dc6a69d78595944f61d15 Mon Sep 17 00:00:00 2001
From: mark <mark18340872469@163.com>
Date: 星期二, 25 十月 2022 14:53:57 +0800
Subject: [PATCH] 设备管理 样式调整

---
 src/views/product/components/ProductContent.vue |   67 ++++++++++++---------------------
 1 files changed, 25 insertions(+), 42 deletions(-)

diff --git a/src/views/product/components/ProductContent.vue b/src/views/product/components/ProductContent.vue
index 193763d..9abfaff 100644
--- a/src/views/product/components/ProductContent.vue
+++ b/src/views/product/components/ProductContent.vue
@@ -13,9 +13,9 @@
             size="mini"
             v-for="(item, index) in types"
             :key="index + 't'"
-            :class="productLabelId == item.id ? 'selected' : ''"
+            :class="productLabelId == item.productType ? 'selected' : ''"
             class="type-label"
-            @click="selectType(item.id)"
+            @click="selectType(item.productType)"
             >{{ item.name }}</el-button
           >
         </div>
@@ -59,7 +59,7 @@
         :data="item"
         v-for="(item, index) in dataList"
         :key="index"
-        :labels="getLabel(item.productLabelId)"
+        :labels="getLabel(item.productType)"
       >
       </productCard>
     </div>
@@ -76,17 +76,14 @@
 </template>
 
 <script>
-import {
-  findAllCenterProduct,
-  findDicByType,
-  // getReleaseProduct,
-} from "@/api/product";
-// import { activeByCode, showDetail } from "../api/code";
-// import { findDevListByUser } from "../api/device";
-// import { addShopcartProd, resumeOrder } from "../api/shopcart";
-// import request from "../api/index";
+import { findAllCenterProduct, findDicByType } from "@/api/product";
 import productCard from "@/views/product/components/productCard";
 export default {
+  created() {
+    if (this.$route.query.keyWord) {
+      this.inputText = this.$route.query.keyWord;
+    }
+  },
   mounted() {
     this.getDic();
     this.getProductList();
@@ -106,7 +103,7 @@
         { id: "bitmain", name: "bitmain" },
       ],
       targetPlatformId: "all",
-      productLabelId: "",
+      productLabelId: 0,
       elvChip: "all",
       size: 12,
       publishStatus: 1,
@@ -121,27 +118,14 @@
   },
   methods: {
     getDic() {
-      findDicByType()
-        .then((res) => {
-          let dics = res.data.dics.filter(
-            (item) => item.type === "PRODUCTLABEL"
-          );
-          this.types = dics;
-          this.types.unshift({
-            id: "",
-            name: "鍏ㄩ儴",
-          });
-          this.labelDics = res.data.dics;
-        })
-        .catch((err) => {
-          console.log(err);
-          this.$notify({
-            type: "error",
-            message: "鏍囩鑾峰彇澶辫触",
-            duration: 2500,
-            offset: 57,
-          });
+      findDicByType().then((res) => {
+        this.types = res.data.list;
+        this.types.unshift({
+          productType: 0,
+          name: "鍏ㄩ儴",
         });
+        this.labelDics = res.data.list;
+      });
     },
     selectType(id) {
       this.productLabelId = id;
@@ -156,7 +140,6 @@
       this.getProductList();
     },
     getProductList(v) {
-      console.log("--------------");
       let param = {
         page: v === 1 ? 1 : this.page,
         size: this.size,
@@ -164,7 +147,7 @@
         archType: this.targetPlatformId == "all" ? "" : this.targetPlatformId,
         gpuType: this.elvChip == "all" ? "" : this.elvChip,
         publishStatus: this.publishStatus,
-        productLabelId: this.productLabelId,
+        productType: this.productLabelId,
       };
       findAllCenterProduct(param)
         .then((res) => {
@@ -189,14 +172,12 @@
           });
         });
     },
-    getLabel(ids) {
+    getLabel(id) {
       let arr = [];
-      ids.forEach((id) => {
-        let obj = this.labelDics.filter((item) => item.id == id);
-        if (obj.length > 0) {
-          arr.push(obj[0].name);
-        }
-      });
+      let obj = this.labelDics.filter((item) => item.productType == id);
+      if (obj.length > 0) {
+        arr.push(obj[0].name);
+      }
       return arr;
     },
     refresh(page) {
@@ -215,6 +196,7 @@
 .Content {
   position: relative;
   width: 1280px;
+  min-height: calc(100vh - 148px);
   margin: 0 auto;
 
   .searchCard {
@@ -282,6 +264,7 @@
         font-size: 14px;
         border-radius: 0;
         border: 1px solid #fff;
+        color: #3d3d3d;
 
         &.selected {
           border: 1px solid #0065ff;

--
Gitblit v1.8.0