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