From 9efaf5e388c7b413f847dffda71fb64c8bbc101f Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Mon, 19 May 2025 10:37:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8C=85=E8=A3=85=E7=BA=BF=E4=BA=A7?= =?UTF-8?q?=E7=BA=BF=E7=94=9F=E4=BA=A7=E7=9C=8B=E6=9D=BF2=E5=88=86?= =?UTF-8?q?=E9=92=9F=E8=87=AA=E5=8A=A8=E8=B7=B3=E4=BA=A7=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yangwl <1726150332@qq.com> --- src/views/kanban/Packagingline/index2.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue index 0b28297..05e7c4f 100644 --- a/src/views/kanban/Packagingline/index2.vue +++ b/src/views/kanban/Packagingline/index2.vue @@ -444,7 +444,9 @@ export default { actProduction: [], ceshitable: [{}, {}, {}, {}, {}, {}], pollTimer: null, - timer: null + timer: null, + currentIndex: 0, + rotationTimer: null }; }, created() {}, @@ -462,11 +464,24 @@ export default { this.timer = setInterval(() => { this.getProductionNumberPLC(); }, 10000); + this.startRotation() }, beforeDestroy() { - + clearInterval(this.rotationTimer) + clearInterval(this.timer) }, methods: { + startRotation() { + this.rotationTimer = setInterval(() => { + if(this.dictDatatype?.length > 0) { + this.currentIndex = (this.currentIndex + 1) % this.dictDatatype.length + console.log(this.currentIndex + 1); + // console.log(this.dictDatatype); + this.selectxtclasses = this.dictDatatype[this.currentIndex].equCode + this.selectline2(this.selectxtclasses) // 触发change事件 + } + }, 120000) + }, back() { this.$router.push({ path: "/index" }); }, From ddfebf213141e4786cd455fd30314911e40dd300 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Mon, 19 May 2025 11:08:28 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8C=85=E8=A3=85=E7=BA=BF=E4=BA=A7?= =?UTF-8?q?=E7=BA=BF=E7=94=9F=E4=BA=A7=E7=9C=8B=E6=9D=BF1=E5=88=86?= =?UTF-8?q?=E9=92=9F=E8=87=AA=E5=8A=A8=E8=B7=B3=E4=BA=A7=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yangwl <1726150332@qq.com> --- src/views/kanban/Packagingline/index2.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue index 05e7c4f..cbf9257 100644 --- a/src/views/kanban/Packagingline/index2.vue +++ b/src/views/kanban/Packagingline/index2.vue @@ -480,7 +480,7 @@ export default { this.selectxtclasses = this.dictDatatype[this.currentIndex].equCode this.selectline2(this.selectxtclasses) // 触发change事件 } - }, 120000) + }, 60000) }, back() { this.$router.push({ path: "/index" }); From 5c80d802b699409d16ae70071c0a6005746d8436 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Tue, 20 May 2025 09:06:01 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=AC=E6=9C=88=E2=80=94=E2=80=94=E3=80=8B?= =?UTF-8?q?=E6=9C=AC=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yangwl <1726150332@qq.com> --- src/views/cs/index5/cards.vue | 64 ++--------------------------------- 1 file changed, 3 insertions(+), 61 deletions(-) diff --git a/src/views/cs/index5/cards.vue b/src/views/cs/index5/cards.vue index c151d97..b0f6c21 100644 --- a/src/views/cs/index5/cards.vue +++ b/src/views/cs/index5/cards.vue @@ -38,63 +38,7 @@ export default { data () { return { cards: [ - { - title: "点检", - desc: "今日", - total: { - number: [], - content: '{nt}', - textAlign: 'right', - style: { - fill: '#ea6027', - fontWeight: 'bold' - } - }, - num: { - number: [], - content: '{nt}', - textAlign: 'right', - style: { - fill: '#26fcd8', - fontWeight: 'bold' - } - }, - ring: { - series: [ - { - type: 'gauge', - startAngle: -Math.PI / 2, - endAngle: Math.PI * 1.5, - arcLineWidth: 13, - radius: '80%', - data: [], - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - pointer: { - show: false - }, - backgroundArc: { - style: { - stroke: '#224590' - } - }, - details: { - show: true, - formatter: '完成占比{value}%', - style: { - fill: '#1ed3e5', - fontSize: 20 - } - } - } - ], - color: ['#03d3ec'] - } - }, + ], equipmentinfo: {}, } @@ -116,16 +60,14 @@ export default { }).then((response) => { if (response.data) { _this.equipmentinfo = response.data; - this.cards = titles.map(title => { const [totalKey, finishKey] = dataMap[title]; const total = this.equipmentinfo[totalKey] || 0; // 避免除零 const finish = this.equipmentinfo[finishKey] || 0; - const ratio = Number((finish / total).toFixed(2)); + const ratio = Number((finish / total).toFixed(2)) * 100; return { - title: title, - desc: title === '保养' || '巡检' ? '本月' : '今日', + desc: (title === '保养' || title === '巡检') ? '本月' : '今日', total: { number: [total], content: '{nt}', From 62dfb4b75cfafb499873c8d29239aee40ec2bf5f Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 20 May 2025 13:22:25 +0800 Subject: [PATCH 4/5] =?UTF-8?q?update=20-=20ems=E4=B8=9A=E6=80=81=E8=83=BD?= =?UTF-8?q?=E8=80=97=E5=88=86=E6=9E=90=E4=BC=98=E5=8C=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../businessEnergyConsumptionAnalysis/index.vue | 17 ++++++++++++----- .../energyConsumptionTrendAnalysis/index.vue | 13 +++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/views/energy/report/businessEnergyConsumptionAnalysis/index.vue b/src/views/energy/report/businessEnergyConsumptionAnalysis/index.vue index fdf5b40..5f4a12f 100644 --- a/src/views/energy/report/businessEnergyConsumptionAnalysis/index.vue +++ b/src/views/energy/report/businessEnergyConsumptionAnalysis/index.vue @@ -63,7 +63,7 @@ value-format="yyyy-MM-dd HH:mm:ss" :placeholder="getDatePickerPlaceholder" style="width: 240px" - @change="handleQuery" + @change="handleEndTimeChange" /> @@ -418,9 +418,8 @@ export default { const now = new Date(); const startTime = new Date(now.setHours(0, 0, 0, 0)); const endTime = new Date(now.setHours(23, 59, 59, 999)); - this.queryParams.startTime = this.formatDateTime(startTime, this.queryParams.type); - this.queryParams.endTime = this.formatDateTime(endTime, this.queryParams.type); + this.queryParams.endTime = this.getEndDateTime(endTime, this.queryParams.type); }, initCharts() { @@ -480,13 +479,21 @@ export default { handleTimeRangeChange(type) { const now = new Date(); const startTime = new Date(now.setHours(0, 0, 0, 0)); - const endTime = new Date(now.setHours(23, 59, 59, 999)); - + const endTime = new Date(now); this.queryParams.startTime = this.formatDateTime(startTime, type); this.queryParams.endTime = this.getEndDateTime(endTime, type); this.handleQuery(); }, + // 监听结束时间变化 + handleEndTimeChange(time) { + if (time) { + const date = new Date(time); + this.queryParams.endTime = this.getEndDateTime(date, this.queryParams.type); + this.handleQuery(); + } + }, + //数组转树形结构 tranListToTreeData(list) { // 最终要产出的树状数据的数组 diff --git a/src/views/energy/report/energyConsumptionTrendAnalysis/index.vue b/src/views/energy/report/energyConsumptionTrendAnalysis/index.vue index 3b84324..b9ee684 100644 --- a/src/views/energy/report/energyConsumptionTrendAnalysis/index.vue +++ b/src/views/energy/report/energyConsumptionTrendAnalysis/index.vue @@ -63,7 +63,7 @@ value-format="yyyy-MM-dd HH:mm:ss" :placeholder="getDatePickerPlaceholder" style="width: 240px" - @change="handleQuery" + @change="handleEndTimeChange" /> @@ -322,7 +322,7 @@ export default { const endTime = new Date(now.setHours(23, 59, 59, 999)); this.queryParams.startTime = this.formatDateTime(startTime, this.queryParams.type); - this.queryParams.endTime = this.formatDateTime(endTime, this.queryParams.type); + this.queryParams.endTime = this.getEndDateTime(endTime, this.queryParams.type); }, initCharts() { @@ -386,6 +386,15 @@ export default { this.handleQuery(); }, + // 监听结束时间变化 + handleEndTimeChange(time) { + if (time) { + const date = new Date(time); + this.queryParams.endTime = this.getEndDateTime(date, this.queryParams.type); + this.handleQuery(); + } + }, + //数组转树形结构 tranListToTreeData(list) { // 最终要产出的树状数据的数组 From bb0c2658531ec5d11d09d389b5362d516ad73d28 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 21 May 2025 18:15:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=BB=91=E8=9A=8A=E9=A6=99=E8=BD=A6?= =?UTF-8?q?=E9=97=B4=E7=94=9F=E4=BA=A7=E7=9B=91=E6=8E=A7=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yangwl <1726150332@qq.com> --- src/api/device/faultReport.js | 10 +++ src/views/cs/index.vue | 120 ++++++++++++++-------------------- 2 files changed, 60 insertions(+), 70 deletions(-) diff --git a/src/api/device/faultReport.js b/src/api/device/faultReport.js index ad5344f..186779f 100644 --- a/src/api/device/faultReport.js +++ b/src/api/device/faultReport.js @@ -9,6 +9,16 @@ export function listFaultReport(query) { }); } +// 查询故障报修列表 +export function getCsRepairlist(query) { + return request({ + url: '/device/faultReport/getCsRepairlist', + method: 'get', + params: query + }); +} + + // 查询故障报修详细 export function getFaultReport(orderId) { return request({ diff --git a/src/views/cs/index.vue b/src/views/cs/index.vue index bf39099..433c199 100644 --- a/src/views/cs/index.vue +++ b/src/views/cs/index.vue @@ -193,16 +193,18 @@ import {getDailyReportNew} from "../../api/mes/reportWork"; import moment from 'moment'; +import { getCsRepairlist } from "@/api/device/faultReport"; export default { data() { return { - url: "ws://192.168.202.34:9208/websocket/message", + url:"ws://localhost:9208/websocket/message", message: "", text_content: "", scrollText: "", repairOrders:[], ws: null, + timer: null, // 查询参数 queryParams: { timeArray: [], @@ -397,6 +399,15 @@ export default { ] } }, + + mounted() { + this.getDate(); + this.timer = setInterval(() => { + this.getlistFaultReport(); + }, 10000); + this.startAutoScroll(); + }, + methods: { Fungetdate(num) { var dd = new Date(); @@ -463,90 +474,59 @@ export default { tableBody.scrollTop = scrollTop } - }, 50) // 调整时间间隔控制滚动速度 + }, 3000) // 调整时间间隔控制滚动速度 }, stopAutoScroll() { clearInterval(this.scrollInterval) }, - join() { - const wsuri = this.url; - this.ws = new WebSocket(wsuri); - const self = this; - this.ws.onopen = function (event) { - self.text_content = self.text_content + "已经打开连接!" + "\n"; - }; - this.ws.onmessage = function (event) { - self.text_content = event.data + "\n"; - console.log(self.text_content); - try { - // 解析JSON数据 - const receivedData = JSON.parse(event.data) - if (Array.isArray(receivedData)) { - // 更新响应式数据 - this.repairOrders = receivedData.map(item => ({ - ...item, - })) - const descList = receivedData.map(item => - `${item.params?.equipmentName || '未知'} ${item.orderDesc || '无故障描述'} 维修人:${item.orderRepairmanName}` - ); - this.scrollText = descList.join('★★★★★★★★'); // 用两个全角空格分隔 + //设备故障信息 + getlistFaultReport(){ + const _this = this; + const param ={ + pageNum: 1, + pageSize: 20 + } + getCsRepairlist(param).then((response) => { + if (response) { + console.log(response) + // 更新响应式数据 + this.repairOrders = response.map(item => ({ + ...item, + })) + const descList = response.map(item => + `${item.params?.equipmentName || '未知'} ${item.params?.auxiliaryequipmentName || '未知'} ${item.orderDesc || '无故障描述'}` + ); + this.scrollText = descList.join('★★★★★★★★'); // 用两个全角空格分隔 // 提取所有有效的设备名称 - const activeEquipmentNames = new Set( - receivedData - .map(item => item.params?.equipmentName) - .filter(name => name) - ); + const activeEquipmentNames = new Set( + response.map(item => item.params?.equipmentName) + .filter(name => name) + ); - // 更新infoData的高亮状态 - this.infoData.forEach((item, index) => { - if (activeEquipmentNames.has(item.equipmentName)) { - // 响应式设置alpha - this.$set(this.infoData[index], 'alpha', '#CB4C4C80'); - } else { - // 移除alpha属性 - if (this.infoData[index].hasOwnProperty('alpha')) { - this.$delete(this.infoData[index], 'alpha'); - } + // 更新infoData的高亮状态 + this.infoData.forEach((item, index) => { + if (activeEquipmentNames.has(item.equipmentName)) { + // 响应式设置alpha + this.$set(this.infoData[index], 'alpha', '#CB4C4C80'); + } else { + // 移除alpha属性 + if (this.infoData[index].hasOwnProperty('alpha')) { + this.$delete(this.infoData[index], 'alpha'); } - }); - - } else { - console.warn('收到非数组格式数据:', receivedData) - } - } catch (error) { - console.error("JSON parsing failed:", error) - this.$notify.error({ title: '数据错误', message: '接收数据格式异常' }) + } + }); } - }.bind(this);; - this.ws.onclose = function (event) { - self.text_content = self.text_content + "已经关闭连接!" + "\n"; - }; - }, - exit() { - if (this.ws) { - this.ws.close(); - this.ws = null; - } - }, - send() { - if (this.ws) { - this.ws.send(this.message); - } else { - alert("未连接到服务器"); - } + }) }, }, created(){ - this.join(); + }, - mounted() { - this.getDate(); - this.startAutoScroll(); - }, + beforeDestroy() { this.stopAutoScroll() }, @@ -999,7 +979,7 @@ export default { .scroll-title-content { position: absolute; white-space: nowrap; - animation: scroll 15s linear infinite; + animation: scroll 15s linear infinite; /* 将15s改为30s使速度减半 */ font-size: 18px; color: #00f7ff; line-height: 30px;