Просмотр исходного кода

!1472 使用分页输入参数基类中的关键字字段
Merge pull request !1472 from 喵你个汪/dev

zuohuaijun 1 год назад
Родитель
Сommit
2ab6bab4a6

+ 0 - 5
Admin.NET/Admin.NET.Core/Service/Auth/Dto/SysLdapInput.cs

@@ -11,11 +11,6 @@ namespace Admin.NET.Core.Service;
 /// </summary>
 public class SysLdapInput : BasePageInput
 {
-    /// <summary>
-    /// 关键字查询
-    /// </summary>
-    public string? SearchKey { get; set; }
-
     /// <summary>
     /// 主机
     /// </summary>

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Auth/SysLdapService.cs

@@ -30,7 +30,7 @@ public class SysLdapService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysLdap>> Page(SysLdapInput input)
     {
         return await _sysLdapRep.AsQueryable()
-            .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Host.Contains(input.SearchKey.Trim()))
+            .WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.Host.Contains(input.Keyword.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Host), u => u.Host.Contains(input.Host.Trim()))
             .OrderBy(u => u.CreateTime, OrderByType.Desc)
             .ToPagedListAsync(input.Page, input.PageSize);

+ 0 - 2
Admin.NET/Admin.NET.Core/Service/Wechat/Dto/WechatPayInput.cs

@@ -80,8 +80,6 @@ public class WechatPayRefundDomesticInput
 
 public class WechatPayPageInput : BasePageInput
 {
-    public string SearchKey { get; set; }
-
     /// <summary>
     /// 添加时间范围
     /// </summary>

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs

@@ -65,7 +65,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<SysWechatPay>> Page(WechatPayPageInput input)
     {
         var query = _sysWechatPayRep.AsQueryable()
-            .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.OutTradeNumber == input.SearchKey || u.TransactionId == input.SearchKey)
+            .WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.OutTradeNumber == input.Keyword || u.TransactionId == input.Keyword)
             .WhereIF(input.CreateTimeRange != null && input.CreateTimeRange.Count > 0 && input.CreateTimeRange[0].HasValue, x => x.CreateTime >= input.CreateTimeRange[0])
             .WhereIF(input.CreateTimeRange != null && input.CreateTimeRange.Count > 1 && input.CreateTimeRange[1].HasValue, x => x.CreateTime < ((DateTime)input.CreateTimeRange[1]).AddDays(1));
         return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);

+ 0 - 5
Admin.NET/Admin.NET.Web.Entry/wwwroot/template/Input.cs.vm

@@ -31,11 +31,6 @@ if (@column.ColumnKey != "True" && @column.WhetherAddUpdate == "Y" && !(@column.
 /// </summary>
 public class Page@(@Model.ClassName)Input : BasePageInput
 {
-    /// <summary>
-    /// 关键字查询
-    /// </summary>
-    public string? SearchKey { get; set; }
-
 @foreach (var column in Model.TableField){
     if (@column.QueryWhether == "Y"){
 

+ 3 - 3
Admin.NET/Admin.NET.Web.Entry/wwwroot/template/Service.cs.vm

@@ -54,15 +54,15 @@ public class @(@Model.ClassName)Service : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<@(@Model.ClassName)Output>> Page(Page@(@Model.ClassName)Input input)
     {
 @if (haveLikeCdt) {
-		@:input.SearchKey = input.SearchKey?.Trim();
+		@:input.Keyword = input.Keyword?.Trim();
 }
         var query = _@(@Model.LowerClassName)Rep.AsQueryable()
 @{string conditionFlag = "";}
 @if (haveLikeCdt) {
-            @:.WhereIF(!string.IsNullOrEmpty(input.SearchKey), u =>
+            @:.WhereIF(!string.IsNullOrEmpty(input.Keyword), u =>
     @foreach (var column in Model.TableField){
         if (@column.QueryWhether == "Y" && column.QueryType == "like"){
-                @:@(conditionFlag)u.@(@column.PropertyName).Contains(input.SearchKey)
+                @:@(conditionFlag)u.@(@column.PropertyName).Contains(input.Keyword)
             conditionFlag="|| ";
         }
     }

+ 1 - 1
Admin.NET/Admin.NET.Web.Entry/wwwroot/template/index.vue.vm

@@ -22,7 +22,7 @@
           if(haveLikeCdt){
           @:<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
             @:<el-form-item label="关键字">
-              @:<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
+              @:<el-input v-model="queryParams.keyword" clearable="" placeholder="请输入模糊查询关键字"/>
             @:</el-form-item>
           @:</el-col>
           }

+ 1 - 1
Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Service/ApprovalFlow/ApprovalFlowService.cs

@@ -31,7 +31,7 @@ public class ApprovalFlowService : IDynamicApiController, ITransient
     public async Task<SqlSugarPagedList<ApprovalFlowOutput>> Page(ApprovalFlowInput input)
     {
         return await _approvalFlowRep.AsQueryable()
-            .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Code.Contains(input.SearchKey.Trim()) || u.Name.Contains(input.SearchKey.Trim()) || u.Remark.Contains(input.SearchKey.Trim()))
+            .WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.Code.Contains(input.Keyword.Trim()) || u.Name.Contains(input.Keyword.Trim()) || u.Remark.Contains(input.Keyword.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Remark), u => u.Remark.Contains(input.Remark.Trim()))

+ 0 - 5
Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Service/ApprovalFlow/Dto/ApprovalFlowInput.cs

@@ -87,11 +87,6 @@ public class ApprovalFlowBaseInput
 /// </summary>
 public class ApprovalFlowInput : BasePageInput
 {
-    /// <summary>
-    /// 关键字查询
-    /// </summary>
-    public string? SearchKey { get; set; }
-
     /// <summary>
     /// 编号
     /// </summary>

+ 13 - 13
Web/src/api-services/_approvalFlow/apis/approval-flow-api.ts

@@ -230,7 +230,7 @@ export const ApprovalFlowApiAxiosParamCreator = function (configuration?: Config
         /**
          * 
          * @summary 获取审批流列表
-         * @param {string} [searchKey] 关键字查询
+         * @param {string} [keyword] 关键字查询
          * @param {string} [code] 编号
          * @param {string} [name] 名称
          * @param {string} [remark] 备注
@@ -242,7 +242,7 @@ export const ApprovalFlowApiAxiosParamCreator = function (configuration?: Config
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        apiApprovalFlowListGet: async (searchKey?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+        apiApprovalFlowListGet: async (keyword?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
             const localVarPath = `/api/approvalFlow/list`;
             // use dummy base URL string because the URL constructor only accepts absolute URLs.
             const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@@ -263,8 +263,8 @@ export const ApprovalFlowApiAxiosParamCreator = function (configuration?: Config
                 localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
             }
 
-            if (searchKey !== undefined) {
-                localVarQueryParameter['SearchKey'] = searchKey;
+            if (keyword !== undefined) {
+                localVarQueryParameter['Keyword'] = keyword;
             }
 
             if (code !== undefined) {
@@ -479,7 +479,7 @@ export const ApprovalFlowApiFp = function(configuration?: Configuration) {
         /**
          * 
          * @summary 获取审批流列表
-         * @param {string} [searchKey] 关键字查询
+         * @param {string} [keyword] 关键字查询
          * @param {string} [code] 编号
          * @param {string} [name] 名称
          * @param {string} [remark] 备注
@@ -491,8 +491,8 @@ export const ApprovalFlowApiFp = function(configuration?: Configuration) {
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiApprovalFlowListGet(searchKey?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListApprovalFlowOutput>>> {
-            const localVarAxiosArgs = await ApprovalFlowApiAxiosParamCreator(configuration).apiApprovalFlowListGet(searchKey, code, name, remark, page, pageSize, field, order, descStr, options);
+        async apiApprovalFlowListGet(keyword?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListApprovalFlowOutput>>> {
+            const localVarAxiosArgs = await ApprovalFlowApiAxiosParamCreator(configuration).apiApprovalFlowListGet(keyword, code, name, remark, page, pageSize, field, order, descStr, options);
             return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                 const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                 return axios.request(axiosRequestArgs);
@@ -578,7 +578,7 @@ export const ApprovalFlowApiFactory = function (configuration?: Configuration, b
         /**
          * 
          * @summary 获取审批流列表
-         * @param {string} [searchKey] 关键字查询
+         * @param {string} [keyword] 关键字查询
          * @param {string} [code] 编号
          * @param {string} [name] 名称
          * @param {string} [remark] 备注
@@ -590,8 +590,8 @@ export const ApprovalFlowApiFactory = function (configuration?: Configuration, b
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async apiApprovalFlowListGet(searchKey?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApprovalFlowOutput>> {
-            return ApprovalFlowApiFp(configuration).apiApprovalFlowListGet(searchKey, code, name, remark, page, pageSize, field, order, descStr, options).then((request) => request(axios, basePath));
+        async apiApprovalFlowListGet(keyword?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApprovalFlowOutput>> {
+            return ApprovalFlowApiFp(configuration).apiApprovalFlowListGet(keyword, code, name, remark, page, pageSize, field, order, descStr, options).then((request) => request(axios, basePath));
         },
         /**
          * 
@@ -670,7 +670,7 @@ export class ApprovalFlowApi extends BaseAPI {
     /**
      * 
      * @summary 获取审批流列表
-     * @param {string} [searchKey] 关键字查询
+     * @param {string} [keyword] 关键字查询
      * @param {string} [code] 编号
      * @param {string} [name] 名称
      * @param {string} [remark] 备注
@@ -683,8 +683,8 @@ export class ApprovalFlowApi extends BaseAPI {
      * @throws {RequiredError}
      * @memberof ApprovalFlowApi
      */
-    public async apiApprovalFlowListGet(searchKey?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApprovalFlowOutput>> {
-        return ApprovalFlowApiFp(this.configuration).apiApprovalFlowListGet(searchKey, code, name, remark, page, pageSize, field, order, descStr, options).then((request) => request(this.axios, this.basePath));
+    public async apiApprovalFlowListGet(keyword?: string, code?: string, name?: string, remark?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApprovalFlowOutput>> {
+        return ApprovalFlowApiFp(this.configuration).apiApprovalFlowListGet(keyword, code, name, remark, page, pageSize, field, order, descStr, options).then((request) => request(this.axios, this.basePath));
     }
     /**
      * 

+ 1 - 1
Web/src/api-services/_approvalFlow/models/approval-flow-input.ts

@@ -66,7 +66,7 @@ export interface ApprovalFlowInput {
      * @type {string}
      * @memberof ApprovalFlowInput
      */
-    searchKey?: string | null;
+    keyword?: string | null;
 
     /**
      * 编号

+ 0 - 8
Web/src/api-services/models/sys-ldap-input.ts

@@ -82,14 +82,6 @@ export interface SysLdapInput {
      */
     descStr?: string | null;
 
-    /**
-     * 关键字查询
-     *
-     * @type {string}
-     * @memberof SysLdapInput
-     */
-    searchKey?: string | null;
-
     /**
      * 主机
      *

+ 0 - 6
Web/src/api-services/models/wechat-pay-page-input.ts

@@ -82,12 +82,6 @@ export interface WechatPayPageInput {
      */
     descStr?: string | null;
 
-    /**
-     * @type {string}
-     * @memberof WechatPayPageInput
-     */
-    searchKey?: string | null;
-
     /**
      * 添加时间范围
      *

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

@@ -3,7 +3,7 @@
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
 				<el-form-item label="关键字">
-					<el-input v-model="state.queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字" />
+					<el-input v-model="state.queryParams.keyword" clearable="" placeholder="请输入模糊查询关键字" />
 				</el-form-item>
 				<el-form-item label="主机">
 					<el-input v-model="state.queryParams.host" clearable="" placeholder="请输入主机" />
@@ -82,7 +82,7 @@ const state = reactive({
 	loading: false,
 	tableData: [] as any,
 	queryParams: {
-		searchKey: undefined,
+		keyword: undefined,
 		host: undefined,
 	},
 	tableParams: {
@@ -109,7 +109,7 @@ const handleQuery = async () => {
 
 // 重置操作
 const resetQuery = () => {
-	state.queryParams.searchKey = undefined;
+	state.queryParams.keyword = undefined;
 	state.queryParams.host = undefined;
 	handleQuery();
 };

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

@@ -3,7 +3,7 @@
 		<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
 			<el-form :model="state.queryParams" ref="queryForm" :inline="true">
 				<el-form-item label="订单号">
-					<el-input v-model="state.queryParams.searchKey" clearable="" placeholder="请输入订单号" />
+					<el-input v-model="state.queryParams.keyword" clearable="" placeholder="请输入订单号" />
 				</el-form-item>
 				<el-form-item label="创建时间">
 					<el-date-picker placeholder="请选择创建时间" value-format="YYYY/MM/DD" type="daterange" v-model="state.queryParams.createTimeRange" />
@@ -149,7 +149,7 @@ const state = reactive({
 	loading: false,
 	tableData: [] as Array<SysWechatPay>,
 	queryParams: {
-		searchKey: undefined,
+		keyword: undefined,
 		createTimeRange: undefined,
 	},
 	tableParams: {
@@ -178,7 +178,7 @@ const handleQuery = async () => {
 
 // 重置操作
 const resetQuery = () => {
-	state.queryParams.searchKey = undefined;
+	state.queryParams.keyword = undefined;
 	state.queryParams.createTimeRange = undefined;
 	handleQuery();
 };