From c598af2734e0483a961116e5c17fb391df2244d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=AE=E5=BB=BA?= <450837357@qq.com> Date: Fri, 16 May 2025 13:07:49 +0800 Subject: [PATCH] first --- src/views/board/kanBan/compents/leftBot.vue | 12 ++++++------ src/views/board/kanBan/index.vue | 18 +++++++++++++++++- src/views/produce/workRecords/index.vue | 8 ++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/views/board/kanBan/compents/leftBot.vue b/src/views/board/kanBan/compents/leftBot.vue index bf3cfcd..c85b19e 100644 --- a/src/views/board/kanBan/compents/leftBot.vue +++ b/src/views/board/kanBan/compents/leftBot.vue @@ -124,7 +124,8 @@ export default defineComponent({ data: line.data.map((value, idx) => ({ value, itemStyle: { color: value >= 65 && value <= 75 ? '#00ff00' : '#ff0000' }, - batchNumber: line.batchNumber && line.batchNumber[idx] || '未知批次' + batchNumber: line.batchNumber && line.batchNumber[idx] || '未知批次', + id: line.ids && line.ids[idx] || '' })), label: { show: false }, markLine: { @@ -181,21 +182,20 @@ export default defineComponent({ // 添加新的点击事件监听器 myChart.on('click', (params) => { + console.log("params", params) if (params.componentType === 'series') { // 点击的是数据点 const seriesName = params.seriesName; // 生产线名称 const value = params.value; // 转速值 const batchNumber = params.data.batchNumber; // 批次号 + const id = params.data.id; // 批次号 console.log(`点击了 ${seriesName} 的数据点`); console.log(`批次: ${batchNumber}, 转速: ${value} 转/秒`); - + console.log(`id: ${id}, 转速: ${value} 转/秒`); // 触发自定义事件,通知父组件 emit('pointClick', { - seriesName, - value, - batchNumber, - time: params.name || '未知时间' + id }); } }); diff --git a/src/views/board/kanBan/index.vue b/src/views/board/kanBan/index.vue index d32e08a..acae5bc 100644 --- a/src/views/board/kanBan/index.vue +++ b/src/views/board/kanBan/index.vue @@ -34,7 +34,8 @@ -
+ +
在线质检
@@ -47,6 +48,7 @@ width="480px" height="290px" :real-data="leftBotData" + @pointClick="pointClick" />
@@ -642,8 +644,22 @@ export default defineComponent({ app.setContentFull(this.fullScreen); }, jumpPage(routerName){ + console.log("fu") this.router.push({name : routerName}) }, + handleParentClick(event) { + console.log(event.target.tagName, "event.target") + // 判断点击源是否是子组件内部元素 + if ('CANVAS' == event.target.tagName) { + console.log("zi") + return; // 如果是子组件内部元素,不执行跳转 + } + this.jumpPage('produce_workRecords'); + }, + pointClick(e){ + console.log(e) + this.router.push({name : 'produce_workRecords', query: { id: e.id, title: ' glasses' }}) + }, // 防抖函数 debounce(func, wait = 100) { let timeout; diff --git a/src/views/produce/workRecords/index.vue b/src/views/produce/workRecords/index.vue index 9ecd431..5c7db04 100644 --- a/src/views/produce/workRecords/index.vue +++ b/src/views/produce/workRecords/index.vue @@ -136,6 +136,7 @@ import { ref, onMounted } from 'vue'; import type { Ref } from 'vue'; import { hiprint } from 'vue-plugin-hiprint'; +import { useRoute } from 'vue-router' import type { DataTableColumns } from 'naive-ui'; import { getWorkbenchWiredrawingList } from '@/service/api/md/workbench/wiredrawing'; import { getWorkbenchEnamellingList, getMdPrintData } from '@/service/api/md/workbench/enamelling'; @@ -151,6 +152,7 @@ import { useResetSearch } from '~/src/utils/common/searchReset'; const { loading, startLoading, endLoading } = useLoading(); const { searchForm, reset } = useResetSearch({ + id: '', taskSn: '', // 生产工单号 workstationId: null, // 机台 taskType: 0, // 工单类型 @@ -541,6 +543,12 @@ function init() { }); } onMounted(() => { + const route = useRoute() + console.log("route", route) + if (route.query.id) { + console.log("route.query.id", route.query.id) + searchForm.value.id = route.query.id as string; + } init(); // getList(); lsColumns.value = columns.value.filter((item: any) => !columnsFilterData.value.includes(item.key));