| | |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const tableData = ref([]) |
| | | const blindb = ref(false) |
| | | const slot = ref('') |
| | | const requestData = { |
| | | line: 2001 |
| | |
| | | stateList=[selectValuesa[1]]; |
| | | } |
| | | } |
| | | console.log(timeRange.value[0],timeRange.value[1]); |
| | | const response = await request.post("/cacheGlass/edgGlassTaskInfo/setEdgGlassInfoRequest", { |
| | | cellList: celllist, |
| | | stateList: stateList, |
| | |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } catch (error) { |
| | | } |
| | | }; |
| | | // 拿走 |
| | |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/edgTasks`; |
| | | const handleMessage = (data) => { |
| | | tableData.value = data.edgTasks[0] |
| | | const formattedTasks = data.edgTasks[0].map(cageInfo => { |
| | | if (cageInfo && cageInfo.createTime) { |
| | | cageInfo.formattedCreateTime = formatTimestamp(cageInfo.createTime); |
| | | } |
| | | return cageInfo; |
| | | }); |
| | | tableData.value = formattedTasks |
| | | }; |
| | | // 历史任务 |
| | | const iframeUrl = ref(''); |
| | | const handlehistorical = (row) => { |
| | | blindb.value = true; |
| | | iframeUrl.value = `${window.location.origin}/#/StockBasicData/stockhistory`; |
| | | }; |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | function getStatusTypeb(state) { |
| | | switch (state) { |
| | | case 0: |
| | | return 'info'; |
| | | case 1: |
| | | return 'success'; |
| | | case 1: |
| | | return 'danger'; |
| | | } |
| | | } |
| | | function getStatusTextb(state) { |
| | | switch (state) { |
| | | case 0: |
| | | return t('workOrder.nedging'); |
| | | case 1: |
| | | return t('workOrder.edging'); |
| | | case 2: |
| | | return t('workOrder.finedging'); |
| | | } |
| | | } |
| | | function formatTimestamp(timestamp) { |
| | | const date = new Date(timestamp); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零 |
| | | const day = String(date.getDate()).padStart(2, '0'); // 补零 |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" > |
| | | <div style="display: flex;"> |
| | | <!-- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handlehistorical">{{ |
| | | $t('searchOrder.historicaltasks') |
| | | }} |
| | | </el-button> --> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('workOrder.cway')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.edgingone')" value="2001"></el-option> |
| | | <el-option :label="$t('workOrder.edgingtwo')" value="2002"></el-option> |
| | | <el-option :label="$t('workOrder.edgingone')" value="930"></el-option> |
| | | <el-option :label="$t('workOrder.edgingtwo')" value="931"></el-option> |
| | | </el-select> |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('workOrder.cstate')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120" /> |
| | | <el-table-column prop="glassType" align="center" :label="$t('workOrder.glasstype')" min-width="120" /> |
| | | <el-table-column prop="filmsid" align="center" :label="$t('workOrder.glasstype')" min-width="120" /> |
| | | <el-table-column prop="line" align="center" :label="$t('workOrder.line')" min-width="120" /> |
| | | <el-table-column prop="status" :label="$t('workOrder.status')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-table-column prop="formattedCreateTime" align="center" :label="$t('workOrder.time')" min-width="120" /> |
| | | <el-table-column prop="state" :label="$t('workOrder.status')" align="center" width="200"> |
| | | <!-- <template #default="scope"> |
| | | {{ scope.row.status==0?"未磨边":scope.row.status==1?"磨边中":"已磨边" }} |
| | | </template> |
| | | </template> --> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.state)"> |
| | | {{ getStatusTextb(scope.row.state) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ |
| | | <el-button type="text" plain @click="open(scope.row)">{{ |
| | | $t('workOrder.breakage') |
| | | }} |
| | | </el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ |
| | | <el-button type="text" plain @click="opena(scope.row)">{{ |
| | | $t('workOrder.takeout') |
| | | }} |
| | | </el-button> |
| | |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="10vh" width="95%" @close="iframeUrl=''"> |
| | | <iframe |
| | | :src="iframeUrl" |
| | | marginwidth="2000px" |
| | | marginheight="2000px" |
| | | width="100%" |
| | | height="700px" |
| | | frameborder="0" |
| | | ></iframe> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <style scoped> |