feat(dept): 添加部门列表接口和大区选择组件
This commit is contained in:
parent
b43a03b206
commit
bfc5bb8f59
8
api/dept.js
Normal file
8
api/dept.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import request from "../utils/request";
|
||||||
|
|
||||||
|
export const getDeptList = () => {
|
||||||
|
return request({
|
||||||
|
method: 'get',
|
||||||
|
url: '/system/dept/list',
|
||||||
|
})
|
||||||
|
}
|
||||||
33
components/LargeArea/LargeArea.vue
Normal file
33
components/LargeArea/LargeArea.vue
Normal 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>
|
||||||
Loading…
x
Reference in New Issue
Block a user