龚焕茏
2024-09-12 f19b8d3466d2963c7f515bb22b3f9181519dbecf
调整
9个文件已修改
150 ■■■■ 已修改文件
src/layout/components/Navbar.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/Logo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/styles/variables.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/student/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue
@@ -3,27 +3,17 @@
    <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
    <breadcrumb class="breadcrumb-container" />
    <!-- 固定右上角 -->
    <h3 style="position: fixed; top: 0; font-size: 16px; color: #5a5e66; " :style="'right:' + orgCss() ">{{ getOrgName() }}</h3>
    <div class="right-menu">
      <el-dropdown class="avatar-container" trigger="click">
        <div class="avatar-wrapper">
          <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
          <i class="el-icon-caret-bottom" />
          {{ '你好,' + getUserName() }}
          <i class="el-icon-caret-bottom"></i>
        </div>
        <el-dropdown-menu slot="dropdown" class="user-dropdown">
          <router-link to="/">
            <el-dropdown-item>
              Home
            </el-dropdown-item>
          </router-link>
          <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
            <el-dropdown-item>Github</el-dropdown-item>
          </a>
          <a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
            <el-dropdown-item>Docs</el-dropdown-item>
          </a>
          <el-dropdown-item divided @click.native="logout">
            <span style="display:block;">Log Out</span>
          <el-dropdown-item @click.native="logout">
            <span style="display:block;">退出登录</span>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
@@ -48,12 +38,21 @@
    ])
  },
  methods: {
    orgCss() {
      return JSON.parse(localStorage.getItem("user")).name.length * 20 + 100 + 'px';
    },
    getOrgName() {
      return JSON.parse(localStorage.getItem("user")).staffs[0].org.name;
    },
    getUserName() {
      return JSON.parse(localStorage.getItem("user")).name;
    },
    toggleSideBar() {
      this.$store.dispatch('app/toggleSideBar')
    },
    async logout() {
      await this.$store.dispatch('user/logout')
      this.$router.push(`/login?redirect=${this.$route.fullPath}`)
      // await this.$store.dispatch('user/logout')
      this.$router.push(`/login`)
    }
  }
}
@@ -112,11 +111,12 @@
    }
    .avatar-container {
      margin-right: 30px;
      margin-right: 50px;
      .avatar-wrapper {
        margin-top: 5px;
        position: relative;
        cursor: pointer;
        .user-avatar {
          cursor: pointer;
src/layout/components/Sidebar/Logo.vue
@@ -24,8 +24,8 @@
  },
  data() {
    return {
      title: 'Vue Admin Template',
      logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
      title: '叮当微教务',
      logo: 'https://s1.locimg.com/2024/09/11/ba34571897536.png'
    }
  }
}
@@ -64,7 +64,7 @@
    & .sidebar-title {
      display: inline-block;
      margin: 0;
      color: #fff;
      color: #FFF;
      font-weight: 600;
      line-height: 50px;
      font-size: 14px;
src/layout/components/Sidebar/index.vue
@@ -1,5 +1,5 @@
<template>
  <div :class="{'has-logo':showLogo}">
  <div :class="{'has-logo':showLogo}" style="border-right: 1px solid #DDE0E2;">
    <logo v-if="showLogo" :collapse="isCollapse" />
    <el-scrollbar wrap-class="scrollbar-wrapper">
      <el-menu
@@ -43,7 +43,7 @@
      return path
    },
    showLogo() {
      return this.$store.state.settings.sidebarLogo
      return true;
    },
    variables() {
      return variables
src/layout/index.vue
@@ -14,6 +14,7 @@
<script>
import { Navbar, Sidebar, AppMain } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { login } from "@/api/user";
export default {
  name: 'Layout',
@@ -42,7 +43,24 @@
      }
    }
  },
  mounted() {
    // 获取地址栏code
    let code = this.$route.query.code;
    if (code) {
      this.getUserDate(code);
    }
    //  else {
    //     this.$router.push("/login");
    // }
  },
  methods: {
    getUserDate(code) {
      login({
        code: code,
      }).then((res) => {
        localStorage.setItem("user", JSON.stringify(res));
      });
    },
    handleClickOutside() {
      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
    }
src/router/index.js
@@ -43,32 +43,32 @@
    hidden: true,
  },
  {
    path: "/",
    component: Layout,
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "home",
        component: () => import("@/views/home/index"),
        meta: { title: "首页", icon: "dashboard" },
      },
    ],
  },
  {
    path: "/",
    component: Layout,
    redirect: "/curriculum",
    children: [
      {
        path: "/curriculum",
        name: "Curriculum",
        component: () => import("@/views/curriculum/index"),
        meta: { title: "课表", icon: "table" },
      },
    ],
  },
  // {
  //   path: "/",
  //   component: Layout,
  //   redirect: "/home",
  //   children: [
  //     {
  //       path: "home",
  //       name: "home",
  //       component: () => import("@/views/home/index"),
  //       meta: { title: "首页", icon: "dashboard" },
  //     },
  //   ],
  // },
  // {
  //   path: "/",
  //   component: Layout,
  //   redirect: "/curriculum",
  //   children: [
  //     {
  //       path: "/curriculum",
  //       name: "Curriculum",
  //       component: () => import("@/views/curriculum/index"),
  //       meta: { title: "课表", icon: "table" },
  //     },
  //   ],
  // },
  {
    path: "/",
    component: Layout,
@@ -78,7 +78,7 @@
        path: "/student",
        name: "Student",
        component: () => import("@/views/student/index"),
        meta: { title: "学员", icon: "table" },
        meta: { title: "学员列表", icon: "table" },
      },
    ],
  },
@@ -91,7 +91,7 @@
        path: "/class",
        name: "Class",
        component: () => import("@/views/class/index"),
        meta: { title: "班级", icon: "table" },
        meta: { title: "班级列表", icon: "table" },
      },
    ],
  },
src/styles/variables.scss
@@ -1,9 +1,9 @@
// sidebar
$menuText:#323232;
$menuText:rgb(191, 203, 217);
$menuActiveText:#409EFF;
$subMenuActiveText:#409EFF; //https://github.com/ElemeFE/element/issues/12951
$menuBg:rgb(119, 183, 228);
$menuBg:#304156;
$menuHover:#c3e8ff;
$subMenuBg:#c3ebff;
src/views/home/index.vue
@@ -44,22 +44,8 @@
    }
  },
  mounted() {
    // 获取地址栏code
    let code = this.$route.query.code;
    if (code) {
      this.getUserDate(code);
    } else {
      this.$router.push("/login");
    }
  },
  methods: {
    getUserDate(code) {
      login({
        code: code,
      }).then((res) => {
        localStorage.setItem("user", JSON.stringify(res));
      });
    },
  },
};
</script>
src/views/login/index.vue
@@ -100,7 +100,7 @@
    };
    return {
      appid: "wx7103925df6236723",
      redirect_uri: encodeURIComponent("https://dingdang.9village.cn"),
      redirect_uri: encodeURIComponent("https://dingdang.9village.cn/#/student"),
      state: "1",
      href: "data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7CiAgICAgICAgICBib3JkZXI6IG5vbmU7CiAgICAgICAgICB3aWR0aDogMTQwcHg7CiAgICAgICAgICBoZWlnaHQ6IDE0MHB4OwogICAgICAgIH0=", // 自定义样式链接
      loginForm: {
@@ -191,6 +191,8 @@
/* reset element-ui css */
.login-container {
  // background-image: url('https://s1.locimg.com/2024/09/12/891ab39f72938.png');
  // background-size: contain;
  display: flex;
  align-items: center;
  justify-content: center;
src/views/student/index.vue
@@ -10,10 +10,10 @@
      <!-- <el-button type="primary" size="small" @click="showCreate">新建学员</el-button> -->
      <el-button type="primary" size="small" @click="handleExport">导出学员</el-button>
      <div style="width: 500px">
      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
      <!-- <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
        end-placeholder="结束日期" value-format="yyyy-MM-dd" style="margin-right: 10px">
      </el-date-picker>
      <el-button type="primary" @click="handleExport2">导出课包</el-button>
      <el-button type="primary" @click="handleExport2">导出课包</el-button> -->
    </div>
      <div style="width: 300px">
        <el-input
@@ -179,7 +179,7 @@
        this.list = response.data.findPlayerByStaff.ls;
        this.total = response.data.findPlayerByStaff.pageOut.total;
        this.listLoading = false;
      });
      })
    },
    handleSizeChange(val) {
      this.data.pageIn.size = val;