From 53f2b242a45f606e82bb5768fc0fb98fc177bfd9 Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Wed, 3 Jan 2024 14:08:49 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AA=91=E7=82=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.dev | 4 +-
src/layout/components/TagsView/index.vue | 23 ++
src/store/modules/websocket.js | 64 ++++-
src/views/databoard/components/FlueGas.vue | 234 ++++++++++++++++++
src/views/databoard/components/GasChart.vue | 216 ++++++++++------
src/views/databoard/components/ISRAChart.vue | 49 +---
.../databoard/components/SelectorBtnGroup.vue | 11 +-
src/views/databoard/deepProcessing/index.vue | 25 +-
src/views/databoard/kiln/EnergeCost.vue | 47 +++-
src/views/databoard/kiln/EnergeTop.vue | 33 +--
src/views/databoard/kiln/FanSequence.vue | 10 +-
src/views/databoard/kiln/GasHandle.vue | 66 ++---
src/views/databoard/kiln/IsraCheck.vue | 2 +-
src/views/databoard/kiln/MaterialCost.vue | 6 +-
src/views/databoard/kiln/RightTwo.vue | 4 +-
src/views/databoard/kiln/index.vue | 34 ++-
src/views/databoard/utils/wsInterface.js | 134 +++++++---
.../databoard/wholePlant/DefectStatistics.vue | 34 +++
src/views/databoard/wholePlant/LeftTwo.vue | 2 +-
src/views/databoard/wholePlant/MiddleTwo.vue | 12 +-
.../databoard/wholePlant/OrderStatus.vue | 147 ++++++++++-
src/views/databoard/wholePlant/RightTwo.vue | 6 +-
src/views/databoard/wholePlant/YieldRate.vue | 121 ++++++++-
src/views/databoard/wholePlant/index.vue | 8 +-
src/websocket/websocket.js | 176 +++++++++++++
src/websocket/wsInterface.js | 160 ++++++++++++
26 files changed, 1357 insertions(+), 271 deletions(-)
create mode 100644 src/views/databoard/components/FlueGas.vue
create mode 100644 src/views/databoard/wholePlant/DefectStatistics.vue
create mode 100644 src/websocket/websocket.js
create mode 100644 src/websocket/wsInterface.js
diff --git a/.env.dev b/.env.dev
index a3f5a522..d08a5b5c 100644
--- a/.env.dev
+++ b/.env.dev
@@ -13,7 +13,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
-VUE_APP_BASE_API = 'http://192.168.0.33:48082'
+# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
@@ -23,6 +23,8 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
+
+VUE_APP_BASE_API = 'http://100.64.0.23:48082'
# 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index ca436de0..7b7b76fc 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -48,6 +48,7 @@
+
+
diff --git a/src/views/databoard/components/GasChart.vue b/src/views/databoard/components/GasChart.vue
index 5b70f50e..3a7b46f9 100644
--- a/src/views/databoard/components/GasChart.vue
+++ b/src/views/databoard/components/GasChart.vue
@@ -17,7 +17,10 @@ export default {
name: 'GasChart',
mixins: [resize],
components: {},
- props: {},
+ props: {
+ chartType: '', // 能源类型
+ chartTime: ''
+ },
data() {
const colors = [
'#12FFF5',
@@ -30,22 +33,154 @@ export default {
'#2aa1ff',
];
return {
- chart: null,
- option: {
- color: colors,
- grid: { top: 32, right: 12, bottom: 20, left: 48 },
- xAxis: {
- type: 'category',
- data: Array(7)
+ chart: null
+ };
+ },
+ computed: {
+ gasChartMsg() {
+ return this.$store.state.websocket.sumGasInfo
+ },
+ energyWeekTrend() {
+ return this.$store.state.websocket.energyWeekTrend
+ },
+ energyMonthTrend() {
+ return this.$store.state.websocket.energyMonthTrend
+ },
+ energyYearTrend() {
+ return this.$store.state.websocket.energyYearTrend
+ }
+ },
+ watch: {
+ energyWeekTrend: {// 监听时间变化,更新图
+ handler(newVal, oldVal) {
+ if (this.chartTime === '周' && this.chartType === '电耗能') {
+ this.updateChart()
+ }
+ }
+ },
+ energyMonthTrend: {// 监听时间变化,更新图
+ handler(newVal, oldVal) {
+ if (this.chartTime === '月' && this.chartType === '电耗能') {
+ this.updateChart()
+ }
+ }
+ },
+ energyYearTrend: {// 监听时间变化,更新图
+ handler(newVal, oldVal) {
+ if (this.chartTime === '年' && this.chartType === '电耗能') {
+ this.updateChart()
+ }
+ }
+ },
+ chartTime: {// 监听时间变化,更新图
+ handler(newVal, oldVal) {
+ this.updateChart()
+ }
+ },
+ chartType: {// 监听能源类型变化,更新图
+ handler(newVal, oldVal) {
+ this.updateChart()
+ }
+ }
+ },
+ mounted() {
+ this.$el.addEventListener('resize', () => {
+ console.log('resziing.....');
+ });
+ this.updateChart()
+ },
+ methods: {
+ updateChart() {
+ let gasName = ''
+ const colors = ['#FFCB59'];
+ let temp = []
+ let seriesData = []
+ let xData = []
+ let yData = []
+ switch (this.chartType) {
+ case '电耗能':{
+ gasName = '电耗能'
+ if (this.chartTime === '周') {
+ temp = this.energyWeekTrend || []
+ }else if(this.chartTime === '月') {
+ temp = this.energyMonthTrend || []
+ }else{
+ temp = this.energyYearTrend || []
+ }
+ temp && temp.map(i => {
+ xData.push(i.time)
+ yData.push(i.qty)
+ })
+ break;
+ }
+ case '天然气I':{
+ yData = this.gasChartMsg.hisSumGas1 || []
+ gasName = '天然气I'
+ xData = Array(7)
.fill(1)
.map((_, index) => {
const today = new Date();
- const dtimestamp = today - index * 24 * 60 * 60 * 1000;
+ const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
dtimestamp
).getDate()}`;
})
- .reverse(),
+ .reverse()
+ break;
+ }
+ default:
+ gasName = '天然气II'
+ yData = this.gasChartMsg.hisSumGas2 || []
+ xData = Array(7)
+ .fill(1)
+ .map((_, index) => {
+ const today = new Date();
+ const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
+ return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
+ dtimestamp
+ ).getDate()}`;
+ })
+ .reverse()
+ }
+ if (yData.length == 0) {
+ seriesData = []
+ }else {
+ seriesData = [{
+ name: gasName,
+ data: yData,
+ type: "line",
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: '#FFCB59' + "40" },
+ { offset: 0.5, color: '#FFCB59' + "20" },
+ { offset: 1, color: '#FFCB59' + "00" },
+ ]),
+ },
+ lineStyle: {
+ width: 1
+ },
+ symbolSize: 1,
+ emphasis: {
+ focus: 'series'
+ }
+ }]
+
+ }
+ // 绘图
+ if (
+ this.chart !== null &&
+ this.chart !== '' &&
+ this.chart !== undefined
+ ) {
+ this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
+ }
+ this.chart = echarts.init(this.$el);
+ var option = {
+ color: colors,
+ grid: { top: 32, right: 12, bottom: 20, left: 48 },
+ xAxis: {
+ type: 'category',
+ data: xData,
axisLabel: {
color: '#fff',
fontSize: 12,
@@ -82,71 +217,14 @@ export default {
},
},
},
- series: [
- Array(7)
- .fill(1)
- .map((_) => Math.ceil(Math.random() * 100)),
- Array(7)
- .fill(1)
- .map((_) => Math.ceil(Math.random() * 100)),
- Array(7)
- .fill(1)
- .map((_) => Math.ceil(Math.random() * 100)),
- ].map((v, i) => ({
- name: ['总量', '白班', '夜班'][i],
- data: v,
- type: 'line',
- symbol: 'circle',
- areaStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- // i % 8 避免超过8个数据时无颜色的问题
- { offset: 0, color: colors[i % 8] + '40' },
- { offset: 0.5, color: colors[i % 8] + '20' },
- { offset: 1, color: colors[i % 8] + '00' },
- ]),
- },
- })),
+ series: seriesData,
tooltip: {
trigger: 'axis',
},
- },
- };
- },
- computed: {
- sidebarStatus() {
- return this.$store.state.app.sidebar.opened;
- },
- gasChartMsg() {
- return this.$store.state.websocket.gasInfo
- }
- },
- watch: {
- sidebarStatus(val) {
- console.log('sidebarStatus', val);
- this.chart && this.chart.dispose();
-
- setTimeout(() => {
- this.chart = echarts.init(this.$el);
- this.chart.setOption(this.option);
- }, 500);
- },
- gasChartMsg: {
- handler(newVal, oldVal) {
- console.log(newVal)
- // this.chartData = newVal
- console.log('newVal============')
- // this.updateChart()
}
+ option && this.chart.setOption(option)
}
},
- mounted() {
- this.$el.addEventListener('resize', () => {
- console.log('resziing.....');
- });
- this.chart = echarts.init(this.$el);
- this.chart.setOption(this.option);
- },
- methods: {},
};
diff --git a/src/views/databoard/components/ISRAChart.vue b/src/views/databoard/components/ISRAChart.vue
index 49b0968a..bc56c004 100644
--- a/src/views/databoard/components/ISRAChart.vue
+++ b/src/views/databoard/components/ISRAChart.vue
@@ -1,10 +1,3 @@
-
-
@@ -68,9 +61,7 @@ export default {
watch: {
israChartMsg: {
handler(newVal, oldVal) {
- console.log(newVal)
this.chartData = newVal
- console.log('newVal============')
this.updateChart()
}
}
@@ -99,48 +90,18 @@ export default {
color: '#fff',
},
subtextStyle: {
- fontSize: 16,
+ fontSize: 20,
color: '#fff00',
},
},
series:[{
- name: 'Access From',
+ name: 'ISRA缺陷检测',
type: 'pie',
- radius: ['45%', '65%'],
+ center: ['50%', '40%'],
+ radius: ['45%', '70%'],
avoidLabelOverlap: true,
label: {
- show: true,
- position: 'outside',
- formatter: ({ dataIndex, percent }) => {
- const styleName = ['a', 'b', 'c', 'd'][dataIndex % 4];
- return `{${styleName}|${percent}%}`;
- },
- rich: {
- a: {
- color: '#2760ff',
- fontSize: 24,
- borderWidth: 0,
- textBorderWidth: 0,
- },
- b: {
- color: '#518eec',
- fontSize: 24,
- borderWidth: 0,
- textBorderWidth: 0,
- },
- c: {
- color: '#0ee8e4',
- fontSize: 24,
- borderWidth: 0,
- textBorderWidth: 0,
- },
- d: {
- color: '#ddb523',
- fontSize: 24,
- borderWidth: 0,
- textBorderWidth: 0,
- },
- },
+ show: false
},
labelLine: {
show: true,
diff --git a/src/views/databoard/components/SelectorBtnGroup.vue b/src/views/databoard/components/SelectorBtnGroup.vue
index 5df5b3a9..0fc4e90e 100644
--- a/src/views/databoard/components/SelectorBtnGroup.vue
+++ b/src/views/databoard/components/SelectorBtnGroup.vue
@@ -11,7 +11,7 @@
class="btn"
v-for="opt in options"
:key="opt"
- @click="active = opt"
+ @click="clickBtn(opt)"
:class="active == opt ? 'btn-active' : ''">
{{ opt }}
@@ -22,15 +22,18 @@
export default {
name: 'SelectorBtnGroup',
components: {},
- props: ['options'],
+ props: ['options', 'active'],
data() {
return {
- active: this.options[0] || 'default'
+ // active: this.options[0] || 'default'
};
},
computed: {},
methods: {
-
+ clickBtn(opt) {
+ // this.active = opt
+ this.$emit('emitFun', opt)
+ }
},
};
diff --git a/src/views/databoard/deepProcessing/index.vue b/src/views/databoard/deepProcessing/index.vue
index be0a7d28..2515dd91 100644
--- a/src/views/databoard/deepProcessing/index.vue
+++ b/src/views/databoard/deepProcessing/index.vue
@@ -6,10 +6,10 @@
class="deepProcessingBoard"
style="
position: absolute;
- transform-origin: 16px 8px;
+ transform-origin: left top;
font-size: 16px;
- top: -8px;
- left: -16px;
+ top: 0px;
+ left: 0px;
width: 1920px;
height: 1080px;
display: flex;
@@ -18,6 +18,17 @@
"
:style="{transform:'scale('+scaleNum+')'}">
排放浓度
二氧化硫
排放浓度
二氧化氮
-排放浓度
-