yws_dev #99

Merged
yangws merged 6 commits from yws_dev into main 2024-12-09 17:26:10 +08:00
4 changed files with 67 additions and 33 deletions
Showing only changes of commit 399c4b5461 - Show all commits

View File

@ -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)

View File

@ -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
})

View File

@ -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)
}
}
});
};

View File

@ -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