Merge pull request '扩展行政区功能' (#161) from 362270511/Admin.NET.Pro:main into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/161
This commit is contained in:
commit
f2ec3d7c58
@ -28,6 +28,27 @@ public class RegionInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
public class QueryRegionInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 父节点Id
|
||||
/// </summary>
|
||||
public long? Pid { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
}
|
||||
|
||||
public class AddRegionInput : SysRegion
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@ -54,6 +54,24 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
return await _sysRegionRep.GetListAsync(u => u.Pid == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询行政区域列表 🔖
|
||||
/// post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Query"), HttpPost]
|
||||
[DisplayName("查询行政区域列表")]
|
||||
public async Task<List<SysRegion>> QueryList(QueryRegionInput input)
|
||||
{
|
||||
return await _sysRegionRep.AsQueryable()
|
||||
.WhereIF(input.Pid.HasValue, u => u.Pid == input.Pid)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type == input.Type)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加行政区域 🔖
|
||||
/// </summary>
|
||||
|
||||
@ -28,6 +28,7 @@ import { PageRegionInput } from '../models';
|
||||
import { SyncInput } from '../models';
|
||||
import { TiandituInput } from '../models';
|
||||
import { UpdateRegionInput } from '../models';
|
||||
import { QueryRegionInput } from '../models/query-region-input';
|
||||
/**
|
||||
* SysRegionApi - axios parameter creator
|
||||
* @export
|
||||
@ -278,6 +279,54 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRegionQueryPost: async (body?: QueryRegionInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysRegion/query`;
|
||||
// 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: 'POST', ...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;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
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};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -550,6 +599,20 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionQueryPost(body?: QueryRegionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysRegion>>> {
|
||||
const localVarAxiosArgs = await SysRegionApiAxiosParamCreator(configuration).apiSysRegionQueryPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -665,6 +728,16 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
async apiSysRegionPagePost(body?: PageRegionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRegion>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionPagePost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionQueryPost(body?: QueryRegionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysRegion>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionQueryPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -770,6 +843,17 @@ export class SysRegionApi extends BaseAPI {
|
||||
public async apiSysRegionPagePost(body?: PageRegionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysRegion>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRegionApi
|
||||
*/
|
||||
public async apiSysRegionQueryPost(body?: QueryRegionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysRegion>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionQueryPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
|
||||
54
Web/src/api-services/models/query-region-input.ts
Normal file
54
Web/src/api-services/models/query-region-input.ts
Normal file
@ -0,0 +1,54 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface QueryRegionInput
|
||||
*/
|
||||
export interface QueryRegionInput {
|
||||
|
||||
/**
|
||||
* 父节点Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof QueryRegionInput
|
||||
*/
|
||||
pid?: number;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof QueryRegionInput
|
||||
*/
|
||||
name?: string | null;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof QueryRegionInput
|
||||
*/
|
||||
code?: string | null;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof QueryRegionInput
|
||||
*/
|
||||
type?: string | null;
|
||||
}
|
||||
@ -46,6 +46,11 @@
|
||||
<el-input v-model="state.ruleForm.cityCode" placeholder="区号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-input v-model="state.ruleForm.type" placeholder="类型" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user