diff --git a/src/components/scDegra.vue b/src/components/scDegra.vue index 8c245af7..86fe9a63 100644 --- a/src/components/scDegra.vue +++ b/src/components/scDegra.vue @@ -104,6 +104,31 @@ export default { let mySvgWdith =document.getElementsByClassName("output")[0].getBoundingClientRect().width+150 ; document.getElementById('mySvg').setAttribute("height", mySvgHeight); document.getElementById('mySvg').setAttribute("width", mySvgWdith); + + svg.selectAll("g.node").on("click", function(event, d) { + // 改变节点的颜色 + const node = d3.select(this); + const currentColor = node.select("rect").style("fill"); + + // 判断当前颜色,如果是默认颜色,就修改为新的颜色 + if (currentColor === "rgb(255, 255, 255)") { // 如果当前是白色 + // svg.selectAll("g.node").forEach(item=>{ + // item.select("rect").style("fill", "#fff"); + // // d3.select(item).select("rect").style("fill", "#fff"); // 修改为白色 + // }); + node.select("rect").style("fill", "#f00"); // 修改为红色 + } else { + node.select("rect").style("fill", "#fff"); // 否则恢复白色 + } + // 调用自定义方法 + onNodeClick(d); + }); + // 自定义方法:在节点点击时触发 + function onNodeClick(nodeData) { + console.log("Node clicked:", nodeData); + this.$emit("nodeClick", nodeData); + // 你可以在这里处理更多的逻辑,例如显示一个提示框,更新图形状态等 + } } }) }, diff --git a/src/views/mtm/route_show.vue b/src/views/mtm/route_show.vue index bfff7219..7602901c 100644 --- a/src/views/mtm/route_show.vue +++ b/src/views/mtm/route_show.vue @@ -62,6 +62,11 @@ + + + @@ -94,6 +99,10 @@ export default { 40: "进行中", 50: "已完成", }, + tracking_:{ + 10:"批次", + 20:"单个", + }, form: {}, nodes:[], edges:[], diff --git a/src/views/wpm_bx/handover_form.vue b/src/views/wpm_bx/handover_form.vue index 485d769e..9a56bfd4 100644 --- a/src/views/wpm_bx/handover_form.vue +++ b/src/views/wpm_bx/handover_form.vue @@ -23,7 +23,6 @@ style="width: 300px;margin-left: 10px;" > - {{ totalCount }} diff --git a/src/views/wpm_bx/inm.vue b/src/views/wpm_bx/inm.vue index 9b7e6fc8..ddeeb867 100644 --- a/src/views/wpm_bx/inm.vue +++ b/src/views/wpm_bx/inm.vue @@ -101,6 +101,10 @@ {{scope.row.count}} + - + - +