feat: 新增租户切换组件和css目录优化

This commit is contained in:
Ray.Hao
2025-12-15 08:04:05 +08:00
parent 6e0597437e
commit 62e0af68a6
23 changed files with 193 additions and 166 deletions

View File

@@ -20,7 +20,7 @@
</template>
<script setup lang="ts">
import { ComponentSize } from "@/enums/settings/layout-enum";
import { ComponentSize } from "@/enums/settings";
import { useAppStore } from "@/store/modules/app-store";
const { t } = useI18n();

View File

@@ -0,0 +1,35 @@
<template>
<el-select
v-if="tenantList.length > 0"
v-model="currentTenantIdRef"
placeholder="选择租户"
style="width: 180px"
@change="onChange"
>
<el-option v-for="item in tenantList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</template>
<script setup lang="ts">
import { computed } from "vue";
import { useTenantStoreHook } from "@/store/modules/tenant-store";
const emit = defineEmits<{
(e: "change", tenantId: number): void;
}>();
const tenantStore = useTenantStoreHook();
const tenantList = computed(() => tenantStore.tenantList);
const currentTenantIdRef = computed<number | null>({
get: () => tenantStore.currentTenantId,
set: (val) => {
tenantStore.currentTenantId = val;
},
});
function onChange(tenantId: number) {
emit("change", tenantId);
}
</script>