zhanghua
2024-09-14 be30a62a2dddf9ba36e69ade654513cbd7aa0c52
机构切换
18个文件已修改
1052 ■■■■ 已修改文件
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/graphql.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/class/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/comment/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/curriculum/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/development/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/integral/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/rollCall/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scheduleCourses/index.vue 278 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/student/components/create.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/student/components/details.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/student/index.vue 473 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/work/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'https://www.9village.cn/dream_test'
VUE_APP_BASE_API = '/dream_test'
README.md
@@ -1,4 +1,4 @@
## dream_web
## dream_test_web
叮当微教务后台
src/layout/components/Navbar.vue
@@ -1,24 +1,44 @@
<template>
  <div class="navbar">
    <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
    <div class="navbar">
        <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">
          {{ '你好,' + getUserName() }}
          <i class="el-icon-caret-bottom"></i>
        <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 trigger="click" ref="eldrop" style="margin-right:20px">
                <div class="avatar-wrapper" style="font-size:20px">
                    {{ selectStaff.org.name }}
                    <i class="el-icon-caret-bottom"></i>
                </div>
                <el-dropdown-menu slot="dropdown" align="center">
                    <el-dropdown-item
                        v-for="item in staffs"
                        @click.native="changeStaff(item)"
                        :key="item.id"
                    >
                        {{ item.org.name }}
                    </el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
            <el-dropdown class="avatar-container" trigger="click">
                <div class="avatar-wrapper">
                    {{ '您好,' + getUserName() }}
                    <i class="el-icon-caret-bottom"></i>
                </div>
                <el-dropdown-menu slot="dropdown" class="user-dropdown">
                    <el-dropdown-item @click.native="logout">
                        <span style="display: block">退出登录</span>
                    </el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
        <el-dropdown-menu slot="dropdown" class="user-dropdown">
          <el-dropdown-item @click.native="logout">
            <span style="display:block;">退出登录</span>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>
<script>
@@ -27,113 +47,124 @@
import Hamburger from '@/components/Hamburger'
export default {
  components: {
    Breadcrumb,
    Hamburger
  },
  computed: {
    ...mapGetters([
      'sidebar',
      'avatar'
    ])
  },
  methods: {
    orgCss() {
      return JSON.parse(localStorage.getItem("user")).name.length * 20 + 100 + 'px';
    data() {
        return {
            selectStaff: JSON.parse(localStorage.getItem("selectStaff")),
            staffs: JSON.parse(localStorage.getItem("staffs"))
        }
    },
    getOrgName() {
      return JSON.parse(localStorage.getItem("user")).staffs[0].org.name;
    components: {
        Breadcrumb,
        Hamburger
    },
    getUserName() {
      return JSON.parse(localStorage.getItem("user")).name;
    computed: {
        ...mapGetters([
            'sidebar',
            'avatar'
        ])
    },
    toggleSideBar() {
      this.$store.dispatch('app/toggleSideBar')
    },
    async logout() {
      // await this.$store.dispatch('user/logout')
      this.$router.push(`/login`)
    methods: {
        changeStaff(item) {
            this.selectStaff = item
            localStorage.setItem("selectStaff", JSON.stringify(item))
            this.$router.go(0)
        },
        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`)
        }
    }
  }
}
</script>
<style lang="scss" scoped>
.navbar {
  height: 50px;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,21,41,.08);
    height: 50px;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  .hamburger-container {
    line-height: 46px;
    height: 100%;
    float: left;
    cursor: pointer;
    transition: background .3s;
    -webkit-tap-highlight-color:transparent;
    &:hover {
      background: rgba(0, 0, 0, .025)
    }
  }
  .breadcrumb-container {
    float: left;
  }
  .right-menu {
    float: right;
    height: 100%;
    line-height: 50px;
    &:focus {
      outline: none;
    }
    .right-menu-item {
      display: inline-block;
      padding: 0 8px;
      height: 100%;
      font-size: 18px;
      color: #5a5e66;
      vertical-align: text-bottom;
      &.hover-effect {
    .hamburger-container {
        line-height: 46px;
        height: 100%;
        float: left;
        cursor: pointer;
        transition: background .3s;
        transition: background 0.3s;
        -webkit-tap-highlight-color: transparent;
        &:hover {
          background: rgba(0, 0, 0, .025)
            background: rgba(0, 0, 0, 0.025);
        }
      }
    }
    .avatar-container {
      margin-right: 50px;
      .avatar-wrapper {
        margin-top: 5px;
        position: relative;
        cursor: pointer;
        .user-avatar {
          cursor: pointer;
          width: 40px;
          height: 40px;
          border-radius: 10px;
        }
        .el-icon-caret-bottom {
          cursor: pointer;
          position: absolute;
          right: -20px;
          top: 25px;
          font-size: 12px;
        }
      }
    .breadcrumb-container {
        float: left;
    }
  }
    .right-menu {
        float: right;
        height: 100%;
        line-height: 50px;
        &:focus {
            outline: none;
        }
        .right-menu-item {
            display: inline-block;
            padding: 0 8px;
            height: 100%;
            font-size: 18px;
            color: #5a5e66;
            vertical-align: text-bottom;
            &.hover-effect {
                cursor: pointer;
                transition: background 0.3s;
                &:hover {
                    background: rgba(0, 0, 0, 0.025);
                }
            }
        }
        .avatar-container {
            margin-right: 50px;
            .avatar-wrapper {
                margin-top: 5px;
                position: relative;
                cursor: pointer;
                .user-avatar {
                    cursor: pointer;
                    width: 40px;
                    height: 40px;
                    border-radius: 10px;
                }
                .el-icon-caret-bottom {
                    cursor: pointer;
                    position: absolute;
                    right: -20px;
                    top: 25px;
                    font-size: 12px;
                }
            }
        }
    }
}
</style>
src/layout/components/Sidebar/index.vue
@@ -12,7 +12,7 @@
        :collapse-transition="false"
        mode="vertical"
      >
        <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
        <sidebar-item v-for="(route,index) in routes" :key="index" :item="route" :base-path="route.path" />
      </el-menu>
    </el-scrollbar>
  </div>
src/utils/graphql.js
@@ -6,8 +6,8 @@
// export default apolloClient;
// 定义不同请求地址
const EFORMURI = "https://www.9village.cn/dream_test/graphql";
const IOTURI = "https://www.9village.cn/dream_test" + "/graphql";
const EFORMURI = "/dream_test/graphql";
const IOTURI = "/dream_test/graphql";
// import ApolloClient from 'apollo-boost' //引入apollo-boost插件
import { ApolloClient } from "apollo-client";
import { createHttpLink } from "apollo-link-http";
@@ -23,7 +23,7 @@
    headers: {
      Authorization: JSON.parse(localStorage.getItem("user")).jwtToken,
      // Authorization:'eyJhbGciOiJIUzI1NiJ9.eyJleHBUaW1lIjoiMjAyNC8wNy8zMSAxODoxMSIsInVzZXJJZCI6NDQsImp0aSI6ImVlMDM3NmFjLWQ5OTAtNDRkZS05YTVmLTUxYjhjMjc0YWNiOSIsImlhdCI6MTcyMjQxMzUwMSwic3ViIjoieWNsIiwiZXhwIjoxNzIyNDIwNzAxfQ.bSd0qag44dwXeJQpvryYJXEtrQ03-8MmHQWhgILGXO4',
      staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
      staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
      playerId:
        JSON.parse(localStorage.getItem("user")).players.length > 0
          ? JSON.parse(localStorage.getItem("user")).players[0].id
src/views/class/index.vue
@@ -104,7 +104,7 @@
      activeName: "all",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -158,7 +158,7 @@
        this.listLoading = true;
        let data = {
          itemType: "TEAM",
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
src/views/comment/index.vue
@@ -129,7 +129,7 @@
      activeName: "comment",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -172,7 +172,7 @@
        this.listLoading = true;
        let data = {
          commentTypes: ["DIRECT_COMMENT"],
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
src/views/curriculum/index.vue
@@ -188,7 +188,7 @@
  methods: {
    getCourses() {
      let data = {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        day: this.getYMD(this.time),
      };
      getBySessionExistsOfDay(data).then((res) => {
@@ -197,7 +197,7 @@
          courseIds.push(i.id);
        });
        let params = {
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          beginDate: this.getYMD(this.time),
          endDate: this.getYMD(this.time),
          courseIds: courseIds,
src/views/development/index.vue
@@ -133,7 +133,7 @@
      activeName: "all",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -182,7 +182,7 @@
      } else if (this.activeName == "other") {
        this.listLoading = true;
        let data = {
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
src/views/integral/index.vue
@@ -132,7 +132,7 @@
      activeName: "student",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -175,7 +175,7 @@
        this.listLoading = true;
        let data = {
          types: ["NORMAL"],
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
src/views/login/index.vue
@@ -88,7 +88,9 @@
            login({
                code: code,
            }).then((res) => {
                localStorage.setItem("user", JSON.stringify(res));
                localStorage.setItem("user", JSON.stringify(res));
                localStorage.setItem("staffs", JSON.stringify(res.staffs));
                localStorage.setItem("selectStaff", JSON.stringify(res.staffs[0]));
                this.$router.push("/student");
            });
        },
src/views/rollCall/index.vue
@@ -198,7 +198,7 @@
      activeName: "student",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -242,7 +242,7 @@
        this.listLoading = true;
        let data = {
          types: ["NORMAL"],
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
@@ -259,7 +259,7 @@
        this.listLoading = true;
        let data = {
          completeTypes: ["ROLL_CALL"],
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
src/views/scheduleCourses/index.vue
@@ -1,151 +1,155 @@
<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="fetchData">
      <el-tab-pane label="全部" name="all" />
      <el-tab-pane label="已停用" name="deactivated" />
    </el-tabs>
    <div style="display: flex; flex-direction: row-reverse">
      <div style="width: 300px">
        <el-input
          placeholder="按课程名称搜索"
          v-model="data.keyword"
          class="input-with-select"
          size="small"
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="fetchData"
          ></el-button>
        </el-input>
      </div>
    <div class="app-container">
        <el-tabs v-model="activeName" @tab-click="fetchData">
            <el-tab-pane label="全部" name="all" />
            <el-tab-pane label="已停用" name="deactivated" />
        </el-tabs>
        <div style="display: flex; flex-direction: row-reverse">
            <div style="width: 300px">
                <el-input
                    placeholder="按课程名称搜索"
                    v-model="data.keyword"
                    class="input-with-select"
                    size="small"
                >
                    <el-button
                        slot="append"
                        icon="el-icon-search"
                        @click="fetchData"
                    ></el-button>
                </el-input>
            </div>
        </div>
        <div style="height: calc(100vh - 248px)">
            <el-table
                v-loading="listLoading"
                :data="list"
                element-loading-text="Loading"
                fit
                height="100%"
            >
                <el-table-column label="课程名称">
                    <template slot-scope="scope">
                        <el-link type="primary" :underline="false">{{
                            scope.row.name
                        }}</el-link>
                    </template>
                </el-table-column>
                <el-table-column
                    label="停用时间"
                    width="200"
                    v-if="activeName == 'deactivated'"
                >
                    <template slot-scope="scope">
                        {{ scope.row.modifyTime }}
                    </template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    width="200"
                    v-if="activeName == 'deactivated'"
                >
                    <template slot-scope="">
                        <el-link type="primary" :underline="false"
                            >恢复</el-link
                        >
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div>
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="data.pageIn.index + 1"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="data.pageIn.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
            >
            </el-pagination>
        </div>
    </div>
    <div style="height: calc(100vh - 248px)">
      <el-table
        v-loading="listLoading"
        :data="list"
        element-loading-text="Loading"
        fit
        height="100%"
      >
        <el-table-column label="课程名称">
          <template slot-scope="scope">
            <el-link type="primary" :underline="false">{{
              scope.row.name
            }}</el-link>
          </template>
        </el-table-column>
        <el-table-column
          label="停用时间"
          width="200"
          v-if="activeName == 'deactivated'"
        >
          <template slot-scope="scope">
            {{ scope.row.modifyTime }}
          </template>
        </el-table-column>
        <el-table-column
          label="操作"
          width="200"
          v-if="activeName == 'deactivated'"
        >
          <template slot-scope="">
            <el-link type="primary" :underline="false">恢复</el-link>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="data.pageIn.index + 1"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="data.pageIn.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { getCourse, getDeletedItem } from "@/api/scheduleCourses";
export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: "success",
        draft: "gray",
        deleted: "danger",
      };
      return statusMap[status];
    },
  },
  data() {
    return {
      list: null,
      listLoading: true,
      activeName: "all",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
          index: 0, //必选
          size: 10, //每页的大小。默认20
          sorts: {
            name: "name", //排序字段名称
            direction: "ASC", //排序方向
          },
    filters: {
        statusFilter(status) {
            const statusMap = {
                published: "success",
                draft: "gray",
                deleted: "danger",
            };
            return statusMap[status];
        },
        types: ["BOOKING_NONE", "BOOKING_TIME_STAFF", "BOOKING_TIME_PLACE"],
      },
    };
  },
  created() {
    this.fetchData();
  },
  methods: {
    handleSizeChange(val) {
      this.data.pageIn.size = val;
      this.fetchData("pageIn");
    },
    handleCurrentChange(val) {
      this.data.pageIn.index = val - 1;
      this.fetchData("pageIn");
    },
    fetchData(_val) {
      if (_val !== "pageIn") {
        this.data.pageIn.index = 0;
        this.data.pageIn.size = 10;
      }
      this.listLoading = true;
      if (this.activeName == "all") {
        this.listLoading = true;
        getCourse(this.data).then((response) => {
          this.list = response.data.findCourse.ls;
          this.total = response.data.findCourse.pageOut.total;
          this.listLoading = false;
        });
      } else if (this.activeName == "deactivated") {
        this.listLoading = true;
        let data = {
          itemType: "COURSE",
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
    data() {
        return {
            list: null,
            listLoading: true,
            activeName: "all",
            total: 0,
            data: {
                staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
                keyword: "",
                pageIn: {
                    //可选,如果是分页查询,需要加上。
                    index: 0, //必选
                    size: 10, //每页的大小。默认20
                    sorts: {
                        name: "name", //排序字段名称
                        direction: "ASC", //排序方向
                    },
                },
                types: ["BOOKING_NONE", "BOOKING_TIME_STAFF", "BOOKING_TIME_PLACE"],
            },
        };
        getDeletedItem(data).then((response) => {
          this.list = response.data.findDeletedItem.ls;
          this.total = response.data.findDeletedItem.pageOut.total;
          this.listLoading = false;
        });
      }
    },
  },
    created() {
        this.fetchData();
    },
    methods: {
        handleSizeChange(val) {
            this.data.pageIn.size = val;
            this.fetchData("pageIn");
        },
        handleCurrentChange(val) {
            this.data.pageIn.index = val - 1;
            this.fetchData("pageIn");
        },
        fetchData(_val) {
            this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id
            if (_val !== "pageIn") {
                this.data.pageIn.index = 0;
                this.data.pageIn.size = 10;
            }
            this.listLoading = true;
            if (this.activeName == "all") {
                this.listLoading = true;
                getCourse(this.data).then((response) => {
                    this.list = response.data.findCourse.ls;
                    this.total = response.data.findCourse.pageOut.total;
                    this.listLoading = false;
                });
            } else if (this.activeName == "deactivated") {
                this.listLoading = true;
                let data = {
                    itemType: "COURSE",
                    staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
                    keyword: this.data.keyword,
                    pageIn: { ...this.data.pageIn },
                };
                getDeletedItem(data).then((response) => {
                    this.list = response.data.findDeletedItem.ls;
                    this.total = response.data.findDeletedItem.pageOut.total;
                    this.listLoading = false;
                });
            }
        },
    },
};
</script>
src/views/student/components/create.vue
@@ -142,7 +142,7 @@
          id: "",
          name: "",
        },
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        visibility: true,
        voucherId: "", //课包/会员卡
      },
@@ -158,7 +158,7 @@
    },
    getSaleManList() {
      let data = {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          index: 0,
src/views/student/components/details.vue
@@ -156,7 +156,7 @@
    },
    getSaleManList() {
      let data = {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          index: 0,
src/views/student/index.vue
@@ -1,120 +1,126 @@
<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="全部" name="all" />
      <el-tab-pane label="待续费" name="pendingFees" />
      <el-tab-pane label="已过期" name="expired" />
      <el-tab-pane label="已停用" name="deactivated" />
    </el-tabs>
    <div style="display: flex; justify-content: space-between">
      <!-- <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="开始日期"
    <div class="app-container">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="全部" name="all" />
            <el-tab-pane label="待续费" name="pendingFees" />
            <el-tab-pane label="已过期" name="expired" />
            <el-tab-pane label="已停用" name="deactivated" />
        </el-tabs>
        <div style="display: flex; justify-content: space-between">
            <!-- <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="开始日期"
        end-placeholder="结束日期" value-format="yyyy-MM-dd" style="margin-right: 10px">
      </el-date-picker>
      <el-button type="primary" @click="handleExport2">导出课包</el-button> -->
    </div>
      <div style="width: 300px">
        <el-input
          placeholder="按姓名搜索"
          v-model="data.keyword"
          class="input-with-select"
          size="small"
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="handleClick"
          ></el-button>
        </el-input>
      </div>
    </div>
    <div style="height: calc(100vh - 248px)">
      <el-table
        v-loading="listLoading"
        :data="list"
        element-loading-text="Loading"
        fit
        height="100%"
      >
        <el-table-column label="姓名" prop="">
          <template slot-scope="scope">
            <el-link
            type="primary"
            :underline="false"
            @click="goDetails(scope.row)"
            >{{ scope.row.name }}</el-link
          >
            <!-- <el-link type="primary" :underline="false">{{
            </div>
            <div style="width: 300px">
                <el-input
                    placeholder="按姓名搜索"
                    v-model="data.keyword"
                    class="input-with-select"
                    size="small"
                >
                    <el-button
                        slot="append"
                        icon="el-icon-search"
                        @click="handleClick"
                    ></el-button>
                </el-input>
            </div>
        </div>
        <div style="height: calc(100vh - 248px)">
            <el-table
                v-loading="listLoading"
                :data="list"
                element-loading-text="Loading"
                fit
                height="100%"
            >
                <el-table-column label="姓名" prop="">
                    <template slot-scope="scope">
                        <el-link
                            type="primary"
                            :underline="false"
                            @click="goDetails(scope.row)"
                            >{{ scope.row.name }}</el-link
                        >
                        <!-- <el-link type="primary" :underline="false">{{
              scope.row.name
            }}</el-link> -->
          </template>
        </el-table-column>
        <el-table-column
          label="性别"
          width="80"
          v-if="activeName !== 'deactivated'"
        >
          <template slot-scope="scope">
            {{ scope.row.gender == "FEMALE" ? "女" : "男" }}
          </template>
        </el-table-column>
        <el-table-column
          label="手机号"
          width="200"
          prop="mobile"
          v-if="activeName !== 'deactivated'"
        >
          <template slot-scope="scope">
            {{ scope.row.mobile ? scope.row.mobile : "--" }}
          </template>
        </el-table-column>
        <el-table-column
          label="是否绑定微信"
          width="200"
          v-if="activeName !== 'deactivated'"
        >
          <template slot-scope="scope">
            {{ scope.row.user ? "是" : "否" }}
          </template>
        </el-table-column>
        <el-table-column
          label="操作"
          width="200"
          v-if="activeName == 'deactivated'"
        >
          <template slot-scope="">
            <el-link type="primary" :underline="false">删除</el-link>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <el-link type="primary" :underline="false">恢复</el-link>
          </template>
        </el-table-column>
        <el-table-column
          label="停用时间"
          width="200"
          v-if="activeName == 'deactivated'"
        >
          <template slot-scope="scope">
            {{ scope.row.modifyTime }}
          </template>
        </el-table-column>
      </el-table>
                    </template>
                </el-table-column>
                <el-table-column
                    label="性别"
                    width="80"
                    v-if="activeName !== 'deactivated'"
                >
                    <template slot-scope="scope">
                        {{ scope.row.gender == 'FEMALE' ? '女' : '男' }}
                    </template>
                </el-table-column>
                <el-table-column
                    label="手机号"
                    width="200"
                    prop="mobile"
                    v-if="activeName !== 'deactivated'"
                >
                    <template slot-scope="scope">
                        {{ scope.row.mobile ? scope.row.mobile : '--' }}
                    </template>
                </el-table-column>
                <el-table-column
                    label="是否绑定微信"
                    width="200"
                    v-if="activeName !== 'deactivated'"
                >
                    <template slot-scope="scope">
                        {{ scope.row.user ? '是' : '否' }}
                    </template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    width="200"
                    v-if="activeName == 'deactivated'"
                >
                    <template slot-scope="">
                        <el-link type="primary" :underline="false"
                            >删除</el-link
                        >
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <el-link type="primary" :underline="false"
                            >恢复</el-link
                        >
                    </template>
                </el-table-column>
                <el-table-column
                    label="停用时间"
                    width="200"
                    v-if="activeName == 'deactivated'"
                >
                    <template slot-scope="scope">
                        {{ scope.row.modifyTime }}
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div>
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="data.pageIn.index + 1"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="data.pageIn.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
            >
            </el-pagination>
        </div>
        <StudentCreate ref="studentCreate" />
    </div>
    <div>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="data.pageIn.index + 1"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="data.pageIn.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>
    <StudentCreate ref="studentCreate" />
  </div>
</template>
<script>
@@ -123,135 +129,136 @@
export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: "success",
        draft: "gray",
        deleted: "danger",
      };
      return statusMap[status];
    },
  },
  components: {
    StudentCreate,
  },
  data() {
    return {
      dateRange: [],
      list: null,
      listLoading: true,
      activeName: "all",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
          index: 0, //必选
          size: 10, //每页的大小。默认20
          sorts: {
            name: "name", //排序字段名称
            direction: "ASC", //排序方向
          },
    filters: {
        statusFilter(status) {
            const statusMap = {
                published: "success",
                draft: "gray",
                deleted: "danger",
            };
            return statusMap[status];
        },
      },
    };
  },
  created() {
    // 获取地址栏code
    // let code = this.$route.query.code;
    // if (code) {
    //   if (localStorage.getItem("code")) {
    //     if (code !== localStorage.getItem("code")) {
    //       this.getUserDate(code);
    //     }
    //   } else {
    //     this.getUserDate(code);
    //   }
    // } else {
    //   if (!localStorage.getItem("user")) {
    //     this.$router.push("/login");
    //   }
    // }
    if (localStorage.getItem("user")) {
      this.fetchData();
    } else {
      this.$router.push("/login");
    }
  },
  methods: {
    handleExport() {
      this.download('exportPlayer?orgId=' + JSON.parse(localStorage.getItem("user")).staffs[0].org.id, {
      }, `导出_${new Date().getTime()}.xlsx`)
    },
    handleExport2() {
      if (this.dateRange.length == 0) {
        this.$message.warning("请选择日期范围");
        return;
      }
      this.download('exportReport?startDate=' + this.dateRange[0] + '&endDate=' + this.dateRange[1], {
      }, `导出_${new Date().getTime()}.xlsx`)
    components: {
        StudentCreate,
    },
    fetchData() {
      this.listLoading = true;
      getData(this.data).then((response) => {
        this.list = response.data.findPlayerByStaff.ls;
        this.total = response.data.findPlayerByStaff.pageOut.total;
        this.listLoading = false;
      })
    },
    handleSizeChange(val) {
      this.data.pageIn.size = val;
      this.handleClick();
    },
    handleCurrentChange(val) {
      this.data.pageIn.index = val - 1;
      this.handleClick();
    },
    handleClick(tab, event) {
      if (this.activeName == "pendingFees") {
        this.listLoading = true;
        getRenew(this.data).then((response) => {
          this.list = response.data.findPlayerRenew.ls;
          this.total = response.data.findPlayerRenew.pageOut.total;
          this.listLoading = false;
        });
      } else if (this.activeName == "expired") {
        this.listLoading = true;
        getExpire(this.data).then((response) => {
          this.list = response.data.findPlayerExpire.ls;
          this.total = response.data.findPlayerExpire.pageOut.total;
          this.listLoading = false;
        });
      } else if (this.activeName == "all") {
        this.fetchData();
      } else if (this.activeName == "deactivated") {
        this.listLoading = true;
        let data = {
          itemType: "PLAYER",
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
    data() {
        return {
            dateRange: [],
            list: null,
            listLoading: true,
            activeName: "all",
            total: 0,
            data: {
                staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
                keyword: "",
                pageIn: {
                    //可选,如果是分页查询,需要加上。
                    index: 0, //必选
                    size: 10, //每页的大小。默认20
                    sorts: {
                        name: "name", //排序字段名称
                        direction: "ASC", //排序方向
                    },
                },
            },
        };
        getDeleted(data).then((response) => {
          this.list = response.data.findDeletedItem.ls;
          this.total = response.data.findDeletedItem.pageOut.total;
          this.listLoading = false;
        });
      }
    },
    goDetails(row) {
      this.$router.push({
        name: "StudentDetails",
        query: {
          id: row.id,
    created() {
        // 获取地址栏code
        // let code = this.$route.query.code;
        // if (code) {
        //   if (localStorage.getItem("code")) {
        //     if (code !== localStorage.getItem("code")) {
        //       this.getUserDate(code);
        //     }
        //   } else {
        //     this.getUserDate(code);
        //   }
        // } else {
        //   if (!localStorage.getItem("user")) {
        //     this.$router.push("/login");
        //   }
        // }
        if (localStorage.getItem("user")) {
            this.fetchData();
        } else {
            this.$router.push("/login");
        }
    },
    methods: {
        handleExport() {
            this.download('exportPlayer?orgId=' + JSON.parse(localStorage.getItem("user")).staffs[0].org.id, {
            }, `导出_${new Date().getTime()}.xlsx`)
        },
      });
        handleExport2() {
            if (this.dateRange.length == 0) {
                this.$message.warning("请选择日期范围");
                return;
            }
            this.download('exportReport?startDate=' + this.dateRange[0] + '&endDate=' + this.dateRange[1], {
            }, `导出_${new Date().getTime()}.xlsx`)
        },
        fetchData() {
            this.listLoading = true;
            getData(this.data).then((response) => {
                this.list = response.data.findPlayerByStaff.ls;
                this.total = response.data.findPlayerByStaff.pageOut.total;
                this.listLoading = false;
            })
        },
        handleSizeChange(val) {
            this.data.pageIn.size = val;
            this.handleClick();
        },
        handleCurrentChange(val) {
            this.data.pageIn.index = val - 1;
            this.handleClick();
        },
        handleClick(tab, event) {
            this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id
            if (this.activeName == "pendingFees") {
                this.listLoading = true;
                getRenew(this.data).then((response) => {
                    this.list = response.data.findPlayerRenew.ls;
                    this.total = response.data.findPlayerRenew.pageOut.total;
                    this.listLoading = false;
                });
            } else if (this.activeName == "expired") {
                this.listLoading = true;
                getExpire(this.data).then((response) => {
                    this.list = response.data.findPlayerExpire.ls;
                    this.total = response.data.findPlayerExpire.pageOut.total;
                    this.listLoading = false;
                });
            } else if (this.activeName == "all") {
                this.fetchData();
            } else if (this.activeName == "deactivated") {
                this.listLoading = true;
                let data = {
                    itemType: "PLAYER",
                    staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
                    keyword: this.data.keyword,
                    pageIn: { ...this.data.pageIn },
                };
                getDeleted(data).then((response) => {
                    this.list = response.data.findDeletedItem.ls;
                    this.total = response.data.findDeletedItem.pageOut.total;
                    this.listLoading = false;
                });
            }
        },
        goDetails(row) {
            this.$router.push({
                name: "StudentDetails",
                query: {
                    id: row.id,
                },
            });
        },
        showCreate() {
            this.$refs.studentCreate.showDialog();
        },
    },
    showCreate() {
      this.$refs.studentCreate.showDialog();
    },
  },
};
</script>
src/views/work/index.vue
@@ -149,7 +149,7 @@
      activeName: "work",
      total: 0,
      data: {
        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
        staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
        keyword: "",
        pageIn: {
          //可选,如果是分页查询,需要加上。
@@ -194,7 +194,7 @@
        this.listLoading = true;
        let data = {
          commentTypes: ["PLAYER_REPLY"],
          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
          staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
          keyword: this.data.keyword,
          pageIn: { ...this.data.pageIn },
        };
vue.config.js
@@ -39,7 +39,7 @@
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        // 匹配所有以 '/dev-api'开头的请求路径
        target: "http://192.168.3.87:18081/dream", //类似于Nginx反向代理
        target: "http://localhost:18081/dream_test", //类似于Nginx反向代理
        changeOrigin: true, // 支持跨域
        pathRewrite: {
          // 重写路径: 去掉路径中开头的'/dev-api'