add:添加活动页面;
This commit is contained in:
parent
8d03c927b9
commit
399c4b5461
|
@ -142,6 +142,8 @@ export class PPTApi {
|
||||||
static updateSlide(data: object): Promise<Boolean> {
|
static updateSlide(data: object): Promise<Boolean> {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data)
|
const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data)
|
||||||
|
console.log(data,'data');
|
||||||
|
console.log(res,'dresata');
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else msgUtils.msgError(res.msg || '更新失败');resolve(false)
|
} else msgUtils.msgError(res.msg || '更新失败');resolve(false)
|
||||||
|
|
|
@ -32,21 +32,24 @@
|
||||||
<!-- 作业列表 -->
|
<!-- 作业列表 -->
|
||||||
<div class="c-apt-r">
|
<div class="c-apt-r">
|
||||||
<!-- 显示-作业内容 -->
|
<!-- 显示-作业内容 -->
|
||||||
<template v-for="(item, index) in workList">
|
<template v-for="(item, index) in workList" :key="index">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="item-title">
|
<div class="item-title">
|
||||||
<el-tag :type="getTagType(item.worktype) || 'primary'">{{item.worktype}}</el-tag>
|
<el-tag :type="getTagType(item.worktype) || 'primary'">{{item.worktype}}</el-tag>
|
||||||
<el-tooltip :content="item.title||item.uniquekey" placement="top">
|
<el-tooltip :content="item.evaltitle" placement="top">
|
||||||
<div class="tt">{{item.title||item.uniquekey}}</div>
|
<div class="tt">{{item.evaltitle}}</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button class="btn-del" type="danger" link @click="handleRemoveDemoActivityClassWork(item)">删除</el-button>
|
<el-button class="btn-del" type="danger" link @click="handleRemoveDemoActivityClassWork(item)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
{{workList.length}}
|
||||||
</div>
|
</div>
|
||||||
<!-- // 推送作业 -->
|
<!-- // 推送作业 -->
|
||||||
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="80%">
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="80%" height="500">
|
||||||
<NewClassTsakAssign :currentCourse='currentCourse'/>
|
<el-scrollbar height="500">
|
||||||
|
<NewClassTsakAssign :currentCourse='currentCourse' @getData="getData" />
|
||||||
|
</el-scrollbar>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 活动引用 -->
|
<!-- 活动引用 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
|
@ -55,9 +58,9 @@
|
||||||
append-to-body
|
append-to-body
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
width="40%"
|
width="40%"
|
||||||
@selection-change="handleSelectionChange">
|
>
|
||||||
<el-table :data="taskList" style="width: 100%" height="500">
|
<el-table :data="taskList" style="width: 100%" height="500" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" :selectable="selectable" width="55" />
|
<el-table-column type="selection" width="55" :selectable="selectable"/>
|
||||||
<el-table-column prop="evaltitle" label="活动名称" width="150" />
|
<el-table-column prop="evaltitle" label="活动名称" width="150" />
|
||||||
<el-table-column prop="worktype" label="活动类型" width="120" sortable>
|
<el-table-column prop="worktype" label="活动类型" width="120" sortable>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -74,7 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onBeforeMount, defineExpose } from 'vue'
|
import { ref, reactive, onMounted, onBeforeMount, defineExpose,nextTick } from 'vue'
|
||||||
import Divider from '../../../../../components/Divider.vue'
|
import Divider from '../../../../../components/Divider.vue'
|
||||||
import {listEntpcoursefile} from '@/api/education/entpcoursefile'
|
import {listEntpcoursefile} from '@/api/education/entpcoursefile'
|
||||||
import {homeworklist} from '@/api/teaching/classwork'
|
import {homeworklist} from '@/api/teaching/classwork'
|
||||||
|
@ -84,6 +87,7 @@ import { ElMessageBox } from 'element-plus'
|
||||||
import NewClassTsakAssign from '@/views/classTask/newClassTaskAssign/index.vue'
|
import NewClassTsakAssign from '@/views/classTask/newClassTaskAssign/index.vue'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
|
import { updateSlide } from '@/AixPPTist/src/api/index'
|
||||||
const currentCourse = reactive({
|
const currentCourse = reactive({
|
||||||
textbookId:0,
|
textbookId:0,
|
||||||
levelFirstId:0,
|
levelFirstId:0,
|
||||||
|
@ -121,51 +125,58 @@ const type = ref([
|
||||||
])
|
])
|
||||||
// 作业列表
|
// 作业列表
|
||||||
const workList = ref([])
|
const workList = ref([])
|
||||||
const selectable = (row,index) => {
|
// 获取所选择的作业列表
|
||||||
console.log(row,index,'row,index');
|
const selectedWorkList = ref([])
|
||||||
return true
|
// 获取当前的活动ppt页面
|
||||||
}
|
const currentPPT = ref({})
|
||||||
|
const selectable=(row, index)=>{
|
||||||
|
return row.status == '10';
|
||||||
|
};
|
||||||
const clickPPTList = (item) => {
|
const clickPPTList = (item) => {
|
||||||
console.log(item,'点击了')
|
console.log(item,'点击了')
|
||||||
|
console.log(item.id,'item');
|
||||||
|
return
|
||||||
workList.value = []
|
workList.value = []
|
||||||
let datacontent = item.datacontent;
|
let datacontent = item.datacontent;
|
||||||
let pptJson = "";
|
let pptJson = "";
|
||||||
if(typeof datacontent === 'string') pptJson = JSON.parse(datacontent)
|
if(typeof datacontent === 'string') pptJson = JSON.parse(datacontent)
|
||||||
if(pptJson&&pptJson[0]&&pptJson[0].classworkList) {
|
if(pptJson&&pptJson.activityContent) {
|
||||||
homeworklist({ids:pptJson[0].classworkList, pageSize: 100}).then( async res => {
|
homeworklist({ids:pptJson.activityContent, pageSize: 100}).then( async res => {
|
||||||
await formatClassWorkFile(res.rows)
|
// await formatClassWorkFile(res.rows)
|
||||||
|
await nextTick();
|
||||||
|
workList.value = [...res.rows]
|
||||||
|
console.log(workList.value,'workList.value');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const formatClassWorkFile = async (postData) => {
|
const formatClassWorkFile = async (postData) => {
|
||||||
return new Promise(async (resolve, reject)=>{
|
return new Promise(async (resolve, reject) => {
|
||||||
for (let i = 0; i < postData.length; i++) {
|
for (let i = 0; i < postData.length; i++) {
|
||||||
let item = postData[i];
|
let item = postData[i];
|
||||||
|
console.log("当前处理的元素:", item); // 新增这行,查看元素结构
|
||||||
switch (item.worktype) {
|
switch (item.worktype) {
|
||||||
case '框架梳理': {
|
case '框架梳理': {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '习题训练': {
|
case '习题训练': {
|
||||||
item.entpcourseworklistarray = item.entpcourseworklist?JSON.parse('['+item.entpcourseworklist+']'):[];
|
let workIds = item.quizlist.map(items => items.id).join(',');
|
||||||
let workIds = item.entpcourseworklistarray.map(items=>items.id).join(',')
|
let ress = await listEntpcoursework({ ids: workIds });
|
||||||
let ress = await listEntpcoursework({ids:workIds})
|
processList(ress.rows);
|
||||||
processList(ress.rows)
|
|
||||||
item.workShowList = ress.rows
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '课堂展示': {
|
case '课堂展示': {
|
||||||
item.base64 = JSON.parse(item.workcodes).base64
|
item.base64 = JSON.parse(item.workcodes).base64;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '常规作业': {
|
case '常规作业': {
|
||||||
item.prevData = JSON.parse(item.workcodes)
|
item.prevData = JSON.parse(item.workcodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
workList.value.push(item)
|
// console.log(workList.value, 'workList.value');
|
||||||
}
|
}
|
||||||
resolve()
|
await nextTick();
|
||||||
})
|
resolve();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// 删除作业
|
// 删除作业
|
||||||
const handleRemoveDemoActivityClassWork = (item) => {
|
const handleRemoveDemoActivityClassWork = (item) => {
|
||||||
|
@ -183,12 +194,15 @@ const getTagType = (worktype) => {
|
||||||
const initHomeWork = async()=> {
|
const initHomeWork = async()=> {
|
||||||
tasklist_loading.value = true;
|
tasklist_loading.value = true;
|
||||||
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
|
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
|
||||||
|
console.log(res,'res');
|
||||||
|
|
||||||
taskList.value = res;
|
taskList.value = res;
|
||||||
tasklist_loading.value = false;
|
tasklist_loading.value = false;
|
||||||
}
|
}
|
||||||
// 多选活动引用
|
// 多选活动引用
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
console.log(val,'多选')
|
console.log(val,'多选')
|
||||||
|
selectedWorkList.value = [...val]
|
||||||
}
|
}
|
||||||
// 打开添加作业活动
|
// 打开添加作业活动
|
||||||
const showDialog = (item) => {
|
const showDialog = (item) => {
|
||||||
|
@ -200,8 +214,15 @@ const openList = () => {
|
||||||
initHomeWork()
|
initHomeWork()
|
||||||
}
|
}
|
||||||
// 添加活动引用列表作业
|
// 添加活动引用列表作业
|
||||||
const save = () => {
|
const save = async () => {
|
||||||
console.log('添加了')
|
console.log('添加了')
|
||||||
|
if(!currentPPT.classWorkList){
|
||||||
|
currentPPT.classWorkList = [];
|
||||||
|
}
|
||||||
|
const arr = selectedWorkList.value.map(item=>item.id)
|
||||||
|
const classworkList = arr.join(',')
|
||||||
|
// await formatClassWorkFile(selectedWorkList.value)
|
||||||
|
updateSlide({activityContent:classworkList})
|
||||||
activeVisible.value = false
|
activeVisible.value = false
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -219,6 +240,11 @@ onMounted(() => {
|
||||||
dataList.value = [...res.rows]
|
dataList.value = [...res.rows]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
// 接收习题训练的值
|
||||||
|
const getData = async (data) => {
|
||||||
|
console.log(data,'data')
|
||||||
|
await formatClassWorkFile([data])
|
||||||
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
clickPPTList
|
clickPPTList
|
||||||
})
|
})
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue'
|
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick, defineEmits } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { Plus, Delete } from '@element-plus/icons-vue'
|
import { Plus, Delete } from '@element-plus/icons-vue'
|
||||||
|
@ -156,6 +156,7 @@ const { proxy } = getCurrentInstance()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
currentCourse: Object,
|
currentCourse: Object,
|
||||||
})
|
})
|
||||||
|
const emits = defineEmits(['getData'])
|
||||||
const isShow = ref(false)
|
const isShow = ref(false)
|
||||||
|
|
||||||
const propsQueryCourseObj = route.query.courseObj;//作业布置的内容对象
|
const propsQueryCourseObj = route.query.courseObj;//作业布置的内容对象
|
||||||
|
@ -460,10 +461,11 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
await nextTick(); // 确保DOM更新完成
|
await nextTick(); // 确保DOM更新完成
|
||||||
proxy.$refs["classWorkFormRef"].validate(async valid => {
|
proxy.$refs["classWorkFormRef"].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
//
|
if(!isShow.value){
|
||||||
|
//
|
||||||
// const { chapterId } = await useGetHomework(courseObj.node)
|
// const { chapterId } = await useGetHomework(courseObj.node)
|
||||||
// this.entpcourseid = chapterId
|
// this.entpcourseid = chapterId
|
||||||
|
debugger
|
||||||
const cform = {
|
const cform = {
|
||||||
id: 0,
|
id: 0,
|
||||||
workdate: classWorkForm.workdate, // //作业类型?web端这里貌似没有这个时间
|
workdate: classWorkForm.workdate, // //作业类型?web端这里貌似没有这个时间
|
||||||
|
@ -604,6 +606,10 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
// // 首页进入的,跳转到作业布置页面
|
// // 首页进入的,跳转到作业布置页面
|
||||||
// router.push({ path: '/classTaskAssign' });
|
// router.push({ path: '/classTaskAssign' });
|
||||||
// }
|
// }
|
||||||
|
}else{
|
||||||
|
console.log(11111);
|
||||||
|
emits('getData',classWorkForm)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -52,7 +52,7 @@ import { useRouter } from 'vue-router'
|
||||||
import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons-vue'
|
import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons-vue'
|
||||||
import useUserStore from '@/store/modules/user' // 用户信息
|
import useUserStore from '@/store/modules/user' // 用户信息
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
import { createWindow, sessionStore } from '@/utils/tool' // 相关工具
|
import { createWindow } from '@/utils/tool' // 相关工具
|
||||||
import * as API_smarttalk from '@/api/file' // 文件相关api
|
import * as API_smarttalk from '@/api/file' // 文件相关api
|
||||||
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
|
|
Loading…
Reference in New Issue