|
|
@@ -21,6 +21,7 @@
|
|
|
import { useTargetTenantIdSetting } from '@/utils/useTargetTenantIdSetting';
|
|
|
import { replaceParams } from '@/utils/helper/treeHelper';
|
|
|
import router from '@/router';
|
|
|
+ import { useRoute } from 'vue-router';
|
|
|
|
|
|
interface TenantOption {
|
|
|
label: string;
|
|
|
@@ -37,6 +38,8 @@
|
|
|
const currentTenant = ref(localTId ? Number(localTId) : Number(tenantId.value));
|
|
|
const options = ref<TenantOption[]>([]);
|
|
|
|
|
|
+ const route = useRoute();
|
|
|
+
|
|
|
const optionsShown = computed(() => {
|
|
|
// 列表空
|
|
|
if (!options.value.length) return false;
|
|
|
@@ -46,6 +49,12 @@
|
|
|
});
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ const routeTenantId = route.query.targetTenantId as string;
|
|
|
+ if (routeTenantId) {
|
|
|
+ const nextTenantId = Number(routeTenantId);
|
|
|
+ currentTenant.value = nextTenantId;
|
|
|
+ setValue(routeTenantId);
|
|
|
+ }
|
|
|
queryListTenant().then((res) => {
|
|
|
if (!res) return;
|
|
|
options.value = replaceParams(res || [], 'tenantName', 'id');
|