|
|
|
@ -143,8 +143,16 @@
|
|
|
|
|
utils.blobtoDown(decodeURIComponent(fileName), new Blob([response.data]))
|
|
|
|
|
return Promise.resolve({errors: []});
|
|
|
|
|
}
|
|
|
|
|
}, function (response) {
|
|
|
|
|
return Promise.resolve(handleError(response.response.status));
|
|
|
|
|
}, function (error) {
|
|
|
|
|
nav.tipClose();
|
|
|
|
|
nav.barError();
|
|
|
|
|
const rsp = {errors: []};
|
|
|
|
|
if (!error.response) {
|
|
|
|
|
rsp.errors.push({message: error.message});
|
|
|
|
|
} else {
|
|
|
|
|
rsp.errors.push(handleError(error.response.status));
|
|
|
|
|
}
|
|
|
|
|
return Promise.resolve(rsp);
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
function Ajax(module, target, method) {
|
|
|
|
@ -261,8 +269,11 @@
|
|
|
|
|
.module(this.module)
|
|
|
|
|
.target(this.target)
|
|
|
|
|
.method("template")
|
|
|
|
|
.data({})
|
|
|
|
|
.template()
|
|
|
|
|
.template(function (response) {
|
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onImport: function (item) {
|
|
|
|
|
utils.selectFile(function (files) {
|
|
|
|
@ -270,7 +281,11 @@
|
|
|
|
|
.module(this.module)
|
|
|
|
|
.target(this.target)
|
|
|
|
|
.data(files[0])
|
|
|
|
|
.imports();
|
|
|
|
|
.imports(function (response) {
|
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}.bind(this))
|
|
|
|
|
},
|
|
|
|
|
onExport: function () {
|
|
|
|
@ -278,7 +293,11 @@
|
|
|
|
|
.module(this.module)
|
|
|
|
|
.target(this.target)
|
|
|
|
|
.data( this.vm)
|
|
|
|
|
.exports();
|
|
|
|
|
.exports(function (response) {
|
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onSave: function () {
|
|
|
|
|
this.$refs['form'].validate(function (valid) {
|
|
|
|
|