| | |
| | | <el-card shadow="hover"> |
| | | <template v-if="prop.multiple" #header> |
| | | <el-tag v-for="user in selectUserList" :key="user.userId" closable style="margin: 2px" @close="handleCloseTag(user)"> |
| | | {{ user.userName }} |
| | | {{ user.nickName }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | |
| | | <script setup lang="ts"> |
| | | import api from '@/api/system/user'; |
| | | import { UserQuery, UserVO } from '@/api/system/user/types'; |
| | | import { DeptVO } from '@/api/system/dept/types'; |
| | | import { DeptTreeVO, DeptVO } from '@/api/system/dept/types'; |
| | | import { VxeTableInstance } from 'vxe-table'; |
| | | import useDialog from '@/hooks/useDialog'; |
| | | |
| | | interface PropType { |
| | | modelValue?: UserVO[] | UserVO | undefined; |
| | | multiple?: boolean; |
| | | data?: string | number | (string | number)[]; |
| | | data?: string | number | (string | number)[] | undefined; |
| | | } |
| | | const prop = withDefaults(defineProps<PropType>(), { |
| | | multiple: true, |
| | |
| | | const total = ref(0); |
| | | const dateRange = ref<[DateModelType, DateModelType]>(['', '']); |
| | | const deptName = ref(''); |
| | | const deptOptions = ref<DeptVO[]>([]); |
| | | const deptOptions = ref<DeptTreeVO[]>([]); |
| | | const selectUserList = ref<UserVO[]>([]); |
| | | |
| | | const deptTreeRef = ref<ElTreeInstance>(); |
| | |
| | | |
| | | const computedIds = (data) => { |
| | | if (data instanceof Array) { |
| | | return [...data]; |
| | | return data.map(item => String(item)); |
| | | } else if (typeof data === 'string') { |
| | | return data.split(','); |
| | | } else if (typeof data === 'number') { |