Merge pull request 'zhuhao_dev' (#181) from zhuhao_dev into main

Reviewed-on: #181
This commit is contained in:
朱浩 2024-09-10 14:03:35 +08:00
commit a2c962e94d
4 changed files with 299 additions and 28 deletions

View File

@ -0,0 +1,162 @@
import request from '@/utils/request'
// 查询entpcoursefile列表
export function listEntpcoursefile(query) {
return request({
url: '/education/entpcoursefile/list',
method: 'get',
params: query
})
}
// zdg:查询entpcoursefile列表-新
export function listEntpcoursefileNew(query) {
return request({
url: '/education/entpcoursefile/new/list',
method: 'get',
params: query
})
}
// 查询entpcoursefile详细
export function getEntpcoursefile(id) {
return request({
url: '/education/entpcoursefile/' + id,
method: 'get'
})
}
// 新增entpcoursefile
export function addEntpcoursefile(data) {
return request({
url: '/education/entpcoursefile',
method: 'post',
data: data
})
}
// 新增entpcoursefile
export function addEntpcoursefileReturnId(data) {
return request({
url: '/education/entpcoursefile/addReturnId',
method: 'post',
data: data
})
}
// addFromId
export function addFromId(fromid, toid, entpid, entpcourseid, edituserid) {
return request({
url: '/education/entpcoursefile/addFromId/'+fromid+'/'+toid+'/'+entpid+'/'+entpcourseid+'/'+edituserid,
method: 'post'
})
}
// 修改entpcoursefile
export function updateEntpcoursefile(data) {
return request({
url: '/education/entpcoursefile',
method: 'put',
data: data
})
}
// 新增 修改接口
export function updateEntpcoursefileNew(data) {
return request({
url: '/education/entpcoursefile/newUpdateFile',
method: 'post',
data: data
})
}
// updateFileByIds
export function updateFileByIds(data) {
return request({
url: '/education/entpcoursefile/updateFileByIds',
method: 'post',
data: data
})
}
// updateFileByArray
export function updateFileByArray(data) {
return request({
url: '/education/entpcoursefile/updateFileByArray',
method: 'post',
data: data
})
}
// 修改entpcoursefile
export function updateFile2Redis(data) {
return request({
url: '/education/entpcoursefile/updateFile2Redis',
method: 'post',
data: data
})
}
// 删除entpcoursefile
export function delEntpcoursefile(id) {
return request({
url: '/education/entpcoursefile/' + id,
method: 'delete'
})
}
// 保存base64图片返回url
export function saveEntpCourseBase64File(data) {
return request({
url: '/education/entpcoursefile/saveBase64File',
method: 'post',
data: data
})
}
// 文件上传
export function saveEntpCourseBase64File2(data) {
return request({
url: '/education/entpcoursefile/saveBase64File2',
method: 'post',
data: data
})
}
// 保存PPT页面预览base64图片返回url
export function savePPTPreviewBase64File(data) {
return request({
url: '/education/entpcoursefile/savePreviewBase64',
method: 'post',
data: data
})
}
// PPT文件上传
export function saveEntpCoursePPT(data) {
return request({
url: '/education/entpcoursefile/importPPT',
method: 'post',
data: data
})
}
// PPT文件解析
export function parsePPT(data) {
return request({
url: '/education/entpcoursefile/parsePPT',
method: 'post',
data: data
})
}
// 修改ppt.slide.index
export function updateSlideIndex(data) {
return request({
url: '/education/entpcoursefile/saveSlideOrder',
method: 'post',
data: data
})
}

View File

@ -9,6 +9,14 @@ export const getSmarttalkPage = (params) => {
}) })
} }
export const creatAPT = (params) => {
return request({
url: '/smarttalk/file/createApt',
method: 'post',
params
})
}
export const getPrepareById = (id) => { export const getPrepareById = (id) => {
return request({ return request({
url: '/smarttalk/file/' + id, url: '/smarttalk/file/' + id,

View File

@ -230,6 +230,10 @@ export default {
} }
}, },
openFileWin(items) { openFileWin(items) {
if (items.fileFlag === 'apt') {
console.log(items);
return
}
if (!items||!items.fileSuffix) return; if (!items||!items.fileSuffix) return;
getPrepareById(items.id).then((item) => { getPrepareById(items.id).then((item) => {
Object.assign(items, item) Object.assign(items, item)

View File

@ -20,11 +20,14 @@
</div> </div>
<el-button <el-button
:type="!curClassReserv.id ? 'info' : 'primary'" :type="!curClassReserv.id ? 'info' : 'primary'"
:disabled="!curClassReserv.id||toolStore.isToolWin" :disabled="!curClassReserv.id || toolStore.isToolWin"
class="to-class-btn" class="to-class-btn"
@click="openLesson" @click="openLesson"
> >
<label><i class="iconfont icon-lingdang"></i>{{curClassReserv.status=='上课中'?'上课中':'上课'}}</label> <label
><i class="iconfont icon-lingdang"></i
>{{ curClassReserv.status == '上课中' ? '上课中' : '上课' }}</label
>
<label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label> <label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label>
<label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label> <label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label>
</el-button> </el-button>
@ -60,9 +63,21 @@
<el-button @click="handleOutLink('feedback')">作业反馈</el-button> <el-button @click="handleOutLink('feedback')">作业反馈</el-button>
<el-button @click="handleOutLink('homeWork')">布置作业</el-button> <el-button @click="handleOutLink('homeWork')">布置作业</el-button>
<el-button @click="isDialogOpen = true">上传资料</el-button> <el-button @click="isDialogOpen = true">上传资料</el-button>
<el-button type="primary" style="margin-left: 10px" @click="createFile" <el-dropdown trigger="click" style="margin-left: 12px">
>新建课件</el-button <el-button type="primary">
> 新建课件<el-icon class="el-icon--right"><arrow-down /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item style="padding: 0">
<el-button type="default" style="" @click="createFile">PPT课件</el-button>
</el-dropdown-item>
<el-dropdown-item style="padding: 0">
<el-button type="default" style="" @click="createAptFile">APT课件</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div> </div>
</div> </div>
<el-checkbox-group <el-checkbox-group
@ -92,7 +107,6 @@
@on-delete="deleteTalk" @on-delete="deleteTalk"
@on-set="openSet" @on-set="openSet"
@on-delhomework="delhomework" @on-delhomework="delhomework"
> >
<el-checkbox v-if="!item.uniquekey" label="" :value="item" /> <el-checkbox v-if="!item.uniquekey" label="" :value="item" />
</file-list-item> </file-list-item>
@ -110,11 +124,7 @@
</div> </div>
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" /> <MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" /> <uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
<SetHomework <SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" />
v-model="setDialog"
:entpcourseid="entpcourseid"
:row="row"
/>
</div> </div>
<reserv <reserv
ref="reservDialog" ref="reservDialog"
@ -127,6 +137,7 @@
<script setup> <script setup>
import { Check } from '@element-plus/icons-vue' import { Check } from '@element-plus/icons-vue'
import Reserv from '@/views/prepare/container/reserv.vue' import Reserv from '@/views/prepare/container/reserv.vue'
import { ArrowDown } from '@element-plus/icons-vue'
</script> </script>
<script> <script>
const Remote = require('@electron/remote') const Remote = require('@electron/remote')
@ -138,18 +149,20 @@ import useUserStore from '@/store/modules/user'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'
import MoveFile from '@/components/move-file/index.vue' import MoveFile from '@/components/move-file/index.vue'
import FileListItem from '@/views/prepare/container/file-list-item.vue' import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { getSmarttalkPage, moveSmarttalk } from '@/api/file' import { getSmarttalkPage, moveSmarttalk, creatAPT } from '@/api/file'
import { toTimeText } from '@/utils/date' import { toTimeText } from '@/utils/date'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile' import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue' import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
import SetHomework from '@/components/set-homework/index.vue' import SetHomework from '@/components/set-homework/index.vue'
import outLink from '@/utils/linkConfig' import outLink from '@/utils/linkConfig'
import { createWindow, ipcMsgSend, sessionStore } from '@/utils/tool' import { createWindow, sessionStore } from '@/utils/tool'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
import { delClasswork } from '@/api/teaching/classwork' import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
import { getSelfReserv, startClass } from '@/api/classManage' import { getSelfReserv } from '@/api/classManage'
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile'
const toolStore = useToolState() const toolStore = useToolState()
const fs = require('fs') const fs = require('fs')
@ -220,8 +233,6 @@ export default {
this.initReserv() this.initReserv()
}, },
mounted() { mounted() {
window.test = sessionStore
window.test1 = toolStore
this.$watch( this.$watch(
() => toolStore.isToolWin, () => toolStore.isToolWin,
(newD, oldD) => { (newD, oldD) => {
@ -230,14 +241,12 @@ export default {
) )
// electron // electron
const curWin = Remote.getCurrentWindow() const curWin = Remote.getCurrentWindow()
curWin.on('focus', ()=>{ curWin.on('focus', () => {
if(!this.isOpenHomework) return if (!this.isOpenHomework) return
this.initHomeWork() this.initHomeWork()
this.asyncAllFile() this.asyncAllFile()
this.isOpenHomework = false this.isOpenHomework = false
}) })
}, },
// activated() { // activated() {
// if (this.uploadData.textbookId !== null) { // if (this.uploadData.textbookId !== null) {
@ -301,6 +310,90 @@ export default {
this.currentFileList.unshift(res.resData) this.currentFileList.unshift(res.resData)
}) })
}, },
createAptFile() {
listEntpcourse({
evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId,
pageSize: 500
}).then((response) => {
if (response.rows.length <= 0) return
let resCourse = response.rows[0]
//
let form = {
parentid: 0,
entpid: this.userStore.deptId,
entpcourseid: resCourse.id,
ppttype: 'file',
title: resCourse.coursetitle,
fileurl: '',
filetype: 'ppt',
datacontent: '',
filekey: '',
filetag: '',
fileidx: 0,
dflag: 0,
status: '',
edituserid: this.userStore.userId
}
addEntpcoursefileReturnId(form).then((slideid) => {
let pagearray = []
//
pagearray.push({
key: '公屏',
title: '公屏页',
slidedata: {
attrs: { width: 1333, height: 749.8125 },
className: 'Stage',
children: [
{
attrs: {},
className: 'Layer',
children: [
{
attrs: {
width: 1333,
height: 749.8125,
fill: 'white',
name: 'fixedbackground',
listening: true
},
className: 'Rect'
}
]
}
]
}
})
//
var form = {
parentid: slideid,
entpid: resCourse.entpid,
entpcourseid: resCourse.id,
ppttype: 'file',
title: '第一页',
fileurl: '',
filetype: 'slide',
datacontent: JSON.stringify(pagearray),
filekey: '',
filetag: '',
fileidx: 0,
dflag: 0,
status: '',
edituserid: this.userStore.userId
}
addEntpcoursefileReturnId(form).then((res) => {
creatAPT({
...this.uploadData,
fileId: res,
fileShowName: this.currentNode.label + '.apt'
}).then((res) => {
this.currentFileList.unshift(res.resData)
})
})
})
})
},
onMoveSingleFile(item) { onMoveSingleFile(item) {
this.moveFile = [item] this.moveFile = [item]
this.isMoveDialogOpen = true this.isMoveDialogOpen = true
@ -404,6 +497,7 @@ export default {
this.asyncAllFileVisiable = true this.asyncAllFileVisiable = true
for (let i = 0; i < this.currentFileList.length; i++) { for (let i = 0; i < this.currentFileList.length; i++) {
let item = this.currentFileList[i] let item = this.currentFileList[i]
if (item.fileFlag === 'apt') continue;
await asyncLocalFile(item) await asyncLocalFile(item)
} }
this.asyncAllFileVisiable = false this.asyncAllFileVisiable = false
@ -428,7 +522,9 @@ export default {
this.uploadData.textbookId = data.textBook.curBookId this.uploadData.textbookId = data.textBook.curBookId
toolStore.curSubjectNode.data = data toolStore.curSubjectNode.data = data
// //
this.$nextTick(() =>{ toolStore.curSubjectNode.querySearch = this.uploadData }) this.$nextTick(() => {
toolStore.curSubjectNode.querySearch = this.uploadData
})
this.initHomeWork() this.initHomeWork()
await this.asyncAllFile() await this.asyncAllFile()
}, },
@ -443,19 +539,20 @@ export default {
}, },
// //
handleOutLink(key) { handleOutLink(key) {
if(key == 'homeWork'){ if (key == 'homeWork') {
this.isOpenHomework = true this.isOpenHomework = true
} }
// key linkConfig.js // key linkConfig.js
let configObj = outLink()[key] let configObj = outLink()[key]
let fullPath = configObj.fullPath let fullPath = configObj.fullPath
// urlunitId ID // urlunitId ID
if(key != 'standard' && key != 'aiModel'){ if (key != 'standard' && key != 'aiModel') {
let unitId = this.uploadData.levelSecondId ? this.uploadData.levelSecondId : this.uploadData.levelFirstId let unitId = this.uploadData.levelSecondId
if(key == 'gk'){ ? this.uploadData.levelSecondId
: this.uploadData.levelFirstId
if (key == 'gk') {
fullPath += `?unitId=${unitId}` fullPath += `?unitId=${unitId}`
} } else {
else{
fullPath += `&unitId=${unitId}` fullPath += `&unitId=${unitId}`
} }
} }