前端修改

玉溪
LAPTOP-S9HJSOEB\昊天 4 months ago
parent 5b269882fc
commit 808a3acd7d

@ -10,7 +10,15 @@ const router = createRouter({
routes: remainingRouter as RouteRecordRaw[],
scrollBehavior: () => ({ left: 0, top: 0 })
})
window.addEventListener('beforeunload', () => {
sessionStorage.setItem('shouldRedirectToHome', 'true')
})
router.isReady().then(() => {
if (sessionStorage.getItem('shouldRedirectToHome')) {
sessionStorage.removeItem('shouldRedirectToHome')
router.push('/index')
}
})
export const resetRouter = (): void => {
const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root']
router.getRoutes().forEach((route) => {

@ -70,30 +70,7 @@
</el-row>
<!-- 底部区域 -->
<el-row :gutter="20" class="mt-20px">
<el-col :span="7">
<!-- 左下实时滚动信息 -->
<el-card shadow="always">
<template #header>
<div class="card-header">
<span>盘点饼状图</span>
</div>
</template>
<Echart style="width: 100%; height: 200px" :options="stockPieOptions" />
</el-card>
</el-col>
<el-col :span="17">
<el-card shadow="always">
<template #header>
<div class="card-header">
<span>随行折线图</span>
</div>
</template>
<Echart style="width: 100%; height: 200px" :options="laneInventoryLineOptions" />
</el-card>
</el-col>
</el-row>
</ContentWrap>
</template>
<script setup lang="ts">
@ -139,7 +116,7 @@ const getAll = async () => {
try {
statistics.value = await homeApi.statistics()
laneInventoryStatistics.value = await homeApi.laneInventoryStatistics()
laneInventoryLine.value = await homeApi.laneInventoryLine()
// laneInventoryLine.value = await homeApi.laneInventoryLine()
stockLaneInventoryStatistics.value = await homeApi.stockLaneInventoryStatistics()
const chartData = stockLaneInventoryStatistics.value
@ -191,7 +168,7 @@ const getAll = async () => {
xAxis: laneInventoryStatistics.value.xaxis,
yAxis: {
type: 'value',
interval: 1, // 1
minInterval: 1, // 1
splitNumber: 5 // 5
},
series: laneInventoryStatistics.value.series

@ -166,9 +166,9 @@ const handleLogin = async (params) => {
window.location.href = window.location.href.replace('/login?redirect=', '')
} else {
console.log(redirect.value);
console.log(permissionStore.addRouters[0].path);
// console.log(permissionStore.addRouters[0].path);
push({ path: redirect.value || permissionStore.addRouters[0].path })
push({ path: redirect.value || '/index' })
// push({ path: redirect.value})
}
} finally {

Loading…
Cancel
Save