File tree Expand file tree Collapse file tree 9 files changed +24
-15
lines changed
components/workspace-dropdown
application-workflow/component Expand file tree Collapse file tree 9 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import type { WorkspaceItem } from '@/api/type/workspace'
4040
4141const props = defineProps ({
4242 data: {
43- type: Array ,
43+ type: Array < any > ,
4444 default : () => [],
4545 },
4646 currentWorkspace: {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const {
2828} = route as any
2929
3030const isShared = computed (() => {
31- return folderId === ' shared' || route .name .includes (' ResourceManagement' )
31+ return folderId === ' shared' || route .name ? .includes (' ResourceManagement' )
3232})
3333const { theme } = useStore ()
3434const isDefaultTheme = computed (() => {
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ const filter_menu_nodes = computed(() => {
177177 if (! search_text .value ) return menuNodes ;
178178 const searchTerm = search_text .value .toLowerCase ();
179179
180- return menuNodes .reduce ((result , item ) => {
180+ return menuNodes .reduce ((result : any [] , item ) => {
181181 const filteredList = item .list .filter (listItem =>
182182 listItem .label .toLowerCase ().includes (searchTerm )
183183 );
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ async function refresh(group?: ListItem) {
310310 if (group ) {
311311 current .value = group
312312 } else {
313- current .value = list .value .find (item => item .id === current .value .id )
313+ current .value = list .value .find (item => item .id === current .value ? .id )
314314 }
315315}
316316
Original file line number Diff line number Diff line change 44 <div v-for =" (element, index) in form" :key =" index" class =" flex w-full" >
55 <el-form-item v-for =" model of props.models" :key =" model.path" :prop =" `[${index}].${model.path}`"
66 :rules =" model.rules" :label =" index === 0 && model.label ? model.label : ''" class =" mr-8" style =" flex : 1 " >
7- <el-select v-show =" !model?.hidden?.(element)" v-model =" element[model.path]"
7+ <el-select v-if =" !model?.hidden?.(element)" v-model =" element[model.path]"
88 :placeholder =" model.selectProps?.placeholder ?? $t('common.selectPlaceholder')" clearable filterable
99 multiple style =" width : 100% " collapse-tags collapse-tags-tooltip v-bind =" model.selectProps" >
1010 <el-option v-for =" opt in model.selectProps?.options" :key =" opt.value" :label =" opt.label"
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ async function refresh(role?: RoleItem) {
202202 if (role ) {
203203 currentRole .value = role
204204 } else {
205- currentRole .value = customRoleList .value .find (item => item .id === currentRole .value .id )
205+ currentRole .value = customRoleList .value .find (item => item .id === currentRole .value ? .id )
206206 }
207207}
208208
Original file line number Diff line number Diff line change @@ -137,6 +137,20 @@ async function getWorkspaceFormItem() {
137137 path: ' workspace_ids' ,
138138 label: t (' views.role.member.workspace' ),
139139 hidden : (e ) => adminRoleList .value .find (item => item .id === e .role_id ),
140+ rules: [
141+ {
142+ validator : (rule , value , callback ) => {
143+ const match = rule .field ?.match (/ \[ (\d + )\] / );
144+ const isAdmin = adminRoleList .value .some (role => role .id === list .value [parseInt (match ?.[1 ] ?? ' ' , 10 )].role_id );
145+ if (! isAdmin && (! value || value .length === 0 )) {
146+ callback (new Error (` ${t (' common.selectPlaceholder' )}${t (' views.role.member.workspace' )} ` ));
147+ } else {
148+ callback ();
149+ }
150+ },
151+ trigger: ' change' ,
152+ },
153+ ],
140154 selectProps: {
141155 options:
142156 res .data ?.map ((item ) => ({
@@ -275,7 +289,6 @@ const submit = async (formEl: FormInstance | undefined) => {
275289 ... userForm .value ,
276290 role_setting: list .value
277291 }
278- console .log (list .value )
279292 if (isEdit .value ) {
280293 userManageApi .putUserManage (userForm .value .id , params , loading ).then ((res ) => {
281294 emit (' refresh' )
Original file line number Diff line number Diff line change 125125 <template #default =" { row } " >
126126 <span @click.stop >
127127 <el-switch
128- :disabled =" row.role === 'ADMIN'"
128+ :disabled =" row.role === 'ADMIN' || row.id === user.userInfo?.id "
129129 size =" small"
130130 v-model =" row.is_active"
131131 :before-change =" () => changeState(row)"
153153 </span >
154154 <span >
155155 <el-button
156- :disabled =" row.role === 'ADMIN'"
156+ :disabled =" row.role === 'ADMIN' || row.id === user.userInfo?.id "
157157 type =" primary"
158158 text
159159 @click.stop =" deleteUserManage(row)"
Original file line number Diff line number Diff line change 9696 <div class =" flex align-center mb-16" >
9797 <h4 class =" medium" >{{ currentWorkspace?.name }}</h4 >
9898 <el-divider direction =" vertical" class =" mr-8 ml-8" />
99- <AppIcon
100- iconName =" app-workspace"
101- style =" font-size : 16px "
102- class =" color-input-placeholder"
103- ></AppIcon >
99+ <el-icon class =" color-input-placeholder" ><UserFilled /></el-icon >
104100 <span class =" color-input-placeholder ml-4" >
105101 {{ currentWorkspace?.user_count }}
106102 </span >
@@ -152,7 +148,7 @@ async function refresh(workspace?: WorkspaceItem) {
152148 if (workspace ) {
153149 currentWorkspace .value = workspace
154150 } else {
155- currentWorkspace .value = list .value .find (item => item .id === currentWorkspace .value .id )
151+ currentWorkspace .value = list .value .find (item => item .id === currentWorkspace .value ? .id )
156152 }
157153}
158154
You can’t perform that action at this time.
0 commit comments