File tree Expand file tree Collapse file tree 8 files changed +34
-17
lines changed
system-chat-user/chat-user Expand file tree Collapse file tree 8 files changed +34
-17
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" tag-group" v-if =" props.tags.length" >
3- <el-tag class =" default-tag" style =" max-width : 100% " >
3+ <el-tag :size = " props.size " class =" default-tag" style =" max-width : 100% " >
44 <span class =" ellipsis" style =" max-width : 100% " >{{ props.tags[0] }}</span >
55 </el-tag >
6- <el-tooltip effect =" light" >
7- <el-tag class =" info-tag ml-4 cursor" v-if =" props.tags?.length > 1" >
6+ <el-tooltip effect =" light" :disabled = " tooltipDisabled " >
7+ <el-tag :size = " props.size " class =" info-tag ml-4 cursor" v-if =" props.tags?.length > 1" >
88 +{{ props.tags?.length - 1 }}
99 </el-tag >
1010 <template #content >
11- <el-tag v-for =" item in props.tags.slice(1)" :key =" item" class =" default-tag mr-4" >
11+ <el-tag :size = " props.size " v-for =" item in props.tags.slice(1)" :key =" item" class =" default-tag mr-4" >
1212 {{ item }}
1313 </el-tag >
1414 </template >
1818<script setup lang="ts">
1919const props = defineProps <{
2020 tags: string []
21+ size? : ' large' | ' default' | ' small'
22+ tooltipDisabled? : boolean
2123}>()
2224 </script >
2325
Original file line number Diff line number Diff line change 2020 </div >
2121 <div style =" width : 90% " >
2222 <p class =" bold mb-4" style =" font-size : 14px " >{{ user.userInfo?.username }}</p >
23- <template v-if =" user .userInfo ?.role && user .userInfo .role .length > 0 " >
24- <el-tag size =" small" class =" default-tag" >{{ user.userInfo?.role[0] }}</el-tag >
25- <el-tag size =" small" class =" default-tag ml-4" v-if =" user.userInfo?.role?.length > 1"
26- >+{{ user.userInfo?.role?.length - 1 }}
27- </el-tag >
23+ <template v-if =" user .userInfo ?.role_name && user .userInfo .role_name .length > 0 " >
24+ <TagGroup size =" small" :tags =" user.userInfo?.role_name" />
2825 </template >
2926 </div >
3027 </div >
Original file line number Diff line number Diff line change @@ -154,13 +154,13 @@ const submit = async (formEl: FormInstance | undefined) => {
154154 await formEl .validate ((valid , fields ) => {
155155 if (valid ) {
156156 if (isEdit .value ) {
157- loadPermissionApi (' chatUser' ).putUserManage (userForm .value .id , userForm .value , loading ).then ((res ) => {
157+ loadPermissionApi (' chatUser' ).putUserManage (userForm .value .id , userForm .value , loading ).then (() => {
158158 emit (' refresh' )
159159 MsgSuccess (t (' common.editSuccess' ))
160160 visible .value = false
161161 })
162162 } else {
163- loadPermissionApi (' chatUser' ).postUserManage (userForm .value , loading ).then ((res ) => {
163+ loadPermissionApi (' chatUser' ).postUserManage (userForm .value , loading ).then (() => {
164164 emit (' refresh' )
165165 MsgSuccess (t (' common.createSuccess' ))
166166 visible .value = false
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ const submit = async (formEl: FormInstance | undefined) => {
119119 if (! formEl ) return
120120 await formEl .validate ((valid , fields ) => {
121121 if (valid ) {
122- loadPermissionApi (' chatUser' ).putUserManagePassword (userId .value , userForm .value , loading ).then ((res ) => {
122+ loadPermissionApi (' chatUser' ).putUserManagePassword (userId .value , userForm .value , loading ).then (() => {
123123 emit (' refresh' )
124124 user .profile ()
125125 MsgSuccess (t (' views.userManage.tip.updatePwdSuccess' ))
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ function getList() {
301301 const params = {
302302 [search_type .value ]: search_form .value [search_type .value as keyof typeof search_form .value ],
303303 }
304- return loadPermissionApi (' chatUser' ).getUserManage (paginationConfig , params , loading ).then ((res ) => {
304+ return loadPermissionApi (' chatUser' ).getUserManage (paginationConfig , params , loading ).then ((res : any ) => {
305305 userTableData .value = res .data .records
306306 paginationConfig .total = res .data .total
307307 })
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ async function getWorkspaceFormItem() {
9494 ],
9595 selectProps: {
9696 options:
97- res .data ?.map ((item ) => ({
97+ res .data ?.map ((item : any ) => ({
9898 label: item .name ,
9999 value: item .id ,
100100 })) || [],
Original file line number Diff line number Diff line change 9494 <el-table-column prop =" role_name" :label =" $t('views.role.member.role')" min-width =" 100"
9595 v-if =" user.isEE() || user.isPE()" >
9696 <template #default =" { row } " >
97- <TagGroup :tags =" row.role_name" />
97+ <el-popover :width =" 400" >
98+ <template #reference >
99+ <TagGroup class =" cursor" :tags =" row.role_name" tooltipDisabled />
100+ </template >
101+ <template #default >
102+ <el-table :data =" row.role_workspace" >
103+ <el-table-column prop =" role" :label =" $t('views.role.member.role')" >
104+ </el-table-column >
105+ <el-table-column prop =" workspace" :label =" $t('views.workspace.title')" >
106+ </el-table-column >
107+ </el-table >
108+ </template >
109+ </el-popover >
98110 </template >
99111 </el-table-column >
100112 <el-table-column prop =" source" :label =" $t('views.userManage.source.label')" >
@@ -225,7 +237,13 @@ function getList() {
225237 return userManageApi
226238 .getUserManage (paginationConfig , params , loading )
227239 .then ((res ) => {
228- userTableData .value = res .data .records
240+ userTableData .value = res .data .records .map ((item : any ) => ({
241+ ... item ,
242+ role_workspace: Object .entries (item .role_workspace ).map (([role , workspaces ]) => ({
243+ role ,
244+ workspace: (workspaces as string [])?.[0 ] === ' None' ? ' -' : (workspaces as string [])?.join (" , " )
245+ }))
246+ }))
229247 paginationConfig .total = res .data .total
230248 })
231249}
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ async function getRoleFormItem() {
8585 },
8686 ],
8787 selectProps: {
88- options: res .data .filter (item => item .type !== RoleTypeEnum .ADMIN )?.map (item => ({
88+ options: res .data .filter (( item : any ) => item .type !== RoleTypeEnum .ADMIN )?.map (( item : any ) => ({
8989 label: item .name ,
9090 value: item .id
9191 })) || [],
You can’t perform that action at this time.
0 commit comments