Compare commits
No commits in common. "e30e3fd42d4873a120cd120abf2c66675d00c832" and "81f704b2a50a2082998c710e62d89c4a703887db" have entirely different histories.
e30e3fd42d
...
81f704b2a5
|
@ -23,9 +23,7 @@ const defaultData = {
|
|||
curNode: null, // 当前选中的节点
|
||||
defaultExpandedKeys: [], //展开的节点
|
||||
subjectTree: [] // "树结构" 章节
|
||||
},
|
||||
env: {}, // 不走同步 Pinia - 变量
|
||||
curr: {} // 不走同步 Pinia - 当前信息
|
||||
}
|
||||
},
|
||||
local: { // 本地(永久localStorage)
|
||||
},
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
<template>
|
||||
<template v-if="loading">
|
||||
加载中...
|
||||
</template>
|
||||
<template v-else>
|
||||
<Screen v-if="screening" />
|
||||
<Editor v-else-if="_isPC" />
|
||||
<Mobile v-else />
|
||||
</template>
|
||||
<Screen v-if="screening" />
|
||||
<Editor v-else-if="_isPC" />
|
||||
<Mobile v-else />
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch, onBeforeMount } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useScreenStore, useMainStore, useSnapshotStore, useSlidesStore } from './store'
|
||||
import { useScreenStore, useMainStore, useSnapshotStore } from './store'
|
||||
import { LOCALSTORAGE_KEY_DISCARDED_DB } from './configs/storage'
|
||||
import { deleteDiscardedDB } from './utils/database'
|
||||
import { isPC } from './utils/common'
|
||||
|
@ -22,17 +17,10 @@ import Editor from './views/Editor/index.vue'
|
|||
import Screen from './views/Screen/index.vue'
|
||||
import Mobile from './views/Mobile/index.vue'
|
||||
|
||||
// zdg
|
||||
import msgUtils from '@/plugins/modal' // 消息工具
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
import { PPTApi } from './api'
|
||||
|
||||
const loading = ref(true)
|
||||
const _isPC = isPC()
|
||||
|
||||
const mainStore = useMainStore()
|
||||
const snapshotStore = useSnapshotStore()
|
||||
const slidesStore = useSlidesStore()
|
||||
const { databaseId } = storeToRefs(mainStore)
|
||||
const { screening } = storeToRefs(useScreenStore())
|
||||
|
||||
|
@ -41,11 +29,9 @@ if (import.meta.env.MODE !== 'development') {
|
|||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await initLoad()
|
||||
await deleteDiscardedDB()
|
||||
snapshotStore.initSnapshotDatabase()
|
||||
mainStore.setAvailableFonts()
|
||||
loading.value = false // 加载完毕
|
||||
})
|
||||
|
||||
// 应用注销时向 localStorage 中记录下本次 indexedDB 的数据库ID,用于之后清除数据库
|
||||
|
@ -58,29 +44,6 @@ window.addEventListener('unload', () => {
|
|||
const newDiscardedDB = JSON.stringify(discardedDBList)
|
||||
localStorage.setItem(LOCALSTORAGE_KEY_DISCARDED_DB, newDiscardedDB)
|
||||
})
|
||||
/** 接口类型 */
|
||||
interface Result {
|
||||
code?: number,
|
||||
msg?: string,
|
||||
data?: any
|
||||
rows?: Array<any>,
|
||||
total?: number
|
||||
}
|
||||
// 获取参数
|
||||
const initLoad: Function = () => {
|
||||
const urlSearch = location.href.split('?')[1]
|
||||
const query = Object.fromEntries(new URLSearchParams(urlSearch))
|
||||
const id: String = query.id
|
||||
// 如果存在就获取pptx幻灯片内容
|
||||
if (!!id) return PPTApi.getSlideList(id)
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
// 监听幻灯片内容变化
|
||||
watch(() => slidesStore.slides, (newVal, oldVal) => {
|
||||
// 更新幻灯片内容
|
||||
PPTApi.updateSlides(newVal, oldVal)
|
||||
},{ deep: true })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
@ -1,171 +0,0 @@
|
|||
/**
|
||||
* @description ppt幻灯片相关的请求接口-集中处理
|
||||
* @author zdg
|
||||
* @date 2024-11-26
|
||||
*/
|
||||
import { toRaw } from 'vue'
|
||||
import msgUtils from '@/plugins/modal' // 消息工具
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
import * as useStore from '../store' // pptist-状态管理
|
||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||
import useUserStore from '@/store/modules/user' // 外部-用户信息
|
||||
|
||||
const slidesStore = useStore.useSlidesStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
/** 工具类 */
|
||||
export class Utils {
|
||||
static mxData: any = {
|
||||
throTime: 0, // 节流时间
|
||||
}
|
||||
/**
|
||||
* 节流-防抖
|
||||
* @param {*} func
|
||||
* @param {*} delay
|
||||
* @param {*} type 1-节流 2-防抖
|
||||
* mxThrottle(() => {xxxx}, 200)
|
||||
*/
|
||||
static mxThrottle(func, delay = 200, type = 1) {
|
||||
if (type == 1) { // 节流(第一次触发后面的事件不触发)
|
||||
const cur = Date.now()
|
||||
const lastExecuted = this.mxData.throTime
|
||||
if (cur - lastExecuted > delay) {
|
||||
this.mxData.throTime = cur
|
||||
return func.apply(this)
|
||||
}
|
||||
} else { // 防抖(只触发最后一次事件)
|
||||
const timer = this.mxData.throTime
|
||||
!!timer && clearTimeout(timer)
|
||||
this.mxData.throTime = setTimeout(() => {
|
||||
return func.apply(this)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** ppt相关后端接口处理 */
|
||||
export class PPTApi {
|
||||
// 变量
|
||||
static isUpdate = true // 是否更新数据
|
||||
|
||||
// 获取所有幻灯片列表
|
||||
static getSlideList(parentid: (Number | String)): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const params: object = { parentid }
|
||||
const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params)
|
||||
if (res.code === 200) {
|
||||
const slides = (res.rows || []).map(o => {
|
||||
if (!!o.datacontent) {
|
||||
const json = JSON.parse(o.datacontent)
|
||||
!!json && (json.id = o.id)
|
||||
return json
|
||||
}
|
||||
// 如果没有数据,默认空白页
|
||||
return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}}
|
||||
})
|
||||
slidesStore.updateSlideIndex(0) // 下标0 为第一页
|
||||
slidesStore.setSlides(slides) // 写入数据
|
||||
resolve(true)
|
||||
} else msgUtils.msgError(res.msg || '获取数据失败');resolve(false)
|
||||
})
|
||||
}
|
||||
|
||||
// 新增幻灯片
|
||||
static addSlide(data: object): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const enpt = sessionStore.get('curr.entp')||{}
|
||||
const resource = sessionStore.get('curr.resource')||{}
|
||||
const {id, ...content} = data
|
||||
const params = {
|
||||
parentid: resource.id,
|
||||
entpid: userStore.user.deptId,
|
||||
entpcourseid: enpt.id,
|
||||
ppttype: 'file',
|
||||
title: '',
|
||||
fileurl: '',
|
||||
filetype: 'slide',
|
||||
datacontent: JSON.stringify(content),
|
||||
filekey: '',
|
||||
filetag: '',
|
||||
fileidx: 0,
|
||||
dflag: 0,
|
||||
status: '',
|
||||
edituserid: userStore.id
|
||||
}
|
||||
const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params)
|
||||
if (!!rid) {
|
||||
data.id = rid
|
||||
slidesStore.updateSlide(data)
|
||||
// msgUtils.msgSuccess('新增成功')
|
||||
this.isUpdate = false // 新增后会触发监听,不再更新数据
|
||||
resolve(true)
|
||||
} else msgUtils.msgError('新增失败');resolve(false)
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description 监听幻灯片数据变化,更新数据
|
||||
* @param newVal
|
||||
* @param oldVal
|
||||
* @returns
|
||||
*/
|
||||
static async updateSlides(newVal: object, oldVal: object) {
|
||||
const newData = toRaw(newVal)
|
||||
const oldData = toRaw(oldVal)
|
||||
console.log('监听幻灯片数据变化', newData, oldData)
|
||||
if (!(newData&&newData.length)) return // 新数据为空,不需要更新数据
|
||||
else if (!oldData.length) return // 初始加载,旧数据空不需要更新数据
|
||||
|
||||
const currentSlide = toRaw(slidesStore.currentSlide)
|
||||
const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增
|
||||
if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
|
||||
const bool = await this.addSlide(currentSlide)
|
||||
bool && this.batchUpdateSlides(newData, true) // 批量更新-排序
|
||||
} else { // 防抖-更新
|
||||
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
|
||||
const params = {
|
||||
id: currentSlide.id,
|
||||
datacontent: JSON.stringify(currentSlide),
|
||||
}
|
||||
Utils.mxThrottle(() => {this.updateSlide(params)}, 1000, 2)
|
||||
}
|
||||
}
|
||||
// 更新幻灯片
|
||||
static updateSlide(data: object): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data)
|
||||
if (res.code === 200) {
|
||||
resolve(true)
|
||||
} else msgUtils.msgError(res.msg || '更新失败');resolve(false)
|
||||
})
|
||||
}
|
||||
/**
|
||||
* @description 批量更新 数据|排序
|
||||
* @param list 数据
|
||||
* @param sort 是否只更新排序
|
||||
* @returns
|
||||
*/
|
||||
static batchUpdateSlides(list: Slide[], sort: boolean): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const data: object[] = list.map((o, index) => ({
|
||||
id: o.id,
|
||||
fileidx: index,
|
||||
datacontent: sort?null:JSON.stringify(o),
|
||||
}))
|
||||
const res: Result = await API_entpcoursefile.batchUpdateNew(data)
|
||||
if (res.code === 200) {
|
||||
resolve(true)
|
||||
} else msgUtils.msgError(res.msg || '更新失败');resolve(false)
|
||||
})
|
||||
}
|
||||
// 删除幻灯片
|
||||
static delSlide(id: string): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const res: Result = await API_entpcoursefile.delEntpcoursefile(id)
|
||||
if (res.code === 200) {
|
||||
resolve(true)
|
||||
} else msgUtils.msgError(res.msg || '删除失败');resolve(false)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default PPTApi
|
|
@ -1,19 +0,0 @@
|
|||
/**
|
||||
* @description api 无store循环引用
|
||||
* @author zdg
|
||||
*/
|
||||
import msgUtils from '@/plugins/modal' // 消息工具
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
|
||||
export default class {
|
||||
// 删除幻灯片
|
||||
static delSlide(id: string): Promise<Boolean> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
console.log('delSlide', id)
|
||||
const res: Result = await API_entpcoursefile.delEntpcoursefile(id)
|
||||
if (res.code === 200) {
|
||||
resolve(true)
|
||||
} else msgUtils.msgError(res.msg || '删除失败');resolve(false)
|
||||
})
|
||||
}
|
||||
}
|
|
@ -13,4 +13,4 @@ interface Document {
|
|||
mozCancelFullScreen(): Promise<void>
|
||||
webkitExitFullscreen(): Promise<void>
|
||||
msExitFullscreen(): Promise<void>
|
||||
}
|
||||
}
|
|
@ -1,187 +1,186 @@
|
|||
import type { Slide } from '../types/slides'
|
||||
|
||||
export const slides: Slide[] = [
|
||||
// {
|
||||
// id: 'test-slide-1',
|
||||
// elements: [
|
||||
// {
|
||||
// type: 'shape',
|
||||
// id: '4cbRxp',
|
||||
// left: 0,
|
||||
// top: 200,
|
||||
// width: 546,
|
||||
// height: 362.5,
|
||||
// viewBox: [200, 200],
|
||||
// path: 'M 0 0 L 0 200 L 200 200 Z',
|
||||
// fill: '#5b9bd5',
|
||||
// fixedRatio: false,
|
||||
// opacity: 0.7,
|
||||
// rotate: 0
|
||||
// },
|
||||
// {
|
||||
// type: 'shape',
|
||||
// id: 'ookHrf',
|
||||
// left: 0,
|
||||
// top: 0,
|
||||
// width: 300,
|
||||
// height: 320,
|
||||
// viewBox: [200, 200],
|
||||
// path: 'M 0 0 L 0 200 L 200 200 Z',
|
||||
// fill: '#5b9bd5',
|
||||
// fixedRatio: false,
|
||||
// flipV: true,
|
||||
// rotate: 0
|
||||
// },
|
||||
// {
|
||||
// type: 'text',
|
||||
// id: 'idn7Mx',
|
||||
// left: 355,
|
||||
// top: 65.25,
|
||||
// width: 450,
|
||||
// height: 188,
|
||||
// lineHeight: 1.2,
|
||||
// content: '<p><strong><span style=\"font-size: 112px;\">PPTist</span></strong></p>',
|
||||
// rotate: 0,
|
||||
// defaultFontName: 'Microsoft Yahei',
|
||||
// defaultColor: '#333'
|
||||
// },
|
||||
// {
|
||||
// type: 'text',
|
||||
// id: '7stmVP',
|
||||
// left: 355,
|
||||
// top: 253.25,
|
||||
// width: 585,
|
||||
// height: 56,
|
||||
// content: '<p><span style=\"font-size: 24px;\">基于 Vue 3.x + TypeScript 的在线演示文稿应用</span></p>',
|
||||
// rotate: 0,
|
||||
// defaultFontName: 'Microsoft Yahei',
|
||||
// defaultColor: '#333'
|
||||
// },
|
||||
// {
|
||||
// type: 'line',
|
||||
// id: 'FnpZs4',
|
||||
// left: 361,
|
||||
// top: 238,
|
||||
// start: [0, 0],
|
||||
// end: [549, 0],
|
||||
// points: ['', ''],
|
||||
// color: '#5b9bd5',
|
||||
// style: 'solid',
|
||||
// width: 2,
|
||||
// },
|
||||
// ],
|
||||
// background: {
|
||||
// type: 'solid',
|
||||
// color: '#ffffff',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: 'test-slide-2',
|
||||
// elements: [
|
||||
// {
|
||||
// type: 'text',
|
||||
// id: 'ptNnUJ',
|
||||
// left: 145,
|
||||
// top: 148,
|
||||
// width: 711,
|
||||
// height: 77,
|
||||
// lineHeight: 1.2,
|
||||
// content: '<p style=\"text-align: center;\"><strong><span style=\"font-size: 48px;\">在此处添加标题</span></strong></p>',
|
||||
// rotate: 0,
|
||||
// defaultFontName: 'Microsoft Yahei',
|
||||
// defaultColor: '#333',
|
||||
// },
|
||||
// {
|
||||
// type: 'text',
|
||||
// id: 'mRHvQN',
|
||||
// left: 207.50000000000003,
|
||||
// top: 249.84259259259264,
|
||||
// width: 585,
|
||||
// height: 56,
|
||||
// content: '<p style=\"text-align: center;\"><span style=\"font-size: 24px;\">在此处添加副标题</span></p>',
|
||||
// rotate: 0,
|
||||
// defaultFontName: 'Microsoft Yahei',
|
||||
// defaultColor: '#333',
|
||||
// },
|
||||
// {
|
||||
// type: 'line',
|
||||
// id: '7CQDwc',
|
||||
// left: 323.09259259259267,
|
||||
// top: 238.33333333333334,
|
||||
// start: [0, 0],
|
||||
// end: [354.8148148148148, 0],
|
||||
// points: ['', ''],
|
||||
// color: '#5b9bd5',
|
||||
// style: 'solid',
|
||||
// width: 4
|
||||
// },
|
||||
// {
|
||||
// type: 'shape',
|
||||
// id: '09wqWw',
|
||||
// left: -27.648148148148138,
|
||||
// top: 432.73148148148147,
|
||||
// width: 1056.2962962962963,
|
||||
// height: 162.96296296296296,
|
||||
// viewBox: [200, 200],
|
||||
// path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',
|
||||
// fill: '#5b9bd5',
|
||||
// fixedRatio: false,
|
||||
// rotate: 0
|
||||
// }
|
||||
// ],
|
||||
// background: {
|
||||
// type: 'solid',
|
||||
// color: '#fff',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: 'test-slide-3',
|
||||
// elements: [
|
||||
// {
|
||||
// type: 'shape',
|
||||
// id: 'vSheCJ',
|
||||
// left: 183.5185185185185,
|
||||
// top: 175.5092592592593,
|
||||
// width: 605.1851851851851,
|
||||
// height: 185.18518518518516,
|
||||
// viewBox: [200, 200],
|
||||
// path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',
|
||||
// fill: '#5b9bd5',
|
||||
// fixedRatio: false,
|
||||
// rotate: 0
|
||||
// },
|
||||
// {
|
||||
// type: 'shape',
|
||||
// id: 'Mpwv7x',
|
||||
// left: 211.29629629629628,
|
||||
// top: 201.80555555555557,
|
||||
// width: 605.1851851851851,
|
||||
// height: 185.18518518518516,
|
||||
// viewBox: [200, 200],
|
||||
// path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',
|
||||
// fill: '#5b9bd5',
|
||||
// fixedRatio: false,
|
||||
// rotate: 0,
|
||||
// opacity: 0.7
|
||||
// },
|
||||
// {
|
||||
// type: 'text',
|
||||
// id: 'WQOTAp',
|
||||
// left: 304.9074074074074,
|
||||
// top: 198.10185185185182,
|
||||
// width: 417.9629629629629,
|
||||
// height: 140,
|
||||
// content: '<p style=\"text-align: center;\"><strong><span style=\"font-size: 80px;\"><span style=\"color: rgb(255, 255, 255);\">感谢观看</span></span></strong></p>',
|
||||
// rotate: 0,
|
||||
// defaultFontName: 'Microsoft Yahei',
|
||||
// defaultColor: '#333',
|
||||
// wordSpace: 5
|
||||
// }
|
||||
// ],
|
||||
// background: {
|
||||
// type: 'solid',
|
||||
// color: '#fff',
|
||||
// },
|
||||
// },
|
||||
// {"id":"-3hMiOtk8M","elements":[],"background":{"type":"solid","color":"#fff"}},
|
||||
{
|
||||
id: 'test-slide-1',
|
||||
elements: [
|
||||
{
|
||||
type: 'shape',
|
||||
id: '4cbRxp',
|
||||
left: 0,
|
||||
top: 200,
|
||||
width: 546,
|
||||
height: 362.5,
|
||||
viewBox: [200, 200],
|
||||
path: 'M 0 0 L 0 200 L 200 200 Z',
|
||||
fill: '#5b9bd5',
|
||||
fixedRatio: false,
|
||||
opacity: 0.7,
|
||||
rotate: 0
|
||||
},
|
||||
{
|
||||
type: 'shape',
|
||||
id: 'ookHrf',
|
||||
left: 0,
|
||||
top: 0,
|
||||
width: 300,
|
||||
height: 320,
|
||||
viewBox: [200, 200],
|
||||
path: 'M 0 0 L 0 200 L 200 200 Z',
|
||||
fill: '#5b9bd5',
|
||||
fixedRatio: false,
|
||||
flipV: true,
|
||||
rotate: 0
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'idn7Mx',
|
||||
left: 355,
|
||||
top: 65.25,
|
||||
width: 450,
|
||||
height: 188,
|
||||
lineHeight: 1.2,
|
||||
content: '<p><strong><span style=\"font-size: 112px;\">PPTist</span></strong></p>',
|
||||
rotate: 0,
|
||||
defaultFontName: 'Microsoft Yahei',
|
||||
defaultColor: '#333'
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: '7stmVP',
|
||||
left: 355,
|
||||
top: 253.25,
|
||||
width: 585,
|
||||
height: 56,
|
||||
content: '<p><span style=\"font-size: 24px;\">基于 Vue 3.x + TypeScript 的在线演示文稿应用</span></p>',
|
||||
rotate: 0,
|
||||
defaultFontName: 'Microsoft Yahei',
|
||||
defaultColor: '#333'
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
id: 'FnpZs4',
|
||||
left: 361,
|
||||
top: 238,
|
||||
start: [0, 0],
|
||||
end: [549, 0],
|
||||
points: ['', ''],
|
||||
color: '#5b9bd5',
|
||||
style: 'solid',
|
||||
width: 2,
|
||||
},
|
||||
],
|
||||
background: {
|
||||
type: 'solid',
|
||||
color: '#ffffff',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'test-slide-2',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
id: 'ptNnUJ',
|
||||
left: 145,
|
||||
top: 148,
|
||||
width: 711,
|
||||
height: 77,
|
||||
lineHeight: 1.2,
|
||||
content: '<p style=\"text-align: center;\"><strong><span style=\"font-size: 48px;\">在此处添加标题</span></strong></p>',
|
||||
rotate: 0,
|
||||
defaultFontName: 'Microsoft Yahei',
|
||||
defaultColor: '#333',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'mRHvQN',
|
||||
left: 207.50000000000003,
|
||||
top: 249.84259259259264,
|
||||
width: 585,
|
||||
height: 56,
|
||||
content: '<p style=\"text-align: center;\"><span style=\"font-size: 24px;\">在此处添加副标题</span></p>',
|
||||
rotate: 0,
|
||||
defaultFontName: 'Microsoft Yahei',
|
||||
defaultColor: '#333',
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
id: '7CQDwc',
|
||||
left: 323.09259259259267,
|
||||
top: 238.33333333333334,
|
||||
start: [0, 0],
|
||||
end: [354.8148148148148, 0],
|
||||
points: ['', ''],
|
||||
color: '#5b9bd5',
|
||||
style: 'solid',
|
||||
width: 4
|
||||
},
|
||||
{
|
||||
type: 'shape',
|
||||
id: '09wqWw',
|
||||
left: -27.648148148148138,
|
||||
top: 432.73148148148147,
|
||||
width: 1056.2962962962963,
|
||||
height: 162.96296296296296,
|
||||
viewBox: [200, 200],
|
||||
path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',
|
||||
fill: '#5b9bd5',
|
||||
fixedRatio: false,
|
||||
rotate: 0
|
||||
}
|
||||
],
|
||||
background: {
|
||||
type: 'solid',
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'test-slide-3',
|
||||
elements: [
|
||||
{
|
||||
type: 'shape',
|
||||
id: 'vSheCJ',
|
||||
left: 183.5185185185185,
|
||||
top: 175.5092592592593,
|
||||
width: 605.1851851851851,
|
||||
height: 185.18518518518516,
|
||||
viewBox: [200, 200],
|
||||
path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',
|
||||
fill: '#5b9bd5',
|
||||
fixedRatio: false,
|
||||
rotate: 0
|
||||
},
|
||||
{
|
||||
type: 'shape',
|
||||
id: 'Mpwv7x',
|
||||
left: 211.29629629629628,
|
||||
top: 201.80555555555557,
|
||||
width: 605.1851851851851,
|
||||
height: 185.18518518518516,
|
||||
viewBox: [200, 200],
|
||||
path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',
|
||||
fill: '#5b9bd5',
|
||||
fixedRatio: false,
|
||||
rotate: 0,
|
||||
opacity: 0.7
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'WQOTAp',
|
||||
left: 304.9074074074074,
|
||||
top: 198.10185185185182,
|
||||
width: 417.9629629629629,
|
||||
height: 140,
|
||||
content: '<p style=\"text-align: center;\"><strong><span style=\"font-size: 80px;\"><span style=\"color: rgb(255, 255, 255);\">感谢观看</span></span></strong></p>',
|
||||
rotate: 0,
|
||||
defaultFontName: 'Microsoft Yahei',
|
||||
defaultColor: '#333',
|
||||
wordSpace: 5
|
||||
}
|
||||
],
|
||||
background: {
|
||||
type: 'solid',
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
]
|
|
@ -6,8 +6,6 @@ import { slides } from '../mocks/slides'
|
|||
import { theme } from '../mocks/theme'
|
||||
import { layouts } from '../mocks/layout'
|
||||
|
||||
import PPTApi from '../api/store'
|
||||
|
||||
interface RemovePropData {
|
||||
id: string
|
||||
propName: string | string[]
|
||||
|
@ -157,13 +155,14 @@ export const useSlidesStore = defineStore('slides', {
|
|||
this.slides = slides
|
||||
},
|
||||
|
||||
async deleteSlide(slideId: string | string[]) {
|
||||
deleteSlide(slideId: string | string[]) {
|
||||
const slidesId = Array.isArray(slideId) ? slideId : [slideId]
|
||||
const slides: Slide[] = JSON.parse(JSON.stringify(this.slides))
|
||||
|
||||
const deleteSlidesIndex = []
|
||||
for (const deletedId of slidesId) {
|
||||
const index = slides.findIndex(item => item.id === deletedId)
|
||||
deleteSlidesIndex.push(index)
|
||||
|
||||
const deletedSlideSection = slides[index].sectionTag
|
||||
if (deletedSlideSection) {
|
||||
|
@ -173,13 +172,8 @@ export const useSlidesStore = defineStore('slides', {
|
|||
slides[index + 1].sectionTag = deletedSlideSection
|
||||
}
|
||||
}
|
||||
// 后端先删除,再更新页面数据
|
||||
const isDel = await PPTApi.delSlide(deletedId)
|
||||
if (isDel) {
|
||||
// 后端删除成功,更新页面数据
|
||||
deleteSlidesIndex.push(index)
|
||||
slides.splice(index, 1)
|
||||
}
|
||||
|
||||
slides.splice(index, 1)
|
||||
}
|
||||
let newIndex = Math.min(...deleteSlidesIndex)
|
||||
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询entpcourse列表
|
||||
export function listEntpcourse(query) {
|
||||
return request({
|
||||
url: '/education/entpcourse/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询entpcourse详细
|
||||
export function getEntpcourse(id) {
|
||||
return request({
|
||||
url: '/education/entpcourse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增entpcourse
|
||||
export function addEntpcourse(data) {
|
||||
return request({
|
||||
url: '/education/entpcourse',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改entpcourse
|
||||
export function updateEntpcourse(data) {
|
||||
return request({
|
||||
url: '/education/entpcourse',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除entpcourse
|
||||
export function delEntpcourse(id) {
|
||||
return request({
|
||||
url: '/education/entpcourse/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function lpmChat(query) {
|
||||
return request({
|
||||
url: '/llm/chatToSD',
|
||||
method: 'POST',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -85,14 +85,6 @@ export function updateFileByArray(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
// zdg: 批量更新pptist - 新
|
||||
export function batchUpdateNew(data) {
|
||||
return request({
|
||||
url: '/education/entpcoursefile/batch/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改entpcoursefile
|
||||
export function updateFile2Redis(data) {
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch } from 'vue'
|
||||
import { completion } from '@/api/mode/index'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { conversation, completion } from '@/api/mode/index'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { dataSetJson } from '@/utils/comm.js'
|
||||
|
@ -58,7 +58,7 @@ const props = defineProps({
|
|||
return { name: '11' }
|
||||
}
|
||||
},
|
||||
type: {
|
||||
modeType: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ const send = () =>{
|
|||
msg: textarea.value
|
||||
})
|
||||
loaded.value = true
|
||||
getCompletion(textarea.value)
|
||||
getConversation(textarea.value)
|
||||
textarea.value = ''
|
||||
}
|
||||
const curNode = reactive({})
|
||||
|
@ -87,11 +87,16 @@ const params = reactive(
|
|||
dataset_id: ''
|
||||
}
|
||||
)
|
||||
// 获取会话ID
|
||||
const getConversation = (val) => {
|
||||
|
||||
getCompletion(val)
|
||||
}
|
||||
// 大模型对话
|
||||
const getCompletion = async (val) => {
|
||||
try {
|
||||
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||
|
||||
params.prompt = `根据${curNode.edustage}${curNode.edusubject}课标${props.item.name},${val}`
|
||||
const { data } = await completion(params)
|
||||
let answer = data.answer
|
||||
msgList.value.push({
|
||||
|
@ -112,26 +117,13 @@ const saveAdjust = (item) =>{
|
|||
|
||||
}
|
||||
|
||||
const modeType = ref('课标')
|
||||
watch(() => props.type, (newVal) => {
|
||||
if (newVal == 1){
|
||||
modeType.value = '课标'
|
||||
}
|
||||
if (newVal == 2){
|
||||
modeType.value = '教材'
|
||||
}
|
||||
if (newVal == 2){
|
||||
modeType.value = '考试'
|
||||
}
|
||||
|
||||
}, { immediate: false })
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
let data = sessionStore.get('subject.curNode')
|
||||
|
||||
|
||||
Object.assign(curNode, data);
|
||||
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
|
||||
let text = props.modeType == 1||props.modeType == 2 ? '课标' : '考试'
|
||||
let jsonKey = `${text}-${data.edustage}-${data.edusubject}`
|
||||
console.log(jsonKey)
|
||||
params.dataset_id = dataSetJson[jsonKey]
|
||||
|
||||
})
|
||||
|
|
|
@ -52,7 +52,7 @@ watch(() => props.item.answer, (newVal) => {
|
|||
|
||||
|
||||
const onSave = () =>{
|
||||
editTempResult({id: props.item.resultId, content: textarea.value}).then( res =>{
|
||||
editTempResult({id: props.item.reultId, content: textarea.value}).then( res =>{
|
||||
isDialog.value = false
|
||||
ElMessage.success('操作成功')
|
||||
emitter.emit('onGetChild', textarea.value)
|
||||
|
|
|
@ -33,11 +33,7 @@ const pdfUrl = ref('')
|
|||
onMounted(async () => {
|
||||
await nextTick()
|
||||
let data = sessionStore.get('subject.curBook')
|
||||
let fileurl = data.fileurl
|
||||
if(props.type == 1){
|
||||
fileurl = `${data.edustage}-${data.edusubject}-课标.txt`
|
||||
}
|
||||
pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf')
|
||||
pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + data.fileurl.replace('.txt', '.pdf')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<!--编辑结果-->
|
||||
<EditDialog v-model="isEdit" :item="editItem" />
|
||||
<!--AI 对话调整-->
|
||||
<AdjustDialog v-model="isAdjust" :type="type" :item="editItem" />
|
||||
<AdjustDialog v-model="isAdjust" :modeType="type" :item="editItem" />
|
||||
<!--添加、编辑提示词-->
|
||||
<keywordDialog v-model="isWordDialog" :isAdd="isAdd" :item="editItem" />
|
||||
</template>
|
||||
|
@ -84,7 +84,7 @@
|
|||
<script setup>
|
||||
import { ref, reactive, onMounted, watch, onUnmounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
|
||||
import { tempSave, completion, modelList, removeChildTemp, tempResult } from '@/api/mode/index'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import keywordDialog from './keyword-dialog.vue';
|
||||
import AdjustDialog from './adjust-dialog.vue'
|
||||
|
@ -155,13 +155,13 @@ const getChildTemplate = () => {
|
|||
|
||||
// 查询模板结果
|
||||
const getTempResult = () => {
|
||||
tempResult({ mainModelId: curTemplate.id, pageNum: 1, pageSize: 10000 }).then(res => {
|
||||
tempResult({ mainModelId: curTemplate.id }).then(res => {
|
||||
let rows = res.rows
|
||||
childTempList.value.forEach(item => {
|
||||
rows.forEach(el => {
|
||||
if (item.id == el.modelId) {
|
||||
item.answer = el.content
|
||||
item.resultId = el.id
|
||||
item.reultId = el.id
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -268,7 +268,7 @@ const againResult = async (index, item) => {
|
|||
let answer = data.answer
|
||||
childTempList.value[index].oldAnswer = answer
|
||||
childTempList.value[index].answer = getResult(answer);
|
||||
onEditSave(item)
|
||||
onSaveTemp(item)
|
||||
} finally {
|
||||
childTempList.value[index].loading = false
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ const getCompletion = async () => {
|
|||
for (let item of childTempList.value) {
|
||||
try {
|
||||
item.loading = true
|
||||
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||
const { data } = await completion(params)
|
||||
let answer = data.answer
|
||||
item.oldAnswer = answer
|
||||
|
@ -290,15 +290,6 @@ const getCompletion = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
// 保存 重新研读后的结果
|
||||
const onEditSave = async (item) =>{
|
||||
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
|
||||
ElMessage.success(res)
|
||||
getChildTemplate()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 保存模板
|
||||
const onSaveTemp = (item) => {
|
||||
const data = {
|
||||
|
|
|
@ -10,7 +10,7 @@ import _ from 'lodash'
|
|||
// import { diff } from 'jsondiffpatch'
|
||||
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
|
||||
|
||||
const exArrs = ['subject','env','curr'] // 不需要同步key-排除
|
||||
const exArrs = ['subject'] // 不需要同步key-排除
|
||||
|
||||
export function shareStorePlugin({store}) {
|
||||
store.$subscribe((mutation, state) => { // 自动同步
|
||||
|
|
|
@ -6,7 +6,7 @@ import { sessionStore } from '@/utils/store'
|
|||
|
||||
// 默认数据
|
||||
const defData = sessionStore.store || {}
|
||||
const exArrs = ['subject','env','curr']
|
||||
const exArrs = ['subject']
|
||||
exArrs.forEach(k => Object.keys(defData).includes(k) && (delete defData[k]))
|
||||
|
||||
// 延时
|
||||
|
|
|
@ -143,8 +143,7 @@ const getCompletion = async () => {
|
|||
for (let item of childTempList.value) {
|
||||
try {
|
||||
item.loading = true
|
||||
// params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
|
||||
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
||||
params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
|
||||
const { data } = await completion(params)
|
||||
let answer = data.answer
|
||||
item.oldAnswer = answer
|
||||
|
|
|
@ -24,21 +24,13 @@
|
|||
<div class="flex justify-between pb-2">
|
||||
<h3>教师资源</h3>
|
||||
<span class="c-btns">
|
||||
<template v-for="item in resourBtns">
|
||||
<el-button :size="item.size" text :icon="item.icon" @click="handleAll(item.prop)">{{ item.name }}</el-button>
|
||||
</template>
|
||||
<el-button size="small" text :icon="Refresh" @click="handleAll('refresh')">刷新</el-button>
|
||||
<el-button size="small" text :icon="Files" @click="handleAll('resource')">资源库</el-button>
|
||||
<el-button size="small" text :icon="UploadFilled" @click="handleAll('upload')">上传</el-button>
|
||||
<el-button size="small" text :icon="Plus" @click="handleAll('add')">添加</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<c-table ref="resourRef" v-bind="sourceOpt" t-class="rounded">
|
||||
<template #title="{row,value}">
|
||||
<el-link :underline="false" @click="handleAll('open', row)">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use :xlink:href="`#icon-${getIcon(row)}`"></use>
|
||||
</svg>
|
||||
<b class="ml-1">{{ value }}</b>
|
||||
</el-link>
|
||||
</template>
|
||||
</c-table>
|
||||
<c-table ref="resourRef" v-bind="sourceOpt" t-class="rounded"></c-table>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -48,16 +40,12 @@
|
|||
import { onMounted, ref, watch, reactive } from 'vue'
|
||||
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 * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
import { createWindow } from '@/utils/tool' // 相关工具
|
||||
import * as entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
// 组件引入
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore() // 用户信息
|
||||
|
||||
const courseObj = reactive({
|
||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||
|
@ -66,27 +54,19 @@ const courseObj = reactive({
|
|||
levelSecondId: '',
|
||||
coursetitle: '',
|
||||
node: null, // 选择的课程节点
|
||||
entp: null, // 当前课程
|
||||
})
|
||||
const dt = reactive({
|
||||
curRow: null, // 当前行数据
|
||||
})
|
||||
// ref定义
|
||||
const resourRef = ref() // 资源ref
|
||||
// 资源按钮配置
|
||||
const resourBtns = [
|
||||
{ name: '刷新', prop: 'refresh', size: 'small', icon: Refresh },
|
||||
{ name: '资源库', prop:'resource', size:'small', icon: Files },
|
||||
{ name: '上传', prop:'upload', size:'small', icon: UploadFilled },
|
||||
{ name: '添加', prop:'add', size:'small', icon: Plus },
|
||||
]
|
||||
// 资源相关配置-cTable
|
||||
const sourceOpt = reactive({
|
||||
data: [], // 数据
|
||||
option: [ // 列配置
|
||||
{ label: '名称', prop: 'title', align: 'left' },
|
||||
{ label: '类型', prop: 'filetype', width: 80, },
|
||||
{ label: '时间', prop: 'timestamp', width: 160, sortable: true },
|
||||
{ label: '类型', prop: 'type' },
|
||||
{ label: '时间', prop: 'createTime', width: 160, sortable: true },
|
||||
],
|
||||
noPage: true, // 不显示分页
|
||||
isMain: false, // 主界面
|
||||
|
@ -98,15 +78,15 @@ const sourceOpt = reactive({
|
|||
} else dt.curRow = r
|
||||
}
|
||||
})
|
||||
|
||||
// 页面加载
|
||||
onMounted(() => {
|
||||
})
|
||||
sourceOpt.data = [
|
||||
{ title: '测试学校' },
|
||||
{ title: '测试学校2' },
|
||||
{ title: '测试学校3' },
|
||||
]
|
||||
|
||||
// 相关方法-methods
|
||||
// 教材选中
|
||||
const changeBook = async(data) => {
|
||||
// console.log(data)
|
||||
const changeBook = (data) => {
|
||||
const { textBook, node } = data
|
||||
let textbookId = textBook.curBookId
|
||||
let levelSecondId = node.id
|
||||
|
@ -126,13 +106,6 @@ const changeBook = async(data) => {
|
|||
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId }))
|
||||
// 获取当前章节对应的课程信息
|
||||
const params = { evalid: node.id, edituserid: userStore.id, pageSize: 1 }
|
||||
const res = await HTTP_SERVER_API('getCourseList', params)
|
||||
courseObj.entp = res?.rows?.[0] || null
|
||||
sessionStore.set('curr.entp', courseObj.entp) // 缓存当前课程信息
|
||||
// 更新-资源列表
|
||||
getResourceList()
|
||||
}
|
||||
|
||||
const openPPTist = () => {
|
||||
|
@ -147,131 +120,21 @@ const onchange = (path) => {
|
|||
router.push(path)
|
||||
}
|
||||
}
|
||||
// 获取资源列表
|
||||
const getResourceList = async () => {
|
||||
const entpcourseidarray = courseObj?.entp?.id
|
||||
if (!entpcourseidarray) return msgUtils.msgWarning('请选择章节?')
|
||||
const params = {
|
||||
pageSize: 100, parentid: 0, entpcourseidarray,
|
||||
orderByColumn: 'timestamp', isAsc: 'desc',
|
||||
}
|
||||
const res = await HTTP_SERVER_API('getCourseFileList', params)
|
||||
if (res?.code == 200) {
|
||||
sourceOpt.data = res?.rows || []
|
||||
} else {
|
||||
msgUtils.msgWarning('获取资源列表, 请重试')
|
||||
}
|
||||
}
|
||||
// 统一HTTP处理
|
||||
const HTTP_SERVER_API = (type, params = {}) => {
|
||||
switch (type) {
|
||||
case 'addEntpcourse': { // 添加课程
|
||||
const node = courseObj.node || {}
|
||||
if (!node) return msgUtils.msgWarning('请选择章节?')
|
||||
const def = { // 默认参数
|
||||
entpid: userStore.user.deptId, // 部门id
|
||||
level: 1, // 层级
|
||||
parentid: 0, // 父级id
|
||||
dictid: 0, // 字典id
|
||||
evalid: node.id, // 章节id
|
||||
evalparentid: node.parentid, // 单元id(父级id)
|
||||
edusubject: node.edusubject, // 学科
|
||||
edudegree: node.edudegree, // 年级
|
||||
edustage: node.edustage, // 阶段
|
||||
coursetype: '课标学科', // 课程类型
|
||||
coursetitle: node.itemtitle, // 课程名称
|
||||
coursedesc: '', // 课程描述
|
||||
status: '', // 状态
|
||||
dflag: 0, // 状态
|
||||
edituserid: userStore.id, // 编辑人id
|
||||
createblankfile: 'no', // 创建空白文件
|
||||
}
|
||||
courseObj.entp = def
|
||||
return API_entpcourse.addEntpcourse(def)
|
||||
}
|
||||
case 'addEntpcoursefile': { // 添加课程文件
|
||||
const enpt = courseObj.entp
|
||||
const def = {
|
||||
parentid: 0,
|
||||
entpid: userStore.user.deptId,
|
||||
entpcourseid: enpt.id,
|
||||
ppttype: 'file',
|
||||
title: enpt.coursetitle,
|
||||
fileurl: '',
|
||||
filetype: 'aptist',
|
||||
datacontent: '',
|
||||
filekey: '',
|
||||
filetag: '',
|
||||
fileidx: 0,
|
||||
dflag: 0,
|
||||
status: '',
|
||||
edituserid: userStore.id
|
||||
}
|
||||
// return Promise.resolve(1)
|
||||
return API_entpcoursefile.addEntpcoursefileReturnId({...def,...params})
|
||||
}
|
||||
case 'getCourseList': { // 获取课程列表
|
||||
return API_entpcourse.listEntpcourse(params)
|
||||
}
|
||||
case 'getCourseFileList':{ // 获取课程文件列表
|
||||
return API_entpcoursefile.listEntpcoursefileNew(params)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 事件回调
|
||||
const handleAll = async(type, row) =>{
|
||||
const handleAll = (type) =>{
|
||||
console.log(type)
|
||||
switch (type) {
|
||||
case 'refresh': // 刷新
|
||||
getResourceList()
|
||||
break;
|
||||
case 'resource': // 资源库
|
||||
break;
|
||||
case 'upload': // 上传
|
||||
break;
|
||||
case 'add':{ // 添加PPT-list - 课程文件
|
||||
const enpt = courseObj.entp // 获取课程信息
|
||||
if (!enpt) { // 如果没有,就新增课程
|
||||
const resid = await HTTP_SERVER_API('addEntpcourse')
|
||||
courseObj.entp.id = resid
|
||||
}
|
||||
// 生成ppt课件-父级
|
||||
const p_params = {parentContent: '{"width":1000,"ratio":0.5625}'}
|
||||
const id = await HTTP_SERVER_API('addEntpcoursefile', p_params)
|
||||
if (!!id??null) { // 生成第一个幻灯片
|
||||
const params = {
|
||||
parentid: id,
|
||||
title: '第一页',
|
||||
filetype: 'slide',
|
||||
datacontent: '{"elements":[],"background":{"type":"solid","color":"#fff"}}' // json内容
|
||||
}
|
||||
// 生成ppt课件-子级(slide)
|
||||
await HTTP_SERVER_API('addEntpcoursefile', params)
|
||||
// 刷新资源列表
|
||||
await getResourceList()
|
||||
} else {
|
||||
msgUtils.msgWarning('添加失败!')
|
||||
}
|
||||
case 'add':{ // 添加
|
||||
break;
|
||||
}
|
||||
case 'open': { // 打开资源-pptist
|
||||
// console.log(row)
|
||||
if (row.filetype != 'aptist') return msgUtils.msgWarning('暂不支持该类型文件!')
|
||||
sessionStore.set('curr.resource', row) // 缓存当前资源信息
|
||||
const query = { id: row.id }
|
||||
const queryUrl = new URLSearchParams(query).toString()
|
||||
console.log('打开资源 ', queryUrl)
|
||||
createWindow('open-win', { url: `/pptist?${queryUrl}` })
|
||||
}
|
||||
}
|
||||
}
|
||||
// icons 处理
|
||||
const getIcon = o => {
|
||||
let icon = o.filetype
|
||||
if (['aptist','PPTX','pptList'].includes(o.filetype)) icon = 'pptx'
|
||||
return icon
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -281,8 +281,6 @@ onMounted(() => {
|
|||
// emit('addSuccess',res)
|
||||
// })
|
||||
// connectWebSocket("");
|
||||
let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFilea2e0342f406e4f89b7524bf421d3fef26331634651754729404/%E9%AB%98%E4%B8%AD%E8%AF%AD%E6%96%87%E3%80%8A%E6%B2%81%E5%9B%AD%E6%98%A5%C2%B7%E9%9B%AA%E3%80%8B%E6%8E%88%E8%AF%BE%E8%A7%A3%E6%9E%90.pptx";
|
||||
emit('addSuccess',{url})
|
||||
props.dataList.filter(item => {
|
||||
inputRequire.value += item.answer
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue