|
|
@@ -1,43 +1,47 @@
|
|
|
<template>
|
|
|
<h2 class="contentTitle" v-if="classDown">
|
|
|
<div class="Levelone">
|
|
|
- 课程列表
|
|
|
+ {{ lang.lang == 'hk' ? lang.ssAiTeachRes : lang.ssCourseList }}
|
|
|
</div>
|
|
|
</h2>
|
|
|
- <div class="grandTitle2">人工智能通识课</div>
|
|
|
- <div class="course_select">
|
|
|
- <span class="grandTitle">课程类型:</span>
|
|
|
- <el-button :class="courseTypeShow ? 'el_button_active' : ''" @click="SwitchCourseType(true)">AI通识课2025版</el-button>
|
|
|
+ <div class="grandTitle2" v-if="lang.lang != 'hk'">{{ lang.ssAiGeneral }}</div>
|
|
|
+ <div class="course_select" v-if="lang.lang != 'hk'">
|
|
|
+ <span class="grandTitle">{{ lang.ssCourseType }}</span>
|
|
|
+ <el-button v-for="item in yearList"
|
|
|
+ :key="item.value" :class="activeyear == item.value ? 'el_button_active' : ''"
|
|
|
+ @click="clickYear(item.value)">{{ item.label }}</el-button>
|
|
|
<!-- <el-button :class="!courseTypeShow ? 'el_button_active' : ''" @click="SwitchCourseType(false)">AI通识课2024版</el-button> -->
|
|
|
</div>
|
|
|
<div class="course_select">
|
|
|
- <span class="grandTitle">年级:</span>
|
|
|
- <el-button :class="selectGrand == '三年级' ? 'el_button_active' : ''" @click="clickGrand('三年级')">三年级</el-button>
|
|
|
- <el-button :class="selectGrand == '四年级' ? 'el_button_active' : ''" @click="clickGrand('四年级')">四年级</el-button>
|
|
|
- <el-button :class="selectGrand == '五年级' ? 'el_button_active' : ''" @click="clickGrand('五年级')">五年级</el-button>
|
|
|
- <el-button :class="selectGrand == '六年级' ? 'el_button_active' : ''" @click="clickGrand('六年级')">六年级</el-button>
|
|
|
- <el-button :class="selectGrand == '七年级' ? 'el_button_active' : ''" @click="clickGrand('七年级')">七年级</el-button>
|
|
|
- <el-button :class="selectGrand == '八年级' ? 'el_button_active' : ''" @click="clickGrand('八年级')">八年级</el-button>
|
|
|
- <el-button v-if="courseTypeShow" :class="selectGrand == '九年级' ? 'el_button_active' : ''"
|
|
|
- @click="clickGrand('九年级')">九年级</el-button>
|
|
|
+ <span class="grandTitle">{{ lang.ssGrade }}</span>
|
|
|
+ <el-button
|
|
|
+ v-for="item in classList" :key="item.value"
|
|
|
+ :class="activegrade == item.value ? 'el_button_active' : ''"
|
|
|
+ @click="clickGrand(item.value)">
|
|
|
+ {{ item.label }}
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div class="course_select">
|
|
|
- <el-button :class="volumes ? 'el_button_active' : ''" @click="volumes = true">上册</el-button>
|
|
|
- <el-button :class="!volumes ? 'el_button_active' : ''"
|
|
|
- @click="volumes = false">下册</el-button>
|
|
|
+ <template v-if="lang.lang != 'hk'">
|
|
|
+ <span class="grandTitle">{{ lang.ssTerm }}</span>
|
|
|
+ <el-button :class="activeterm == 0 ? 'el_button_active' : ''" @click="activeterm = 0,getCourseList()">{{ lang.ssTermUp }}</el-button>
|
|
|
+ <el-button :class="activeterm == 1 ? 'el_button_active' : ''"
|
|
|
+ @click="activeterm = 1,getCourseList()">{{ lang.ssTermDown }}</el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
|
|
|
|
|
|
<!-- 课程上下册区域 -->
|
|
|
- <div v-if="currentData && currentData.shang.length > 0 && volumes">
|
|
|
+ <div v-loading="courseLoading">
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="6" v-for="item in currentData.shang" :key="item.title" style="margin-top: 10px;">
|
|
|
+ <el-col :span="6" v-for="item in activeCurrentData" :key="item.id" style="margin-top: 10px;">
|
|
|
<div class="grid-content ep-bg-purple">
|
|
|
- <img :src="getImageUrl(item.url)" alt="">
|
|
|
+ <img :src="getImageUrl(item.json.url)" alt="">
|
|
|
<div class="course_content">
|
|
|
<div class="div_title">
|
|
|
- <span>上册</span>
|
|
|
- <el-tooltip class="item" effect="dark" :content="item.title" placement="top">
|
|
|
- <div class="div_title_text">{{ item.title }}</div>
|
|
|
+ <span>{{ lang.ssTermUp }}</span>
|
|
|
+ <el-tooltip class="item" effect="dark" :content="item.json.title" placement="top">
|
|
|
+ <div class="div_title_text">{{ item.json.title }}</div>
|
|
|
</el-tooltip>
|
|
|
|
|
|
<!-- v-if="isupdateCourse" -->
|
|
|
@@ -45,17 +49,17 @@
|
|
|
<el-popover v-if="isupdateCourse" placement="bottom" :width="210"
|
|
|
trigger="click" show-after="500" @hide="checked1 = false">
|
|
|
<template #reference>
|
|
|
- <img :src="DownloadImg" v-if="item.courseType == '2'" alt="">
|
|
|
- <img :src="DownloadImg" v-else alt="" @click="getDate(item.dataId)">
|
|
|
+ <img :src="DownloadImg" v-if="item.json.courseType == '2'" alt="">
|
|
|
+ <img :src="DownloadImg" v-else alt="" @click="getDate(item.json.dataId)">
|
|
|
</template>
|
|
|
<div>
|
|
|
<div>
|
|
|
- <span>资源列表({{ item.dataList.length }})</span>
|
|
|
+ <span>{{ lang.ssResList.replace(/\*/g, item.json.dataList.length) }}</span>
|
|
|
<el-checkbox style="position: relative;top: 0;left: 35px;height: 30px;" v-model="checked1"
|
|
|
- label="全选" size="large" @click="checkedAll(item.dataId)" />
|
|
|
+ :label="lang.ssSelectAll" size="large" @click="checkedAll(item.json.dataId)" />
|
|
|
</div>
|
|
|
- <div v-if="item.dataList.length > 0">
|
|
|
- <div class="div_hover" v-for="dataitem in item.dataList" :key="dataitem.dataId">
|
|
|
+ <div v-if="item.json.dataList.length > 0">
|
|
|
+ <div class="div_hover" v-for="dataitem in item.json.dataList" :key="dataitem.dataId">
|
|
|
<span style="display: inline-block;width: 130px;" :title="dataitem.name">{{
|
|
|
dataitem.name.length > 10 ?
|
|
|
dataitem.name.substring(0, 8) + '...' : dataitem.name }}</span>
|
|
|
@@ -63,13 +67,13 @@
|
|
|
@click="downloadOne(dataitem.url, dataitem.name)">
|
|
|
<img :src="DownloadImg" alt="">
|
|
|
</span>
|
|
|
- <el-checkbox v-if="checked1" v-model="dataitem.checked" label="全选" size="large" />
|
|
|
+ <el-checkbox v-if="checked1" v-model="dataitem.checked" :label="lang.ssSelectAll" size="large" />
|
|
|
</div>
|
|
|
<el-button style="margin-top: 10px;" v-if="checked1"
|
|
|
- @click="DownloadProcessing()">批量下载</el-button>
|
|
|
+ @click="DownloadProcessing()">{{ lang.ssBatchDown }}</el-button>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- 暂无数据
|
|
|
+ {{ lang.ssNoData }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-popover>
|
|
|
@@ -79,9 +83,9 @@
|
|
|
<!-- <el-popover v-if="item.courseType == '1'" placement="bottom" trigger="hover">
|
|
|
<template #reference> -->
|
|
|
<el-button
|
|
|
- @click="getCourseid(item.id)"
|
|
|
+ @click="getCourseid(item.json.id)"
|
|
|
style="width: 50%;background: rgba(255, 255, 245, 1);color: rgba(0, 0, 0, 0.6);">
|
|
|
- 备课</el-button>
|
|
|
+ {{ lang.ssPrep }}</el-button>
|
|
|
<!-- </template>
|
|
|
<ul class="beike">
|
|
|
<li @click="openCourseDetail(item.id)">查看</li>
|
|
|
@@ -90,13 +94,13 @@
|
|
|
</ul>
|
|
|
</el-popover> -->
|
|
|
<el-button style="width: 50%;" class="el_button_active"
|
|
|
- @click="openCourseDetail(item.id, item)">上课</el-button>
|
|
|
+ @click="openCourseDetail(item.json.id, item.json)">{{ lang.ssInClass }}</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div v-if="currentData && currentData.xia.length > 0 && !volumes">
|
|
|
+ <!-- <div v-if="currentData && currentData.xia.length > 0 && !volumes">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6" v-for="item in currentData.xia" :key="item.title" style="margin-top: 10px;">
|
|
|
<div class="grid-content ep-bg-purple">
|
|
|
@@ -108,7 +112,6 @@
|
|
|
<div class="div_title_text">{{ item.title }}</div>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <!-- v-if="isupdateCourse" -->
|
|
|
<el-popover v-if="isupdateCourse" placement="bottom" :width="210"
|
|
|
trigger="click" show-after="500" @hide="checked1 = false">
|
|
|
<template #reference>
|
|
|
@@ -143,17 +146,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="class_button" v-if="isupdateCourse">
|
|
|
- <!-- <el-popover v-if="item.courseType == '1'" placement="bottom" trigger="hover">
|
|
|
- <template #reference>
|
|
|
- <el-button
|
|
|
- style="width: 50%;background: rgba(255, 255, 245, 1);color: rgba(0, 0, 0, 0.6);">备课</el-button>
|
|
|
- </template>
|
|
|
- <ul class="beike">
|
|
|
- <li @click="openCourseDetail(item.id)">查看</li>
|
|
|
- <li @click="updateCourse(item.id, item)">修改</li>
|
|
|
- <li @click="ReductionCourse(item.id)">还原</li>
|
|
|
- </ul>
|
|
|
- </el-popover> -->
|
|
|
<el-button
|
|
|
@click="getCourseid(item.id)"
|
|
|
style="width: 50%;background: rgba(255, 255, 245, 1);color: rgba(0, 0, 0, 0.6);">
|
|
|
@@ -164,7 +156,7 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<template v-if="false">
|
|
|
<div style="margin-top: 20px;">
|
|
|
@@ -281,7 +273,7 @@
|
|
|
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, watchEffect } from 'vue';
|
|
|
+import { ref, onMounted, watchEffect, inject } from 'vue';
|
|
|
import { userCurrentRole, userInfoStore, userCurrent,pageGotype } from '../../stores/counter'
|
|
|
// import JSZip from 'jszip';
|
|
|
// import { saveAs } from 'file-saver';
|
|
|
@@ -294,6 +286,7 @@ import selectTeachingClassDialog from '../dialog/selectTeachingClassDialog.vue'
|
|
|
// import { dataType } from 'element-plus/es/components/table-v2/src/common';
|
|
|
import axios from 'axios';
|
|
|
|
|
|
+const lang = inject('lang')
|
|
|
|
|
|
const props = defineProps({
|
|
|
classDown: {
|
|
|
@@ -305,10 +298,31 @@ const volumes = ref(false)
|
|
|
const user = userInfoStore()
|
|
|
const CurrentRole = userCurrentRole()
|
|
|
const Current = userCurrent()
|
|
|
-const selectGrand = ref('三年级')
|
|
|
-const selectmod = ref('模块一')
|
|
|
+const selectGrand = ref(lang.ssGradeThree)
|
|
|
+const selectmod = ref(lang.ssModuleOne)
|
|
|
const gotype = pageGotype()
|
|
|
|
|
|
+const classList = ref([
|
|
|
+ {value: 3, label: lang.ssGradeThree},
|
|
|
+ {value: 4, label: lang.ssGradeFour},
|
|
|
+ {value: 5, label: lang.ssGradeFive},
|
|
|
+ {value: 6, label: lang.ssGradeSix},
|
|
|
+ {value: 7, label: lang.ssGradeSeven},
|
|
|
+ {value: 8, label: lang.ssGradeEight},
|
|
|
+ {value: 9, label: lang.ssGradeNine}
|
|
|
+])
|
|
|
+
|
|
|
+const activeyear = ref(2025)
|
|
|
+const courseLoading = ref(false)
|
|
|
+const yearList = ref([
|
|
|
+ {value: 2025, label: 'AI通识课2025版'},
|
|
|
+])
|
|
|
+
|
|
|
+const clickYear = (val) => {
|
|
|
+ activeyear.value = val
|
|
|
+ getCourseList()
|
|
|
+}
|
|
|
+
|
|
|
const isupdateCourse = ref(false)
|
|
|
const currentData = ref(courseDataJson.new.三年级)
|
|
|
const currentmodData = ref(courseDataJson.mod.模块一)
|
|
|
@@ -330,15 +344,47 @@ const modData = ref(courseDataJson.mod)
|
|
|
const AI6Data = ref(courseDataJson.AI6one)
|
|
|
const AI6TwoData = ref(courseDataJson.AI6Two)
|
|
|
|
|
|
+const activegrade = ref('3')
|
|
|
+const activeterm = ref('1')
|
|
|
+const activeCurrentData = ref([])
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
currentData.value = courseData.value["三年级"]
|
|
|
getTimeCourse(1, 1)
|
|
|
+ getCourseList() // 获取课程列表
|
|
|
})
|
|
|
+
|
|
|
+const getCourseList = () => {
|
|
|
+ courseLoading.value = true
|
|
|
+ let params = {
|
|
|
+ ter: activeterm.value,
|
|
|
+ gra: activegrade.value,
|
|
|
+ ar: lang.lang,
|
|
|
+ typ: gotype.gotype == 'bjs' ? 1 : 0,
|
|
|
+ yea: activeyear.value
|
|
|
+ }
|
|
|
+ axios.get('http://localhost:7003/api/pbl/selectaisixCourse', { params })
|
|
|
+ .then(res => {
|
|
|
+ // console.log(res);
|
|
|
+ let data = res.data[0]
|
|
|
+ data.forEach(item => {
|
|
|
+ item.json = JSON.parse(item.json)
|
|
|
+ })
|
|
|
+ activeCurrentData.value = data
|
|
|
+ courseLoading.value = false
|
|
|
+ console.log('activeCurrentData.value',activeCurrentData.value);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err);
|
|
|
+ courseLoading.value = false
|
|
|
+ });
|
|
|
+};
|
|
|
const clickGrand = val => {
|
|
|
- selectGrand.value = val
|
|
|
- console.log('courseData.value',courseData.value);
|
|
|
+ activegrade.value = val
|
|
|
+ getCourseList()
|
|
|
+ // console.log('courseData.value',courseData.value);
|
|
|
|
|
|
- currentData.value = courseData.value[val]
|
|
|
+ // currentData.value = courseData.value[val]
|
|
|
}
|
|
|
const handleClose =(done)=>{
|
|
|
done()
|
|
|
@@ -713,6 +759,8 @@ const DownloadProcessing = async () => {
|
|
|
.catch(console.error);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// 获取课程下载资料
|
|
|
// top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz", ['课程id'], function (res) {}, [], { "type": "POST", "withCredentials": true });
|
|
|
|