From 7954d34524efdc0f1caec8fd76931c3cb60d2551 Mon Sep 17 00:00:00 2001 From: JayChou Date: Wed, 19 Mar 2025 15:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=BC=96=E5=86=99=20=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=AD=A5=E9=AA=A4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + pnpm-lock.yaml | 23 ++ src/api/index.ts | 46 ++- src/assets/images/idea.png | Bin 0 -> 44976 bytes src/main.ts | 7 + src/permissions.ts | 13 +- src/router/index.ts | 7 +- src/store/modules/setting.ts | 43 ++- src/store/modules/user.ts | 23 +- src/utils/index.ts | 12 + src/utils/setStep.ts | 16 + src/views/compiler/index.vue | 77 +++++ src/views/designRoute/components/wenBenYu.vue | 35 ++- .../designRoute/components/wenBenYu2.vue | 10 +- src/views/designRoute/index.vue | 105 ++++--- src/views/program/components/yibiao.vue | 8 +- src/views/program/index.vue | 281 ++++++++++++++---- 17 files changed, 579 insertions(+), 129 deletions(-) create mode 100644 src/assets/images/idea.png create mode 100644 src/utils/index.ts create mode 100644 src/utils/setStep.ts create mode 100644 src/views/compiler/index.vue diff --git a/package.json b/package.json index c7275f2..e0d6e59 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,12 @@ "@antv/x6-plugin-transform": "^2.1.8", "@antv/x6-vue-shape": "^2.1.2", "@element-plus/icons-vue": "^2.3.1", + "@highlightjs/vue-plugin": "^2.1.0", "@kjgl77/datav-vue3": "^1.7.3", "axios": "^1.7.2", "echarts": "^5.6.0", "element-plus": "^2.9.5", + "highlight.js": "^11.11.1", "insert-css": "^2.0.0", "lib-flexible": "^0.3.2", "pinia": "^2.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11ad3e4..d641ff1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: '@element-plus/icons-vue': specifier: ^2.3.1 version: 2.3.1(vue@3.4.29(typescript@5.2.2)) + '@highlightjs/vue-plugin': + specifier: ^2.1.0 + version: 2.1.0(highlight.js@11.11.1)(vue@3.4.29(typescript@5.2.2)) '@kjgl77/datav-vue3': specifier: ^1.7.3 version: 1.7.3(vue@3.4.29(typescript@5.2.2)) @@ -50,6 +53,9 @@ importers: element-plus: specifier: ^2.9.5 version: 2.9.5(vue@3.4.29(typescript@5.2.2)) + highlight.js: + specifier: ^11.11.1 + version: 11.11.1 insert-css: specifier: ^2.0.0 version: 2.0.0 @@ -344,6 +350,12 @@ packages: '@floating-ui/utils@0.2.9': resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==} + '@highlightjs/vue-plugin@2.1.0': + resolution: {integrity: sha512-E+bmk4ncca+hBEYRV2a+1aIzIV0VSY/e5ArjpuSN9IO7wBJrzUE2u4ESCwrbQD7sAy+jWQjkV5qCCWgc+pu7CQ==} + peerDependencies: + highlight.js: ^11.0.1 + vue: ^3 + '@jiaminghi/bezier-curve@0.0.9': resolution: {integrity: sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw==} @@ -772,6 +784,10 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + highlight.js@11.11.1: + resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} + engines: {node: '>=12.0.0'} + htmlparser2@8.0.2: resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} @@ -1362,6 +1378,11 @@ snapshots: '@floating-ui/utils@0.2.9': {} + '@highlightjs/vue-plugin@2.1.0(highlight.js@11.11.1)(vue@3.4.29(typescript@5.2.2))': + dependencies: + highlight.js: 11.11.1 + vue: 3.4.29(typescript@5.2.2) + '@jiaminghi/bezier-curve@0.0.9': dependencies: '@babel/runtime': 7.24.7 @@ -1847,6 +1868,8 @@ snapshots: he@1.2.0: {} + highlight.js@11.11.1: {} + htmlparser2@8.0.2: dependencies: domelementtype: 2.3.0 diff --git a/src/api/index.ts b/src/api/index.ts index 3879b01..9b23e72 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,14 +1,38 @@ -import request from '@/utils/request' +import request from "@/utils/request"; export const login = (data: any) => { - return request({ - url: '/sys/login', - method: 'post', - data - }) -} + return request({ + url: "/sys/login", + method: "post", + data, + }); +}; export const getCode = (time: any) => { - return request({ - url: '/sys/randomImage/' + time, - }) - } \ No newline at end of file + return request({ + url: "/sys/randomImage/" + time, + }); +}; +// 获取用户信息 +export const getUserInfo = () => { + return request({ + url: "/sys/user/getUserInfo", + method: "get", + }); +}; + +// 实验步骤 +export const setStep = (params: any) => { + return request({ + url: "/experimentrecords/xnExperimentRecords/check", + method: "get", + params + }) +} +// 获取步骤id +export const getStepId = () => { + return request({ + url: "/experimentrecords/xnExperimentRecords/getProcedureList", + method: "get", + + }) +} \ No newline at end of file diff --git a/src/assets/images/idea.png b/src/assets/images/idea.png new file mode 100644 index 0000000000000000000000000000000000000000..c6b88c606a619fa4299f8233be3c03099ea9f295 GIT binary patch literal 44976 zcmeFZc~sNa);CV86)lrP6_6ngt+Z81DN4Wqaj0^8tnVZXP>=4`?EhgXWoyFa(j8@%T7*CZtwo%oe!OyoQY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--git a/src/main.ts b/src/main.ts index e979875..21fcf3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,14 @@ import 'element-plus/dist/index.css'; // 引入 Element Plus 的样式文件 import '@/utils/rem.js' import DataVVue3 from '@kjgl77/datav-vue3' import pinia from '@/store/index' +//引入依赖和语言 +import 'highlight.js/styles/stackoverflow-light.css' +// import hljs from "highlight.js/lib/core"; +// import hljsVuePlugin from "@highlightjs/vue-plugin"; +// import java from "highlight.js/lib/languages/java"; const app = createApp(App) +// hljs.registerLanguage("java", java); +// app.use(hljsVuePlugin); app.use(ElementPlus) app.use(pinia) app.use(DataVVue3) diff --git a/src/permissions.ts b/src/permissions.ts index 3bc2aa0..fa9a430 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -14,10 +14,19 @@ router.beforeEach((to: any, from: any, next: any) => { } else { const token = getToken(); if (token) { - next(); + console.log(store.userInfo); + + if (store.userInfo) { + next(); + } else { + store.getUserInfo().then(() => { + next(); + }); + } + // next(); } else { next("/login"); } } }); -export default router; \ No newline at end of file +export default router; diff --git a/src/router/index.ts b/src/router/index.ts index 8d73740..73e7f74 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -19,7 +19,12 @@ const routerList: any = [ path: "program", name: "Program", component: () => import("@/views/program/index.vue"), - } + }, + { + path: "compiler", + name: "Compiler", + component: () => import("@/views/compiler/index.vue"), + }, ], }, { diff --git a/src/store/modules/setting.ts b/src/store/modules/setting.ts index f86ce30..74494ec 100644 --- a/src/store/modules/setting.ts +++ b/src/store/modules/setting.ts @@ -16,6 +16,11 @@ const settingStore = defineStore("settingStore", { sdsz: 0, // 湿度数值 falg: false, timer: null, + experimentPreservation: false, // 是否设计好实验 + saveRoute: false, // 是否保存路由 + stepIds: null, + wenduCode: null, + shiduCode:null }; }, actions: { @@ -27,7 +32,7 @@ const settingStore = defineStore("settingStore", { this.qw = value; }, - setValue(value: number, name: string) { + setValue(value: number | boolean, name: string) { this[name] = value; }, openHeating() { @@ -46,7 +51,7 @@ const settingStore = defineStore("settingStore", { } }, calculateTemperature() { - this.qw <= 0 ? this.qw=1 : this.qw; + this.qw <= 0 ? (this.qw = 1) : this.qw; const a = (100000 * this.zl * this.srmj) / this.jrgl; let time = 0; let currentTemp = this.qw; @@ -61,6 +66,40 @@ const settingStore = defineStore("settingStore", { clearInterval(interval); } + time += 1; // 每秒增加 1s + }, 1000); + }, + simulateHeatingAndHumidifying() { + // 计算时间常数 + const a = (100000 * this.zl * this.srmj) / this.jrgl; + const b = (10000 * this.jsmj) / this.jsgl; + + let time = 0; + let currentTemp = this.qw; + let currentHumidity = this.cssd; + + const interval = setInterval(() => { + // 计算温度 + currentTemp = (1 - Math.exp(-time / a)) * 100 + this.qw; + if (currentTemp > 100) currentTemp = 100; + + // 计算湿度 + currentHumidity = (1 - Math.exp(-time / b)) * 100 + this.cssd; + if (currentHumidity > 100) currentHumidity = 100; + + console.log( + `时间: ${time}s, 温度: ${currentTemp.toFixed( + 2 + )}°C, 湿度: ${currentHumidity}%RH` + ); + this.qw = currentTemp >= 100 ? 100 : currentTemp; + this.cssd = currentHumidity >= 100 ? 100 : Number(currentHumidity.toFixed(2)); + // 停止加热 & 加湿 + if (currentTemp >= 100 && currentHumidity >= 100) { + console.log("温度和湿度均达到上限,停止模拟!"); + clearInterval(interval); + } + time += 1; // 每秒增加 1s }, 1000); }, diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index a2c0c45..6b37de5 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,30 +1,37 @@ import { defineStore } from "pinia"; -import { getToken,setToken } from "@/utils/auth"; -import { login } from "@/api"; +import { getToken, setToken } from "@/utils/auth"; +import { login, getUserInfo } from "@/api"; import { ElMessage } from "element-plus"; const userStore = defineStore("userStore", { state: () => ({ token: getToken(), - userInfo: {}, + userInfo: null, }), actions: { async logIn(form: any) { console.log(form); const res: any = await login(form); // if(res.code === 500) return ElMessage.error(res.msg) - if(res.code !== 200) { - ElMessage.error(res.msg) - return false + if (res.code !== 200) { + ElMessage.error(res.msg); + return false; } this.token = res.result.token; this.userInfo = res.result.userInfo; setToken(this.token); console.log(res); - return true + return true; }, clearStatus() { this.token = ""; - this.userInfo = {}; + this.userInfo = null; + }, + async getUserInfo() { + const res:any = await getUserInfo(); + this.userInfo = res.result.userInfo; + console.log(res); + + // this.userInfo = res.result; }, }, }); diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..8c8eebe --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,12 @@ +// 格式化时间 年月日时分秒 +export function formatDate(date: any) { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + 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"); + console.log(`${year}-${month}-${day} ${hours}:${minutes}:${seconds}`); + + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; +} \ No newline at end of file diff --git a/src/utils/setStep.ts b/src/utils/setStep.ts new file mode 100644 index 0000000..14b1391 --- /dev/null +++ b/src/utils/setStep.ts @@ -0,0 +1,16 @@ +import { setStep, getStepId } from "../api/index"; +import settingStore from "../store/modules/setting"; +import pinia from "@/store"; +const useStore = settingStore(pinia); +export const setStepEvent = async (step: number, controlsSt: string) => { + let id: any = null; + if (!useStore.stepIds) { + const data: any = await getStepId(); + useStore.stepIds = data.result.map((item: any) => item.id); + id = useStore.stepIds[step - 1]; + // return id; + await setStep({ id, controlsSt }); + } else { + await setStep({ id: useStore.stepIds[step - 1], controlsSt }); + } +}; diff --git a/src/views/compiler/index.vue b/src/views/compiler/index.vue new file mode 100644 index 0000000..d88adbf --- /dev/null +++ b/src/views/compiler/index.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/src/views/designRoute/components/wenBenYu.vue b/src/views/designRoute/components/wenBenYu.vue index 59dde09..80d423b 100644 --- a/src/views/designRoute/components/wenBenYu.vue +++ b/src/views/designRoute/components/wenBenYu.vue @@ -6,12 +6,31 @@
W
t
T
-