wu
2024-12-23 b9b44b51b201e2f5a9a1f3665c7fb76b5690f9af
UI-Project/src/views/largescreen/largescreen.vue
@@ -1,15 +1,16 @@
<template>
  <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading">
    <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;">
<template>
  <div style="height: 500px;">
    <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading">
      <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="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
  <div  class="moving-rect lipiana" v-show="woshia"></div>
@@ -94,8 +95,6 @@
          </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-column prop="processingNote" fixed align="center" :label="$t('large.method')" min-width="110" /> -->
        <!-- <el-table-column prop="deliveryDate" fixed align="center" :label="$t('large.deliveryDate')" min-width="130" /> -->
      </el-table>
  <template #footer>
    <div id="dialog-footer" style="text-align: center;">
@@ -104,33 +103,36 @@
  </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>
  <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>
  </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,nextTick  } from "vue";
</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()
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 chartRefs = ref([]);
const adjustedRects = ref([]);
const chartRefs = ref([]);
const timeRange = ref([])
const flake = ref(false)
const flakeb = ref(false)
@@ -149,9 +151,7 @@
const xiapian6 = ref(false)
const blind = ref(false)
const temperingtotal = ref(0)
const thisProcess = ref(); // 用于存储process_id的响应式引用
// 定义一个响应式引用来存储图表实例
const thisProcess = ref();
const chartDom = ref(null);  
let chartInstance = null;  
const blinda = ref(false)
@@ -175,7 +175,6 @@
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
@@ -207,13 +206,10 @@
let socket6 = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`;
const handleMessage = (data) => {
// tableData.value = data.awaitingRepairs[0]
tableDatab.value = data.DoingTask[0]
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,  
@@ -312,7 +308,6 @@
      }
    ]
  };
  chart.setOption(options);
});
};
@@ -354,7 +349,6 @@
      }
    ]
  };
  chart.setOption(options);
});
};
@@ -405,8 +399,6 @@
    reportingWorkTime2: timeRange.value[1],
  })
  if (response.code === 200) {
    console.log(response.data);
    dialogprocesses.value = response.data.map(rect => ({  
    ...rect,  
    completedQuantity: rect.completedQuantity,  
@@ -415,14 +407,12 @@
  }));  
  await nextTick();
  renderPieCharts1();
    ElMessage.success(response.message);
  } else {
    ElMessage.error(response.message);
  }
};
</script>
</script>
<style scoped>  
.echarts-container {
display: flex;
@@ -439,19 +429,19 @@
height: 100%;
}
.parter {
    position: relative;
    display: inline-block; /* 使容器大小适应图片大小 */
  width: 1500px;
  margin-left: -300px
 position: relative;
 display: inline-block; /* 使容器大小适应图片大小 */
 width: 1500px;
 margin-left: -300px
}
img {
    display: block; /* 让图片以块级元素显示 */
    max-width: 100%; /* 确保图片不超出容器 */
 display: block; /* 让图片以块级元素显示 */
 max-width: 100%; /* 确保图片不超出容器 */
}
.moving-rect {
    width: 100px;
    height: 50px;
    position: absolute;
 width: 100px;
 height: 50px;
 position: absolute;
}
.longa{
  z-index: 1;
@@ -518,13 +508,13 @@
  margin-left: 293px;
}
.xiapianji {
    width: 20px;
    height: 10px;
    background-color: #529b2e;
    top: 9px;
    left: 200px;
    transform: translateX(-50%);
    animation: move-xiapianji 15s infinite;
 width: 20px;
 height: 10px;
 background-color: #529b2e;
 top: 9px;
 left: 200px;
 transform: translateX(-50%);
 animation: move-xiapianji 15s infinite;
}
@keyframes move-xiapianji {
    0% {