Browse Source

修改问题:查询条件添加去空功能,解决有空格查询不到问题;
通用修改

chengbeibei 10 months ago
parent
commit
fea2aab121
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/mixins/JeecgListMixin.js

+ 6 - 0
src/mixins/JeecgListMixin.js

@@ -128,6 +128,12 @@ export const JeecgListMixin = {
         sqp['superQueryParams']=encodeURI(this.superQueryParams)
         sqp['superQueryParams']=encodeURI(this.superQueryParams)
         sqp['superQueryMatchType'] = this.superQueryMatchType
         sqp['superQueryMatchType'] = this.superQueryMatchType
       }
       }
+      // 参数去空
+      if (Object.prototype.toString.call(this.queryParam) === "[object Object]") {
+        for (let paramKey in this.queryParam) {
+          this.queryParam[paramKey] = typeof this.queryParam[paramKey] === "string" ? this.queryParam[paramKey].trim() : this.queryParam[paramKey];
+        }
+      }
       var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
       var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
       param.field = this.getQueryField();
       param.field = this.getQueryField();
       param.pageNo = this.ipagination.current;
       param.pageNo = this.ipagination.current;