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;
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}',
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) {
// 最终要产出的树状数据的数组
diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue
index 0b28297..cbf9257 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事件
+ }
+ }, 60000)
+ },
back() {
this.$router.push({ path: "/index" });
},