mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-21 08:57:08 +08:00
refactor(tenant): 优化租户相关代码
This commit is contained in:
70
src/views/tenant/management/DetailDrawer.vue
Normal file
70
src/views/tenant/management/DetailDrawer.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<a-drawer v-model:visible="visible" title="租户详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
|
||||
<a-descriptions :column="2" size="large" class="general-description">
|
||||
<a-descriptions-item label="ID" :span="2">
|
||||
<a-typography-paragraph copyable>{{ dataDetail?.id }}</a-typography-paragraph>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="编码">
|
||||
<a-typography-paragraph copyable>{{ dataDetail?.code }}</a-typography-paragraph>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
|
||||
<a-descriptions-item label="套餐">{{ dataDetail?.packageName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="状态">
|
||||
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
|
||||
<a-tag v-else color="red">禁用</a-tag>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="过期时间">
|
||||
<span v-if="!dataDetail?.expireTime">
|
||||
<icon-check-circle-fill class="success" />
|
||||
<span>永不过期</span>
|
||||
</span>
|
||||
<span v-else>{{ dataDetail?.expireTime }}</span>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="域名">
|
||||
<a v-if="dataDetail?.domain" style="color: rgb(var(--arcoblue-7))">{{ dataDetail?.domain }}</a>
|
||||
<span v-else style="color: red" class="text-red-4">未设置</span>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="隔离级别"><GiCellTag :value="dataDetail?.isolationLevel" :dict="tenant_isolation_level_enum" /></a-descriptions-item>
|
||||
<a-descriptions-item label="数据源">{{ dataDetail?.datasourceName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="修改人">{{ dataDetail?.updateUserString }}</a-descriptions-item>
|
||||
<a-descriptions-item label="修改时间">{{ dataDetail?.updateTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="描述" :span="2">{{ dataDetail?.description }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type TenantResp, getTenant as getDetail } from '@/apis/tenant/management'
|
||||
import { useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
const { menuList, getTenantPackageMenuList } = useMenu()
|
||||
const { width } = useWindowSize()
|
||||
|
||||
const dataId = ref('')
|
||||
const dataDetail = ref<TenantResp>()
|
||||
const visible = ref(false)
|
||||
const { tenant_isolation_level_enum } = useDict('tenant_isolation_level_enum')
|
||||
|
||||
// 查询详情
|
||||
const getDataDetail = async () => {
|
||||
const { data } = await getDetail(dataId.value)
|
||||
dataDetail.value = data
|
||||
}
|
||||
|
||||
// 打开
|
||||
const onOpen = async (id: string) => {
|
||||
dataId.value = id
|
||||
if (!menuList.value.length) {
|
||||
await getTenantPackageMenuList()
|
||||
}
|
||||
await getDataDetail()
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
defineExpose({ onOpen })
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
Reference in New Issue
Block a user