feat
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type {Unit} from '#/api/property/resident/unit/model';
|
||||
|
||||
import {shallowRef} from 'vue';
|
||||
import {shallowRef,ref} from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
|
||||
@@ -10,7 +10,7 @@ import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {resident_unitInfo} from '#/api/property/resident/unit';
|
||||
import {resident_unitInfo, authGroupList} from '#/api/property/resident/unit';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
dayjs.extend(duration);
|
||||
@@ -24,7 +24,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
const unitDetail = shallowRef<null | Unit>(null);
|
||||
|
||||
const authGroupName = ref('')
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -33,13 +33,16 @@ async function handleOpenChange(open: boolean) {
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await resident_unitInfo(id);
|
||||
const authGroupId = response.authGroupId;
|
||||
const res = await authGroupList();
|
||||
const authGroup = res.rows;
|
||||
authGroupName.value = authGroup.find(item => item.id === authGroupId)?.name;
|
||||
// 赋值
|
||||
unitDetail.value = response;
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -80,7 +83,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="通行权限组">
|
||||
{{ unitDetail.authGroupId ?? '-' }}
|
||||
{{ authGroupName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ unitDetail.remark ?? '-' }}
|
||||
|
Reference in New Issue
Block a user