feat(dept): 添加部门列表接口和大区选择组件

This commit is contained in:
lonewolfyx 2026-02-07 16:26:31 +08:00
parent b43a03b206
commit bfc5bb8f59
2 changed files with 41 additions and 0 deletions

8
api/dept.js Normal file
View File

@ -0,0 +1,8 @@
import request from "../utils/request";
export const getDeptList = () => {
return request({
method: 'get',
url: '/system/dept/list',
})
}

View File

@ -0,0 +1,33 @@
<template>
<uni-data-select
v-model="modelValue"
:localdata="options"
v-bind="omit($attrs,['change'])"
/>
</template>
<script setup>
import {defineModel, defineOptions, onMounted, ref} from 'vue'
import {omit} from "radash";
import UniDataSelect from "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue";
import {getDeptList} from "../../api/dept";
defineOptions({
name: "LargeArea"
})
const modelValue = defineModel()
const options = ref([])
onMounted(async () => {
const {data} = await getDeptList()
options.value = data.filter(i => i.isUnit === 1).map(i => ({
value: i.deptId,
text: i.deptName
}))
})
</script>
<style lang="scss" scoped>
</style>