zdg #144
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "aix-win",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.7",
|
||||
"description": "An Electron application with Vue",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
|
|
@ -250,7 +250,9 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
|||
onDownloadStarted: async ({ id, item, webContents }) => {
|
||||
// Do something with the download id
|
||||
},
|
||||
onDownloadProgress: async ({ id, item, percentCompleted }) => {},
|
||||
onDownloadProgress: async ({ id, item, percentCompleted }) => {
|
||||
e.reply('download-file-default-prog' + fileName, percentCompleted)
|
||||
},
|
||||
onDownloadCompleted: async ({ id, item }) => {
|
||||
console.log('完成')
|
||||
e.reply('download-file-default' + fileName, true)
|
||||
|
|
|
@ -42,6 +42,11 @@ const updateInit = (win) => {
|
|||
logger.error('检查更新失败')
|
||||
})
|
||||
|
||||
// 监听下载进度
|
||||
autoUpdater.on('download-progress', (progressObj) => {
|
||||
win.webContents.send('update-app-progress', progressObj.percent);
|
||||
});
|
||||
|
||||
// 跟新下载完毕
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
dialog
|
||||
|
|
|
@ -130,3 +130,46 @@ export function addStudentmainByNameArray(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
//新增课程预约
|
||||
export function addSmartClassReserv(data) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/addSmartClassReserv',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//修改课程预约
|
||||
export function updateSmartClassReserv(data) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/updateSmartClassReserv',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//查询课程预约
|
||||
export function getSelfReserv() {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/getSelfReserv',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function deleteSmartReserv(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function startClass(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/startClass',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
export function endClass(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/endClass',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2794390 */
|
||||
src: url('iconfont.woff2?t=1723186593107') format('woff2'),
|
||||
url('iconfont.woff?t=1723186593107') format('woff'),
|
||||
url('iconfont.ttf?t=1723186593107') format('truetype'),
|
||||
url('iconfont.svg?t=1723186593107#iconfont') format('svg');
|
||||
src: url('iconfont.woff2?t=1723452423265') format('woff2'),
|
||||
url('iconfont.woff?t=1723452423265') format('woff'),
|
||||
url('iconfont.ttf?t=1723452423265') format('truetype'),
|
||||
url('iconfont.svg?t=1723452423265#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -14,6 +14,10 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-zanwushuju:before {
|
||||
content: "\e655";
|
||||
}
|
||||
|
||||
.icon-xiangzuo:before {
|
||||
content: "\e64d";
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,13 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "9689424",
|
||||
"name": "暂无数据",
|
||||
"font_class": "zanwushuju",
|
||||
"unicode": "e655",
|
||||
"unicode_decimal": 58965
|
||||
},
|
||||
{
|
||||
"icon_id": "6176588",
|
||||
"name": "向左",
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="zanwushuju" unicode="" d="M876.202667 543.445333H147.882667L0 282.752V-42.666667h1024v325.376l-147.797333 260.736z m-234.112-263.637333c0-70.485333-58.197333-127.658667-130.090667-127.658667-71.893333 0-130.133333 57.173333-130.133333 127.658667H61.098667L179.541333 501.76H844.373333l118.442667-221.952H642.133333zM500.138667 810.666667h44.629333v-157.610667h-44.629333V810.666667zM197.290667 732.416l31.573333 31.018667L342.272 651.946667l-31.573333-31.018667-113.493334 111.445333z m491.52-80.512l113.493333 111.445333 31.573333-30.976-113.493333-111.445333-31.573333 30.976z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="xiangzuo" unicode="" d="M774.89 725L399.08 380.75l375.81-344.21a39.28 39.28 0 0 0 13.11-29c0-36.51-48.19-54.79-76.38-29L335.8 322.8c-34.94 32-34.94 83.9 0 115.9l375.82 344.22c28.19 25.81 76.38 7.53 76.38-29A39.3 39.3 0 0 0 774.89 725z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="kechengziyuan1" unicode="" d="M530.299631 315.712191a54.537462 54.537462 0 0 0-34.299976 12.187492L19.862486 563.299519l-3.749997 3.749997a55.187462 55.187462 0 0 0 0 77.949946l3.749997 3.749998L495.687155 883.836796A54.537462 54.537462 0 0 0 530.299631 895.999288a54.562462 54.562462 0 0 0 34.299976-12.162492l476.137169-235.424836 3.749997-3.749998a55.199962 55.199962 0 0 0 0-77.949945l-3.749997-3.749998-476.137169-235.399836a54.562462 54.562462 0 0 0-34.299976-11.849992z m-455.874683 289.999798l455.874683-225.449843 455.874683 225.437343-455.874683 225.749843z m0 0M530.299631 94.012346a54.574962 54.574962 0 0 0-34.299976 12.162491L24.537483 339.149675a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-234.849836 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.174978 31.174978 0 0 0 27.749981-55.812461L564.599607 105.862337a54.562462 54.562462 0 0 0-34.299976-11.849991z m0 0M530.299631-128a54.862462 54.862462 0 0 0-34.299976 12.149992L24.537483 116.46233a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-233.862337 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.724978 31.724978 0 1 0 27.749981-57.06246L564.599607-115.850008a55.199962 55.199962 0 0 0-34.299976-12.149992z m0 0" horiz-adv-x="1060" />
|
||||
|
|
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 263 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -42,7 +42,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||
import { onMounted, ref, nextTick, toRaw, reactive,watch } from 'vue';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
|
@ -102,21 +102,11 @@ const getSubjectContent = async () => {
|
|||
}
|
||||
|
||||
let data;
|
||||
if (localStorage.getItem('evaluationList')) {
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
data = evaluationList.value
|
||||
treeLoading.value = false
|
||||
}
|
||||
else {
|
||||
try {
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
} finally {
|
||||
treeLoading.value = false
|
||||
}
|
||||
}
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
treeLoading.value = false
|
||||
|
||||
//获取教材版本
|
||||
await getSubject()
|
||||
|
@ -266,14 +256,10 @@ const transData = (data) => {
|
|||
|
||||
//获取教材
|
||||
const getSubject = async () => {
|
||||
if (localStorage.getItem('subjectList')) {
|
||||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id))
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||
}
|
||||
|
||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||
|
||||
// 默认第一个
|
||||
if(!subjectList.value.length) return
|
||||
|
@ -284,11 +270,11 @@ const getSubject = async () => {
|
|||
}
|
||||
|
||||
|
||||
const isHaveUnit = (id) => {
|
||||
return evaluationList.value.some(item => {
|
||||
return item.rootid == id
|
||||
})
|
||||
}
|
||||
// const isHaveUnit = (id) => {
|
||||
// return evaluationList.value.some(item => {
|
||||
// return item.rootid == id
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
const handleNodeClick = (data, node) => {
|
||||
|
@ -319,7 +305,9 @@ const handleNodeClick = (data, node) => {
|
|||
currentNode.data = curData
|
||||
emit('nodeClick', curData)
|
||||
}
|
||||
|
||||
watch(() => userStore.edusubject, () => {
|
||||
console.log(userStore.edusubject,'userStore.edusubject')
|
||||
})
|
||||
onMounted(() => {
|
||||
getSubjectContent()
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, defineProps, onMounted, defineEmits } from 'vue';
|
||||
import { ref, watch, onMounted, defineEmits } from 'vue';
|
||||
const placeholder = ref('')
|
||||
|
||||
const props = defineProps({
|
||||
|
|
|
@ -118,18 +118,11 @@ const getSubjectContent = async () => {
|
|||
entpcourseedituserid: userId,
|
||||
pageSize: 500
|
||||
}
|
||||
|
||||
let data;
|
||||
if (localStorage.getItem('evaluationList')) {
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
data = evaluationList.value
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
}
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
|
||||
//获取教材版本
|
||||
getSubject()
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
pdfAdnFabric<template>
|
||||
<div class="canvasitem">
|
||||
<div class="pdfAdnFabric" id="pdfAdnFabric" >
|
||||
<!-- @touchmove="handleTouchMove"
|
||||
@touchend="handleTouchEnd"
|
||||
@mousedown="handleMouseDown"
|
||||
@mousemove="handleMouseMove"
|
||||
@mouseup="handleMouseUp" -->
|
||||
<div :class="ispointer ? 'ispointer' : ''">
|
||||
<canvas ref="fabriccanvas" />
|
||||
</div>
|
||||
<!-- style="pointer-events: none;" -->
|
||||
<div v-if="props.pdfObj.numberOfPdf === 2" :class="ispointer ? 'ispointer' : ''">
|
||||
<canvas ref="fabriccanvas1" />
|
||||
</div>
|
||||
|
@ -80,7 +74,10 @@ const renderPage = async (canvasobj) => {
|
|||
viewport: viewport
|
||||
}
|
||||
// console.log(renderContext,22222222222222222222)
|
||||
|
||||
// const textContent = await page.getTextContent();
|
||||
// console.log(textContent);
|
||||
// const annotations = await page.getAnnotations();
|
||||
// console.log(annotations);
|
||||
page.render(renderContext).promise.then((res) => {
|
||||
const img = document.createElement('img')
|
||||
img.src = canvasobj.canvas.toDataURL('image/png')
|
||||
|
@ -106,22 +103,12 @@ const renderPage = async (canvasobj) => {
|
|||
}
|
||||
img.remove()
|
||||
}
|
||||
// 判断imgarr的JSONdata在canvsStore.pageArr有没有
|
||||
// canvsStore.pageArr.forEach((item) => {
|
||||
// if (item.page == canvasobj.page) {
|
||||
// imgarr.value.forEach((img) => {
|
||||
// if (img.page == canvasobj.page) {
|
||||
// img.JSONdata = item.JSONdata
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
})
|
||||
}
|
||||
// 保存数据
|
||||
const savaDataStore = () => {
|
||||
if(!toolState.isToolWin){
|
||||
toolState.isPdfWin=false
|
||||
toolState.isPdfWin=false
|
||||
toolState.showBoardAll=true //恢复默认值
|
||||
ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
||||
ipcRenderer.send('open-PDF:minimize')
|
||||
|
@ -393,8 +380,18 @@ defineExpose({
|
|||
savaDataStore
|
||||
})
|
||||
watchEffect(() => {
|
||||
console.log(toolState.model,'监听')
|
||||
watchToolState() //监听工具栏
|
||||
setTimeout(() => {
|
||||
console.log(toolState,'监听')
|
||||
|
||||
}, 300)
|
||||
if(toolState.isPdfWin){
|
||||
// if(toolState.isToolWin){
|
||||
// ispointer.value=false
|
||||
// }else{
|
||||
// ispointer.value=true
|
||||
// }
|
||||
watchToolState() //监听工具栏
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -73,11 +73,6 @@ const renderPage = async (canvasobj) => {
|
|||
canvasContext: canvasobj.context,
|
||||
viewport: viewport
|
||||
}
|
||||
// console.log(renderContext,22222222222222222222)
|
||||
// const textContent = await page.getTextContent();
|
||||
// console.log(textContent);
|
||||
// const annotations = await page.getAnnotations();
|
||||
// console.log(annotations);
|
||||
page.render(renderContext).promise.then((res) => {
|
||||
const img = document.createElement('img')
|
||||
img.src = canvasobj.canvas.toDataURL('image/png')
|
||||
|
@ -90,7 +85,6 @@ const renderPage = async (canvasobj) => {
|
|||
if (canvasobj.index == 0) {
|
||||
canvasFabricVue.value.canvas.setWidth(screenWidth)
|
||||
canvasFabricVue.value.canvas.setHeight(screenHeight)
|
||||
// updateCanvasBackgroundImage(canvasFabricVue,img)
|
||||
displayData(canvasFabricVue, canvsStore, canvasobj, fabric, img)
|
||||
} else {
|
||||
canvas1FabricVue.value.canvas.setWidth(screenWidth)
|
||||
|
@ -198,10 +192,7 @@ const initPdf = async (type = 'default') => {
|
|||
})
|
||||
}
|
||||
// 保存数据
|
||||
// savecanvsStore(imgarr, canvsStore)
|
||||
|
||||
if (props.pdfObj.numberOfPdf == 1) {
|
||||
// imgarr.value[0]
|
||||
canvasFabricVue.value.history.clean()
|
||||
} else {
|
||||
canvasFabricVue.value.history.clean()
|
||||
|
@ -380,14 +371,16 @@ defineExpose({
|
|||
savaDataStore
|
||||
})
|
||||
watchEffect(() => {
|
||||
console.log(toolState.isToolWin,'监听')
|
||||
console.log(toolState,'监听111')
|
||||
if(toolState.isToolWin){
|
||||
ispointer.value=false
|
||||
}else{
|
||||
ispointer.value=true
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log(toolState,'监听')
|
||||
|
||||
}, 300)
|
||||
if(toolState.isPdfWin){
|
||||
// if(toolState.isToolWin){
|
||||
// ispointer.value=false
|
||||
// }else{
|
||||
// ispointer.value=true
|
||||
// }
|
||||
watchToolState() //监听工具栏
|
||||
}
|
||||
})
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
|
||||
import { addEntpcourse } from '@/api/teaching/classwork'
|
||||
|
||||
const userStore = useUserStore()
|
||||
// 当前选中教材章节节点
|
||||
let curNode = null
|
||||
// 查询作业列表所需要的ID
|
||||
let chapterId = null
|
||||
|
||||
export const useGetHomework = async (node) => {
|
||||
/**
|
||||
* node
|
||||
*/
|
||||
if (!node) return
|
||||
curNode = node
|
||||
|
||||
// 获取查询作业列表所需ID
|
||||
let { rows } = await getChapterId()
|
||||
if (rows.length > 0) {
|
||||
chapterId = rows[0].id
|
||||
} else {
|
||||
// 没有则 传教新的entpcourse 再次查询
|
||||
await createEntpcourse()
|
||||
let { rows } = await getChapterId()
|
||||
chapterId = rows[0].id
|
||||
}
|
||||
|
||||
return await getHomeWorkList()
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 根据教材章节ID 查询作业列表所需ID
|
||||
const getChapterId = () => {
|
||||
return listEntpcourse({
|
||||
evalid: curNode.id ? curNode.id : curNode.parentNode.id,
|
||||
edituserid: userStore.user.userId,
|
||||
pageSize: 500
|
||||
})
|
||||
}
|
||||
|
||||
// 创建新的entpcourse
|
||||
const createEntpcourse = () => {
|
||||
// 参照 web AIx 传入参数
|
||||
var cform = {}
|
||||
cform.entpid = userStore.user.deptId
|
||||
cform.level = 1
|
||||
cform.parentid = 0
|
||||
cform.dictid = 0
|
||||
cform.evalid = curNode.id
|
||||
cform.evalparentid = 0
|
||||
cform.edusubject = curNode.edusubject
|
||||
cform.edudegree = curNode.edudegree
|
||||
cform.edustage = curNode.edustage
|
||||
cform.coursetype = '课标学科'
|
||||
cform.coursetitle = curNode.itemtitle
|
||||
cform.coursedesc = ''
|
||||
cform.status = ''
|
||||
cform.dflag = 0
|
||||
cform.edituserid = userStore.user.userId
|
||||
cform.createblankfile = 'yes'
|
||||
return addEntpcourse(cform)
|
||||
}
|
||||
|
||||
const getHomeWorkList = async () => {
|
||||
return await homeworklist({
|
||||
entpcourseid: chapterId,
|
||||
edituserid: userStore.user.userId,
|
||||
pageSize: 100
|
||||
}).then((res) => {
|
||||
//以下代码 参照AIx web端 作业布置
|
||||
let list = []
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
res.rows[i].taskconfig = []
|
||||
|
||||
// 找child
|
||||
for (var j = 0; j < res.rows.length; j++) {
|
||||
if (res.rows[j].parentid == res.rows[i].id) {
|
||||
var ss = []
|
||||
if (res.rows[j].classworkdatastudentids != null) {
|
||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||
}
|
||||
var js = {
|
||||
id: res.rows[j].id,
|
||||
classid: res.rows[j].classid,
|
||||
classcaption: res.rows[j].classcaption,
|
||||
parentid: 0,
|
||||
worktype: '',
|
||||
workkey: res.rows[j].workkey,
|
||||
worktag: '',
|
||||
entpcourseid: 0,
|
||||
evalid: 0,
|
||||
edusubject: '',
|
||||
edudegree: '',
|
||||
workdate: '',
|
||||
title: '',
|
||||
workcodes: '',
|
||||
studentlist: ss,
|
||||
deaddate: res.rows[j].deaddate,
|
||||
timelength: res.rows[j].timelength,
|
||||
weights: res.rows[j].weights,
|
||||
feedtype: res.rows[j].feedtype
|
||||
}
|
||||
res.rows[i].taskconfig.push(js)
|
||||
}
|
||||
}
|
||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||
|
||||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||
// 2024-05-15,酉阳,jackyshen
|
||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||
list.push(res.rows[i])
|
||||
}
|
||||
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (res.rows[i].entpcourseworklist != '') {
|
||||
res.rows[i].entpcourseworklistarray = JSON.parse('[' + res.rows[i].entpcourseworklist + ']')
|
||||
} else {
|
||||
res.rows[i].entpcourseworklistarray = []
|
||||
}
|
||||
}
|
||||
return list
|
||||
})
|
||||
}
|
|
@ -35,6 +35,7 @@
|
|||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
||||
<el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>
|
||||
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">
|
||||
<span>退出登录</span>
|
||||
|
|
|
@ -44,8 +44,8 @@ function stateSync(storeName, key, value) {
|
|||
// 同步数据-发送给主线程-全量更新
|
||||
function stateSyncAll(store) {
|
||||
const storeName = store.$id
|
||||
const jsonStr = JSON.stringify(store.$state)
|
||||
// console.log('state-change', jsonStr, storeName)
|
||||
const jsonStr = circularSafeStringify(store.$state)
|
||||
console.log('state-change', jsonStr, storeName)
|
||||
// 通知主线程更新
|
||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||
}
|
||||
|
@ -61,21 +61,32 @@ function stateSyncInit(wid, store) {
|
|||
// 同步数据-接收主线程消息
|
||||
function stateChange(store) {
|
||||
const storeName = store.$id
|
||||
// 设置更新 store-state 数据状态
|
||||
const setStateData = (jsonStr) => {
|
||||
const curJson = JSON.stringify(store.$state) // 当前数据
|
||||
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
||||
if (!isUp) return
|
||||
const stateJson = JSON.parse(jsonStr) // 新数据
|
||||
// console.log('setStateData', stateJson)
|
||||
// 更新状态
|
||||
store.$patch(stateJson)
|
||||
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
||||
// store.$state = stateJson
|
||||
}
|
||||
// 消息监听
|
||||
ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => {
|
||||
// console.log('pinia-state-set', sName, jsonStr)
|
||||
sName == storeName && setStateData(jsonStr) // 更新对应数据
|
||||
if (sName == storeName) { // 更新对应数据
|
||||
// console.log('state-set', jsonStr, sName)
|
||||
const curJson = circularSafeStringify(store.$state) // 当前数据
|
||||
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
||||
if (!isUp) return
|
||||
const stateJson = JSON.parse(jsonStr) // 新数据
|
||||
// 更新状态
|
||||
store.$patch(stateJson)
|
||||
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
||||
// store.$state = stateJson
|
||||
}
|
||||
})
|
||||
}
|
||||
//解决JSON.stringify嵌套循环产生的bug
|
||||
const circularSafeStringify = (obj) => {
|
||||
const cache = new Set();
|
||||
return JSON.stringify(obj, (key, value) => {
|
||||
if (typeof value === "object" && value !== null) {
|
||||
if (cache.has(value)) {
|
||||
// 当前对象已经存在于缓存中,说明存在循环引用,返回占位符或其他处理方式
|
||||
return "[Circular Reference]";
|
||||
}
|
||||
cache.add(value);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ export const constantRoutes = [
|
|||
path: '/prepare',
|
||||
component: () => import('@/views/prepare/index.vue'),
|
||||
name: 'prepare',
|
||||
meta: {title: '备课',keepAlive:true}
|
||||
meta: {title: '备课'}
|
||||
},
|
||||
{
|
||||
path: '/teach',
|
||||
|
@ -45,6 +45,12 @@ export const constantRoutes = [
|
|||
name: 'profile',
|
||||
meta: {title: '个人中心'}
|
||||
},
|
||||
{
|
||||
path: '/classReserv',
|
||||
component: () => import('@/views/classManage/classReserv.vue'),
|
||||
name: 'classReserv',
|
||||
meta: {title: '课程预约'}
|
||||
},
|
||||
{
|
||||
path: '/class',
|
||||
component: () => import('@/views/classManage/index.vue'),
|
||||
|
|
|
@ -9,6 +9,10 @@ export const useToolState = defineStore('tool', {
|
|||
showBoardAll: false, // 全屏画板-是否显示
|
||||
isPdfWin: false, // pdf窗口是否打开
|
||||
isToolWin: false, // 工具窗口是否打开
|
||||
curSubjectNode: {
|
||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||
querySearch: {} // 查询资源所需参数
|
||||
}
|
||||
}),
|
||||
actions: {
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ const { ipcRenderer } = require('electron')
|
|||
import { getBookMarkById } from '@/api/eTextbook/index'
|
||||
import {useToolState} from '@/store/modules/tool'
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = getStaticUrl('/lib/build/pdf.worker.mjs')
|
||||
|
||||
const toolState = useToolState();
|
||||
const route = useRoute();
|
||||
const isOnLoadShow = ref(false) //加载完毕显示
|
||||
|
@ -70,14 +71,9 @@ const navtopage = (type) => {
|
|||
if (pdfObj.numPages > numPagesTotal.value) return
|
||||
pdfCanvaslist.value.initPdf('rest')
|
||||
}
|
||||
// 最小化窗口
|
||||
// 关闭窗口
|
||||
const minimize = async () => {
|
||||
await pdfCanvaslist.value.savaDataStore()
|
||||
// toolState.isPdfWin=false
|
||||
// toolState.showBoardAll=true //恢复默认值
|
||||
// console.log(toolState.showBoardAll,"关闭")
|
||||
// // ipcRenderer.send('tool-sphere:reset') //重置tool状态
|
||||
// ipcRenderer.send('open-PDF:minimize')
|
||||
}
|
||||
const handleUpdate = (data) => {
|
||||
numPagesTotal.value = data
|
||||
|
@ -104,11 +100,12 @@ const switchPageMode = () => {
|
|||
}
|
||||
}
|
||||
onMounted(async () => {
|
||||
toolState.isPdfWin=true
|
||||
// pdfObj.pdfUrl = getStaticUrl(route.query.path, 'user', 'selfFile', true)
|
||||
toolState.isPdfWin=true //设置打开pdf窗口
|
||||
// pdfObj.pdfUrl = getStaticUrl(route.query.path, 'user', 'selfFile', true) //线上
|
||||
pdfObj.pdfUrl = getStaticUrl('aaa.pdf', 'user', 'selfFile', true) //本地
|
||||
textbookId.value = route.query.textbookId
|
||||
pdfObj.bookId=textbookId.value
|
||||
//初始化获取接口数据
|
||||
getBookMarkById(textbookId.value).then(res=>{
|
||||
pdfObj.allPageData=getUniqueArrayByLastOccurrence(res.data)
|
||||
isOnLoadShow.value=true
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
|
||||
<script setup>
|
||||
import {listClassmain, listClassuser, addClassgroup, listClassgroup, delClassgroup,getClassgroup,updateClassgroup} from '@/api/classManage/index'
|
||||
import {ref, onMounted, reactive, defineProps, watch} from 'vue'
|
||||
import {ref, onMounted, reactive, watch} from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {reactive,onMounted,defineProps,nextTick,watch} from 'vue'
|
||||
import {reactive,onMounted,nextTick,watch} from 'vue'
|
||||
import delClassDemo from '@/store/modules/delClass'
|
||||
const props = defineProps({
|
||||
classId: {
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<el-container class="class-reserv-wrap">
|
||||
<div class="class-reserv-tabs">
|
||||
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
||||
</div>
|
||||
<div class="class-reserv-body">
|
||||
<reserv-item
|
||||
v-for="(item, index) in activeDataList"
|
||||
v-show="tabActive === '进行中'"
|
||||
:key="index"
|
||||
:item="item"
|
||||
@open-edit="reservDialog.openDialog(item)"
|
||||
@delete-reserv="deleteReserv(item)"
|
||||
></reserv-item>
|
||||
<reserv-item
|
||||
v-for="(item, index) in doneDataList"
|
||||
v-show="tabActive === '已结束'"
|
||||
:key="index"
|
||||
:item="item"
|
||||
></reserv-item>
|
||||
</div>
|
||||
<reserv ref="reservDialog"></reserv>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed, watch } from 'vue'
|
||||
import { getSelfReserv } from '@/api/classManage'
|
||||
import ReservItem from '@/views/classManage/reserv-item.vue'
|
||||
import Reserv from '@/views/prepare/container/reserv.vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
const reservDialog = ref(null)
|
||||
const tabOptions = ref(['进行中', '已结束'])
|
||||
const tabActive = ref('进行中')
|
||||
const dataList = ref([])
|
||||
|
||||
const activeDataList = computed(() => {
|
||||
return dataList.value.filter((item) => {
|
||||
return item.status !== '已结束'
|
||||
})
|
||||
})
|
||||
const deleteReserv = (item) => {
|
||||
dataList.value = dataList.value.filter((is) => {
|
||||
return is.id !== item.id
|
||||
})
|
||||
}
|
||||
const doneDataList = computed(() => {
|
||||
return dataList.value.filter((item) => {
|
||||
return item.status === '已结束'
|
||||
})
|
||||
})
|
||||
const toolStore = useToolState()
|
||||
watch(
|
||||
() => toolStore.isToolWin,
|
||||
(newD, oldD) => {
|
||||
getSelfReserv().then((res) => {
|
||||
dataList.value = [...res.data]
|
||||
})
|
||||
}
|
||||
)
|
||||
onMounted(() => {
|
||||
getSelfReserv().then((res) => {
|
||||
dataList.value = res.data
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.class-reserv-wrap {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 15px 30px;
|
||||
.class-reserv-tabs {
|
||||
width: 30%;
|
||||
text-align: left;
|
||||
}
|
||||
.class-reserv-body {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,133 @@
|
|||
<template>
|
||||
<div class="class-reserv-item">
|
||||
<div class="class-reserv-item-img">
|
||||
<img :src="basePath + item.bookImg" alt="封面" />
|
||||
</div>
|
||||
<div class="class-reserv-item-body">
|
||||
<div class="class-reserv-item-title1">
|
||||
<label>{{ item.className }}</label>
|
||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classType }}</el-tag>
|
||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classSubject }}</el-tag>
|
||||
</div>
|
||||
<div class="class-reserv-item-title2">
|
||||
{{ item.classDay }} {{ item.startTime }} ~ {{ item.classDay }} {{ item.endTime }}
|
||||
{{ item.createUserName }}老师
|
||||
</div>
|
||||
<div class="class-reserv-item-title3">
|
||||
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
|
||||
{{ index === 0 ? tag.name : '、' + tag.name }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="class-reserv-item-tool">
|
||||
<el-button v-if="item.status !== '已结束'" type="primary" @click="startClassR(item)"
|
||||
>上课</el-button
|
||||
>
|
||||
<el-button v-if="item.status === '未开始'" @click="openEdit">编辑</el-button>
|
||||
<!-- <el-button v-if="item.status === '上课中'" type="info" @click="endClassR(item)"
|
||||
>下课</el-button
|
||||
>-->
|
||||
<el-button type="danger" @click="deleteReserv">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
import { deleteSmartReserv, startClass, endClass } from '@/api/classManage'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { listEntpcourse } from '@/api/teaching/classwork'
|
||||
const emit = defineEmits(['openEdit', 'deleteReserv'])
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
const openEdit = () => {
|
||||
emit('openEdit', props.item)
|
||||
}
|
||||
const deleteReserv = () => {
|
||||
deleteSmartReserv([props.item.id]).then((res) => {
|
||||
if (res.data === true) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('deleteReserv', props.item)
|
||||
}
|
||||
})
|
||||
}
|
||||
const startClassR = (item) => {
|
||||
startClass(item.id).then((res) => {
|
||||
if (res.data === true) {
|
||||
item.status = '上课中'
|
||||
openLesson()
|
||||
}
|
||||
})
|
||||
}
|
||||
const toolStore = useToolState()
|
||||
// 上课-工具类悬浮
|
||||
const openLesson = () => {
|
||||
if (toolStore.isToolWin) return ElMessage.error('您当前已开始上课,请勿重复操作')
|
||||
startClass(props.item.id)
|
||||
listEntpcourse({
|
||||
evalid: props.item.ex2,
|
||||
edituserid: useUserStore().user.userId,
|
||||
pageSize: 500
|
||||
}).then(res=>{
|
||||
if (res.rows[0].id) {
|
||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id })
|
||||
}
|
||||
})
|
||||
}
|
||||
const endClassR = (item) => {
|
||||
endClass(item.id).then((res) => {
|
||||
if (res.data === true) {
|
||||
ElMessage({
|
||||
message: '下课成功',
|
||||
type: 'success'
|
||||
})
|
||||
item.status = '已结束'
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.class-reserv-item {
|
||||
display: flex;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
.class-reserv-item-img {
|
||||
width: 80px;
|
||||
padding-left: 20px;
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.class-reserv-item-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: left;
|
||||
padding-left: 30px;
|
||||
font-size: 14px;
|
||||
.class-reserv-item-title1 {
|
||||
flex: 1;
|
||||
label {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.class-reserv-item-tool {
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -112,7 +112,7 @@
|
|||
|
||||
<script setup>
|
||||
import {addStudentmain, listClassuser,updateStudentmain,getClassmain,getStudentmain,leaveClass,removeStudentDataAll,addStudentmainByNameArray} from '@/api/classManage/index'
|
||||
import {ref, onMounted, reactive, nextTick, defineProps, watch} from 'vue'
|
||||
import {ref, onMounted, reactive, nextTick, watch} from 'vue'
|
||||
import {ElMessage,ElMessageBox} from "element-plus";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
|
|
@ -7,24 +7,47 @@
|
|||
<img class="welcome-img" :src="leftBg2" />
|
||||
</div>
|
||||
<div class="box-item login">
|
||||
<WindowTools :isHasMax="false" />
|
||||
<WindowTools :is-has-max="false" />
|
||||
<div class="login-title">账号登录</div>
|
||||
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" style="margin-bottom: 15px">
|
||||
<el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" />
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
autocomplete="on"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-checkbox class="flex mb-5" v-model="loginForm.rememberMe">记住密码</el-checkbox>
|
||||
<el-checkbox v-model="loginForm.rememberMe" class="flex mb-5">记住密码</el-checkbox>
|
||||
<el-form-item>
|
||||
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)">登录</el-button>
|
||||
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)"
|
||||
>登录</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="showDownLoading"
|
||||
width="500"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
align-center
|
||||
>
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="22"
|
||||
:percentage="downloadProp"
|
||||
:show-text="false"
|
||||
status="success"
|
||||
/>
|
||||
</el-dialog>
|
||||
<!--选择学科-->
|
||||
<SelectSubject v-model="isSubject" :loginData="loginForm" @onSuccess="successEditSubject"/>
|
||||
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
|
@ -36,7 +59,8 @@ import WindowTools from '@/components/window-tools/index.vue'
|
|||
import SelectSubject from '@/components/select-subject/index.vue'
|
||||
|
||||
const { session } = require('@electron/remote')
|
||||
|
||||
const downloadProp = ref(0)
|
||||
const showDownLoading = ref(false)
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const formRef = ref()
|
||||
const userStore = useUserStore()
|
||||
|
@ -55,7 +79,11 @@ const rules = reactive({
|
|||
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
|
||||
})
|
||||
|
||||
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH;
|
||||
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
ipcRenderer.on('update-app-progress', (e, prop) => {
|
||||
downloadProp.value = prop
|
||||
showDownLoading.value = prop !== 100
|
||||
})
|
||||
|
||||
//登录
|
||||
const submitForm = async (formEl) => {
|
||||
|
@ -83,11 +111,9 @@ const submitForm = async (formEl) => {
|
|||
if (userStore.user.edustage || userStore.user.edusubject) {
|
||||
ElMessage.success('登录成功')
|
||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
isSubject.value = true
|
||||
}
|
||||
|
||||
} finally {
|
||||
btnLoading.value = false
|
||||
}
|
||||
|
@ -118,7 +144,7 @@ const getCookieDetail = (name) => {
|
|||
// 设置cookie
|
||||
const setCookie = (name, value) => {
|
||||
// 30天过期
|
||||
let Days = 30;
|
||||
let Days = 30
|
||||
let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60
|
||||
const cookie = {
|
||||
url: curWinUrl,
|
||||
|
@ -129,8 +155,6 @@ const setCookie = (name, value) => {
|
|||
return session.defaultSession.cookies.set(cookie)
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
localStorage.clear()
|
||||
getCookie()
|
||||
|
|
|
@ -94,13 +94,14 @@
|
|||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="item-popover-item">
|
||||
<!-- 判断是不是自己创建的课件-->
|
||||
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
||||
<el-button text @click="editTalk(item, index)">
|
||||
<i class="iconfont icon-bianji"></i>
|
||||
<span>重命名</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="item-popover-item">
|
||||
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
||||
<el-button text @click="deleteTalk(item)">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
|
@ -140,6 +141,7 @@ import { asyncLocalFile } from '@/utils/talkFile'
|
|||
import { toTimeText } from '@/utils/date'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
export default {
|
||||
|
@ -162,11 +164,13 @@ export default {
|
|||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
|
||||
data() {
|
||||
return {
|
||||
listenList: []
|
||||
listenList: [],
|
||||
userInfo:{}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
editTalk(item) {
|
||||
console.log(item,this.userInfo,'this.userInfo')
|
||||
ElMessageBox.prompt('请输入新的名称', '重命名', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
|
@ -253,6 +257,9 @@ export default {
|
|||
deleteHomework(item){
|
||||
this.$emit('on-delhomework', item)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = useUserStore().user
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -77,20 +77,42 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, defineExpose, onMounted, reactive, computed } from 'vue'
|
||||
import { listClassmain } from '@/api/classManage'
|
||||
import { ref, defineExpose, onMounted, reactive, computed, watch } from 'vue'
|
||||
import { addSmartClassReserv, updateSmartClassReserv, listClassmain } from '@/api/classManage'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const emit = defineEmits(['addSuccess'])
|
||||
const props = defineProps({
|
||||
bookId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
currentNode: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
})
|
||||
const ruleFormDialog = ref(null)
|
||||
const nowType = ref('add')
|
||||
const userStore = useUserStore().user
|
||||
const centerDialogVisible = ref(false)
|
||||
const form = reactive({
|
||||
name: '',
|
||||
type: '常规课',
|
||||
day: '',
|
||||
time: '',
|
||||
time: [],
|
||||
resource: [],
|
||||
classRoom: ''
|
||||
})
|
||||
const updateForm = ref({})
|
||||
watch(
|
||||
() => props.currentNode,
|
||||
(newValue, oldValue) => {
|
||||
form.name = newValue.label
|
||||
}
|
||||
)
|
||||
const ruleForm = reactive({
|
||||
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
||||
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
||||
|
@ -121,17 +143,29 @@ const locationOptions = [
|
|||
const locationMessage = computed(() => {
|
||||
return locationOptions.find((item) => item.value === form.type).message
|
||||
})
|
||||
const openDialog = () => {
|
||||
const openDialog = (data) => {
|
||||
if (data) {
|
||||
updateForm.value = data
|
||||
nowType.value = 'update'
|
||||
form.name = data.className
|
||||
form.type = data.classType
|
||||
form.day = data.classDay
|
||||
form.time = [data.startTime, data.endTime]
|
||||
form.resource = data.classList.split(',').map((item) => parseInt(item))
|
||||
form.classRoom = data.classRoom
|
||||
}
|
||||
centerDialogVisible.value = true
|
||||
}
|
||||
const closeDialog = () => {
|
||||
ruleFormDialog.value.resetFields()
|
||||
centerDialogVisible.value = false
|
||||
form.name = props.currentNode.label
|
||||
}
|
||||
const classList = ref([])
|
||||
onMounted(() => {
|
||||
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
||||
(response) => {
|
||||
console.log(response)
|
||||
classList.value = [...response.rows]
|
||||
}
|
||||
)
|
||||
|
@ -141,10 +175,73 @@ const submitForm = async () => {
|
|||
if (!formEl) return
|
||||
await formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if (nowType.value === 'update') {
|
||||
updateClassReserv(form)
|
||||
} else {
|
||||
addClassReserv(form)
|
||||
}
|
||||
centerDialogVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
const updateClassReserv = (formData) => {
|
||||
let ids = formData.resource.join(',')
|
||||
let param = {
|
||||
className: formData.name,
|
||||
classType: formData.type,
|
||||
classDay: formData.day,
|
||||
startTime: formData.time[0],
|
||||
endTime: formData.time[1],
|
||||
classList: ids,
|
||||
classRoom: formData.classRoom,
|
||||
id: updateForm.value.id
|
||||
}
|
||||
updateSmartClassReserv(param).then((res) => {
|
||||
if (res.data === true) {
|
||||
closeDialog()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '修改预约成功!'
|
||||
})
|
||||
Object.assign(updateForm.value, param)
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const addClassReserv = (formData) => {
|
||||
let ids = formData.resource.join(',')
|
||||
let param = {
|
||||
className: formData.name,
|
||||
classType: formData.type,
|
||||
classDay: formData.day,
|
||||
startTime: formData.time[0],
|
||||
endTime: formData.time[1],
|
||||
classList: ids,
|
||||
classRoom: formData.classRoom,
|
||||
classSubject: props.currentNode.edusubject,
|
||||
ex1: props.bookId,
|
||||
ex2: props.currentNode.id
|
||||
}
|
||||
addSmartClassReserv(param).then((res) => {
|
||||
if (res.data === true) {
|
||||
closeDialog()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '预约成功!'
|
||||
})
|
||||
emit('addSuccess')
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
openDialog,
|
||||
closeDialog
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog v-model="dialogVisible" center top="10vh" width="600px" :show-close="false" append-to-body
|
||||
:z-index="999999" style="border-radius: 10px; padding: 10px 15px;">
|
||||
style="border-radius: 10px; padding: 10px 15px;">
|
||||
<template #header>
|
||||
<div class="homerwork-header flex">
|
||||
<span>{{ title }}</span>
|
||||
|
@ -288,7 +288,6 @@ export default {
|
|||
modelValue(val) {
|
||||
this.dialogVisible = val
|
||||
if (val) {
|
||||
console.log(this.row,10000)
|
||||
this.getGradeList()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -492,11 +492,10 @@ export default {
|
|||
|
||||
// 打开PDF-课件
|
||||
async navtoPdf() {
|
||||
const toolStore = useToolState()
|
||||
// if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
||||
let path = await this.getBookPathFromServer()
|
||||
path=path.replace(/^.*[\\\/]/, '');
|
||||
console.log(path)
|
||||
// path=path.replace(/^.*[\\\/]/, '');
|
||||
// console.log(path)
|
||||
// console.log(this.uploadData.textbookId)
|
||||
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
||||
},
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
import { ref, getCurrentInstance } from 'vue'
|
||||
import { updateUserProfile } from '@/api/system/user'
|
||||
import { listEvaluation } from '@/api/subject/index'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {ElMessage} from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
user: {
|
||||
|
@ -42,6 +44,7 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const rules = ref({
|
||||
nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
||||
|
@ -96,7 +99,17 @@ function submit() {
|
|||
if (valid) {
|
||||
console.log(props.user)
|
||||
updateUserProfile(props.user).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
if(response.code == 200){
|
||||
userStore.getInfo().then(res => {
|
||||
if(res.code === 200){
|
||||
ElMessage.success('修改成功')
|
||||
}else{
|
||||
ElMessage.error(response.msg)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
ElMessage.error(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
@ -36,11 +36,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="item-btns" @click.stop>
|
||||
<!-- 只有自己创建的课件可以修改名称-->
|
||||
<el-popover
|
||||
placement="bottom-end"
|
||||
trigger="hover"
|
||||
popper-class="custom-popover"
|
||||
:visible="item.showPopover"
|
||||
v-if="Number(item.createUserId) === userInfo.userId"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="primary">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<h3 class="title">{{ lesson }}</h3>
|
||||
<div class="grade">{{ usertore.edusubject }}</div>
|
||||
</div>
|
||||
<!-- <i class="iconfont icon-xiangyou"></i> -->
|
||||
<i class="iconfont icon-xiangyou" @click="showLeft = !showLeft"></i>
|
||||
</div>
|
||||
<div class="homework-list" v-loading="loading">
|
||||
<el-scrollbar height="360px">
|
||||
|
@ -42,22 +42,26 @@
|
|||
</div>
|
||||
<el-button color="#349d44" @click="sendHomework(item)">推送</el-button>
|
||||
</li>
|
||||
<div class="no-data flex" v-if="!dataList.length && !resourceList.length">
|
||||
<i class="iconfont icon-zanwushuju"></i>
|
||||
<span>暂无数据</span>
|
||||
</div>
|
||||
</ul>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<SetHomework v-model="setDialog" :title="'推送作业'" :entpcourseid="entpcourseid" :row="curRow"
|
||||
@on-close="closeHomework" />
|
||||
</div>
|
||||
<div class="homework" @click="showLeft = !showLeft" v-else>
|
||||
<div class="homework flex" v-else>
|
||||
<div class="unit-top flex">
|
||||
<div class="unit-top-left">
|
||||
<div class="unit-top-left" @click="showLeft = !showLeft">
|
||||
<i class="iconfont icon-xiangzuo"></i>
|
||||
<span>返回</span>
|
||||
</div>
|
||||
<span class="unit-top-center">选择目录</span>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <Lesson/> -->
|
||||
<div class="unit-content">
|
||||
<Lesson @changeChapter="changeChapter" />
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
|
@ -72,10 +76,12 @@ import { homeworklist } from '@/api/teaching/classwork'
|
|||
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||
import FileImage from '@/components/file-image/index.vue'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { ipcMsgSend } from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { asyncLocalFile } from '@/utils/talkFile'
|
||||
import Lesson from './lesson.vue';
|
||||
import { parseCataByNode } from '@/utils/talkFile'
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const route = useRoute();
|
||||
|
@ -108,13 +114,28 @@ const closeHomework = () => {
|
|||
setDialog.value = false
|
||||
}
|
||||
|
||||
|
||||
const changeChapter = async (data)=>{
|
||||
const res = await useGetHomework(data)
|
||||
dataList.value = res
|
||||
let cata = parseCataByNode(data)
|
||||
|
||||
toolStore.curSubjectNode.querySearch.levelFirstId = cata[0]
|
||||
toolStore.curSubjectNode.querySearch.levelSecondId = cata[1]
|
||||
lesson.value = data.label
|
||||
showLeft.value = !showLeft.value
|
||||
getResource()
|
||||
}
|
||||
|
||||
// 获取资源数据
|
||||
const getResource = () => {
|
||||
let data = toRaw(toolStore.curSubjectNode)
|
||||
data.orderByColumn = 'uploadTime'
|
||||
data.isAsc = 'desc'
|
||||
data.pageSize = 500
|
||||
getSmarttalkPage(data).then(res => {
|
||||
let querySearch = toRaw(toolStore.curSubjectNode).querySearch
|
||||
|
||||
querySearch.orderByColumn = 'uploadTime'
|
||||
querySearch.isAsc = 'desc'
|
||||
querySearch.pageSize = 500
|
||||
|
||||
getSmarttalkPage(querySearch).then(res => {
|
||||
resourceList.value = res.rows
|
||||
})
|
||||
|
||||
|
@ -210,9 +231,9 @@ onMounted(() => {
|
|||
entpcourseid.value = route.query.entpcourseid
|
||||
lesson.value = route.query.label
|
||||
getHomework()
|
||||
setTimeout(() => {
|
||||
setTimeout(()=>{
|
||||
getResource()
|
||||
}, 5000)
|
||||
},5000)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -224,8 +245,9 @@ onMounted(() => {
|
|||
|
||||
.homework {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.homework-content {
|
||||
|
@ -317,6 +339,18 @@ onMounted(() => {
|
|||
.unit-top-center{
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
}
|
||||
.unit-content{
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.no-data{
|
||||
padding-top: 30px;
|
||||
color: #d7d7d7;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
color: 12px;
|
||||
.icon-zanwushuju{
|
||||
font-size: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -6,6 +6,7 @@ import useUserStore from '@/store/modules/user'
|
|||
import * as http from '@/api/apiService' // 自定义api service
|
||||
// import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
||||
const userStore = useUserStore()
|
||||
const emits = defineEmits(['change'])
|
||||
let imChat
|
||||
onMounted(() => {
|
||||
// console.log(userStore)
|
||||
|
@ -48,13 +49,15 @@ const createGroup = async (groupName) => {
|
|||
// if (res && res.code == 0) {
|
||||
// const timGroupId = res?.json_param?.create_group_result_groupid
|
||||
// }
|
||||
const params = {type:'createGroup', data: imChat.timGroupId}
|
||||
emits('change', params)
|
||||
}
|
||||
// 退出
|
||||
const logout = () => imChat?.logout()
|
||||
// 解散群
|
||||
const deleteGroup = () => imChat?.deleteGroup()
|
||||
|
||||
defineExpose({ logout, deleteGroup })
|
||||
defineExpose({ logout, deleteGroup, imChat })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
|
||||
<el-scrollbar>
|
||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||
@node-click="handleNodeClick">
|
||||
|
@ -7,14 +8,16 @@
|
|||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick, markRaw, toRaw } from 'vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { parseCataByNode } from '@/utils/talkFile'
|
||||
|
||||
|
||||
const emit = defineEmits(['changeChapter'])
|
||||
const toolStore = useToolState()
|
||||
const treeData = ref([])
|
||||
const defaultProps = {
|
||||
|
@ -43,12 +46,9 @@ const getTreeData = () => {
|
|||
//下册
|
||||
let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册')
|
||||
//数据过滤
|
||||
console.log(volumeOne,1)
|
||||
console.log(volumeTwo,2)
|
||||
|
||||
let upData = transData(volumeOne)
|
||||
let downData = transData(volumeTwo)
|
||||
console.log(upData)
|
||||
console.log(downData)
|
||||
if(upData.length && downData.length){
|
||||
treeData.value = [...upData,...downData]
|
||||
}
|
||||
|
@ -61,28 +61,50 @@ const getTreeData = () => {
|
|||
}
|
||||
nextTick(() => {
|
||||
let defaultKey
|
||||
if(toolStore.curSubjectNode.levelSecondId){
|
||||
defaultKey = toolStore.curSubjectNode.levelSecondId
|
||||
if(toolStore.curSubjectNode.querySearch.levelSecondId){
|
||||
defaultKey = toolStore.curSubjectNode.querySearch.levelSecondId
|
||||
}
|
||||
else{
|
||||
defaultKey = toolStore.curSubjectNode.levelFirstId
|
||||
defaultKey = toolStore.curSubjectNode.querySearch.levelFirstId
|
||||
}
|
||||
defaultExpandedKeys.value = defaultKey
|
||||
// currentNode.data = getLastLevelData(treeData.value)[0]
|
||||
// currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||
// currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||
|
||||
currentNodeId.value = defaultKey
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const handleNodeClick = ()=>{}
|
||||
const handleNodeClick = (data, node) => {
|
||||
/**
|
||||
* data : 当前节点数据
|
||||
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
||||
*/
|
||||
|
||||
const nodeData = data;
|
||||
const parentNode = node.parent.data;
|
||||
|
||||
if (Array.isArray(parentNode)) {
|
||||
nodeData.parentNode = null
|
||||
}
|
||||
else {
|
||||
nodeData.parentNode = parentNode
|
||||
}
|
||||
|
||||
emit('changeChapter', toRaw(nodeData))
|
||||
}
|
||||
|
||||
|
||||
// 根据教材章节单元ID 查询作业列表所需ID
|
||||
const getChapterId = () => {
|
||||
return listEntpcourse({
|
||||
evalid: this.uploadData.levelSecondId,
|
||||
edituserid: this.userStore.userId,
|
||||
pageSize: 500
|
||||
})
|
||||
}
|
||||
|
||||
const transData = (data) => {
|
||||
let ary = []
|
||||
data.forEach(item => {
|
||||
let obj = {}
|
||||
console.log(item.rootid, '==========>',curBookId.value)
|
||||
if (item.rootid == curBookId.value) {
|
||||
obj.label = item.itemtitle
|
||||
obj.id = item.id
|
||||
|
@ -114,16 +136,36 @@ const transData = (data) => {
|
|||
|
||||
|
||||
onMounted(()=>{
|
||||
// console.log(toolStore.curSubjectNode,111)
|
||||
|
||||
// let data = toRaw(toolStore.curSubjectNode)
|
||||
// console.log(data,222)
|
||||
|
||||
|
||||
// curBookId.value = toolStore.curSubjectNode.textbookId
|
||||
// getTreeData()
|
||||
setTimeout(()=>{
|
||||
let data = toRaw(toolStore.curSubjectNode)
|
||||
curBookId.value = data.data.textBook.curBookId
|
||||
getTreeData()
|
||||
},500)
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
.el-tree{
|
||||
background-color: #121212
|
||||
}
|
||||
:deep(.el-tree-node) {
|
||||
.el-tree-node__content {
|
||||
height: 45px;
|
||||
color: #EFEFEF;
|
||||
//#368FFF
|
||||
&:hover {
|
||||
background-color: #272728;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content) {
|
||||
background-color: #121212 !important;
|
||||
color: #409EFF
|
||||
}
|
||||
:deep(.el-scrollbar__view){
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -10,7 +10,7 @@
|
|||
<upvote-vue></upvote-vue>
|
||||
|
||||
<!-- im-chat 聊天组件 -->
|
||||
<im-chat ref="imChatRef" />
|
||||
<im-chat ref="imChatRef" @change="chatChange" />
|
||||
|
||||
<!-- 底部工具栏 -->
|
||||
<div class="tool-bottom-all" @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
||||
|
@ -38,7 +38,8 @@
|
|||
<script setup>
|
||||
// 功能说明:electron 悬浮球
|
||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
||||
|
||||
import { useRoute } from 'vue-router';
|
||||
import { endClass } from '@/api/classManage'
|
||||
import logo from '@root/resources/icon.png' // logo
|
||||
import boardVue from './components/board.vue' // 画板-子组件
|
||||
import sideVue from './components/side.vue' // 画板-子组件
|
||||
|
@ -48,6 +49,7 @@ import vDrag from './directive/drag' // 自定义指令-拖拽
|
|||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
||||
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
||||
const route = useRoute();
|
||||
const tabActive = ref('select') // 工具栏当前选中项
|
||||
const isFold = ref(false) // 折叠工具栏
|
||||
const isDrag = ref(false) // 开始拖拽
|
||||
|
@ -56,6 +58,10 @@ const isShow = ref(false) // 是否显示-画板
|
|||
const toolStore = useToolState() // 状态管理
|
||||
const boardVueRef=ref(null) // 画板ref
|
||||
const imChatRef = ref(null) // im-chat ref
|
||||
const classObj = reactive({ // 课程相关
|
||||
id: route.query.reservId, // 课程id
|
||||
data: {} // 课程信息
|
||||
})
|
||||
const btnList = [ // 工具栏按钮列表
|
||||
{ label: '选择', value: 'select', icon: 'icon-mouse' },
|
||||
{ label: '画笔', value: 'brush', icon: 'icon-huabi' },
|
||||
|
@ -95,6 +101,11 @@ const mouseChange = (bool) => {
|
|||
if (!isShow.value) resBool = !!bool
|
||||
setIgnore(resBool)
|
||||
}
|
||||
// im-chat: 聊天事件
|
||||
const chatChange = data => {
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
// 忽略鼠标穿透
|
||||
const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)}
|
||||
// 重置状态: 鼠标|画板
|
||||
|
@ -107,6 +118,7 @@ const resetStatus = () => {
|
|||
}, 500)
|
||||
})
|
||||
toolStore.isToolWin = true // 标记状态
|
||||
|
||||
}
|
||||
// 侧边工具栏: 移入移出
|
||||
const sideMouse = e => {
|
||||
|
@ -125,6 +137,7 @@ const sideChange = async o => {
|
|||
break
|
||||
case 'over': // 下课
|
||||
toolStore.isToolWin = false
|
||||
endClass(route.query.reservId)
|
||||
console.log(imChatRef.value)
|
||||
await imChatRef.value?.deleteGroup() // 解散群
|
||||
await imChatRef.value?.logout() // 退出im
|
||||
|
@ -135,7 +148,6 @@ const sideChange = async o => {
|
|||
|
||||
// === 监听器 ===
|
||||
watchEffect(() => {
|
||||
console.log('工具:', toolStore)
|
||||
// 不同的时候, 更新值: 是否显示-画板
|
||||
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
||||
if (show != isShow.value) isShow.value = show
|
||||
|
|
Loading…
Reference in New Issue