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