Jelajahi Sumber

!1870 增加获取“获取机构树”公用方法,精简输出实体字段
Merge pull request !1870 from Lzh666/v2

zuohuaijun 8 bulan lalu
induk
melakukan
81bcc99926

+ 42 - 0
Admin.NET/Admin.NET.Core/Service/Org/Dto/OrgTreeOutput.cs

@@ -0,0 +1,42 @@
+// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
+//
+// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
+//
+// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
+
+namespace Admin.NET.Core.Service;
+
+/// <summary>
+/// 机构树形输出
+/// </summary>
+public class OrgTreeOutput
+{
+    /// <summary>
+    /// 主键Id
+    /// </summary>
+    [SugarColumn(IsTreeKey = true)]
+    public long Id { get; set; }
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long TenantId { get; set; }
+    /// <summary>
+    /// 父Id
+    /// </summary>
+    public long Pid { get; set; }
+
+    /// <summary>
+    /// 名称
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 机构子项
+    /// </summary>
+    public List<OrgTreeOutput> Children { get; set; }
+
+    /// <summary>
+    /// 是否禁止选中
+    /// </summary>
+    public bool Disabled { get; set; }
+}

+ 48 - 4
Admin.NET/Admin.NET.Core/Service/Org/SysOrgService.cs

@@ -44,10 +44,7 @@ public class SysOrgService : IDynamicApiController, ITransient
         // 获取拥有的机构Id集合
         var userOrgIdList = await GetUserOrgIdList();
 
-        var queryable = _sysOrgRep.AsQueryable()
-            .WhereIF(_userManager.SuperAdmin && input.TenantId > 0, u => u.TenantId == input.TenantId)
-            .OrderBy(u => new { u.OrderNo, u.Id });
-
+        var queryable = _sysOrgRep.AsQueryable().WhereIF(input.TenantId > 0, u => u.TenantId == input.TenantId).OrderBy(u => new { u.OrderNo, u.Id });
         // 带条件筛选时返回列表数据
         if (!string.IsNullOrWhiteSpace(input.Name) || !string.IsNullOrWhiteSpace(input.Code) || !string.IsNullOrWhiteSpace(input.Type))
         {
@@ -94,6 +91,53 @@ public class SysOrgService : IDynamicApiController, ITransient
     }
 
     /// <summary>
+    /// 获取机构树 🔖
+    /// </summary>
+    /// <param name="input"></param>
+    /// <returns></returns>
+    [DisplayName("获取机构树")]
+    public async Task<List<OrgTreeOutput>> GetTree([FromQuery] OrgInput input)
+    {
+        // 获取拥有的机构Id集合
+        var userOrgIdList = await GetUserOrgIdList();
+
+        var queryable = _sysOrgRep.AsQueryable().WhereIF(input.TenantId > 0, u => u.TenantId == input.TenantId).OrderBy(u => new { u.OrderNo, u.Id });
+        List<OrgTreeOutput> orgTree;
+        if (_userManager.SuperAdmin)
+        {
+            orgTree = await queryable.Select<OrgTreeOutput>().ToTreeAsync(u => u.Children, u => u.Pid, input.Id);
+        }
+        else
+        {
+            orgTree = await queryable.Select<OrgTreeOutput>().ToTreeAsync(u => u.Children, u => u.Pid, input.Id, userOrgIdList.Select(d => (object)d).ToArray());
+            // 递归禁用没权限的机构(防止用户修改或创建无权的机构和用户)
+            HandlerOrgTree(orgTree, userOrgIdList);
+        }
+
+        var sysOrg = await _sysOrgRep.AsQueryable().Select<OrgTreeOutput>().FirstAsync(u => u.Id == input.Id);
+        if (sysOrg == null) return orgTree;
+
+        sysOrg.Children = orgTree;
+        orgTree = new List<OrgTreeOutput> { sysOrg };
+        return orgTree;
+    }
+
+    /// <summary>
+    /// 递归禁用没权限的机构
+    /// </summary>
+    /// <param name="orgTree"></param>
+    /// <param name="userOrgIdList"></param>
+    private static void HandlerOrgTree(List<OrgTreeOutput> orgTree, List<long> userOrgIdList)
+    {
+        foreach (var org in orgTree)
+        {
+            org.Disabled = !userOrgIdList.Contains(org.Id); // 设置禁用/不可选择
+            if (org.Children != null)
+                HandlerOrgTree(org.Children, userOrgIdList);
+        }
+    }
+
+    /// <summary>
     /// 增加机构 🔖
     /// </summary>
     /// <param name="input"></param>

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs

@@ -284,9 +284,9 @@ public class SysUserService : IDynamicApiController, ITransient
     /// </summary>
     /// <returns></returns>
     [DisplayName("查询用户组织机构信息")]
-    public virtual async Task<List<SysOrg>> GetOrgInfo()
+    public virtual async Task<List<OrgTreeOutput>> GetOrgInfo()
     {
-        return await _sysOrgService.GetList(new OrgInput { Id = 0 });
+        return await _sysOrgService.GetTree(new OrgInput { Id = 0 });
     }
 
     /// <summary>

+ 120 - 0
Web/src/api-services/apis/sys-org-api.ts

@@ -19,6 +19,7 @@ import { Configuration } from '../configuration';
 import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
 import { AddOrgInput } from '../models';
 import { AdminResultInt64 } from '../models';
+import { AdminResultListOrgTreeOutput } from '../models';
 import { AdminResultListSysOrg } from '../models';
 import { DeleteOrgInput } from '../models';
 import { UpdateOrgInput } from '../models';
@@ -198,6 +199,78 @@ export const SysOrgApiAxiosParamCreator = function (configuration?: Configuratio
         },
         /**
          * 
+         * @summary 获取机构树 🔖
+         * @param {number} id 主键Id
+         * @param {string} [name] 名称
+         * @param {string} [code] 编码
+         * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        apiSysOrgTreeGet: async (id: number, name?: string, code?: string, type?: string, tenantId?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+            // verify required parameter 'id' is not null or undefined
+            if (id === null || id === undefined) {
+                throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysOrgTreeGet.');
+            }
+            const localVarPath = `/api/sysOrg/tree`;
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+            // authentication Bearer required
+            // http bearer authentication required
+            if (configuration && configuration.accessToken) {
+                const accessToken = typeof configuration.accessToken === 'function'
+                    ? await configuration.accessToken()
+                    : await configuration.accessToken;
+                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
+            }
+
+            if (name !== undefined) {
+                localVarQueryParameter['Name'] = name;
+            }
+
+            if (code !== undefined) {
+                localVarQueryParameter['Code'] = code;
+            }
+
+            if (type !== undefined) {
+                localVarQueryParameter['Type'] = type;
+            }
+
+            if (tenantId !== undefined) {
+                localVarQueryParameter['TenantId'] = tenantId;
+            }
+
+            if (id !== undefined) {
+                localVarQueryParameter['Id'] = id;
+            }
+
+            const query = new URLSearchParams(localVarUrlObj.search);
+            for (const key in localVarQueryParameter) {
+                query.set(key, localVarQueryParameter[key]);
+            }
+            for (const key in options.params) {
+                query.set(key, options.params[key]);
+            }
+            localVarUrlObj.search = (new URLSearchParams(query)).toString();
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
+                options: localVarRequestOptions,
+            };
+        },
+        /**
+         * 
          * @summary 更新机构 🔖
          * @param {UpdateOrgInput} [body] 
          * @param {*} [options] Override http request option.
@@ -301,6 +374,24 @@ export const SysOrgApiFp = function(configuration?: Configuration) {
         },
         /**
          * 
+         * @summary 获取机构树 🔖
+         * @param {number} id 主键Id
+         * @param {string} [name] 名称
+         * @param {string} [code] 编码
+         * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysOrgTreeGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListOrgTreeOutput>>> {
+            const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgTreeGet(id, name, code, type, tenantId, options);
+            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+                return axios.request(axiosRequestArgs);
+            };
+        },
+        /**
+         * 
          * @summary 更新机构 🔖
          * @param {UpdateOrgInput} [body] 
          * @param {*} [options] Override http request option.
@@ -358,6 +449,20 @@ export const SysOrgApiFactory = function (configuration?: Configuration, basePat
         },
         /**
          * 
+         * @summary 获取机构树 🔖
+         * @param {number} id 主键Id
+         * @param {string} [name] 名称
+         * @param {string} [code] 编码
+         * @param {string} [type] 机构类型
+         * @param {number} [tenantId] 租户Id
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysOrgTreeGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListOrgTreeOutput>> {
+            return SysOrgApiFp(configuration).apiSysOrgTreeGet(id, name, code, type, tenantId, options).then((request) => request(axios, basePath));
+        },
+        /**
+         * 
          * @summary 更新机构 🔖
          * @param {UpdateOrgInput} [body] 
          * @param {*} [options] Override http request option.
@@ -415,6 +520,21 @@ export class SysOrgApi extends BaseAPI {
     }
     /**
      * 
+     * @summary 获取机构树 🔖
+     * @param {number} id 主键Id
+     * @param {string} [name] 名称
+     * @param {string} [code] 编码
+     * @param {string} [type] 机构类型
+     * @param {number} [tenantId] 租户Id
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof SysOrgApi
+     */
+    public async apiSysOrgTreeGet(id: number, name?: string, code?: string, type?: string, tenantId?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListOrgTreeOutput>> {
+        return SysOrgApiFp(this.configuration).apiSysOrgTreeGet(id, name, code, type, tenantId, options).then((request) => request(this.axios, this.basePath));
+    }
+    /**
+     * 
      * @summary 更新机构 🔖
      * @param {UpdateOrgInput} [body] 
      * @param {*} [options] Override http request option.

+ 4 - 4
Web/src/api-services/apis/sys-user-api.ts

@@ -21,7 +21,7 @@ import { AddUserInput } from '../models';
 import { AdminResultInt32 } from '../models';
 import { AdminResultInt64 } from '../models';
 import { AdminResultListInt64 } from '../models';
-import { AdminResultListSysOrg } from '../models';
+import { AdminResultListOrgTreeOutput } from '../models';
 import { AdminResultListSysUserExtOrg } from '../models';
 import { AdminResultSqlSugarPagedListUserOutput } from '../models';
 import { AdminResultString } from '../models';
@@ -803,7 +803,7 @@ export const SysUserApiFp = function(configuration?: Configuration) {
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysUserOrgInfoGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysOrg>>> {
+        async apiSysUserOrgInfoGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListOrgTreeOutput>>> {
             const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).apiSysUserOrgInfoGet(options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@@ -982,7 +982,7 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiSysUserOrgInfoGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysOrg>> {
+        async apiSysUserOrgInfoGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListOrgTreeOutput>> {
             return SysUserApiFp(configuration).apiSysUserOrgInfoGet(options).then((request) => request(axios, basePath));
         },
         /**
@@ -1137,7 +1137,7 @@ export class SysUserApi extends BaseAPI {
      * @throws {RequiredError}
      * @memberof SysUserApi
      */
-    public async apiSysUserOrgInfoGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysOrg>> {
+    public async apiSysUserOrgInfoGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListOrgTreeOutput>> {
         return SysUserApiFp(this.configuration).apiSysUserOrgInfoGet(options).then((request) => request(this.axios, this.basePath));
     }
     /**

+ 71 - 0
Web/src/api-services/models/admin-result-list-org-tree-output.ts

@@ -0,0 +1,71 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
+ *
+ * OpenAPI spec version: 1.0.0
+ * 
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { OrgTreeOutput } from './org-tree-output';
+ /**
+ * 全局返回结果
+ *
+ * @export
+ * @interface AdminResultListOrgTreeOutput
+ */
+export interface AdminResultListOrgTreeOutput {
+
+    /**
+     * 状态码
+     *
+     * @type {number}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    code?: number;
+
+    /**
+     * 类型success、warning、error
+     *
+     * @type {string}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    type?: string | null;
+
+    /**
+     * 错误信息
+     *
+     * @type {string}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    message?: string | null;
+
+    /**
+     * 数据
+     *
+     * @type {Array<OrgTreeOutput>}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    result?: Array<OrgTreeOutput> | null;
+
+    /**
+     * 附加数据
+     *
+     * @type {any}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    extras?: any | null;
+
+    /**
+     * 时间
+     *
+     * @type {Date}
+     * @memberof AdminResultListOrgTreeOutput
+     */
+    time?: Date;
+}

+ 2 - 0
Web/src/api-services/models/index.ts

@@ -44,6 +44,7 @@ export * from './admin-result-list-enum-type-output';
 export * from './admin-result-list-int64';
 export * from './admin-result-list-log-vis-output';
 export * from './admin-result-list-menu-output';
+export * from './admin-result-list-org-tree-output';
 export * from './admin-result-list-role-output';
 export * from './admin-result-list-string';
 export * from './admin-result-list-sys-config';
@@ -260,6 +261,7 @@ export * from './notice-user-status-enum';
 export * from './number-format-info';
 export * from './open-access-input';
 export * from './open-access-output';
+export * from './org-tree-output';
 export * from './page-config-input';
 export * from './page-dict-data-input';
 export * from './page-dict-type-input';

+ 71 - 0
Web/src/api-services/models/org-tree-output.ts

@@ -0,0 +1,71 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
+ *
+ * OpenAPI spec version: 1.0.0
+ * 
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { OrgTreeOutput } from './org-tree-output';
+ /**
+ * 机构树形输出
+ *
+ * @export
+ * @interface OrgTreeOutput
+ */
+export interface OrgTreeOutput {
+
+    /**
+     * 主键Id
+     *
+     * @type {number}
+     * @memberof OrgTreeOutput
+     */
+    id?: number;
+
+    /**
+     * 租户Id
+     *
+     * @type {number}
+     * @memberof OrgTreeOutput
+     */
+    tenantId?: number;
+
+    /**
+     * 父Id
+     *
+     * @type {number}
+     * @memberof OrgTreeOutput
+     */
+    pid?: number;
+
+    /**
+     * 名称
+     *
+     * @type {string}
+     * @memberof OrgTreeOutput
+     */
+    name?: string | null;
+
+    /**
+     * 机构子项
+     *
+     * @type {Array<OrgTreeOutput>}
+     * @memberof OrgTreeOutput
+     */
+    children?: Array<OrgTreeOutput> | null;
+
+    /**
+     * 是否禁止选中
+     *
+     * @type {boolean}
+     * @memberof OrgTreeOutput
+     */
+    disabled?: boolean;
+}

+ 4 - 4
Web/src/views/system/org/component/orgTree.vue

@@ -63,7 +63,7 @@ import { Search, MoreFilled } from '@element-plus/icons-vue';
 
 import { getAPI } from '/@/utils/axios-utils';
 import {SysOrgApi, SysTenantApi} from '/@/api-services/api';
-import { SysOrg } from '/@/api-services/models';
+import { OrgTreeOutput, SysOrg } from '/@/api-services/models';
 import { useUserInfo } from "/@/stores/userInfo";
 
 const props = defineProps({
@@ -76,9 +76,9 @@ const state = reactive({
 	loading: false,
 	tenantList: [] as Array<any>,
 	tenantId: props.tenantId as number,
-	orgData: [] as Array<SysOrg>,
+	orgData: [] as Array<OrgTreeOutput>,
 	isShowCheckbox: false,
-	ownOrgData: [] as Array<SysOrg>,
+	ownOrgData: [] as Array<OrgTreeOutput>,
 });
 
 onMounted( async () => {
@@ -94,7 +94,7 @@ watch(filterText, (val) => {
 
 const initTreeData = async () => {
 	state.loading = true;
-	const res = await getAPI(SysOrgApi).apiSysOrgListGet(0, undefined, undefined, undefined, state.tenantId);
+	const res = await getAPI(SysOrgApi).apiSysOrgTreeGet(0, undefined, undefined, undefined, state.tenantId);
 	state.orgData = res.data.result ?? [];
 	state.loading = false;
 };

+ 3 - 3
Web/src/views/system/user/index.vue

@@ -135,7 +135,7 @@ import { Splitpanes, Pane } from 'splitpanes';
 import 'splitpanes/dist/splitpanes.css';
 import { getAPI } from '/@/utils/axios-utils';
 import { SysUserApi, SysOrgApi } from '/@/api-services/api';
-import { SysUser, SysOrg, UpdateUserInput } from '/@/api-services/models';
+import { SysUser, UpdateUserInput, OrgOutput } from '/@/api-services/models';
 
 const orgTreeRef = ref<InstanceType<typeof OrgTree>>();
 const editUserRef = ref<InstanceType<typeof EditUser>>();
@@ -143,7 +143,7 @@ const state = reactive({
 	loading: false,
 	tenantList: [] as Array<any>,
 	userData: [] as Array<SysUser>,
-	orgTreeData: [] as Array<SysOrg>,
+	orgTreeData: [] as Array<OrgOutput>,
 	queryParams: {
 		orgId: -1,
 		account: undefined,
@@ -168,7 +168,7 @@ onMounted(async () => {
 // 查询机构数据
 const loadOrgData = async () => {
 	state.loading = true;
-	let res = await getAPI(SysOrgApi).apiSysOrgListGet(0);
+	let res = await getAPI(SysOrgApi).apiSysOrgTreeGet(0);
 	state.orgTreeData = res.data.result ?? [];
 	state.loading = false;
 };

+ 4 - 4
Web/src/views/system/userRegWay/component/editRegWay.vue

@@ -73,8 +73,8 @@
 <script lang="ts" setup name="sysEditTenant">
 import { onMounted, reactive, ref } from 'vue';
 import { getAPI } from '/@/utils/axios-utils';
-import {SysOrgApi, SysPosApi, SysRoleApi, SysUserRegWayApi} from '/@/api-services/api';
-import {AccountTypeEnum, RoleOutput, SysOrg, SysPos, UpdateUserRegWayInput} from '/@/api-services/models';
+import { SysOrgApi, SysPosApi, SysRoleApi, SysUserRegWayApi } from '/@/api-services/api';
+import { OrgTreeOutput, RoleOutput, SysPos, UpdateUserRegWayInput } from '/@/api-services/models';
 
 const props = defineProps({
 	title: String,
@@ -87,7 +87,7 @@ const state = reactive({
 	isShowDialog: false,
 	file: undefined as any,
 	ruleForm: {} as UpdateUserRegWayInput,
-	orgData: [] as Array<SysOrg>,
+	orgData: [] as Array<OrgTreeOutput>,
 	posData: [] as Array<SysPos>, // 职位数据
 	roleData: [] as Array<RoleOutput>, // 角色数据
 });
@@ -96,7 +96,7 @@ onMounted(async () => {
 	state.loading = true;
 	state.posData = await getAPI(SysPosApi).apiSysPosListGet().then(res => res.data.result ?? []);
 	state.roleData = await getAPI(SysRoleApi).apiSysRoleListGet().then(res => res.data.result ?? []);
-	state.orgData = await getAPI(SysOrgApi).apiSysOrgListGet(0).then(res => res.data.result ?? []);
+	state.orgData = await getAPI(SysOrgApi).apiSysOrgTreeGet(0).then(res => res.data.result ?? []);
 	state.loading = false;
 });