AppMenuDialog.vue
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
<el-dialog
title="添加菜单"
width="1000px"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
append-to-body
>
<app-menu-form
v-if="dialogVisible"
ref="appMenuForm"
:data.sync="data"
:app-alias="appAlias"
:app-name="appName"
:level="level"
></app-menu-form>
<div slot="footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="save">保存</el-button>
</div>
</el-dialog>
</template>
<script>
const AppMenuForm = () => import('./AppMenuForm')
export default {
name: 'AppMenuDialog',
props: {
appAlias: {
type: String,
},
appName: {
type: String,
},
},
components: {
AppMenuForm,
},
data() {
return {
dialogVisible: false,
data: {},
level: 1,
}
},
methods: {
open(data, level) {
this.data = data
this.level = level
this.dialogVisible = true
},
save() {
this.$refs.appMenuForm.save(() => {
this.dialogVisible = false
this.$emit('refresh')
})
},
},
}
</script>
<style lang="scss" scoped>
::v-deep {
& > .el-dialog {
.el-dialog__body {
height: 100%;
padding: 0;
}
.el-tree .el-tree__empty-block {
margin: 20px 0;
}
}
.el-dialog__footer {
text-align: right;
}
}
</style>