|
|
|
@ -85,8 +85,17 @@ watch( |
|
|
|
list.push(valItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
let tableTitle = ""; |
|
|
|
if(Array.isArray(props.sunDimAry) && props.sunDimAry.length > 0){ |
|
|
|
props.sunDimAry.forEach((taItem:any)=>{ |
|
|
|
if(taItem.tableKey == item){ |
|
|
|
tableTitle = taItem.tableName |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
weiduSunList.value.push({ |
|
|
|
tableKey:item, |
|
|
|
tableTitle:tableTitle, |
|
|
|
list:list |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -127,8 +136,17 @@ watch( |
|
|
|
list.push(valItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
let tableTitle = ""; |
|
|
|
if(Array.isArray(props.sunDimAry) && props.sunDimAry.length > 0){ |
|
|
|
props.sunDimAry.forEach((taItem:any)=>{ |
|
|
|
if(taItem.tableKey == item){ |
|
|
|
tableTitle = taItem.tableName |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
duliangSunList.value.push({ |
|
|
|
tableKey:item, |
|
|
|
tableTitle:tableTitle, |
|
|
|
list:list |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -277,10 +295,119 @@ const shuxingmh = (val: any) => { |
|
|
|
} |
|
|
|
return titleVal; |
|
|
|
}; |
|
|
|
|
|
|
|
//初始化维度与度量子表数据 |
|
|
|
const initDerStor = () => { |
|
|
|
console.log("初始化维度-----xsun----->",controlData.value.xsun) |
|
|
|
console.log("初始化维度-----ysun----->",controlData.value.ysun) |
|
|
|
console.log("初始化维度-----sunDimAry----->",props.sunDimAry) |
|
|
|
duliangSunList.value = [] |
|
|
|
weiduSunList.value = [] |
|
|
|
|
|
|
|
|
|
|
|
console.log("初始化维度-----sunDimAry--1--->",Array.isArray(props.sunDimAry) , props.sunDimAry.length > 0) |
|
|
|
|
|
|
|
if(Array.isArray(props.sunDimAry) && props.sunDimAry.length > 0){ |
|
|
|
props.sunDimAry.forEach((taItem:any)=>{ |
|
|
|
|
|
|
|
console.log("初始化维度-----xsun--1--->",Array.isArray(controlData.value.xsun) , controlData.value.xsun.length > 0) |
|
|
|
//x轴 |
|
|
|
if(Array.isArray(controlData.value.xsun) && controlData.value.xsun.length > 0){ |
|
|
|
let list = [] |
|
|
|
controlData.value.xsun.forEach((xItem:any)=>{ |
|
|
|
if(taItem.tableKey == xItem.tableKey){ |
|
|
|
list.push(xItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
weiduSunList.value.push({ |
|
|
|
tableKey:taItem.tableKey, |
|
|
|
tableTitle:taItem.tableName, |
|
|
|
list:list |
|
|
|
}) |
|
|
|
} |
|
|
|
//y轴 |
|
|
|
if(Array.isArray(controlData.value.ysun) && controlData.value.ysun.length > 0){ |
|
|
|
let list = [] |
|
|
|
controlData.value.ysun.forEach((yItem:any)=>{ |
|
|
|
if(taItem.tableKey == yItem.tableKey){ |
|
|
|
list.push(yItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("初始化维度-----ysun--1--->",list) |
|
|
|
duliangSunList.value.push({ |
|
|
|
tableKey:taItem.tableKey, |
|
|
|
tableTitle:taItem.tableName, |
|
|
|
list:list |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
console.log("初始化维度-----weiduSunList----->",weiduSunList.value) |
|
|
|
console.log("初始化维度-----duliangSunList----->",duliangSunList.value) |
|
|
|
} |
|
|
|
const activeXName = ref(0) |
|
|
|
const activeYName = ref(0) |
|
|
|
//删除维度子表 |
|
|
|
const delDimSun = (tableKey:string,fieldKey:string) => { |
|
|
|
if(Array.isArray(controlData.value.xsun) && controlData.value.xsun.length > 0){ |
|
|
|
let list = [] |
|
|
|
controlData.value.xsun.forEach((xItem:any,index:number)=>{ |
|
|
|
if(xItem.tableKey == tableKey && xItem.field == fieldKey ){ |
|
|
|
list.push(index) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(list.length > 0){ |
|
|
|
list.forEach((item:number) => { |
|
|
|
controlData.value.xsun.splice(item, 1); |
|
|
|
}) |
|
|
|
} |
|
|
|
if(Array.isArray(controlData.value.xsun)){ |
|
|
|
if (controlData.value.xsun.length <= 0){ |
|
|
|
controlData.value.ysun = [] |
|
|
|
} |
|
|
|
}else{ |
|
|
|
controlData.value.xsun = [] |
|
|
|
controlData.value.ysun = [] |
|
|
|
} |
|
|
|
}else{ |
|
|
|
controlData.value.xsun = [] |
|
|
|
controlData.value.ysun = [] |
|
|
|
} |
|
|
|
} |
|
|
|
//删除度量子表 |
|
|
|
const delDimSunDuliang = (tableKey:string,fieldKey:string) => { |
|
|
|
if(Array.isArray(controlData.value.ysun) && controlData.value.ysun.length > 0){ |
|
|
|
let list = [] |
|
|
|
controlData.value.ysun.forEach((xItem:any,index:number)=>{ |
|
|
|
if(xItem.tableKey == tableKey && xItem.field == fieldKey ){ |
|
|
|
list.push(index) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(list.length > 0){ |
|
|
|
list.forEach((item:number) => { |
|
|
|
controlData.value.ysun.splice(item, 1); |
|
|
|
}) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
controlData.value.ysun = [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onMounted(()=>{ |
|
|
|
initDerStor() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|
<template> |
|
|
|
<div class="echartsRight"> |
|
|
|
<el-divider content-position="left">配置属性</el-divider> |
|
|
|
|
|
|
|
<el-divider content-position="left">配置属性</el-divider> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="controlData.icon"> |
|
|
|
<div class="arttBoxTitle"> |
|
|
|
<el-text class="mx-1" size="large">图表名称</el-text> |
|
|
|
@ -326,23 +453,28 @@ const shuxingmh = (val: any) => { |
|
|
|
<svg-icon icon-class="sc" :size="20" class="setBut" @click="delDim(index)" /> |
|
|
|
</el-space> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-for="(item, index) in controlData.xsun" class="dimListBox"> |
|
|
|
<div class="dimListTitle">{{ item.title }}</div> |
|
|
|
<el-space wrap> |
|
|
|
<svg-icon |
|
|
|
icon-class="set" |
|
|
|
:size="20" |
|
|
|
class="setBut" |
|
|
|
@click="setDimInfo(item)" |
|
|
|
/> |
|
|
|
<svg-icon icon-class="sc" :size="20" class="setBut" @click="delDim(index)" /> |
|
|
|
</el-space> |
|
|
|
</div> |
|
|
|
<el-tabs v-if="weiduSunList&&weiduSunList.length>0" v-model="activeXName" type="border-card" class="demo-tabs"> |
|
|
|
<el-tab-pane v-for="(item,index) in weiduSunList" :label="item.tableTitle" :name="index"> |
|
|
|
<div v-for="(sitem, sindex) in item.list" class="dimListBox"> |
|
|
|
<div class="dimListTitle">{{ sitem.title }}</div> |
|
|
|
<el-space wrap> |
|
|
|
<svg-icon |
|
|
|
icon-class="set" |
|
|
|
:size="20" |
|
|
|
class="setBut" |
|
|
|
@click="setDimInfo(sitem)" |
|
|
|
/> |
|
|
|
<svg-icon icon-class="sc" :size="20" class="setBut" @click="delDimSun(item.tableKey,sitem.field)" /> |
|
|
|
</el-space> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="arttBoxTitle"> |
|
|
|
<div class="arttBoxTitle" style="margin-top:10px;"> |
|
|
|
<el-text class="mx-1" size="large">看板指标/度量</el-text> |
|
|
|
<el-text class="mx-1 shouxing" type="primary" @click="pickDim(2)">添加</el-text> |
|
|
|
</div> |
|
|
|
@ -366,6 +498,25 @@ const shuxingmh = (val: any) => { |
|
|
|
</el-space> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-tabs v-if="duliangSunList&&duliangSunList.length>0" v-model="activeYName" type="border-card" class="demo-tabs"> |
|
|
|
<el-tab-pane v-for="(item,index) in duliangSunList" :label="item.tableTitle" :name="index"> |
|
|
|
<div v-for="(sitem, sindex) in item.list" class="dimListBox"> |
|
|
|
<div class="dimListTitle">{{ sitem.title }}</div> |
|
|
|
<el-space wrap> |
|
|
|
<svg-icon |
|
|
|
icon-class="set" |
|
|
|
:size="20" |
|
|
|
class="setBut" |
|
|
|
@click="setMeaInfo(sitem)" |
|
|
|
/> |
|
|
|
<svg-icon icon-class="sc" :size="20" class="setBut" @click="delDimSunDuliang(item.tableKey,sitem.field)" /> |
|
|
|
</el-space> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="arttBoxTitle"> |
|
|
|
<el-text class="mx-1" size="large">过滤器</el-text> |
|
|
|
<el-text class="mx-1 shouxing" type="primary" @click="pickDim(3)">添加</el-text> |
|
|
|
@ -486,6 +637,9 @@ const shuxingmh = (val: any) => { |
|
|
|
.echartsRight { |
|
|
|
width: 100%; |
|
|
|
padding: 0px 10px; |
|
|
|
:deep .el-tabs__content{ |
|
|
|
padding: 10px 2px 0 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
.arttBoxTitle { |
|
|
|
display: flex; |
|
|
|
|