Former-commit-id: 2b8e28e5f5348877107060e4092123f21db1ef94
master
wangbing 5 years ago
parent 17fcfa5350
commit dc677002db

@ -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) {

Loading…
Cancel
Save

Powered by TurnKey Linux.