|
|
|
|
@ -143,6 +143,8 @@ const AdminDelete = async () => {
|
|
|
|
|
if (edit_data.value.pid === 0) {
|
|
|
|
|
const index = table_list.value.findIndex(item => item.id === response.data.id)
|
|
|
|
|
table_list.value.splice(index, 1)
|
|
|
|
|
const select_index = admin_auth_select.value.findIndex(item => item.id === response.data.id)
|
|
|
|
|
admin_auth_select.value.splice(select_index, 1)
|
|
|
|
|
} else {
|
|
|
|
|
const index = table_list.value.findIndex(item => item.id === edit_data.value.pid)
|
|
|
|
|
const children_index = table_list.value[index].children.findIndex(item => item.id === response.data.id)
|
|
|
|
|
@ -178,9 +180,14 @@ const editDoneClick = async () => {
|
|
|
|
|
edit_show.value = false
|
|
|
|
|
table_ref.value.setCurrentRow(null)
|
|
|
|
|
if (data.id === 0) {
|
|
|
|
|
window.$message().success('创建')
|
|
|
|
|
window.$message().success('创建成功')
|
|
|
|
|
if (data.pid === 0) {
|
|
|
|
|
table_list.value.unshift(response.data.info)
|
|
|
|
|
const info = JSON.parse(JSON.stringify(response.data.info))
|
|
|
|
|
table_list.value.unshift({
|
|
|
|
|
...info,
|
|
|
|
|
children: []
|
|
|
|
|
})
|
|
|
|
|
admin_auth_select.value.unshift(info)
|
|
|
|
|
} else {
|
|
|
|
|
const index = table_list.value.findIndex(item => item.id === data.pid)
|
|
|
|
|
table_list.value[index].children.unshift(response.data.info)
|
|
|
|
|
@ -212,8 +219,11 @@ const editDoneClick = async () => {
|
|
|
|
|
}
|
|
|
|
|
if (index === -1) {
|
|
|
|
|
table_list.value.unshift(response.data.info);
|
|
|
|
|
admin_auth_select.value.unshift(response.data.info)
|
|
|
|
|
} else {
|
|
|
|
|
table_list.value.splice(index, 0, response.data.info);
|
|
|
|
|
const select_index = admin_auth_select.value.findIndex(item => item.id === data.id)
|
|
|
|
|
admin_auth_select.value.splice(select_index, 1)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
index = table_list.value.findIndex(item => item.id === data.pid);
|
|
|
|
|
|