From d68b036a3b3c67273b8effa3c9925ef3869a91ba Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 07 二月 2024 13:56:50 +0800
Subject: [PATCH] wms项目 wms系统参数设置的页面开发+路由+是否显示表头配置

---
 src/components/makepager/SearchCommonView.vue |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/components/makepager/SearchCommonView.vue b/src/components/makepager/SearchCommonView.vue
index c44e993..fc3e2ea 100644
--- a/src/components/makepager/SearchCommonView.vue
+++ b/src/components/makepager/SearchCommonView.vue
@@ -54,7 +54,7 @@
             <template v-if="selectArr?.length > 0" slot="prepend">
               <div style="display: flex">
                 <div v-for="(val, i) in selectArr" :key="i" class="pre-views">
-                  <span style="margin-left: 5px">{{ val }}</span>
+                  <span style="margin-left: 5px">{{ val?.title ?? val }}</span>
                   <i @click="delSelectClick(val)" class="el-icon-close" style="margint: 0 5px"></i>
                 </div>
               </div>
@@ -80,7 +80,7 @@
             trigger="click"
             :hide-on-click="false"
             placement="bottom"
-            @command="switchStatusKeywords($event, selList)"
+            @command="switchKeywords($event, selList)"
           >
             <div class="common yes-cursor">
               <img src="@/assets/img/shaixuan.png" style="width: 10px" />
@@ -88,7 +88,7 @@
             </div>
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item
-                v-for="(item, key) in taskStatusMap"
+                v-for="(item, key) in screenArray"
                 :key="key"
                 :command="item.title"
                 :class="{ selected: status == item.title }"
@@ -224,6 +224,14 @@
     showSreen: {
       type: Boolean,
       default: true
+    },
+    searchTaskMap: {
+      type: Array,
+      default: () => []
+    },
+    screenArray: {
+      type: Array,
+      default: () => []
     }
   },
   watch: {
@@ -243,13 +251,16 @@
       searchInput: "",
       searchSelValue: this.searchSel,
       status: "",
-      taskStatusMap: [
-        { value: "0", type: "default", title: "瀹屾垚" },
-        { value: "1", type: "default", title: "灏辩窉" }
-      ],
       selList: [],
       selectArr: []
     }
+  },
+  mounted() {
+    this.searchTaskMap.forEach((ele) => {
+      this.selList.push(ele.title)
+    })
+    this.selectArr = this.searchTaskMap
+    this.searchInput = this.inputName
   },
   methods: {
     // 鎼滅储
@@ -280,8 +291,8 @@
     inspectionConfigClick() {
       this.$emit("inspectionConfigClick")
     },
-    switchStatusKeywords(command, item) {
-      console.log("index", command)
+    switchKeywords(command, item) {
+      console.log("index", command, item)
       this.status = command
       const oldValue = item
       console.log(oldValue)
@@ -294,6 +305,7 @@
       } else {
         oldValue.push(command)
       }
+      this.$emit("switchKeywords", item)
     },
     // 鍒犻櫎绛涢�夊唴瀹�
     delSelectClick(item) {
@@ -302,6 +314,7 @@
         this.selectArr.findIndex((e) => e === item),
         1
       )
+      this.$emit("delSelectClick", item)
     }
   }
 }
@@ -400,7 +413,7 @@
         }
       }
       .pre-views {
-        border: 1px solid #ccc;
+        border: 1px solid #c0c0c0;
         font-size: 12px;
         margin-right: 5px;
         border-radius: 3px;
@@ -419,7 +432,7 @@
   }
 }
 .selected {
-  color: #409eff;
+  color: #606266;
 }
 .dropdown-view {
   position: relative;

--
Gitblit v1.8.0