Commit 35b463a8 authored by Reza Sahebgharan's avatar Reza Sahebgharan

fix(fix limit bug): fix limit bug

parent a14fad1b
Pipeline #1059 passed with stage
in 44 minutes and 36 seconds
......@@ -414,15 +414,13 @@ export default {
},
searchServerSide() {
try {
this.limit = 40;
this.query = JSON.parse(this.queryText);
this.limit = this.count + 5;
// this.limit = 40;
} catch (e) {
this.alertText = this.$t("RegisterRoute.jsonParseError");
this.alertSnackbar = true;
this.limit = 40;
this.query = null;
this.limit = this.count + 5;
// this.limit = 40;
}
}
},
......@@ -456,9 +454,8 @@ export default {
if (error != undefined) {
this.alertText = this.$t("RegisterRoute.dbError");
this.alertSnackbar = true;
this.limit = 40;
this.query = null;
this.limit = this.count + 5;
// this.limit = 40;
}
}
}
......@@ -468,18 +465,6 @@ export default {
hislink() {
return HisLink.find({}).fetch();
},
// worklist4hislink() {
// if (this.selectedBrand == null) return [];
// this.count = Counts.get("brandCount");
// if (BrandCollections[this.selectedBrand])
// return BrandCollections[this.selectedBrand].find({}).fetch();
// else {
// BrandCollections[this.selectedBrand] = new Mongo.Collection(
// this.selectedBrand
// );
// return BrandCollections[this.selectedBrand].find({}).fetch();
// }
// },
worklist4hislink() {
try {
if (this.selectedBrand == null) return [];
......@@ -487,25 +472,28 @@ export default {
if (BrandCollections[this.selectedBrand])
if (this.query != null)
return BrandCollections[this.selectedBrand]
.find(this.query)
.find(this.query, { limit: this.limit })
.fetch();
else
return BrandCollections[this.selectedBrand]
.find({}, { limit: this.limit })
.fetch();
else return BrandCollections[this.selectedBrand].find().fetch();
else {
BrandCollections[this.selectedBrand] = new Mongo.Collection(
this.selectedBrand
);
if (this.query == null)
return BrandCollections[this.selectedBrand].find().fetch();
return BrandCollections[this.selectedBrand]
.find({}, { limit: this.limit })
.fetch();
else
return BrandCollections[this.selectedBrand]
.find(this.query)
.find(this.query, { limit: this.limit })
.fetch();
}
} catch (e) {
this.alertText = this.$t("RegisterRoute.dbError");
this.alertSnackbar = true;
this.limit = this.count + 5;
// this.limit = 40;
return [];
}
}
......
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