bugs fixed
This commit is contained in:
parent
5e2be42247
commit
df614b4943
|
@ -8,6 +8,7 @@
|
|||
<vn-one>
|
||||
<ul class="dropdown">
|
||||
<li ng-repeat="item in $ctrl.items | filter:search" ng-click="$ctrl.selected = item">{{::item.name}}</li>
|
||||
<li ng-if="$ctrl.showLoadMore" class="dropdown__loadMore" ng-click="$ctrl.loadMore()" translate="Load More"></li>
|
||||
</ul>
|
||||
</vn-one>
|
||||
</vn-vertical>
|
|
@ -5,11 +5,22 @@ export default class DropDown {
|
|||
constructor($element, $scope) {
|
||||
this.$element = $element;
|
||||
this.$ = $scope;
|
||||
this._showLoadMore = false;
|
||||
}
|
||||
get showLoadMore() {
|
||||
return this._showLoadMore;
|
||||
}
|
||||
set showLoadMore(value) {
|
||||
this._showLoadMore = value;
|
||||
}
|
||||
|
||||
$onChanges(changesObj) {
|
||||
if (changesObj.show && changesObj.top && changesObj.top.currentValue) {
|
||||
this.$element.css('top', changesObj.top.currentValue + 'px');
|
||||
}
|
||||
if (this.loadMore) {
|
||||
this.showLoadMore = true;
|
||||
}
|
||||
}
|
||||
clearSearch() {
|
||||
this.$.search = '';
|
||||
|
@ -28,6 +39,7 @@ module.component('vnDropDown', {
|
|||
show: '<',
|
||||
filter: '@?',
|
||||
selected: '=',
|
||||
loadMore: '&?',
|
||||
top: '<?'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="icon-menu" ng-click="$ctrl.show()">
|
||||
<div class="icon-menu">
|
||||
<vn-icon-button icon="{{::$ctrl.icon}}"></vn-icon-button>
|
||||
<vn-drop-down items="$ctrl.items" show="$ctrl.showDropDown" selected="$ctrl.selected" filter="true"></vn-drop-down>
|
||||
</div>
|
|
@ -14,10 +14,6 @@ export default class IconMenu {
|
|||
set showDropDown(value) {
|
||||
this._showDropDown = value;
|
||||
}
|
||||
show() {
|
||||
// this._showDropDown = true;
|
||||
}
|
||||
|
||||
getItems() {
|
||||
this.$http.get(this.url).then(
|
||||
json => {
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
"Accept": "Aceptar",
|
||||
"Cancel": "Cancelar",
|
||||
"Close": "Cerrar",
|
||||
"Clear": "Borrar"
|
||||
"Clear": "Borrar",
|
||||
"Load More": "Cargar más"
|
||||
}
|
|
@ -54,7 +54,7 @@ export default class ProductionIndex {
|
|||
);
|
||||
}
|
||||
$onInit() {
|
||||
for (let i = 6; i < 21; i++) {
|
||||
for (let i = 1; i <= 24; i++) {
|
||||
let hour = [i].join('');
|
||||
if (hour.length === 1) {
|
||||
hour = [0, i].join('');
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
export default class ProductionActions {
|
||||
constructor($http, $translate) {
|
||||
constructor($http, $translate, vnApp) {
|
||||
this.$http = $http;
|
||||
this.$translate = $translate;
|
||||
|
||||
this.vnApp = vnApp;
|
||||
|
||||
this._actionState = null;
|
||||
this._actionWorker = null;
|
||||
this._actionHours = null;
|
||||
|
@ -38,9 +39,9 @@ export default class ProductionActions {
|
|||
this.$http.put(`/production/api/TicketStates/${sateteId}/changeState`, {tickets: ids}).then(
|
||||
() => {
|
||||
index.forEach(
|
||||
val => {
|
||||
this.tickets[val].state = stateName;
|
||||
this.tickets[val].stateFk = sateteId;
|
||||
i => {
|
||||
this.tickets[i].state = stateName;
|
||||
this.tickets[i].stateFk = sateteId;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -57,8 +58,8 @@ export default class ProductionActions {
|
|||
this.$http.put(`/production/api/changeTime?time=${time}`, {tickets: ids}).then(
|
||||
() => {
|
||||
index.forEach(
|
||||
val => {
|
||||
this.tickets[val].hour = time;
|
||||
i => {
|
||||
this.tickets[i].hour = time;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -101,7 +102,7 @@ export default class ProductionActions {
|
|||
}
|
||||
}
|
||||
|
||||
ProductionActions.$inject = ['$http', '$translate'];
|
||||
ProductionActions.$inject = ['$http', '$translate', 'vnApp'];
|
||||
|
||||
ngModule.component('vnProductionActions', {
|
||||
template: require('./production-actions.html'),
|
||||
|
|
|
@ -16,7 +16,8 @@ export class ProductionTable {
|
|||
set tickets(value) {
|
||||
this._tickets = value;
|
||||
this.totalFilter = this._tickets.length;
|
||||
this.pageTable.model = this._tickets.slice(0, this.itemsDisplayedInList);
|
||||
this.pageTable.filter.page = 1;
|
||||
this.pageTickets();
|
||||
}
|
||||
get tickets() {
|
||||
return this._tickets;
|
||||
|
|
Loading…
Reference in New Issue