-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathindex.vue
106 lines (103 loc) · 2.6 KB
/
index.vue
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<script setup>
import { ref, toRefs } from 'vue'
import GroupDesc from './GroupDesc.vue'
import GroupAnnoun from './GroupAnnoun.vue'
import GroupMembers from './GroupMembers.vue'
import GroupBlackList from './GroupBlackList.vue'
import GroupMuteList from './GroupMuteList.vue'
const props = defineProps({
modalType: {
type: String,
required: true,
default: 'groupDesc'
},
groupModalTitle: {
type: Object,
required: true,
default: () => ({ title: '', type: 0 })
},
memberRole: {
type: Boolean,
required: true,
default: false
},
groupId: {
type: String,
required: true,
default: ''
}
})
const dialogVisible = ref(false)
defineExpose({
dialogVisible
})
const { modalType, groupModalTitle } = toRefs(props)
const diffModal = {
groupDesc: {
width: '480px',
title: '群描述',
components: GroupDesc
},
announcements: {
width: '480px',
title: '群公告',
components: GroupAnnoun
},
groupmembers: {
width: '840px',
title: '群成员',
components: GroupMembers
},
groupBlacklist: {
width: '840px',
title: '群组黑名单',
components: GroupBlackList
},
groupMutelist: {
width: '840px',
title: '群组禁言名单',
components: GroupMuteList
}
}
//完成事件
const groupModalComp = ref(null)
const save = () => {
if (groupModalComp.value && groupModalComp.value.saveHandleMembers) {
groupModalComp.value.saveHandleMembers()
}
dialogVisible.value = false
}
</script>
<template>
<el-dialog
v-model="dialogVisible"
:destroy-on-close="true"
:title="
(diffModal[modalType] && diffModal[modalType].title) ||
groupModalTitle.title
"
:width="diffModal[modalType] && diffModal[modalType].width"
>
<component
ref="groupModalComp"
:is="diffModal[modalType] && diffModal[modalType].components"
:groupModalTitle="groupModalTitle"
:memberRole="memberRole"
:groupId="groupId"
@save="save"
>
</component>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="save">完成</el-button>
</span>
</template>
</el-dialog>
</template>
<style lang="scss" scoped>
:deep(.el-dialog) > .el-dialog__body {
padding: 0;
}
</style>
./GroupDesc.vue