精简搜索函数, 添加页面
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { loginStatus, post } from '@/utils/https';
|
||||
import { cloneLite, getAuthInfo, getDataSet, toArray, toNumber } from '@/utils/util';
|
||||
import {
|
||||
cloneLite,
|
||||
getAuthInfo,
|
||||
getDataSet,
|
||||
searchValueFormat,
|
||||
toArray,
|
||||
toNumber,
|
||||
} from '@/utils/util';
|
||||
|
||||
const defaultParams = { curr_page: 1, page_count: 20, batch_id: '' };
|
||||
|
||||
@@ -28,12 +35,7 @@ Page({
|
||||
},
|
||||
searchChange(e: any) {
|
||||
const key = getDataSet(e).key;
|
||||
this.data.params[key] = e.detail.value;
|
||||
this.setData({ params: this.data.params });
|
||||
},
|
||||
searchChange2(e: any) {
|
||||
const key = getDataSet(e).key;
|
||||
const val = `${e.detail.value || ''}`.trim();
|
||||
const val = searchValueFormat(e.detail.value);
|
||||
if (val) {
|
||||
this.data.params[key] = val;
|
||||
} else {
|
||||
@@ -41,16 +43,6 @@ Page({
|
||||
}
|
||||
this.setData({ params: this.data.params });
|
||||
},
|
||||
onOptionChange(e: any) {
|
||||
const key = getDataSet(e).key;
|
||||
this.data.params[key] = e.detail.value;
|
||||
this.setData({ params: this.data.params });
|
||||
},
|
||||
datePickerConfirm(e: any) {
|
||||
const data = getDataSet(e);
|
||||
this.data.params[data.key] = e.detail.value;
|
||||
this.setData({ params: this.data.params });
|
||||
},
|
||||
searchOk() {
|
||||
this.getList(1);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user