| | |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost } from '@/utils/constants'; |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456',downGlassInfoList:"" } }, |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '',downGlassInfoList:"" } }, |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '',downGlassInfoList:"" } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: '' ,downGlassInfoList:""} } |
| | | |
| | | ]); |
| | | |
| | |
| | | import { initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const racks = ref([ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '' } }, |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: '' } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: '' } } |
| | | |
| | | ]); |
| | | |
| | |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | | const getTagType =(status) => { |
| | | return status === 1 ? 'success' : 'danger'; |
| | | // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) |
| | | } |
| | | |
| | | const toggleStatus = (row) => { |
| | | // 切换料架状态的逻辑 |
| | | row.enableState = 1 - row.enableState; // Toggle between 0 and 1 |
| | | // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 |
| | | updateRowStatus(row); |
| | | }; |
| | | |
| | | const updateRowStatus = async (row) => { |
| | | try { |
| | | // 假设你的后端 API 接收 PUT 请求,并且需要传递 row.id 和 row.enableState 参数 |
| | | |
| | | |
| | | // setInterval(fetchTableData, 2000) |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { |
| | | enableState: 1 - row.enableState |
| | | |
| | | }); |
| | | console.log('Updated row status:', response.data); |
| | | // 可以根据后端返回的数据进行进一步处理,比如更新本地状态等 |
| | | } catch (error) { |
| | | console.error('Error updating row status:', error); |
| | | // 处理错误情况,比如提示用户更新失败 |
| | | } |
| | | }; |
| | | |
| | | |
| | | </script> |
| | |
| | | prop="enableState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enableState==1? $t('reportWork.enable') : $t('reportWork.unenable')}}</el-tag> |
| | | |
| | | <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> |
| | | {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> |
| | |
| | | <template> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="600px"> |
| | | <div id="top" style="height: 150px;background-color: #911005;"> |
| | | <v-chart ref="mychart1" class="chart" :option="optionPie "></v-chart> |
| | | <div id="top" style="height: 150px;display: flex;"> |
| | | <div v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | :style="{ width: '1000px', height: '100px',margin: '5px',}"> |
| | | <div ref="setChartDom(index, $el)" style="width: 100%; height: 100%;"></div> |
| | | <div style="text-align: center;"> |
| | | {{ rect.thisProcess }}</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 prop="orderId" align="center" :label="$t('large.number')" min-width="110" /> |
| | | <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" /> |
| | |
| | | @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" :label="$t('large.customerName')" min-width="90" /> |
| | | <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 height="500" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="reportingWorkTime" align="center" :label="$t('large.time')" min-width="110" /> |
| | | <el-table-column prop="orderId" align="center" :label="$t('large.number')" min-width="110" /> |
| | | <el-table-column prop="reportingWorkTime" fixed align="center" :label="$t('large.time')" min-width="110" /> |
| | | <el-table-column prop="orderId" fixed align="center" :label="$t('large.number')" min-width="110" /> |
| | | <el-table-column prop="reportingWorkId" align="center" :label="$t('large.jobnumber')" min-width="120" /> |
| | | <el-table-column prop="productionId" align="center" :label="$t('large.productionnumber')" min-width="130" /> |
| | | <el-table-column prop="processId" align="center" :label="$t('large.cardnumber')" min-width="140" /> |
| | |
| | | <el-table-column prop="batch" align="center" :label="$t('large.batch')" min-width="110" /> |
| | | <el-table-column prop="reviewer" align="center" :label="$t('large.detailID')" min-width="110" /> |
| | | <el-table-column prop="orderSort" align="center" :label="$t('large.serialnumber')" min-width="110" /> |
| | | <el-table-column prop="productName" align="center" :label="$t('large.productname')" min-width="180" /> |
| | | <el-table-column prop="productName" align="center" :label="$t('large.productname')" :show-overflow-tooltip="true" min-width="220" /> |
| | | <el-table-column prop="technologyNumber" align="center" :label="$t('large.serial')" min-width="110" /> |
| | | <el-table-column prop="glassAddress" align="center" :label="$t('large.slicemarker')" min-width="130" /> |
| | | <el-table-column prop="patchNum" align="center" :label="$t('large.numberpatches')" min-width="110" /> |
| | |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed, watch, shallowRef } from "vue"; |
| | | import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } 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 * as echarts from 'echarts'; |
| | | // import 'echarts/lib/chart/pie'; |
| | | // import 'echarts/dist/echarts.min.css'; |
| | | import * as echarts from 'echarts'; |
| | | const tableData = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const chartRefs = ref([]); |
| | | const thisProcess = ref(); // 用于存储process_id的响应式引用 |
| | | // 定义一个响应式引用来存储图表实例 |
| | | const chartDom = ref(null); |
| | | let chartInstance = null; |
| | | const blinda = ref(false) |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | |
| | | return t('large.allstatus'); |
| | | } |
| | | } |
| | | // function getStatusType(warehousing: number) { |
| | | // switch (warehousing) { |
| | | // case 0: |
| | | // return 'success'; |
| | | // case 1: |
| | | // return 'primary'; |
| | | // case 2: |
| | | // return 'danger'; |
| | | // } |
| | | // } |
| | | // function getStatusText(warehousing: number) { |
| | | // switch (warehousing) { |
| | | // case 0: |
| | | // return t('large.notstocked'); |
| | | // case 1: |
| | | // return t('large.inboundstatus'); |
| | | // case 2: |
| | | // return t('large.allstatus'); |
| | | // } |
| | | // } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.awaitingRepairs[0] |
| | | tableDatab.value = data.DoingTask[0] |
| | | tableDatac.value = data.orders[0] |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | let socket; |
| | | // 设置图表 DOM 引用 |
| | | function setChartDom(index, el) { |
| | | if (!chartRefs.value[index]) { |
| | | chartRefs.value[index] = { dom: el, chart: null }; |
| | | } else { |
| | | chartRefs.value[index].dom = el; |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | adjustedRects.value = data.device[0].map(rect => ({ |
| | | ...rect, |
| | | completedQuantity: rect.completedQuantity, |
| | | breakageQuantity: rect.breakageQuantity, |
| | | thisProcess: rect.thisProcess, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | // updateCharts(); |
| | | }; |
| | | adjustedRects.value.forEach((rect, index) => { |
| | | initChart(index, rect); |
| | | }); |
| | | // }; |
| | | }); |
| | | |
| | | |
| | | function initChart(index, rect) { |
| | | const { dom } = chartRefs.value[index] || { dom: null }; |
| | | if (dom) { |
| | | const chart = echarts.init(dom); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '饼状图', |
| | | type: 'pie', |
| | | radius: ['50%','70%'], |
| | | data: [ |
| | | {value: rect.completedQuantity, name: '加工数量'}, |
| | | {value: rect.breakageQuantity, name: '次破数量'}, |
| | | console.log(rect.breakageQuantity) |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | chart.setOption(option); |
| | | chartRefs.value[index] = { ...chartRefs.value[index], chart }; |
| | | |
| | | } |
| | | console.log(chartRefs.value[index]); |
| | | } |
| | | |
| | | // 更新图表 |
| | | // function updateCharts() { |
| | | // adjustedRects.value.forEach((rect, index) => { |
| | | // const { chart } = chartRefs.value[index] || { chart: null }; |
| | | // if (chart) { |
| | | // chart.setOption({ |
| | | // series: [{ |
| | | // data: [ |
| | | // { value: rect.completedQuantity, name: '加工数量' }, |
| | | // { value: rect.breakageQuantity, name: '次破数量' }, |
| | | // ], |
| | | // }], |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | // 初始化图表 |
| | | // function initChart(index, rect) { |
| | | // const chartDom = ref(`chartDom${index}`).value; |
| | | // console.log(ref(`chartDom${index}`).value); |
| | | // const chart = echarts.init(chartDom); |
| | | // const option = { |
| | | // tooltip: { |
| | | // trigger: 'item' |
| | | // }, |
| | | // legend: { |
| | | // orient: 'vertical', |
| | | // left: 'left', |
| | | // }, |
| | | // series: [ |
| | | // { |
| | | // name: '饼状图', |
| | | // type: 'pie', |
| | | // radius: ['50%','70%'], |
| | | // data: [ |
| | | // {value: rect.completed, name: '加工数量'}, |
| | | // {value: rect.breakage, name: '次破数量'}, |
| | | // ], |
| | | // emphasis: { |
| | | // itemStyle: { |
| | | // shadowBlur: 10, |
| | | // shadowOffsetX: 0, |
| | | // shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | // } |
| | | // } |
| | | // } |
| | | // ] |
| | | // }; |
| | | // chart.setOption(option); |
| | | // } |
| | | // 清理 WebSocket 连接 |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (isBind) { |
| | | if (!isBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | |
| | | mes: |
| | | maxWidth: 2500 #下片的最大宽度 |
| | | maxHeight: 2000 #下片的最大高度 |
| | | minWidth: 400 #下片的最大宽度 |
| | | minHeight: 400 #下片的最大高度 |
| | | minWidth: 400 #下片的最小宽度 |
| | | minHeight: 400 #下片的最小高度 |
| | | throughWidth: 3000 |
| | | throughHeight: 2500 |
| | | threshold: 5 #下片的最大阈值 |