123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <div class="teacher_edu" v-if="isData">
- <!-- 头部导航及搜索 -->
- <Header />
- <div class="nav_title">
- <div class="inner">
- <el-menu
- :default-active="activeIndex"
- class="el-menu-demo"
- mode="horizontal"
- @select="handleSelect"
- text-color="#000"
- active-text-color="#FF9900"
- >
- <!-- <el-menu-item index="TEACHINGTOOL"> 教研工具</el-menu-item> -->
- <el-menu-item index="TEXTBOOK">
- <!-- 教辅资料 -->{{ $t("Key554") }}
- </el-menu-item>
- <el-menu-item index="TEACHING">
- <!-- 教研资料 -->{{ $t("Key214") }}
- </el-menu-item>
- <el-menu-item index="TOOLBOOK">
- <!-- 工具书 -->{{ $t("Key555") }}
- </el-menu-item>
- </el-menu>
- <div class="seek" @keyup="keyDownSeekData">
- <!-- 搜索课程 -->
- <el-input
- type="text"
- name=""
- id=""
- :placeholder="$t('Key131')"
- v-model="SeekName"
- @change="SeekName = SeekName.trim()"
- maxlength="50"
- />
- <img
- @click="gotoSeekResult"
- src="../../assets/teacherdev/Group2149.png"
- alt=""
- />
- </div>
- </div>
- </div>
- <!-- 主要信息列表 -->
- <div class="main" v-loading="loading">
- <div id="TEACHINGTOOL">
- <TeachingTool />
- </div>
- <div id="TEXTBOOK" v-if="textBookList">
- <Textbook v-if="textBookList.data" :classList="textBookList.data" />
- </div>
- <div id="TEACHING" v-if="teachingList">
- <Teaching v-if="teachingList.data" :classList="teachingList.data" />
- </div>
- <div id="TOOLBOOK" v-if="toolBookList">
- <ToolBook v-if="toolBookList.data" :classList="toolBookList.data" />
- </div>
- </div>
- </div>
- </template>
- <script>
- import Header from "@/components/Header";
- import Textbook from "@/components/teacher-dev/Textbook";
- import Teaching from "@/components/teacher-dev/Teaching";
- import ToolBook from "@/components/teacher-dev/ToolBook";
- import TeachingTool from "@/components/teacher-dev/TeachingTool";
- import { materiallist } from "@/api/api";
- import { updateWordPack } from "@/utils/i18n";
- export default {
- name: "teacher_edu",
- components: {
- Header,
- Teaching,
- Textbook,
- ToolBook,
- TeachingTool,
- },
- data() {
- return {
- activeIndex: "TEXTBOOK",
- navName: "CLASSICAL COURSE",
- SeekName: "",
- loading: false,
- dataList: null,
- textBookList: null, //book数据
- teachingList: null, // tea数据
- toolBookList: null, //工具书
- isData: false,
- };
- },
- computed: {},
- methods: {
- // 切换导航
- handleSelect(key, keyPath) {
- console.log(key, keyPath);
- this.navName = key;
- this.changeNav(key);
- },
- // 锚点定位
- changeNav(index) {
- let id = index;
- let dom = document.getElementById(id);
- if (dom) {
- document.getElementById(id).scrollIntoView();
- }
- },
- // 前往搜索结果
- gotoSeekResult() {
- if (this.SeekName != "") {
- this.SeekName = this.SeekName.trim();
- this.$router.push({
- path: "/Viewmore",
- query: { keyWord: this.SeekName },
- });
- } else {
- this.$message.warning("请输入内容");
- }
- },
- keyDownSeekData(e) {
- if (e.keyCode == 13) {
- this.gotoSeekResult();
- }
- },
- // 获取数据
- getData() {
- this.loading = true;
- materiallist({
- pageNum: 1,
- pageSize: 10,
- tagList: ["TEXTBOOK"],
- keyWord: this.keyWord,
- })
- .then((res) => {
- this.textBookList = res.data;
- })
- .catch((res) => {
- this.loading = false;
- });
- materiallist({
- pageNum: 1,
- pageSize: 10,
- tagList: ["TEACHING"],
- keyWord: this.keyWord,
- })
- .then((res) => {
- this.teachingList = res.data;
- this.loading = false;
- })
- .catch((res) => {
- this.loading = false;
- });
- materiallist({
- pageNum: 1,
- pageSize: 10,
- tagList: ["TOOLBOOK"],
- keyWord: this.keyWord,
- })
- .then((res) => {
- this.toolBookList = res.data;
- this.loading = false;
- })
- .catch((res) => {
- this.loading = false;
- });
- },
- },
- async created() {
- await updateWordPack({
- word_key_list: [
- "Key5",
- "Key8",
- "Key9",
- "Key39",
- "Key47",
- "Key131",
- "Key214",
- "Key214",
- "Key554",
- "Key555",
- ],
- });
- this.isData = true;
- // 需要根据身份信息来判断是进入首页还是录入
- // if (token) {
- // if (JSON.parse(token).popedom_code_list.indexOf(2000006) != -1) {
- // this.$router.push("/teacherdevEntering");
- // } else {
- // this.$router.push({ path: "/" });
- // }
- // }
- // this.loading = true;
- // // 验证登录拿到JSESSIONID放到cookies中后面的接口用来验证用户身份
- // VerifyLogin()
- // .then((res) => {
- // if (res.data?.JSESSSIONID) {
- // Cookies.set("JSESSIONID", res.data.JSESSSIONID);
- //
- // }
- // })
- // .catch((res) => {
- // this.loading = false;
- // });
- },
- mounted() {
- this.getData();
- },
- };
- </script>
- <style lang="scss" scoped>
- .teacher_edu {
- min-height: 100vh;
- // background: #f6f6f6;
- .seek {
- width: 300px;
- height: 40px;
- background: #ffffff;
- border: 1px solid #d9d9d9;
- box-sizing: border-box;
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 16px;
- input {
- width: 90%;
- border: none;
- outline: none;
- margin-left: 5px;
- }
- img {
- width: 18px;
- height: 18px;
- cursor: pointer;
- }
- }
- .nav_title {
- background: #fff;
- .inner {
- width: 1200px;
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-weight: 600;
- }
- .el-menu-item {
- font-size: 16px;
- }
- // 取消组件默认的样式
- .el-menu.el-menu--horizontal {
- border-bottom: none;
- }
- }
- .main {
- min-height: 80vh;
- background: #f6f6f6;
- padding-bottom: 50px;
- }
- }
- </style>
- <style lang="scss">
- .seek {
- .el-input__prefix {
- color: black;
- }
- .el-input__inner {
- border: none;
- height: 38px;
- padding: 0;
- }
- }
- </style>
|