修改问题

main
JayChou 1 day ago
parent be92f66f9c
commit 225f038264
  1. 2
      index.html
  2. BIN
      src/assets/images/guanxitu.png
  3. 4
      src/utils/request.ts
  4. 9
      src/views/designRoute/index.vue
  5. 14
      src/views/program/index.vue

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" /> <link rel="icon" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 KiB

After

Width:  |  Height:  |  Size: 316 KiB

@ -2,7 +2,7 @@
import axios from "axios"; import axios from "axios";
import pinia from "@/store"; import pinia from "@/store";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { removeToken } from "@/utils/auth"; import { clearLocalStorage } from "@/utils/auth";
import userStore from "@/store/modules/user"; import userStore from "@/store/modules/user";
import router from "@/router"; import router from "@/router";
@ -30,7 +30,7 @@ const handleAuthError = (message:string) => {
const useUserStore = userStore(pinia); const useUserStore = userStore(pinia);
ElMessage.error(message); ElMessage.error(message);
removeToken(); clearLocalStorage();
useUserStore.token = ""; useUserStore.token = "";
router.push("/login"); router.push("/login");
}; };

@ -820,9 +820,12 @@ onMounted(() => {
setTimeout(() => { setTimeout(() => {
restoreGraph(); restoreGraph();
}, 1000); }, 1000);
graph.on("edge:added", ({ edge }) => { const zoom = window.outerWidth / window.innerWidth;
console.log("新增连线数据:", edge.toJSON()); console.log("缩放比例为:", zoom);
}); if(zoom > 1) {
ElMessage.error("当前浏览器缩放比例过大,通过Ctrl+滚轮调整比例");
// graph.zoom(-0.5);
}
// const nodes = graph.getNodes(); // const nodes = graph.getNodes();
// console.log(nodes); // console.log(nodes);
// const data = graph.toJSON(); // const data = graph.toJSON();

@ -153,6 +153,8 @@ const nodeName = ref("");
const csedNode = ref<any>(null); const csedNode = ref<any>(null);
const operations = []; const operations = [];
onMounted(() => { onMounted(() => {
preWork(); preWork();
// #region // #region
@ -254,7 +256,8 @@ onMounted(() => {
console.log(cell); console.log(cell);
if (!useSettingStore.saveRoute) { if (!useSettingStore.saveRoute) {
ElMessage({ ElMessage({
message: "请先完成配置", message:
"第二步只需把模块拖放的相应的位置即可,下一步完成后可以填写数据",
type: "warning", type: "warning",
}); });
return; return;
@ -400,6 +403,12 @@ onMounted(() => {
graph.zoom(0.1); 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"], () => { graph.bindKey(["ctrl+2", "meta+2"], () => {
const zoom = graph.zoom(); const zoom = graph.zoom();
if (zoom > 0.5) { if (zoom > 0.5) {
@ -1213,12 +1222,13 @@ function preWork() {
bord bord
} }
#stencil { #stencil {
width: 0.9375rem; width: 200px;
height: 3.125rem; height: 3.125rem;
position: relative; position: relative;
} }
#graph-container { #graph-container {
flex:1;
width: 8.3333rem; width: 8.3333rem;
height: 3.125rem; height: 3.125rem;
} }

Loading…
Cancel
Save