Admin
2022-12-01 44ca77b3057dd7f5cd67b7a6ee89b164e3b0749b
Default Changelist
已修改4个文件
88 ■■■■■ 文件已修改
src/router/index.ts 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/route.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePrevent/dpIndex/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/intellectInspect/intelligentLine/index.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts
@@ -66,36 +66,32 @@
// 路由加载前
router.beforeEach(async (to, from, next) => {
    if (to.path === '/intelligentLine') {
    NProgress.configure({ showSpinner: false });
    if (to.meta.title) NProgress.start();
    const token = Session.get('token');
    if (to.path === '/login' && !token) {
        next();
        NProgress.done();
    } else {
        NProgress.configure({ showSpinner: false });
        if (to.meta.title) NProgress.start();
        const token = Session.get('token');
        if (to.path === '/login' && !token) {
            next();
        if (!token) {
            next(`/login?redirect=${to.path}&params=${JSON.stringify(to.query ? to.query : to.params)}`);
            Session.clear();
            NProgress.done();
        } else if (token && to.path === '/login') {
            next('/home');
            NProgress.done();
        } else {
            if (!token) {
                next(`/login?redirect=${to.path}&params=${JSON.stringify(to.query ? to.query : to.params)}`);
                Session.clear();
                NProgress.done();
            } else if (token && to.path === '/login') {
                next('/home');
                NProgress.done();
            } else {
                const storesRoutesList = useRoutesList(pinia);
                const { routesList } = storeToRefs(storesRoutesList);
                if (routesList.value.length === 0) {
            const storesRoutesList = useRoutesList(pinia);
            const { routesList } = storeToRefs(storesRoutesList);
            if (routesList.value.length === 0) {
                    // 后端控制路由:路由数据初始化,防止刷新时丢失
                    await initBackEndControlRoutes();
                    // 动态添加路由:防止非首页刷新时跳转回首页的问题
                    // 确保 addRoute() 时动态添加的路由已经被完全加载上去
                    next({ ...to, replace: true });
                } else {
                    next();
                }
                // 后端控制路由:路由数据初始化,防止刷新时丢失
                await initBackEndControlRoutes();
                // 动态添加路由:防止非首页刷新时跳转回首页的问题
                // 确保 addRoute() 时动态添加的路由已经被完全加载上去
                next({ ...to, replace: true });
            } else {
                next();
            }
        }
    }
src/router/route.ts
@@ -111,13 +111,5 @@
        meta: {
            title: '安全物资与设备'
        }
    },
    {
        path: '/intelligentLine',
        name: 'intelligentLine',
        component: () => import('/@/views/intellectInspect/intelligentLine/index.vue'),
        meta: {
            title: '巡检路线'
        }
    }
];
src/views/doublePrevent/dpIndex/index.vue
@@ -30,7 +30,7 @@
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="reportTime" label="上报时间" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="reportTime" label="上报时间" show-overflow-tooltip align="center"></el-table-column>
                    <el-table-column prop="dangerStatus" label="隐患状态" show-overflow-tooltip>
                        <template #default="scope">
                            <div :style="{color: scope.row.dangerStatus==0 || scope.row.dangerStatus==1 ?'#67C23A':(scope.row.dangerStatus==2 || scope.row.dangerStatus==3?'#F56C6C':'#409EFF')}">
src/views/intellectInspect/intelligentLine/index.vue
@@ -1,14 +1,18 @@
<template>
    <div class="container">
    <div class="container" id="screenFull">
        <div class="big-title" @click="goBack()">国泰新华智能巡检系统</div>
        <div style="height: 20px;font-size: 14px;line-height: 20px; color: #00ffff; margin-top: 4px">{{ present }}</div>
        <div class="btns">
            <div class="fullbtn" @click="onScreenfullClick">
                <div class="toFull">
                    <i class="iconfont" :title="isScreenfull ? $t('message.user.title6') : $t('message.user.title5')" :class="!isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"></i>
                </div>
                <div>全屏</div>
            </div>
<!--            <div class="fullbtn" @click="onScreenfullClick">-->
<!--                <div class="toFull">-->
<!--                    <i class="iconfont" :title="全屏" :class="!isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"></i>-->
<!--                  <el-icon>-->
<!--                    <FullScreen v-if="isScreenfull"/>-->
<!--                    <Close v-else/>-->
<!--                  </el-icon>-->
<!--                </div>-->
<!--                <div>全屏</div>-->
<!--            </div>-->
            <div class="backBtn" @click="goBack()">
                <img src="../../../assets/loginPage/back-icon.png"/>
                <div>退出</div>
@@ -101,7 +105,6 @@
// 定义接口来定义对象的类型
interface stateType {
    present: string;
    isScreenfull: boolean;
    path: string;
    socket: any;
    socketData: string;
@@ -118,7 +121,6 @@
        const route = useRoute();
        const state = reactive<stateType>({
            present: '',
            isScreenfull: false,
            path: '',
            socketData: '',
            socket: null,
@@ -135,6 +137,7 @@
            state.id = curId.toString()
            getLine(state.id)
            getUrl(state.id)
            onScreenfullClick();
        });
        const dataList = computed(() => {
@@ -199,18 +202,13 @@
        // 全屏
        const onScreenfullClick = () => {
            const element = document.getElementById('screenFull')
            if (!screenfull.isEnabled) {
                ElMessage.warning('暂不不支持全屏');
                return false;
            }
            screenfull.toggle();
            screenfull.on('change', () => {
                if (screenfull.isFullscreen) {
                    state.isScreenfull = true;
                } else {
                    state.isScreenfull = false;
                }
            });
            screenfull.toggle(element);
            console.log(111111111111111)
        };
        // 返回