vue-laravel-crud 1.6.21 → 1.6.22
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 +138 -8
- package/dist/vue-laravel-crud.min.js +3 -3
- package/dist/vue-laravel-crud.ssr.js +245 -111
- package/package.json +1 -1
- package/src/vue-laravel-crud.vue +292 -184
|
@@ -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-c0990da7]:last-child,\ntr td[data-v-c0990da7]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-c0990da7] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-c0990da7] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-c0990da7] .crud-title[data-v-c0990da7] {\n margin: 0; }\n .crud-header[data-v-c0990da7] .crud-search[data-v-c0990da7] {\n max-width: 15rem; }\n .crud-header[data-v-c0990da7] .crud-search[data-v-c0990da7] .btn[data-v-c0990da7] {\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-c0990da7] .crud-search[data-v-c0990da7] .btn[data-v-c0990da7].open[data-v-c0990da7] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-c0990da7] .table-options[data-v-c0990da7] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-c0990da7] {\n position: relative; }\n\n@media (min-width: 992px) {\n .table[data-v-c0990da7] {\n table-layout: auto; }\n .table[data-v-c0990da7] tbody[data-v-c0990da7] td[data-v-c0990da7] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-c0990da7] tbody[data-v-c0990da7] td[data-v-c0990da7]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12536
12536
|
n(css, {});function normalizeComponent (
|
|
12537
12537
|
scriptExports,
|
|
12538
12538
|
render,
|
|
@@ -12879,6 +12879,14 @@ n(css, {});function normalizeComponent (
|
|
|
12879
12879
|
type: String,
|
|
12880
12880
|
default: "Nuevo"
|
|
12881
12881
|
},
|
|
12882
|
+
messageImport: {
|
|
12883
|
+
type: String,
|
|
12884
|
+
default: "Importar"
|
|
12885
|
+
},
|
|
12886
|
+
messageExport: {
|
|
12887
|
+
type: String,
|
|
12888
|
+
default: "Exportar"
|
|
12889
|
+
},
|
|
12882
12890
|
messageEmptyResults: {
|
|
12883
12891
|
type: String,
|
|
12884
12892
|
default: "No se han encontrado resultados"
|
|
@@ -12958,6 +12966,14 @@ n(css, {});function normalizeComponent (
|
|
|
12958
12966
|
bulkDelete: {
|
|
12959
12967
|
type: Boolean,
|
|
12960
12968
|
default: false
|
|
12969
|
+
},
|
|
12970
|
+
showImport: {
|
|
12971
|
+
type: Boolean,
|
|
12972
|
+
default: false
|
|
12973
|
+
},
|
|
12974
|
+
showExport: {
|
|
12975
|
+
type: Boolean,
|
|
12976
|
+
default: false
|
|
12961
12977
|
}
|
|
12962
12978
|
},
|
|
12963
12979
|
mounted: function mounted() {
|
|
@@ -13698,8 +13714,64 @@ n(css, {});function normalizeComponent (
|
|
|
13698
13714
|
});
|
|
13699
13715
|
}
|
|
13700
13716
|
},
|
|
13701
|
-
|
|
13717
|
+
exportItems: function exportItems() {
|
|
13702
13718
|
var _this20 = this;
|
|
13719
|
+
if (this.useVuexORM) {
|
|
13720
|
+
return;
|
|
13721
|
+
}
|
|
13722
|
+
if (!this.ajax) {
|
|
13723
|
+
return;
|
|
13724
|
+
}
|
|
13725
|
+
var exportItems = true;
|
|
13726
|
+
var params;
|
|
13727
|
+
var ids = this.selectedItems.map(function (it) {
|
|
13728
|
+
return it.id;
|
|
13729
|
+
});
|
|
13730
|
+
if (ids.length) {
|
|
13731
|
+
params = {
|
|
13732
|
+
ids: ids,
|
|
13733
|
+
exportItems: exportItems
|
|
13734
|
+
};
|
|
13735
|
+
} else {
|
|
13736
|
+
params = {
|
|
13737
|
+
filters: JSON.stringify(this.finalFilters),
|
|
13738
|
+
exportItems: exportItems
|
|
13739
|
+
};
|
|
13740
|
+
}
|
|
13741
|
+
this.loading = true;
|
|
13742
|
+
axios.delete(this.apiUrl + "/" + this.modelName + "/export", {
|
|
13743
|
+
params: params
|
|
13744
|
+
}).then(function (response) {
|
|
13745
|
+
_this20.downloadBlobResponse(response, extension);
|
|
13746
|
+
_this20.loading = false;
|
|
13747
|
+
}).catch(function (error) {
|
|
13748
|
+
_this20.toastError(error);
|
|
13749
|
+
_this20.loading = false;
|
|
13750
|
+
});
|
|
13751
|
+
},
|
|
13752
|
+
importItems: function importItems() {
|
|
13753
|
+
var _this21 = this;
|
|
13754
|
+
var formData = new FormData();
|
|
13755
|
+
formData.append("file", this.fileImport);
|
|
13756
|
+
axios.post(this.apiUrl + "/" + this.modelName + "/impport", formData, {
|
|
13757
|
+
headers: {
|
|
13758
|
+
"Content-Type": "multipart/form-data"
|
|
13759
|
+
}
|
|
13760
|
+
}).then(function (response) {
|
|
13761
|
+
if (response && response.data && response.data.success == true) {
|
|
13762
|
+
_this21.$refs["modal-import"].hide();
|
|
13763
|
+
_this21.toastSuccess("Datos Importados con Éxito");
|
|
13764
|
+
_this21.$refs["crud"].refresh();
|
|
13765
|
+
} else {
|
|
13766
|
+
_this21.toastError("No se pudo importar los datos.");
|
|
13767
|
+
}
|
|
13768
|
+
}).catch(function (error) {
|
|
13769
|
+
console.error(error);
|
|
13770
|
+
_this21.toastError(error);
|
|
13771
|
+
});
|
|
13772
|
+
},
|
|
13773
|
+
getArrayValue: function getArrayValue(value, displayProp) {
|
|
13774
|
+
var _this22 = this;
|
|
13703
13775
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
13704
13776
|
if (!Array.isArray(value)) return "N/A";
|
|
13705
13777
|
var values = [];
|
|
@@ -13716,7 +13788,7 @@ n(css, {});function normalizeComponent (
|
|
|
13716
13788
|
return "";
|
|
13717
13789
|
}
|
|
13718
13790
|
values.forEach(function (val) {
|
|
13719
|
-
valuesFinal.push(
|
|
13791
|
+
valuesFinal.push(_this22.getStateValue(val, options));
|
|
13720
13792
|
});
|
|
13721
13793
|
return values.join(",");
|
|
13722
13794
|
},
|
|
@@ -13738,22 +13810,22 @@ n(css, {});function normalizeComponent (
|
|
|
13738
13810
|
return ops.join(", ");
|
|
13739
13811
|
},
|
|
13740
13812
|
saveItemVuex: function saveItemVuex() {
|
|
13741
|
-
var
|
|
13813
|
+
var _this23 = this;
|
|
13742
13814
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
13743
13815
|
var jsondata, result, create;
|
|
13744
13816
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
13745
13817
|
while (1) switch (_context6.prev = _context6.next) {
|
|
13746
13818
|
case 0:
|
|
13747
|
-
console.debug("save item 1",
|
|
13748
|
-
jsondata =
|
|
13749
|
-
console.debug("save item 2",
|
|
13819
|
+
console.debug("save item 1", _this23.item);
|
|
13820
|
+
jsondata = _this23.item.$toJson();
|
|
13821
|
+
console.debug("save item 2", _this23.item, jsondata);
|
|
13750
13822
|
create = false;
|
|
13751
|
-
if (!
|
|
13823
|
+
if (!_this23.item.id) {
|
|
13752
13824
|
_context6.next = 12;
|
|
13753
13825
|
break;
|
|
13754
13826
|
}
|
|
13755
13827
|
_context6.next = 8;
|
|
13756
|
-
return
|
|
13828
|
+
return _this23.model.api().put('/' + _this23.item.id, jsondata);
|
|
13757
13829
|
case 8:
|
|
13758
13830
|
result = _context6.sent;
|
|
13759
13831
|
create = false;
|
|
@@ -13761,7 +13833,7 @@ n(css, {});function normalizeComponent (
|
|
|
13761
13833
|
break;
|
|
13762
13834
|
case 12:
|
|
13763
13835
|
_context6.next = 14;
|
|
13764
|
-
return
|
|
13836
|
+
return _this23.model.api().post('', jsondata);
|
|
13765
13837
|
case 14:
|
|
13766
13838
|
result = _context6.sent;
|
|
13767
13839
|
create = true;
|
|
@@ -13771,16 +13843,16 @@ n(css, {});function normalizeComponent (
|
|
|
13771
13843
|
_context6.next = 21;
|
|
13772
13844
|
break;
|
|
13773
13845
|
}
|
|
13774
|
-
|
|
13775
|
-
|
|
13846
|
+
_this23.toastError(result.response.data.error);
|
|
13847
|
+
_this23.loading = false;
|
|
13776
13848
|
return _context6.abrupt("return");
|
|
13777
13849
|
case 21:
|
|
13778
13850
|
result.save();
|
|
13779
|
-
if (
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
if (
|
|
13783
|
-
|
|
13851
|
+
if (_this23.refreshAfterSave) _this23.refresh();
|
|
13852
|
+
_this23.loading = false;
|
|
13853
|
+
_this23.toastSuccess("Elemento Modificado");
|
|
13854
|
+
if (_this23.hideModalAfterSave || create && _this23.hideModalAfterCreate || !create && _this23.hideModalAfterUpdate) {
|
|
13855
|
+
_this23.$bvModal.hide("modal-form-item-" + _this23.modelName);
|
|
13784
13856
|
}
|
|
13785
13857
|
case 26:
|
|
13786
13858
|
case "end":
|
|
@@ -13790,36 +13862,36 @@ n(css, {});function normalizeComponent (
|
|
|
13790
13862
|
}))();
|
|
13791
13863
|
},
|
|
13792
13864
|
saveItemLocal: function saveItemLocal() {
|
|
13793
|
-
var
|
|
13865
|
+
var _this24 = this;
|
|
13794
13866
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
13795
13867
|
var itemSave, itemIndex;
|
|
13796
13868
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
13797
13869
|
while (1) switch (_context7.prev = _context7.next) {
|
|
13798
13870
|
case 0:
|
|
13799
|
-
itemSave = JSON.parse(JSON.stringify(
|
|
13800
|
-
if (
|
|
13801
|
-
if (
|
|
13802
|
-
itemIndex =
|
|
13803
|
-
return item.id ==
|
|
13871
|
+
itemSave = JSON.parse(JSON.stringify(_this24.item));
|
|
13872
|
+
if (_this24.item.id || _this24.item.index) {
|
|
13873
|
+
if (_this24.item.id) {
|
|
13874
|
+
itemIndex = _this24.items.findIndex(function (item) {
|
|
13875
|
+
return item.id == _this24.item.id;
|
|
13804
13876
|
});
|
|
13805
13877
|
} else {
|
|
13806
|
-
itemIndex =
|
|
13807
|
-
return item.index ==
|
|
13878
|
+
itemIndex = _this24.items.findIndex(function (item) {
|
|
13879
|
+
return item.index == _this24.item.index;
|
|
13808
13880
|
});
|
|
13809
13881
|
}
|
|
13810
|
-
|
|
13811
|
-
if (
|
|
13812
|
-
|
|
13882
|
+
_this24.items[itemIndex] = itemSave;
|
|
13883
|
+
if (_this24.hideModalAfterSave || _this24.hideModalAfterUpdate) {
|
|
13884
|
+
_this24.$bvModal.hide("modal-form-item-" + _this24.modelName);
|
|
13813
13885
|
}
|
|
13814
13886
|
} else {
|
|
13815
|
-
itemSave.index =
|
|
13816
|
-
|
|
13817
|
-
if (
|
|
13818
|
-
|
|
13887
|
+
itemSave.index = _this24.items.length + 1;
|
|
13888
|
+
_this24.items.push(itemSave);
|
|
13889
|
+
if (_this24.hideModalAfterSave || _this24.hideModalAfterCreate) {
|
|
13890
|
+
_this24.$bvModal.hide("modal-form-item-" + _this24.modelName);
|
|
13819
13891
|
}
|
|
13820
13892
|
}
|
|
13821
|
-
|
|
13822
|
-
|
|
13893
|
+
_this24.toastSuccess("Elemento Modificado");
|
|
13894
|
+
_this24.loading = false;
|
|
13823
13895
|
case 5:
|
|
13824
13896
|
case "end":
|
|
13825
13897
|
return _context7.stop();
|
|
@@ -13828,7 +13900,7 @@ n(css, {});function normalizeComponent (
|
|
|
13828
13900
|
}))();
|
|
13829
13901
|
},
|
|
13830
13902
|
loadOptions: function loadOptions() {
|
|
13831
|
-
var
|
|
13903
|
+
var _this25 = this;
|
|
13832
13904
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
13833
13905
|
var i, column, options;
|
|
13834
13906
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -13836,11 +13908,11 @@ n(css, {});function normalizeComponent (
|
|
|
13836
13908
|
case 0:
|
|
13837
13909
|
i = 0;
|
|
13838
13910
|
case 1:
|
|
13839
|
-
if (!(i <
|
|
13911
|
+
if (!(i < _this25.columns.length)) {
|
|
13840
13912
|
_context8.next = 12;
|
|
13841
13913
|
break;
|
|
13842
13914
|
}
|
|
13843
|
-
column =
|
|
13915
|
+
column = _this25.columns[i];
|
|
13844
13916
|
if (!(column.options instanceof Promise)) {
|
|
13845
13917
|
_context8.next = 9;
|
|
13846
13918
|
break;
|
|
@@ -13849,16 +13921,16 @@ n(css, {});function normalizeComponent (
|
|
|
13849
13921
|
return column.options;
|
|
13850
13922
|
case 6:
|
|
13851
13923
|
options = _context8.sent;
|
|
13852
|
-
|
|
13924
|
+
_this25.$set(_this25.columns, i, _objectSpread2(_objectSpread2({}, column), {}, {
|
|
13853
13925
|
options: options
|
|
13854
13926
|
}));
|
|
13855
|
-
console.debug("Options promise",
|
|
13927
|
+
console.debug("Options promise", _this25.columns);
|
|
13856
13928
|
case 9:
|
|
13857
13929
|
i++;
|
|
13858
13930
|
_context8.next = 1;
|
|
13859
13931
|
break;
|
|
13860
13932
|
case 12:
|
|
13861
|
-
|
|
13933
|
+
_this25.optionsLoaded = true;
|
|
13862
13934
|
case 13:
|
|
13863
13935
|
case "end":
|
|
13864
13936
|
return _context8.stop();
|
|
@@ -13868,25 +13940,25 @@ n(css, {});function normalizeComponent (
|
|
|
13868
13940
|
},
|
|
13869
13941
|
saveItem: function saveItem() {
|
|
13870
13942
|
var _arguments4 = arguments,
|
|
13871
|
-
|
|
13943
|
+
_this26 = this;
|
|
13872
13944
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
13873
13945
|
var event, validation_result, validation_error_message, formData;
|
|
13874
13946
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
13875
13947
|
while (1) switch (_context9.prev = _context9.next) {
|
|
13876
13948
|
case 0:
|
|
13877
13949
|
event = _arguments4.length > 0 && _arguments4[0] !== undefined ? _arguments4[0] : null;
|
|
13878
|
-
|
|
13879
|
-
if (!
|
|
13950
|
+
_this26.loading = true;
|
|
13951
|
+
if (!_this26.validate) {
|
|
13880
13952
|
_context9.next = 10;
|
|
13881
13953
|
break;
|
|
13882
13954
|
}
|
|
13883
13955
|
validation_result = true;
|
|
13884
|
-
validation_error_message =
|
|
13956
|
+
validation_error_message = _this26.messageDefaultValidationError;
|
|
13885
13957
|
if (validation_result) {
|
|
13886
13958
|
_context9.next = 8;
|
|
13887
13959
|
break;
|
|
13888
13960
|
}
|
|
13889
|
-
|
|
13961
|
+
_this26.toastError(validation_error_message);
|
|
13890
13962
|
return _context9.abrupt("return");
|
|
13891
13963
|
case 8:
|
|
13892
13964
|
_context9.next = 11;
|
|
@@ -13894,105 +13966,105 @@ n(css, {});function normalizeComponent (
|
|
|
13894
13966
|
case 10:
|
|
13895
13967
|
if (event) event.preventDefault();
|
|
13896
13968
|
case 11:
|
|
13897
|
-
if (!
|
|
13969
|
+
if (!_this26.useVuexORM) {
|
|
13898
13970
|
_context9.next = 13;
|
|
13899
13971
|
break;
|
|
13900
13972
|
}
|
|
13901
|
-
return _context9.abrupt("return",
|
|
13973
|
+
return _context9.abrupt("return", _this26.saveItemVuex(event));
|
|
13902
13974
|
case 13:
|
|
13903
|
-
if (
|
|
13975
|
+
if (_this26.ajax) {
|
|
13904
13976
|
_context9.next = 15;
|
|
13905
13977
|
break;
|
|
13906
13978
|
}
|
|
13907
|
-
return _context9.abrupt("return",
|
|
13979
|
+
return _context9.abrupt("return", _this26.saveItemLocal(event));
|
|
13908
13980
|
case 15:
|
|
13909
|
-
if (
|
|
13910
|
-
axios.put(
|
|
13911
|
-
if (
|
|
13912
|
-
|
|
13981
|
+
if (_this26.item.id) {
|
|
13982
|
+
axios.put(_this26.apiUrl + "/" + _this26.modelName + "/" + _this26.item.id, _this26.item).then(function (response) {
|
|
13983
|
+
if (_this26.hideModalAfterSave || _this26.hideModalAfterUpdate) {
|
|
13984
|
+
_this26.$bvModal.hide("modal-form-item-" + _this26.modelName);
|
|
13913
13985
|
}
|
|
13914
13986
|
var itemSv = response.data;
|
|
13915
|
-
var itemIndex =
|
|
13916
|
-
return item.id ==
|
|
13987
|
+
var itemIndex = _this26.items.findIndex(function (item) {
|
|
13988
|
+
return item.id == _this26.item.id;
|
|
13917
13989
|
});
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
if (
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
item:
|
|
13990
|
+
_this26.items[itemIndex] = itemSv;
|
|
13991
|
+
_this26.item = itemSv;
|
|
13992
|
+
_this26.loading = false;
|
|
13993
|
+
if (_this26.refreshAfterSave) _this26.refresh();
|
|
13994
|
+
_this26.toastSuccess("Elemento Modificado");
|
|
13995
|
+
_this26.$emit("itemSaved", {
|
|
13996
|
+
item: _this26.item
|
|
13925
13997
|
});
|
|
13926
|
-
|
|
13927
|
-
item:
|
|
13998
|
+
_this26.$emit("itemUpdated", {
|
|
13999
|
+
item: _this26.item
|
|
13928
14000
|
});
|
|
13929
14001
|
}).catch(function (error) {
|
|
13930
|
-
|
|
13931
|
-
|
|
14002
|
+
_this26.toastError(error);
|
|
14003
|
+
_this26.loading = false;
|
|
13932
14004
|
});
|
|
13933
14005
|
} else {
|
|
13934
|
-
if (
|
|
14006
|
+
if (_this26.createMultipart) {
|
|
13935
14007
|
formData = new FormData();
|
|
13936
|
-
Object.keys(
|
|
13937
|
-
if (
|
|
13938
|
-
var files =
|
|
14008
|
+
Object.keys(_this26.item).forEach(function (key) {
|
|
14009
|
+
if (_this26.item[key][0] && _this26.item[key][0].name) {
|
|
14010
|
+
var files = _this26.item[key];
|
|
13939
14011
|
for (var x = 0; x < files.length; x++) {
|
|
13940
|
-
formData.append(key + "[]",
|
|
14012
|
+
formData.append(key + "[]", _this26.item[key][x], _this26.item[key][x].name);
|
|
13941
14013
|
}
|
|
13942
|
-
} else formData.append(key,
|
|
14014
|
+
} else formData.append(key, _this26.item[key]);
|
|
13943
14015
|
});
|
|
13944
|
-
axios.post(
|
|
13945
|
-
|
|
13946
|
-
if (
|
|
13947
|
-
|
|
14016
|
+
axios.post(_this26.apiUrl + "/" + _this26.modelName, formData).then(function (response) {
|
|
14017
|
+
_this26.loading = false;
|
|
14018
|
+
if (_this26.hideModalAfterSave || _this26.hideModalAfterCreate) {
|
|
14019
|
+
_this26.$bvModal.hide("modal-form-item-" + _this26.modelName);
|
|
13948
14020
|
}
|
|
13949
14021
|
if (response.data.success) {
|
|
13950
14022
|
if (response.data.message) {
|
|
13951
|
-
|
|
14023
|
+
_this26.toastSuccess(response.data.message);
|
|
13952
14024
|
}
|
|
13953
14025
|
return;
|
|
13954
14026
|
}
|
|
13955
14027
|
var itemSv = response.data;
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
if (
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
item:
|
|
14028
|
+
_this26.items.push(itemSv);
|
|
14029
|
+
_this26.item = itemSv;
|
|
14030
|
+
if (_this26.refreshAfterSave) _this26.refresh();
|
|
14031
|
+
_this26.toastSuccess("Elemento Creado");
|
|
14032
|
+
_this26.$emit("itemSaved", {
|
|
14033
|
+
item: _this26.item
|
|
13962
14034
|
});
|
|
13963
|
-
|
|
13964
|
-
item:
|
|
14035
|
+
_this26.$emit("itemCreated", {
|
|
14036
|
+
item: _this26.item
|
|
13965
14037
|
});
|
|
13966
14038
|
}).catch(function (error) {
|
|
13967
|
-
|
|
13968
|
-
|
|
14039
|
+
_this26.toastError(error);
|
|
14040
|
+
_this26.loading = false;
|
|
13969
14041
|
});
|
|
13970
14042
|
} else {
|
|
13971
|
-
axios.post(
|
|
13972
|
-
|
|
13973
|
-
if (
|
|
13974
|
-
|
|
14043
|
+
axios.post(_this26.apiUrl + "/" + _this26.modelName, _this26.item).then(function (response) {
|
|
14044
|
+
_this26.loading = false;
|
|
14045
|
+
if (_this26.hideModalAfterSave || _this26.hideModalAfterUpdate) {
|
|
14046
|
+
_this26.$bvModal.hide("modal-form-item-" + _this26.modelName);
|
|
13975
14047
|
}
|
|
13976
14048
|
if (response.data.success) {
|
|
13977
14049
|
if (response.data.message) {
|
|
13978
|
-
|
|
14050
|
+
_this26.toastSuccess(response.data.message);
|
|
13979
14051
|
}
|
|
13980
14052
|
return;
|
|
13981
14053
|
}
|
|
13982
14054
|
var itemSv = response.data;
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
if (
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
item:
|
|
14055
|
+
_this26.items.push(itemSv);
|
|
14056
|
+
_this26.item = itemSv;
|
|
14057
|
+
if (_this26.refreshAfterSave) _this26.refresh();
|
|
14058
|
+
_this26.toastSuccess("Elemento Creado");
|
|
14059
|
+
_this26.$emit("itemSaved", {
|
|
14060
|
+
item: _this26.item
|
|
13989
14061
|
});
|
|
13990
|
-
|
|
13991
|
-
item:
|
|
14062
|
+
_this26.$emit("itemCreated", {
|
|
14063
|
+
item: _this26.item
|
|
13992
14064
|
});
|
|
13993
14065
|
}).catch(function (error) {
|
|
13994
|
-
|
|
13995
|
-
|
|
14066
|
+
_this26.toastError(error);
|
|
14067
|
+
_this26.loading = false;
|
|
13996
14068
|
});
|
|
13997
14069
|
}
|
|
13998
14070
|
}
|
|
@@ -14060,11 +14132,11 @@ n(css, {});function normalizeComponent (
|
|
|
14060
14132
|
});
|
|
14061
14133
|
},
|
|
14062
14134
|
onChangeFilter: function onChangeFilter(event) {
|
|
14063
|
-
var
|
|
14135
|
+
var _this27 = this;
|
|
14064
14136
|
this.forceRecomputeCounter++;
|
|
14065
14137
|
console.debug("Filters debug ", this.finalFilters, this.internalFilter, this.internalFilters, this.filter, this.filters);
|
|
14066
14138
|
setTimeout(function () {
|
|
14067
|
-
|
|
14139
|
+
_this27.refresh();
|
|
14068
14140
|
}, 1);
|
|
14069
14141
|
},
|
|
14070
14142
|
onPaginationChange: function onPaginationChange(page) {
|
|
@@ -14169,7 +14241,7 @@ var _sfc_render = function render() {
|
|
|
14169
14241
|
callback: function callback($$v) {
|
|
14170
14242
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
14171
14243
|
},
|
|
14172
|
-
expression: "internalFilterByProp(column.prop + '_from').value\n
|
|
14244
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
14173
14245
|
}
|
|
14174
14246
|
})], 1), _c('div', {
|
|
14175
14247
|
staticClass: "col-6"
|
|
@@ -14185,7 +14257,7 @@ var _sfc_render = function render() {
|
|
|
14185
14257
|
callback: function callback($$v) {
|
|
14186
14258
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
14187
14259
|
},
|
|
14188
|
-
expression: "internalFilterByProp(column.prop + '_to').value\n
|
|
14260
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
14189
14261
|
}
|
|
14190
14262
|
})], 1)])]) : column.type == 'state' ? _c('div', {
|
|
14191
14263
|
staticClass: "form-group"
|
|
@@ -14314,7 +14386,27 @@ var _sfc_render = function render() {
|
|
|
14314
14386
|
}, [_vm._t("tableActions", function () {
|
|
14315
14387
|
return [_vm._t("tableActionsPrepend", null, {
|
|
14316
14388
|
"loading": _vm.loading
|
|
14317
|
-
}), _vm.
|
|
14389
|
+
}), _vm.showImport ? _c('b-button', {
|
|
14390
|
+
directives: [{
|
|
14391
|
+
name: "b-modal",
|
|
14392
|
+
rawName: "v-b-modal.modal-import",
|
|
14393
|
+
modifiers: {
|
|
14394
|
+
"modal-import": true
|
|
14395
|
+
}
|
|
14396
|
+
}],
|
|
14397
|
+
attrs: {
|
|
14398
|
+
"variant": "info"
|
|
14399
|
+
}
|
|
14400
|
+
}, [_c('b-icon-cloud-upload'), _vm._v(_vm._s(_vm.messageImport) + " ")], 1) : _vm._e(), _vm.showExport ? _c('b-button', {
|
|
14401
|
+
attrs: {
|
|
14402
|
+
"variant": "info"
|
|
14403
|
+
},
|
|
14404
|
+
on: {
|
|
14405
|
+
"click": function click($event) {
|
|
14406
|
+
return _vm.exportItems();
|
|
14407
|
+
}
|
|
14408
|
+
}
|
|
14409
|
+
}, [_c('b-icon-cloud-download'), _vm._v(_vm._s(_vm.messageExport) + " ")], 1) : _vm._e(), _vm.showPrincipalSortBtn ? _c('b-button', {
|
|
14318
14410
|
attrs: {
|
|
14319
14411
|
"variant": "info",
|
|
14320
14412
|
"disabled": _vm.loading
|
|
@@ -14476,7 +14568,7 @@ var _sfc_render = function render() {
|
|
|
14476
14568
|
callback: function callback($$v) {
|
|
14477
14569
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_from'), "value", $$v);
|
|
14478
14570
|
},
|
|
14479
|
-
expression: "internalFilterByProp(column.prop + '_from').value\n
|
|
14571
|
+
expression: "internalFilterByProp(column.prop + '_from').value\n "
|
|
14480
14572
|
}
|
|
14481
14573
|
})], 1), _c('div', {
|
|
14482
14574
|
staticClass: "col-6"
|
|
@@ -14493,7 +14585,7 @@ var _sfc_render = function render() {
|
|
|
14493
14585
|
callback: function callback($$v) {
|
|
14494
14586
|
_vm.$set(_vm.internalFilterByProp(column.prop + '_to'), "value", $$v);
|
|
14495
14587
|
},
|
|
14496
|
-
expression: "internalFilterByProp(column.prop + '_to').value\n
|
|
14588
|
+
expression: "internalFilterByProp(column.prop + '_to').value\n "
|
|
14497
14589
|
}
|
|
14498
14590
|
})], 1)]) : column.type == 'state' && _vm.optionsLoaded ? _c('select', {
|
|
14499
14591
|
directives: [{
|
|
@@ -15061,10 +15153,52 @@ var _sfc_render = function render() {
|
|
|
15061
15153
|
}), 1)];
|
|
15062
15154
|
}, {
|
|
15063
15155
|
"item": _vm.item
|
|
15064
|
-
}) : _vm._e()], 2)
|
|
15156
|
+
}) : _vm._e()], 2), _vm.showImport ? _c('b-modal', {
|
|
15157
|
+
ref: "modal-import",
|
|
15158
|
+
attrs: {
|
|
15159
|
+
"id": "modal-import",
|
|
15160
|
+
"title": "Importar",
|
|
15161
|
+
"hide-footer": ""
|
|
15162
|
+
}
|
|
15163
|
+
}, [_vm.item ? _vm._t("import", function () {
|
|
15164
|
+
return [_c('b-overlay', {
|
|
15165
|
+
attrs: {
|
|
15166
|
+
"show": _vm.loading,
|
|
15167
|
+
"rounded": "sm"
|
|
15168
|
+
}
|
|
15169
|
+
}, [_c('b-form-file', {
|
|
15170
|
+
attrs: {
|
|
15171
|
+
"state": Boolean(_vm.fileImport),
|
|
15172
|
+
"browse-text": "Explorar",
|
|
15173
|
+
"placeholder": "Importar...",
|
|
15174
|
+
"drop-placeholder": "Arrastrar Archivo aquí..."
|
|
15175
|
+
},
|
|
15176
|
+
model: {
|
|
15177
|
+
value: _vm.fileImport,
|
|
15178
|
+
callback: function callback($$v) {
|
|
15179
|
+
_vm.fileImport = $$v;
|
|
15180
|
+
},
|
|
15181
|
+
expression: "fileImport"
|
|
15182
|
+
}
|
|
15183
|
+
}), _c('div', {
|
|
15184
|
+
staticClass: "text-center mt-3"
|
|
15185
|
+
}, [_c('b-button', {
|
|
15186
|
+
attrs: {
|
|
15187
|
+
"variant": "info",
|
|
15188
|
+
"disabled": _vm.loading
|
|
15189
|
+
},
|
|
15190
|
+
on: {
|
|
15191
|
+
"click": function click($event) {
|
|
15192
|
+
return _vm.importItems();
|
|
15193
|
+
}
|
|
15194
|
+
}
|
|
15195
|
+
}, [_c('b-icon-cloud-upload'), _vm._v(" " + _vm._s(_vm.loading ? "Cargando..." : "Importar") + " ")], 1)], 1)], 1)];
|
|
15196
|
+
}, {
|
|
15197
|
+
"item": _vm.item
|
|
15198
|
+
}) : _vm._e()], 2) : _vm._e()], 1);
|
|
15065
15199
|
};
|
|
15066
15200
|
var _sfc_staticRenderFns = [];
|
|
15067
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
15201
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "c0990da7", null, null);
|
|
15068
15202
|
var component$1 = __component__.exports;// Import vue component
|
|
15069
15203
|
|
|
15070
15204
|
// Default export is installable instance of component.
|