vue-laravel-crud 1.6.3 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-laravel-crud.esm.js +46 -13
- package/dist/vue-laravel-crud.min.js +3 -3
- package/dist/vue-laravel-crud.ssr.js +233 -197
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +36 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function _iterableToArrayLimit(r, l) {
|
|
2
2
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
3
3
|
if (null != t) {
|
|
4
4
|
var e,
|
|
@@ -12532,7 +12532,7 @@ Plugin.install = function (Vue, options) {
|
|
|
12532
12532
|
|
|
12533
12533
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
12534
12534
|
window.Vue.use(Plugin);
|
|
12535
|
-
}var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css = "tr td[data-v-
|
|
12535
|
+
}var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css = "tr td[data-v-a4bec9a9]:last-child,\ntr td[data-v-a4bec9a9]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-a4bec9a9] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-a4bec9a9] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-a4bec9a9] .crud-title[data-v-a4bec9a9] {\n margin: 0; }\n .crud-header[data-v-a4bec9a9] .crud-search[data-v-a4bec9a9] {\n max-width: 15rem; }\n .crud-header[data-v-a4bec9a9] .crud-search[data-v-a4bec9a9] .btn[data-v-a4bec9a9] {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0.375rem;\n border-bottom-right-radius: 0.375rem; }\n .crud-header[data-v-a4bec9a9] .crud-search[data-v-a4bec9a9] .btn[data-v-a4bec9a9].open[data-v-a4bec9a9] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-a4bec9a9] .table-options[data-v-a4bec9a9] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-a4bec9a9] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-a4bec9a9] {\n table-layout: auto; }\n .table[data-v-a4bec9a9] tbody[data-v-a4bec9a9] td[data-v-a4bec9a9] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-a4bec9a9] tbody[data-v-a4bec9a9] td[data-v-a4bec9a9]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12536
12536
|
n(css, {});function normalizeComponent (
|
|
12537
12537
|
scriptExports,
|
|
12538
12538
|
render,
|
|
@@ -12794,6 +12794,10 @@ n(css, {});function normalizeComponent (
|
|
|
12794
12794
|
type: Boolean,
|
|
12795
12795
|
default: true
|
|
12796
12796
|
},
|
|
12797
|
+
showPrincipalSortBtn: {
|
|
12798
|
+
type: Boolean,
|
|
12799
|
+
default: false
|
|
12800
|
+
},
|
|
12797
12801
|
showHeader: {
|
|
12798
12802
|
type: Boolean,
|
|
12799
12803
|
default: true
|
|
@@ -12831,7 +12835,7 @@ n(css, {});function normalizeComponent (
|
|
|
12831
12835
|
type: Number
|
|
12832
12836
|
},
|
|
12833
12837
|
colXl: {
|
|
12834
|
-
default:
|
|
12838
|
+
default: 4,
|
|
12835
12839
|
type: Number
|
|
12836
12840
|
},
|
|
12837
12841
|
selectHover: {
|
|
@@ -12941,6 +12945,10 @@ n(css, {});function normalizeComponent (
|
|
|
12941
12945
|
masonryColumns: {
|
|
12942
12946
|
type: Number,
|
|
12943
12947
|
default: 3
|
|
12948
|
+
},
|
|
12949
|
+
principalSortColumn: {
|
|
12950
|
+
type: String,
|
|
12951
|
+
default: "id"
|
|
12944
12952
|
}
|
|
12945
12953
|
},
|
|
12946
12954
|
mounted: function mounted() {
|
|
@@ -13025,7 +13033,18 @@ n(css, {});function normalizeComponent (
|
|
|
13025
13033
|
return this.paginationIndexStart + this.pagination.per_page;
|
|
13026
13034
|
},
|
|
13027
13035
|
finalFilters: function finalFilters() {
|
|
13028
|
-
return [].concat(_toConsumableArray$1(this.filters), _toConsumableArray$1(this.filter), _toConsumableArray$1(this.internalFilter));
|
|
13036
|
+
return [].concat(_toConsumableArray$1(this.filters), _toConsumableArray$1(this.filter), _toConsumableArray$1(this.internalFilter), _toConsumableArray$1(this.sortFilter));
|
|
13037
|
+
},
|
|
13038
|
+
sortFilter: function sortFilter() {
|
|
13039
|
+
if (this.showPrincipalSortBtn) {
|
|
13040
|
+
if (this.principalSort) {
|
|
13041
|
+
return [[this.principalSortColumn, 'SORTASC', '']];
|
|
13042
|
+
} else {
|
|
13043
|
+
return [[this.principalSortColumn, 'SORTDESC', '']];
|
|
13044
|
+
}
|
|
13045
|
+
} else {
|
|
13046
|
+
return [];
|
|
13047
|
+
}
|
|
13029
13048
|
},
|
|
13030
13049
|
internalFilter: function internalFilter() {
|
|
13031
13050
|
var filter = [];
|
|
@@ -13052,6 +13071,13 @@ n(css, {});function normalizeComponent (
|
|
|
13052
13071
|
// Actualizar isMobile cuando cambia el tamaño de la pantalla
|
|
13053
13072
|
this.isMobile = window.matchMedia("(max-width: 1024px)").matches;
|
|
13054
13073
|
},
|
|
13074
|
+
togglePrincipalSort: function togglePrincipalSort() {
|
|
13075
|
+
var _this2 = this;
|
|
13076
|
+
this.principalSort = !this.principalSort;
|
|
13077
|
+
setTimeout(function () {
|
|
13078
|
+
_this2.refresh();
|
|
13079
|
+
}, 1);
|
|
13080
|
+
},
|
|
13055
13081
|
infiniteHandler: function infiniteHandler($state) {
|
|
13056
13082
|
var hasNextPage = (this.pagination.total > 0 || !this.firstLoad) && (!this.firstLoad || this.pagination.current_page * this.pagination.per_page <= this.pagination.total);
|
|
13057
13083
|
console.debug("Has next page", hasNextPage, this.pagination);
|
|
@@ -13085,30 +13111,30 @@ n(css, {});function normalizeComponent (
|
|
|
13085
13111
|
this.$emit("draggableChange", event);
|
|
13086
13112
|
},
|
|
13087
13113
|
setupFilters: function setupFilters() {
|
|
13088
|
-
var
|
|
13114
|
+
var _this3 = this;
|
|
13089
13115
|
this.columns.forEach(function (column) {
|
|
13090
|
-
if (
|
|
13116
|
+
if (_this3.isColumnHasFilter(column)) {
|
|
13091
13117
|
if (column.type == "date") {
|
|
13092
|
-
|
|
13118
|
+
_this3.internalFilters.push({
|
|
13093
13119
|
column: column.prop + "_from",
|
|
13094
13120
|
op: column.filterOp ? column.filterOp : "=",
|
|
13095
13121
|
value: null
|
|
13096
13122
|
});
|
|
13097
|
-
|
|
13123
|
+
_this3.internalFilters.push({
|
|
13098
13124
|
column: column.prop + "_to",
|
|
13099
13125
|
op: column.filterOp ? column.filterOp : "=",
|
|
13100
13126
|
value: null
|
|
13101
13127
|
});
|
|
13102
13128
|
} else {
|
|
13103
|
-
|
|
13129
|
+
_this3.internalFilters.push({
|
|
13104
13130
|
column: column.prop,
|
|
13105
13131
|
op: column.filterOp ? column.filterOp : "=",
|
|
13106
13132
|
value: null
|
|
13107
13133
|
});
|
|
13108
13134
|
}
|
|
13109
13135
|
}
|
|
13110
|
-
if (
|
|
13111
|
-
|
|
13136
|
+
if (_this3.sortable) {
|
|
13137
|
+
_this3.internalFilters.push({
|
|
13112
13138
|
column: column.prop + "_sort",
|
|
13113
13139
|
op: column.filterOp ? column.filterOp : "=",
|
|
13114
13140
|
value: null
|
|
@@ -13135,14 +13161,14 @@ n(css, {});function normalizeComponent (
|
|
|
13135
13161
|
}
|
|
13136
13162
|
},
|
|
13137
13163
|
resetFilters: function resetFilters() {
|
|
13138
|
-
var
|
|
13164
|
+
var _this4 = this;
|
|
13139
13165
|
var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
13140
13166
|
this.internalFilters = [];
|
|
13141
13167
|
this.setupFilters();
|
|
13142
13168
|
this.forceRecomputeCounter++;
|
|
13143
13169
|
if (refresh) {
|
|
13144
13170
|
setTimeout(function () {
|
|
13145
|
-
|
|
13171
|
+
_this4.refresh();
|
|
13146
13172
|
}, 1);
|
|
13147
13173
|
}
|
|
13148
13174
|
},
|
|
@@ -13164,12 +13190,12 @@ n(css, {});function normalizeComponent (
|
|
|
13164
13190
|
}
|
|
13165
13191
|
},
|
|
13166
13192
|
onSort: function onSort() {
|
|
13167
|
-
var
|
|
13193
|
+
var _this5 = this;
|
|
13168
13194
|
var event = {};
|
|
13169
13195
|
var i = 1 + (this.pagination.current_page * this.pagination.per_page - this.pagination.per_page);
|
|
13170
13196
|
this.items.forEach(function (item, index) {
|
|
13171
13197
|
//console.debug(s, i);
|
|
13172
|
-
item[
|
|
13198
|
+
item[_this5.orderProp] = i;
|
|
13173
13199
|
i++;
|
|
13174
13200
|
});
|
|
13175
13201
|
this.$emit("sort", event);
|
|
@@ -13188,14 +13214,14 @@ n(css, {});function normalizeComponent (
|
|
|
13188
13214
|
}
|
|
13189
13215
|
},
|
|
13190
13216
|
selectItem: function selectItem() {
|
|
13191
|
-
var
|
|
13217
|
+
var _this6 = this;
|
|
13192
13218
|
var sitem = this.selectedItems.find(function (e) {
|
|
13193
|
-
return e.id ==
|
|
13219
|
+
return e.id == _this6.item.id;
|
|
13194
13220
|
});
|
|
13195
13221
|
if (sitem) {
|
|
13196
13222
|
this.item.selected = false;
|
|
13197
13223
|
this.selectedItems = this.selectedItems.filter(function (e) {
|
|
13198
|
-
return e.id !=
|
|
13224
|
+
return e.id != _this6.item.id;
|
|
13199
13225
|
});
|
|
13200
13226
|
} else {
|
|
13201
13227
|
this.item.selected = true;
|
|
@@ -13203,16 +13229,16 @@ n(css, {});function normalizeComponent (
|
|
|
13203
13229
|
}
|
|
13204
13230
|
},
|
|
13205
13231
|
externalUpdate: function externalUpdate(itemsUpdate) {
|
|
13206
|
-
var
|
|
13232
|
+
var _this7 = this;
|
|
13207
13233
|
var addIfNotExist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
13208
13234
|
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
|
|
13209
13235
|
itemsUpdate.forEach(function (itemUpdate) {
|
|
13210
|
-
var itemInList =
|
|
13236
|
+
var itemInList = _this7.items.find(function (item) {
|
|
13211
13237
|
return item[key] === itemUpdate[key];
|
|
13212
13238
|
});
|
|
13213
13239
|
if (itemInList) Object.assign(itemInList, itemUpdate);else {
|
|
13214
13240
|
if (addIfNotExist) {
|
|
13215
|
-
|
|
13241
|
+
_this7.items.push(itemUpdate);
|
|
13216
13242
|
}
|
|
13217
13243
|
}
|
|
13218
13244
|
});
|
|
@@ -13260,7 +13286,7 @@ n(css, {});function normalizeComponent (
|
|
|
13260
13286
|
this.$bvModal.show("modal-form-item-" + this.modelName);
|
|
13261
13287
|
},
|
|
13262
13288
|
refresh: function refresh() {
|
|
13263
|
-
var
|
|
13289
|
+
var _this8 = this;
|
|
13264
13290
|
this.$emit("refresh", {});
|
|
13265
13291
|
if (!this.ajax) {
|
|
13266
13292
|
return;
|
|
@@ -13273,13 +13299,13 @@ n(css, {});function normalizeComponent (
|
|
|
13273
13299
|
if (this.infiniteScroll && fetchPromise) {
|
|
13274
13300
|
this.refreshing = true;
|
|
13275
13301
|
fetchPromise.then(function () {
|
|
13276
|
-
var infiniteLoadingRef =
|
|
13302
|
+
var infiniteLoadingRef = _this8.$refs.infiniteLoading;
|
|
13277
13303
|
if (infiniteLoadingRef) {
|
|
13278
13304
|
infiniteLoadingRef.stateChanger.reset();
|
|
13279
13305
|
} else {
|
|
13280
13306
|
console.debug("infiniteLoadingRef not set");
|
|
13281
13307
|
}
|
|
13282
|
-
|
|
13308
|
+
_this8.refreshing = false;
|
|
13283
13309
|
});
|
|
13284
13310
|
}
|
|
13285
13311
|
},
|
|
@@ -13287,45 +13313,45 @@ n(css, {});function normalizeComponent (
|
|
|
13287
13313
|
return column && !column.hideFilter && column.type != "actions";
|
|
13288
13314
|
},
|
|
13289
13315
|
setFilter: function setFilter(column, value) {
|
|
13290
|
-
var
|
|
13316
|
+
var _this9 = this;
|
|
13291
13317
|
var filter = this.filter.find(function (f) {
|
|
13292
13318
|
return f.column == column;
|
|
13293
13319
|
});
|
|
13294
13320
|
filter.value = value;
|
|
13295
13321
|
this.forceRecomputeCounter++;
|
|
13296
13322
|
setTimeout(function () {
|
|
13297
|
-
|
|
13323
|
+
_this9.refresh();
|
|
13298
13324
|
}, 1);
|
|
13299
13325
|
},
|
|
13300
13326
|
fetchItemsVuex: function fetchItemsVuex() {
|
|
13301
13327
|
var _arguments = arguments,
|
|
13302
|
-
|
|
13328
|
+
_this10 = this;
|
|
13303
13329
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
13304
13330
|
var page, result, itemsResult;
|
|
13305
13331
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13306
13332
|
while (1) switch (_context.prev = _context.next) {
|
|
13307
13333
|
case 0:
|
|
13308
13334
|
page = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : 1;
|
|
13309
|
-
|
|
13310
|
-
|
|
13311
|
-
|
|
13335
|
+
_this10.loading = true;
|
|
13336
|
+
_this10.$emit("beforeFetch", {});
|
|
13337
|
+
_this10.model.deleteAll();
|
|
13312
13338
|
_context.next = 7;
|
|
13313
|
-
return
|
|
13339
|
+
return _this10.model.api().get('', {
|
|
13314
13340
|
params: {
|
|
13315
13341
|
page: page,
|
|
13316
|
-
limit:
|
|
13317
|
-
filters: JSON.stringify(
|
|
13342
|
+
limit: _this10.pagination.perPage,
|
|
13343
|
+
filters: JSON.stringify(_this10.finalFilters)
|
|
13318
13344
|
}
|
|
13319
13345
|
});
|
|
13320
13346
|
case 7:
|
|
13321
13347
|
result = _context.sent;
|
|
13322
|
-
itemsResult =
|
|
13348
|
+
itemsResult = _this10.model.query().withAll().get(); //let itemsResult = result.entities[this.model.entity];
|
|
13323
13349
|
if (itemsResult) {
|
|
13324
|
-
|
|
13350
|
+
_this10.items = itemsResult;
|
|
13325
13351
|
}
|
|
13326
|
-
console.debug("fetch page vuex ", itemsResult, page,
|
|
13327
|
-
|
|
13328
|
-
|
|
13352
|
+
console.debug("fetch page vuex ", itemsResult, page, _this10.items, result);
|
|
13353
|
+
_this10.loading = false;
|
|
13354
|
+
_this10.firstLoad = true;
|
|
13329
13355
|
case 13:
|
|
13330
13356
|
case "end":
|
|
13331
13357
|
return _context.stop();
|
|
@@ -13334,7 +13360,7 @@ n(css, {});function normalizeComponent (
|
|
|
13334
13360
|
}))();
|
|
13335
13361
|
},
|
|
13336
13362
|
fetchItems: function fetchItems() {
|
|
13337
|
-
var
|
|
13363
|
+
var _this11 = this;
|
|
13338
13364
|
var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
13339
13365
|
var concat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
13340
13366
|
if (!this.ajax) {
|
|
@@ -13352,14 +13378,14 @@ n(css, {});function normalizeComponent (
|
|
|
13352
13378
|
filters: JSON.stringify(this.finalFilters)
|
|
13353
13379
|
}
|
|
13354
13380
|
}).then(function (response) {
|
|
13355
|
-
|
|
13381
|
+
_this11.makePagination(response.data);
|
|
13356
13382
|
var items = response.data.data;
|
|
13357
|
-
if (
|
|
13383
|
+
if (_this11.grouped) {
|
|
13358
13384
|
var itemswithgroup = [];
|
|
13359
13385
|
var lastcomparevalue = null;
|
|
13360
|
-
var compareattr =
|
|
13361
|
-
var groupLabelPre =
|
|
13362
|
-
var groupLabelAfter =
|
|
13386
|
+
var compareattr = _this11.groupedAttribute;
|
|
13387
|
+
var groupLabelPre = _this11.groupedLabelPre;
|
|
13388
|
+
var groupLabelAfter = _this11.groupedLabelAfter;
|
|
13363
13389
|
items.forEach(function (item, key) {
|
|
13364
13390
|
if (Array.isArray(item)) {
|
|
13365
13391
|
itemswithgroup.push({
|
|
@@ -13381,30 +13407,30 @@ n(css, {});function normalizeComponent (
|
|
|
13381
13407
|
}
|
|
13382
13408
|
});
|
|
13383
13409
|
if (concat) {
|
|
13384
|
-
|
|
13410
|
+
_this11.items = _this11.items.concat(itemswithgroup);
|
|
13385
13411
|
} else {
|
|
13386
|
-
|
|
13412
|
+
_this11.items = itemswithgroup;
|
|
13387
13413
|
}
|
|
13388
13414
|
} else {
|
|
13389
13415
|
if (concat) {
|
|
13390
|
-
|
|
13416
|
+
_this11.items = _this11.items.concat(items);
|
|
13391
13417
|
} else {
|
|
13392
|
-
|
|
13418
|
+
_this11.items = items;
|
|
13393
13419
|
}
|
|
13394
13420
|
}
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13421
|
+
_this11.loading = false;
|
|
13422
|
+
_this11.firstLoad = true;
|
|
13423
|
+
_this11.$emit("afterFetch", {});
|
|
13398
13424
|
}).catch(function (error) {
|
|
13399
13425
|
//console.debug(error);
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13426
|
+
_this11.toastError(error);
|
|
13427
|
+
_this11.loading = false;
|
|
13428
|
+
_this11.firstLoad = true;
|
|
13429
|
+
_this11.fetchError = true;
|
|
13404
13430
|
});
|
|
13405
13431
|
},
|
|
13406
13432
|
removeItem: function removeItem(id, index) {
|
|
13407
|
-
var
|
|
13433
|
+
var _this12 = this;
|
|
13408
13434
|
this.$bvModal.msgBoxConfirm(this.messageRemoveConfirm, {
|
|
13409
13435
|
size: "sm",
|
|
13410
13436
|
buttonSize: "sm",
|
|
@@ -13414,15 +13440,15 @@ n(css, {});function normalizeComponent (
|
|
|
13414
13440
|
centered: true
|
|
13415
13441
|
}).then(function (value) {
|
|
13416
13442
|
if (value) {
|
|
13417
|
-
|
|
13443
|
+
_this12.deleteItem(id, index);
|
|
13418
13444
|
}
|
|
13419
13445
|
}).catch(function (error) {
|
|
13420
|
-
|
|
13421
|
-
|
|
13446
|
+
_this12.toastError(error);
|
|
13447
|
+
_this12.loading = false;
|
|
13422
13448
|
});
|
|
13423
13449
|
},
|
|
13424
13450
|
deleteItem: function deleteItem(id, index) {
|
|
13425
|
-
var
|
|
13451
|
+
var _this13 = this;
|
|
13426
13452
|
if (this.useVuexORM) {
|
|
13427
13453
|
return this.deleteItemVuex(id, index);
|
|
13428
13454
|
}
|
|
@@ -13431,17 +13457,17 @@ n(css, {});function normalizeComponent (
|
|
|
13431
13457
|
}
|
|
13432
13458
|
this.loading = true;
|
|
13433
13459
|
axios.delete(this.apiUrl + "/" + this.modelName + "/" + id).then(function (response) {
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13460
|
+
_this13.items.splice(index, 1);
|
|
13461
|
+
_this13.toastSuccess("Elemento eliminado.");
|
|
13462
|
+
_this13.$emit("itemDeleted", {});
|
|
13463
|
+
_this13.loading = false;
|
|
13438
13464
|
}).catch(function (error) {
|
|
13439
|
-
|
|
13440
|
-
|
|
13465
|
+
_this13.toastError(error);
|
|
13466
|
+
_this13.loading = false;
|
|
13441
13467
|
});
|
|
13442
13468
|
},
|
|
13443
13469
|
deleteItemLocal: function deleteItemLocal(id, index) {
|
|
13444
|
-
var
|
|
13470
|
+
var _this14 = this;
|
|
13445
13471
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
13446
13472
|
var itemIndex;
|
|
13447
13473
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -13449,24 +13475,24 @@ n(css, {});function normalizeComponent (
|
|
|
13449
13475
|
case 0:
|
|
13450
13476
|
if (id || index) {
|
|
13451
13477
|
if (id) {
|
|
13452
|
-
itemIndex =
|
|
13453
|
-
return item.id ==
|
|
13478
|
+
itemIndex = _this14.items.findIndex(function (item) {
|
|
13479
|
+
return item.id == _this14.item.id;
|
|
13454
13480
|
});
|
|
13455
13481
|
} else {
|
|
13456
13482
|
itemIndex = index;
|
|
13457
13483
|
}
|
|
13458
13484
|
|
|
13459
13485
|
// Assuming this.items is an array
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13486
|
+
_this14.items.splice(itemIndex, 1);
|
|
13487
|
+
_this14.item = null;
|
|
13488
|
+
_this14.toastSuccess("Elemento Eliminado");
|
|
13489
|
+
_this14.$emit("itemDeleted", {});
|
|
13464
13490
|
} else {
|
|
13465
13491
|
// Handle the case where there's no item.id or item.index
|
|
13466
13492
|
console.error("Cannot delete item without ID or index");
|
|
13467
13493
|
// You might want to show an error message or handle it in a way that fits your application.
|
|
13468
13494
|
}
|
|
13469
|
-
|
|
13495
|
+
_this14.loading = false;
|
|
13470
13496
|
case 2:
|
|
13471
13497
|
case "end":
|
|
13472
13498
|
return _context2.stop();
|
|
@@ -13475,14 +13501,14 @@ n(css, {});function normalizeComponent (
|
|
|
13475
13501
|
}))();
|
|
13476
13502
|
},
|
|
13477
13503
|
deleteItemVuex: function deleteItemVuex(id, index) {
|
|
13478
|
-
var
|
|
13504
|
+
var _this15 = this;
|
|
13479
13505
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
13480
13506
|
var result;
|
|
13481
13507
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
13482
13508
|
while (1) switch (_context3.prev = _context3.next) {
|
|
13483
13509
|
case 0:
|
|
13484
13510
|
_context3.next = 2;
|
|
13485
|
-
return
|
|
13511
|
+
return _this15.model.api().delete('/' + id, {
|
|
13486
13512
|
delete: 1
|
|
13487
13513
|
});
|
|
13488
13514
|
case 2:
|
|
@@ -13493,11 +13519,11 @@ n(css, {});function normalizeComponent (
|
|
|
13493
13519
|
_context3.next = 9;
|
|
13494
13520
|
break;
|
|
13495
13521
|
}
|
|
13496
|
-
|
|
13497
|
-
|
|
13522
|
+
_this15.toastError(result.response.data.error);
|
|
13523
|
+
_this15.loading = false;
|
|
13498
13524
|
return _context3.abrupt("return");
|
|
13499
13525
|
case 9:
|
|
13500
|
-
|
|
13526
|
+
_this15.toastSuccess("Elemento eliminado.");
|
|
13501
13527
|
case 10:
|
|
13502
13528
|
case "end":
|
|
13503
13529
|
return _context3.stop();
|
|
@@ -13506,14 +13532,14 @@ n(css, {});function normalizeComponent (
|
|
|
13506
13532
|
}))();
|
|
13507
13533
|
},
|
|
13508
13534
|
saveSort: function saveSort() {
|
|
13509
|
-
var
|
|
13535
|
+
var _this16 = this;
|
|
13510
13536
|
if (this.orderable) {
|
|
13511
13537
|
this.loading = true;
|
|
13512
13538
|
var order = [];
|
|
13513
13539
|
this.items.forEach(function (v, k) {
|
|
13514
13540
|
order.push({
|
|
13515
13541
|
id: v.id,
|
|
13516
|
-
order: v[
|
|
13542
|
+
order: v[_this16.orderProp]
|
|
13517
13543
|
});
|
|
13518
13544
|
});
|
|
13519
13545
|
if (!this.ajax) {
|
|
@@ -13523,18 +13549,18 @@ n(css, {});function normalizeComponent (
|
|
|
13523
13549
|
order: order
|
|
13524
13550
|
}).then(function (response) {
|
|
13525
13551
|
response.data;
|
|
13526
|
-
|
|
13527
|
-
if (
|
|
13528
|
-
|
|
13552
|
+
_this16.toastSuccess("Orden Actualizado");
|
|
13553
|
+
if (_this16.refreshAfterSave) _this16.refresh();
|
|
13554
|
+
_this16.loading = false;
|
|
13529
13555
|
}).catch(function (error) {
|
|
13530
13556
|
//console.debug(error);
|
|
13531
|
-
|
|
13532
|
-
|
|
13557
|
+
_this16.toastError(error);
|
|
13558
|
+
_this16.loading = false;
|
|
13533
13559
|
});
|
|
13534
13560
|
}
|
|
13535
13561
|
},
|
|
13536
13562
|
getArrayValue: function getArrayValue(value, displayProp) {
|
|
13537
|
-
var
|
|
13563
|
+
var _this17 = this;
|
|
13538
13564
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
13539
13565
|
if (!Array.isArray(value)) return "N/A";
|
|
13540
13566
|
var values = [];
|
|
@@ -13551,7 +13577,7 @@ n(css, {});function normalizeComponent (
|
|
|
13551
13577
|
return "";
|
|
13552
13578
|
}
|
|
13553
13579
|
values.forEach(function (val) {
|
|
13554
|
-
valuesFinal.push(
|
|
13580
|
+
valuesFinal.push(_this17.getStateValue(val, options));
|
|
13555
13581
|
});
|
|
13556
13582
|
return values.join(",");
|
|
13557
13583
|
},
|
|
@@ -13573,22 +13599,22 @@ n(css, {});function normalizeComponent (
|
|
|
13573
13599
|
return ops.join(", ");
|
|
13574
13600
|
},
|
|
13575
13601
|
saveItemVuex: function saveItemVuex() {
|
|
13576
|
-
var
|
|
13602
|
+
var _this18 = this;
|
|
13577
13603
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
13578
13604
|
var jsondata, result, create;
|
|
13579
13605
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
13580
13606
|
while (1) switch (_context4.prev = _context4.next) {
|
|
13581
13607
|
case 0:
|
|
13582
|
-
console.debug("save item 1",
|
|
13583
|
-
jsondata =
|
|
13584
|
-
console.debug("save item 2",
|
|
13608
|
+
console.debug("save item 1", _this18.item);
|
|
13609
|
+
jsondata = _this18.item.$toJson();
|
|
13610
|
+
console.debug("save item 2", _this18.item, jsondata);
|
|
13585
13611
|
create = false;
|
|
13586
|
-
if (!
|
|
13612
|
+
if (!_this18.item.id) {
|
|
13587
13613
|
_context4.next = 12;
|
|
13588
13614
|
break;
|
|
13589
13615
|
}
|
|
13590
13616
|
_context4.next = 8;
|
|
13591
|
-
return
|
|
13617
|
+
return _this18.model.api().put('/' + _this18.item.id, jsondata);
|
|
13592
13618
|
case 8:
|
|
13593
13619
|
result = _context4.sent;
|
|
13594
13620
|
create = false;
|
|
@@ -13596,7 +13622,7 @@ n(css, {});function normalizeComponent (
|
|
|
13596
13622
|
break;
|
|
13597
13623
|
case 12:
|
|
13598
13624
|
_context4.next = 14;
|
|
13599
|
-
return
|
|
13625
|
+
return _this18.model.api().post('', jsondata);
|
|
13600
13626
|
case 14:
|
|
13601
13627
|
result = _context4.sent;
|
|
13602
13628
|
create = true;
|
|
@@ -13606,16 +13632,16 @@ n(css, {});function normalizeComponent (
|
|
|
13606
13632
|
_context4.next = 21;
|
|
13607
13633
|
break;
|
|
13608
13634
|
}
|
|
13609
|
-
|
|
13610
|
-
|
|
13635
|
+
_this18.toastError(result.response.data.error);
|
|
13636
|
+
_this18.loading = false;
|
|
13611
13637
|
return _context4.abrupt("return");
|
|
13612
13638
|
case 21:
|
|
13613
13639
|
result.save();
|
|
13614
|
-
if (
|
|
13615
|
-
|
|
13616
|
-
|
|
13617
|
-
if (
|
|
13618
|
-
|
|
13640
|
+
if (_this18.refreshAfterSave) _this18.refresh();
|
|
13641
|
+
_this18.loading = false;
|
|
13642
|
+
_this18.toastSuccess("Elemento Modificado");
|
|
13643
|
+
if (_this18.hideModalAfterSave || create && _this18.hideModalAfterCreate || !create && _this18.hideModalAfterUpdate) {
|
|
13644
|
+
_this18.$bvModal.hide("modal-form-item-" + _this18.modelName);
|
|
13619
13645
|
}
|
|
13620
13646
|
case 26:
|
|
13621
13647
|
case "end":
|
|
@@ -13625,36 +13651,36 @@ n(css, {});function normalizeComponent (
|
|
|
13625
13651
|
}))();
|
|
13626
13652
|
},
|
|
13627
13653
|
saveItemLocal: function saveItemLocal() {
|
|
13628
|
-
var
|
|
13654
|
+
var _this19 = this;
|
|
13629
13655
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
13630
13656
|
var itemSave, itemIndex;
|
|
13631
13657
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
13632
13658
|
while (1) switch (_context5.prev = _context5.next) {
|
|
13633
13659
|
case 0:
|
|
13634
|
-
itemSave = JSON.parse(JSON.stringify(
|
|
13635
|
-
if (
|
|
13636
|
-
if (
|
|
13637
|
-
itemIndex =
|
|
13638
|
-
return item.id ==
|
|
13660
|
+
itemSave = JSON.parse(JSON.stringify(_this19.item));
|
|
13661
|
+
if (_this19.item.id || _this19.item.index) {
|
|
13662
|
+
if (_this19.item.id) {
|
|
13663
|
+
itemIndex = _this19.items.findIndex(function (item) {
|
|
13664
|
+
return item.id == _this19.item.id;
|
|
13639
13665
|
});
|
|
13640
13666
|
} else {
|
|
13641
|
-
itemIndex =
|
|
13642
|
-
return item.index ==
|
|
13667
|
+
itemIndex = _this19.items.findIndex(function (item) {
|
|
13668
|
+
return item.index == _this19.item.index;
|
|
13643
13669
|
});
|
|
13644
13670
|
}
|
|
13645
|
-
|
|
13646
|
-
if (
|
|
13647
|
-
|
|
13671
|
+
_this19.items[itemIndex] = itemSave;
|
|
13672
|
+
if (_this19.hideModalAfterSave || _this19.hideModalAfterUpdate) {
|
|
13673
|
+
_this19.$bvModal.hide("modal-form-item-" + _this19.modelName);
|
|
13648
13674
|
}
|
|
13649
13675
|
} else {
|
|
13650
|
-
itemSave.index =
|
|
13651
|
-
|
|
13652
|
-
if (
|
|
13653
|
-
|
|
13676
|
+
itemSave.index = _this19.items.length + 1;
|
|
13677
|
+
_this19.items.push(itemSave);
|
|
13678
|
+
if (_this19.hideModalAfterSave || _this19.hideModalAfterCreate) {
|
|
13679
|
+
_this19.$bvModal.hide("modal-form-item-" + _this19.modelName);
|
|
13654
13680
|
}
|
|
13655
13681
|
}
|
|
13656
|
-
|
|
13657
|
-
|
|
13682
|
+
_this19.toastSuccess("Elemento Modificado");
|
|
13683
|
+
_this19.loading = false;
|
|
13658
13684
|
case 5:
|
|
13659
13685
|
case "end":
|
|
13660
13686
|
return _context5.stop();
|
|
@@ -13663,7 +13689,7 @@ n(css, {});function normalizeComponent (
|
|
|
13663
13689
|
}))();
|
|
13664
13690
|
},
|
|
13665
13691
|
loadOptions: function loadOptions() {
|
|
13666
|
-
var
|
|
13692
|
+
var _this20 = this;
|
|
13667
13693
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
13668
13694
|
var i, column, options;
|
|
13669
13695
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -13671,11 +13697,11 @@ n(css, {});function normalizeComponent (
|
|
|
13671
13697
|
case 0:
|
|
13672
13698
|
i = 0;
|
|
13673
13699
|
case 1:
|
|
13674
|
-
if (!(i <
|
|
13700
|
+
if (!(i < _this20.columns.length)) {
|
|
13675
13701
|
_context6.next = 12;
|
|
13676
13702
|
break;
|
|
13677
13703
|
}
|
|
13678
|
-
column =
|
|
13704
|
+
column = _this20.columns[i];
|
|
13679
13705
|
if (!(column.options instanceof Promise)) {
|
|
13680
13706
|
_context6.next = 9;
|
|
13681
13707
|
break;
|
|
@@ -13684,16 +13710,16 @@ n(css, {});function normalizeComponent (
|
|
|
13684
13710
|
return column.options;
|
|
13685
13711
|
case 6:
|
|
13686
13712
|
options = _context6.sent;
|
|
13687
|
-
|
|
13713
|
+
_this20.$set(_this20.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
|
|
13688
13714
|
options: options
|
|
13689
13715
|
}));
|
|
13690
|
-
console.debug("Options promise",
|
|
13716
|
+
console.debug("Options promise", _this20.columns);
|
|
13691
13717
|
case 9:
|
|
13692
13718
|
i++;
|
|
13693
13719
|
_context6.next = 1;
|
|
13694
13720
|
break;
|
|
13695
13721
|
case 12:
|
|
13696
|
-
|
|
13722
|
+
_this20.optionsLoaded = true;
|
|
13697
13723
|
case 13:
|
|
13698
13724
|
case "end":
|
|
13699
13725
|
return _context6.stop();
|
|
@@ -13703,25 +13729,25 @@ n(css, {});function normalizeComponent (
|
|
|
13703
13729
|
},
|
|
13704
13730
|
saveItem: function saveItem() {
|
|
13705
13731
|
var _arguments4 = arguments,
|
|
13706
|
-
|
|
13732
|
+
_this21 = this;
|
|
13707
13733
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
13708
13734
|
var event, validation_result, validation_error_message, formData;
|
|
13709
13735
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
13710
13736
|
while (1) switch (_context7.prev = _context7.next) {
|
|
13711
13737
|
case 0:
|
|
13712
13738
|
event = _arguments4.length > 0 && _arguments4[0] !== undefined ? _arguments4[0] : null;
|
|
13713
|
-
|
|
13714
|
-
if (!
|
|
13739
|
+
_this21.loading = true;
|
|
13740
|
+
if (!_this21.validate) {
|
|
13715
13741
|
_context7.next = 10;
|
|
13716
13742
|
break;
|
|
13717
13743
|
}
|
|
13718
13744
|
validation_result = true;
|
|
13719
|
-
validation_error_message =
|
|
13745
|
+
validation_error_message = _this21.messageDefaultValidationError;
|
|
13720
13746
|
if (validation_result) {
|
|
13721
13747
|
_context7.next = 8;
|
|
13722
13748
|
break;
|
|
13723
13749
|
}
|
|
13724
|
-
|
|
13750
|
+
_this21.toastError(validation_error_message);
|
|
13725
13751
|
return _context7.abrupt("return");
|
|
13726
13752
|
case 8:
|
|
13727
13753
|
_context7.next = 11;
|
|
@@ -13729,105 +13755,105 @@ n(css, {});function normalizeComponent (
|
|
|
13729
13755
|
case 10:
|
|
13730
13756
|
if (event) event.preventDefault();
|
|
13731
13757
|
case 11:
|
|
13732
|
-
if (!
|
|
13758
|
+
if (!_this21.useVuexORM) {
|
|
13733
13759
|
_context7.next = 13;
|
|
13734
13760
|
break;
|
|
13735
13761
|
}
|
|
13736
|
-
return _context7.abrupt("return",
|
|
13762
|
+
return _context7.abrupt("return", _this21.saveItemVuex(event));
|
|
13737
13763
|
case 13:
|
|
13738
|
-
if (
|
|
13764
|
+
if (_this21.ajax) {
|
|
13739
13765
|
_context7.next = 15;
|
|
13740
13766
|
break;
|
|
13741
13767
|
}
|
|
13742
|
-
return _context7.abrupt("return",
|
|
13768
|
+
return _context7.abrupt("return", _this21.saveItemLocal(event));
|
|
13743
13769
|
case 15:
|
|
13744
|
-
if (
|
|
13745
|
-
axios.put(
|
|
13746
|
-
if (
|
|
13747
|
-
|
|
13770
|
+
if (_this21.item.id) {
|
|
13771
|
+
axios.put(_this21.apiUrl + "/" + _this21.modelName + "/" + _this21.item.id, _this21.item).then(function (response) {
|
|
13772
|
+
if (_this21.hideModalAfterSave || _this21.hideModalAfterUpdate) {
|
|
13773
|
+
_this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
|
|
13748
13774
|
}
|
|
13749
13775
|
var itemSv = response.data;
|
|
13750
|
-
var itemIndex =
|
|
13751
|
-
return item.id ==
|
|
13776
|
+
var itemIndex = _this21.items.findIndex(function (item) {
|
|
13777
|
+
return item.id == _this21.item.id;
|
|
13752
13778
|
});
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
if (
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
item:
|
|
13779
|
+
_this21.items[itemIndex] = itemSv;
|
|
13780
|
+
_this21.item = itemSv;
|
|
13781
|
+
_this21.loading = false;
|
|
13782
|
+
if (_this21.refreshAfterSave) _this21.refresh();
|
|
13783
|
+
_this21.toastSuccess("Elemento Modificado");
|
|
13784
|
+
_this21.$emit("itemSaved", {
|
|
13785
|
+
item: _this21.item
|
|
13760
13786
|
});
|
|
13761
|
-
|
|
13762
|
-
item:
|
|
13787
|
+
_this21.$emit("itemUpdated", {
|
|
13788
|
+
item: _this21.item
|
|
13763
13789
|
});
|
|
13764
13790
|
}).catch(function (error) {
|
|
13765
|
-
|
|
13766
|
-
|
|
13791
|
+
_this21.toastError(error);
|
|
13792
|
+
_this21.loading = false;
|
|
13767
13793
|
});
|
|
13768
13794
|
} else {
|
|
13769
|
-
if (
|
|
13795
|
+
if (_this21.createMultipart) {
|
|
13770
13796
|
formData = new FormData();
|
|
13771
|
-
Object.keys(
|
|
13772
|
-
if (
|
|
13773
|
-
var files =
|
|
13797
|
+
Object.keys(_this21.item).forEach(function (key) {
|
|
13798
|
+
if (_this21.item[key][0] && _this21.item[key][0].name) {
|
|
13799
|
+
var files = _this21.item[key];
|
|
13774
13800
|
for (var x = 0; x < files.length; x++) {
|
|
13775
|
-
formData.append(key + "[]",
|
|
13801
|
+
formData.append(key + "[]", _this21.item[key][x], _this21.item[key][x].name);
|
|
13776
13802
|
}
|
|
13777
|
-
} else formData.append(key,
|
|
13803
|
+
} else formData.append(key, _this21.item[key]);
|
|
13778
13804
|
});
|
|
13779
|
-
axios.post(
|
|
13780
|
-
|
|
13781
|
-
if (
|
|
13782
|
-
|
|
13805
|
+
axios.post(_this21.apiUrl + "/" + _this21.modelName, formData).then(function (response) {
|
|
13806
|
+
_this21.loading = false;
|
|
13807
|
+
if (_this21.hideModalAfterSave || _this21.hideModalAfterCreate) {
|
|
13808
|
+
_this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
|
|
13783
13809
|
}
|
|
13784
13810
|
if (response.data.success) {
|
|
13785
13811
|
if (response.data.message) {
|
|
13786
|
-
|
|
13812
|
+
_this21.toastSuccess(response.data.message);
|
|
13787
13813
|
}
|
|
13788
13814
|
return;
|
|
13789
13815
|
}
|
|
13790
13816
|
var itemSv = response.data;
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
if (
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
item:
|
|
13817
|
+
_this21.items.push(itemSv);
|
|
13818
|
+
_this21.item = itemSv;
|
|
13819
|
+
if (_this21.refreshAfterSave) _this21.refresh();
|
|
13820
|
+
_this21.toastSuccess("Elemento Creado");
|
|
13821
|
+
_this21.$emit("itemSaved", {
|
|
13822
|
+
item: _this21.item
|
|
13797
13823
|
});
|
|
13798
|
-
|
|
13799
|
-
item:
|
|
13824
|
+
_this21.$emit("itemCreated", {
|
|
13825
|
+
item: _this21.item
|
|
13800
13826
|
});
|
|
13801
13827
|
}).catch(function (error) {
|
|
13802
|
-
|
|
13803
|
-
|
|
13828
|
+
_this21.toastError(error);
|
|
13829
|
+
_this21.loading = false;
|
|
13804
13830
|
});
|
|
13805
13831
|
} else {
|
|
13806
|
-
axios.post(
|
|
13807
|
-
|
|
13808
|
-
if (
|
|
13809
|
-
|
|
13832
|
+
axios.post(_this21.apiUrl + "/" + _this21.modelName, _this21.item).then(function (response) {
|
|
13833
|
+
_this21.loading = false;
|
|
13834
|
+
if (_this21.hideModalAfterSave || _this21.hideModalAfterUpdate) {
|
|
13835
|
+
_this21.$bvModal.hide("modal-form-item-" + _this21.modelName);
|
|
13810
13836
|
}
|
|
13811
13837
|
if (response.data.success) {
|
|
13812
13838
|
if (response.data.message) {
|
|
13813
|
-
|
|
13839
|
+
_this21.toastSuccess(response.data.message);
|
|
13814
13840
|
}
|
|
13815
13841
|
return;
|
|
13816
13842
|
}
|
|
13817
13843
|
var itemSv = response.data;
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
if (
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
item:
|
|
13844
|
+
_this21.items.push(itemSv);
|
|
13845
|
+
_this21.item = itemSv;
|
|
13846
|
+
if (_this21.refreshAfterSave) _this21.refresh();
|
|
13847
|
+
_this21.toastSuccess("Elemento Creado");
|
|
13848
|
+
_this21.$emit("itemSaved", {
|
|
13849
|
+
item: _this21.item
|
|
13824
13850
|
});
|
|
13825
|
-
|
|
13826
|
-
item:
|
|
13851
|
+
_this21.$emit("itemCreated", {
|
|
13852
|
+
item: _this21.item
|
|
13827
13853
|
});
|
|
13828
13854
|
}).catch(function (error) {
|
|
13829
|
-
|
|
13830
|
-
|
|
13855
|
+
_this21.toastError(error);
|
|
13856
|
+
_this21.loading = false;
|
|
13831
13857
|
});
|
|
13832
13858
|
}
|
|
13833
13859
|
}
|
|
@@ -13895,11 +13921,11 @@ n(css, {});function normalizeComponent (
|
|
|
13895
13921
|
});
|
|
13896
13922
|
},
|
|
13897
13923
|
onChangeFilter: function onChangeFilter(event) {
|
|
13898
|
-
var
|
|
13924
|
+
var _this22 = this;
|
|
13899
13925
|
this.forceRecomputeCounter++;
|
|
13900
13926
|
console.debug("Filters debug ", this.finalFilters, this.internalFilter, this.internalFilters, this.filter, this.filters);
|
|
13901
13927
|
setTimeout(function () {
|
|
13902
|
-
|
|
13928
|
+
_this22.refresh();
|
|
13903
13929
|
}, 1);
|
|
13904
13930
|
},
|
|
13905
13931
|
onPaginationChange: function onPaginationChange(page) {
|
|
@@ -14149,7 +14175,17 @@ var _sfc_render = function render() {
|
|
|
14149
14175
|
}, [_vm._t("tableActions", function () {
|
|
14150
14176
|
return [_vm._t("tableActionsPrepend", null, {
|
|
14151
14177
|
"loading": _vm.loading
|
|
14152
|
-
}), _vm.
|
|
14178
|
+
}), _vm.showPrincipalSortBtn ? _c('b-button', {
|
|
14179
|
+
attrs: {
|
|
14180
|
+
"variant": "success",
|
|
14181
|
+
"disabled": _vm.loading
|
|
14182
|
+
},
|
|
14183
|
+
on: {
|
|
14184
|
+
"click": function click($event) {
|
|
14185
|
+
return _vm.togglePrincipalSort();
|
|
14186
|
+
}
|
|
14187
|
+
}
|
|
14188
|
+
}, [_vm.principalSort ? _c('b-icon-sort-numeric-down') : _c('b-icon-sort-numeric-up')], 1) : _vm._e(), _vm.showCreateBtn ? _c('b-button', {
|
|
14153
14189
|
attrs: {
|
|
14154
14190
|
"variant": "success",
|
|
14155
14191
|
"disabled": _vm.loading
|
|
@@ -14578,12 +14614,12 @@ var _sfc_render = function render() {
|
|
|
14578
14614
|
}, [_c('masonry', {
|
|
14579
14615
|
attrs: {
|
|
14580
14616
|
"cols": {
|
|
14581
|
-
default: _vm.colLg,
|
|
14582
|
-
1400: _vm.colXl,
|
|
14583
|
-
1200: _vm.colLg,
|
|
14584
|
-
1000: _vm.colMd,
|
|
14585
|
-
700: _vm.colSm,
|
|
14586
|
-
400: _vm.colXs
|
|
14617
|
+
default: 12 / _vm.colLg,
|
|
14618
|
+
1400: 12 / _vm.colXl,
|
|
14619
|
+
1200: 12 / _vm.colLg,
|
|
14620
|
+
1000: 12 / _vm.colMd,
|
|
14621
|
+
700: 12 / _vm.colSm,
|
|
14622
|
+
400: 12 / _vm.colXs
|
|
14587
14623
|
},
|
|
14588
14624
|
"gutter": {
|
|
14589
14625
|
default: '15px',
|
|
@@ -14854,7 +14890,7 @@ var _sfc_render = function render() {
|
|
|
14854
14890
|
}) : _vm._e()], 2)], 1);
|
|
14855
14891
|
};
|
|
14856
14892
|
var _sfc_staticRenderFns = [];
|
|
14857
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14893
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "a4bec9a9", null, null);
|
|
14858
14894
|
var component$1 = __component__.exports;// Import vue component
|
|
14859
14895
|
|
|
14860
14896
|
// Default export is installable instance of component.
|