提交 bcffe753 编写于 作者: W wei_ning_wang

scalar 报错

上级 8ca7b522
...@@ -564,7 +564,11 @@ export default { ...@@ -564,7 +564,11 @@ export default {
ajaxArr.push(this.addAjax(params, yIndex)); ajaxArr.push(this.addAjax(params, yIndex));
}); });
Promise.all(ajaxArr) Promise.all(ajaxArr.map(function(promiseItem) {
return promiseItem.catch(function(err) {
return err;
});
}))
.then((res) => { .then((res) => {
if (!res) { if (!res) {
return; return;
......
...@@ -336,6 +336,11 @@ export default { ...@@ -336,6 +336,11 @@ export default {
this.getScalarsList(); this.getScalarsList();
this.firstNum = 1; this.firstNum = 1;
// auto refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}); });
}, },
methods: { methods: {
...@@ -429,11 +434,6 @@ export default { ...@@ -429,11 +434,6 @@ export default {
// Refresh the chart data on the current page // Refresh the chart data on the current page
this.freshCurPageData(); this.freshCurPageData();
} }
// auto refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}, this.requestErrorCallback) }, this.requestErrorCallback)
.catch((e) => { .catch((e) => {
this.$message.error(this.$t('public.dataError')); this.$message.error(this.$t('public.dataError'));
...@@ -499,22 +499,28 @@ export default { ...@@ -499,22 +499,28 @@ export default {
promiseArr.push(this.addPromise(params)); promiseArr.push(this.addPromise(params));
Promise.all(promiseArr) Promise.all(promiseArr.map(function(promiseItem) {
return promiseItem.catch(function(err) {
return err;
});
}))
.then((res) => { .then((res) => {
// error // error
if (!res || !res.length) { if (!res || !res.length) {
return; return;
} }
if (sampleObject.charObj) {
sampleObject.charObj.showLoading();
}
let scalarIndex = 0; let scalarIndex = 0;
let hasInvalidData = false; let hasInvalidData = false;
for (let i = 0; i < res.length; i++) { for (let i = 0; i < res.length; i++) {
if (!res[i] || !res[i].data) { if (!res[i] || !res[i].data) {
sampleObject.charObj.clear();
return; return;
} }
if (sampleObject.charObj) {
sampleObject.charObj.showLoading();
}
const resData = res[i].data; const resData = res[i].data;
const tempObject = { const tempObject = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册