代码提交
This commit is contained in:
parent
e7b7125476
commit
00eaac59a7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -125,12 +125,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.xData = this.typeValue.type_data.map(ele => {
|
||||
return ele.name;
|
||||
});
|
||||
this.yData = this.typeValue.type_data.map(ele => {
|
||||
return ele.quantity;
|
||||
});
|
||||
|
||||
this.drawBar();
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -268,21 +268,7 @@ export default {
|
|||
// console.log(this.$parent.dataArr, '父组件的dataArr');
|
||||
// this.$set(this.$parent.dataArr)
|
||||
},
|
||||
computed: {
|
||||
listTotal() {
|
||||
return JSON.parse(JSON.stringify(this.$parent.dataArr))
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listTotal: {
|
||||
// handler(newVal){
|
||||
// console.log(this.chartName , newVal,'数据');
|
||||
// },
|
||||
|
||||
deep: true
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<template><!-- 触发类型 -->
|
||||
<div class="setion" v-if="dataArr">
|
||||
<template>
|
||||
<!-- 触发类型 -->
|
||||
<div class="setion">
|
||||
<p class="chartTitle"><span class="titleIcon"></span> {{ componentName }} {{ triggerType }}</p>
|
||||
<!-- 触发数据数值渲染 -->
|
||||
<div class="typeContent" >
|
||||
<div v-if="dataArr && dataArr.length != 0 && dataArr!=undefined">
|
||||
<div class="typeContent">
|
||||
<div v-if="dataArr && dataArr.length != 0 && dataArr != undefined">
|
||||
<div v-if="title == '类型'" style="display:flex">
|
||||
<el-card v-for="(n, i) in dataArr[0].type_data" :key="i"
|
||||
style="width: 150px; margin-bottom: 20px; text-align: center">
|
||||
|
@ -20,11 +21,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<el-card v-show="echartArr.includes('数值')" style="width: 150px; margin-bottom: 20px; text-align: center">
|
||||
<div v-if="dataArr&& dataArr.length != 0 && dataArr!=undefined">
|
||||
<div v-if="dataArr && dataArr.length != 0 && dataArr != undefined">
|
||||
<div v-if="title == '类型'">
|
||||
<span style="font-size: 15px;">类型数量总和</span><br />
|
||||
<span style="font-size: 30px; font-weight: bold">
|
||||
{{ getTotal() }}
|
||||
{{ }}
|
||||
</span>
|
||||
</div>
|
||||
<div style="font-size: 30px; font-weight: bold" v-if="title == '速度'">
|
||||
|
@ -64,12 +65,12 @@
|
|||
</el-card>
|
||||
</div>
|
||||
<div v-show="echartArr.includes('表格')">
|
||||
<div class="tableTitle" v-if="dataArr&& dataArr.length != 0 && dataArr!=undefined">
|
||||
<div class="tableTitle" v-if="dataArr && dataArr.length != 0 && dataArr != undefined">
|
||||
<div>
|
||||
<span
|
||||
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
|
||||
></span>
|
||||
<span style="font-size:18px;">{{ this.chartName + '-' + this.componentName + '-' + '表格' + '-' + triggerType }}</span>
|
||||
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"></span>
|
||||
<span style="font-size:18px;">{{ this.chartName + '-' + this.componentName + '-' + '表格' + '-' +
|
||||
triggerType }}</span>
|
||||
</div>
|
||||
<div class="tableTime">
|
||||
{{ dataArr[0].time ? dataArr[0].time : '' }}
|
||||
|
@ -84,16 +85,8 @@
|
|||
</div>
|
||||
<div class="border" v-if="echartArr.includes('曲线图')">
|
||||
<detailDialog />
|
||||
<lineChart
|
||||
:componentName="componentName"
|
||||
:chartName="chartName"
|
||||
:pageType="pageType"
|
||||
:list="dataArr"
|
||||
:status="triggerType"
|
||||
:title="title"
|
||||
:typeValue="typeValue"
|
||||
ref="lineChartRef"
|
||||
/>
|
||||
<lineChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
|
||||
:status="triggerType" :title="title" :typeValue="typeValue" ref="lineChartRef" />
|
||||
</div>
|
||||
<div class="border" v-if="echartArr.includes('饼状图')">
|
||||
<detailDialog />
|
||||
|
@ -146,8 +139,8 @@ export default {
|
|||
valueShow: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log(this.title+'TYPECHARTdataArr', this.dataArr)
|
||||
created() {
|
||||
console.log(this.title + 'TYPECHARTdataArr', this.dataArr)
|
||||
},
|
||||
methods: {
|
||||
// 计算类型的数值
|
||||
|
@ -155,8 +148,10 @@ export default {
|
|||
|
||||
computed: {
|
||||
// 获取类型的总数量
|
||||
getTotal(){
|
||||
|
||||
getTotal() {
|
||||
return this.dataArr[0].type_data((pre, cur) => {
|
||||
return pre + cur
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
|
@ -164,17 +159,17 @@ export default {
|
|||
// 监听触发数据
|
||||
dataArr: {
|
||||
handler(newVal) {
|
||||
|
||||
|
||||
},
|
||||
|
||||
immediate: true
|
||||
},
|
||||
typeValue: {
|
||||
handler(newVal) {
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
immediate:true
|
||||
immediate: true
|
||||
}
|
||||
// cycleTimeData: {
|
||||
// handler(newVal) {
|
||||
|
|
|
@ -339,7 +339,10 @@ export default {
|
|||
typeTimeMode: {},
|
||||
// 周期时刻的数值看板展示
|
||||
typeCycleTimeData: {},
|
||||
typeCycleStatistics: {}
|
||||
typeCycleStatistics: {},
|
||||
|
||||
// 各个组件分类
|
||||
classify: []
|
||||
};
|
||||
},
|
||||
// beforeCeated(){
|
||||
|
@ -360,8 +363,8 @@ export default {
|
|||
});
|
||||
},
|
||||
siftData() {
|
||||
// this.sectionArr=[]
|
||||
// this.sectionData=[]
|
||||
this.sectionArr=[]
|
||||
this.sectionData=[]
|
||||
this.componentList.forEach(val => {
|
||||
this.sectionArr.push(val.combinationName);
|
||||
this.sectionArr = Array.from(new Set(this.sectionArr));
|
||||
|
@ -371,6 +374,7 @@ export default {
|
|||
this.acticveName = [];
|
||||
this.componentList.forEach(val => {
|
||||
if (item.title == val.combinationName) {
|
||||
this.classify.push(val)
|
||||
item.children.push(val);
|
||||
}
|
||||
this.acticveName.push(val.analogAreaComponentId);
|
||||
|
@ -396,7 +400,7 @@ export default {
|
|||
downPulls1[i].style.cssText = 'transition: all 0.5s linear;';
|
||||
// sections[i].style.height = '500px';
|
||||
if (sectionBox[i] != undefined) {
|
||||
// sectionBox[i].style.height = '48vh';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -418,6 +422,15 @@ export default {
|
|||
},
|
||||
mounted() { },
|
||||
watch: {
|
||||
// acticveName: {
|
||||
// handler(newVal) {
|
||||
// if (newVal != 'second') {
|
||||
// // 组件数据赋空
|
||||
// this.classify = []
|
||||
// }
|
||||
// }
|
||||
|
||||
// },
|
||||
// 触发的原始数据
|
||||
triggerData: {
|
||||
handler(newVal, oldVal) { },
|
||||
|
@ -432,12 +445,12 @@ export default {
|
|||
console.log(newVal, 'triggerlistData');
|
||||
var _this = this
|
||||
if (newVal.length != 0 && _this.sectionData) {
|
||||
_this.componentList.forEach(ele => {
|
||||
_this.classify.forEach((ele, index) => {
|
||||
|
||||
if (ele.trigger == undefined && ele.timeMode == '触发') {
|
||||
ele.trigger = [];
|
||||
}
|
||||
newVal.forEach((item, i) => {
|
||||
newVal.forEach((item) => {
|
||||
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
|
||||
if (ele.trigger.length == 10) {
|
||||
ele.trigger.splice(newVal.length - 1, 1);
|
||||
|
@ -449,8 +462,11 @@ export default {
|
|||
}
|
||||
ele.trigger.unshift(item);
|
||||
_this.$nextTick(() => {
|
||||
if (_this.$refs.typeChartRef[i].$refs.lineChartRef.drawLine) {
|
||||
_this.$refs.typeChartRef[i].$refs.lineChartRef.drawLine(ele.trigger, ele.componentName.split('_')[0])
|
||||
console.log(index, '满足条件的索引');
|
||||
console.log(_this.$refs.typeChartRef[index], index, '...........');
|
||||
if (_this.$refs.typeChartRef[index] != undefined) {
|
||||
console.log(_this.$refs.typeChartRef[index].dataArr, '数据');
|
||||
_this.$refs.typeChartRef[index].$refs.lineChartRef.drawLine(ele.trigger, ele.componentName.split('_')[0])
|
||||
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue