feat: 重构

This commit is contained in:
zhanghao 2026-08-25 10:26:33 +08:00
parent 815f8d3cde
commit 73ee3fe080
13 changed files with 107 additions and 61 deletions

View File

@ -7,8 +7,8 @@ VITE_APP_ENV = 'development'
# 招商车研物联网平台/开发环境 # 招商车研物联网平台/开发环境
VITE_APP_BASE_API = '/dev-api' VITE_APP_BASE_API = '/dev-api'
VITE_API_URL = http://localhost:14080 VITE_API_URL = http://192.168.0.222:14080
VITE_WS_URL = ws://localhost:14080/ws VITE_WS_URL = ws://192.168.0.222:14080/ws
VITE_PORT = 5174 VITE_PORT = 5174
VITE_INSPECTION_TYPE = "inspection" VITE_INSPECTION_TYPE = "inspection"
VITE_MINIO_URL = "http://192.168.28.10:9000/cmvr-iot/" VITE_MINIO_URL = "http://192.168.28.10:9000/cmvr-iot/"

View File

@ -14,6 +14,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@cmvr/iot-common": "1.0.0",
"@element-plus/icons-vue": "2.3.2", "@element-plus/icons-vue": "2.3.2",
"@vue-flow/background": "^1.3.2", "@vue-flow/background": "^1.3.2",
"@vue-flow/controls": "^1.1.3", "@vue-flow/controls": "^1.1.3",

81
pnpm-lock.yaml generated
View File

@ -11,6 +11,9 @@ importers:
.: .:
dependencies: 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': '@element-plus/icons-vue':
specifier: 2.3.2 specifier: 2.3.2
version: 2.3.2(vue@3.5.26) version: 2.3.2(vue@3.5.26)
@ -182,6 +185,15 @@ packages:
'@bufbuild/protobuf@2.13.0': '@bufbuild/protobuf@2.13.0':
resolution: {integrity: sha512-acq7c49vxfm1ggJ95P70TX7ABDM0vxr1SYD3BB0o0jnBLB4OAqeHyKuN+cD3w80gXEDQ2zxHpR6CUeA+O/aU9g==} 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': '@codemirror/autocomplete@6.20.3':
resolution: {integrity: sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==} resolution: {integrity: sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==}
@ -487,42 +499,36 @@ packages:
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm-musl@2.6.0': '@parcel/watcher-linux-arm-musl@2.6.0':
resolution: {integrity: sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==} resolution: {integrity: sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-linux-arm64-glibc@2.6.0': '@parcel/watcher-linux-arm64-glibc@2.6.0':
resolution: {integrity: sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==} resolution: {integrity: sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm64-musl@2.6.0': '@parcel/watcher-linux-arm64-musl@2.6.0':
resolution: {integrity: sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==} resolution: {integrity: sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-linux-x64-glibc@2.6.0': '@parcel/watcher-linux-x64-glibc@2.6.0':
resolution: {integrity: sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==} resolution: {integrity: sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-x64-musl@2.6.0': '@parcel/watcher-linux-x64-musl@2.6.0':
resolution: {integrity: sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==} resolution: {integrity: sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-win32-arm64@2.6.0': '@parcel/watcher-win32-arm64@2.6.0':
resolution: {integrity: sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==} resolution: {integrity: sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==}
@ -594,79 +600,66 @@ packages:
resolution: {integrity: sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==} resolution: {integrity: sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.62.3': '@rollup/rollup-linux-arm-musleabihf@4.62.3':
resolution: {integrity: sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==} resolution: {integrity: sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.62.3': '@rollup/rollup-linux-arm64-gnu@4.62.3':
resolution: {integrity: sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==} resolution: {integrity: sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.62.3': '@rollup/rollup-linux-arm64-musl@4.62.3':
resolution: {integrity: sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==} resolution: {integrity: sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-loong64-gnu@4.62.3': '@rollup/rollup-linux-loong64-gnu@4.62.3':
resolution: {integrity: sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==} resolution: {integrity: sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==}
cpu: [loong64] cpu: [loong64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-loong64-musl@4.62.3': '@rollup/rollup-linux-loong64-musl@4.62.3':
resolution: {integrity: sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==} resolution: {integrity: sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==}
cpu: [loong64] cpu: [loong64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-ppc64-gnu@4.62.3': '@rollup/rollup-linux-ppc64-gnu@4.62.3':
resolution: {integrity: sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==} resolution: {integrity: sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-ppc64-musl@4.62.3': '@rollup/rollup-linux-ppc64-musl@4.62.3':
resolution: {integrity: sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==} resolution: {integrity: sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-riscv64-gnu@4.62.3': '@rollup/rollup-linux-riscv64-gnu@4.62.3':
resolution: {integrity: sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==} resolution: {integrity: sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-musl@4.62.3': '@rollup/rollup-linux-riscv64-musl@4.62.3':
resolution: {integrity: sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==} resolution: {integrity: sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-s390x-gnu@4.62.3': '@rollup/rollup-linux-s390x-gnu@4.62.3':
resolution: {integrity: sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==} resolution: {integrity: sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==}
cpu: [s390x] cpu: [s390x]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.62.3': '@rollup/rollup-linux-x64-gnu@4.62.3':
resolution: {integrity: sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==} resolution: {integrity: sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.62.3': '@rollup/rollup-linux-x64-musl@4.62.3':
resolution: {integrity: sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==} resolution: {integrity: sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-openbsd-x64@4.62.3': '@rollup/rollup-openbsd-x64@4.62.3':
resolution: {integrity: sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==} resolution: {integrity: sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==}
@ -2344,56 +2337,48 @@ packages:
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: glibc
sass-embedded-linux-arm@1.97.2: sass-embedded-linux-arm@1.97.2:
resolution: {integrity: sha512-yDRe1yifGHl6kibkDlRIJ2ZzAU03KJ1AIvsAh4dsIDgK5jx83bxZLV1ZDUv7a8KK/iV/80LZnxnu/92zp99cXQ==} resolution: {integrity: sha512-yDRe1yifGHl6kibkDlRIJ2ZzAU03KJ1AIvsAh4dsIDgK5jx83bxZLV1ZDUv7a8KK/iV/80LZnxnu/92zp99cXQ==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: glibc
sass-embedded-linux-musl-arm64@1.97.2: sass-embedded-linux-musl-arm64@1.97.2:
resolution: {integrity: sha512-NfUqZSjHwnHvpSa7nyNxbWfL5obDjNBqhHUYmqbHUcmqBpFfHIQsUPgXME9DKn1yBlBc3mWnzMxRoucdYTzd2Q==} resolution: {integrity: sha512-NfUqZSjHwnHvpSa7nyNxbWfL5obDjNBqhHUYmqbHUcmqBpFfHIQsUPgXME9DKn1yBlBc3mWnzMxRoucdYTzd2Q==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: musl
sass-embedded-linux-musl-arm@1.97.2: sass-embedded-linux-musl-arm@1.97.2:
resolution: {integrity: sha512-GIO6xfAtahJAWItvsXZ3MD1HM6s8cKtV1/HL088aUpKJaw/2XjTCveiOO2AdgMpLNztmq9DZ1lx5X5JjqhS45g==} resolution: {integrity: sha512-GIO6xfAtahJAWItvsXZ3MD1HM6s8cKtV1/HL088aUpKJaw/2XjTCveiOO2AdgMpLNztmq9DZ1lx5X5JjqhS45g==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: musl
sass-embedded-linux-musl-riscv64@1.97.2: sass-embedded-linux-musl-riscv64@1.97.2:
resolution: {integrity: sha512-qtM4dJ5gLfvyTZ3QencfNbsTEShIWImSEpkThz+Y2nsCMbcMP7/jYOA03UWgPfEOKSehQQ7EIau7ncbFNoDNPQ==} resolution: {integrity: sha512-qtM4dJ5gLfvyTZ3QencfNbsTEShIWImSEpkThz+Y2nsCMbcMP7/jYOA03UWgPfEOKSehQQ7EIau7ncbFNoDNPQ==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: musl
sass-embedded-linux-musl-x64@1.97.2: sass-embedded-linux-musl-x64@1.97.2:
resolution: {integrity: sha512-ZAxYOdmexcnxGnzdsDjYmNe3jGj+XW3/pF/n7e7r8y+5c6D2CQRrCUdapLgaqPt1edOPQIlQEZF8q5j6ng21yw==} resolution: {integrity: sha512-ZAxYOdmexcnxGnzdsDjYmNe3jGj+XW3/pF/n7e7r8y+5c6D2CQRrCUdapLgaqPt1edOPQIlQEZF8q5j6ng21yw==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: musl
sass-embedded-linux-riscv64@1.97.2: sass-embedded-linux-riscv64@1.97.2:
resolution: {integrity: sha512-reVwa9ZFEAOChXpDyNB3nNHHyAkPMD+FTctQKECqKiVJnIzv2EaFF6/t0wzyvPgBKeatA8jszAIeOkkOzbYVkQ==} resolution: {integrity: sha512-reVwa9ZFEAOChXpDyNB3nNHHyAkPMD+FTctQKECqKiVJnIzv2EaFF6/t0wzyvPgBKeatA8jszAIeOkkOzbYVkQ==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: glibc
sass-embedded-linux-x64@1.97.2: sass-embedded-linux-x64@1.97.2:
resolution: {integrity: sha512-bvAdZQsX3jDBv6m4emaU2OMTpN0KndzTAMgJZZrKUgiC0qxBmBqbJG06Oj/lOCoXGCxAvUOheVYpezRTF+Feog==} resolution: {integrity: sha512-bvAdZQsX3jDBv6m4emaU2OMTpN0KndzTAMgJZZrKUgiC0qxBmBqbJG06Oj/lOCoXGCxAvUOheVYpezRTF+Feog==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: glibc
sass-embedded-unknown-all@1.97.2: sass-embedded-unknown-all@1.97.2:
resolution: {integrity: sha512-86tcYwohjPgSZtgeU9K4LikrKBJNf8ZW/vfsFbdzsRlvc73IykiqanufwQi5qIul0YHuu9lZtDWyWxM2dH/Rsg==} resolution: {integrity: sha512-86tcYwohjPgSZtgeU9K4LikrKBJNf8ZW/vfsFbdzsRlvc73IykiqanufwQi5qIul0YHuu9lZtDWyWxM2dH/Rsg==}
@ -2993,6 +2978,48 @@ snapshots:
'@bufbuild/protobuf@2.13.0': {} '@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': '@codemirror/autocomplete@6.20.3':
dependencies: dependencies:
'@codemirror/language': 6.12.4 '@codemirror/language': 6.12.4

View File

@ -1,4 +1,5 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import { configureCmvrCommon } from '@cmvr/iot-common'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
@ -30,6 +31,16 @@ import { useDict } from '@/utils/dict'
import { getConfigKey } from "@/api/system/config" import { getConfigKey } from "@/api/system/config"
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' 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' import Pagination from '@/components/Pagination'
// 自定义表格工具组件 // 自定义表格工具组件

View File

@ -1,10 +1,13 @@
const CachePrefix = 'cmvr:platform:'
const cacheKey = (key) => `${CachePrefix}${key}`
const sessionCache = { const sessionCache = {
set (key, value) { set (key, value) {
if (!sessionStorage) { if (!sessionStorage) {
return return
} }
if (key != null && value != null) { if (key != null && value != null) {
sessionStorage.setItem(key, value) sessionStorage.setItem(cacheKey(key), value)
} }
}, },
get (key) { get (key) {
@ -14,7 +17,7 @@ const sessionCache = {
if (key == null) { if (key == null) {
return null return null
} }
return sessionStorage.getItem(key) return sessionStorage.getItem(cacheKey(key))
}, },
setJSON (key, jsonValue) { setJSON (key, jsonValue) {
if (jsonValue != null) { if (jsonValue != null) {
@ -29,7 +32,7 @@ const sessionCache = {
return null return null
}, },
remove (key) { remove (key) {
sessionStorage.removeItem(key) sessionStorage.removeItem(cacheKey(key))
} }
} }
const localCache = { const localCache = {
@ -38,7 +41,7 @@ const localCache = {
return return
} }
if (key != null && value != null) { if (key != null && value != null) {
localStorage.setItem(key, value) localStorage.setItem(cacheKey(key), value)
} }
}, },
get (key) { get (key) {
@ -48,7 +51,7 @@ const localCache = {
if (key == null) { if (key == null) {
return null return null
} }
return localStorage.getItem(key) return localStorage.getItem(cacheKey(key))
}, },
setJSON (key, jsonValue) { setJSON (key, jsonValue) {
if (jsonValue != null) { if (jsonValue != null) {
@ -63,7 +66,7 @@ const localCache = {
return null return null
}, },
remove (key) { remove (key) {
localStorage.removeItem(key) localStorage.removeItem(cacheKey(key))
} }
} }

View File

@ -1,6 +1,15 @@
import { createWebHistory, createRouter } from "vue-router"; import { createWebHistory, createRouter } from "vue-router";
/* Layout */ /* Layout */
import Layout from "@/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: 路由配置项 * Note: 路由配置项
@ -33,28 +42,28 @@ export const constantRoutes = [
children: [ children: [
{ {
path: "/redirect/:path(.*)", path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"), component: commonView('redirect/index'),
}, },
], ],
}, },
{ {
path: "/login", path: "/login",
component: () => import("@/views/login"), component: commonView('login'),
hidden: true, hidden: true,
}, },
{ {
path: "/register", path: "/register",
component: () => import("@/views/register"), component: commonView('register'),
hidden: true, hidden: true,
}, },
{ {
path: "/:pathMatch(.*)*", path: "/:pathMatch(.*)*",
component: () => import("@/views/error/404"), component: commonView('error/404'),
hidden: true, hidden: true,
}, },
{ {
path: "/401", path: "/401",
component: () => import("@/views/error/401"), component: commonView('error/401'),
hidden: true, hidden: true,
}, },
{ {
@ -126,14 +135,6 @@ export const constantRoutes = [
meta: { title: "触摸交互", noLogin: true }, meta: { title: "触摸交互", noLogin: true },
hidden: true, hidden: true,
}, },
{
//cockpit
path: "/inspection/cockpit",
component: () =>
import("@/views/inspection/cockpit/index.vue"),
meta: { title: "logicFlow", noLogin: true },
hidden: true,
},
{ {
// 流程运行状态 // 流程运行状态
path: "/logic_flow", path: "/logic_flow",
@ -145,7 +146,7 @@ export const constantRoutes = [
{ {
// 流程编排 // 流程编排
path: "/flow", path: "/flow",
component: () => import("@/views/flow/index.vue"), component: commonView('flow/index'),
meta: { title: "流程编排", noLogin: true }, meta: { title: "流程编排", noLogin: true },
hidden: true, hidden: true,
}, },
@ -183,7 +184,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: "profile/:activeTab?", path: "profile/:activeTab?",
component: () => import("@/views/system/user/profile/index"), component: commonView('system/user/profile/index'),
name: "Profile", name: "Profile",
meta: { title: "个人中心", icon: "user" }, meta: { title: "个人中心", icon: "user" },
}, },
@ -201,7 +202,7 @@ export const dynamicRoutes = [
children: [ children: [
{ {
path: "role/:userId(\\d+)", path: "role/:userId(\\d+)",
component: () => import("@/views/system/user/authRole"), component: commonView('system/user/authRole'),
name: "AuthRole", name: "AuthRole",
meta: { title: "分配角色", activeMenu: "/system/user" }, meta: { title: "分配角色", activeMenu: "/system/user" },
}, },
@ -215,7 +216,7 @@ export const dynamicRoutes = [
children: [ children: [
{ {
path: "user/:roleId(\\d+)", path: "user/:roleId(\\d+)",
component: () => import("@/views/system/role/authUser"), component: commonView('system/role/authUser'),
name: "AuthUser", name: "AuthUser",
meta: { title: "分配用户", activeMenu: "/system/role" }, meta: { title: "分配用户", activeMenu: "/system/role" },
}, },
@ -229,7 +230,7 @@ export const dynamicRoutes = [
children: [ children: [
{ {
path: "index/:dictId(\\d+)", path: "index/:dictId(\\d+)",
component: () => import("@/views/system/dict/data"), component: commonView('system/dict/data'),
name: "Data", name: "Data",
meta: { title: "字典数据", activeMenu: "/system/dict" }, meta: { title: "字典数据", activeMenu: "/system/dict" },
}, },
@ -299,7 +300,7 @@ export const dynamicRoutes = [
children: [ children: [
{ {
path: "index/:jobId(\\d+)", path: "index/:jobId(\\d+)",
component: () => import("@/views/monitor/job/log"), component: commonView('monitor/job/log'),
name: "JobLog", name: "JobLog",
meta: { title: "调度日志", activeMenu: "/monitor/job" }, meta: { title: "调度日志", activeMenu: "/monitor/job" },
}, },
@ -313,7 +314,7 @@ export const dynamicRoutes = [
children: [ children: [
{ {
path: "index/:tableId(\\d+)", path: "index/:tableId(\\d+)",
component: () => import("@/views/tool/gen/editTable"), component: commonView('tool/gen/editTable'),
name: "GenEdit", name: "GenEdit",
meta: { title: "修改生成配置", activeMenu: "/tool/gen" }, meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
}, },

View File

@ -4,6 +4,7 @@ import { getRouters } from '@/api/menu'
import Layout from '@/layout/index' import Layout from '@/layout/index'
import ParentView from '@/components/ParentView' import ParentView from '@/components/ParentView'
import InnerLink from '@/layout/components/InnerLink' import InnerLink from '@/layout/components/InnerLink'
import { commonViewRegistry } from '@cmvr/iot-common'
// 匹配views里面所有的.vue文件 // 匹配views里面所有的.vue文件
const modules = import.meta.glob('./../../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] const dir = path.split('views/')[1].split('.vue')[0]
if (dir === view) { if (dir === view) {
res = () => modules[path]() res = () => modules[path]()
break
} }
} }
return res return res || commonViewRegistry[String(view || '').replace(/^\/+|\.vue$/g, '')]
} }
export default usePermissionStore export default usePermissionStore

View File

@ -1,6 +1,6 @@
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token' const TokenKey = 'CMVR-Platform-Token'
export function getToken() { export function getToken() {
return Cookies.get(TokenKey) return Cookies.get(TokenKey)

View File

@ -68,7 +68,7 @@ import { ref, watch } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow"; import { addValueProperty, formatTableData } from "@/utils/flow";
import { getExecuteRunParams, projectExecute } from "@/api/is/project/index.js"; import { getExecuteRunParams, projectExecute } from "@/api/is/project/index.js";
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' import { RuntimeAssignmentsEditor } from '@cmvr/iot-common'
import { import {
firstAssignedRobotId, firstAssignedRobotId,
loadFlowItemRuntimeRoles, loadFlowItemRuntimeRoles,

View File

@ -68,7 +68,7 @@ import { emitter } from "@/utils/eventBus";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { getTaskConfig } from "@/api/test/config.js"; import { getTaskConfig } from "@/api/test/config.js";
import { taskExecute } from "@/api/test/config" import { taskExecute } from "@/api/test/config"
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' import { RuntimeAssignmentsEditor } from '@cmvr/iot-common'
import { import {
firstAssignedRobotId, firstAssignedRobotId,
loadFlowItemScopedRuntimeRoles, loadFlowItemScopedRuntimeRoles,

View File

@ -218,7 +218,7 @@ import { appendParamsToPath } from "@/utils/fn.js";
import { getTaskConfig } from "@/api/test/config.js"; import { getTaskConfig } from "@/api/test/config.js";
import { onMounted } from "vue"; import { onMounted } from "vue";
import { fetchAllPagedRows } from '@/utils/pagedRequest' import { fetchAllPagedRows } from '@/utils/pagedRequest'
import TaskExecutionLog from '@/views/flow/components/TaskExecutionLog.vue' import { TaskExecutionLog } from '@cmvr/iot-common'
import { useContainerHeight } from "@/hooks/tableHeight"; import { useContainerHeight } from "@/hooks/tableHeight";

View File

@ -68,7 +68,7 @@ import { ref, watch } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow"; import { addValueProperty, formatTableData } from "@/utils/flow";
import { getExecuteRunParams, projectExecute } from "@/api/vi/project.js" import { getExecuteRunParams, projectExecute } from "@/api/vi/project.js"
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue' import { RuntimeAssignmentsEditor } from '@cmvr/iot-common'
import { import {
firstAssignedRobotId, firstAssignedRobotId,
loadFlowItemRuntimeRoles, loadFlowItemRuntimeRoles,

View File

@ -30,6 +30,7 @@ export default defineConfig(({ mode, command }) => {
// 设置别名 // 设置别名
'@': path.resolve(__dirname, './src') '@': path.resolve(__dirname, './src')
}, },
dedupe: ['vue', 'vue-router', 'pinia', 'element-plus', '@element-plus/icons-vue'],
// https://cn.vitejs.dev/config/#resolve-extensions // https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}, },