【招生用户端】 优化# 子账号管理:账号名额

main
kaeery 2025-02-26 22:03:57 +08:00
parent 935d73277b
commit ebbe48d31c
3 changed files with 23 additions and 13 deletions

View File

@ -116,7 +116,6 @@ const fetchPostionData = async () => {
positionOptions.value = result.lists
} catch (error) {}
}
fetchPostionData()
const fetchOrganizationData = async () => {
try {
const result = await organzationLists()
@ -136,6 +135,7 @@ const setDsiabled = (nodes: any[]) => {
})
}
const openDialog = (params: IParams) => {
fetchPostionData()
fetchOrganizationData()
proDialogRef.value?.openDialog(params)
}

View File

@ -1,6 +1,6 @@
<template>
<div class="flex flex-col h-full">
<account-number />
<account-number :accoutnInfo="accoutnInfo" />
<div class="flex flex-1 bg-white overflow-x-auto">
<organization @set-selected-node="setSelectedNode" :curSelectedNode="selectedNode" @fetch-table-list="fetchTableList" />
<account-list ref="accountListRef" :curOrganization="selectedNode" />
@ -9,10 +9,11 @@
</template>
<script setup lang="ts">
import accountNumber from './modules/account-number.vue'
import accountNumber, { type IAccountInfo } from './modules/account-number.vue'
import organization from './modules/organization.vue'
import accountList from './modules/account-list.vue'
import type { Tree } from './components/organization/organization-tree.vue'
import { subAccountNumber } from '@/api/account_center/sub_account'
const selectedNode = ref()
const setSelectedNode = (data: Tree) => {
@ -30,5 +31,13 @@ const accountListRef = ref<InstanceType<typeof accountList>>()
const fetchTableList = () => {
accountListRef.value?.fetchTableList(selectedNode.value?.id)
}
const accoutnInfo = ref<IAccountInfo>()
const fetchSubAccountNumber = async () => {
try {
const result = await subAccountNumber()
accoutnInfo.value = result
} catch (error) {}
}
fetchSubAccountNumber()
</script>
<style scoped></style>

View File

@ -11,17 +11,18 @@
</template>
<script setup lang="ts">
import { subAccountNumber } from '@/api/account_center/sub_account'
import type { PropType } from 'vue'
const accoutnInfo = ref()
const parseUnuseNumber = computed(() => accoutnInfo.value?.quota - accoutnInfo.value?.quantity)
const fetchSubAccountNumber = async () => {
try {
const result = await subAccountNumber()
accoutnInfo.value = result
} catch (error) {}
export interface IAccountInfo {
quota: number
quantity: number
}
fetchSubAccountNumber()
const props = defineProps({
accoutnInfo: {
type: Object as PropType<IAccountInfo>,
default: () => ({})
}
})
const parseUnuseNumber = computed(() => props.accoutnInfo.quota - props.accoutnInfo.quantity)
</script>
<style scoped></style>