|
|
|
|
@ -189,6 +189,7 @@ const editDoneClick = async () => {
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
const index = table_list.value.findIndex(item => item.id === data.pid)
|
|
|
|
|
if (!('children' in table_list.value[index])) table_list.value[index].children = []
|
|
|
|
|
table_list.value[index].children.unshift(response.data.info)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -210,10 +211,8 @@ const editDoneClick = async () => {
|
|
|
|
|
if ('children' in table_list.value[index]) {
|
|
|
|
|
response.data.info.children = JSON.parse(JSON.stringify(table_list.value[index].children));
|
|
|
|
|
}
|
|
|
|
|
if (data.type === 1) {
|
|
|
|
|
select_index = admin_auth_select.value.findIndex(item => item.id === data.id);
|
|
|
|
|
admin_auth_select.value.splice(select_index, 1)
|
|
|
|
|
}
|
|
|
|
|
select_index = admin_auth_select.value.findIndex(item => item.id === data.id);
|
|
|
|
|
if (select_index !== -1) admin_auth_select.value.splice(select_index, 1)
|
|
|
|
|
table_list.value.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
@ -233,7 +232,8 @@ const editDoneClick = async () => {
|
|
|
|
|
table_list.value.splice(index, 0, response.data.info);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
index = table_list.value.findIndex(item => item.id === data.pid);
|
|
|
|
|
if (index !== -1) index = table_list.value.findIndex(item => item.id === data.pid);
|
|
|
|
|
children_index = table_list.value[index].children.findIndex(item => item.id === data.id);
|
|
|
|
|
if (children_index === -1) {
|
|
|
|
|
table_list.value[index].children.unshift(response.data.info);
|
|
|
|
|
} else {
|
|
|
|
|
@ -242,6 +242,7 @@ const editDoneClick = async () => {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
console.log(table_list.value)
|
|
|
|
|
edit_data.value = JSON.parse(JSON.stringify(default_data))
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
@ -338,7 +339,7 @@ const iconChooseShowClick = () => {
|
|
|
|
|
<el-select v-model="edit_data.pid"
|
|
|
|
|
class="input_line_input_wrapper"
|
|
|
|
|
placeholder="请选择分组">
|
|
|
|
|
<el-option v-for="(i,k) in [
|
|
|
|
|
<el-option :disabled="edit_data.id === i.id" v-for="(i,k) in [
|
|
|
|
|
{id:0,title:'根节点'},
|
|
|
|
|
...admin_auth_select,
|
|
|
|
|
]" :key="k" :label="i.title" :value="i.id"/>
|
|
|
|
|
|