| | |
| | | </el-form> |
| | | </div> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="480" ref="table" :data="tableDataa" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.order')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.thickness')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.coatingtypes')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.height')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.width')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.state')" align="center"/> |
| | | </el-table> |
| | | <div style="float: right;"> |
| | | <el-pagination layout="prev, pager, next" :total="50"/> |
| | | </div> |
| | | <el-table height="480" ref="table" :data="tableDataa" |
| | | :header-cell-style="{ background: '#F2F3F5', color: '#1D2129' }"> |
| | | <el-table-column prop="sequence" :label="$t('hellow.order')" align="center"/> |
| | | <el-table-column prop="thickness" :label="$t('hellow.thickness')" align="center"/> |
| | | <el-table-column prop="layer" :label="$t('hellow.coatingtypes')" align="center"/> |
| | | <el-table-column prop="height" :label="$t('hellow.height')" align="center"/> |
| | | <el-table-column prop="width" :label="$t('hellow.width')" align="center"/> |
| | | <el-table-column prop="state" :label="$t('hellow.state')" align="center"/> |
| | | </el-table> |
| | | <div style="float: right;"> |
| | | <el-pagination |
| | | layout="prev, pager, next" |
| | | :total="30" |
| | | :current-page.sync="currentPage" |
| | | @current-change="handlePageChange" |
| | | /> |
| | | </div> |
| | | <!-- <div style="float: right;"> |
| | | <el-pagination layout="prev, pager, next" :total="3" :current-page.sync="currentPage" @current-change="handlePageChange"/> |
| | | </div> --> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <!-- 创建任务 --> |
| | |
| | | </el-dialog> |
| | | </template> |
| | | <script setup> |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref, reactive} from "vue"; |
| | | import {ElMessage} from 'element-plus' |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref, reactive, watch, computed} from "vue"; |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket} from '@/utils/WebSocketService'; |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | import {useI18n} from 'vue-i18n' |
| | | const {t} = useI18n() |
| | | const blinda = ref(false) |
| | |
| | | const tableDataa = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const allData = ref({}) |
| | | const flowCard = ref('') |
| | | const cell = ref('') |
| | | const totalPairQuantity = ref('') |
| | |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const dialogFormVisibled = ref(false) |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const currentRow = reactive({}); |
| | | const options = [ |
| | | { |
| | | value: 930, |
| | |
| | | } |
| | | ] |
| | | let socket = null; |
| | | // const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | // const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | // }; |
| | | // let socket; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/hollowGlass/api/talk/HollowGlass`; |
| | | const currentPage = ref(parseInt(window.localStorage.getItem('currentPage')) || 1); |
| | | console.log(currentPage.value); |
| | | watch(() => currentPage.value, (newVal) => { |
| | | window.localStorage.setItem('currentPage', newVal); |
| | | }); |
| | | const currentPageKey = computed(() => `93${currentPage.value - 1}`); |
| | | const handlePageChange = (newPage) => { |
| | | currentPage.value = newPage; |
| | | }; |
| | | const handleMessage = (data) => { |
| | | try { |
| | | const allPageData = data; |
| | | const currentPageKeyValue = currentPageKey.value; |
| | | const currentPageData = allPageData[currentPageKeyValue]; |
| | | if (currentPageData && Array.isArray(currentPageData) && currentPageData.length > 0) { |
| | | tableDataa.value = currentPageData[0]; |
| | | } else { |
| | | console.warn('No data for the current page key:', currentPageKeyValue); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error parsing WebSocket message:', error); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | // socket = new WebSocket(socketUrl); |
| | | // socket.onmessage = (event) => { |
| | | // const data = JSON.parse(event.data); |
| | | |
| | | // // updateCharts(); |
| | | // }; |
| | | // }; |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | // 开始任务 |
| | | const handleBinda = (row) => { |
| | |
| | | var url="/hollowGlass/hollowGlassRelationInfo/queryLackByFlowCard?flowCardId="+flowCardId + "&layer=" + layer; |
| | | const response = await request.post(url) |
| | | if (response.code == 200) { |
| | | tableDatac.value = response.data[1]; |
| | | ElMessage.success(response.message); |
| | | tableDatac.value = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | onMounted(() => { |
| | | // fetchTableData(); |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |