|
@@ -127,12 +127,12 @@
|
|
column-key="operation"
|
|
column-key="operation"
|
|
width="60px"
|
|
width="60px"
|
|
>
|
|
>
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
<el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
|
|
<el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
|
|
<i
|
|
<i
|
|
class="el-icon-delete table-operation"
|
|
class="el-icon-delete table-operation"
|
|
style="color: #f50;"
|
|
style="color: #f50;"
|
|
- @click="domDelete(row)"
|
|
|
|
|
|
+ @click="domDelete(scope.row, scope.$index)"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
@@ -333,19 +333,17 @@ export default {
|
|
this.tableData.data.push(obj)
|
|
this.tableData.data.push(obj)
|
|
},
|
|
},
|
|
// 【删除】按钮-事件(前端删除)
|
|
// 【删除】按钮-事件(前端删除)
|
|
- domDelete(row){
|
|
|
|
|
|
+ domDelete(row, index){
|
|
this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
|
|
this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
|
|
distinguishCancelAndClose: true,
|
|
distinguishCancelAndClose: true,
|
|
confirmButtonText: this.$t("common.confirm"),
|
|
confirmButtonText: this.$t("common.confirm"),
|
|
cancelButtonText: this.$t("common.cancel"),
|
|
cancelButtonText: this.$t("common.cancel"),
|
|
type: "warning"
|
|
type: "warning"
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- // 过滤我们需要的数据
|
|
|
|
- let list = this.tableData.data.filter(item => item.key != row.key || item.id != row.id)
|
|
|
|
- // 给列表赋值
|
|
|
|
- this.tableData.data = list
|
|
|
|
|
|
+ // 过滤我们需要的数据
|
|
|
|
+ this.tableData.data.splice(index, 1)
|
|
// 清除table的选中数据
|
|
// 清除table的选中数据
|
|
- this.$refs.table.toggleRowSelection(row, false)
|
|
|
|
|
|
+ this.$refs.table.toggleRowSelection(row, false)
|
|
}).catch(() => {})
|
|
}).catch(() => {})
|
|
},
|
|
},
|
|
viewClose () {
|
|
viewClose () {
|