Compare commits
No commits in common. "8eff515fd8df86e2c5972d2b052f4f9c2cc7b89c" and "cf3809773943529c39c34e01f8e4bd875ff67e36" have entirely different histories.
8eff515fd8
...
cf38097739
|
@ -17,7 +17,7 @@
|
|||
"build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
|
||||
"build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
|
||||
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
|
||||
"build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml",
|
||||
"build:mac": "npm run build && electron-builder --mac",
|
||||
"build:linux": "npm run build && electron-builder --linux"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -88,10 +88,9 @@ function createLoginWindow() {
|
|||
//主窗口
|
||||
function createMainWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1350,
|
||||
minWidth: 1200,
|
||||
width: 1200,
|
||||
minWidth: 1350,
|
||||
height: 700,
|
||||
minHeight: 700,
|
||||
show: false,
|
||||
frame: false, // 无边框
|
||||
autoHideMenuBar: true,
|
||||
|
@ -119,11 +118,6 @@ function createMainWindow() {
|
|||
}, 1000)
|
||||
// app.quit() // 主窗口关闭-结束所有进程
|
||||
})
|
||||
mainWindow.on('resize', () => {
|
||||
const { width, height } = mainWindow.getBounds();
|
||||
mainWindow.webContents.send('minWinResize', { width, height });
|
||||
});
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url)
|
||||
return { action: 'deny' }
|
||||
|
@ -135,7 +129,6 @@ function createMainWindow() {
|
|||
} else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
}
|
||||
|
||||
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
|
||||
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
|
||||
// 第三步: 开启remote服务
|
||||
|
|
|
@ -14,14 +14,14 @@ const defaultData = {
|
|||
isPdfWin: false, // pdf窗口是否打开
|
||||
isToolWin: false, // 工具窗口是否打开
|
||||
curSubjectNode: {
|
||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||
querySearch: {} // 查询资源所需参数
|
||||
},
|
||||
subject: { // 不走同步 Pinia
|
||||
subject: {
|
||||
bookList: null, // 教材列表
|
||||
curBook: null, // 当前选中的教材
|
||||
curNode: null, // 当前选中的节点
|
||||
defaultExpandedKeys: [], //展开的节点
|
||||
subjectTree: [] // "树结构" 章节
|
||||
}
|
||||
},
|
||||
local: { // 本地(永久localStorage)
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getAppInstallUrl } from '@/utils/tool'
|
||||
const props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
|
@ -17,7 +16,7 @@ const props = defineProps({
|
|||
/**pdf文件地址 */
|
||||
const pdfUrl = ref('');
|
||||
/**pdfjs文件地址 */
|
||||
const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
||||
const fileUrl = '/pdfjs-dist/web/viewer.html?pagemode=attachments&file=';
|
||||
onMounted(() => {
|
||||
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
||||
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
||||
|
|
|
@ -181,8 +181,6 @@ onMounted( async () => {
|
|||
|
||||
// 章节"树"
|
||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
||||
sessionStore.set('subject.subjectTree',useSubject.getTreeData(curBook.data.id))
|
||||
|
||||
nextTick(() =>{
|
||||
// 默认展开 选中
|
||||
if(sessionStore.get('subject.curNode')){
|
||||
|
|
|
@ -55,7 +55,7 @@ export const useGetSubject = async () =>{
|
|||
treeData = getTreeData(subjectList[0].id)
|
||||
// 设置一个默认的curNode
|
||||
let curNode
|
||||
if(treeData[0].children && treeData[0].children.length){
|
||||
if(treeData[0].children){
|
||||
curNode = treeData[0].children[0]
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<span class="user-name">{{ userStore.user.nickName }}</span>
|
||||
<div class="flex">
|
||||
|
||||
<el-dropdown @command="changeSubject" max-height="500">
|
||||
<el-dropdown @command="changeSubject">
|
||||
<div class="user-subject">{{ userStore.user.edusubject }}
|
||||
<el-icon class="el-icon--right"><arrow-down />
|
||||
</el-icon>
|
||||
|
@ -70,8 +70,10 @@ import { ArrowDown } from '@element-plus/icons-vue'
|
|||
import WindowTools from '@/components/window-tools/index.vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { updateUserInfo } from '@/api/system/user'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import logoIco from '@/assets/images/logo.png'
|
||||
import { listEvaluation } from '@/api/classManage/index'
|
||||
import { clearBookInfo } from '@/utils/ruoyi'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
|
||||
|
@ -178,10 +180,9 @@ const changeSubject = async (command) =>{
|
|||
curBook: null,
|
||||
curNode: null,
|
||||
defaultExpandedKeys: [],
|
||||
subjectTree: []
|
||||
}
|
||||
sessionStore.set( 'subject', sessionSubject)
|
||||
const { userId, userName, plainpwd } = userStore.user
|
||||
const { userId, userName, phonenumber, plainpwd } = userStore.user
|
||||
const data = {
|
||||
userId,
|
||||
userName,
|
||||
|
@ -189,7 +190,7 @@ const changeSubject = async (command) =>{
|
|||
edusubject: command.edusubject
|
||||
}
|
||||
await updateUserInfo(data)
|
||||
await userStore.login({username: userName, password: plainpwd})
|
||||
await userStore.login({username: phonenumber, password: plainpwd})
|
||||
await userStore.getInfo()
|
||||
router.go()
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@ import { sessionStore } from '@/utils/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))
|
||||
|
||||
|
@ -19,6 +16,7 @@ export const useToolState = defineStore('tool', {
|
|||
isPdfWin: false, // pdf窗口是否打开
|
||||
isToolWin: false, // 工具窗口是否打开
|
||||
curSubjectNode: {
|
||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||
querySearch: {} // 查询资源所需参数
|
||||
},
|
||||
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
||||
|
|
|
@ -49,18 +49,6 @@ export const getStaticUrl = (url = '', type = 'app', exitPath = '', isFile = fal
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const getAppInstallUrl = (url = '', type = 'app', exitPath = '', isFile = false) => {
|
||||
if (isDev) return url
|
||||
else { // 生产环境获取-url
|
||||
switch(type) {
|
||||
case 'app': return path.join(__dirname, url) // 应用目录
|
||||
case 'user': return (isFile?'file://':'')+path.join(Remote.app.getAppPath(),exitPath, url) // 用户目录
|
||||
// case 'user': return (isFile?'file://':'')+path.join(Remote.app.getPath('userData'),exitPath, url) // 用户目录
|
||||
default: return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description 消息发送-nodejs 消息发送
|
||||
* @form src/main/tool.js 来源
|
||||
|
@ -149,7 +137,7 @@ export const createWindow = async (type, data) => {
|
|||
winPdf.focus();
|
||||
// toolState.isPdfWin=true
|
||||
}
|
||||
|
||||
|
||||
return
|
||||
}
|
||||
const option = data.option||{}
|
||||
|
@ -284,7 +272,7 @@ const eventHandles = (type, win) => {
|
|||
winPdf=null
|
||||
win&&win.destroy()
|
||||
})
|
||||
|
||||
|
||||
// 监听窗口的激活事件
|
||||
win.on('focus', async () => {
|
||||
console.log('激活窗口')
|
||||
|
@ -311,8 +299,8 @@ const eventHandles = (type, win) => {
|
|||
|
||||
/**
|
||||
* @description 外部跳转-web网页
|
||||
* @param {*} path
|
||||
* @param {*} params
|
||||
* @param {*} path
|
||||
* @param {*} params
|
||||
*/
|
||||
export const toLinkWeb = (path) => {
|
||||
const config = baseConfig()
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
||||
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
|
||||
import { listByDeadDate, listClassworkdataByDeadDate } from '@/api/classTask'
|
||||
|
||||
import TaskItem from '@/views/classTask/container/task-item.vue'
|
||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||
|
@ -109,13 +109,13 @@ const changeEndDate = (val) => {
|
|||
}
|
||||
|
||||
// 获取数据
|
||||
const getData = async () => {
|
||||
const getData = () => {
|
||||
classWorkList.value = []
|
||||
loading.value = true
|
||||
// 1、班级列表
|
||||
getClassList()
|
||||
// 2、班级作业
|
||||
await getClassWorkList()
|
||||
getClassWorkList()
|
||||
// 3、班级学生作业 包含多个班级
|
||||
getStudentClassWorkData()
|
||||
loading.value = false
|
||||
|
@ -133,76 +133,76 @@ const getClassList = () => {
|
|||
/**
|
||||
* 2、获取班级作业
|
||||
*/
|
||||
const getClassWorkList = async () => {
|
||||
const getClassWorkList = () => {
|
||||
if(classTaskStore.classListIds.length>0){
|
||||
// 班级作业数据,包含多个班级 homeworklist
|
||||
const response = await listByDeadDate({
|
||||
listByDeadDate({
|
||||
classidarray: classTaskStore.classListIds.join(','),
|
||||
edituserid: userStore.userId, // 老师的id
|
||||
edustage: userStore.edustage, // 学段
|
||||
edustage: userStore.edustage,// 学段
|
||||
edusubject: userStore.edusubject,//学科
|
||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||
status: '1', // 作业状态:1-已发布
|
||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||
orderby: 'deaddate DESC',
|
||||
orderby: 'uniquekey DESC',
|
||||
pageSize: 100,
|
||||
}).then((response) => {
|
||||
for (var i = 0; i < response.rows.length; i++) {
|
||||
// 初始化部分新增字段值
|
||||
response.rows[i].workdatalist = []
|
||||
response.rows[i].workdatacount = 0 // 人数
|
||||
response.rows[i].workdatalistVisible = false
|
||||
response.rows[i].workdatafeedbackcount = 0 // 已交人数
|
||||
response.rows[i].feedtimelength = 0
|
||||
response.rows[i].rightAnswerCount = 0
|
||||
response.rows[i].scoingRate = 0 + '%' // 得分率
|
||||
response.rows[i].averagetime = 0 // 平均用时
|
||||
|
||||
// ----------------------------------------------
|
||||
// 处理任务类型的UI
|
||||
if (response.rows[i].worktype == '学习目标定位') {
|
||||
response.rows[i].workclass = 'success'
|
||||
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
|
||||
} else if (response.rows[i].worktype == '教材研读') {
|
||||
response.rows[i].workclass = 'primary'
|
||||
} else if (response.rows[i].worktype == '框架梳理') {
|
||||
response.rows[i].workclass = 'warning'
|
||||
} else if (response.rows[i].worktype == '学科定位') {
|
||||
response.rows[i].workclass = 'info'
|
||||
} else if (response.rows[i].worktype == '习题训练') {
|
||||
response.rows[i].workclass = 'danger'
|
||||
} else {
|
||||
response.rows[i].workclass = ''
|
||||
}
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (response.rows[i].entpcourseworklist != '') {
|
||||
response.rows[i].entpcourseworklistarray = JSON.parse(
|
||||
'[' + response.rows[i].entpcourseworklist + ']'
|
||||
)
|
||||
} else {
|
||||
response.rows[i].entpcourseworklistarray = []
|
||||
}
|
||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||
if (
|
||||
response.rows[i].classworkdatastudentids != '' &&
|
||||
response.rows[i].classworkdatastudentids != null &&
|
||||
response.rows[i].classworkdatastudentids != 'null'
|
||||
) {
|
||||
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
|
||||
response.rows[i].workdatacount = stuList.length
|
||||
}
|
||||
}
|
||||
|
||||
// 显示分配人数(workdatacount)>0 的
|
||||
if (response.rows && response.rows.length > 0) {
|
||||
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
total.value = response.total
|
||||
}else{
|
||||
classWorkList.value = []
|
||||
total.value = 0
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
for (var i = 0; i < response.rows.length; i++) {
|
||||
// 初始化部分新增字段值
|
||||
response.rows[i].workdatalist = []
|
||||
response.rows[i].workdatacount = 0 // 人数
|
||||
response.rows[i].workdatalistVisible = false
|
||||
response.rows[i].workdatafeedbackcount = 0 // 已交人数
|
||||
response.rows[i].feedtimelength = 0
|
||||
response.rows[i].rightAnswerCount = 0
|
||||
response.rows[i].scoingRate = 0 + '%' // 得分率
|
||||
response.rows[i].averagetime = 0 // 平均用时
|
||||
|
||||
// ----------------------------------------------
|
||||
// 处理任务类型的UI
|
||||
if (response.rows[i].worktype == '学习目标定位') {
|
||||
response.rows[i].workclass = 'success'
|
||||
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
|
||||
} else if (response.rows[i].worktype == '教材研读') {
|
||||
response.rows[i].workclass = 'primary'
|
||||
} else if (response.rows[i].worktype == '框架梳理') {
|
||||
response.rows[i].workclass = 'warning'
|
||||
} else if (response.rows[i].worktype == '学科定位') {
|
||||
response.rows[i].workclass = 'info'
|
||||
} else if (response.rows[i].worktype == '习题训练') {
|
||||
response.rows[i].workclass = 'danger'
|
||||
} else {
|
||||
response.rows[i].workclass = ''
|
||||
}
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (response.rows[i].entpcourseworklist != '') {
|
||||
response.rows[i].entpcourseworklistarray = JSON.parse(
|
||||
'[' + response.rows[i].entpcourseworklist + ']'
|
||||
)
|
||||
} else {
|
||||
response.rows[i].entpcourseworklistarray = []
|
||||
}
|
||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||
if (
|
||||
response.rows[i].classworkdatastudentids != '' &&
|
||||
response.rows[i].classworkdatastudentids != null &&
|
||||
response.rows[i].classworkdatastudentids != 'null'
|
||||
) {
|
||||
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
|
||||
response.rows[i].workdatacount = stuList.length
|
||||
}
|
||||
}
|
||||
// 显示分配人数(workdatacount)>0 的
|
||||
if (response.rows && response.rows.length > 0) {
|
||||
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
total.value = response.total
|
||||
}else{
|
||||
classWorkList.value = []
|
||||
total.value = 0
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,19 +211,14 @@ const getClassWorkList = async () => {
|
|||
*/
|
||||
const getStudentClassWorkData = () => {
|
||||
if(classTaskStore.classListIds.length>0){
|
||||
// listClassworkdataByDeadDate({
|
||||
// edituserid: userStore.userId, // 老师的id
|
||||
// classids: classTaskStore.classListIds.join(','),
|
||||
// edusubject: userStore.edusubject,//学科
|
||||
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||
// //status: '1', // 作业状态:1-已发布
|
||||
// orderby: "deaddate DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
||||
// pageSize: 1000,
|
||||
// })
|
||||
const ids = classWorkList.value.map((item) => item.id).join(',');
|
||||
listClassworkdata({
|
||||
classworkids: ids,
|
||||
pageSize: 1000,
|
||||
listClassworkdataByDeadDate({
|
||||
classids: classTaskStore.classListIds.join(','),
|
||||
edustage: userStore.edustage,// 学段
|
||||
edusubject: userStore.edusubject,//学科
|
||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||
status: '1', // 作业状态:1-已发布
|
||||
orderby: "uniquekey DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
||||
pageSize: 1000
|
||||
}).then((res) => {
|
||||
for (var t = 0; t < classWorkList.value.length; t++) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
|
@ -290,10 +285,10 @@ const getStudentClassWorkData = () => {
|
|||
|
||||
// 以下四个参数,都要计算
|
||||
// 2024-04-12,酉阳,by jackyshen
|
||||
|
||||
|
||||
// 计算参与学习任务的平均用时
|
||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
||||
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
||||
} else {
|
||||
classWorkList.value[t].averagetime = 0
|
||||
}
|
||||
|
@ -375,13 +370,12 @@ const getStudentVisible = async () => {
|
|||
// 班级作业数据,多个班级
|
||||
const response = await listByDeadDate({
|
||||
classidarray: classTaskStore.classListIds.join(','),
|
||||
edituserid: userStore.userId, // 老师的id
|
||||
edustage: userStore.edustage,// 学段
|
||||
edusubject: userStore.edusubject,//学科
|
||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||
status: '1', // 作业状态:1-已发布
|
||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||
orderby: 'deaddate DESC',
|
||||
orderby: 'uniquekey DESC',
|
||||
pageSize: 100
|
||||
})
|
||||
const curWorkList = response.rows
|
||||
|
@ -406,7 +400,7 @@ const getStudentVisible = async () => {
|
|||
)
|
||||
// 计算参与学习任务的平均用时
|
||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
||||
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
||||
} else {
|
||||
classWorkList.value[t].averagetime = 0
|
||||
}
|
||||
|
|
|
@ -539,10 +539,6 @@ const workHandle = (type) => {
|
|||
classWorkAnalysis.view = type
|
||||
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
||||
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
||||
// 每次进来都重新调用一次
|
||||
if(type == 'quizStats') {
|
||||
getWorkFeedList();
|
||||
}
|
||||
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
||||
if (isOpen) {
|
||||
// 轮询 更新学生作答数据
|
||||
|
|
|
@ -17,13 +17,7 @@
|
|||
<div class="respond">
|
||||
<div class="c-label">
|
||||
<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>
|
||||
</template>
|
||||
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人)</span>
|
||||
</div>
|
||||
<div class="c-childen">
|
||||
<template v-for="(it, ind) in item.children">
|
||||
|
@ -117,14 +111,6 @@ colorArr = [
|
|||
onMounted(() => {})
|
||||
|
||||
// === 方法(methods) ===
|
||||
|
||||
const isSame = (a,b) => {
|
||||
if (a.length != b.length) return false
|
||||
return !a.some(v => !b.includes(v))
|
||||
}
|
||||
|
||||
|
||||
// 初始-数据处理
|
||||
// 初始-数据处理
|
||||
const initData = () => {
|
||||
// console.log('xxx', props)
|
||||
|
@ -138,128 +124,43 @@ const initData = () => {
|
|||
const workdesc = o.workdesc || ''
|
||||
let accSum = 0 // 该题总人数
|
||||
let activeIds = [] // 已做答学生
|
||||
let rightIds = [] // 正确学生
|
||||
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
||||
let children = []
|
||||
const allStudents = [];
|
||||
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):[];
|
||||
if (['单选题','多选题'].includes(o.worktype)) { // '单选题','多选题'
|
||||
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[]
|
||||
children = list.map((v,i) => {
|
||||
const isOne = o.worktype == '单选题'
|
||||
const code = toCode(i) // 转换 A-Z
|
||||
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // 是否(包含)正确答案
|
||||
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
||||
// 改选项的学生id
|
||||
const studentIds = quizFeedList.filter(f => f.feedcontent.includes(i)&&f.finishtimelength!='0').map(f => f.studentid)||[];
|
||||
accSum += studentIds.length;
|
||||
if (studentIds.length>0) {
|
||||
allStudents.push(...studentIds);
|
||||
}
|
||||
if(isOk) {
|
||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||
}
|
||||
const studentIds = quizFeedList.filter(f => isOne ? f.feedcontent==v : f.feedcontent.includes(i)).map(f => f.studentid)||[]
|
||||
accSum += studentIds.length
|
||||
if(isOk) isOne ? activeIds.push(...studentIds) : activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||
return { def: v, code, isOk, studentIds }
|
||||
})
|
||||
}
|
||||
else if (o.worktype == '填空题') { // 填空题
|
||||
} else if (o.worktype == '填空题') { // 填空题
|
||||
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
children = (o.title||'').match(regex).map((v,i) => {
|
||||
const def = `填空项 ${i+1}`
|
||||
//const code = '( )'
|
||||
const code = '(略)', txt=v
|
||||
const code = '( )', txt=v
|
||||
// 改选项的学生id
|
||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i] && f.finishtimelength!='0').map(f => f.studentid)||[]
|
||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i]).map(f => f.studentid)||[]
|
||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||
accSum = activeIds.length
|
||||
return { def, code, txt, isOk:true, studentIds }
|
||||
})
|
||||
} else if (o.worktype == '判断题') { // 判断题
|
||||
const list = ['正确', '错误'];
|
||||
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)||[]
|
||||
} else if (o.worktype == '论述题') { // 论述题
|
||||
const code = '( )', def = '论述内容'
|
||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')).map(f => f.studentid)||[]
|
||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||
accSum = activeIds.length
|
||||
children = [{ def, code, isOk:true, studentIds }]
|
||||
}
|
||||
|
||||
const studentSum = studentList.value.length || 0 // 当前推送答题人数
|
||||
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;
|
||||
}
|
||||
|
||||
const points = percent((activeIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
||||
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
||||
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children }
|
||||
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, children }
|
||||
})
|
||||
console.log('获取数据: ', data)
|
||||
dataList.value = data
|
||||
|
@ -269,7 +170,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))
|
||||
// 获取-该题进度-txt
|
||||
const getRatioTxt = row => ['单选题', '多选题', '判断题'].includes(row.type) ? '得分率' : '完成度'
|
||||
const getRatioTxt = row => row.type.includes('选题') ? '得分率' : '完成度'
|
||||
// 获取-进度条状态-左侧
|
||||
const getStatus = row => row.isOk ? 'success' : 'exception'
|
||||
// 获取-学生姓名(id)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="class-reserv-item-tool">
|
||||
<span>
|
||||
<!-- {{ 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>
|
||||
<span v-if=" item.averagetime==60 ">
|
||||
|
@ -39,8 +39,7 @@
|
|||
<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> -->
|
||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||
</span>
|
||||
</span>
|
||||
<span>平均用时</span>
|
||||
</div>
|
||||
|
|
|
@ -34,15 +34,30 @@
|
|||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getSelfReserv } from '@/api/classManage'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||
|
||||
const type = ref(-1)
|
||||
const user = useUserStore().user
|
||||
const loading = ref(false)
|
||||
const classList = ref([])
|
||||
const homeworkList = ref([])
|
||||
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 () => {
|
||||
loading.value = true
|
||||
|
@ -50,8 +65,7 @@ const getHomework = async () => {
|
|||
try {
|
||||
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 && getTomorrow() <= item.deaddate) //大于今天的才算进行中
|
||||
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
|
||||
homeworkList.value.forEach((item) => {
|
||||
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
|
@ -84,16 +98,16 @@ const tagType = (time) => {
|
|||
|
||||
|
||||
onMounted(() => {
|
||||
// getClass()
|
||||
getHomework()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.desktop-work-item {
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.item-title {
|
||||
height: 32px;
|
||||
text-align: left;
|
||||
|
@ -112,7 +126,7 @@ onMounted(() => {
|
|||
border-radius: 5px;
|
||||
padding: 10px 15px;
|
||||
font-size: 13px;
|
||||
flex: 1;
|
||||
height: calc(100% - 60px);
|
||||
|
||||
.class-item {
|
||||
justify-content: space-between;
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
<template>
|
||||
<div class="page-desktop">
|
||||
<el-row :gutter="20" style="height: 100%;">
|
||||
<el-col :span="17" class="desktop-left">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
||||
<div class="desktop-item">
|
||||
<div class="item-title">{{ item.name }}</div>
|
||||
<div class="item-content">
|
||||
<ul class="flex con-ul">
|
||||
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
|
||||
<i class="iconfont" :class="menu.icon"></i>
|
||||
<span>{{ menu.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="17">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
||||
<div class="desktop-item">
|
||||
<div class="item-title">{{ item.name }}</div>
|
||||
<div class="item-content">
|
||||
<ul class="flex con-ul">
|
||||
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
|
||||
<i class="iconfont" :class="menu.icon"></i>
|
||||
<span>{{ menu.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="height: 100%;">
|
||||
<el-col :span="24">
|
||||
<div class="desktop-item-chart">
|
||||
<div class="item-title flex">
|
||||
<span>教学进度</span>
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<div ref="chartDom" class="chart-box"></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="desktop-item">
|
||||
<div class="item-title flex">
|
||||
<span>教学进度</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="7" style="flex: 1;">
|
||||
<!--工作动态-->
|
||||
<workTrend/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="item-content">
|
||||
<div ref="chartDom" class="chart-box"></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<!--工作动态-->
|
||||
<workTrend/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
@ -42,12 +42,11 @@
|
|||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import * as echarts from 'echarts'
|
||||
import workTrend from './container/work-trend.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import * as echarts from 'echarts'
|
||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { debounce } from 'lodash'
|
||||
|
||||
const router = useRouter()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
@ -192,10 +191,6 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
|||
}
|
||||
}
|
||||
|
||||
ipcRenderer.on('minWinResize', debounce((e, data) =>{
|
||||
chartInstance.resize()
|
||||
}, 100))
|
||||
|
||||
onMounted(async ()=>{
|
||||
|
||||
await useGetSubject()
|
||||
|
@ -255,10 +250,7 @@ onMounted(async ()=>{
|
|||
.page-desktop{
|
||||
height: 100%;
|
||||
padding-top: 20px;
|
||||
.desktop-left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.desktop-item{
|
||||
margin-bottom: 20px;
|
||||
.item-title{
|
||||
|
@ -306,30 +298,12 @@ 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>
|
|
@ -1,14 +1,14 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" width="35%" :close-on-click-modal="false"
|
||||
<el-dialog v-model="visible" width="75%" :close-on-click-modal="false"
|
||||
@close="handleClose">
|
||||
<template #header><div style="width: 100%;text-align: left"><b>开始上课(APT)</b></div></template>
|
||||
<template #header><b>准备开始上课</b></template>
|
||||
<div class="class-all">
|
||||
<el-row>
|
||||
<!-- <el-col :span="10">
|
||||
<el-col :span="10">
|
||||
<c-form v-bind="classForm">
|
||||
<template #item_classid="{prop, form}">
|
||||
<el-select v-model="form[prop]" placeholder="请选择班级">
|
||||
<el-option v-for="item in listData.classList" :value="item.id"
|
||||
<el-option v-for="item in listData.classList" :value="item.id"
|
||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
@ -20,16 +20,8 @@
|
|||
</el-scrollbar>
|
||||
</template>
|
||||
</c-form>
|
||||
</el-col>-->
|
||||
<el-col :span="24">
|
||||
<c-form v-bind="classForm">
|
||||
<template #item_classid="{prop, form}">
|
||||
<el-select v-model="form[prop]" placeholder="请选择班级">
|
||||
<el-option v-for="item in listData.classList" :value="item.id"
|
||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
||||
</el-select>
|
||||
</template>
|
||||
</c-form>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<c-form v-bind="teacherForm">
|
||||
<!-- 上课 -->
|
||||
<template #item_classcourseid="{prop,form}">
|
||||
|
@ -52,7 +44,7 @@
|
|||
<div :title="value" v-if="!!value">
|
||||
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
||||
</div>
|
||||
<!-- <el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>-->
|
||||
<el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>
|
||||
</template>
|
||||
<!-- 手机登录 -->
|
||||
<template #item_mobile>
|
||||
|
@ -98,6 +90,7 @@ const visible = ref(false) // 是否打开窗口
|
|||
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
||||
const imChatRef = ref(null) // im-chat ref
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const classForm = reactive({ // 班级(左侧):表单数据 表单配置
|
||||
form: {}, itemOption: [], option: {}
|
||||
})
|
||||
|
@ -139,7 +132,7 @@ const open = async (id) => {
|
|||
nextTick(async() => {
|
||||
chat = await imChatRef.value?.initImChat()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// 关闭弹窗
|
||||
const handleClose = async () => {
|
||||
|
@ -151,16 +144,15 @@ const handleClose = async () => {
|
|||
// 初始化-数据
|
||||
const initData = () => {
|
||||
// 班级-表单配置
|
||||
classForm.option = { labelW: 80 }
|
||||
classForm.option = { labelW: 40 }
|
||||
classForm.itemOption = [
|
||||
{ label: '班级', prop: 'classid' },
|
||||
// { label: '学生', prop: 'student' },
|
||||
{ label: '学生', prop: 'student' },
|
||||
]
|
||||
// 老师-表单提交
|
||||
teacherForm.form = { classcourseid: 0 }
|
||||
teacherForm.itemOption = [
|
||||
// { label: '班级', prop: 'classid' },
|
||||
// { label: '上课', prop: 'classcourseid' },
|
||||
{ label: '上课', prop: 'classcourseid' },
|
||||
{ label: '老师扫码', prop: 'qrUrl', show: false },
|
||||
{ label: '手机登录', prop: 'mobile', show: false },
|
||||
{ label: '故障备用', prop: 'backup', show: false },
|
||||
|
@ -195,10 +187,10 @@ const getClassList = async () => {
|
|||
return o
|
||||
});
|
||||
// 默认选中第一项
|
||||
/*if (listData.classList.length > 0) {
|
||||
if (listData.classList.length > 0) {
|
||||
classForm.form.classid = listData.classList[0].id
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 获取开课列表 - 历史记录
|
||||
|
@ -225,12 +217,8 @@ const getClasscourseList = async type => {
|
|||
}
|
||||
// 创建课程
|
||||
const createClasscourse = async () => {
|
||||
const { classid } = classForm.form
|
||||
if (!classid) {
|
||||
ElMessage.warning('请选择班级')
|
||||
return
|
||||
}
|
||||
dt.loading = true
|
||||
const { classid } = classForm.form
|
||||
const { entpcourseid, evalid, id, coursetitle } = myClassActive.value // 课件对象
|
||||
const curDate = commUtil.getDateNow('yyyy-MM-dd')
|
||||
const params = {
|
||||
|
@ -341,4 +329,4 @@ defineExpose({
|
|||
.class-all{
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</style>
|
|
@ -2,10 +2,10 @@
|
|||
<el-dialog
|
||||
v-model="centerDialogVisible"
|
||||
class="reserv-dialog"
|
||||
title="开始上课(PPT)"
|
||||
title="上课"
|
||||
destroy-on-close
|
||||
:before-close="closeDialog"
|
||||
width="35%"
|
||||
width="600"
|
||||
style="text-align: left"
|
||||
>
|
||||
<el-form
|
||||
|
@ -15,7 +15,7 @@
|
|||
label-width="auto"
|
||||
style="max-width: 600px"
|
||||
>
|
||||
<!-- <el-form-item label="课程名称" prop="name">
|
||||
<el-form-item label="课程名称" prop="name">
|
||||
<el-input v-model="form.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程类型" prop="type">
|
||||
|
@ -59,21 +59,17 @@
|
|||
/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item label-width="80px" label="班级" prop="resource">
|
||||
<el-select v-model="form.resource" placeholder="请选择班级">
|
||||
<el-option v-for="(item, index) in classList" :value="item.id"
|
||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
||||
</el-select>
|
||||
<!-- <el-checkbox-group v-model="form.resource">
|
||||
</el-form-item>
|
||||
<el-form-item label="授课对象" prop="resource">
|
||||
<el-checkbox-group v-model="form.resource">
|
||||
<el-checkbox v-for="(item, index) in classList" :key="index" name="type" :value="item.id"
|
||||
>{{ item.caption }}({{ item.classstudentcount }})人
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>-->
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="教室" prop="classRoom">
|
||||
<el-form-item label="教室" prop="classRoom">
|
||||
<el-input v-model="form.classRoom" />
|
||||
</el-form-item>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
|
@ -276,7 +272,7 @@ const updateClassReserv = (formData) => {
|
|||
})
|
||||
}
|
||||
const addClassReserv = (formData) => {
|
||||
let ids = formData.resource
|
||||
let ids = formData.resource.join(',')
|
||||
// 判断是否添加教材
|
||||
if(!props.bookId){
|
||||
ElMessage.warning('请选择教材')
|
||||
|
@ -297,10 +293,10 @@ const addClassReserv = (formData) => {
|
|||
addSmartClassReserv(param).then((res) => {
|
||||
if (res.msg) {
|
||||
closeDialog()
|
||||
/*ElMessage({
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '预约成功!'
|
||||
})*/
|
||||
})
|
||||
emit('addSuccess',res.msg)
|
||||
} else {
|
||||
ElMessage({
|
||||
|
|
|
@ -313,6 +313,7 @@ export default {
|
|||
this.openReserv()
|
||||
}
|
||||
if(item.fileFlag === 'apt') {
|
||||
//TODO 打开apt - fileId: aptId
|
||||
this.$refs.calssRef.open(item.fileId)
|
||||
}
|
||||
// 当前上课-store
|
||||
|
@ -583,7 +584,11 @@ export default {
|
|||
this.uploadData.levelSecondId = cata[1]
|
||||
this.uploadData.levelThirdId = cata[2]
|
||||
this.uploadData.textbookId = data.textBook.curBookId
|
||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||
toolStore.curSubjectNode.data = data
|
||||
// 不要同时修改共享数据,这样只会触发一次
|
||||
this.$nextTick(() => {
|
||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||
})
|
||||
this.initHomeWork()
|
||||
await this.asyncAllFile()
|
||||
},
|
||||
|
|
|
@ -47,7 +47,6 @@ import { listEvaluation } from '@/api/subject/index'
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import { clearBookInfo } from '@/utils/ruoyi'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const props = defineProps({
|
||||
user: {
|
||||
|
@ -149,14 +148,7 @@ function submit() {
|
|||
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
||||
userStore.getInfo().then(res => {
|
||||
if(res.code === 200){
|
||||
let sessionSubject = {
|
||||
bookList: null,
|
||||
curBook: null,
|
||||
curNode: null,
|
||||
defaultExpandedKeys: [],
|
||||
subjectTree: []
|
||||
}
|
||||
sessionStore.set( 'subject', sessionSubject)
|
||||
clearBookInfo()
|
||||
ElMessage.success('修改成功')
|
||||
}else{
|
||||
ElMessage.error(response.msg)
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<span class="unit-top-center">选择目录</span>
|
||||
</div>
|
||||
<div class="unit-content">
|
||||
<Lesson @changeChapter="changeChapter" :curNode="curNode.data" />
|
||||
<Lesson @changeChapter="changeChapter" />
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
|
@ -70,20 +70,19 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, toRaw, nextTick, reactive } from 'vue';
|
||||
import { ref, onMounted, toRaw } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getSmarttalkPage } from '@/api/file'
|
||||
import SetHomework from '@/components/set-homework/index.vue'
|
||||
import FileImage from '@/components/file-image/index.vue'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
||||
import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import Lesson from './lesson.vue';
|
||||
import { parseCataByNode } from '@/utils/talkFile'
|
||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
||||
import { createHomework } from '../createHomework'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const route = useRoute();
|
||||
const usertore = useUserStore().user
|
||||
|
@ -100,10 +99,6 @@ const resourceList = ref([])
|
|||
//当前点击的数据
|
||||
const curRow = ref('')
|
||||
|
||||
const curNode = reactive({
|
||||
data: {}
|
||||
})
|
||||
|
||||
const sendHomework = (row) => {
|
||||
curRow.value = row
|
||||
setTimeout(() => {
|
||||
|
@ -123,7 +118,6 @@ const successHomework = (data)=>{
|
|||
}
|
||||
// 章节目录change
|
||||
const changeChapter = async (data)=>{
|
||||
curNode.data = data
|
||||
const { res } = await useGetHomework(data)
|
||||
dataList.value = res
|
||||
let cata = parseCataByNode(data)
|
||||
|
@ -183,10 +177,10 @@ const getResource = () => {
|
|||
|
||||
//获取作业数据
|
||||
const getHomework = async () => {
|
||||
|
||||
const data = toRaw(toolStore.curSubjectNode).data.node
|
||||
loading.value = true
|
||||
try {
|
||||
const { res } = await useGetHomework(curNode.data)
|
||||
const { res } = await useGetHomework(data)
|
||||
dataList.value = res
|
||||
} finally {
|
||||
loading.value = false
|
||||
|
@ -209,16 +203,13 @@ function leave(el, done) {
|
|||
done();
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
onMounted(() => {
|
||||
entpcourseid.value = route.query.entpcourseid
|
||||
lesson.value = route.query.label
|
||||
// 当前节点 mounted 的时候从缓存里拿
|
||||
curNode.data = sessionStore.get('subject.curNode')
|
||||
getHomework()
|
||||
getResource()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
getHomework()
|
||||
getResource()
|
||||
},200)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<el-scrollbar>
|
||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode.data.id" highlight-current
|
||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||
@node-click="handleNodeClick">
|
||||
<template #default="{ node }">
|
||||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||
|
@ -13,60 +13,133 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, toRaw, watch } from 'vue'
|
||||
import { ref, onMounted, nextTick, toRaw } from 'vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
const emit = defineEmits(['changeChapter'])
|
||||
const props = defineProps(['curNode'])
|
||||
|
||||
const toolStore = useToolState()
|
||||
const treeData = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'itemtitle',
|
||||
label: 'label',
|
||||
class: 'textbook-tree'
|
||||
}
|
||||
const currentNode = reactive({
|
||||
data: {}
|
||||
})
|
||||
|
||||
watch(() => props.curNode , (newVal) =>{
|
||||
currentNode.data = newVal
|
||||
console.log(currentNode.data)
|
||||
},
|
||||
{deep: true, immediate: true})
|
||||
|
||||
// 当前选中的节点ID
|
||||
const currentNodeId = ref(0)
|
||||
// 当前选中的节点名称
|
||||
const currentNodeName = ref('')
|
||||
// 默认展开的节点
|
||||
const defaultExpandedKeys = ref([])
|
||||
// tree
|
||||
const refTree = ref(null)
|
||||
// 教材ID
|
||||
const curBookId = ref('')
|
||||
//
|
||||
const evaluationList = ref([])
|
||||
|
||||
const handleNodeClick = (data) => {
|
||||
/**
|
||||
* data : 当前节点数据
|
||||
const getTreeData = () => {
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('unitList'))
|
||||
|
||||
//上册
|
||||
/**
|
||||
* 不区分上下册
|
||||
* 2024/08/20调整
|
||||
*/
|
||||
currentNode.data = data
|
||||
let nodeData = cloneDeep(toRaw(data));
|
||||
|
||||
//增加一个label 之前取的label
|
||||
nodeData.label = nodeData.itemtitle
|
||||
// 父级节点 如果当前是一级节点 父级则为null
|
||||
let parent = {
|
||||
id: nodeData.parentid,
|
||||
label: nodeData.parenttitle,
|
||||
itemtitle: nodeData.parenttitle
|
||||
}
|
||||
const parentNode = nodeData.parentid ? parent : null
|
||||
nodeData.parentNode = parentNode
|
||||
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
|
||||
})
|
||||
|
||||
emit('changeChapter', nodeData)
|
||||
}
|
||||
|
||||
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 = {}
|
||||
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(()=>{
|
||||
treeData.value = sessionStore.get('subject.subjectTree')
|
||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
||||
setTimeout(()=>{
|
||||
let data = toRaw(toolStore.curSubjectNode)
|
||||
curBookId.value = data.data.textBook.curBookId
|
||||
getTreeData()
|
||||
},500)
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue