Commit 4424540c authored by Cai Wei's avatar Cai Wei

feat(*): 布袋监测优化

parent b1f8c8a9
......@@ -4,6 +4,12 @@ import Layout from '../layout/index.vue'
// 检查路由是否在授权菜单中的函数
const checkRoutePermission = (route, menuList) => {
// bag-monitor 路由不需要权限验证
if (route.path === '/bag-monitor') {
return true;
}
// 检查当前路由
const hasPermission = menuList.some(menu =>
menu.name === route.meta?.title &&
......
......@@ -5,7 +5,7 @@ import NProgress from 'nprogress'
import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
const whiteList = ['/login', '/auth-redirect', '/bag-monitor'] // no redirect whitelist
router.beforeEach(async (to, from, next) => {
const store = useUsersStore()
const hasToken = getToken('TOKEN')
......@@ -50,19 +50,6 @@ router.beforeEach(async (to, from, next) => {
}
} else {
try {
// debugger
// get user info
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
// const roles = await store.getInfo()
// generate accessible routes map based on roles
// const menuLimitsObj = await store.menuLimitsObj
// const accessRoutes = await store.dispatch('permission/generateRoutes', { roles, menuLimitsObj })
// console.log("accessRoutes",accessRoutes)
// dynamically add accessible routes
// router.addRoutes(accessRoutes)
// hack method to ensure that addRoutes is complete
// set the replace: true, so the navigation will not leave a history record
// next({ ...to, replace: true })
next()
} catch (error) {
console.log(error)
......
......@@ -159,7 +159,7 @@ export const getBagMonitoringChartOption = (xData = [], seriesData = []) => ({
type: "value",
min: 0,
// max: 600,
interval: 200,
// interval: 200,
axisLabel: {
color: "rgba(0,0,0,0.6)",
formatter: "{value}",
......
......@@ -68,6 +68,10 @@
<div class="data-table">
<div class="time-controls">
<div class="time-desc">
<span class="icon"></span>
当前实时信号:{{ currentData.compartNo }}仓 / {{ currentData.row }}</div>
<div>
<el-button @click="navigateBackward">
<el-icon><ArrowLeftBold />向前</el-icon>
</el-button>
......@@ -81,6 +85,8 @@
<el-button @click="reset">重置</el-button>
</div>
</div>
<table>
<thead>
<tr>
......@@ -92,8 +98,8 @@
</thead>
<tbody>
<tr>
<td>峰值{{currentData.row}}排_R</td>
<td v-for="(value, index) in tableData" :key="'r' + index">
<td>峰值{{ currentData.row }}排_R</td>
<td v-for="(value, index) in tableData" :key="'r' + index" :class="{ 'online-style': value.compartNo === currentData.compartNo }">
{{ value.peakValueR || "-" }}
</td>
</tr>
......@@ -482,9 +488,12 @@ const getDeviceList = () => {
getMonitorList({
dusterNo: dusterNo.value,
}).then((res) => {
if (res.data) {
deviceList.value = res.data.devices || [];
if (deviceList.value.length > 0) {
selectedDevice.value = deviceList.value[0].deviceNo;
}
tableData.value = Array.from(
{ length: res.data.compartCount },
(item, index) => ({
......@@ -495,8 +504,8 @@ const getDeviceList = () => {
blowBack: 0,
})
);
}
initChart();
}
});
};
......@@ -573,7 +582,7 @@ onBeforeUnmount(() => {
.title {
font-size: 18px;
font-weight: bold;
color: #409eff;
color: #2182a0;
}
}
......@@ -712,14 +721,31 @@ onBeforeUnmount(() => {
z-index: 1;
}
}
.online-style {
background-color: rgba(33, 130, 160, 1);
color: #fff;
}
}
.time-controls {
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: flex-end;
justify-content: space-between;
.time-desc {
font-size: 14px;
color: #606266;
display: flex;
align-items: center;
.icon {
display: inline-block;
width: 12px;
height: 12px;
background-color: #05ea09;
border-radius: 50%;
margin-right: 5px;
}
}
.time-label,
.time-unit {
margin: 0 5px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment