From 5f443aad6e9f4e4914b4383583161647f150a511 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 29 Jan 2024 10:29:25 +0800
Subject: [PATCH] 公司默认回填,评论区修改swsitch

---
 src/views/property/oiae.vue |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/views/property/oiae.vue b/src/views/property/oiae.vue
index d0a8f1e..6e6301c 100644
--- a/src/views/property/oiae.vue
+++ b/src/views/property/oiae.vue
@@ -37,9 +37,10 @@
                 </el-tag>
             </template>
 
-            <template slot-scope="{ row, size }" slot="iscomment">
-                <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
-                </el-tag>
+            <template slot-scope="{ row }" slot="iscomment">
+                <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'"
+                    :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc">
+                </el-switch>
             </template>
         </avue-crud>
 
@@ -280,7 +281,10 @@
                         label: "评论区",
                         prop: "iscomment",
                         slot: true,
-                        type: "select",
+                        type: "switch",
+                        activeColor: "#13ce66",
+                        inactiveColor: "#ccc",
+                        value: '1',
                         dicData: [{
                             label: "关闭",
                             value: "0",
@@ -476,6 +480,14 @@
         }
     },
     methods: {
+        iscommentInput (e, data) {
+            upcomment(data.id, e).then(() => {
+                this.$message({
+                    type: "success",
+                    message: "操作成功!",
+                })
+            })
+        },
 
         openDilog (row, type) {
             this.dialogVisibles = true

--
Gitblit v1.9.3