File tree Expand file tree Collapse file tree 4 files changed +28
-55
lines changed
Expand file tree Collapse file tree 4 files changed +28
-55
lines changed Original file line number Diff line number Diff line change 11<template >
22 <el-dialog :title =" `${!form.id ? $t('common.create') : $t('common.rename')}${$t('views.chatUser.group.title')}`"
33 v-model =" dialogVisible" :close-on-click-modal =" false" :close-on-press-escape =" false" :destroy-on-close =" true" >
4- <el-form label-position =" top" ref =" formRef" :rules =" rules" :model =" form" require-asterisk-position =" right" >
4+ <el-form label-position =" top" ref =" formRef" :rules =" rules" :model =" form" require-asterisk-position =" right" @submit.prevent >
55 <el-form-item :label =" $t('views.chatUser.group.name')" prop =" name" >
66 <el-input v-model =" form.name" maxlength =" 64"
77 :placeholder =" `${$t('common.inputPlaceholder')}${$t('views.chatUser.group.name')}`" />
Original file line number Diff line number Diff line change @@ -306,8 +306,12 @@ function deleteGroup(item: ListItem) {
306306
307307async function refresh(group ? : ListItem ) {
308308 await getUserGroupList ()
309- // 创建角色后选中新建的角色
310- current .value = group ? group : current .value
309+ // 创建后选中新建的
310+ if (group ) {
311+ current .value = group
312+ } else {
313+ current .value = list .value .find (item => item .id === current .value .id )
314+ }
311315}
312316
313317const rightLoading = ref (false )
Original file line number Diff line number Diff line change 2626 @mouseleave =" mouseId = ''"
2727 >
2828 <template #default =" { row } " >
29- <div class =" flex-between" >
30- <span class =" mr-8" >{{ row.role_name }}</span >
31- <div @click.stop v-show =" mouseId === row.id" >
32- <el-dropdown :teleported =" false" >
33- <el-button text >
34- <el-icon class =" color-secondary" >
35- <MoreFilled />
36- </el-icon >
37- </el-button >
38- <template #dropdown >
39- <el-dropdown-menu style =" min-width : 80px " >
40- <el-dropdown-item @click.stop =" createOrUpdateRole(row)" class =" p-8"
41- v-if =" hasPermission(
42- new ComplexPermission(
43- [RoleConst.ADMIN],
44- [PermissionConst.ROLE_EDIT],
45- [],'OR'
46- ),'OR'
47- )"
48- >
49- <el-icon ><EditPen /></el-icon >
50- {{ $t('common.rename') }}
51- </el-dropdown-item >
52- <el-dropdown-item @click.stop =" deleteRole(row)" class =" border-t p-8"
53- v-if =" hasPermission(
54- new ComplexPermission(
55- [RoleConst.ADMIN],
56- [PermissionConst.ROLE_DELETE],
57- [],'OR'
58- ),'OR'
59- )"
60- >
61- <el-icon ><Delete /></el-icon >
62- {{ $t('common.delete') }}
63- </el-dropdown-item >
64- </el-dropdown-menu >
65- </template >
66- </el-dropdown >
67- </div >
68- </div >
29+ <span >{{ row.role_name }}</span >
6930 </template >
7031 <template #empty >
7132 <span ></span >
@@ -238,7 +199,11 @@ onMounted(async () => {
238199async function refresh(role ? : RoleItem ) {
239200 await getRole ()
240201 // 创建角色后选中新建的角色
241- currentRole .value = role ? role : currentRole .value
202+ if (role ) {
203+ currentRole .value = role
204+ } else {
205+ currentRole .value = customRoleList .value .find (item => item .id === currentRole .value .id )
206+ }
242207}
243208
244209function filter(list : RoleItem [], filterText : string ) {
Original file line number Diff line number Diff line change 5454 @click.stop =" createOrUpdateWorkspace(row)"
5555 class =" p-8"
5656 v-if ="
57- hasPermission(
58- [RoleConst.ADMIN, PermissionConst.WORKSPACE_EDIT],
59- 'OR',
60- )
57+ hasPermission(
58+ [RoleConst.ADMIN, PermissionConst.WORKSPACE_EDIT],
59+ 'OR',
60+ )
6161 "
6262 >
6363 <el-icon ><EditPen /></el-icon >
6767 @click.stop =" deleteWorkspace(row)"
6868 class =" border-t p-8"
6969 v-if ="
70- row.id !== 'default' &&
71- hasPermission(
72- [RoleConst.ADMIN, PermissionConst.WORKSPACE_DELETE],
73- 'OR',
74- )
70+ row.id !== 'default' &&
71+ hasPermission(
72+ [RoleConst.ADMIN, PermissionConst.WORKSPACE_DELETE],
73+ 'OR',
74+ )
7575 "
7676 >
7777 <el-icon ><Delete /></el-icon >
@@ -148,8 +148,12 @@ onMounted(async () => {
148148
149149async function refresh(workspace ? : WorkspaceItem ) {
150150 await getWorkspace ()
151- // 创建角色后选中新建的角色
152- currentWorkspace .value = workspace ? workspace : currentWorkspace .value
151+ // 创建后选中新建的
152+ if (workspace ) {
153+ currentWorkspace .value = workspace
154+ } else {
155+ currentWorkspace .value = list .value .find (item => item .id === currentWorkspace .value .id )
156+ }
153157}
154158
155159function filter(list : WorkspaceItem [], filterText : string ) {
You can’t perform that action at this time.
0 commit comments