ZhangXianQiang
2024-03-20 00bf2a7e27491ef55b7d5f7742a322010a1fec11
fix:修改路由
5个文件已修改
82 ■■■■ 已修改文件
src/router/index.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/data-view/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/components/screen-wrapper/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/components/select-item/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js
@@ -51,13 +51,13 @@
    component: Layout,
    hidden: true,
    children: [
    {
      path: 'index',
      name: 'vehicle-data-monitor',
      component: () => import('@/views/system/vehicle-data-monitor/index'),
      meta: { title: '车辆过卡口数据一致性', activeMenu: '/system/vehicle-data-monitor' }
    }
  ]
      {
        path: 'index',
        name: 'vehicle-data-monitor',
        component: () => import('@/views/system/vehicle-data-monitor/index'),
        meta: { title: '车辆过卡口数据一致性', activeMenu: '/system/vehicle-data-monitor' }
      }
    ]
  },
  {
    path: '/register',
@@ -77,7 +77,7 @@
  {
    path: '',
    component: Layout,
    redirect: 'index',
    redirect: 'screen',
    children: [
      {
        path: 'index',
@@ -87,6 +87,20 @@
      }
    ]
  },
  // {
  //   path: '',
  //   component: Layout,
  //   redirect: 'index',
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/index'),
  //       name: 'Index',
  //       meta: { title: '首页', icon: 'dashboard', affix: true }
  //     }
  //   ]
  // },
  {
    path: '/screen',
    hidden: true,
src/views/home/data-view/index.vue
@@ -9,11 +9,20 @@
    <el-card class="map-wrapper">
      <el-row>
        <el-col :offset="21" :span="3">
          <el-select v-model="selectOption" placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        <el-col :span="5">
          <div class="select-container">
            <div class="select-label">
              数据源
            </div>
            <el-select v-model="selectOption" placeholder="请选择">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </div>
        </el-col>
        <el-col :span="2">
          <el-button type="primary" @click="toScreen">可视化大屏</el-button>
        </el-col>
      </el-row>
      <el-row :gutter="40" class="data-plane" style="height: 100%;">
@@ -123,6 +132,10 @@
          value: 2,
          label: '市局数据'
        },
        {
          value: 3,
          label: '公安部数据'
        },
      ],
      selectOption: 1
    }
@@ -145,6 +158,12 @@
      });
      data.name = '自贡市';
      this.activeData = data;
    },
    toScreen() {
      this.$router.push({
        path: '/screen'
      })
    }
  },
  created() {
@@ -179,6 +198,16 @@
  aspect-ratio: 6/2;
}
.select-container {
  display: flex;
  align-items: center;
  .select-label {
    color: #666;
    margin-right: 20px;
    font-size: 16px;
  }
}
@media screen and (min-width: 1200px) {
  .el-col-md-6 {
    width: 20%;
src/views/login.vue
@@ -149,6 +149,7 @@
  watch: {
    $route: {
      handler: function(route) {
        console.log(route);
        this.redirect = route.query && route.query.redirect;
      },
      immediate: true
@@ -198,6 +199,8 @@
              this.loginInfo = loginInfo.user
              //如果返回为1正常跳转
              if(this.loginInfo.firstLogin == 1){
                this.$router.push({ path: "/" }).catch(()=>{});
                return;
                this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
              } else {
                 localStorage.setItem('firstLogin',0)
src/views/screen/components/screen-wrapper/index.vue
@@ -2,7 +2,7 @@
  <div class="wrapper-container">
    <select-item></select-item>
    <div class="return-button">
      <el-button type="primary" @click="returnPath">返回</el-button>
      <el-button type="primary" @click="returnPath">管理系统</el-button>
    </div>
    <div class="wrapper-content">
      <div class="left-container wrapper">
@@ -43,7 +43,7 @@
  },
  methods: {
    returnPath() {
      this.$router.go(-1);
      this.$router.push('/index');
    }
  }
}
src/views/screen/components/select-item/index.vue
@@ -24,15 +24,15 @@
      dateValue: new Date(),
      testData1: [
        {
          name: '省厅',
          name: '省厅数据',
          value: 1
        },
        {
          name: '市厅',
          name: '市局数据',
          value: 2
        },
        {
          name: '公安部',
          name: '公安部数据',
          value: 3
        }
      ]