Commit 9bf4d2fc by liwk

修改删除

1 parent b783cf54
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
width="30%" width="30%"
center> center>
<div style="text-align:center">确定是否要删除</div> <div style="text-align:center">确定是否要删除</div>
<span slot="footer" class="dialog-footer"> <span slot="footer">
<gl-button @click="cancel">取 消</gl-button> <gl-button @click="cancel">取 消</gl-button>
<gl-button type="primary" @click="delData">确 定</gl-button> <gl-button type="primary" @click="delData">确 定</gl-button>
</span> </span>
...@@ -66,24 +66,21 @@ export default { ...@@ -66,24 +66,21 @@ export default {
watch: { watch: {
'value.form.name'(val) { 'value.form.name'(val) {
if (val !== '') this.$refs.name[0].$el.classList.remove('err') if (val !== '') this.$refs.name[0].$el.classList.remove('err')
},
'value.showDatails'(val) {
console.log(val)
} }
}, },
methods: { methods: {
// 删除 // 删除
delData() { delData() {
for (let index = 0; index < this.node.parent.childNodes.length; index++) { for (let index = 0; index < this.value.node.parent.childNodes.length; index++) {
if (this.node.parent.childNodes[index] === this.node) this.node.level === 1 ? this.node.parent.data.splice(index, 1) : this.node.parent.data.children.splice(index, 1) if (this.value.node.parent.childNodes[index] === this.value.node) this.value.node.level === 1 ? this.value.node.parent.data.splice(index, 1) : this.value.node.parent.data.children.splice(index, 1)
} }
this.$notify({ this.$notify({
title: '删除成功', title: '删除成功',
type: 'success' type: 'success'
}) })
this.centerDialogVisible = false this.centerDialogVisible = false
this.$set_session_config(this.data) this.$set_session_config(this.value.data)
this.showDetails = false this.value.showDetails = false
}, },
cancel() { cancel() {
this.centerDialogVisible = false this.centerDialogVisible = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!