isv-robot 2 лет назад
Родитель
Сommit
91d921ceb9
3 измененных файлов с 137 добавлено и 2 удалено
  1. 1 1
      src/permission.js
  2. 19 1
      src/router/index.js
  3. 117 0
      src/views/dashboard-screen/index.vue

+ 1 - 1
src/permission.js

@@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
+const whiteList = ['/login', '/auth-redirect', '/dashboard-screen'] // no redirect whitelist
 
 router.beforeEach(async(to, from, next) => {
   // start progress bar

+ 19 - 1
src/router/index.js

@@ -59,7 +59,6 @@ export const constantRoutes = [
     }]
   },
 
-
   // {
   //   path: 'external-link',
   //   component: Layout,
@@ -80,6 +79,25 @@ export const constantRoutes = [
 
 ]
 export const asyncRoutes = [
+  {
+    path: '/dashboard-screen',
+    component: Layout,
+    // redirect: '/catenary/fault',
+    name: 'dashboard-screen',
+    meta: {
+      title: '大屏',
+      icon: 'icon-jiechuwang',
+      pages: ['pc:catenary']
+    },
+    children: [
+      {
+        path: '',
+        component: () => import('@/views/dashboard-screen/index'), // Parent router-view
+        name: 'fault',
+        meta: { title: '大屏', pages: ['pc:catenary:jlgz'] }
+      }
+    ]
+  },
   {
     path: '/catenary',
     component: Layout,

+ 117 - 0
src/views/dashboard-screen/index.vue

@@ -0,0 +1,117 @@
+<template>
+  <div class="login-container">
+123
+  </div>
+</template>
+
+<script>
+import { captchaImage } from '@/api/user'
+
+export default {
+  name: 'Login',
+  data() {
+  },
+  watch: {
+    $route: {
+      handler: function(route) {
+        this.redirect = route.query && route.query.redirect
+      },
+      immediate: true
+    }
+  },
+  created() {
+    this.captchaImage()
+  },
+  methods: {
+    captchaImage() {
+      captchaImage({ type: 'math' }).then(res => {
+        const url = 'data:image/jpg;base64,' + res.img
+        this.imgSrc = url
+        this.loginForm.uuid = res.uuid
+      })
+    },
+    showPwd() {
+      if (this.passwordType === 'password') {
+        this.passwordType = ''
+      } else {
+        this.passwordType = 'password'
+      }
+      this.$nextTick(() => {
+        this.$refs.password.focus()
+      })
+    },
+    handleLogin() {
+      this.$refs.loginForm.validate(valid => {
+        if (valid) {
+          this.loading = true
+          this.$store.dispatch('user/login', this.loginForm).then(() => {
+            this.$router.push({ path: this.redirect || '/' })
+            this.loading = false
+          }).catch(() => {
+            this.loading = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+  .login-container {
+    background-image: url('../../assets/login/bg.png');
+    background-size: 100% 100%;
+    .el-form {
+      width: 70%;
+      margin: 0 auto;
+      .el-input__inner{
+        height: 40px;
+      }
+    }
+
+  }
+</style>
+
+<style lang="css" scoped>
+  .title-container{
+    color: #547BD4;
+    font-family: Noto Sans Malayalam UI;
+    font-size: 28px;
+    line-height: 26px;
+    letter-spacing: 0px;
+  }
+  /deep/ .el-input__inner {
+    border: 0;
+    border-bottom: 1px solid #DCDFE6;
+    border-radius: 0;
+    padding: 0;
+  }
+  /deep/ .el-form-item__label{
+    padding:0;
+  }
+  .login-container {
+    min-height: 100%;
+    width: 100%;
+    overflow: hidden;
+  }
+
+  /deep/ .el-form-item{
+    margin-bottom: 4px;
+  }
+
+  .window-login {
+    overflow: hidden;
+    border-radius: 15px;
+    margin: 0 auto;
+    margin-top: 3%;
+    width: 800px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
+  }
+  .picColor{
+    background: linear-gradient(166.06deg, #2782DF 0%, #003DAE 100%);
+    box-shadow: 0px 4px 8px 0px #46BBFD5B;
+  }
+</style>