fix filter
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8432815cb7
commit
69530d3019
|
@ -18,7 +18,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span translate>row(s) have been selected.</span>
|
<span translate>row(s) have been selected.</span>
|
||||||
<span class="bold link" ng-click="$ctrl.checkDummy()">
|
<span class="bold link" ng-click="$ctrl.checkDummy()">
|
||||||
{{$ctrl.AllRowsCount}}
|
{{$ctrl.AllRowsText}}
|
||||||
</span>
|
</span>
|
||||||
</vn-list>
|
</vn-list>
|
||||||
</vn-menu>
|
</vn-menu>
|
|
@ -151,21 +151,22 @@ export default class MultiCheck extends FormInput {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.rows = data.length;
|
||||||
|
|
||||||
this.$http.get(this.model.url, {params})
|
this.$http.get(this.model.url, {params})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.AllRows = res.data;
|
this.AllRowsCount = res.data.length;
|
||||||
this.AllRowsCount = this.$t('SelectAllRows', {
|
this.AllRowsText = this.$t('SelectAllRows', {
|
||||||
rows: res.data.length
|
rows: this.AllRowsCount
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.rows = data.length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDummy() {
|
checkDummy() {
|
||||||
if (this.checkedDummyCount)
|
if (this.checkedDummyCount)
|
||||||
return this.checkedDummyCount = null;
|
return this.checkedDummyCount = null;
|
||||||
|
|
||||||
this.checkedDummyCount = this.rows;
|
this.checkedDummyCount = this.AllRowsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('editLatestBuys', {
|
Self.remoteMethodCtx('editLatestBuys', {
|
||||||
description: 'Updates a column for one or more buys',
|
description: 'Updates a column for one or more buys',
|
||||||
accessType: 'WRITE',
|
accessType: 'WRITE',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
|
@ -35,7 +35,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.editLatestBuys = async(field, newValue, lines, filter, options) => {
|
Self.editLatestBuys = async(ctx, field, newValue, lines, filter, options) => {
|
||||||
let tx;
|
let tx;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
||||||
|
@ -76,11 +76,12 @@ module.exports = Self => {
|
||||||
const value = {};
|
const value = {};
|
||||||
value[field] = newValue;
|
value[field] = newValue;
|
||||||
|
|
||||||
if (filter)
|
if (filter) {
|
||||||
lines = await models.Entry.latestBuysFilter(null, filter, myOptions);// ctx?
|
ctx.args.filter = {where: filter, limit: null};
|
||||||
// get lines
|
lines = await models.Buy.latestBuysFilter(ctx, null, myOptions);// ctx?
|
||||||
|
}
|
||||||
|
// get lines
|
||||||
|
|
||||||
console.log(lines.length);
|
|
||||||
const targets = lines.map(line => {
|
const targets = lines.map(line => {
|
||||||
return line[identifier];
|
return line[identifier];
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue