工作流表单+模型代码提交
This commit is contained in:
31
src/views/system/auth/userList/UserSelect.vue
Normal file
31
src/views/system/auth/userList/UserSelect.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<!-- TODO puhui999: 先单独一个后面封装成通用选择组件 -->
|
||||
<template>
|
||||
<el-select class='w-1/1' v-bind='attrs'>
|
||||
<el-option
|
||||
v-for='(dict, index) in userOptions'
|
||||
:key='index'
|
||||
:label='dict.nickname'
|
||||
:value='dict.id'
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { getUserListByIds } from '@/api/user-boot/user'
|
||||
|
||||
defineOptions({ name: 'UserSelect' })
|
||||
const attrs = useAttrs()
|
||||
const userOptions = ref([]) // 用户下拉数据
|
||||
|
||||
onMounted(async () => {
|
||||
let data: any = []
|
||||
await getUserListByIds().then(res => {
|
||||
data = res.data
|
||||
})
|
||||
if (!data || data.length === 0) {
|
||||
return
|
||||
}
|
||||
userOptions.value = data
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user