6868 <el-table-column label =" 按钮组" >
6969 <template slot-scope =" scope" >
7070 <el-button class =" table-button" @click =" update{ { .StructName} } (scope.row)" size =" small" type =" primary" icon =" el-icon-edit" >变更</el-button >
71- <el-popover placement =" top" width =" 160" v-model =" scope.row.visible" >
72- <p >确定要删除吗?</p >
73- <div style =" text-align : right ; margin : 0 " >
74- <el-button size =" mini" type =" text" @click =" scope.row.visible = false" >取消</el-button >
75- <el-button type =" primary" size =" mini" @click =" delete{ { .StructName} } (scope.row)" >确定</el-button >
76- </div >
77- <el-button type =" danger" icon =" el-icon-delete" size =" mini" slot =" reference" >删除</el-button >
78- </el-popover >
71+ <el-button type =" danger" icon =" el-icon-delete" size =" mini" @click =" deleteRow(scope.row)" >删除</el-button >
7972 </template >
8073 </el-table-column >
8174 </el-table >
@@ -145,7 +138,6 @@ export default {
145138 return {
146139 listApi: get{ { .StructName } } List,
147140 dialogFormVisible: false ,
148- visible: false ,
149141 type: " " ,
150142 deleteVisible: false ,
151143 multipleSelection: [],
@@ -208,6 +200,15 @@ export default {
208200 handleSelectionChange(val) {
209201 this.multipleSelection = val
210202 } ,
203+ deleteRow(row){
204+ this.$confirm (' 确定要删除吗?' , ' 提示' , {
205+ confirmButtonText: ' 确定' ,
206+ cancelButtonText: ' 取消' ,
207+ type: ' warning'
208+ } ).then(() => {
209+ this.delete{ { .StructName} } (row);
210+ } );
211+ } ,
211212 async onDelete() {
212213 const ids = []
213214 if (this.multipleSelection.length == 0){
@@ -265,7 +266,6 @@ export default {
265266 } ;
266267 } ,
267268 async delete{ { .StructName} } (row) {
268- this.visible = false ;
269269 const res = await delete{ { .StructName} } ({ ID: row.ID } );
270270 if (res.code == 0) {
271271 this.$message ({
@@ -317,4 +317,4 @@ export default {
317317 </script >
318318
319319<style >
320- </style >
320+ </style >
0 commit comments