Compare commits

...

4 Commits

Author SHA1 Message Date
朱浩 ed8051d0e0 Merge remote-tracking branch 'origin/main' 2024-12-16 14:24:16 +08:00
朱浩 628055fb58 大模型页面补全 2024-12-16 14:24:00 +08:00
zhengdegang 1698ce30dd Merge pull request '更新ppt活动' (#140) from zdg_dev into main
Reviewed-on: #140
2024-12-16 12:18:57 +08:00
zdg a973d296fe 更新ppt活动 2024-12-16 12:18:19 +08:00
7 changed files with 65 additions and 23 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win-ws",
"version": "2.5.5",
"version": "2.5.6",
"description": "",
"main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院",

View File

@ -74,6 +74,8 @@ const initLoad: Function = () => {
!!(opt.ratio??null) && slidesStore.setViewportRatio(opt.ratio)//
}
return PPTApi.getSlideList(resource.id)
// PPTApi.updateWorkList()
// return Promise.resolve()
}
return Promise.resolve()
}

View File

@ -8,6 +8,7 @@ import type { Result } from './types' // 接口类型
import msgUtils from '@/plugins/modal' // 消息工具
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
import * as API_smarttalk from '@/api/file' // 相关api
import * as API_classwork from '@/api/teaching/classwork' // 相关api
import * as useStore from '../store' // pptist-状态管理
import { sessionStore } from '@/utils/store' // electron-store 状态管理
import useUserStore from '@/store/modules/user' // 外部-用户信息
@ -76,12 +77,14 @@ export class PPTApi {
slidesStore.setSlides(slides) // 写入数据
}
// 活动列表处理
const workList = (res.rows || []).map(o => o.activityContent)
// const workList = (res.rows || []).map(o => o.activityContent)
const workItem = res.rows ? [...res.rows] : []
// 写入作业列表数据
slidesStore.setWorkList(workList)
// slidesStore.setWorkList(workList)
// 获取所有的pptlist的数据
slidesStore.setWorkItem(workItem)
this.updateWorkList()
resolve(true)
} else msgUtils.msgError(res.msg || '获取数据失败');resolve(false)
})
@ -202,6 +205,32 @@ export class PPTApi {
else msgUtils.msgError(res.msg || '更新失败');return false
})
}
// 更新-活动列表
static async updateWorkList(): Promise<Boolean> {
const resolveData = (resolve, data = []) => {
slidesStore.setWorkList(data)
return resolve()
}
return new Promise(async (resolve, reject) => {
const workItem = slidesStore.workItem // 所有的pptlist的数据-原始数据
const currentSlide = slidesStore.currentSlide // 当前页幻灯片
const slideId = currentSlide.id // 当前页幻灯片id
if (!slideId) return resolveData(resolve)
// slide详情获取-作业id
// const res = await API_entpcoursefile.getEntpcoursefile(slideId)
// const workIds = res?.data?.activityContent||''
// workItem-获取作业id
const workIds = workItem.find(o => o.id == slideId)?.activityContent
console.log('更新-活动列表', workItem, currentSlide, slideId, workIds)
if (!workIds) return resolveData(resolve)
// 获取作业列表
const resW = await API_classwork.homeworklist({ ids: workIds, pageSize: 1000 })
if (resW && resW.rows) return resolveData(resolve, resW.rows)
else msgUtils.msgError(resW.msg || '更新失败');return resolveData(resolve)
})
}
// thumbnail-slide thumbnail 缩略图
static getSlideThumUrl(): Promise<Boolean> {
return nextTick().then(async() => {

View File

@ -35,6 +35,11 @@ export default () => {
updatePPT({title: newVal})
})
// 监听幻灯片下标变化
watch(() => slidesStore.slideIndex, (newVal, oldVal) => {
PPTApi.updateWorkList()
})
// 消息监听ws
// console.log('监听器已开启', ChatWs)
if (!!ChatWs.ws) {

View File

@ -32,7 +32,7 @@
<!-- 作业列表 -->
<div class="c-apt-r" v-loading='loadingActive'>
<!-- 显示-作业内容 -->
<template v-for="(item, index) in workList" :key="index">
<template v-for="(item, index) in slidesStore.workList" :key="index">
<div class="item">
<div class="item-title">
<el-tag :type="getTagType(item.worktype) || 'primary'">{{item.worktype}}</el-tag>
@ -94,7 +94,7 @@ import {useSlidesStore} from '../../../../../store'
import { updateEntpcoursefileNew } from '@/api/education/entpcoursefile'
const slidesStore = useSlidesStore()
const { slides, slideIndex, currentSlide, workItem } = storeToRefs(slidesStore)
console.log('slidesStore',slidesStore.workList)
interface CourseNode {
rootid: number;
parentNode: { id: number };
@ -332,8 +332,8 @@ onMounted(() => {
currentCourse.levelSecondId = curNode.id
currentCourse.coursetitle = curNode.itemtitle
currentCourse.node = curNode
objItem.value = workItem.value[slideIndex.value]
getCurrentPPtData()
// objItem.value = workItem.value[slideIndex.value]
// getCurrentPPtData()
})
watch(() => [workItem.value.length,workItem.value[slideIndex.value]?.id], (newVal,oldVal) => {
if(!objectsAreEqual(newVal,oldVal))

View File

@ -10,7 +10,7 @@
<div class="content-header-title">{{item.name}}</div>
<div class="content-header-body">
<div class="content-header-num">{{item.num}}</div>
<div class="content-header-text">分析结果</div>
<div class="content-header-text">{{item.type}}</div>
</div>
</div>
</div>
@ -112,27 +112,33 @@ const collectRef = (key) => {
const tags = reactive([{
name: '课标分析',
path: '/model/curriculum',
bgcolor: 'rgb(241,65,108)'
bgcolor: 'rgb(241,65,108)',
type: '分析结果'
},{
name: '教材分析',
path: '/model/teaching',
bgcolor: 'rgb(114,57,234)'
bgcolor: 'rgb(114,57,234)',
type: '分析结果'
},{
name: '考试分析',
path: '/model/examination',
bgcolor: 'rgb(251,132,4)'
bgcolor: 'rgb(251,132,4)',
type: '分析结果'
},{
name: '素材设计',
path: '/model/aiKolors',
bgcolor: 'rgb(25,123,237)'
bgcolor: 'rgb(25,123,237)',
type: '素材'
},{
name: '作业设计',
path: '/model/newClassTaskAssign',
bgcolor: 'rgb(23,198,83)'
bgcolor: 'rgb(23,198,83)',
type: '作业'
},{
name: '框架设计',
path: '/model/design',
bgcolor: 'rgb(34,35,43)'
bgcolor: 'rgb(34,35,43)',
type: '设计框架'
}])
const tools = reactive([{