This commit is contained in:
hzz 2025-03-25 16:03:58 +08:00
parent e5b4710fb5
commit f0b6b6f6ab
14 changed files with 155 additions and 44 deletions

View File

@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/ras-web/favicon.ico">
<title>物联大屏管理系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>

View File

@ -42,6 +42,7 @@
"@vitejs/plugin-vue": "3.1.0",
"@vue/compiler-sfc": "3.2.45",
"file-loader": "^6.2.0",
"rollup-plugin-copy": "^3.5.0",
"sass": "1.56.1",
"unplugin-auto-import": "0.11.4",
"url-loader": "^4.1.1",

View File

@ -0,0 +1 @@
<svg t="1740536373624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3564" width="256" height="256"><path d="M845.3 978.7c-8.7-8.7-19.9-14.9-32.4-17.4-7.5-1.5-12.9-7.9-12.9-15.5V578.2c0-159-130.1-290.8-289.1-290.2-158.5 0.6-286.9 129.3-286.9 288v369.8c0 7.6-5.4 14-12.9 15.5-29.2 6-51.1 31.8-51.1 62.7h704c0-17.7-7.2-33.7-18.7-45.3zM567.3 464l-19.4 173.3H624L456.8 880l19.4-173.3H400L567.3 464zM512 208c-17.7 0-32-14.3-32-32V32c0-17.7 14.3-32 32-32s32 14.3 32 32v144c0 17.7-14.3 32-32 32zM280 296.1c-15.3 8.8-34.9 3.6-43.7-11.7l-72-124.7c-8.8-15.3-3.6-34.9 11.7-43.7 15.3-8.8 34.9-3.6 43.7 11.7l72 124.7c8.8 15.3 3.6 34.8-11.7 43.7zM744 296.1c15.3 8.8 34.9 3.6 43.7-11.7l72-124.7c8.8-15.3 3.6-34.9-11.7-43.7-15.3-8.8-34.9-3.6-43.7 11.7l-72 124.7c-8.8 15.3-3.6 34.8 11.7 43.7zM202.5 444.9c-4.6 17.1-22.1 27.2-39.2 22.6L24.2 430.3C7.1 425.7-3 408.2 1.5 391.1c4.6-17.1 22.1-27.2 39.2-22.6l139.1 37.3c17.1 4.5 27.2 22 22.7 39.1zM821.5 444.9c4.6 17.1 22.1 27.2 39.2 22.6l139.1-37.3c17.1-4.6 27.2-22.1 22.6-39.2-4.6-17.1-22.1-27.2-39.2-22.6l-139.1 37.3c-17 4.6-27.1 22.1-22.6 39.2z" p-id="3565" fill="#F7595B"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg t="1740535935166" class="icon" viewBox="0 0 1027 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2370" width="256" height="256"><path d="M835.707408 791.0893c8.945488 8.935549 8.945488 23.039602-0.268365 32.52182-8.667184 8.408759-22.771238 8.408759-31.99503-0.546669l-140.434229-140.145985c-8.667184-8.935549-8.667184-23.039602 0.546669-32.253456 8.677124-8.677124 23.317907-8.677124 32.531759 0L835.707408 791.0893zM773.625718 0c14.640783 0 29.55987 1.083398 44.190713 4.601957 15.455816 2.713465 29.54993 7.325361 43.107315 13.020655 18.974375 8.130455 28.198167 30.633328 19.789408 50.154372a39.638453 39.638453 0 0 1-7.86209 11.927318c-29.013201 29.003261-58.016462 57.748098-86.761299 86.751359l4.880261 17.354247 4.343532 17.622613 17.890977 4.88026 17.354247 4.611897c28.734897-29.003261 57.748098-57.479733 86.751359-86.761299 14.650722-14.909147 39.042087-14.909147 54.2196 0 4.343532 4.611896 7.593726 10.307191 9.223792 16.27085a195.558317 195.558317 0 0 1 11.658953 38.495418v0.546669h0.268365c2.703525 13.825749 4.343532 28.734897 4.343532 44.459078 0 60.998292-25.216338 117.116322-65.610188 157.788476-40.125485 40.39385-96.52182 65.341823-157.788477 65.341823-4.343532 0-8.677124-0.268365-13.020655-0.268364l-42.292282 41.745612L950.935238 721.145519l1.888492 2.166797a156.715018 156.715018 0 0 1 44.190713 109.254232c0 40.125485-15.177512 80.519335-46.089144 111.152663l-0.546669 0.546669c-30.901693 30.374903-70.490449 45.552415-110.615934 45.552415s-81.056065-15.177512-111.152663-46.099084l-233.159187-232.880882-237.741264 238.307812c-49.617642 49.607703-109.532536 53.951235-158.60351 32.810063-18.974375-7.86209-36.050318-19.789408-50.154371-33.893461h-0.268365c-14.094114-14.362479-25.753067-31.179997-33.615158-49.886007-21.141171-49.070974-16.807579-109.254232 33.078429-158.593571v-0.546669L313.290884 473.892219l-97.05855-97.058549-86.214629-25.753067a37.740022 37.740022 0 0 1-24.401305-21.419475L22.930269 135.822333c-7.593726-14.094114-5.148626-32.53176 6.778692-44.459078L64.407517 56.933064 98.569343 22.771238c10.575555-10.565616 27.114769-14.640783 41.755552-8.130455l196.283895 83.769529a37.571051 37.571051 0 0 1 21.68784 24.401305l25.484703 86.214629 97.058549 97.05855 69.675415-69.138686c-0.268365-4.880261-0.546669-9.492157-0.546668-13.010716h0.268364c0-62.08169 24.947973-118.19972 65.341824-158.325206v-0.278304c40.383911-40.115546 96.511881-65.331884 158.046901-65.331884z m-109.532536 542.752601l-114.402857 114.412797 232.602578 232.602578c15.455816 15.724181 36.865352 23.854636 57.469793 23.854636s41.487187-8.130455 56.943004-23.586271l0.536729-0.268365c15.724181-15.177512 23.049542-36.596987 23.049542-57.201428 0-20.067712-7.325361-40.39385-21.966144-55.581302l-1.620127-1.620127-232.612518-232.612518zM366.963814 420.209349l59.914894-59.636589-103.837242-104.105607a38.525237 38.525237 0 0 1-10.297251-18.974375l-22.502873-76.185743L134.082932 95.428483l-15.992545 15.72418-15.992546 16.260911 66.425222 156.158409 78.620903 23.049542c6.510328 1.898431 11.927318 5.148626 16.27085 10.028887L366.963814 420.209349zM768.208728 76.454108a146.248796 146.248796 0 0 0-98.688616 43.375679 145.562976 145.562976 0 0 0-43.37568 104.105607h0.546669v10.575555l1.083398 8.945488c2.703525 11.927318-1.083398 24.938034-10.30719 34.430191L102.097841 792.987731h-0.268364c-23.854636 24.669669-26.568101 52.599472-16.807579 75.639074 4.065228 8.935549 10.307191 17.890977 17.622612 25.474764 7.86209 7.593726 16.539214 13.557385 26.031371 17.622612 23.039602 10.028886 50.701041 7.315422 75.092406-16.539214l264.060879-264.05094 1.083398-1.083398 168.085728-168.354092 1.083398-1.351763 80.7877-80.250971h0.268364c7.86209-8.677124 20.067712-13.010716 32.263395-11.112284 3.796863 0.536729 7.315422 1.083398 11.390589 1.083398 2.703525 0.268365 6.500388 0.546669 10.84392 0.546669 40.672154 0 77.537506-16.539214 104.105606-42.560646v-0.546669c25.216338-24.938034 41.208883-59.914894 42.570586-98.688616-16.539214 16.807579-33.078428 33.078428-49.617643 50.154371-9.482218 10.565616-23.854636 14.909147-38.495418 11.658954l-38.495419-10.575556-39.042087-10.565615c-13.020655-3.528498-23.586271-13.020655-27.11477-27.11477l-10.297251-39.042087-10.575555-39.042087c-2.981829-11.927318-0.268365-26.568101 10.038826-36.060258 17.056065-17.344308 34.141948-34.420252 51.496195-51.774499z" fill="#E0E500" p-id="2371"></path></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,6 @@

<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -436 -253 )">
<path d="M 6.15 6.22 C 7.15 5.24325581395349 8.57 4.69627906976744 10 4.69627906976744 C 11.43 4.69627906976744 12.86 5.25302325581395 13.86 6.22976744186046 C 14.86 7.20651162790698 15.43 8.46651162790698 15.43 9.85348837209303 C 15.43 11.2404651162791 14.86 12.5004651162791 13.86 13.4772093023256 C 11.72 15.5674418604651 8.29 15.5674418604651 6.15 13.6139534883721 C 5.15 12.6372093023256 4.58 11.2404651162791 4.58 9.84372093023256 C 4.58 8.44697674418605 5.15 7.19674418604651 6.15 6.22 Z M 11.43 1.2093023255814 L 11.29 1.2093023255814 C 14.43 1.6293023255814 17 3.71953488372093 18.29 6.51302325581395 C 18.58 7.20651162790698 18.86 7.90976744186047 19 8.60325581395349 L 20 8.60325581395349 C 19.43 4.27627906976744 15.86 0.789302325581395 11.43 0.232558139534884 L 11.43 1.2093023255814 Z M 0 8.60325581395349 L 1 8.60325581395349 C 1.14 7.90976744186047 1.29 7.20651162790698 1.57 6.51302325581395 C 2.86 3.71953488372093 5.57 1.6293023255814 8.57 1.2093023255814 L 8.57 0.232558139534884 C 4.14 0.789302325581395 0.57 4.27627906976744 0 8.60325581395349 Z M 20 11.26 L 19 11.26 C 18.86 11.953488372093 18.71 12.6567441860465 18.43 13.3502325581395 C 17.14 16.1437209302326 14.57 18.2339534883721 11.43 18.6539534883721 L 11.43 19.6306976744186 C 15.86 19.0739534883721 19.43 15.586976744186 20 11.26 Z M 8.57 19.6306976744186 L 8.57 18.6539534883721 C 5.43 18.2339534883721 2.86 16.1437209302326 1.57 13.3502325581395 C 1.28 12.6567441860465 1.14 11.953488372093 1 11.26 L 0 11.26 C 0.57 15.586976744186 4.14 19.0739534883721 8.57 19.6306976744186 Z " fill-rule="nonzero" fill="#aaef8a" stroke="none" transform="matrix(1 0 0 1 436 253 )" />
</g>
</svg>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -436 -311 )">
<path d="M 6.15 6.22 C 7.15 5.24325581395349 8.57 4.69627906976744 10 4.69627906976744 C 11.43 4.69627906976744 12.86 5.25302325581395 13.86 6.22976744186046 C 14.86 7.20651162790698 15.43 8.46651162790698 15.43 9.85348837209303 C 15.43 11.2404651162791 14.86 12.5004651162791 13.86 13.4772093023256 C 11.72 15.5674418604651 8.29 15.5674418604651 6.15 13.6139534883721 C 5.15 12.6372093023256 4.58 11.2404651162791 4.58 9.84372093023256 C 4.58 8.44697674418605 5.15 7.19674418604651 6.15 6.22 Z M 11.43 1.2093023255814 L 11.29 1.2093023255814 C 14.43 1.6293023255814 17 3.71953488372093 18.29 6.51302325581395 C 18.58 7.20651162790698 18.86 7.90976744186047 19 8.60325581395349 L 20 8.60325581395349 C 19.43 4.27627906976744 15.86 0.789302325581395 11.43 0.232558139534884 L 11.43 1.2093023255814 Z M 0 8.60325581395349 L 1 8.60325581395349 C 1.14 7.90976744186047 1.29 7.20651162790698 1.57 6.51302325581395 C 2.86 3.71953488372093 5.57 1.6293023255814 8.57 1.2093023255814 L 8.57 0.232558139534884 C 4.14 0.789302325581395 0.57 4.27627906976744 0 8.60325581395349 Z M 20 11.26 L 19 11.26 C 18.86 11.953488372093 18.71 12.6567441860465 18.43 13.3502325581395 C 17.14 16.1437209302326 14.57 18.2339534883721 11.43 18.6539534883721 L 11.43 19.6306976744186 C 15.86 19.0739534883721 19.43 15.586976744186 20 11.26 Z M 8.57 19.6306976744186 L 8.57 18.6539534883721 C 5.43 18.2339534883721 2.86 16.1437209302326 1.57 13.3502325581395 C 1.28 12.6567441860465 1.14 11.953488372093 1 11.26 L 0 11.26 C 0.57 15.586976744186 4.14 19.0739534883721 8.57 19.6306976744186 Z " fill-rule="nonzero" fill="#d7d7d7" stroke="none" transform="matrix(1 0 0 1 436 311 )" />
</g>
</svg>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -436 -281 )">
<path d="M 6.15 6.22 C 7.15 5.24325581395349 8.57 4.69627906976744 10 4.69627906976744 C 11.43 4.69627906976744 12.86 5.25302325581395 13.86 6.22976744186046 C 14.86 7.20651162790698 15.43 8.46651162790698 15.43 9.85348837209303 C 15.43 11.2404651162791 14.86 12.5004651162791 13.86 13.4772093023256 C 11.72 15.5674418604651 8.29 15.5674418604651 6.15 13.6139534883721 C 5.15 12.6372093023256 4.58 11.2404651162791 4.58 9.84372093023256 C 4.58 8.44697674418605 5.15 7.19674418604651 6.15 6.22 Z M 11.43 1.2093023255814 L 11.29 1.2093023255814 C 14.43 1.6293023255814 17 3.71953488372093 18.29 6.51302325581395 C 18.58 7.20651162790698 18.86 7.90976744186047 19 8.60325581395349 L 20 8.60325581395349 C 19.43 4.27627906976744 15.86 0.789302325581395 11.43 0.232558139534884 L 11.43 1.2093023255814 Z M 0 8.60325581395349 L 1 8.60325581395349 C 1.14 7.90976744186047 1.29 7.20651162790698 1.57 6.51302325581395 C 2.86 3.71953488372093 5.57 1.6293023255814 8.57 1.2093023255814 L 8.57 0.232558139534884 C 4.14 0.789302325581395 0.57 4.27627906976744 0 8.60325581395349 Z M 20 11.26 L 19 11.26 C 18.86 11.953488372093 18.71 12.6567441860465 18.43 13.3502325581395 C 17.14 16.1437209302326 14.57 18.2339534883721 11.43 18.6539534883721 L 11.43 19.6306976744186 C 15.86 19.0739534883721 19.43 15.586976744186 20 11.26 Z M 8.57 19.6306976744186 L 8.57 18.6539534883721 C 5.43 18.2339534883721 2.86 16.1437209302326 1.57 13.3502325581395 C 1.28 12.6567441860465 1.14 11.953488372093 1 11.26 L 0 11.26 C 0.57 15.586976744186 4.14 19.0739534883721 8.57 19.6306976744186 Z " fill-rule="nonzero" fill="#f59a23" stroke="none" transform="matrix(1 0 0 1 436 281 )" />
</g>
</svg>

View File

@ -1,9 +1,11 @@
import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import copyText from './common/copyText'
import tableAutoScroll from './tableScroll/tableAutoScroll'
export default function directive(app){
app.directive('hasRole', hasRole)
app.directive('hasPermi', hasPermi)
app.directive('copyText', copyText)
app.directive('tableAutoScroll', tableAutoScroll)
}

View File

@ -0,0 +1,59 @@
interface ElType extends HTMLElement {
timer: number | null
isScroll: boolean
curTableTopValue: number
}
export default {
created(el: ElType) {
el.timer = null
el.isScroll = true
el.curTableTopValue = 0
},
mounted(el: ElType, binding: { value?: { delay?: number } }) {
const { delay = 15 } = binding.value || {}
const tableDom = el.getElementsByClassName(
'el-scrollbar__wrap'
)[0] as HTMLElement
const viewDom = el.getElementsByClassName(
'el-scrollbar__view'
)[0] as HTMLElement
const onMouseOver = () => (el.isScroll = false)
const onMouseOut = () => {
el.curTableTopValue = tableDom.scrollTop
el.isScroll = true
}
tableDom.addEventListener('mouseover', onMouseOver)
tableDom.addEventListener('mouseout', onMouseOut)
el.timer = window.setInterval(() => {
const viewDomClientHeight = viewDom.scrollHeight
const tableDomClientHeight = el.clientHeight
if (el.isScroll && viewDomClientHeight > tableDomClientHeight) {
const curScrollPosition = tableDom.clientHeight + el.curTableTopValue
el.curTableTopValue =
curScrollPosition === tableDom.scrollHeight
? 0
: el.curTableTopValue + 1
tableDom.scrollTop = el.curTableTopValue
}
}, delay)
},
unmounted(el: ElType) {
if (el.timer !== null) {
clearInterval(el.timer)
}
el.timer = null
const tableDom = el.getElementsByClassName(
'el-scrollbar__wrap'
)[0] as HTMLElement
tableDom.removeEventListener('mouseover', () => (el.isScroll = false))
tableDom.removeEventListener('mouseout', () => {
el.curTableTopValue = tableDom.scrollTop
el.isScroll = true
})
},
}

View File

@ -11,6 +11,7 @@ import App from './App'
import store from './store'
import router from './router'
import directive from './directive' // directive
import dataV from "@iamzzg/data-view/dist/vue3/datav.map.vue.esm";
import VECharts from 'vue-echarts'
@ -110,6 +111,7 @@ app.use(router)
app.use(store)
app.use(plugins)
app.use(elementIcons)
app.use(dataV)
app.component('svg-icon', SvgIcon)
directive(app)

View File

@ -21,7 +21,7 @@ const whiteList = ['/login', '/register'];
const whiteScreen = '/screen'
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
if (!startsWith(to.path, whiteScreen) && getToken()) {
to.meta.title && useSettingsStore().setTitle(to.meta.title)
/* has token*/
if (to.path === '/login') {

View File

@ -59,7 +59,7 @@
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 天津市再登软件有限公司 版权所有</span>
<span>Copyright © 天津市再登软件有限公司 版权所有</span>
</div>
</div>
</template>

View File

@ -8,31 +8,32 @@
<CardVue class="left-container-1" title="设备列表">
<!-- <scrollBoard ref="DvScrollBoard" :data="scrollBoardConfig_data" :config="scrollBoardConfig">
</scrollBoard> -->
<el-table :data="devList"
v-tableAutoScroll="{delay:15}"
header-row-class-name="table_header"
style="width: 100%;height: 100%;"
@row-click="handlePush2item"
>
<el-table-column prop="code" label="编码" width="90"/>
<el-table :data="devList" v-tableAutoScroll="{ delay: 15 }" header-row-class-name="table_header"
style="width: 100%;height: 100%;" @row-click="handlePush2item">
<el-table-column prop="code" label="编码" width="90" />
<el-table-column prop="name" label="设备名称" />
<el-table-column prop="runTime" label="运行时长" >
<template #default="{row}">
<el-table-column prop="runTime" label="运行时长">
<template #default="{ row }">
<div>{{ row.runTime }}min</div>
</template>
</el-table-column>
<el-table-column prop="rate" label="设备利用率" >
<template #default="{row}">
<el-table-column prop="rate" label="设备利用率">
<template #default="{ row }">
<div>{{ row.rate }}%</div>
</template>
</el-table-column>
<el-table-column prop="state" label="状态" >
<template #default="{row}">
<div style="width:100%;height:100%;display:flex;justify-content: space-around;align-items: center;">
<svg-icon v-if="row.state == 0" icon-class="stop" class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 1" icon-class="wait" class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 2" icon-class="run" class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 4" icon-class="alarm" class="el-input__icon input-icon" />
<el-table-column prop="state" label="状态">
<template #default="{ row }">
<div
style="width:100%;height:100%;display:flex;justify-content: space-around;align-items: center;">
<svg-icon v-if="row.state == 0" icon-class="stop"
class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 1" icon-class="wait"
class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 2" icon-class="run"
class="el-input__icon input-icon" />
<svg-icon v-else-if="row.state == 4" icon-class="alarm"
class="el-input__icon input-icon" />
</div>
</template>
</el-table-column>
@ -105,7 +106,11 @@
</div>
<div class="centerChart">
<div class="ring-chart">
<RingChart :data="devStatus.work/devStatus.total * 100" />
<dv-decoration-9 style="width:220px;height:220px;">
<span style="font-size: 28px;font-weight: 700;">{{ (devStatus.work / devStatus.total * 100).toFixed(1)
}}%</span>
</dv-decoration-9>
</div>
</div>
</div>
@ -125,8 +130,9 @@
<LineChart :data="rateData" />
</CardVue>
<CardVue class="left-container" title="设备提醒">
<el-table :data="remindData" v-if="remindData.length > 0" v-tableAutoScroll="{delay:15}" header-row-class-name="table_header" style="width: 100%;height: 100%;">
<el-table-column prop="devCode" label="编码" width="90"/>
<el-table :data="remindData" v-if="remindData.length > 0" v-tableAutoScroll="{ delay: 15 }"
header-row-class-name="table_header" style="width: 100%;height: 100%;">
<el-table-column prop="devCode" label="编码" width="90" />
<el-table-column prop="name" label="设备名称" />
<el-table-column prop="subject" label="保养内容" />
<el-table-column prop="person" label="负责人" />
@ -141,8 +147,9 @@
</div> -->
</CardVue>
<CardVue class="left-container" title="设备报警">
<el-table :data="repairData" v-if="repairData.length > 0" v-tableAutoScroll="{delay:15}" header-row-class-name="table_header" style="width: 100%;height: 100%;">
<el-table-column prop="devCode" label="编码" width="90"/>
<el-table :data="repairData" v-if="repairData.length > 0" v-tableAutoScroll="{ delay: 15 }"
header-row-class-name="table_header" style="width: 100%;height: 100%;">
<el-table-column prop="devCode" label="编码" width="90" />
<el-table-column prop="name" label="设备名称" />
<el-table-column prop="subject" label="报警内容" />
<el-table-column prop="person" label="负责人" />
@ -158,7 +165,7 @@
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted,getCurrentInstance } from 'vue'
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'
import CardVue from './component/card.vue'
import CenterCard from './component/centerCard.vue'
@ -174,10 +181,10 @@ import u157 from './image/u157.png'
import u158 from './image/u158.png'
import 'element-plus/theme-chalk/dark/css-vars.css'
import { getConfigKey } from "@/api/system/config";
import { connectWebsocket, closeWebsocket} from "@/utils/websocket";
import { listDevice, listElect, electMonitoring, deviceStatus, deviceRate,deviceCheck,deviceRepair } from '@/api/screen/micro'
import { connectWebsocket, closeWebsocket } from "@/utils/websocket";
import { listDevice, listElect, electMonitoring, deviceStatus, deviceRate, deviceCheck, deviceRepair } from '@/api/screen/micro'
let {proxy} = getCurrentInstance()
let { proxy } = getCurrentInstance()
let router = useRouter()
let radio_bar = ref('d')
let radio_repair = ref('b')
@ -236,7 +243,7 @@ let timer = new Date().getTime();
function throttle(func, wait) {
let lastTime = 0;
return function(...args) {
return function (...args) {
const now = Date.now();
if (now - lastTime >= wait) {
@ -379,7 +386,7 @@ onMounted(() => {
getdeviceRepair()
getConfigKeyFun('screen.microFactory.title')
connectWebsocket('','',getWebsocket, errWebsocket)
connectWebsocket('', '', getWebsocket, errWebsocket)
})
onUnmounted(() => {
@ -393,10 +400,12 @@ onUnmounted(() => {
color: #21dadb;
text-align: center;
}
.input-icon {
width: 32px;
height: 32px;
}
.container {
width: 1920px;
height: 1080px;

View File

@ -1,6 +1,7 @@
import { defineConfig, loadEnv } from 'vite'
import path from 'path'
import createVitePlugins from './vite/plugins'
import copy from 'rollup-plugin-copy'
// https://vitejs.dev/config/
export default defineConfig(({ mode, command }) => {
@ -10,7 +11,7 @@ export default defineConfig(({ mode, command }) => {
// 部署生产环境和开发环境下的URL。
// 默认情况下vite 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
base: VITE_APP_ENV === 'production' ? '/ras-web/' : '/',
base: VITE_APP_ENV === 'production' ? '/' : '/',
plugins: createVitePlugins(env, command === 'build'),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
@ -23,6 +24,23 @@ export default defineConfig(({ mode, command }) => {
// https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
publicDir: false, // 禁用默认的public目录复制
build: {
rollupOptions: {
plugins: [
copy({
targets: [
{
src: 'public/*', // 复制public下所有内容
dest: 'dist/ras-web' // 输出到dist/static目录相对于build.outDir
}
],
hook: 'writeBundle' // 在打包完成后执行复制
})
]
},
assetsDir: 'ras-web/assets',
},
// vite 相关配置
server: {
port: 80,