提交 1018ee3c 编写于 作者: sq3536's avatar sq3536

提交

上级 7190cf2d
......@@ -191,8 +191,20 @@ export default class DAReportBBZSCustomView extends DAReportBBZSCustomViewBase {
let url='/lite/report/'+JSON.parse(this.viewdata).srfparentkey;
let domain=this.getDomain();
if(!loadData)
url=url+"/config";
{
if(domain)
url=url+"/"+domain+"/config";
else
url=url+"/config";
}
else if(!this.treeValue)
{
alert('请选择统计范围');
return;
}
else if(this.treeValue&&this.treeValue!='%')
url=url+"/"+this.treeValue;
if(this.startTime&&this.endTime)
......@@ -210,7 +222,13 @@ export default class DAReportBBZSCustomView extends DAReportBBZSCustomViewBase {
this.items = response.data.rows;
if((!loadData)||this.treeOptions.length==0)
this.treeOptions=response.data.dict.items;
{
let dictItems: any=this.getDict(response.data.dict.items,domain);
if(dictItems)
this.treeOptions=dictItems;
else
this.treeOptions=response.data.dict.items;
}
this.treeValue=response.data.selectValue;
this.dimPlaceholder="请选择"+response.data.group;
if(!this.startTime)
......@@ -231,6 +249,51 @@ export default class DAReportBBZSCustomView extends DAReportBBZSCustomViewBase {
}
public getDict(items: any,curOrg: string ) :any
{
if(curOrg)
{
let nodes: any = null;
items.forEach((item: any) => {
if(item.value===curOrg)
{
nodes = [item];
return nodes;
}
if(item.children)
{
let tmp=this.getDict(item.children,curOrg);
if(tmp)
{
nodes = tmp;
return nodes;
}
}
});
return nodes;
}
else
return items;
}
public getDomain(): string
{
let curOrg:string = this.$store.getters.getAppData().context.srforgcode;
if(curOrg)
{
if(curOrg.startsWith("10"))
return null;
else if(curOrg.endsWith("0000"))
return curOrg.substring(0,2);
else if(curOrg.endsWith("00"))
return curOrg.substring(0,4);
else
return curOrg;
}
return null;
}
/**
* 请求数据
*/
......@@ -395,6 +458,14 @@ export default class DAReportBBZSCustomView extends DAReportBBZSCustomViewBase {
let total=$event.data[$event.column.colId];
this.getTimeRange();
const params: any = {};
if(colId==='no')
return;
else if(colId==='itemName')
{
this.treeValue=rowId;
this.getReportData();
return;
}
let url='/lite/lookup/'+colId+'/'+rowId+'?page=0&size=1000&total='+total;
if(this.startTime&&this.endTime)
url=url+"&startTime="+this.startTime+"&endTime="+this.endTime;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册