Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into baigl
This commit is contained in:
commit
cb1c3c23fe
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
@ -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) => {
|
||||
return request({
|
||||
url: '/smarttalk/file/' + id,
|
||||
|
|
|
@ -230,6 +230,10 @@ export default {
|
|||
}
|
||||
},
|
||||
openFileWin(items) {
|
||||
if (items.fileFlag === 'apt') {
|
||||
console.log(items);
|
||||
return
|
||||
}
|
||||
if (!items||!items.fileSuffix) return;
|
||||
getPrepareById(items.id).then((item) => {
|
||||
Object.assign(items, item)
|
||||
|
|
|
@ -20,11 +20,14 @@
|
|||
</div>
|
||||
<el-button
|
||||
:type="!curClassReserv.id ? 'info' : 'primary'"
|
||||
:disabled="!curClassReserv.id||toolStore.isToolWin"
|
||||
:disabled="!curClassReserv.id || toolStore.isToolWin"
|
||||
class="to-class-btn"
|
||||
@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.startTime }}-{{ curClassReserv.endTime }}</label>
|
||||
</el-button>
|
||||
|
@ -60,9 +63,21 @@
|
|||
<el-button @click="handleOutLink('feedback')">作业反馈</el-button>
|
||||
<el-button @click="handleOutLink('homeWork')">布置作业</el-button>
|
||||
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="createFile"
|
||||
>新建课件</el-button
|
||||
>
|
||||
<el-dropdown trigger="click" style="margin-left: 12px">
|
||||
<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>
|
||||
<el-checkbox-group
|
||||
|
@ -92,7 +107,6 @@
|
|||
@on-delete="deleteTalk"
|
||||
@on-set="openSet"
|
||||
@on-delhomework="delhomework"
|
||||
|
||||
>
|
||||
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
|
||||
</file-list-item>
|
||||
|
@ -110,11 +124,7 @@
|
|||
</div>
|
||||
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
|
||||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||
<SetHomework
|
||||
v-model="setDialog"
|
||||
:entpcourseid="entpcourseid"
|
||||
:row="row"
|
||||
/>
|
||||
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" />
|
||||
</div>
|
||||
<reserv
|
||||
ref="reservDialog"
|
||||
|
@ -127,6 +137,7 @@
|
|||
<script setup>
|
||||
import { Check } from '@element-plus/icons-vue'
|
||||
import Reserv from '@/views/prepare/container/reserv.vue'
|
||||
import { ArrowDown } from '@element-plus/icons-vue'
|
||||
</script>
|
||||
<script>
|
||||
const Remote = require('@electron/remote')
|
||||
|
@ -138,18 +149,20 @@ import useUserStore from '@/store/modules/user'
|
|||
import { useToolState } from '@/store/modules/tool'
|
||||
import MoveFile from '@/components/move-file/index.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 { ElMessage } from 'element-plus'
|
||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||
import SetHomework from '@/components/set-homework/index.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import { createWindow, ipcMsgSend, sessionStore } from '@/utils/tool'
|
||||
import { createWindow, sessionStore } from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { delClasswork } from '@/api/teaching/classwork'
|
||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
||||
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
|
||||
import { getSelfReserv } from '@/api/classManage'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile'
|
||||
|
||||
const toolStore = useToolState()
|
||||
|
||||
const fs = require('fs')
|
||||
|
@ -220,8 +233,6 @@ export default {
|
|||
this.initReserv()
|
||||
},
|
||||
mounted() {
|
||||
window.test = sessionStore
|
||||
window.test1 = toolStore
|
||||
this.$watch(
|
||||
() => toolStore.isToolWin,
|
||||
(newD, oldD) => {
|
||||
|
@ -230,14 +241,12 @@ export default {
|
|||
)
|
||||
// electron 当前窗口
|
||||
const curWin = Remote.getCurrentWindow()
|
||||
curWin.on('focus', ()=>{
|
||||
if(!this.isOpenHomework) return
|
||||
curWin.on('focus', () => {
|
||||
if (!this.isOpenHomework) return
|
||||
this.initHomeWork()
|
||||
this.asyncAllFile()
|
||||
this.isOpenHomework = false
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
// activated() {
|
||||
// if (this.uploadData.textbookId !== null) {
|
||||
|
@ -301,6 +310,90 @@ export default {
|
|||
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) {
|
||||
this.moveFile = [item]
|
||||
this.isMoveDialogOpen = true
|
||||
|
@ -404,6 +497,7 @@ export default {
|
|||
this.asyncAllFileVisiable = true
|
||||
for (let i = 0; i < this.currentFileList.length; i++) {
|
||||
let item = this.currentFileList[i]
|
||||
if (item.fileFlag === 'apt') continue;
|
||||
await asyncLocalFile(item)
|
||||
}
|
||||
this.asyncAllFileVisiable = false
|
||||
|
@ -428,7 +522,9 @@ export default {
|
|||
this.uploadData.textbookId = data.textBook.curBookId
|
||||
toolStore.curSubjectNode.data = data
|
||||
// 不要同时修改共享数据,这样只会触发一次
|
||||
this.$nextTick(() =>{ toolStore.curSubjectNode.querySearch = this.uploadData })
|
||||
this.$nextTick(() => {
|
||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||
})
|
||||
this.initHomeWork()
|
||||
await this.asyncAllFile()
|
||||
},
|
||||
|
@ -443,19 +539,20 @@ export default {
|
|||
},
|
||||
// 打开外部链接
|
||||
handleOutLink(key) {
|
||||
if(key == 'homeWork'){
|
||||
if (key == 'homeWork') {
|
||||
this.isOpenHomework = true
|
||||
}
|
||||
// key 对应的 linkConfig.js 外部链接配置
|
||||
let configObj = outLink()[key]
|
||||
let fullPath = configObj.fullPath
|
||||
//打开作业 高考 url增加unitId 章节ID
|
||||
if(key != 'standard' && key != 'aiModel'){
|
||||
let unitId = this.uploadData.levelSecondId ? this.uploadData.levelSecondId : this.uploadData.levelFirstId
|
||||
if(key == 'gk'){
|
||||
if (key != 'standard' && key != 'aiModel') {
|
||||
let unitId = this.uploadData.levelSecondId
|
||||
? this.uploadData.levelSecondId
|
||||
: this.uploadData.levelFirstId
|
||||
if (key == 'gk') {
|
||||
fullPath += `?unitId=${unitId}`
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
fullPath += `&unitId=${unitId}`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue