diff --git a/index.html b/index.html index 753c5a8..265fb61 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/assets/images/guanxitu.png b/src/assets/images/guanxitu.png index 87ea67c..1829352 100644 Binary files a/src/assets/images/guanxitu.png and b/src/assets/images/guanxitu.png differ diff --git a/src/utils/request.ts b/src/utils/request.ts index 26867e1..f2bbb7d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -2,7 +2,7 @@ import axios from "axios"; import pinia from "@/store"; import { ElMessage } from "element-plus"; -import { removeToken } from "@/utils/auth"; +import { clearLocalStorage } from "@/utils/auth"; import userStore from "@/store/modules/user"; import router from "@/router"; @@ -30,7 +30,7 @@ const handleAuthError = (message:string) => { const useUserStore = userStore(pinia); ElMessage.error(message); - removeToken(); + clearLocalStorage(); useUserStore.token = ""; router.push("/login"); }; diff --git a/src/views/designRoute/index.vue b/src/views/designRoute/index.vue index a1472c6..230f939 100644 --- a/src/views/designRoute/index.vue +++ b/src/views/designRoute/index.vue @@ -820,9 +820,12 @@ onMounted(() => { setTimeout(() => { restoreGraph(); }, 1000); - graph.on("edge:added", ({ edge }) => { - console.log("新增连线数据:", edge.toJSON()); - }); + const zoom = window.outerWidth / window.innerWidth; + console.log("缩放比例为:", zoom); + if(zoom > 1) { + ElMessage.error("当前浏览器缩放比例过大,通过Ctrl+滚轮调整比例"); + // graph.zoom(-0.5); + } // const nodes = graph.getNodes(); // console.log(nodes); // const data = graph.toJSON(); diff --git a/src/views/program/index.vue b/src/views/program/index.vue index f51ace6..26405d1 100644 --- a/src/views/program/index.vue +++ b/src/views/program/index.vue @@ -153,6 +153,8 @@ const nodeName = ref(""); const csedNode = ref(null); const operations = []; onMounted(() => { + + preWork(); // #region 初始化画布 @@ -254,7 +256,8 @@ onMounted(() => { console.log(cell); if (!useSettingStore.saveRoute) { ElMessage({ - message: "请先完成配置", + message: + "第二步只需把模块拖放的相应的位置即可,下一步完成后可以填写数据", type: "warning", }); return; @@ -400,6 +403,12 @@ onMounted(() => { graph.zoom(0.1); } }); + const zoom = window.outerWidth / window.innerWidth; + console.log("缩放比例为:", zoom); + if(zoom > 1) { + ElMessage.error("当前浏览器缩放比例过大,通过Ctrl+滚轮调整比例"); + graph.zoom(-0.5); + } graph.bindKey(["ctrl+2", "meta+2"], () => { const zoom = graph.zoom(); if (zoom > 0.5) { @@ -1213,12 +1222,13 @@ function preWork() { bord } #stencil { - width: 0.9375rem; + width: 200px; height: 3.125rem; position: relative; } #graph-container { + flex:1; width: 8.3333rem; height: 3.125rem; }