From 73fe3c5574c8fbb7b18fa9b76d53b918f6f921e1 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 12 十一月 2025 11:09:04 +0800
Subject: [PATCH] 更换前端打包方式,将ip地址配置提取到public
---
UI-Project/src/views/largescreen/largescreen.vue | 898 +++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 652 insertions(+), 246 deletions(-)
diff --git a/UI-Project/src/views/largescreen/largescreen.vue b/UI-Project/src/views/largescreen/largescreen.vue
index a972dbe..827d1cf 100644
--- a/UI-Project/src/views/largescreen/largescreen.vue
+++ b/UI-Project/src/views/largescreen/largescreen.vue
@@ -1,255 +1,661 @@
-<template>
- <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
- <el-scrollbar height="600px">
- <div id="app" style="margin-top: 20px;">
- <div
- :style="{ width: `${olWidth}px`, height: `${olHeight}px`,position: 'relative' }"
- >
- <div
- v-for="(rect, index) in adjustedRects"
- :key="rect.glass_id"
- class="rect"
- @click="showDialog(rect.glass_id)"
- :style="{ position: 'absolute',
- top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`,
- backgroundColor: getRectColor(rect.glass_state)
- }"
- >
- <!-- 绠ご -->
- <!-- <div id="arrow"></div>
- <div id="line"></div> -->
- <!-- <div class="centered-text" >NG24030401B01</div> -->
- <div class="centered-text">
- <div>{{ rect.process_id }}</div>
- <div style="margin-top: 50px;margin-left: -85px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
+<template>
+ <div style="height: 500px;">
+ <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" >
+ <el-scrollbar height="800px">
+ <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" @click="showDialog">
+ <div :id="'pieChart_' + index" class="pie-chart"></div>
+ </div>
+ </div>
+ </div>
+ <div style="display: flex;">
+<div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
+ <img src="/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
+ <div class="moving-rect lipiana" v-show="woshia"></div>
+ <div class="moving-rect lipianb" v-show="woshia"></div>
+ <div class="moving-rect lipianc" v-show="woshic"></div>
+ <div class="moving-rect lipiand" v-show="woshic"></div>
+ <div class="moving-rect overlaya" v-show="flake"></div>
+ <div class="moving-rect overlayb" v-show="flakeb"></div>
+ <div class="moving-rect overlayc" v-show="flakec"></div>
+ <div class="moving-rect longa" v-show="dalipiana"></div>
+ <div class="moving-rect longb" v-show="dalipianb"></div>
+ <div class="moving-rect shangpianji" v-show="shangpian"></div>
+ <div class="moving-rect xiapianji" v-show="xiapian"></div>
+ <div class="moving-rect xiapianji1" v-show="xiapian1"></div>
+ <div class="moving-rect xiapianji2" v-show="xiapian2"></div>
+ <div class="moving-rect xiapianji3" v-show="xiapian3"></div>
+ <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>
+</div>
+<div id="bottom" style="margin-top: 10px;height: 190px;">
+<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" />
+ <el-table-column prop="customerName" align="center" :show-overflow-tooltip="true" :label="$t('large.customerName')" min-width="90" />
+ <el-table-column prop="project" align="center" :label="$t('large.project')" min-width="50" />
+ <el-table-column prop="area" align="center" :label="$t('large.are')" min-width="50" />
+ <el-table-column prop="quantity" align="center" :label="$t('large.quantity')" min-width="50" />
+ <el-table-column
+ align="center"
+ :label="$t('large.warehousing')"
+ min-width="50"
+ prop="warehousing"
+ >
+ <template #default="scope">
+ <el-tag :type="getStatusType(scope.row.warehousing)">
+ {{ getStatusText(scope.row.warehousing) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="deliveryDate" align="center" :label="$t('large.deliveryDate')" min-width="100" />
+ <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100">
+ <template #default="scope">
+ <el-button type="text" plain @click="handleBinda(scope.row)">{{ $t('large.mes') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+</div>
+</el-scrollbar>
+</el-card>
+<el-dialog v-model="blinda" top="5vh" width="85%">
+ <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" />
+ <el-table-column prop="project" align="center" :label="$t('large.project')" min-width="110" />
+ <el-table-column prop="processId" align="center" :label="$t('large.cardnumber')" min-width="110" />
+ <el-table-column prop="orderNumber" align="center" :label="$t('large.serialnumber')" min-width="110" />
+ <el-table-column prop="productName" align="center" :label="$t('large.productname')" min-width="110" />
+ <el-table-column prop="width" align="center" :label="$t('large.width')" min-width="100" />
+ <el-table-column prop="height" align="center" :label="$t('large.height')" min-width="100" />
+ <el-table-column prop="area" align="center" :label="$t('large.are')" min-width="100" />
+ <el-table-column prop="quantity" align="center" :label="$t('large.tionnumber')" min-width="110" />
+ <el-table-column prop="numberPatches" align="center" :label="$t('large.numberpatches')" min-width="110" />
+ <el-table-column prop="receivedQuantity" align="center" :label="$t('large.innumber')" min-width="110" />
+ <el-table-column prop="terminationStatus" align="center" :label="$t('large.productstatus')" min-width="110" />
+ <el-table-column
+ align="center"
+ :label="$t('large.productstatus')"
+ min-width="80"
+ prop="terminationStatus"
+ >
+ <template #default="scope">
+ <el-tag
+ :type="scope.row.terminationStatus === 0 ? 'success' : 'danger'"
+ >
+ {{ scope.row.terminationStatus === 0 ? $t('large.right') : $t('large.stop') }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="packType" align="center" :label="$t('large.quantity')" min-width="110" />
+ <el-table-column prop="projectNo" align="center" :label="$t('large.projectnumber')" min-width="110" />
+ </el-table>
+ <template #footer>
+ <div id="dialog-footer" style="text-align: center;">
+ <el-button @click="blinda = false">{{ $t('large.close') }}</el-button>
+ </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>
- </div>
- <!-- 鐐瑰嚮寮瑰嚭 -->
- <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
- <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
- {{ $t('order.dilapidation') }}
- </el-button>
- <el-button type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;">
- <el-icon class="el-icon--right"><Upload /></el-icon>
- {{ $t('order.Takeaway') }}</el-button>
- </el-dialog>
- </div>
- </div>
- </el-scrollbar>
- </el-card>
-</template>
-<script setup lang="ts">
-import { Delete, Upload } from '@element-plus/icons-vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, onMounted, onBeforeUnmount } from 'vue';
+</el-dialog>
+ </div>
+</template>
+<script setup>
+import {ElMessage} from 'element-plus'
+import {nextTick, onBeforeUnmount, onMounted, onUnmounted, ref} from "vue";
import request from "@/utils/request"
-import { WebSocketHost ,host} from '@/utils/constants'
-import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
- import { useI18n } from 'vue-i18n'
- const { t } = useI18n()
- let language = ref(localStorage.getItem('lang') || 'zh')
-const blind = ref(false)
-const olWidth = ref();
-const olHeight = ref();
-const process_id = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤
-const glass_id = ref();
-// const rects = ref([]); // 鐢ㄤ簬瀛樺偍鐭╁舰鏁版嵁鐨勫搷搴斿紡寮曠敤
-const currentGlassId = ref(null); // 瀛樺偍褰撳墠鐐瑰嚮鐭╁舰鐨� glass_id
+import {host, WebSocketHost} from '@/utils/constants'
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+import {useI18n} from 'vue-i18n'
+import * as echarts from 'echarts';
+const {t} = useI18n()
+const tableData = ref([])
+const tableDatab = ref([])
+const tableDatac = ref([])
const adjustedRects = ref([]);
-// const handleBind = (row) => {
-// blind.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
-// };
-// 鏄剧ず瀵硅瘽妗嗗苟璁剧疆褰撳墠 glass_id
-function showDialog(glassId: number) {
- currentGlassId.value = glassId;
+const chartRefs = ref([]);
+const timeRange = ref([])
+const flake = ref(false)
+const flakeb = ref(false)
+const flakec = ref(false)
+const woshia = ref(false)
+const woshic = ref(false)
+const dalipiana = ref(false)
+const dalipianb = ref(false)
+const shangpian = ref(false)
+const xiapian = ref(false)
+const xiapian1 = ref(false)
+const xiapian2 = ref(false)
+const xiapian3 = ref(false)
+const xiapian4 = ref(false)
+const xiapian5 = ref(false)
+const xiapian6 = ref(false)
+const blind = ref(false)
+const temperingtotal = ref(0)
+const thisProcess = ref();
+const chartDom = ref(null);
+let chartInstance = null;
+const blinda = ref(false)
+const handleBinda = async (row) => {
+ blinda.value = true;
+ await fetchFlowCardId(row.orderId);
+};
+const processesData = ref([]);
+const dialogprocesses = ref([]);
+const fetchFlowCardId = async (orderId) => {
+ try {
+ const response = await request.post('/loadGlass/order/order/selectOrderdetail',{
+ orderId: orderId
+ })
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ tableData.value = response.data;
+ } else {
+ ElMessage.error(response.message);
+ }
+}
+catch (error) {
+ console.error(error);
+ }
+}
+function getStatusType(warehousing) {
+switch (warehousing) {
+ case 0:
+ return 'info';
+ case 1:
+ return 'warning';
+ case 2:
+ return 'success';
+}
+}
+function getStatusText(warehousing) {
+switch (warehousing) {
+ case 0:
+ return t('large.notstocked');
+ case 1:
+ return t('large.inboundstatus');
+ case 2:
+ return t('large.allstatus');
+}
+}
+let socket = null;
+let socket2 = null;
+let socket3 = null;
+let socket4 = null;
+let socket5 = null;
+let socket6 = null;
+const socketUrl = `ws://${window.ipConfig.serverUrl}/api/temperingGlass/api/talk/screen`;
+const handleMessage = (data) => {
+tableDatab.value = data.DoingTask[0]
+tableDatac.value = data.orders[0]
+ socket.onmessage = (event) => {
+ const data = JSON.parse(event.data);
+ processesData.value = data.device[0].map(rect => ({
+ ...rect,
+ completedQuantity: rect.completedQuantity,
+ breakageQuantity: rect.breakageQuantity,
+ thisProcess: rect.thisProcess,
+ }));
+ renderPieCharts();
+}
+};
+function setChartDom(index, el) {
+if (!chartRefs.value[index]) {
+ chartRefs.value[index] = { dom: el, chart: null };
+} else {
+ chartRefs.value[index].dom = el;
+}
+}
+const socketUrl2 = `ws://${window.ipConfig.serverUrl}/api/temperingGlass/api/talk/temperingIsRun`;
+const handleMessage2 = (data) => {
+ const tasks = data.temperingTaskType[0];
+ flake.value = tasks.some(task => task.state == 1);
+ flakeb.value = tasks.some(task => task.state == 2);
+ flakec.value = tasks.some(task => task.state == 3);
+};
+// 鍗у紡鐞嗙墖
+const socketUrl3 = `ws://${window.ipConfig.serverUrl}/api/cacheGlass/api/talk/cacheGlassIsRun`;
+const handleMessage3 = (data) => {
+ const tasks = data.taskCaches[0];
+ woshia.value = tasks.some(task => task.line == 2001);
+ woshic.value = tasks.some(task => task.line == 2002);
+};
+// 澶х悊鐗囩
+const socketUrl4 = `ws://${window.ipConfig.serverUrl}/api/cacheVerticalGlass/api/talk/isRun`;
+const handleMessage4 = (data) => {
+ const tasks = data.bigStorageCageDetailsOutTask[0];
+ dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined);
+ const taskss = data.bigStorageCageDetailsFeedTask[0];
+dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined);
+};
+// 涓婄墖
+const socketUrl5 = `ws://${window.ipConfig.serverUrl}/api/loadGlass/api/talk/loadGlassIsRun`;
+const handleMessage5 = (data) => {
+ const tasks = data.engineering;
+ shangpian.value = tasks.some(task => task.state == 1);
+ temperingtotal.value = data.engineering[0].engineerId
+ };
+// 涓嬬墖
+const socketUrl6 = `ws://${window.ipConfig.serverUrl}/api/unLoadGlass/api/talk/unLoadGlassIsRun`;
+const handleMessage6 = (data) => {
+ const tasks = data.downWorkstation[0];
+ const tasks1 = data.downGlassTask[0];
+ xiapian.value = tasks1.some(task => task.thickness!== '');
+ if (tasks && tasks.length >= 6) {
+ xiapian1.value = tasks[0].racksNumber !== 0;
+ xiapian2.value = tasks[1].racksNumber !== 0;
+ xiapian3.value = tasks[2].racksNumber !== 0;
+ xiapian4.value = tasks[3].racksNumber !== 0;
+ xiapian5.value = tasks[4].racksNumber !== 0;
+ xiapian6.value = tasks[5].racksNumber !== 0;
+ }
+};
+const renderPieCharts = () => {
+processesData.value.forEach((data, index) => {
+ const chart = echarts.init(document.getElementById('pieChart_' + 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);
+});
+};
+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);
+});
+};
+onMounted(() => {
+ socket = initializeWebSocket(socketUrl, handleMessage);
+ socket2 = initializeWebSocket(socketUrl2, handleMessage2);
+ socket3 = initializeWebSocket(socketUrl3, handleMessage3);
+ socket4 = initializeWebSocket(socketUrl4, handleMessage4);
+ socket5 = initializeWebSocket(socketUrl5, handleMessage5);
+ socket6 = initializeWebSocket(socketUrl6, handleMessage6);
+});
+ onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+ if (socket2) {
+ closeWebSocket2(socket2);
+ }
+ if (socket3) {
+ closeWebSocket3(socket3);
+ }
+ if (socket4) {
+ closeWebSocket4(socket4);
+ }
+ if (socket5) {
+ closeWebSocket5(socket5);
+ }
+ if (socket6) {
+ closeWebSocket6(socket6);
+ }
+ });
+onBeforeUnmount(() => {
+closeWebSocket();
+closeWebSocket2();
+closeWebSocket3();
+closeWebSocket4();
+closeWebSocket5();
+closeWebSocket6();
+});
+function showDialog() {
blind.value = true;
}
-onMounted(async () => {
- try {
- const response = await request.post('/cacheGlass/taskCache/currentCutTerritory'); // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (response.code === 200) {
- // const process_id = response.data[0].process_id
- const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
- console.log(response.data);
- const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id ,glass_id:newglass_id } = response.data; // 鑾峰彇灏哄
- olWidth.value = newolWidth; // 璁剧疆瀹瑰櫒瀹藉害
- olHeight.value = newolHeight; // 璁剧疆瀹瑰櫒楂樺害
- process_id.value = newprocess_id;
- glass_id.value = newglass_id;
-
- adjustedRects.value = rawRects.map(rect => ({
- ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- x_axis: (rect.x_axis*100) * 0.003, // 灏唜鍊奸櫎浠�3
- y_axis: (rect.y_axis*100) * 0.003,
- width: (rect.width*100) * 0.002 ,
- widtha: rect.width ,
- heighta: rect.height ,
- height:( rect.height*100) * 0.002 ,
- glass_state: rect.glass_state
- }));
- console.log(adjustedRects.value);
-
-
- // console.log( (rect.width*100) / 300 );
- } else {
- // console.error('Failed to fetch rectangles from API.');
- console.error('Failed to fetch rects from API.');
- }
- } catch (error) {
- // console.error('Error fetching rectangles :', error);
- console.error('Error fetching rects :', error);
- }
-});
-// 鐮存崯
-const handleDamage = async () => {
- try {
- var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+201;
- console.log(url);
- const response = await request.post(url)
- // const response = await request.post('/cacheGlass/taskCache/identControls', {
- // identId: currentGlassId.value,
- // controlsId: 201,
- // })
- if (response.code == 200) {
- // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
- ElMessage.success(response.message);
- // window.location.reload()
- blind.value = false;
- updateRectStatus(currentGlassId.value, 201);
- } else {
- // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
- }
-}
-catch (error) {
- // 澶勭悊閿欒
- console.error(error);
+// 鏌ヨ鏁版嵁
+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) {
+ 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);
}
-}
-// // 浜哄伐鎷胯蛋
-const handleManualTake = async () => {
- try {
- var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200;
- console.log(url);
- const response = await request.post(url)
- // const response = await request.post('/cacheGlass/taskCache/identControls', {
- // identId: currentGlassId.value,
- // controlsId: 200,
- // })
- if (response.code == 200) {
- // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
- ElMessage.success(response.message);
- // window.location.reload()
- blind.value = false;
- updateRectStatus(currentGlassId.value, 200);
- } else {
- // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
- }
-}
-catch (error) {
- // 澶勭悊閿欒
- console.error(error);
- }
-}
-function getRectColor(state: number): string {
- switch (state) {
- case 0:
- return '#e1f3d8';
- case 100:
- return '#c8c9cc';
- case 110:
- return '#b3e19d';
- case 120:
- return '#f89898';
- case 200:
- return 'lightblue';
- case 201:
- return '#f3d19e';
- default:
- return '#911005'; // 榛樿棰滆壊
- }
-}
-// 鏇存柊鐭╁舰鐘舵��
-function updateRectStatus(glassId: string, status: number) {
- adjustedRects.value.forEach(rect => {
- if (rect.glass_id === glassId) {
- rect.glass_state = status; // 鏇存柊鐭╁舰鐨勭姸鎬�
- }
- });
-}
-const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
-// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
-const handleMessage = (data) => {
- // 鏇存柊 tableData 鐨勬暟鎹�
-
- // adjustedRects.value = data.currentCutTerritory[0]
- adjustedRects.value = data.currentCutTerritory[0].map(rect => ({
- ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- x_axis: (rect.x_axis*100) * 0.003, // 灏唜鍊奸櫎浠�3
- y_axis: (rect.y_axis*100) * 0.003,
- width: (rect.width*100) * 0.002 ,
- widtha: rect.width ,
- heighta: rect.height ,
- height:( rect.height*100) * 0.002 ,
- glass_state: rect.glass_state
- }));
- // console.log("鏇存柊鍚庢暟鎹�", tableData);
-
};
-
-// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
-
-onMounted(() => {
- // fetchFlowCardId();
- // fetchTableData(); // 鑾峰彇鏁版嵁
- initializeWebSocket(socketUrl, handleMessage);
-});
-
-onBeforeUnmount(() => {
- console.log("鍏抽棴浜�")
- closeWebSocket();
-});
-</script>
-
+</script>
<style scoped>
-.rect {
- border: 1px solid black; /* 璁剧疆鐭╁舰鐨勮竟妗� */
- /* background-color: lightblue; 璁剧疆鐭╁舰鐨勮儗鏅壊 */
-}
-.centered-text {
- /* 璁剧疆鏂囧瓧灞呬腑鏍峰紡 */
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */
-}
-#rect {
- position: relative; /* 纭繚绠ご鍙互鐩稿浜庣煩褰㈠畾浣� */
- /* 鍏朵粬鏍峰紡 */
-}
-
-#arrow {
- position: absolute;
- top: 70%; /* 绠ご浣嶄簬鐭╁舰涓棿 */
- left: 200px; /* 绠ご鍦ㄧ煩褰㈠乏渚т竴浜涜窛绂� */
- transform: translateY(-50%); /* 鍨傜洿灞呬腑 */
- width: 0;
- height: 0;
- border-top: 10px solid transparent; /* 涓婅竟妗� */
- border-bottom: 10px solid transparent; /* 涓嬭竟妗� */
- border-right: 20px solid #911005; /* 鍙宠竟妗嗭紝褰㈡垚绠ご */
- /* 鏍规嵁闇�瑕佽皟鏁磋竟妗嗗ぇ灏忓拰棰滆壊 */
-}
-
-#line {
- position: absolute;
- top: 70%; /* 鐩寸嚎浣嶄簬鐭╁舰涓棿 */
- left: 210px; /* 鐩寸嚎鍦ㄧ澶村彸渚т竴浜涜窛绂� */
- transform: translateY(-50%); /* 鍨傜洿灞呬腑 */
- height: 2px; /* 鐩寸嚎鐨勯珮搴� */
- width: 240px; /* 鐩寸嚎鐨勯暱搴︼紝鏍规嵁闇�瑕佽皟鏁� */
- background-color: #911005; /* 鐩寸嚎鐨勯鑹� */
-}
-
+.echarts-container {
+display: flex;
+flex-wrap: wrap;
+gap: 20px;
+}
+.echarts-item {
+width: 120px;
+height: 150px;
+margin: 20px;
+}
+.pie-chart {
+width: 100%;
+height: 100%;
+}
+.parter {
+ position: relative;
+ display: inline-block; /* 浣垮鍣ㄥぇ灏忛�傚簲鍥剧墖澶у皬 */
+ width: 1500px;
+ margin-left: -300px
+}
+img {
+ display: block; /* 璁╁浘鐗囦互鍧楃骇鍏冪礌鏄剧ず */
+ max-width: 100%; /* 纭繚鍥剧墖涓嶈秴鍑哄鍣� */
+}
+.moving-rect {
+ width: 100px;
+ height: 50px;
+ position: absolute;
+}
+.longa{
+ z-index: 1;
+ width: 33px;
+ height: 5px;
+ background-color: #529b2e;
+ margin-top: -15px;
+ margin-left: 130px;
+}
+.longb{
+ z-index: 1;
+ width: 33px;
+ height: 5px;
+ background-color: #529b2e;
+ margin-top: -15px;
+ margin-left: 235px;
+}
+.xiapianji1{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -206px;
+ margin-left: 173px;
+}
+.xiapianji2{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -206px;
+ margin-left: 217px;
+}
+.xiapianji3{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -195px;
+ margin-left: 196px;
+}
+.xiapianji4{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -206px;
+ margin-left: 270px;
+}
+.xiapianji5{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -206px;
+ margin-left: 314px;
+}
+.xiapianji6{
+ z-index: 1;
+ width: 12px;
+ height: 7px;
+ background-color: #529b2e;
+ margin-top: -195px;
+ margin-left: 293px;
+}
+.xiapianji {
+ width: 20px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 9px;
+ left: 200px;
+ transform: translateX(-50%);
+ animation: move-xiapianji 15s infinite;
+}
+@keyframes move-xiapianji {
+ 0% {
+ left: 200px;
+ }
+ 100% {
+ left: calc(100% - 700px);
+ }
+}
+.lipiana {
+ width: 15px;
+ height: 9px;
+ background-color: #529b2e;
+ top: 190px;
+ right: 530px;
+ transform: translateX(-50%);
+ animation: move-lipiana 15s infinite;
+}
+@keyframes move-lipiana {
+ 0% {
+ right: 530px;
+ }
+ 100% {
+ right: calc(100% - 350px);
+ }
+}
+.lipianb {
+ width: 18px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 160px;
+ left: 502px;
+ transform: translateX(-50%);
+ animation: move-lipianb 15s infinite;
+}
+@keyframes move-lipianb {
+ 0% {
+ top: 160px;
+ }
+ 100% {
+ top: calc(100% - 55px);
+ }
+}
+.lipianc {
+ width: 15px;
+ height: 9px;
+ background-color: #529b2e;
+ top: 215px;
+ right: 490px;
+ transform: translateX(-50%);
+ animation: move-lipianc 15s infinite;
+}
+@keyframes move-lipianc {
+ 0% {
+ right: 490px;
+ }
+ 100% {
+ right: calc(100% - 350px);
+ }
+}
+.lipiand {
+ width: 25px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 160px;
+ left: 555px;
+ transform: translateX(-50%);
+ animation: move-lipiand 15s infinite;
+}
+@keyframes move-lipiand {
+ 0% {
+ top: 160px;
+ }
+ 100% {
+ top: calc(100% - 40px);
+ }
+}
+.overlaya {
+ width: 15px;
+ height: 9px;
+ background-color: #529b2e;
+ top: 213px;
+ right: 800px;
+ transform: translateX(-50%);
+ animation: move-overlaya 15s infinite;
+}
+@keyframes move-overlaya {
+ 0% {
+ right: 880px;
+ }
+ 100% {
+ right: calc(100% - 15px);
+ }
+}
+.overlayb {
+ width: 20px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 110px;
+ left: 13px;
+ transform: translateX(-50%);
+ animation: move-overlayb 15s infinite;
+}
+@keyframes move-overlayb {
+ 0% {
+ top: 160px;
+ }
+ 100% {
+ top: calc(100% - 190px);
+ }
+}
+.overlayc {
+ width: 20px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 7px;
+ left: 13px;
+ transform: translateX(-50%);
+ animation: move-overlayc 15s infinite;
+}
+@keyframes move-overlayc {
+ 0% {
+ left: 20px;
+ }
+ 100% {
+ left: calc(100% - 900px);
+ }
+}
+.shangpianji {
+ width: 20px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 157px;
+ right: 90px;
+ transform: translateX(-50%);
+ animation: move-shangpianji 15s infinite;
+}
+@keyframes move-shangpianji {
+ 0% {
+ right: 90px;
+ }
+ 100% {
+ right: calc(100% - 770px);
+ }
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0