Browse Source

左侧菜单栏:统计数据新增子栏(基础数据、个人数据)结构、文章管理新增子栏(新建第三方文章)结构,页面内容待完成

huangtao 3 years ago
parent
commit
ba1efe5476

+ 20 - 19
src/router/common/common.js

@@ -1,29 +1,30 @@
-import NotFound from "@/components/not-found";
-import layout from "@/components/layout";
+import NotFound from '@/components/not-found';
+import layout from '@/components/layout';
 
 export default [
   {
-    path: "/",
+    path: '/',
     component: layout,
-    redirect: "/home",
+    redirect: '/home',
     children: [
+      // {
+      //   path: "home",
+      //   name: "home",
+      //   meta: { title: "首页" },
+      //   component: () => import("@/views/Home")
+      // },
       {
-        path: "home",
-        name: "home",
-        meta: { title: "首页" },
-        component: () => import("@/views/Home")
+        path: 'engineeringWorkManagement',
+        name: 'engineeringWorkManagement',
+        meta: { title: '工种管理' },
+        component: () =>
+          import('@/views/engineeringWorkManagement/engineeringWorkList'),
       },
-      {
-        path: "engineeringWorkManagement",
-        name: "engineeringWorkManagement",
-        meta: { title: "工种管理" },
-        component: () => import("@/views/engineeringWorkManagement/engineeringWorkList")
-      },
-    ]
+    ],
   },
   {
-    path: "*",
-    name: "error",
-    component: NotFound
-  }
+    path: '*',
+    name: 'error',
+    component: NotFound,
+  },
 ];

+ 16 - 2
src/router/menu.js

@@ -2,6 +2,16 @@ export default [
   {
     path: '/home',
     meta: { title: '统计数据', icon: 'ali-icon-tongji' },
+    children: [
+      {
+        path: '/home/basicData',
+        meta: { title: '基本数据' },
+      },
+      {
+        path: '/home/personData',
+        meta: { title: '个人数据' },
+      },
+    ],
   },
   {
     path: '/user',
@@ -10,7 +20,7 @@ export default [
       {
         path: '/user/list',
         meta: { title: '账号管理' },
-      }
+      },
     ],
   },
   {
@@ -36,7 +46,11 @@ export default [
       {
         path: '/articleManagement/carouselUploda',
         meta: { title: '轮播图管理' },
-      }
+      },
+      {
+        path: '/articleManagement/articleCreateThird',
+        meta: { title: '新建第三方文章' },
+      },
     ],
   },
   {

+ 9 - 6
src/router/modules/articleManagement.js

@@ -9,22 +9,19 @@ export default {
       path: 'list',
       name: 'articleManagement-list',
       meta: { title: '文章列表' },
-      component: () =>
-        import('@/views/articleManagement/articleList'),
+      component: () => import('@/views/articleManagement/articleList'),
     },
     {
       path: 'create',
       name: 'articleManagement-create',
       meta: { title: '新建文章' },
-      component: () =>
-        import('@/views/articleManagement/articleCreate'),
+      component: () => import('@/views/articleManagement/articleCreate'),
     },
     {
       path: 'videoCreate',
       name: 'articleManagement-videoCreate',
       meta: { title: '新建视频' },
-      component: () =>
-        import('@/views/articleManagement/videoCreate'),
+      component: () => import('@/views/articleManagement/videoCreate'),
     },
     {
       path: 'carouselUploda',
@@ -33,5 +30,11 @@ export default {
       component: () =>
         import('@/views/articleManagement/articleCarouselUpload'),
     },
+    {
+      path: 'articleCreateThird',
+      name: 'articleManagement-articleCreateThird',
+      meta: { title: '新建第三方文章' },
+      component: () => import('@/views/articleManagement/articleCreateThird'),
+    },
   ],
 };

+ 21 - 0
src/router/modules/count.js

@@ -0,0 +1,21 @@
+import layout from '@/components/layout';
+export default {
+  path: '/home',
+  meta: { title: '首页' },
+  redirect: '/home/basicData',
+  component: layout,
+  children: [
+    {
+      path: 'basicData',
+      name: 'basicData',
+      meta: { title: '基础数据' },
+      component: () => import('@/views/Home'),
+    },
+    {
+      path: 'personData',
+      name: 'personData',
+      meta: { title: '个人数据' },
+      component: () => import('@/views/count/personData'),
+    },
+  ],
+};

+ 28 - 0
src/views/articleManagement/articleCreateThird.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="">这里是新建第三方文章</div>
+</template>
+
+<script>
+export default {
+  props: {},
+  components: {},
+  data() {
+    return {};
+  },
+  created() {
+    this.initDataFun(); // 初始化数据
+  },
+  mounted() {},
+  beforeDestroy() {},
+  computed: {},
+  watch: {},
+  methods: {
+    // 初始化数据
+    initDataFun() {},
+  },
+};
+</script>
+
+<style lang="less"></style>
+
+<style lang="less" scoped></style>

+ 28 - 0
src/views/count/personData.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="">这里是个人数据</div>
+</template>
+
+<script>
+export default {
+  props: {},
+  components: {},
+  data() {
+    return {};
+  },
+  created() {
+    this.initDataFun(); // 初始化数据
+  },
+  mounted() {},
+  beforeDestroy() {},
+  computed: {},
+  watch: {},
+  methods: {
+    // 初始化数据
+    initDataFun() {},
+  },
+};
+</script>
+
+<style lang="less"></style>
+
+<style lang="less" scoped></style>

+ 30 - 31
src/views/login/login.vue

@@ -65,18 +65,18 @@
 </template>
 
 <script>
-import { PROGRAM_Title, AUTH_TOKEN_FRONT } from "@/common/Constant";
-import { getCookie } from "@/utils/cookie";
+import { PROGRAM_Title, AUTH_TOKEN_FRONT } from '@/common/Constant';
+import { getCookie } from '@/utils/cookie';
 export default {
-  name: "login",
+  name: 'login',
   props: {},
   components: {},
   data() {
     return {
       loading: false, // 是否显示加载动画
-      logoImg: require("@/assets/image/logo.png"), // logo图
+      logoImg: require('@/assets/image/logo.png'), // logo图
       loginTitle: PROGRAM_Title, // 系统标题
-      loginForm: this.$form.createForm(this, { name: "login" })
+      loginForm: this.$form.createForm(this, { name: 'login' }),
     };
   },
   created() {
@@ -98,46 +98,45 @@ export default {
           let params = {
             userName: values.loginUserName,
             password: values.loginPassword,
-            token: AUTH_TOKEN_FRONT
+            token: AUTH_TOKEN_FRONT,
           };
           this.$_http
             .get(this.$_API.INTERFACE_GET_USER_LOGIN, {
               auth: {
                 username: params.userName,
-                password: params.password
-              }
+                password: params.password,
+              },
             })
-            .then(res => {
+            .then((res) => {
               this.loading = false;
               if (res.data) {
                 this.setUserInfo(res.data);
-                console.log("--token---" + getCookie(AUTH_TOKEN_FRONT));
+                console.log('--token---' + getCookie(AUTH_TOKEN_FRONT));
                 this.getEngineeringWorkList(res.data); // 获取工种,并存到vuex
               } else {
                 this.loginForm.setFields({
                   loginUserName: {
                     value: values.loginUserName,
-                    errors: [new Error("账号密码不正确")]
+                    errors: [new Error('账号密码不正确')],
                   },
                   loginPassword: {
                     value: values.loginPassword,
-                    errors: [new Error("账号密码不正确")]
-                  }
+                    errors: [new Error('账号密码不正确')],
+                  },
                 });
               }
-              
             })
             .catch(() => {
               this.loading = false;
               this.loginForm.setFields({
                 loginUserName: {
                   value: values.loginUserName,
-                  errors: [new Error("账号密码不正确")]
+                  errors: [new Error('账号密码不正确')],
                 },
                 loginPassword: {
                   value: values.loginPassword,
-                  errors: [new Error("账号密码不正确")]
-                }
+                  errors: [new Error('账号密码不正确')],
+                },
               });
             });
         }
@@ -148,30 +147,30 @@ export default {
       this.loading = true;
       this.$_http
         .get(this.$_API.INTERFACE_GET_ENGINEERINGWORK_LIST)
-        .then(res => {
-          this.$store.commit("common/SET_ENGINEERING_WORK_LIST", res.data);
+        .then((res) => {
+          this.$store.commit('common/SET_ENGINEERING_WORK_LIST', res.data);
           sessionStorage.setItem(
-            "ENGINEERING_WORK_LIST",
+            'ENGINEERING_WORK_LIST',
             JSON.stringify(res.data)
           );
           this.getExamQuestionTypeConditionParentList(); // 获取试题类型-父类信息,并存到vuex
         })
         .catch(() => {
           this.loading = false;
-           // 设置用户信息,跳转到首页
+          // 设置用户信息,跳转到首页
         });
     },
     // 获取试题类型-父类信息,并存到vuex
     getExamQuestionTypeConditionParentList() {
       this.$_http
         .get(this.$_API.INTERFACE_GET_EXAMS_QUESTION_TYPE_CONDITION_PARENT)
-        .then(res => {
+        .then((res) => {
           this.$store.commit(
-            "common/SET_EXAM_QUESTION_TYPE_CONDITION_PARENT",
+            'common/SET_EXAM_QUESTION_TYPE_CONDITION_PARENT',
             res.data
           );
           sessionStorage.setItem(
-            "EXAM_QUESTION_TYPE_CONDITION_PARENT",
+            'EXAM_QUESTION_TYPE_CONDITION_PARENT',
             JSON.stringify(res.data)
           );
         })
@@ -181,12 +180,12 @@ export default {
     },
     // 设置用户信息,跳转到首页
     setUserInfo(userInfo) {
-      this.$store.commit("user/SET_LOGIN", userInfo); // // 存用户信息
-      this.$store.commit("user/SET_MENU", []); // 赋值菜单
+      this.$store.commit('user/SET_LOGIN', userInfo); // // 存用户信息
+      this.$store.commit('user/SET_MENU', []); // 赋值菜单
       this.loading = false;
-      this.$router.push({ name: "home" });
-    }
-  }
+      this.$router.push({ path: '/home' });
+    },
+  },
 };
 </script>
 
@@ -200,12 +199,12 @@ export default {
 </style>
 
 <style lang="less" scoped>
-@import "~@/styles/common/variable.less";
+@import '~@/styles/common/variable.less';
 .login-box {
   .login-body {
     width: 100vw;
     height: 100vh;
-    background-image: url("../../assets/image/login/background.png");
+    background-image: url('../../assets/image/login/background.png');
     background-repeat: no-repeat;
     background-size: cover;
     display: flex;