|
|
@@ -2,6 +2,11 @@
|
|
|
<el-card class="box-card" shadow="hover" style="height: 100%" body-style="height:100%; overflow:auto">
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
+ <div class="tree-h-flex">
|
|
|
+ <el-select v-model="state.tenantId" @change="initTreeData()" placeholder="请选择租户" class="w100 mb10">
|
|
|
+ <el-option :value="item.value" :label="`${item.label} (${item.host})`" v-for="(item, index) in state.tenantList" :key="index" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<div class="tree-h-flex">
|
|
|
<div class="tree-h-left">
|
|
|
<el-input :prefix-icon="Search" v-model="filterText" placeholder="机构名称" />
|
|
|
@@ -57,19 +62,27 @@ import type { ElTree } from 'element-plus';
|
|
|
import { Search, MoreFilled } from '@element-plus/icons-vue';
|
|
|
|
|
|
import { getAPI } from '/@/utils/axios-utils';
|
|
|
-import { SysOrgApi } from '/@/api-services/api';
|
|
|
+import {SysOrgApi, SysTenantApi} from '/@/api-services/api';
|
|
|
import { SysOrg } from '/@/api-services/models';
|
|
|
+import { useUserInfo } from "/@/stores/userInfo";
|
|
|
|
|
|
+const userStore = useUserInfo();
|
|
|
const filterText = ref('');
|
|
|
const treeRef = ref<InstanceType<typeof ElTree>>();
|
|
|
const state = reactive({
|
|
|
loading: false,
|
|
|
+ tenantList: [],
|
|
|
+ tenantId: undefined as Number,
|
|
|
orgData: [] as Array<SysOrg>,
|
|
|
isShowCheckbox: false,
|
|
|
ownOrgData: [],
|
|
|
});
|
|
|
|
|
|
-onMounted(() => {
|
|
|
+onMounted( async () => {
|
|
|
+ if (userStore.userInfos.accountType == 999) {
|
|
|
+ state.tenantList = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
|
|
|
+ state.tenantId = state.tenantList[0].value;
|
|
|
+ }
|
|
|
initTreeData();
|
|
|
});
|
|
|
|
|
|
@@ -79,7 +92,7 @@ watch(filterText, (val) => {
|
|
|
|
|
|
const initTreeData = async () => {
|
|
|
state.loading = true;
|
|
|
- var res = await getAPI(SysOrgApi).apiSysOrgListGet(0);
|
|
|
+ const res = await getAPI(SysOrgApi).apiSysOrgListGet(0, undefined, undefined, undefined, state.tenantId);
|
|
|
state.orgData = res.data.result ?? [];
|
|
|
state.loading = false;
|
|
|
};
|