Commit 0a2e3555 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化应用数据排序

parent fcc2150a
...@@ -162,6 +162,7 @@ export default { ...@@ -162,6 +162,7 @@ export default {
searchTemplate: [], //关联搜索字段模板列表 searchTemplate: [], //关联搜索字段模板列表
selectedRowKeys: [], selectedRowKeys: [],
orConditionList: [], orConditionList: [],
sortSearch: [], // 排序搜索条件
}; };
}, },
computed: { computed: {
...@@ -233,6 +234,16 @@ export default { ...@@ -233,6 +234,16 @@ export default {
return a.fieldOrderNo - b.fieldOrderNo; return a.fieldOrderNo - b.fieldOrderNo;
}); });
this.appTemplate = arr; this.appTemplate = arr;
this.sortSearch = arr
.filter((v) => {
return v.fieldCode == "top" || v.fieldCode == "sort";
})
.map((v) => {
return {
fieldCode: v.fieldCode,
fieldValue: "%%",
};
});
this.searchTemplate = data.filter((v) => { this.searchTemplate = data.filter((v) => {
return v.defaultValue == 1; return v.defaultValue == 1;
}); });
...@@ -244,12 +255,21 @@ export default { ...@@ -244,12 +255,21 @@ export default {
// 获取数据列表 // 获取数据列表
async getDatasetList() { async getDatasetList() {
this.loading = true; this.loading = true;
let orConditionList = [
{
fieldCode: this.fieldCode,
fieldValue: `%${this.searchVal}%`,
},
...this.sortSearch,
];
let res = await getDatasetList({ let res = await getDatasetList({
page: this.current, page: this.current,
size: this.size, size: this.size,
appId: this.appId, appId: this.appId,
fieldCode: this.fieldCode, orConditionList,
fieldValue: `%${this.searchVal}%`, // fieldCode: this.fieldCode,
// fieldValue: `%${this.searchVal}%`,
// orConditionList: [ // orConditionList: [
// { // {
// fieldCode: this.fieldCode, // fieldCode: this.fieldCode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment