Commit 95534ca1 by zhuzhequan

菜单添加loading

parent e3e0febd
<template>
<div class="system-menu card">
<div class="system-menu card" v-loading="delLoading">
<div class="header">
<el-form size="mini" :inline="true" label-width="80px">
<el-form-item label>
......@@ -26,6 +26,7 @@
:title="isEdit ? '修改' : '新增'"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
v-loading="formLoading"
:before-close="beforeClose"
width="820px">
<el-form
......@@ -184,6 +185,8 @@ export default {
loading: false,
sourceData: [],
dialogVisible: false,
formLoading: false,
delLoading: false,
editForm: {
name: '',
pid: '0',
......@@ -400,10 +403,10 @@ export default {
// getApplication().then((res) => {
// if (res.code === 200) {
// this.applicationList = res.data || []
this.$nextTick(() => {
this.$refs.editForm && this.$refs.editForm.clearValidate()
})
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.editForm && this.$refs.editForm.clearValidate()
})
this.dialogVisible = true
// }
// })
},
......@@ -413,6 +416,7 @@ export default {
} catch {
return
}
this.formLoading = true
const api = this.isEdit ? updateMenu : addMenu
delete this.editForm.children
try {
......@@ -443,6 +447,7 @@ export default {
console.error(e)
} finally {
this.resetForm()
this.formLoading = false
this.dialogVisible = false
}
},
......@@ -456,14 +461,17 @@ export default {
} catch {
return
}
this.delLoading = true
try {
const res = await deleteMenu(item.id)
if (res.code === 200) {
this.$message.success(res.message)
this.getlist()
this.delLoading = false
await this.getlist()
}
} catch (e) {
console.error(e)
this.delLoading = false
}
},
clone() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment