From 9504a29fb713d536022aec6a3b147119870f0c2b Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期二, 27 八月 2024 09:18:26 +0800
Subject: [PATCH] 可视化系统,新增点击弹窗查询功能,新增正在上片,调整样式
---
UI-Project/src/lang/zh.js | 4 +
UI-Project/src/views/largescreen/largescreen.vue | 141 +++++++++++++++++++++++++++++++++++-----------
2 files changed, 110 insertions(+), 35 deletions(-)
diff --git a/UI-Project/src/lang/zh.js b/UI-Project/src/lang/zh.js
index 7c79146..b829bb3 100644
--- a/UI-Project/src/lang/zh.js
+++ b/UI-Project/src/lang/zh.js
@@ -455,6 +455,10 @@
projectnumber: '宸ョ▼鍙�',
right: '姝e父',
stop: '缁堟',
+ inquire: '鏌ヨ',
+ starttime :'寮�濮嬫椂闂�',
+ endtime :'缁撴潫鏃堕棿',
+ loading :'姝e湪涓婄墖锛�',
},
reportmanage:{
productiontime :'鐢熶骇鏃堕棿',
diff --git a/UI-Project/src/views/largescreen/largescreen.vue b/UI-Project/src/views/largescreen/largescreen.vue
index c096e5f..024ff7a 100644
--- a/UI-Project/src/views/largescreen/largescreen.vue
+++ b/UI-Project/src/views/largescreen/largescreen.vue
@@ -1,30 +1,15 @@
<template>
<el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading">
<el-scrollbar height="800px">
-<div id="top" style="height: 150px;display: flex;">
+ <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }} </div>
+ <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;">
<div class="echarts-container">
- <div v-for="(processData, index) in processesData" :key="index" class="echarts-item">
+ <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog">
<div :id="'pieChart_' + index" class="pie-chart"></div>
</div>
</div>
</div>
<div style="display: flex;">
-<!-- <div id="centerleft" style="margin-top: 10px;height: 240px;width: 340px;background-color: #911005;">
- <el-table height="240" ref="table" width="340px"
- @selection-change="handleSelectionChange"
- :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column fixed prop="orderId" align="center" :label="$t('large.number')" min-width="110" />
- <el-table-column prop="project" align="center" :label="$t('large.projectname')" min-width="100" />
- <el-table-column prop="responsibleProcess" align="center" :label="$t('large.responsibleprocess')" min-width="100" />
- <el-table-column prop="breakageQuantity" align="center" :label="$t('large.numberfractions')" min-width="110" />
- <el-table-column prop="patchProcesses" align="center" :label="$t('large.process')" min-width="100" />
- <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100">
- <template #default="scope">
- <el-button size="mini" type="text" plain @click="handleBinda">{{ $t('large.mes') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
-</div> -->
<div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
<img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
<div class="moving-rect lipiana" v-show="woshia"></div>
@@ -44,11 +29,10 @@
<div class="moving-rect xiapianji4" v-show="xiapian4"></div>
<div class="moving-rect xiapianji5" v-show="xiapian5"></div>
<div class="moving-rect xiapianji6" v-show="xiapian6"></div>
- <div>姝e湪涓婄墖锛�</div>
</div>
</div>
<div id="bottom" style="margin-top: 10px;height: 190px;">
-<el-table height="390" ref="table"
+<el-table height="350" ref="table"
@selection-change="handleSelectionChange"
:data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
<el-table-column prop="orderId" align="center" :label="$t('large.orderId')" min-width="50" />
@@ -79,7 +63,7 @@
</el-scrollbar>
</el-card>
<el-dialog v-model="blinda" top="5vh" width="85%">
- <el-table height="400" ref="table"
+ <el-table height="650" ref="table"
@selection-change="handleSelectionChange"
:data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
<el-table-column prop="orderId" fixed align="center" :label="$t('large.orderId')" min-width="110" />
@@ -119,11 +103,23 @@
</div>
</template>
</el-dialog>
+<el-dialog v-model="blind" top="10vh" width="70%" >
+ <el-date-picker style="margin-left: 1px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
+ :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')" :default-time="defaultTime" />
+ <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()">{{ $t('large.inquire') }}</el-button>
+ <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;">
+ <div class="echarts-container">
+ <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item">
+ <div :id="'dialogPieChart_' + index" class="pie-chart"></div>
+ </div>
+ </div>
+ </div>
+ </el-dialog>
</template>
<script setup>
import { Delete, Upload } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue";
+import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect,nextTick } from "vue";
import request from "@/utils/request"
import { WebSocketHost ,host} from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -135,6 +131,7 @@
const tableDatac = ref([])
const adjustedRects = ref([]);
const chartRefs = ref([]);
+const timeRange = ref([])
const flake = ref(false)
const flakeb = ref(false)
const flakec = ref(false)
@@ -150,7 +147,9 @@
const xiapian4 = ref(false)
const xiapian5 = ref(false)
const xiapian6 = ref(false)
-
+const blind = ref(false)
+const temperingtotal = ref(0)
+
const thisProcess = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤
// 瀹氫箟涓�涓搷搴斿紡寮曠敤鏉ュ瓨鍌ㄥ浘琛ㄥ疄渚�
const chartDom = ref(null);
@@ -161,6 +160,7 @@
await fetchFlowCardId(row.orderId);
};
const processesData = ref([]);
+const dialogprocesses = ref([]);
const fetchFlowCardId = async (orderId) => {
try {
const response = await request.post('/loadGlass/order/order/selectOrderdetail',{
@@ -212,6 +212,8 @@
tableDatac.value = data.orders[0]
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
+ console.log(data.device[0]);
+
processesData.value = data.device[0].map(rect => ({
...rect,
completedQuantity: rect.completedQuantity,
@@ -255,7 +257,8 @@
const handleMessage5 = (data) => {
const tasks = data.engineering;
shangpian.value = tasks.some(task => task.state == 1);
-};
+ temperingtotal.value = data.engineering[0].engineerId
+ };
// 涓嬬墖
const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`;
const handleMessage6 = (data) => {
@@ -309,7 +312,49 @@
}
]
};
-
+
+ chart.setOption(options);
+});
+};
+const renderPieCharts1 = () => {
+dialogprocesses.value.forEach((data, index) => {
+ const chart = echarts.init(document.getElementById('dialogPieChart_' + index));
+ const options = {
+ title: {
+ text: `${data.thisProcess} `,
+ left: 'center',
+ },
+ tooltip: {
+ trigger: 'item',
+ },
+ series: [
+ {
+ name: `${data.thisProcess} `,
+ type: 'pie',
+ radius: ['40%', '70%'],
+ avoidLabelOverlap: false,
+ data: [
+ { value: data.completedQuantity, name: t('large.completedquantity') },
+ { value: data.breakageQuantity, name: t('large.scrapquantity') }
+ ],
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ },
+ label: {
+ show: false,
+ position: 'center',
+ },
+ labelLine: {
+ show: false
+ },
+ }
+ ]
+ };
+
chart.setOption(options);
});
};
@@ -350,8 +395,34 @@
closeWebSocket5();
closeWebSocket6();
});
-</script>
+function showDialog() {
+ blind.value = true;
+}
+// 鏌ヨ鏁版嵁
+const selectReportData = async () => {
+ const response = await request.post("/loadGlass/reporting_work/reporting-work/selectDamage", {
+ reportingWorkTime: timeRange.value[0],
+ reportingWorkTime2: timeRange.value[1],
+ })
+ if (response.code === 200) {
+ console.log(response.data);
+
+ dialogprocesses.value = response.data.map(rect => ({
+ ...rect,
+ completedQuantity: rect.completedQuantity,
+ breakageQuantity: rect.breakageQuantity,
+ thisProcess: rect.thisProcess,
+ }));
+ await nextTick();
+ renderPieCharts1();
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+};
+</script>
+
<style scoped>
.echarts-container {
display: flex;
@@ -453,7 +524,7 @@
top: 9px;
left: 200px;
transform: translateX(-50%);
- animation: move-xiapianji 6s infinite;
+ animation: move-xiapianji 15s infinite;
}
@keyframes move-xiapianji {
0% {
@@ -470,7 +541,7 @@
top: 190px;
right: 530px;
transform: translateX(-50%);
- animation: move-lipiana 6s infinite;
+ animation: move-lipiana 15s infinite;
}
@keyframes move-lipiana {
0% {
@@ -487,7 +558,7 @@
top: 160px;
left: 502px;
transform: translateX(-50%);
- animation: move-lipianb 6s infinite;
+ animation: move-lipianb 15s infinite;
}
@keyframes move-lipianb {
0% {
@@ -504,7 +575,7 @@
top: 215px;
right: 490px;
transform: translateX(-50%);
- animation: move-lipianc 6s infinite;
+ animation: move-lipianc 15s infinite;
}
@keyframes move-lipianc {
0% {
@@ -521,7 +592,7 @@
top: 160px;
left: 555px;
transform: translateX(-50%);
- animation: move-lipiand 6s infinite;
+ animation: move-lipiand 15s infinite;
}
@keyframes move-lipiand {
0% {
@@ -538,7 +609,7 @@
top: 213px;
right: 800px;
transform: translateX(-50%);
- animation: move-overlaya 6s infinite;
+ animation: move-overlaya 15s infinite;
}
@keyframes move-overlaya {
0% {
@@ -555,7 +626,7 @@
top: 110px;
left: 13px;
transform: translateX(-50%);
- animation: move-overlayb 6s infinite;
+ animation: move-overlayb 15s infinite;
}
@keyframes move-overlayb {
0% {
@@ -572,7 +643,7 @@
top: 7px;
left: 13px;
transform: translateX(-50%);
- animation: move-overlayc 6s infinite;
+ animation: move-overlayc 15s infinite;
}
@keyframes move-overlayc {
0% {
@@ -589,7 +660,7 @@
top: 157px;
right: 90px;
transform: translateX(-50%);
- animation: move-shangpianji 6s infinite;
+ animation: move-shangpianji 15s infinite;
}
@keyframes move-shangpianji {
0% {
--
Gitblit v1.8.0