daiqisheng vor 3 Jahren
Ursprung
Commit
e1406deb9c
1 geänderte Dateien mit 25 neuen und 8 gelöschten Zeilen
  1. 25 8
      src/pages/main/performance/components/table.vue

+ 25 - 8
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-23 16:54:13
+ * @LastEditTime: 2022-02-10 11:13:44
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -59,7 +59,7 @@
               v-for="(item, index) in scope.row[props].split(',')"
               :key="index"
               class="simple-table-click cursor-pointer"
-              @click="handleClick(props, { ...scope.row,index })"
+              @click="handleClick(props, { ...scope.row, index })"
             >
               {{ scope.row[props].split(",")[index] }}
             </span>
@@ -132,16 +132,20 @@
           class="padding-right-5"
         >
           <span v-if="handleFormat(visible, scope.row)">
-            <el-popconfirm
-              v-if="popconfirm"
+            <!-- <el-popconfirm
+             
               :title="`确定要${label}吗?`"
               @confirm="handleClick(props, scope.row)"
               @cancel="handleCancel"
             >
-              <el-button slot="reference" type="text" size="small">{{
-                label
-              }}</el-button>
-            </el-popconfirm>
+            </el-popconfirm> -->
+            <el-button
+              v-if="popconfirm"
+              type="text"
+              size="small"
+              @click="handleConfirm(label, props, scope.row)"
+              >{{ label }}</el-button
+            >
             <el-button
               v-else
               @click="handleClick(props, scope.row)"
@@ -202,6 +206,19 @@ export default {
       }
       return visible;
     },
+    handleConfirm(label, props, row) {
+      this.$confirm(`确定要${label}吗?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "error",
+      })
+        .then(() => {
+          this.$emit(props, row);
+        })
+        .catch(() => {
+          console.log("error");
+        });
+    },
     handleClick(props, row) {
       this.$emit(props, row);
     },