From 73ee3fe0808a4a9d06f9297a5b6abba924eb9229 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Tue, 25 Aug 2026 10:26:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- package.json | 1 + pnpm-lock.yaml | 81 +++++++++++++++-------- src/main.js | 11 +++ src/plugins/cache.js | 15 +++-- src/router/index.js | 41 ++++++------ src/store/modules/permission.js | 4 +- src/utils/auth.js | 2 +- src/views/is/project/evaluate/Run.vue | 2 +- src/views/test/configs/Run.vue | 2 +- src/views/test/log/index.vue | 2 +- src/views/vi/testProject/evaluate/Run.vue | 2 +- vite.config.js | 1 + 13 files changed, 107 insertions(+), 61 deletions(-) diff --git a/.env.development b/.env.development index da134de..368025f 100644 --- a/.env.development +++ b/.env.development @@ -7,8 +7,8 @@ VITE_APP_ENV = 'development' # 招商车研物联网平台/开发环境 VITE_APP_BASE_API = '/dev-api' -VITE_API_URL = http://localhost:14080 -VITE_WS_URL = ws://localhost:14080/ws +VITE_API_URL = http://192.168.0.222:14080 +VITE_WS_URL = ws://192.168.0.222:14080/ws VITE_PORT = 5174 VITE_INSPECTION_TYPE = "inspection" VITE_MINIO_URL = "http://192.168.28.10:9000/cmvr-iot/" diff --git a/package.json b/package.json index 0648cb7..793f6a7 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "preview": "vite preview" }, "dependencies": { + "@cmvr/iot-common": "1.0.0", "@element-plus/icons-vue": "2.3.2", "@vue-flow/background": "^1.3.2", "@vue-flow/controls": "^1.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0eac5f..50ca951 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: .: dependencies: + '@cmvr/iot-common': + specifier: 1.0.0 + version: 1.0.0(@element-plus/icons-vue@2.3.2(vue@3.5.26))(core-js@3.49.0)(element-plus@2.13.1(vue@3.5.26))(pinia@3.0.4(vue@3.5.26))(vue-router@4.6.4(vue@3.5.26))(vue@3.5.26) '@element-plus/icons-vue': specifier: 2.3.2 version: 2.3.2(vue@3.5.26) @@ -182,6 +185,15 @@ packages: '@bufbuild/protobuf@2.13.0': resolution: {integrity: sha512-acq7c49vxfm1ggJ95P70TX7ABDM0vxr1SYD3BB0o0jnBLB4OAqeHyKuN+cD3w80gXEDQ2zxHpR6CUeA+O/aU9g==} + '@cmvr/iot-common@1.0.0': + resolution: {integrity: sha512-EIdZdRRgyhb4FfclQ6SoDT3NwIAY/7uI2re+zcwwcnc0a0ELKizTn4POFZt/O4mhr5Ikeg8J98cRB/cchV3E9g==} + peerDependencies: + '@element-plus/icons-vue': ^2.3.2 + element-plus: ^2.13.1 + pinia: ^3.0.4 + vue: ^3.5.26 + vue-router: ^4.6.4 + '@codemirror/autocomplete@6.20.3': resolution: {integrity: sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==} @@ -487,42 +499,36 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm-musl@2.6.0': resolution: {integrity: sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.6.0': resolution: {integrity: sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.6.0': resolution: {integrity: sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.6.0': resolution: {integrity: sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.6.0': resolution: {integrity: sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-win32-arm64@2.6.0': resolution: {integrity: sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==} @@ -594,79 +600,66 @@ packages: resolution: {integrity: sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.62.3': resolution: {integrity: sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.62.3': resolution: {integrity: sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.62.3': resolution: {integrity: sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.62.3': resolution: {integrity: sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.62.3': resolution: {integrity: sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==} cpu: [loong64] os: [linux] - libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.62.3': resolution: {integrity: sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.62.3': resolution: {integrity: sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==} cpu: [ppc64] os: [linux] - libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.62.3': resolution: {integrity: sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.62.3': resolution: {integrity: sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.62.3': resolution: {integrity: sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.62.3': resolution: {integrity: sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.62.3': resolution: {integrity: sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-openbsd-x64@4.62.3': resolution: {integrity: sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==} @@ -2344,56 +2337,48 @@ packages: engines: {node: '>=14.0.0'} cpu: [arm64] os: [linux] - libc: glibc sass-embedded-linux-arm@1.97.2: resolution: {integrity: sha512-yDRe1yifGHl6kibkDlRIJ2ZzAU03KJ1AIvsAh4dsIDgK5jx83bxZLV1ZDUv7a8KK/iV/80LZnxnu/92zp99cXQ==} engines: {node: '>=14.0.0'} cpu: [arm] os: [linux] - libc: glibc sass-embedded-linux-musl-arm64@1.97.2: resolution: {integrity: sha512-NfUqZSjHwnHvpSa7nyNxbWfL5obDjNBqhHUYmqbHUcmqBpFfHIQsUPgXME9DKn1yBlBc3mWnzMxRoucdYTzd2Q==} engines: {node: '>=14.0.0'} cpu: [arm64] os: [linux] - libc: musl sass-embedded-linux-musl-arm@1.97.2: resolution: {integrity: sha512-GIO6xfAtahJAWItvsXZ3MD1HM6s8cKtV1/HL088aUpKJaw/2XjTCveiOO2AdgMpLNztmq9DZ1lx5X5JjqhS45g==} engines: {node: '>=14.0.0'} cpu: [arm] os: [linux] - libc: musl sass-embedded-linux-musl-riscv64@1.97.2: resolution: {integrity: sha512-qtM4dJ5gLfvyTZ3QencfNbsTEShIWImSEpkThz+Y2nsCMbcMP7/jYOA03UWgPfEOKSehQQ7EIau7ncbFNoDNPQ==} engines: {node: '>=14.0.0'} cpu: [riscv64] os: [linux] - libc: musl sass-embedded-linux-musl-x64@1.97.2: resolution: {integrity: sha512-ZAxYOdmexcnxGnzdsDjYmNe3jGj+XW3/pF/n7e7r8y+5c6D2CQRrCUdapLgaqPt1edOPQIlQEZF8q5j6ng21yw==} engines: {node: '>=14.0.0'} cpu: [x64] os: [linux] - libc: musl sass-embedded-linux-riscv64@1.97.2: resolution: {integrity: sha512-reVwa9ZFEAOChXpDyNB3nNHHyAkPMD+FTctQKECqKiVJnIzv2EaFF6/t0wzyvPgBKeatA8jszAIeOkkOzbYVkQ==} engines: {node: '>=14.0.0'} cpu: [riscv64] os: [linux] - libc: glibc sass-embedded-linux-x64@1.97.2: resolution: {integrity: sha512-bvAdZQsX3jDBv6m4emaU2OMTpN0KndzTAMgJZZrKUgiC0qxBmBqbJG06Oj/lOCoXGCxAvUOheVYpezRTF+Feog==} engines: {node: '>=14.0.0'} cpu: [x64] os: [linux] - libc: glibc sass-embedded-unknown-all@1.97.2: resolution: {integrity: sha512-86tcYwohjPgSZtgeU9K4LikrKBJNf8ZW/vfsFbdzsRlvc73IykiqanufwQi5qIul0YHuu9lZtDWyWxM2dH/Rsg==} @@ -2993,6 +2978,48 @@ snapshots: '@bufbuild/protobuf@2.13.0': {} + '@cmvr/iot-common@1.0.0(@element-plus/icons-vue@2.3.2(vue@3.5.26))(core-js@3.49.0)(element-plus@2.13.1(vue@3.5.26))(pinia@3.0.4(vue@3.5.26))(vue-router@4.6.4(vue@3.5.26))(vue@3.5.26)': + dependencies: + '@element-plus/icons-vue': 2.3.2(vue@3.5.26) + '@vue-flow/background': 1.3.2(@vue-flow/core@1.48.2(vue@3.5.26))(vue@3.5.26) + '@vue-flow/controls': 1.1.3(@vue-flow/core@1.48.2(vue@3.5.26))(vue@3.5.26) + '@vue-flow/core': 1.48.2(vue@3.5.26) + '@vueup/vue-quill': 1.2.0(vue@3.5.26) + '@vueuse/core': 14.1.0(vue@3.5.26) + ace-builds: 1.44.0 + axios: 1.13.2 + clipboard: 2.0.11 + dayjs: 1.11.21 + echarts: 5.6.0 + element-plus: 2.13.1(vue@3.5.26) + file-saver: 2.0.5 + fuse.js: 7.1.0 + js-beautify: 1.15.4 + js-cookie: 3.0.5 + jsencrypt: 3.3.2 + json-editor-vue: 0.18.1(vue@3.5.26) + lodash: 4.18.1 + mitt: 3.0.1 + monaco-editor: 0.55.1 + nprogress: 0.2.0 + pako: 2.2.0 + pinia: 3.0.4(vue@3.5.26) + sortablejs: 1.15.7 + splitpanes: 3.1.5 + uuid: 11.1.1 + vue: 3.5.26 + vue-cropper: 1.1.1 + vue-router: 4.6.4(vue@3.5.26) + vue3-ace-editor: 2.2.4(ace-builds@1.44.0)(vue@3.5.26) + vue3-json-viewer: 2.3.0(vue@3.5.26) + vuedraggable: 4.1.0(vue@3.5.26) + xgplayer: 3.0.26(core-js@3.49.0) + transitivePeerDependencies: + - '@typescript-eslint/types' + - '@vue/composition-api' + - core-js + - debug + '@codemirror/autocomplete@6.20.3': dependencies: '@codemirror/language': 6.12.4 diff --git a/src/main.js b/src/main.js index f281aea..169c103 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,5 @@ import { createApp } from 'vue' +import { configureCmvrCommon } from '@cmvr/iot-common' import Cookies from 'js-cookie' @@ -30,6 +31,16 @@ import { useDict } from '@/utils/dict' import { getConfigKey } from "@/api/system/config" import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' +configureCmvrCommon({ + apiBaseURL: import.meta.env.VITE_APP_BASE_API, + tokenKey: 'CMVR-Platform-Token', + storagePrefix: 'cmvr:platform', + router, + loginPath: '/login', + homePath: '/index' +}) +import '@cmvr/iot-common/style.css' + // 分页组件 import Pagination from '@/components/Pagination' // 自定义表格工具组件 diff --git a/src/plugins/cache.js b/src/plugins/cache.js index ea8a53f..8422132 100644 --- a/src/plugins/cache.js +++ b/src/plugins/cache.js @@ -1,10 +1,13 @@ +const CachePrefix = 'cmvr:platform:' +const cacheKey = (key) => `${CachePrefix}${key}` + const sessionCache = { set (key, value) { if (!sessionStorage) { return } if (key != null && value != null) { - sessionStorage.setItem(key, value) + sessionStorage.setItem(cacheKey(key), value) } }, get (key) { @@ -14,7 +17,7 @@ const sessionCache = { if (key == null) { return null } - return sessionStorage.getItem(key) + return sessionStorage.getItem(cacheKey(key)) }, setJSON (key, jsonValue) { if (jsonValue != null) { @@ -29,7 +32,7 @@ const sessionCache = { return null }, remove (key) { - sessionStorage.removeItem(key) + sessionStorage.removeItem(cacheKey(key)) } } const localCache = { @@ -38,7 +41,7 @@ const localCache = { return } if (key != null && value != null) { - localStorage.setItem(key, value) + localStorage.setItem(cacheKey(key), value) } }, get (key) { @@ -48,7 +51,7 @@ const localCache = { if (key == null) { return null } - return localStorage.getItem(key) + return localStorage.getItem(cacheKey(key)) }, setJSON (key, jsonValue) { if (jsonValue != null) { @@ -63,7 +66,7 @@ const localCache = { return null }, remove (key) { - localStorage.removeItem(key) + localStorage.removeItem(cacheKey(key)) } } diff --git a/src/router/index.js b/src/router/index.js index 86950ba..7128fcf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,15 @@ import { createWebHistory, createRouter } from "vue-router"; /* Layout */ import Layout from "@/layout"; +import { resolveCommonView } from '@cmvr/iot-common' + +const commonView = (view) => { + const component = resolveCommonView(view) + if (!component) { + throw new Error(`[cmvr-common] view not found: ${view}`) + } + return component +} /** * Note: 路由配置项 @@ -33,28 +42,28 @@ export const constantRoutes = [ children: [ { path: "/redirect/:path(.*)", - component: () => import("@/views/redirect/index.vue"), + component: commonView('redirect/index'), }, ], }, { path: "/login", - component: () => import("@/views/login"), + component: commonView('login'), hidden: true, }, { path: "/register", - component: () => import("@/views/register"), + component: commonView('register'), hidden: true, }, { path: "/:pathMatch(.*)*", - component: () => import("@/views/error/404"), + component: commonView('error/404'), hidden: true, }, { path: "/401", - component: () => import("@/views/error/401"), + component: commonView('error/401'), hidden: true, }, { @@ -126,14 +135,6 @@ export const constantRoutes = [ meta: { title: "触摸交互", noLogin: true }, hidden: true, }, - { - //cockpit - path: "/inspection/cockpit", - component: () => - import("@/views/inspection/cockpit/index.vue"), - meta: { title: "logicFlow", noLogin: true }, - hidden: true, - }, { // 流程运行状态 path: "/logic_flow", @@ -145,7 +146,7 @@ export const constantRoutes = [ { // 流程编排 path: "/flow", - component: () => import("@/views/flow/index.vue"), + component: commonView('flow/index'), meta: { title: "流程编排", noLogin: true }, hidden: true, }, @@ -183,7 +184,7 @@ export const constantRoutes = [ children: [ { path: "profile/:activeTab?", - component: () => import("@/views/system/user/profile/index"), + component: commonView('system/user/profile/index'), name: "Profile", meta: { title: "个人中心", icon: "user" }, }, @@ -201,7 +202,7 @@ export const dynamicRoutes = [ children: [ { path: "role/:userId(\\d+)", - component: () => import("@/views/system/user/authRole"), + component: commonView('system/user/authRole'), name: "AuthRole", meta: { title: "分配角色", activeMenu: "/system/user" }, }, @@ -215,7 +216,7 @@ export const dynamicRoutes = [ children: [ { path: "user/:roleId(\\d+)", - component: () => import("@/views/system/role/authUser"), + component: commonView('system/role/authUser'), name: "AuthUser", meta: { title: "分配用户", activeMenu: "/system/role" }, }, @@ -229,7 +230,7 @@ export const dynamicRoutes = [ children: [ { path: "index/:dictId(\\d+)", - component: () => import("@/views/system/dict/data"), + component: commonView('system/dict/data'), name: "Data", meta: { title: "字典数据", activeMenu: "/system/dict" }, }, @@ -299,7 +300,7 @@ export const dynamicRoutes = [ children: [ { path: "index/:jobId(\\d+)", - component: () => import("@/views/monitor/job/log"), + component: commonView('monitor/job/log'), name: "JobLog", meta: { title: "调度日志", activeMenu: "/monitor/job" }, }, @@ -313,7 +314,7 @@ export const dynamicRoutes = [ children: [ { path: "index/:tableId(\\d+)", - component: () => import("@/views/tool/gen/editTable"), + component: commonView('tool/gen/editTable'), name: "GenEdit", meta: { title: "修改生成配置", activeMenu: "/tool/gen" }, }, diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index a7f3835..6a8d29b 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -4,6 +4,7 @@ import { getRouters } from '@/api/menu' import Layout from '@/layout/index' import ParentView from '@/components/ParentView' import InnerLink from '@/layout/components/InnerLink' +import { commonViewRegistry } from '@cmvr/iot-common' // 匹配views里面所有的.vue文件 const modules = import.meta.glob('./../../views/**/*.vue') @@ -150,9 +151,10 @@ export const loadView = (view) => { const dir = path.split('views/')[1].split('.vue')[0] if (dir === view) { res = () => modules[path]() + break } } - return res + return res || commonViewRegistry[String(view || '').replace(/^\/+|\.vue$/g, '')] } export default usePermissionStore diff --git a/src/utils/auth.js b/src/utils/auth.js index 08a43d6..3f88270 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,6 @@ import Cookies from 'js-cookie' -const TokenKey = 'Admin-Token' +const TokenKey = 'CMVR-Platform-Token' export function getToken() { return Cookies.get(TokenKey) diff --git a/src/views/is/project/evaluate/Run.vue b/src/views/is/project/evaluate/Run.vue index 313b5b0..9e14590 100644 --- a/src/views/is/project/evaluate/Run.vue +++ b/src/views/is/project/evaluate/Run.vue @@ -68,7 +68,7 @@ import { ref, watch } from "vue"; import { ElMessage } from "element-plus"; import { addValueProperty, formatTableData } from "@/utils/flow"; import { getExecuteRunParams, projectExecute } from "@/api/is/project/index.js"; -import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' +import { RuntimeAssignmentsEditor } from '@cmvr/iot-common' import { firstAssignedRobotId, loadFlowItemRuntimeRoles, diff --git a/src/views/test/configs/Run.vue b/src/views/test/configs/Run.vue index 7320dd3..6fdc5a7 100644 --- a/src/views/test/configs/Run.vue +++ b/src/views/test/configs/Run.vue @@ -68,7 +68,7 @@ import { emitter } from "@/utils/eventBus"; import { ElMessage } from "element-plus"; import { getTaskConfig } from "@/api/test/config.js"; import { taskExecute } from "@/api/test/config" -import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' +import { RuntimeAssignmentsEditor } from '@cmvr/iot-common' import { firstAssignedRobotId, loadFlowItemScopedRuntimeRoles, diff --git a/src/views/test/log/index.vue b/src/views/test/log/index.vue index e3a4d99..d384919 100644 --- a/src/views/test/log/index.vue +++ b/src/views/test/log/index.vue @@ -218,7 +218,7 @@ import { appendParamsToPath } from "@/utils/fn.js"; import { getTaskConfig } from "@/api/test/config.js"; import { onMounted } from "vue"; import { fetchAllPagedRows } from '@/utils/pagedRequest' -import TaskExecutionLog from '@/views/flow/components/TaskExecutionLog.vue' +import { TaskExecutionLog } from '@cmvr/iot-common' import { useContainerHeight } from "@/hooks/tableHeight"; diff --git a/src/views/vi/testProject/evaluate/Run.vue b/src/views/vi/testProject/evaluate/Run.vue index 2e1a90a..81dc1e0 100644 --- a/src/views/vi/testProject/evaluate/Run.vue +++ b/src/views/vi/testProject/evaluate/Run.vue @@ -68,7 +68,7 @@ import { ref, watch } from "vue"; import { ElMessage } from "element-plus"; import { addValueProperty, formatTableData } from "@/utils/flow"; import { getExecuteRunParams, projectExecute } from "@/api/vi/project.js" -import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' +import { RuntimeAssignmentsEditor } from '@cmvr/iot-common' import { firstAssignedRobotId, loadFlowItemRuntimeRoles, diff --git a/vite.config.js b/vite.config.js index b3c084c..39bc171 100644 --- a/vite.config.js +++ b/vite.config.js @@ -30,6 +30,7 @@ export default defineConfig(({ mode, command }) => { // 设置别名 '@': path.resolve(__dirname, './src') }, + dedupe: ['vue', 'vue-router', 'pinia', 'element-plus', '@element-plus/icons-vue'], // https://cn.vitejs.dev/config/#resolve-extensions extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] },