From 28db820caf0ed90f4326d29cb0fa7a19cba92775 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 27 二月 2026 16:33:03 +0800
Subject: [PATCH] 经销商管理

---
 admin/src/views/business/banner.vue |   67 +++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 20 deletions(-)

diff --git a/admin/src/views/business/banner.vue b/admin/src/views/business/banner.vue
index 8a12fd9..bf0c8c8 100644
--- a/admin/src/views/business/banner.vue
+++ b/admin/src/views/business/banner.vue
@@ -37,7 +37,7 @@
     <template v-slot:table-wrap>
       <ul class="toolbar" v-permissions="['business:banner:create', 'business:banner:delete']">
         <li><el-button type="primary" @click="$refs.operaBannerWindow.open('鏂板缓杞挱鍥�')" icon="el-icon-plus" v-permissions="['business:banner:create']">鏂板缓</el-button></li>
-        <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:banner:delete']">鍒犻櫎</el-button></li>
+        <li><el-button  type="danger"  @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:banner:delete']">鍒犻櫎</el-button></li>
       </ul>
       <el-table
         v-loading="isWorking.search"
@@ -52,10 +52,21 @@
         </el-table-column>
         <el-table-column prop="imgurlfull" label="灞曠ず鍥�" align="center" min-width="100px">
           <template slot-scope="{row}">
-            <el-image :scr="row.imgFullUrl" :preview-src-list="[row.imgFullUrl]"></el-image>
+            <el-image :src="row.imgFullUrl" :preview-src-list="[row.imgFullUrl]"></el-image>
           </template>
         </el-table-column>
-        <el-table-column prop="cityName" label="灞曠ず鍩庡競" align="center" min-width="100px"></el-table-column>
+        <el-table-column prop="status" label="鐘舵��" align="center" min-width="100px">
+          <template slot-scope="{row}">
+            <el-switch
+                v-model="row.status"
+                active-color="#13ce66"
+                inactive-color="#999"
+                :active-value="0"
+                :inactive-value="1"
+                @change="statusChange(row)"
+            ></el-switch>
+          </template>
+        </el-table-column>
         <el-table-column prop="type" label="璺宠浆鍔熻兘" align="center" min-width="100px">
            <template slot-scope="{row}">
             {{ typeToStr(row.type) }}
@@ -64,9 +75,10 @@
         <el-table-column prop="content" label="鍐呭" align="center" min-width="100px">
           <template slot-scope="{row}">
             <el-button v-if="row.type==0" type="text" @click="$refs.showRich.open('璇︽儏',row)">鏌ョ湅璇︽儏</el-button>
-            <template v-else>
+            <el-button v-if="row.type==1 && row.content" type="text"  @click="goLink(row)" :title="row.content">璺宠浆澶栭摼</el-button>
+<!--            <template v-else>
               {{ row.content }}
-            </template>
+            </template>-->
           </template>
         </el-table-column>
         <el-table-column prop="sortnum" label="鎺掑簭鐮�" align="center" min-width="100px"></el-table-column>
@@ -80,7 +92,7 @@
         >
           <template slot-scope="{row}">
             <el-button type="text" @click="$refs.operaBannerWindow.open('缂栬緫杞挱鍥�', row)" icon="el-icon-edit" v-permissions="['business:banner:update']">缂栬緫</el-button>
-            <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:banner:delete']">鍒犻櫎</el-button>
+            <el-button type="text"  style="color: red;" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:banner:delete']">鍒犻櫎</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -94,7 +106,7 @@
     <!-- 鏂板缓/淇敼 -->
     <OperaBannerWindow ref="operaBannerWindow" @success="handlePageChange"/>
     <ShowRich ref="showRich"/>
-    
+
   </TableLayout>
 </template>
 
@@ -113,27 +125,27 @@
       // 鎼滅储
       searchForm: {
         position: '',
-        type: '',
+        type: ''
       },
       postions: [
         // 0棣栭〉 1鎺ㄨ崘搴楅摵 2鍟嗗煄棣栭〉
         { label: '棣栭〉', id: 0 },
         { label: '鎺ㄨ崘搴楅摵', id: 1 },
-        { label: '鍟嗗煄棣栭〉', id: 2 },
+        { label: '鍟嗗煄棣栭〉', id: 2 }
       ],
       types: [
         //  0瀵屾枃鏈� 1澶栭摼 2娲诲姩 3鍟嗗
         { label: '瀵屾枃鏈�', id: 0 },
-        { label: '澶栭摼', id: 1 },
-        { label: '娲诲姩', id: 2 },
-        { label: '鍟嗗', id: 3 },
+        { label: '澶栭摼', id: 1 }
+      /*  { label: '娲诲姩', id: 2 },
+        { label: '鍟嗗', id: 3 }, */
       ]
     }
   },
-  provide() {
+  provide () {
     return {
       postions: () => this.postions,
-      types: () => this.types,
+      types: () => this.types
     }
   },
   created () {
@@ -146,15 +158,30 @@
     this.search()
   },
   methods: {
-    postionToStr(postion) {
+    statusChange (row) {
+      this.api.updateStatus(row)
+        .then(() => {
+          this.$tip.success('鎿嶄綔鎴愬姛')
+        })
+        .catch(e => {
+          this.$tip.error(e)
+        })
+        .finally(() => {
+          this.handlePageChange()
+        })
+    },
+    goLink(row){
+      window.open(row.content)
+    },
+    postionToStr (postion) {
       // console.log(postion);
-      let temp = this.postions.find(item => item.id == postion)
+      const temp = this.postions.find(item => item.id == postion)
       return temp ? temp.label : '-'
     },
-    typeToStr(type) {
-      let temp = this.types.find(item => item.id == type)
+    typeToStr (type) {
+      const temp = this.types.find(item => item.id == type)
       return temp ? temp.label : '-'
-    },
-  },
+    }
+  }
 }
 </script>

--
Gitblit v1.9.3