From 41a319187c10191151d44e3260eaf4b448d6f197 Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期三, 30 十一月 2022 16:58:33 +0800
Subject: [PATCH] 图片视频修改

---
 src/views/operate/images/index.vue |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/views/operate/images/index.vue b/src/views/operate/images/index.vue
index 1ea787d..9dfaeb0 100644
--- a/src/views/operate/images/index.vue
+++ b/src/views/operate/images/index.vue
@@ -27,7 +27,7 @@
       <div class="mainContent">
         <div class="type-nav">
           <div
-            @click="changeTypeChecked(index)"
+            @click="changeTypeChecked(item)"
             v-for="(item, index) in typeList"
             :key="item.name"
             :class="[item.checked ? 'is-active' : '', 'type-item']"
@@ -65,8 +65,6 @@
           </el-table-column>
           <el-table-column prop="regionName" label="绀惧尯鍚嶇О" min-width="8">
           </el-table-column>
-          <!-- <el-table-column prop="id" label="鍥剧墖Id" min-width="8">
-          </el-table-column> -->
           <el-table-column
             prop="createTime"
             label="涓婁紶鏃堕棿"
@@ -80,12 +78,12 @@
                 <span @click="handleUpdateImageResource(scope.row, 'view')"
                   >鏌ョ湅</span
                 >
-                <span class="line">|</span>
-                <span @click="handleUpdateImageResource(scope.row, 'update')"
+                <span v-if="mystatus === 2" class="line">|</span>
+                <span v-if="mystatus === 2" @click="handleUpdateImageResource(scope.row, 'update')"
                   >淇敼</span
                 >
-                <span class="line">|</span>
-                <span @click="handleDelete(scope.row)">鍒犻櫎</span>
+                <span v-if="mystatus === 2"  class="line">|</span>
+                <span v-if="mystatus === 2"  @click="handleDelete(scope.row)">鍒犻櫎</span>
               </div>
             </template>
           </el-table-column>
@@ -321,12 +319,13 @@
         .catch((err) => this.$message({ type: "error", message: err }));
     },
     // 鏇存敼杩濊/杩濆缓
-    changeTypeChecked(idx) {
-      this.typeList.forEach((item) => {
-        item.checked = item.value === idx;
-      });
-      this.mystatus = idx + 1;
-      this.size = idx;
+    changeTypeChecked(data) {
+      this.typeList.forEach(item => {
+        item.checked = data.name === item.name;
+      })
+      const checkedType = this.typeList.find(item => item.checked);
+      this.mystatus = checkedType.value ? 2 : 1;
+      this.size = checkedType.value;
       this.getImageResourceList();
     },
     // 璁剧疆琛ㄦ牸鏂戦┈绾�

--
Gitblit v1.8.0