Browse Source

优化配载详情搜索

dev-xx
qb 5 months ago
parent
commit
546116eff4
  1. 7
      src/utils/util.js
  2. 2
      src/views/distribution/artery/VehicleStowageDetails.vue

7
src/utils/util.js

@ -665,7 +665,7 @@ export const isNumber = value => {
* 向下保留小数位
* @param {*} num -- 被截取数
* @param {*} decimalPlaces -- 保留小数位
* @returns
* @returns
*/
export function floorToDecimalPlaces(num, decimalPlaces) {
const factor = Math.pow(10, decimalPlaces);
@ -812,9 +812,10 @@ export function handleTranslationDataSeclect(data, columnList, fn = (value, item
* @param {object} col 每列的配置
* @param {object} query 存储查询条件的对象
* @param {Boolean} isRegExp 是否将输入的值转换为正则表达式
* @param {Boolean} isStart 正则是否从头开始匹配
* @returns
*/
export const handleInputQuery = (value, col, query, isRegExp = false) => {
export const handleInputQuery = (value, col, query, isRegExp = false, isStart = true) => {
if (getObjType(query) !== 'object') return;
if (getObjType(col) !== 'object') return;
if (!value && value !== 0) {
@ -822,7 +823,7 @@ export const handleInputQuery = (value, col, query, isRegExp = false) => {
return;
}
const _value = isRegExp ? new RegExp('^' + value) : value;
const _value = isRegExp ? new RegExp(isStart ? '^' : '' + value) : value;
query[col.prop] = _value;
};

2
src/views/distribution/artery/VehicleStowageDetails.vue

@ -950,7 +950,7 @@ const handleData = async () => {
/** 表格表头输入框搜索 */
const inputsc = (value, row) => {
handleInputQuery(value, row, details.query.inputQuery, true);
handleInputQuery(value, row, details.query.inputQuery, true, false);
handleData();
};

Loading…
Cancel
Save