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