提交 2016a4e8 编写于 作者: Mosher's avatar Mosher

upadte:更新

上级 ac589dd3
......@@ -349,18 +349,33 @@ import { Http } from "@/utils";
let tempViewParams: any = parentData.viewparams ? parentData.viewparams : {};
Object.assign(tempViewParams, JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(data, { viewparams: tempViewParams });
this.service.search(this.fetchAction, this.context, data, isloadding).then((response: any) => {
if(!response || response.status !== 200) {
this.$notify.warning({
title: '警告',
message: response.error.message
})
this.handleCtrlEvents('onbeforeload', { viewparams: data }).then((beforeLoadRes: boolean) => {
if (!beforeLoadRes) {
return;
}
this.$emit('load', response.data ? response.data : []);
this.items = response.data;
this.handleOptions(response.data);
this.setOptions();
});
this.service.search(this.fetchAction, this.context, data, isloadding).then((response: any) => {
if(!response || response.status !== 200) {
this.handleCtrlEvents('onloaderror', { viewparams: data }).then((loadErrorRes: boolean) => {
if (!loadErrorRes) {
return;
}
this.$notify.warning({
title: '警告',
message: response.error.message
})
})
}
this.handleCtrlEvents('onloadsuccess', { data: response.data ? response.data : [] }).then((loadSuccessRes: boolean) => {
if (!loadSuccessRes) {
return;
}
this.$emit('load', response.data ? response.data : []);
this.items = response.data;
this.handleOptions(response.data);
this.setOptions();
})
});
})
}
/**
......
......@@ -313,13 +313,36 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
Object.assign(arg,{size:${appDataSet.getPageSize()?c}});
</#if>
</#if>
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) {
this.transformToBasicChartSetData(res.data,(codelist:any) =>{_this.drawCharts(codelist)});
this.handleCtrlEvents('onbeforeload', { viewparams: arg }).then((beforeLoadRes: boolean) => {
if (!beforeLoadRes) {
return;
}
}).catch((error) => {
console.error(error);
});
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) {
this.handleCtrlEvents('onloadsuccess', { data: res.data }).then((loadSuccessRes: boolean) => {
if (!loadSuccessRes) {
return;
}
this.transformToBasicChartSetData(res.data,(codelist:any) =>{_this.drawCharts(codelist)});
})
} else {
this.handleCtrlEvents('onloaderror').then((loadErrorRes: boolean) => {
if (!loadErrorRes) {
return;
}
// 加载失败逻辑
});
}
}).catch((error) => {
this.handleCtrlEvents('onloaderror').then((loadErrorRes: boolean) => {
if (!loadErrorRes) {
return;
}
// 加载失败逻辑
console.error(error);
});
});
})
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册