| | |
| | | |
| | | import { ref, watch } from 'vue'; |
| | | |
| | | import { useVbenModal } from '..\..\..\..\..\packages\effects\common-ui\src'; |
| | | import { DICT_TYPE } from '..\..\..\..\..\packages\constants\src'; |
| | | import { getDictOptions } from '..\..\..\..\..\packages\effects\hooks\src'; |
| | | import { IconifyIcon } from '..\..\..\..\..\packages\icons\src'; |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | import { IconifyIcon } from '@vben/icons'; |
| | | |
| | | import { |
| | | Avatar, |
| | |
| | | newVal.managerUserIds.includes(user.id), |
| | | ) as SystemUserApi.User[]) |
| | | : []; |
| | | // 流程管理员固定为超级管理员:进入页面即强制回写,修改场景同样生效 |
| | | const admin = props.userList.find( |
| | | (user: SystemUserApi.User) => user.username === 'admin', |
| | | ); |
| | | if (admin) { |
| | | newVal.managerUserIds = [admin.id]; |
| | | selectedManagerUsers.value = [admin as SystemUserApi.User]; |
| | | } |
| | | }, |
| | | { |
| | | immediate: true, |
| | |
| | | </div> |
| | | </Form.Item> |
| | | <Form.Item label="流程管理员" name="managerUserIds"> |
| | | <div class="flex flex-wrap gap-1"> |
| | | <div |
| | | v-for="user in selectedManagerUsers" |
| | | :key="user.id" |
| | | class="relative flex h-9 items-center rounded-full bg-gray-100 pr-2 hover:bg-gray-200 dark:border dark:border-gray-500 dark:bg-gray-700 dark:hover:bg-gray-600" |
| | | > |
| | | <Avatar class="m-1 size-7" v-if="user.avatar" :src="user.avatar" /> |
| | | <Avatar class="m-1 size-7" v-else> |
| | | {{ user.nickname?.substring(0, 1) }} |
| | | </Avatar> |
| | | <span class="text-gray-700 dark:text-gray-200"> |
| | | {{ user.nickname }} |
| | | </span> |
| | | <IconifyIcon |
| | | icon="lucide:x" |
| | | class="ml-2 size-4 cursor-pointer text-gray-400 hover:text-red-500" |
| | | @click="handleRemoveManagerUser(user)" |
| | | /> |
| | | </div> |
| | | <Button |
| | | type="link" |
| | | @click="openManagerUserSelect" |
| | | class="flex items-center" |
| | | > |
| | | <template #icon> |
| | | <IconifyIcon icon="lucide:user-plus" class="size-4" /> |
| | | </template> |
| | | 选择人员 |
| | | </Button> |
| | | </div> |
| | | <!-- 流程管理员固定为超级管理员,不允许选择 --> |
| | | <span class="text-gray-700 dark:text-gray-200"> |
| | | {{ selectedManagerUsers[0]?.nickname || '超级管理员' }} |
| | | </span> |
| | | </Form.Item> |
| | | </Form> |
| | | |