Browse Source

修改table二次确认

noob 3 years ago
parent
commit
965c454584
1 changed files with 24 additions and 7 deletions
  1. 24 7
      src/pages/main/performance/components/table.vue

+ 24 - 7
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-03 20:00:28
+ * @LastEditTime : 2021-12-03 21:22:43
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
 -->
 <template>
@@ -57,14 +57,31 @@
             :width="handleRow.length * 50"
         >
             <template slot-scope="scope">
-                <el-button
-                    v-for="({ label, props }, index) in handleRow"
+                <span
+                    v-for="({ label, props, popconfirm }, index) in handleRow"
                     :key="index"
-                    @click="handleClick(props, scope.row)"
-                    type="text"
-                    size="small"
-                    >{{ label }}</el-button
+                    class="padding-right-5"
                 >
+                    <el-popconfirm
+                        v-if="popconfirm"
+                        :title="`确定要${label}吗?`"
+                    >
+                        <el-button
+                            slot="reference"
+                            @click="handleClick(props, scope.row)"
+                            type="text"
+                            size="small"
+                            >{{ label }}</el-button
+                        >
+                    </el-popconfirm>
+                    <el-button
+                        v-else
+                        @click="handleClick(props, scope.row)"
+                        type="text"
+                        size="small"
+                        >{{ label }}</el-button
+                    >
+                </span>
             </template>
         </el-table-column>
     </el-table>