diff --git a/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/TenantInput.cs b/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/TenantInput.cs index 75ab8704..60e830ab 100644 --- a/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/TenantInput.cs +++ b/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/TenantInput.cs @@ -25,6 +25,11 @@ public class PageTenantInput : BasePageInput /// 电话 /// public virtual string Phone { get; set; } + + /// + /// 是否包括默认 + /// + public bool IncludeDefault { get; set; } = false; } public class AddTenantInput : TenantOutput diff --git a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs index c8b510e3..54648afd 100644 --- a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs @@ -74,7 +74,7 @@ public class SysTenantService : IDynamicApiController, ITransient .LeftJoin((u, a, b) => u.OrgId == b.Id) .WhereIF(!string.IsNullOrWhiteSpace(input.Phone), (u, a) => a.Phone.Contains(input.Phone.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.Name), (u, a, b) => b.Name.Contains(input.Name.Trim())) - .Where(u => u.Id.ToString() != SqlSugarConst.MainConfigId) // 排除默认主库/主租户 + .WhereIF(!input.IncludeDefault, u => u.Id.ToString() != SqlSugarConst.MainConfigId) // 排除默认主库/主租户 .OrderBy(u => new { u.OrderNo, u.Id }) .Select((u, a, b) => new TenantOutput { @@ -358,7 +358,7 @@ public class SysTenantService : IDynamicApiController, ITransient await _sysOrgRep.UpdateAsync(u => new SysOrg() { Name = input.Name, Pid = input.OrgPid }, u => u.Id == input.OrgId); // 更新系统用户 - await _sysUserRep.UpdateAsync(u => new SysUser() { Account = input.AdminAccount, Phone = input.Phone, Email = input.Email }, u => u.Id == input.UserId); + await _sysUserRep.UpdateAsync(u => new SysUser() { Account = input.AdminAccount, RealName = input.RealName, Phone = input.Phone, Email = input.Email }, u => u.Id == input.UserId); await CacheTenant(input.Id); diff --git a/Web/src/api-services/apis/sys-common-api.ts b/Web/src/api-services/apis/sys-common-api.ts index 00056587..4050fa93 100644 --- a/Web/src/api-services/apis/sys-common-api.ts +++ b/Web/src/api-services/apis/sys-common-api.ts @@ -325,6 +325,61 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura options: localVarRequestOptions, }; }, + /** + * + * @summary 从 china.sqlite 中获取区划数据 + * @param {string} code 区划编码 + * @param {number} level 级数(从当前code所在级别往下级数) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCommonRegionTreeCodeLevelGet: async (code: string, level: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'code' is not null or undefined + if (code === null || code === undefined) { + throw new RequiredError('code','Required parameter code was null or undefined when calling apiSysCommonRegionTreeCodeLevelGet.'); + } + // verify required parameter 'level' is not null or undefined + if (level === null || level === undefined) { + throw new RequiredError('level','Required parameter level was null or undefined when calling apiSysCommonRegionTreeCodeLevelGet.'); + } + const localVarPath = `/api/sysCommon/regionTree/{code}/{level}` + .replace(`{${"code"}}`, encodeURIComponent(String(code))) + .replace(`{${"level"}}`, encodeURIComponent(String(level))); + // 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; + } + + 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 国密SM2解密字符串 🔖 @@ -608,6 +663,21 @@ export const SysCommonApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 从 china.sqlite 中获取区划数据 + * @param {string} code 区划编码 + * @param {number} level 级数(从当前code所在级别往下级数) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonRegionTreeCodeLevelGet(code: string, level: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonRegionTreeCodeLevelGet(code, level, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 国密SM2解密字符串 🔖 @@ -733,6 +803,17 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base async apiSysCommonMachineSerialKeyGet(options?: AxiosRequestConfig): Promise> { return SysCommonApiFp(configuration).apiSysCommonMachineSerialKeyGet(options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 从 china.sqlite 中获取区划数据 + * @param {string} code 区划编码 + * @param {number} level 级数(从当前code所在级别往下级数) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonRegionTreeCodeLevelGet(code: string, level: number, options?: AxiosRequestConfig): Promise> { + return SysCommonApiFp(configuration).apiSysCommonRegionTreeCodeLevelGet(code, level, options).then((request) => request(axios, basePath)); + }, /** * * @summary 国密SM2解密字符串 🔖 @@ -849,6 +930,18 @@ export class SysCommonApi extends BaseAPI { public async apiSysCommonMachineSerialKeyGet(options?: AxiosRequestConfig) : Promise> { return SysCommonApiFp(this.configuration).apiSysCommonMachineSerialKeyGet(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 从 china.sqlite 中获取区划数据 + * @param {string} code 区划编码 + * @param {number} level 级数(从当前code所在级别往下级数) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCommonApi + */ + public async apiSysCommonRegionTreeCodeLevelGet(code: string, level: number, options?: AxiosRequestConfig) : Promise> { + return SysCommonApiFp(this.configuration).apiSysCommonRegionTreeCodeLevelGet(code, level, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 国密SM2解密字符串 🔖 diff --git a/Web/src/api-services/models/page-tenant-input.ts b/Web/src/api-services/models/page-tenant-input.ts index e63adbed..3838ccdb 100644 --- a/Web/src/api-services/models/page-tenant-input.ts +++ b/Web/src/api-services/models/page-tenant-input.ts @@ -97,4 +97,12 @@ export interface PageTenantInput { * @memberof PageTenantInput */ phone?: string | null; + + /** + * 是否包括默认 + * + * @type {boolean} + * @memberof PageTenantInput + */ + includeDefault?: boolean; } diff --git a/Web/src/views/system/openAccess/component/editOpenAccess.vue b/Web/src/views/system/openAccess/component/editOpenAccess.vue index ee61fc28..62a67b34 100644 --- a/Web/src/views/system/openAccess/component/editOpenAccess.vue +++ b/Web/src/views/system/openAccess/component/editOpenAccess.vue @@ -33,7 +33,12 @@ - + + {{ item.account }} + + {{ item.realName }} + + @@ -69,7 +74,7 @@ const state = reactive({ }); onMounted(async () => { - let res = await getAPI(SysTenantApi).apiSysTenantPagePost({ page: 1, pageSize: 10000 }); + let res = await getAPI(SysTenantApi).apiSysTenantPagePost({ page: 1, pageSize: 10000, includeDefault: true }); state.tenantData = res.data.result?.items ?? []; });