Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into zdg
This commit is contained in:
commit
785b70d888
|
@ -88,9 +88,10 @@ function createLoginWindow() {
|
||||||
//主窗口
|
//主窗口
|
||||||
function createMainWindow() {
|
function createMainWindow() {
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1200,
|
width: 1350,
|
||||||
minWidth: 1350,
|
minWidth: 1200,
|
||||||
height: 700,
|
height: 700,
|
||||||
|
minHeight: 700,
|
||||||
show: false,
|
show: false,
|
||||||
frame: false, // 无边框
|
frame: false, // 无边框
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
|
@ -118,6 +119,11 @@ function createMainWindow() {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
// app.quit() // 主窗口关闭-结束所有进程
|
// app.quit() // 主窗口关闭-结束所有进程
|
||||||
})
|
})
|
||||||
|
mainWindow.on('resize', () => {
|
||||||
|
const { width, height } = mainWindow.getBounds();
|
||||||
|
mainWindow.webContents.send('minWinResize', { width, height });
|
||||||
|
});
|
||||||
|
|
||||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||||
shell.openExternal(details.url)
|
shell.openExternal(details.url)
|
||||||
return { action: 'deny' }
|
return { action: 'deny' }
|
||||||
|
@ -129,6 +135,7 @@ function createMainWindow() {
|
||||||
} else {
|
} else {
|
||||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
|
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
|
||||||
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
|
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
|
||||||
// 第三步: 开启remote服务
|
// 第三步: 开启remote服务
|
||||||
|
|
|
@ -14,14 +14,14 @@ const defaultData = {
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
},
|
||||||
subject: {
|
subject: { // 不走同步 Pinia
|
||||||
bookList: null, // 教材列表
|
bookList: null, // 教材列表
|
||||||
curBook: null, // 当前选中的教材
|
curBook: null, // 当前选中的教材
|
||||||
curNode: null, // 当前选中的节点
|
curNode: null, // 当前选中的节点
|
||||||
defaultExpandedKeys: [], //展开的节点
|
defaultExpandedKeys: [], //展开的节点
|
||||||
|
subjectTree: [] // "树结构" 章节
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
local: { // 本地(永久localStorage)
|
local: { // 本地(永久localStorage)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -294,7 +294,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||||
</span>
|
</span>
|
||||||
<span id="numPages" class="toolbarLabel"></span>
|
<span id="numPages" class="toolbarLabel"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="toolbarViewerRight" style="display: none;">
|
<div id="toolbarViewerRight">
|
||||||
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||||
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
||||||
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
||||||
|
|
|
@ -21,7 +21,6 @@ const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\r
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
||||||
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
||||||
console.log('组件',pdfUrl.value);
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,8 @@ onMounted( async () => {
|
||||||
|
|
||||||
// 章节"树"
|
// 章节"树"
|
||||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
treeData.value = useSubject.getTreeData(curBook.data.id)
|
||||||
|
sessionStore.set('subject.subjectTree',useSubject.getTreeData(curBook.data.id))
|
||||||
|
|
||||||
nextTick(() =>{
|
nextTick(() =>{
|
||||||
// 默认展开 选中
|
// 默认展开 选中
|
||||||
if(sessionStore.get('subject.curNode')){
|
if(sessionStore.get('subject.curNode')){
|
||||||
|
|
|
@ -55,7 +55,7 @@ export const useGetSubject = async () =>{
|
||||||
treeData = getTreeData(subjectList[0].id)
|
treeData = getTreeData(subjectList[0].id)
|
||||||
// 设置一个默认的curNode
|
// 设置一个默认的curNode
|
||||||
let curNode
|
let curNode
|
||||||
if(treeData[0].children){
|
if(treeData[0].children && treeData[0].children.length){
|
||||||
curNode = treeData[0].children[0]
|
curNode = treeData[0].children[0]
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<span class="user-name">{{ userStore.user.nickName }}</span>
|
<span class="user-name">{{ userStore.user.nickName }}</span>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
||||||
<el-dropdown @command="changeSubject">
|
<el-dropdown @command="changeSubject" max-height="500">
|
||||||
<div class="user-subject">{{ userStore.user.edusubject }}
|
<div class="user-subject">{{ userStore.user.edusubject }}
|
||||||
<el-icon class="el-icon--right"><arrow-down />
|
<el-icon class="el-icon--right"><arrow-down />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
@ -70,10 +70,8 @@ import { ArrowDown } from '@element-plus/icons-vue'
|
||||||
import WindowTools from '@/components/window-tools/index.vue'
|
import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { updateUserInfo } from '@/api/system/user'
|
import { updateUserInfo } from '@/api/system/user'
|
||||||
import outLink from '@/utils/linkConfig'
|
|
||||||
import logoIco from '@/assets/images/logo.png'
|
import logoIco from '@/assets/images/logo.png'
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
import { listEvaluation } from '@/api/classManage/index'
|
||||||
import { clearBookInfo } from '@/utils/ruoyi'
|
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
|
||||||
|
@ -180,9 +178,10 @@ const changeSubject = async (command) =>{
|
||||||
curBook: null,
|
curBook: null,
|
||||||
curNode: null,
|
curNode: null,
|
||||||
defaultExpandedKeys: [],
|
defaultExpandedKeys: [],
|
||||||
|
subjectTree: []
|
||||||
}
|
}
|
||||||
sessionStore.set( 'subject', sessionSubject)
|
sessionStore.set( 'subject', sessionSubject)
|
||||||
const { userId, userName, phonenumber, plainpwd } = userStore.user
|
const { userId, userName, plainpwd } = userStore.user
|
||||||
const data = {
|
const data = {
|
||||||
userId,
|
userId,
|
||||||
userName,
|
userName,
|
||||||
|
@ -190,7 +189,7 @@ const changeSubject = async (command) =>{
|
||||||
edusubject: command.edusubject
|
edusubject: command.edusubject
|
||||||
}
|
}
|
||||||
await updateUserInfo(data)
|
await updateUserInfo(data)
|
||||||
await userStore.login({username: phonenumber ? phonenumber : userName, password: plainpwd})
|
await userStore.login({username: userName, password: plainpwd})
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
router.go()
|
router.go()
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,9 @@ import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
// 默认数据
|
// 默认数据
|
||||||
const defData = sessionStore.store || {}
|
const defData = sessionStore.store || {}
|
||||||
|
const exArrs = ['subject']
|
||||||
|
exArrs.forEach(k => Object.keys(defData).includes(k) && (delete defData[k]))
|
||||||
|
|
||||||
// 延时
|
// 延时
|
||||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
|
||||||
|
@ -16,7 +19,6 @@ export const useToolState = defineStore('tool', {
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
},
|
||||||
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
||||||
import { listByDeadDate, listClassworkdataByDeadDate } from '@/api/classTask'
|
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
|
||||||
|
|
||||||
import TaskItem from '@/views/classTask/container/task-item.vue'
|
import TaskItem from '@/views/classTask/container/task-item.vue'
|
||||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
|
@ -109,13 +109,13 @@ const changeEndDate = (val) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getData = () => {
|
const getData = async () => {
|
||||||
classWorkList.value = []
|
classWorkList.value = []
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// 1、班级列表
|
// 1、班级列表
|
||||||
getClassList()
|
getClassList()
|
||||||
// 2、班级作业
|
// 2、班级作业
|
||||||
getClassWorkList()
|
await getClassWorkList()
|
||||||
// 3、班级学生作业 包含多个班级
|
// 3、班级学生作业 包含多个班级
|
||||||
getStudentClassWorkData()
|
getStudentClassWorkData()
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
@ -133,19 +133,21 @@ const getClassList = () => {
|
||||||
/**
|
/**
|
||||||
* 2、获取班级作业
|
* 2、获取班级作业
|
||||||
*/
|
*/
|
||||||
const getClassWorkList = () => {
|
const getClassWorkList = async () => {
|
||||||
if(classTaskStore.classListIds.length>0){
|
if(classTaskStore.classListIds.length>0){
|
||||||
// 班级作业数据,包含多个班级 homeworklist
|
// 班级作业数据,包含多个班级 homeworklist
|
||||||
listByDeadDate({
|
const response = await listByDeadDate({
|
||||||
classidarray: classTaskStore.classListIds.join(','),
|
classidarray: classTaskStore.classListIds.join(','),
|
||||||
|
edituserid: userStore.userId, // 老师的id
|
||||||
edustage: userStore.edustage, // 学段
|
edustage: userStore.edustage, // 学段
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||||
orderby: 'uniquekey DESC',
|
orderby: 'deaddate DESC',
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
}).then((response) => {
|
})
|
||||||
|
|
||||||
for (var i = 0; i < response.rows.length; i++) {
|
for (var i = 0; i < response.rows.length; i++) {
|
||||||
// 初始化部分新增字段值
|
// 初始化部分新增字段值
|
||||||
response.rows[i].workdatalist = []
|
response.rows[i].workdatalist = []
|
||||||
|
@ -191,7 +193,6 @@ const getClassWorkList = () => {
|
||||||
response.rows[i].workdatacount = stuList.length
|
response.rows[i].workdatacount = stuList.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示分配人数(workdatacount)>0 的
|
// 显示分配人数(workdatacount)>0 的
|
||||||
if (response.rows && response.rows.length > 0) {
|
if (response.rows && response.rows.length > 0) {
|
||||||
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
||||||
|
@ -202,7 +203,6 @@ const getClassWorkList = () => {
|
||||||
total.value = 0
|
total.value = 0
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,14 +211,19 @@ const getClassWorkList = () => {
|
||||||
*/
|
*/
|
||||||
const getStudentClassWorkData = () => {
|
const getStudentClassWorkData = () => {
|
||||||
if(classTaskStore.classListIds.length>0){
|
if(classTaskStore.classListIds.length>0){
|
||||||
listClassworkdataByDeadDate({
|
// listClassworkdataByDeadDate({
|
||||||
classids: classTaskStore.classListIds.join(','),
|
// edituserid: userStore.userId, // 老师的id
|
||||||
edustage: userStore.edustage,// 学段
|
// classids: classTaskStore.classListIds.join(','),
|
||||||
edusubject: userStore.edusubject,//学科
|
// edusubject: userStore.edusubject,//学科
|
||||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
// //status: '1', // 作业状态:1-已发布
|
||||||
orderby: "uniquekey DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
// orderby: "deaddate DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
||||||
pageSize: 1000
|
// pageSize: 1000,
|
||||||
|
// })
|
||||||
|
const ids = classWorkList.value.map((item) => item.id).join(',');
|
||||||
|
listClassworkdata({
|
||||||
|
classworkids: ids,
|
||||||
|
pageSize: 1000,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
for (var t = 0; t < classWorkList.value.length; t++) {
|
for (var t = 0; t < classWorkList.value.length; t++) {
|
||||||
for (var i = 0; i < res.rows.length; i++) {
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
@ -288,7 +293,7 @@ const getStudentClassWorkData = () => {
|
||||||
|
|
||||||
// 计算参与学习任务的平均用时
|
// 计算参与学习任务的平均用时
|
||||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||||
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
||||||
} else {
|
} else {
|
||||||
classWorkList.value[t].averagetime = 0
|
classWorkList.value[t].averagetime = 0
|
||||||
}
|
}
|
||||||
|
@ -370,12 +375,13 @@ const getStudentVisible = async () => {
|
||||||
// 班级作业数据,多个班级
|
// 班级作业数据,多个班级
|
||||||
const response = await listByDeadDate({
|
const response = await listByDeadDate({
|
||||||
classidarray: classTaskStore.classListIds.join(','),
|
classidarray: classTaskStore.classListIds.join(','),
|
||||||
|
edituserid: userStore.userId, // 老师的id
|
||||||
edustage: userStore.edustage,// 学段
|
edustage: userStore.edustage,// 学段
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||||
orderby: 'uniquekey DESC',
|
orderby: 'deaddate DESC',
|
||||||
pageSize: 100
|
pageSize: 100
|
||||||
})
|
})
|
||||||
const curWorkList = response.rows
|
const curWorkList = response.rows
|
||||||
|
@ -400,7 +406,7 @@ const getStudentVisible = async () => {
|
||||||
)
|
)
|
||||||
// 计算参与学习任务的平均用时
|
// 计算参与学习任务的平均用时
|
||||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||||
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
||||||
} else {
|
} else {
|
||||||
classWorkList.value[t].averagetime = 0
|
classWorkList.value[t].averagetime = 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -539,6 +539,10 @@ const workHandle = (type) => {
|
||||||
classWorkAnalysis.view = type
|
classWorkAnalysis.view = type
|
||||||
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
||||||
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
||||||
|
// 每次进来都重新调用一次
|
||||||
|
if(type == 'quizStats') {
|
||||||
|
getWorkFeedList();
|
||||||
|
}
|
||||||
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
// 轮询 更新学生作答数据
|
// 轮询 更新学生作答数据
|
||||||
|
|
|
@ -17,7 +17,13 @@
|
||||||
<div class="respond">
|
<div class="respond">
|
||||||
<div class="c-label">
|
<div class="c-label">
|
||||||
<b t1>作答情况</b>
|
<b t1>作答情况</b>
|
||||||
|
<template v-if="item.type=='单选题'||item.type == '多选题'||item.type == '判断题'">
|
||||||
|
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人-</span>
|
||||||
|
<span>回答正确 <el-text type="danger">{{item.rightSum}}</el-text> 人)</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人)</span>
|
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人)</span>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="c-childen">
|
<div class="c-childen">
|
||||||
<template v-for="(it, ind) in item.children">
|
<template v-for="(it, ind) in item.children">
|
||||||
|
@ -111,6 +117,14 @@ colorArr = [
|
||||||
onMounted(() => {})
|
onMounted(() => {})
|
||||||
|
|
||||||
// === 方法(methods) ===
|
// === 方法(methods) ===
|
||||||
|
|
||||||
|
const isSame = (a,b) => {
|
||||||
|
if (a.length != b.length) return false
|
||||||
|
return !a.some(v => !b.includes(v))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 初始-数据处理
|
||||||
// 初始-数据处理
|
// 初始-数据处理
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
// console.log('xxx', props)
|
// console.log('xxx', props)
|
||||||
|
@ -124,43 +138,128 @@ const initData = () => {
|
||||||
const workdesc = o.workdesc || ''
|
const workdesc = o.workdesc || ''
|
||||||
let accSum = 0 // 该题总人数
|
let accSum = 0 // 该题总人数
|
||||||
let activeIds = [] // 已做答学生
|
let activeIds = [] // 已做答学生
|
||||||
|
let rightIds = [] // 正确学生
|
||||||
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
||||||
let children = []
|
let children = []
|
||||||
if (['单选题','多选题'].includes(o.worktype)) { // '单选题','多选题'
|
const allStudents = [];
|
||||||
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[]
|
if (o.worktype == '单选题') { // '单选题','多选题'
|
||||||
|
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
|
||||||
|
children = list.map((v,i) => {
|
||||||
|
const code = toCode(i) // 转换 A-Z
|
||||||
|
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
||||||
|
// 改选项的学生id
|
||||||
|
const studentIds = quizFeedList.filter(f => f.feedcontent==v&&f.finishtimelength!='0').map(f => f.studentid)||[];
|
||||||
|
accSum += studentIds.length;
|
||||||
|
if (isOk) {
|
||||||
|
activeIds.push(...studentIds)
|
||||||
|
}
|
||||||
|
return { def: v, code, isOk, studentIds }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else if (o.worktype == '多选题') {
|
||||||
|
// 多选题的正确率单独处理
|
||||||
|
rightIds = quizFeedList.filter(f => {
|
||||||
|
const workanswer = (isJson(o.workanswer)) ? JSON.parse(o.workanswer) : o.workanswer || [];
|
||||||
|
const res = isSame((f.feedcontent||'').split(','), workanswer);
|
||||||
|
return f.entpcourseworkid == o.id && f.finishtimelength!='0' && res;
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
|
||||||
children = list.map((v,i) => {
|
children = list.map((v,i) => {
|
||||||
const isOne = o.worktype == '单选题'
|
const isOne = o.worktype == '单选题'
|
||||||
const code = toCode(i) // 转换 A-Z
|
const code = toCode(i) // 转换 A-Z
|
||||||
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // 是否(包含)正确答案
|
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // 是否(包含)正确答案
|
||||||
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
||||||
// 改选项的学生id
|
// 改选项的学生id
|
||||||
const studentIds = quizFeedList.filter(f => isOne ? f.feedcontent==v : f.feedcontent.includes(i)).map(f => f.studentid)||[]
|
const studentIds = quizFeedList.filter(f => f.feedcontent.includes(i)&&f.finishtimelength!='0').map(f => f.studentid)||[];
|
||||||
accSum += studentIds.length
|
accSum += studentIds.length;
|
||||||
if(isOk) isOne ? activeIds.push(...studentIds) : activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
if (studentIds.length>0) {
|
||||||
|
allStudents.push(...studentIds);
|
||||||
|
}
|
||||||
|
if(isOk) {
|
||||||
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
|
}
|
||||||
return { def: v, code, isOk, studentIds }
|
return { def: v, code, isOk, studentIds }
|
||||||
})
|
})
|
||||||
} else if (o.worktype == '填空题') { // 填空题
|
}
|
||||||
|
else if (o.worktype == '填空题') { // 填空题
|
||||||
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||||
children = (o.title||'').match(regex).map((v,i) => {
|
children = (o.title||'').match(regex).map((v,i) => {
|
||||||
const def = `填空项 ${i+1}`
|
const def = `填空项 ${i+1}`
|
||||||
const code = '( )', txt=v
|
//const code = '( )'
|
||||||
|
const code = '(略)', txt=v
|
||||||
// 改选项的学生id
|
// 改选项的学生id
|
||||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i]).map(f => f.studentid)||[]
|
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i] && f.finishtimelength!='0').map(f => f.studentid)||[]
|
||||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
accSum = activeIds.length
|
accSum = activeIds.length
|
||||||
return { def, code, txt, isOk:true, studentIds }
|
return { def, code, txt, isOk:true, studentIds }
|
||||||
})
|
})
|
||||||
} else if (o.worktype == '论述题') { // 论述题
|
} else if (o.worktype == '判断题') { // 判断题
|
||||||
const code = '( )', def = '论述内容'
|
const list = ['正确', '错误'];
|
||||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')).map(f => f.studentid)||[]
|
children = list.map((v,i) => {
|
||||||
|
const workanswer = o.workanswer
|
||||||
|
.replace('×', '0')
|
||||||
|
.replace('√', '1')
|
||||||
|
.replace('错误', '0')
|
||||||
|
.replace('正确', '1')
|
||||||
|
.replace('正确。', '1')
|
||||||
|
.replace('F', '0')
|
||||||
|
.replace('T', '1')
|
||||||
|
.replace('错', '0')
|
||||||
|
.replace('对', '1');
|
||||||
|
const workanswerFormat = isJson(workanswer) ? JSON.parse(workanswer) : workanswer||''
|
||||||
|
const code = v=='正确' ? '1' : '0'
|
||||||
|
let isOk = (workanswerFormat).includes(code)
|
||||||
|
// warn: 看是否需要转为回答正常的显示, 当前为学生实际回答字面的正确和错误
|
||||||
|
// if (workanswerFormat == '0') {
|
||||||
|
// isOk = !isOk;
|
||||||
|
// }
|
||||||
|
// 改选项的学生id
|
||||||
|
const studentIds = quizFeedList.filter(f => {
|
||||||
|
const feedcontent = f.feedcontent
|
||||||
|
.replace('×', '0')
|
||||||
|
.replace('√', '1')
|
||||||
|
.replace('错误', '0')
|
||||||
|
.replace('正确', '1')
|
||||||
|
.replace('正确。', '1')
|
||||||
|
.replace('F', '0')
|
||||||
|
.replace('T', '1')
|
||||||
|
.replace('错', '0')
|
||||||
|
.replace('对', '1');
|
||||||
|
if(feedcontent == code&&f.finishtimelength!='0'){
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
}).map(f => f.studentid)||[];
|
||||||
|
accSum += studentIds.length;
|
||||||
|
if(isOk) activeIds.push(...studentIds)
|
||||||
|
return { def: v, code: v, isOk, studentIds }
|
||||||
|
})
|
||||||
|
} else { // 论述题
|
||||||
|
// code = '( )'
|
||||||
|
const code = '(略)', def = '解答内容'
|
||||||
|
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')&&f.finishtimelength!='0').map(f => f.studentid)||[]
|
||||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
accSum = activeIds.length
|
accSum = activeIds.length
|
||||||
children = [{ def, code, isOk:true, studentIds }]
|
children = [{ def, code, isOk:true, studentIds }]
|
||||||
}
|
}
|
||||||
|
|
||||||
const studentSum = studentList.value.length || 0 // 当前推送答题人数
|
const studentSum = studentList.value.length || 0 // 当前推送答题人数
|
||||||
const points = percent((activeIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
let points = percent((activeIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
||||||
|
let rightSum = activeIds.length; // 回答正确人数
|
||||||
|
|
||||||
|
// 多选题单独处理
|
||||||
|
if (o.worktype == '多选题') {
|
||||||
|
// 单独重新处理人数问题
|
||||||
|
const uniqueTmpStuents = [...new Set(allStudents)];
|
||||||
|
accSum = uniqueTmpStuents.length;
|
||||||
|
// 单独处理得分率
|
||||||
|
points = percent((rightIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
||||||
|
// 回答正确人数
|
||||||
|
rightSum = rightIds.length;
|
||||||
|
}
|
||||||
|
|
||||||
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
||||||
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, children }
|
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children }
|
||||||
})
|
})
|
||||||
console.log('获取数据: ', data)
|
console.log('获取数据: ', data)
|
||||||
dataList.value = data
|
dataList.value = data
|
||||||
|
@ -170,7 +269,7 @@ const ratio_1 = (row, sum = 1) => percent(((row.studentIds.length||0) / (sum||1)
|
||||||
// 获取-该题-完成进度
|
// 获取-该题-完成进度
|
||||||
const ratio_2 = row => percent(((row.accSum||0) / (studentList.value.length||1)).toFixed(2))
|
const ratio_2 = row => percent(((row.accSum||0) / (studentList.value.length||1)).toFixed(2))
|
||||||
// 获取-该题进度-txt
|
// 获取-该题进度-txt
|
||||||
const getRatioTxt = row => row.type.includes('选题') ? '得分率' : '完成度'
|
const getRatioTxt = row => ['单选题', '多选题', '判断题'].includes(row.type) ? '得分率' : '完成度'
|
||||||
// 获取-进度条状态-左侧
|
// 获取-进度条状态-左侧
|
||||||
const getStatus = row => row.isOk ? 'success' : 'exception'
|
const getStatus = row => row.isOk ? 'success' : 'exception'
|
||||||
// 获取-学生姓名(id)
|
// 获取-学生姓名(id)
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<div class="class-reserv-item-tool">
|
<div class="class-reserv-item-tool">
|
||||||
<span>
|
<span>
|
||||||
<!-- {{ item.averagetime?item.averagetime:0 }} -->
|
<!-- {{ item.averagetime?item.averagetime:0 }} -->
|
||||||
<span v-if=" item.averagetime<60 ">
|
<!-- <span v-if=" item.averagetime<60 ">
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||||
</span>
|
</span>
|
||||||
<span v-if=" item.averagetime==60 ">
|
<span v-if=" item.averagetime==60 ">
|
||||||
|
@ -39,7 +39,8 @@
|
||||||
<span v-if=" item.averagetime>60 ">
|
<span v-if=" item.averagetime>60 ">
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
|
||||||
</span>
|
</span> -->
|
||||||
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||||
</span>
|
</span>
|
||||||
<span>平均用时</span>
|
<span>平均用时</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,30 +34,15 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { getSelfReserv } from '@/api/classManage'
|
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
|
|
||||||
const type = ref(-1)
|
|
||||||
const user = useUserStore().user
|
const user = useUserStore().user
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const classList = ref([])
|
|
||||||
const homeworkList = ref([])
|
const homeworkList = ref([])
|
||||||
const itemDialogRef = ref(null)
|
const itemDialogRef = ref(null)
|
||||||
|
|
||||||
// 获取上课
|
|
||||||
const getClass = async () => {
|
|
||||||
loading.value = true
|
|
||||||
try {
|
|
||||||
const res = await getSelfReserv()
|
|
||||||
let list = res.data || []
|
|
||||||
list.sort((a, b) => { if (a.status == '上课中') return -1; else return 0 })
|
|
||||||
classList.value = list.filter(item => item.status !== '已结束')
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取作业
|
// 获取作业
|
||||||
const getHomework = async () => {
|
const getHomework = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
@ -65,7 +50,8 @@ const getHomework = async () => {
|
||||||
try {
|
try {
|
||||||
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
|
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
|
||||||
// 只展示进行中的
|
// 只展示进行中的
|
||||||
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
|
// homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
|
||||||
|
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getTomorrow() <= item.deaddate) //大于今天的才算进行中
|
||||||
homeworkList.value.forEach((item) => {
|
homeworkList.value.forEach((item) => {
|
||||||
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
||||||
// 如果是习题训练任务,则检查一共有多少道
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
@ -98,16 +84,16 @@ const tagType = (time) => {
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// getClass()
|
|
||||||
getHomework()
|
getHomework()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.desktop-work-item {
|
.desktop-work-item {
|
||||||
align-items: center;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
.item-title {
|
.item-title {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -126,7 +112,7 @@ onMounted(() => {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
height: calc(100% - 60px);
|
flex: 1;
|
||||||
|
|
||||||
.class-item {
|
.class-item {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page-desktop">
|
<div class="page-desktop">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20" style="height: 100%;">
|
||||||
<el-col :span="17">
|
<el-col :span="17" class="desktop-left">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
||||||
<div class="desktop-item">
|
<div class="desktop-item">
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row style="height: 100%;">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="desktop-item">
|
<div class="desktop-item-chart">
|
||||||
<div class="item-title flex">
|
<div class="item-title flex">
|
||||||
<span>教学进度</span>
|
<span>教学进度</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7" style="flex: 1;">
|
||||||
<!--工作动态-->
|
<!--工作动态-->
|
||||||
<workTrend/>
|
<workTrend/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -42,11 +42,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick } from 'vue'
|
import { ref, onMounted, nextTick } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import * as echarts from 'echarts'
|
||||||
import workTrend from './container/work-trend.vue'
|
import workTrend from './container/work-trend.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
|
import { debounce } from 'lodash'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
@ -191,6 +192,10 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcRenderer.on('minWinResize', debounce((e, data) =>{
|
||||||
|
chartInstance.resize()
|
||||||
|
}, 100))
|
||||||
|
|
||||||
onMounted(async ()=>{
|
onMounted(async ()=>{
|
||||||
|
|
||||||
await useGetSubject()
|
await useGetSubject()
|
||||||
|
@ -250,7 +255,10 @@ onMounted(async ()=>{
|
||||||
.page-desktop{
|
.page-desktop{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
|
.desktop-left{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.desktop-item{
|
.desktop-item{
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
.item-title{
|
.item-title{
|
||||||
|
@ -298,12 +306,30 @@ onMounted(async ()=>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.chart-box{
|
|
||||||
height: 220px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.desktop-item-chart{
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.item-title{
|
||||||
|
height: 32px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.item-content{
|
||||||
|
background: #fff;
|
||||||
|
flex: 1;
|
||||||
|
.chart-box{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -583,11 +583,7 @@ export default {
|
||||||
this.uploadData.levelSecondId = cata[1]
|
this.uploadData.levelSecondId = cata[1]
|
||||||
this.uploadData.levelThirdId = cata[2]
|
this.uploadData.levelThirdId = cata[2]
|
||||||
this.uploadData.textbookId = data.textBook.curBookId
|
this.uploadData.textbookId = data.textBook.curBookId
|
||||||
toolStore.curSubjectNode.data = data
|
|
||||||
// 不要同时修改共享数据,这样只会触发一次
|
|
||||||
this.$nextTick(() => {
|
|
||||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||||
})
|
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
},
|
},
|
||||||
|
|
|
@ -47,6 +47,7 @@ import { listEvaluation } from '@/api/subject/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { clearBookInfo } from '@/utils/ruoyi'
|
import { clearBookInfo } from '@/utils/ruoyi'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
|
@ -148,7 +149,14 @@ function submit() {
|
||||||
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
||||||
userStore.getInfo().then(res => {
|
userStore.getInfo().then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
clearBookInfo()
|
let sessionSubject = {
|
||||||
|
bookList: null,
|
||||||
|
curBook: null,
|
||||||
|
curNode: null,
|
||||||
|
defaultExpandedKeys: [],
|
||||||
|
subjectTree: []
|
||||||
|
}
|
||||||
|
sessionStore.set( 'subject', sessionSubject)
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(response.msg)
|
ElMessage.error(response.msg)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
||||||
</div>
|
</div>
|
||||||
<div class="stand-head-right">
|
<div class="stand-head-right">
|
||||||
<div class="stand-head-right-tit">{{booktitle}}</div>
|
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName : ''}}</div>
|
||||||
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
||||||
<div class="stand-head-right-row">
|
<div class="stand-head-right-row">
|
||||||
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
||||||
|
@ -68,11 +68,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
|
<el-dialog v-model="dialogVisible" title="切换课标" append-to-body width="550">
|
||||||
<div class="booklist">
|
<div class="booklist">
|
||||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
||||||
<el-image class="bookimg" :src="item.avartar" />
|
<el-image class="bookimg" :src="item.avartar" />
|
||||||
<div class="bookname">{{item.fileurl.replace('.txt', '')}}</div>
|
<div class="bookname">{{item.bookName}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -105,7 +105,6 @@ const headref = ref(null);
|
||||||
const searchref = ref(null);
|
const searchref = ref(null);
|
||||||
const listHeight = ref(0);
|
const listHeight = ref(0);
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const booktitle = ref('');
|
|
||||||
const bookInfo = ref(null);
|
const bookInfo = ref(null);
|
||||||
const booksel = ref(0);
|
const booksel = ref(0);
|
||||||
const bookList = ref([])
|
const bookList = ref([])
|
||||||
|
@ -246,23 +245,24 @@ const getAllSubject = async () => {
|
||||||
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
||||||
const { edustage, edusubject } = userStore.user;
|
const { edustage, edusubject } = userStore.user;
|
||||||
rows && rows.map(item => {
|
rows && rows.map(item => {
|
||||||
if(item.edustage === edustage && item.edusubject === edusubject){
|
if(edustage === item.edustage && item.edusubject === edusubject){
|
||||||
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
|
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}
|
||||||
}
|
}
|
||||||
if(item.fileurl !== ''){
|
if(item.fileurl !== ''){
|
||||||
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
||||||
booksel.value = textselidx
|
booksel.value = textselidx
|
||||||
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
|
|
||||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
|
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
|
||||||
await loadPdfAnimation(filePath)
|
await loadPdfAnimation(filePath)
|
||||||
}
|
}
|
||||||
|
const bookNameFormat = (edustage,edusubject) => {
|
||||||
|
return `${edustage}-${edusubject}`
|
||||||
|
}
|
||||||
const bookChange = async (item, idx) => {
|
const bookChange = async (item, idx) => {
|
||||||
booksel.value = idx
|
booksel.value = idx
|
||||||
bookInfo.value = {...item}
|
bookInfo.value = {...item}
|
||||||
booktitle.value = item.fileurl.replace('.txt','')
|
|
||||||
pdfUrl.value = '';
|
pdfUrl.value = '';
|
||||||
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
||||||
await loadPdfAnimation(filepath)
|
await loadPdfAnimation(filepath)
|
||||||
|
@ -539,9 +539,9 @@ onMounted(async () => {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
height: 180px;
|
height: 180px;
|
||||||
}
|
}
|
||||||
.name{
|
.bookname{
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #3b3b3b;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item:hover{
|
.item:hover{
|
||||||
|
|
|
@ -244,19 +244,17 @@ const getData = (data) => {
|
||||||
// 获取学科
|
// 获取学科
|
||||||
const getAllSubject = async () => {
|
const getAllSubject = async () => {
|
||||||
const { edustage, edusubject } = userStore.user;
|
const { edustage, edusubject } = userStore.user;
|
||||||
const { rows } = await listEvaluation({ itemkey: "version", edustage, edusubject, pageSize: 500 })
|
const { rows } = await listEvaluation({ itemkey: "version", edustage, edusubject, orderby: 'orderidx asc', pageSize: 500 })
|
||||||
rows && rows.map(item => {
|
const dataList = [];
|
||||||
if(item.edustage === edustage && item.edusubject === edusubject){
|
rows && rows.map((item,idx) => {
|
||||||
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
|
|
||||||
}
|
|
||||||
if(item.fileurl !== ''){
|
if(item.fileurl !== ''){
|
||||||
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
bookList.value = dataList
|
||||||
booksel.value = textselidx
|
bookInfo.value = {...dataList[0],avartar: dataList[0].avartar}
|
||||||
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
|
booktitle.value = dataList[0].fileurl.replace('.txt','')
|
||||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
|
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + dataList[0].fileurl.replace('.txt','.pdf')
|
||||||
await loadPdfAnimation(filePath)
|
await loadPdfAnimation(filePath)
|
||||||
}
|
}
|
||||||
const bookChange = async (item, idx) => {
|
const bookChange = async (item, idx) => {
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<span class="unit-top-center">选择目录</span>
|
<span class="unit-top-center">选择目录</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="unit-content">
|
<div class="unit-content">
|
||||||
<Lesson @changeChapter="changeChapter" />
|
<Lesson @changeChapter="changeChapter" :curNode="curNode.data" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -70,19 +70,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, toRaw } from 'vue';
|
import { ref, onMounted, toRaw, nextTick, reactive } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { getSmarttalkPage } from '@/api/file'
|
import { getSmarttalkPage } from '@/api/file'
|
||||||
import SetHomework from '@/components/set-homework/index.vue'
|
import SetHomework from '@/components/set-homework/index.vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool'
|
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import Lesson from './lesson.vue';
|
import Lesson from './lesson.vue';
|
||||||
import { parseCataByNode } from '@/utils/talkFile'
|
import { parseCataByNode } from '@/utils/talkFile'
|
||||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
||||||
import { createHomework } from '../createHomework'
|
import { createHomework } from '../createHomework'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const usertore = useUserStore().user
|
const usertore = useUserStore().user
|
||||||
|
@ -99,6 +100,10 @@ const resourceList = ref([])
|
||||||
//当前点击的数据
|
//当前点击的数据
|
||||||
const curRow = ref('')
|
const curRow = ref('')
|
||||||
|
|
||||||
|
const curNode = reactive({
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
|
||||||
const sendHomework = (row) => {
|
const sendHomework = (row) => {
|
||||||
curRow.value = row
|
curRow.value = row
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -118,6 +123,7 @@ const successHomework = (data)=>{
|
||||||
}
|
}
|
||||||
// 章节目录change
|
// 章节目录change
|
||||||
const changeChapter = async (data)=>{
|
const changeChapter = async (data)=>{
|
||||||
|
curNode.data = data
|
||||||
const { res } = await useGetHomework(data)
|
const { res } = await useGetHomework(data)
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
let cata = parseCataByNode(data)
|
let cata = parseCataByNode(data)
|
||||||
|
@ -177,10 +183,10 @@ const getResource = () => {
|
||||||
|
|
||||||
//获取作业数据
|
//获取作业数据
|
||||||
const getHomework = async () => {
|
const getHomework = async () => {
|
||||||
const data = toRaw(toolStore.curSubjectNode).data.node
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const { res } = await useGetHomework(data)
|
const { res } = await useGetHomework(curNode.data)
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
@ -203,13 +209,16 @@ function leave(el, done) {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
await nextTick()
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
setTimeout(()=>{
|
// 当前节点 mounted 的时候从缓存里拿
|
||||||
|
curNode.data = sessionStore.get('subject.curNode')
|
||||||
getHomework()
|
getHomework()
|
||||||
getResource()
|
getResource()
|
||||||
},200)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode.data.id" highlight-current
|
||||||
@node-click="handleNodeClick">
|
@node-click="handleNodeClick">
|
||||||
<template #default="{ node }">
|
<template #default="{ node }">
|
||||||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||||
|
@ -13,133 +13,60 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick, toRaw } from 'vue'
|
import { ref, reactive, onMounted, toRaw, watch } from 'vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
const emit = defineEmits(['changeChapter'])
|
const emit = defineEmits(['changeChapter'])
|
||||||
|
const props = defineProps(['curNode'])
|
||||||
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'label',
|
label: 'itemtitle',
|
||||||
class: 'textbook-tree'
|
class: 'textbook-tree'
|
||||||
}
|
}
|
||||||
// 当前选中的节点ID
|
const currentNode = reactive({
|
||||||
const currentNodeId = ref(0)
|
data: {}
|
||||||
// 当前选中的节点名称
|
})
|
||||||
const currentNodeName = ref('')
|
|
||||||
|
watch(() => props.curNode , (newVal) =>{
|
||||||
|
currentNode.data = newVal
|
||||||
|
console.log(currentNode.data)
|
||||||
|
},
|
||||||
|
{deep: true, immediate: true})
|
||||||
|
|
||||||
// 默认展开的节点
|
// 默认展开的节点
|
||||||
const defaultExpandedKeys = ref([])
|
const defaultExpandedKeys = ref([])
|
||||||
// tree
|
// tree
|
||||||
const refTree = ref(null)
|
const refTree = ref(null)
|
||||||
// 教材ID
|
|
||||||
const curBookId = ref('')
|
|
||||||
//
|
|
||||||
const evaluationList = ref([])
|
|
||||||
|
|
||||||
const getTreeData = () => {
|
const handleNodeClick = (data) => {
|
||||||
evaluationList.value = JSON.parse(localStorage.getItem('unitList'))
|
|
||||||
|
|
||||||
//上册
|
|
||||||
/**
|
|
||||||
* 不区分上下册
|
|
||||||
* 2024/08/20调整
|
|
||||||
*/
|
|
||||||
let volumeOne = evaluationList.value.filter(item => item.level == 1)
|
|
||||||
|
|
||||||
//数据过滤
|
|
||||||
|
|
||||||
let upData = transData(volumeOne)
|
|
||||||
if(upData.length){
|
|
||||||
treeData.value = [...upData]
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
treeData.value = []
|
|
||||||
return
|
|
||||||
}
|
|
||||||
nextTick(() => {
|
|
||||||
let defaultKey
|
|
||||||
if(toolStore.curSubjectNode.querySearch.levelSecondId){
|
|
||||||
defaultKey = toolStore.curSubjectNode.querySearch.levelSecondId
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
defaultKey = toolStore.curSubjectNode.querySearch.levelFirstId
|
|
||||||
}
|
|
||||||
currentNodeId.value = defaultKey
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleNodeClick = (data, node) => {
|
|
||||||
/**
|
/**
|
||||||
* data : 当前节点数据
|
* data : 当前节点数据
|
||||||
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
|
||||||
*/
|
*/
|
||||||
|
currentNode.data = data
|
||||||
|
let nodeData = cloneDeep(toRaw(data));
|
||||||
|
|
||||||
const nodeData = data;
|
//增加一个label 之前取的label
|
||||||
const parentNode = node.parent.data;
|
nodeData.label = nodeData.itemtitle
|
||||||
|
// 父级节点 如果当前是一级节点 父级则为null
|
||||||
if (Array.isArray(parentNode)) {
|
let parent = {
|
||||||
nodeData.parentNode = null
|
id: nodeData.parentid,
|
||||||
|
label: nodeData.parenttitle,
|
||||||
|
itemtitle: nodeData.parenttitle
|
||||||
}
|
}
|
||||||
else {
|
const parentNode = nodeData.parentid ? parent : null
|
||||||
nodeData.parentNode = parentNode
|
nodeData.parentNode = parentNode
|
||||||
}
|
|
||||||
|
|
||||||
emit('changeChapter', toRaw(nodeData))
|
emit('changeChapter', 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 = {}
|
|
||||||
if (item.rootid == curBookId.value) {
|
|
||||||
obj.label = item.itemtitle
|
|
||||||
obj.id = item.id
|
|
||||||
obj.itemtitle = item.itemtitle
|
|
||||||
obj.edudegree = item.edudegree
|
|
||||||
obj.edustage = item.edustage
|
|
||||||
obj.edusubject = item.edusubject
|
|
||||||
let ary2 = []
|
|
||||||
evaluationList.value.forEach(el => {
|
|
||||||
let obj2 = {}
|
|
||||||
if (item.id == el.parentid) {
|
|
||||||
obj2 = {
|
|
||||||
label: el.itemtitle,
|
|
||||||
id: el.id,
|
|
||||||
itemtitle : el.itemtitle,
|
|
||||||
edudegree : el.edudegree,
|
|
||||||
edustage : el.edustage,
|
|
||||||
edusubject : el.edusubject,
|
|
||||||
}
|
|
||||||
ary2.push(obj2)
|
|
||||||
}
|
|
||||||
obj.children = ary2
|
|
||||||
})
|
|
||||||
ary.push(obj)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return ary
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
setTimeout(()=>{
|
treeData.value = sessionStore.get('subject.subjectTree')
|
||||||
let data = toRaw(toolStore.curSubjectNode)
|
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
||||||
curBookId.value = data.data.textBook.curBookId
|
|
||||||
getTreeData()
|
|
||||||
},500)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue