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

upadte:更新

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