|
@@ -101,7 +101,7 @@
|
|
</template>
|
|
</template>
|
|
<template slot="operation" slot-scope="text, record">
|
|
<template slot="operation" slot-scope="text, record">
|
|
<span>
|
|
<span>
|
|
- <a-popconfirm title="是否要删除此行?" @confirm="remove(record.key)">
|
|
|
|
|
|
+ <a-popconfirm title="是否要删除此行?" @confirm="remove(record)">
|
|
<a>删除</a>
|
|
<a>删除</a>
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
</span>
|
|
</span>
|
|
@@ -567,10 +567,20 @@
|
|
console.log(this.model.data)
|
|
console.log(this.model.data)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- remove(key) {
|
|
|
|
- console.log(key)
|
|
|
|
- const newData = this.model.data.filter(item => item.key !== key)
|
|
|
|
- this.model.data = newData
|
|
|
|
|
|
+ remove(record) {
|
|
|
|
+ if (record.id) {
|
|
|
|
+ const key = record.id
|
|
|
|
+ const newData = this.model.data.filter(item => item.id !== key)
|
|
|
|
+ this.model.data = newData
|
|
|
|
+ console.log(this.model.data)
|
|
|
|
+ } else {
|
|
|
|
+ const key = record.key
|
|
|
|
+ const newData = this.model.data.filter(item => item.key !== key)
|
|
|
|
+ this.model.data = newData
|
|
|
|
+ }
|
|
|
|
+ // console.log(key)
|
|
|
|
+ // const newData = this.model.data.filter(item => item.key !== key)
|
|
|
|
+ // this.model.data = newData
|
|
},
|
|
},
|
|
submitForm () {
|
|
submitForm () {
|
|
const that = this;
|
|
const that = this;
|