Compare commits
58 Commits
a72177d02e
...
302c82503a
Author | SHA1 | Date |
---|---|---|
朱浩 | 302c82503a | |
朱浩 | afd1a1dcf9 | |
zhengdegang | 9c1cd2a2fc | |
zdg | dc39486620 | |
zdg | 62881bc052 | |
zouyf | 812e799e2a | |
“zouyf” | b5b6272141 | |
“zouyf” | 027d0ebe07 | |
yangws | a731dff62c | |
小杨 | dac36e611d | |
yangws | b574464a1e | |
小杨 | eba6727dc0 | |
朱浩 | 521247f817 | |
lyc | 8a759479bd | |
lyc | e891259413 | |
yangws | 14340e211d | |
小杨 | 24ce28f2e2 | |
小杨 | 0de7a7356e | |
lyc | 0b4019957f | |
lyc | e457ac9baf | |
baigl | 7b2ad4ce64 | |
白了个白 | 758081d9e5 | |
白了个白 | a7a84b3738 | |
yangws | 6467203c26 | |
小杨 | 49b4ba1f02 | |
小杨 | 2c2c5b32e9 | |
zouyf | 2f726bccfb | |
“zouyf” | 6112cc8a92 | |
“zouyf” | d05388cb05 | |
“zouyf” | cca640e945 | |
baigl | 08ed5c9f2f | |
白了个白 | 35a00e2aca | |
“zouyf” | ab127958f9 | |
“zouyf” | ef75fb7570 | |
白了个白 | e3ce510322 | |
朱浩 | 79cb126728 | |
朱浩 | 810a734fa5 | |
zouyf | bcc9a66df6 | |
“zouyf” | 0f425d9277 | |
“zouyf” | 8c36d59b19 | |
“zouyf” | a229e9933e | |
朱浩 | b43422f389 | |
yangws | 6c1bb40826 | |
小杨 | ea861dd2ea | |
lyc | ff2e05fb6b | |
lyc | b7425da4da | |
zouyf | b0075b86ba | |
yangws | 54d4896e18 | |
小杨 | 3042e874e4 | |
zouyf | 92f23a35f9 | |
zouyf | 64e91dffbe | |
qinqing | 80c38152d2 | |
qinqing | 0cefb94721 | |
yangws | 5ff18bf4aa | |
小杨 | 688f200d43 | |
小杨 | 46d5078cac | |
朱浩 | cf05038c0d | |
小杨 | 6b63235084 |
|
@ -18,4 +18,4 @@ VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktx
|
||||||
|
|
||||||
VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/'
|
VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/'
|
||||||
|
|
||||||
VITE_SHOW_DEV_TOOLS = 'true'
|
VITE_SHOW_DEV_TOOLS = 'false'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win",
|
||||||
"version": "2.1.12",
|
"version": "2.1.18",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "example.com",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
"homepage": "https://electron-vite.org",
|
"homepage": "https://electron-vite.org",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
|
|
|
@ -271,12 +271,13 @@ app.on('window-all-closed', () => {
|
||||||
function handleAll() {
|
function handleAll() {
|
||||||
const chatInstance = chat.initialize() // im-chat 实例
|
const chatInstance = chat.initialize() // im-chat 实例
|
||||||
// 新窗口创建-监听
|
// 新窗口创建-监听
|
||||||
ipcMain.on('new-window', (e, data) => {
|
ipcMain.handle('new-window', (e, data) => {
|
||||||
const { id, type } = data
|
const { id, type } = data
|
||||||
const win = BrowserWindow.fromId(id)
|
const win = BrowserWindow.fromId(id)
|
||||||
win.type = type // 绑定独立标识
|
win.type = type // 绑定独立标识
|
||||||
remote.enable(win.webContents) // 开启远程服务
|
remote.enable(win.webContents) // 开启远程服务
|
||||||
chatInstance.enable(win.webContents) // 开启im-chat
|
chatInstance.enable(win.webContents) // 开启im-chat
|
||||||
|
console.log(`主进程 [${type}]: 窗口注册-远程代理-完毕(${Date.now()})`)
|
||||||
})
|
})
|
||||||
// 用于监听-状态管理变化-同步所有窗口
|
// 用于监听-状态管理变化-同步所有窗口
|
||||||
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
|
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,74 @@
|
||||||
|
<template>
|
||||||
|
<!-- 试题详情 -->
|
||||||
|
<el-drawer
|
||||||
|
v-model="activeExamInfoDrawer"
|
||||||
|
title="题目详情"
|
||||||
|
:with-header="false"
|
||||||
|
direction="rtl"
|
||||||
|
size="60%"
|
||||||
|
>
|
||||||
|
<div style="height: calc(100% - 50px);">
|
||||||
|
<el-scrollbar style="background: #F3F5F8;border-radius: 8px;">
|
||||||
|
<el-row class="drawer-main">
|
||||||
|
<el-col :span="24">
|
||||||
|
<span>{{activeExam.worktag}}</span>
|
||||||
|
<span style="margin-left: 4px" v-html="activeExam.titleFormat" ></span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" style="padding: 4px" v-html="activeExam.workdescFormat">
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3" class="drawer-main-col"><em>【答案】</em></el-col>
|
||||||
|
<el-col :span="20" class="drawer-main-col" v-html="activeExam.workanswerFormat"></el-col>
|
||||||
|
<el-col :span="3" class="drawer-main-col"><em>【分析】</em></el-col>
|
||||||
|
<el-col :span="20" class="drawer-main-col" v-html="activeExam.method"></el-col>
|
||||||
|
<el-col :span="3" class="drawer-main-col"><em>【解答】</em></el-col>
|
||||||
|
<el-col :span="20" class="drawer-main-col" v-html="activeExam.analyse"></el-col>
|
||||||
|
<el-col :span="3" class="drawer-main-col" ><em>【点评】</em></el-col>
|
||||||
|
<el-col :span="20" class="drawer-main-col" v-html="activeExam.discuss"></el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
<div class="drawer-footer">
|
||||||
|
<el-button type="primary" @click="activeExamInfoDrawer = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup name="examDetailsDrawerRef">
|
||||||
|
import {ref, reactive, watch} from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const activeExamInfoDrawer = ref(false);
|
||||||
|
const activeExam = ref({});
|
||||||
|
|
||||||
|
//接收父组件传过来的参数
|
||||||
|
const acceptParams = (params) => {
|
||||||
|
activeExamInfoDrawer.value = true;
|
||||||
|
activeExam.value = params.activeExam;
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
acceptParams
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.drawer-main{
|
||||||
|
margin: 1%;
|
||||||
|
padding: 2%;
|
||||||
|
display: flex;
|
||||||
|
text-align: left;
|
||||||
|
.drawer-main-col{
|
||||||
|
padding: 10px 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.drawer-footer{
|
||||||
|
padding-top: 15px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -259,9 +259,10 @@ const onSubmit = (formEl) => {
|
||||||
classworkarray: JSON.stringify(ary)
|
classworkarray: JSON.stringify(ary)
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
||||||
setLoading.value = false
|
setLoading.value = false
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
emit('on-success', res.data)
|
emit('on-success', res)
|
||||||
cloneDialog(formEl)
|
cloneDialog(formEl)
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -16,8 +16,9 @@ export const isJson = (str) => {
|
||||||
/**
|
/**
|
||||||
* @description processList 格式化试题
|
* @description processList 格式化试题
|
||||||
* @param {*} row
|
* @param {*} row
|
||||||
|
* @param {*} aloneOption 选择题中选项是否为每行一个
|
||||||
*/
|
*/
|
||||||
export const processList = (row) => {
|
export const processList = (row, aloneOption=false) => {
|
||||||
for (var i = 0; i < row.length; i++) {
|
for (var i = 0; i < row.length; i++) {
|
||||||
if (isJson(row[i].workanalysis)) {
|
if (isJson(row[i].workanalysis)) {
|
||||||
//1、先默认格式化 格式化各项内容(待优化, 后续界面显示的为format的值)
|
//1、先默认格式化 格式化各项内容(待优化, 后续界面显示的为format的值)
|
||||||
|
@ -55,19 +56,25 @@ export const processList = (row) => {
|
||||||
const workDescArr = element.split('#&')
|
const workDescArr = element.split('#&')
|
||||||
let tmp = ''
|
let tmp = ''
|
||||||
let j = 0
|
let j = 0
|
||||||
for (; j < workDescArr.length; j++) {
|
for(; j<workDescArr.length; j++){
|
||||||
if (j % 2 == 0) {
|
const char = String.fromCharCode(65+j);
|
||||||
tmp += `<div style='width:80%;display:flex;'>`
|
if (aloneOption) {
|
||||||
|
tmp += `<div style='width:100%;display:flex;padding: 2px 0'>${char}.${workDescArr[j]}</div>`;
|
||||||
}
|
}
|
||||||
const char = String.fromCharCode(65 + j)
|
else {
|
||||||
tmp += `<div style='display:flex;margin-left:2%;width:35%;overflow:hidden;text-overflow:ellipsis;font-size:0.9em;'>${char}.${workDescArr[j]}</div>`
|
if(j%2 == 0){
|
||||||
if (j % 2 == 1) {
|
tmp += `<div style='width:100%;display:flex;'>`;
|
||||||
tmp += '</div>'
|
}
|
||||||
|
|
||||||
|
tmp += `<div style='padding-left:10px;width:50%;overflow:hidden;text-overflow:ellipsis;font-size:0.9em;'>${char}.${workDescArr[j]}</div>`;
|
||||||
|
if(j%2 == 1){
|
||||||
|
tmp += '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// j此刻已自增1, 故当选项为单数时, 需要补充结束标签
|
// j此刻已自增1, 故当选项为单数时, 需要补充结束标签
|
||||||
if (j % 2 == 1) {
|
if(!aloneOption && j%2 == 1){
|
||||||
tmp += '</div>'
|
tmp += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// workDescArr为 [''] 表示为 判断题或者填空题,这里不需要选项
|
// workDescArr为 [''] 表示为 判断题或者填空题,这里不需要选项
|
||||||
|
@ -136,31 +143,36 @@ export const processList = (row) => {
|
||||||
* ]
|
* ]
|
||||||
*/
|
*/
|
||||||
let workDescArr = JSON.parse(row[i].workdesc)
|
let workDescArr = JSON.parse(row[i].workdesc)
|
||||||
let workDescHtml = `<div style='width:80%;display:flex;>`
|
let workDescHtml = `<div style='width:100%;display:flex;>`
|
||||||
workDescArr.map((item, index) => {
|
workDescArr.map((item, index) => {
|
||||||
if (item.type == '单选题' || item.type == '多选题') {
|
if (item.type == '单选题' || item.type == '多选题') {
|
||||||
workDescHtml += `<div style='width:80%;display:flex;'>${index + 1}. ${item.title}</div>`
|
workDescHtml += `<div style='width:100%;display:flex;'>${index + 1}. ${item.title}</div>`
|
||||||
let tmp = ''
|
let tmp = ''
|
||||||
let j = 0
|
let j = 0
|
||||||
let optionsArr = item.options
|
let optionsArr = item.options
|
||||||
for (; j < optionsArr.length; j++) {
|
for(; j<optionsArr.length; j++){
|
||||||
if (j % 2 == 0) {
|
const char = String.fromCharCode(65+j);
|
||||||
tmp += `<div style='width:80%;display:flex;'>`
|
if (aloneOption) {
|
||||||
|
tmp += `<div style='width:100%;display:flex;padding: 2px 0'>${char}.${optionsArr[j]}</div>`;
|
||||||
}
|
}
|
||||||
const char = String.fromCharCode(65 + j)
|
else {
|
||||||
tmp += `<div style='display:flex;margin-left: 2%; width: 36%'>${char}.${optionsArr[j]}</div>`
|
if(j%2 == 0){
|
||||||
if (j % 2 == 1) {
|
tmp += `<div style='width:100%;display:flex;'>`;
|
||||||
tmp += '</div>'
|
}
|
||||||
|
|
||||||
|
tmp += `<div style='padding-left: 10px; width: 50%'>${char}.${optionsArr[j]}</div>`;
|
||||||
|
if(j%2 == 1){
|
||||||
|
tmp += '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// j此刻已自增1, 故当选项为单数时, 需要补充结束标签
|
// j此刻已自增1, 故当选项为单数时, 需要补充结束标签
|
||||||
if (j % 2 == 1) {
|
if(!aloneOption && j%2 == 1){
|
||||||
tmp += '</div>'
|
tmp += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
workDescHtml += tmp
|
workDescHtml += tmp
|
||||||
} else if (item.type == '填空题' || item.type == '判断题' || item.type == '主观题') {
|
} else if (item.type == '填空题' || item.type == '判断题' || item.type == '主观题') {
|
||||||
workDescHtml += `<div style='width:80%;display:flex;'>${index + 1}. ${item.title}</div>`
|
workDescHtml += `<div style='width:100%;display:flex;'>${index + 1}. ${item.title}</div>`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
workDescHtml += '</div>'
|
workDescHtml += '</div>'
|
||||||
|
@ -265,18 +277,24 @@ export const processList = (row) => {
|
||||||
// 处理[选项显示] - 拼接ABCD首序号
|
// 处理[选项显示] - 拼接ABCD首序号
|
||||||
let tmp = ''
|
let tmp = ''
|
||||||
let j = 0
|
let j = 0
|
||||||
for (; j < workDescArr.length; j++) {
|
for(; j<workDescArr.length; j++){
|
||||||
if (j % 2 == 0) {
|
const char = String.fromCharCode(65+j);
|
||||||
tmp += `<div style='width:80%;display:flex;'>`
|
if (aloneOption) {
|
||||||
|
tmp += `<div style='width:100%;display:flex;padding: 2px 0'>${char}.${workDescArr[j]}</div>`;
|
||||||
}
|
}
|
||||||
const char = String.fromCharCode(65 + j)
|
else {
|
||||||
tmp += `<div style='display:flex;margin-left: 2%; width: 36%'>${char}.${workDescArr[j]}</div>`
|
if(j%2 == 0){
|
||||||
if (j % 2 == 1) {
|
tmp += `<div style='width:100%;display:flex;'>`;
|
||||||
tmp += '</div>'
|
}
|
||||||
|
|
||||||
|
tmp += `<div style='padding-left: 10px; width: 50%'>${char}.${workDescArr[j]}</div>`;
|
||||||
|
if(j%2 == 1){
|
||||||
|
tmp += '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (j % 2 == 0) {
|
if(!aloneOption && j%2== 0){
|
||||||
tmp += '</div>'
|
tmp += '</div>';
|
||||||
}
|
}
|
||||||
row[i].workdescFormat = tmp
|
row[i].workdescFormat = tmp
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
||||||
<el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>
|
<!-- <el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>-->
|
||||||
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
||||||
<el-dropdown-item divided command="logout">
|
<el-dropdown-item divided command="logout">
|
||||||
<span>退出登录</span>
|
<span>退出登录</span>
|
||||||
|
|
|
@ -4,13 +4,18 @@ const overviewStore = defineStore(
|
||||||
{
|
{
|
||||||
state: () => {
|
state: () => {
|
||||||
return {
|
return {
|
||||||
tableList:[]
|
tableList:[],
|
||||||
|
allData:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
getTableList(data){
|
getTableList(data){
|
||||||
this.tableList = [...data]
|
this.tableList = [...data]
|
||||||
}
|
},
|
||||||
|
//整理的所有列表
|
||||||
|
getAllData(data){
|
||||||
|
this.allData = [...data]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default overviewStore
|
export default overviewStore
|
||||||
|
|
|
@ -18,13 +18,13 @@ export class Chat {
|
||||||
}
|
}
|
||||||
return Chat.instance;
|
return Chat.instance;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 初始化 获取IM签名
|
* 初始化 获取IM签名
|
||||||
* @param {*} isInit : 是否初始化IM
|
* @param {*} isInit : 是否初始化IM
|
||||||
* @param {*} isLogin : 是否登录IM
|
* @param {*} isLogin : 是否登录IM
|
||||||
* @param {*} callback: 监听消息回调函数
|
* @param {*} callback: 监听消息回调函数
|
||||||
* @returns Promise<ImChat>
|
* @returns Promise<ImChat>
|
||||||
*/
|
*/
|
||||||
async init(isInit = true, isLogin = true, callback) {
|
async init(isInit = true, isLogin = true, callback) {
|
||||||
// 特殊处理,只传1个参数且为函数,则默认为callback,isInit和isLogin默认为true
|
// 特殊处理,只传1个参数且为函数,则默认为callback,isInit和isLogin默认为true
|
||||||
if (typeof isInit == 'function'){
|
if (typeof isInit == 'function'){
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { getSignature } from "./index";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
let appId = "01ec9aa3";
|
let appId = "a3c84da2";
|
||||||
let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy";
|
let secret = "OTZkZDdhNDQ4MDk0NTZiYjcyY2RjZmYz";
|
||||||
let timestamp = Math.floor(Date.now() / 1000);
|
let timestamp = Math.floor(Date.now() / 1000);
|
||||||
let signature = getSignature(appId, secret, timestamp);
|
let signature = getSignature(appId, secret, timestamp);
|
||||||
let req = (url, type, data)=>{
|
let req = (url, type, data)=>{
|
||||||
|
|
|
@ -131,7 +131,7 @@ export const createWindow = async (type, data) => {
|
||||||
data.isConsole = true // 是否开启控制台
|
data.isConsole = true // 是否开启控制台
|
||||||
data.isWeb = false // 是否开启web安全
|
data.isWeb = false // 是否开启web安全
|
||||||
data.option = {...defOption, ...option}
|
data.option = {...defOption, ...option}
|
||||||
wins_tool = await toolWindow(data)
|
wins_tool = await toolWindow(type, data)
|
||||||
wins_tool.type = type // 唯一标识
|
wins_tool.type = type // 唯一标识
|
||||||
wins_tool.show()
|
wins_tool.show()
|
||||||
wins_tool.setFullScreen(true) // 设置窗口为全屏
|
wins_tool.setFullScreen(true) // 设置窗口为全屏
|
||||||
|
@ -161,7 +161,7 @@ export const createWindow = async (type, data) => {
|
||||||
}
|
}
|
||||||
data.isConsole = true // 是否开启控制台
|
data.isConsole = true // 是否开启控制台
|
||||||
data.option = {...defOption, ...option}
|
data.option = {...defOption, ...option}
|
||||||
const win = await toolWindow(data)
|
const win = await toolWindow(type, data)
|
||||||
win.type = type // 唯一标识
|
win.type = type // 唯一标识
|
||||||
win.show()
|
win.show()
|
||||||
win.setFullScreen(true) // 设置窗口为全屏
|
win.setFullScreen(true) // 设置窗口为全屏
|
||||||
|
@ -193,7 +193,7 @@ export const createWindow = async (type, data) => {
|
||||||
}
|
}
|
||||||
data.isConsole = true // 是否开启控制台
|
data.isConsole = true // 是否开启控制台
|
||||||
data.option = {...defOption, ...option}
|
data.option = {...defOption, ...option}
|
||||||
winChild = await toolWindow(data)
|
winChild = await toolWindow(type, data)
|
||||||
winChild.type = type // 唯一标识
|
winChild.type = type // 唯一标识
|
||||||
winChild.show()
|
winChild.show()
|
||||||
winChild.setFullScreen(false) // 设置窗口为全屏
|
winChild.setFullScreen(false) // 设置窗口为全屏
|
||||||
|
@ -213,7 +213,7 @@ export const createWindow = async (type, data) => {
|
||||||
* @author: zdg
|
* @author: zdg
|
||||||
* @date 2021-07-05 14:07:01
|
* @date 2021-07-05 14:07:01
|
||||||
*/
|
*/
|
||||||
export function toolWindow({url, isConsole, isWeb=true, option={}}) {
|
export function toolWindow(type, {url, isConsole, isWeb=true, option={}}) {
|
||||||
// width = window.screen.width
|
// width = window.screen.width
|
||||||
let width = option?.width || 800
|
let width = option?.width || 800
|
||||||
let height = option?.height || 600
|
let height = option?.height || 600
|
||||||
|
@ -221,7 +221,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
|
||||||
const devUrl = `${BaseUrl}${url}`
|
const devUrl = `${BaseUrl}${url}`
|
||||||
const buildUrl = path.join(__dirname, 'index.html')
|
const buildUrl = path.join(__dirname, 'index.html')
|
||||||
const urlAll = isDev ? devUrl : buildUrl
|
const urlAll = isDev ? devUrl : buildUrl
|
||||||
return new Promise((resolve) => {
|
return new Promise(async(resolve) => {
|
||||||
const config = {
|
const config = {
|
||||||
width, height,
|
width, height,
|
||||||
icon: path.join(appPath, '/resources/logo2.ico'),
|
icon: path.join(appPath, '/resources/logo2.ico'),
|
||||||
|
@ -236,6 +236,9 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
|
||||||
}
|
}
|
||||||
// 创建-新窗口
|
// 创建-新窗口
|
||||||
let win = new Remote.BrowserWindow(config)
|
let win = new Remote.BrowserWindow(config)
|
||||||
|
// 新窗口-创建事件(如:主进程加载远程服务)
|
||||||
|
await ipcMsgInvoke('new-window', {id:win.id, type})
|
||||||
|
console.log(`渲染进程 [${type}]: 窗口创建-成功${Date.now()}`)
|
||||||
if (!isDev) win.loadFile(urlAll,{hash: url}) // 加载文件
|
if (!isDev) win.loadFile(urlAll,{hash: url}) // 加载文件
|
||||||
else win.loadURL(urlAll) // 加载url
|
else win.loadURL(urlAll) // 加载url
|
||||||
win.once('ready-to-show', () => { // 窗口加载完成
|
win.once('ready-to-show', () => { // 窗口加载完成
|
||||||
|
@ -281,7 +284,7 @@ const eventHandles = (type, win) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// 新窗口-创建事件(如:主进程加载远程服务)
|
// 新窗口-创建事件(如:主进程加载远程服务)
|
||||||
ipcRenderer.send('new-window', {id:win.id, type})
|
// ipcRenderer.send('new-window', {id:win.id, type})
|
||||||
}
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'tool-sphere': { // 创建-悬浮球
|
case 'tool-sphere': { // 创建-悬浮球
|
||||||
|
@ -340,7 +343,7 @@ const eventHandles = (type, win) => {
|
||||||
// 监听窗口的激活事件
|
// 监听窗口的激活事件
|
||||||
win.on('focus', async () => {
|
win.on('focus', async () => {
|
||||||
toolState.isTaskWin=true
|
toolState.isTaskWin=true
|
||||||
win&&win.reload(); //刷新该窗口
|
// win&&win.reload(); //刷新该窗口
|
||||||
});
|
});
|
||||||
// 监听窗口关闭事件
|
// 监听窗口关闭事件
|
||||||
win.on('closed', function () {
|
win.on('closed', function () {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="common-layout" style="width: 100%; height: 73vh;">
|
<div class="common-layout" style="width: 100%">
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header style="height: auto">
|
<el-header style="height: auto">
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="font-size: 20px;font-weight: bold">
|
<div style="font-size: 20px;font-weight: bold">
|
||||||
学情分布
|
等级分布
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Distribution></Distribution>
|
<Distribution></Distribution>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="font-size: 20px;font-weight: bold">
|
<div style="font-size: 20px;font-weight: bold">
|
||||||
时长分析
|
用时分析
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<TimeAnalyse></TimeAnalyse>
|
<TimeAnalyse></TimeAnalyse>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="font-size: 20px;font-weight: bold">
|
<div style="font-size: 20px;font-weight: bold">
|
||||||
知识点概览
|
价值透析
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Konwledge></Konwledge>
|
<Konwledge></Konwledge>
|
||||||
|
@ -43,12 +43,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import Distribution from '@/views/classTask/container/classOverview/distribution.vue'
|
import {ref,watchEffect,provide } from 'vue'
|
||||||
import Konwledge from '@/views/classTask/container/classOverview/knowledge.vue'
|
import Distribution from './classOverview/distribution.vue'
|
||||||
import TimeAnalyse from '@/views/classTask/container/classOverview/timeAnalyse.vue'
|
import Konwledge from './classOverview/knowledge.vue'
|
||||||
|
import TimeAnalyse from './classOverview/timeAnalyse.vue'
|
||||||
import {defineProps,watch} from 'vue'
|
import {defineProps,watch} from 'vue'
|
||||||
import overviewStore from "@/store/modules/overview";
|
import overviewStore from "@/store/modules/overview";
|
||||||
// import {getBindlist} from "@/api/education/knowledgePoint";
|
|
||||||
const useOverview = overviewStore()
|
const useOverview = overviewStore()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tableList: {
|
tableList: {
|
||||||
|
@ -57,12 +57,205 @@ const props = defineProps({
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// evalId:{
|
evalId:{
|
||||||
// type: Number,
|
type: Number,
|
||||||
// default: 0
|
default: 0
|
||||||
// }
|
},
|
||||||
|
activeData: { // 数据
|
||||||
|
type: Object,
|
||||||
|
// required: true, // 必传
|
||||||
|
default: () => ({
|
||||||
|
quizlist: [], // 当前习题列表
|
||||||
|
studentList: [], // 当前课程-所有学生
|
||||||
|
workFeedList: [] // 当前课程-所有学生反馈数据
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
let studentList = ref([]) // 学生数据
|
||||||
|
|
||||||
|
// 初始-数据处理
|
||||||
|
const initData = () => {
|
||||||
|
console.log('xxx', props)
|
||||||
|
// window.test = activeCourse
|
||||||
|
studentList.value = props.activeData.studentList || []
|
||||||
|
const activeWorkFeedList = props.activeData.workFeedList || []
|
||||||
|
const quizlist = props.activeData.quizlist || []
|
||||||
|
const timeArr = groupByField(props.activeData.workFeedList,'entpcourseworkid')
|
||||||
|
// 习题特殊处理
|
||||||
|
let data = quizlist.map(o => {
|
||||||
|
// 解析题选项
|
||||||
|
const workdesc = o.workdesc || ''
|
||||||
|
let accSum = 0 // 该题总人数
|
||||||
|
let activeIds = [] // 已做答学生
|
||||||
|
let rightIds = [] // 正确学生
|
||||||
|
let hasAnswers= [] // 答过题的学生
|
||||||
|
let timeAnalyse = [] // 平均时长和编号
|
||||||
|
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
||||||
|
// 获取所有的做题时间
|
||||||
|
timeArr.forEach((item,index) => {
|
||||||
|
const arr = item.reduce((acc, cur) => {
|
||||||
|
return acc + (cur.timelength ? Number(cur.timelength) : 0);
|
||||||
|
},0)
|
||||||
|
timeAnalyse.push(arr)
|
||||||
|
})
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
hasAnswers.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) => {
|
||||||
|
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))] // 多选去重
|
||||||
|
}
|
||||||
|
hasAnswers=[...new Set(hasAnswers.concat(studentIds))]
|
||||||
|
return { def: v, code, isOk, studentIds }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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
|
||||||
|
// 改选项的学生id
|
||||||
|
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i] && f.finishtimelength!='0').map(f => f.studentid)||[]
|
||||||
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
|
hasAnswers=[...new Set(hasAnswers.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)
|
||||||
|
hasAnswers.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))] // 多选去重
|
||||||
|
hasAnswers=[...new Set(hasAnswers.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
||||||
|
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children,hasAnswers,timeAnalyse }
|
||||||
|
})
|
||||||
|
if (data.length === 0) return
|
||||||
|
useOverview.getAllData([...data])
|
||||||
|
}
|
||||||
|
// 百分比现在 0-100
|
||||||
|
const percent = v => v > 1 ? 1 : v < 0 ? 0 : Math.round(v * 100)
|
||||||
|
// Unicode 转 字符 差值65
|
||||||
|
const toCode = (v, b) => b ? v.charCodeAt() - 65 : String.fromCharCode(v + 65)
|
||||||
|
// 判断是否为json字符串
|
||||||
|
const isJson = str => {if(typeof str == 'string'){
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(str)
|
||||||
|
if(typeof res == 'object' && res) return true
|
||||||
|
} catch (error) {}}return false
|
||||||
|
}
|
||||||
|
// 获取到学生的平均回答时间
|
||||||
|
const groupByField = (array, field) => {
|
||||||
|
const groupedMap = {};
|
||||||
|
array.forEach(item => {
|
||||||
|
const key = item[field];
|
||||||
|
if (!groupedMap[key]) {
|
||||||
|
groupedMap[key] = [];
|
||||||
|
}
|
||||||
|
groupedMap[key].push(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 将映射对象转换为二维数组
|
||||||
|
return Object.values(groupedMap);
|
||||||
|
}
|
||||||
|
|
||||||
watch(() => props.tableList,() => {
|
watch(() => props.tableList,() => {
|
||||||
useOverview.getTableList(props.tableList)
|
useOverview.getTableList(props.tableList)
|
||||||
},{deep:true})
|
},{deep:true})
|
||||||
|
// === 监听器 ===
|
||||||
|
watchEffect(() => { initData() })
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import Echarts from '@/views/classTask/container/classOverview/distribution/echarts.vue'
|
import Echarts from './distribution/echarts.vue'
|
||||||
import StuList from "@/views/classTask/container/classOverview/distribution/stuList.vue";
|
import StuList from "./distribution/stuList.vue";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -1,32 +1,39 @@
|
||||||
<template>
|
<template>
|
||||||
<div className="chart-container">
|
<div class="chart-container">
|
||||||
<div ref="chartRef" className="chart"></div>
|
<div ref="chartRef" class="chart"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref,nextTick,watch} from 'vue';
|
import { ref, nextTick, watch } from 'vue';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import overviewStore from '@/store/modules/overview'
|
import overviewStore from '@/store/modules/overview';
|
||||||
const useOverview = overviewStore()
|
const useOverview = overviewStore();
|
||||||
|
|
||||||
// 获取图表容器的引用
|
// 获取图表容器的引用
|
||||||
const chartRef = ref(null);
|
const chartRef = ref(null);
|
||||||
|
|
||||||
// 数据源
|
// 数据源
|
||||||
const dataList = ref([
|
const dataList = ref([
|
||||||
{name: '完美', value: 0,rating:1,max:100,min:100,},
|
{ name: '完美', value: 0, rating: 1, max: 100, min: 100 },
|
||||||
{name: '优秀', value: 0,rating:2,max:99,min:80,},
|
{ name: '优秀', value: 0, rating: 2, max: 99, min: 80 },
|
||||||
{name: '良好', value: 0,rating:3,max:79,min:70,},
|
{ name: '良好', value: 0, rating: 3, max: 79, min: 70 },
|
||||||
{name: '及格', value: 0,rating:4,max:69,min:60,},
|
{ name: '及格', value: 0, rating: 4, max: 69, min: 60 },
|
||||||
{name: '不及格', value: 0,rating:5,max:59,min:0,},
|
{ name: '不及格', value: 0, rating: 5, max: 59, min: 0 },
|
||||||
]);
|
]);
|
||||||
|
// 答过题的学生才进行统计
|
||||||
|
const hasStudents = ref([])
|
||||||
|
|
||||||
// 根据数据生成不同的颜色
|
// 根据数据生成不同的颜色
|
||||||
function getColor(index) {
|
function getColor(name) {
|
||||||
// 这里可以根据值生成不同的颜色
|
const colorMap = {
|
||||||
const colors = ['#d14a61','#675bba', '#e89110','#008c8c','#5793f3'];
|
'完美': '#d14a61',
|
||||||
return colors[index];
|
'优秀': '#675bba',
|
||||||
|
'良好': '#e89110',
|
||||||
|
'及格': '#008c8c',
|
||||||
|
'不及格': '#5793f3'
|
||||||
|
};
|
||||||
|
return colorMap[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
|
@ -34,75 +41,75 @@ function initChart() {
|
||||||
const myChart = echarts.init(chartRef.value);
|
const myChart = echarts.init(chartRef.value);
|
||||||
const total = dataList.value.reduce((acc, cur) => acc + cur.value, 0); // 计算总数
|
const total = dataList.value.reduce((acc, cur) => acc + cur.value, 0); // 计算总数
|
||||||
|
|
||||||
|
// 过滤掉值为0的数据项
|
||||||
|
const filteredData = dataList.value.filter(item => item.value > 0);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'item',
|
||||||
axisPointer: {
|
formatter: params => {
|
||||||
type: 'shadow'
|
const value = params.value;
|
||||||
|
const percentage = value ? ((value / total) * 100).toFixed(2) : 0; // 计算百分比并保留两位小数
|
||||||
|
return `${params.name}: ${value}人 (${percentage}%)`; // 显示为百分比形式
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
|
||||||
left: '3%',
|
|
||||||
right: '4%',
|
|
||||||
bottom: '3%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: dataList.value.map(item => item.name),
|
|
||||||
axisTick: {
|
|
||||||
alignWithLabel: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
series: [{
|
series: [{
|
||||||
name: '数据',
|
name: '数据',
|
||||||
type: 'bar',
|
type: 'pie',
|
||||||
barWidth: '30%',
|
radius: '50%', // 设置饼图的半径为实心
|
||||||
data: dataList.value.map(item => item.value),
|
data: filteredData.map(item => ({
|
||||||
itemStyle: {
|
name: item.name,
|
||||||
color: function (params) {
|
value: item.value,
|
||||||
// 确保这里返回正确的颜色
|
itemStyle: {
|
||||||
return getColor(params.dataIndex);
|
color: getColor(item.name)
|
||||||
}
|
}
|
||||||
},
|
})),
|
||||||
// 显示柱子顶部的值
|
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top',
|
position: 'inside', // 将标签显示在饼图内部
|
||||||
formatter: params => {
|
formatter: params => {
|
||||||
const value = dataList.value[params.dataIndex].value;
|
const value = params.value;
|
||||||
const percentage = value ? ((value / total) * 100).toFixed() : 0; // 计算百分比并保留两位小数
|
const percentage = value ? ((value / total) * 100).toFixed(2) : 0; // 计算百分比并保留两位小数
|
||||||
return `${value}人 ${percentage}%`; // 显示为百分比形式
|
return `${params.name}\n${value}人 (${percentage}%)`; // 显示为百分比形式,换行显示
|
||||||
},
|
},
|
||||||
color: '#333',
|
color: '#333',
|
||||||
fontSize: 12
|
fontSize: 12
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: false // 不显示标签线
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
myChart.setOption(options);
|
myChart.setOption(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取表的数据
|
// 获取表的数据
|
||||||
const showEcharts =() => {
|
const showEcharts = () => {
|
||||||
useOverview.tableList.forEach((item,index) => {
|
hasStudents.value.forEach((item, index) => {
|
||||||
if(item.rating === 0) return // 没批改不计数
|
if (item.rating === 0) {
|
||||||
dataList.value.forEach((item1,index1) => {
|
dataList.value.forEach((item1, index1) => {
|
||||||
if(item1.min <= Number(item.scoingRate) && Number(item.scoingRate) <= item1.max ){
|
if (item1.min <= Number(item.scoingRate) && Number(item.scoingRate) <= item1.max) {
|
||||||
item1.value ++
|
item1.value++;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
} else {
|
||||||
|
dataList.value.forEach((item1, index1) => {
|
||||||
|
if (item1.rating === item.rating) {
|
||||||
|
item1.value++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
watch(() => useOverview.tableList,() => {
|
//执行
|
||||||
showEcharts()
|
watch(() => useOverview.tableList, () => {
|
||||||
|
hasStudents.value = useOverview.tableList.filter(item => useOverview.allData[0].hasAnswers.includes(item.studentid)).map(item => item);
|
||||||
|
showEcharts();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
initChart();
|
initChart();
|
||||||
})
|
});
|
||||||
})
|
},{deep: true})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -16,11 +16,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {nextTick, ref, watch} from 'vue'
|
import {ref, watch} from 'vue'
|
||||||
import overviewStore from '@/store/modules/overview'
|
import overviewStore from '@/store/modules/overview'
|
||||||
|
|
||||||
const useOverview = overviewStore()
|
const useOverview = overviewStore()
|
||||||
const tabPosition = ref('left')
|
const tabPosition = ref('left')
|
||||||
|
|
||||||
|
//答过题的学生才进行统计
|
||||||
|
const hasStudents = ref([])
|
||||||
const leftList = ref([
|
const leftList = ref([
|
||||||
{
|
{
|
||||||
label:'完美',
|
label:'完美',
|
||||||
|
@ -65,17 +68,22 @@ const handelChange = (item) => {
|
||||||
}
|
}
|
||||||
//取区域的学生
|
//取区域的学生
|
||||||
const showStudents = (index) => {
|
const showStudents = (index) => {
|
||||||
leftList.value[index].stuList = useOverview.tableList.filter(item => {
|
leftList.value[index].stuList = hasStudents.value.filter(item => {
|
||||||
if(item.rating > 0){
|
if(item.rating === 0){
|
||||||
if(leftList.value[index].min <= Number(item.scoingRate || 0) && Number(item.scoingRate || 0) <= leftList.value[index].max ){
|
if(leftList.value[index].min <= Number(item.scoingRate || 0) && Number(item.scoingRate || 0) <= leftList.value[index].max ){
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
if(item.rating == leftList.value[index].rating){
|
||||||
|
return item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
watch(() => useOverview.tableList,() => {
|
watch(() => useOverview.tableList, () => {
|
||||||
|
hasStudents.value = useOverview.tableList.filter(item => useOverview.allData[0].hasAnswers.includes(item.studentid)).map(item => item);
|
||||||
showStudents(0)
|
showStudents(0)
|
||||||
})
|
},{deep: true})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -14,156 +14,124 @@ const useOverview = overviewStore()
|
||||||
// 获取图表容器的引用
|
// 获取图表容器的引用
|
||||||
const chartRef = ref(null);
|
const chartRef = ref(null);
|
||||||
|
|
||||||
const estimateTime = ref([]);
|
|
||||||
|
|
||||||
const avaterTime = ref([]);
|
|
||||||
// x轴
|
|
||||||
const xAxisData = ref([]);
|
|
||||||
|
|
||||||
// 获得 y 轴的数据
|
|
||||||
const getyAxisData = () => {
|
|
||||||
estimateTime.value = [];
|
|
||||||
avaterTime.value = [];
|
|
||||||
useOverview.tableList.forEach(item => {
|
|
||||||
if (item.rating !== 0) {
|
|
||||||
estimateTime.value.push({
|
|
||||||
name: item.scoingRate ? item.scoingRate + '%' : 0 + '%',
|
|
||||||
value: Number(item.timelength)
|
|
||||||
});
|
|
||||||
avaterTime.value.push({
|
|
||||||
name: item.scoingRate ? item.scoingRate + '%' : 0 + '%',
|
|
||||||
value: Number(item.finishtimelength)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// x 轴排序
|
|
||||||
xAxisData.value.sort((a, b) => {
|
|
||||||
const aPercentage = parseInt(a.replace('%', ''));
|
|
||||||
const bPercentage = parseInt(b.replace('%', ''));
|
|
||||||
return aPercentage - bPercentage;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 生成 x 轴数据
|
|
||||||
generateXAxisData();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 生成 x 轴数据
|
|
||||||
function generateXAxisData() {
|
|
||||||
// 超过8条开始计算x轴
|
|
||||||
if(estimateTime.value.length > 8){
|
|
||||||
const minScoreRate = 0;
|
|
||||||
const maxScoreRate = 100;
|
|
||||||
const numPoints = 6; // x 轴上的点数
|
|
||||||
const step = (maxScoreRate - minScoreRate) / (numPoints - 1);
|
|
||||||
|
|
||||||
xAxisData.value = [];
|
|
||||||
for (let i = 0; i < numPoints; i++) {
|
|
||||||
const scoreRate = minScoreRate + i * step;
|
|
||||||
xAxisData.value.push(scoreRate + '%');
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
let uniqueXAxisData = new Set();
|
|
||||||
estimateTime.value.forEach(item => {
|
|
||||||
// 添加元素到 Set 中,自动处理重复问题
|
|
||||||
uniqueXAxisData.add(item.name);
|
|
||||||
});
|
|
||||||
// 将 Set 转换成数组
|
|
||||||
xAxisData.value = Array.from(uniqueXAxisData);
|
|
||||||
// 对数组进行排序
|
|
||||||
xAxisData.value.sort((a, b) => {
|
|
||||||
const aPercentage = parseInt(a.replace('%', ''));
|
|
||||||
const bPercentage = parseInt(b.replace('%', ''));
|
|
||||||
return aPercentage - bPercentage;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
function initChart() {
|
function initChart() {
|
||||||
const myChart = echarts.init(chartRef.value);
|
const myChart = echarts.init(chartRef.value);
|
||||||
const options = {
|
// 指定图表的配置项和数据
|
||||||
tooltip: {
|
let option = {
|
||||||
trigger: 'axis',
|
tooltip: {
|
||||||
axisPointer: {
|
trigger: "axis",
|
||||||
type: 'cross'
|
axisPointer: {
|
||||||
}
|
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||||
},
|
},
|
||||||
legend: {
|
formatter: function(parms) {
|
||||||
data: ['预估时长', '平均用时']
|
let str =
|
||||||
},
|
parms[0].axisValue +
|
||||||
grid: {
|
"</br>" +
|
||||||
left: '3%',
|
parms[0].marker +
|
||||||
right: '4%',
|
"平均用时:" +
|
||||||
bottom: '3%',
|
parms[0].value + 's'
|
||||||
top: '10%',
|
return str;
|
||||||
containLabel: true
|
},
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
boundaryGap: false,
|
|
||||||
name: '得分率',
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#999',
|
|
||||||
fontSize: 12,
|
|
||||||
padding: [0, 0, 10, 0]
|
|
||||||
},
|
|
||||||
data: xAxisData.value
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value',
|
|
||||||
name: '作业时长',
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#999',
|
|
||||||
fontSize: 12,
|
|
||||||
padding: [0, 0, 10, 0]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: `预估时长`,
|
|
||||||
type: 'line',
|
|
||||||
smooth: true,
|
|
||||||
symbol: 'circle',
|
|
||||||
symbolSize: 10,
|
|
||||||
lineStyle: {
|
|
||||||
color: '#5793f3'
|
|
||||||
},
|
},
|
||||||
data: estimateTime.value.map(item => ({
|
textStyle: {
|
||||||
name: item.name,
|
color: "#333",
|
||||||
value: item.value
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `平均用时`,
|
|
||||||
type: 'line',
|
|
||||||
smooth: true,
|
|
||||||
symbol: 'circle',
|
|
||||||
symbolSize: 10,
|
|
||||||
lineStyle: {
|
|
||||||
color: '#d14a61'
|
|
||||||
},
|
},
|
||||||
data: avaterTime.value.map(item => ({
|
color: ["#7BA9FA", "#4690FA"],
|
||||||
name: item.name,
|
grid: {
|
||||||
value: item.value
|
containLabel: true,
|
||||||
}))
|
left: "10%",
|
||||||
}
|
top: "20%",
|
||||||
]
|
bottom: "10%",
|
||||||
};
|
right: "10%",
|
||||||
myChart.setOption(options);
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: getXValue(),
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#333",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
margin: 20, //刻度标签与轴线之间的距离。
|
||||||
|
textStyle: {
|
||||||
|
color: "#000",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
name:'题目编号'
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: "#B5B5B5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
name:'平均时长',
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
// 使用深浅的间隔色
|
||||||
|
color: ["#B5B5B5"],
|
||||||
|
type: "dashed",
|
||||||
|
opacity: 0.5,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {},
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
data: getYValue(),
|
||||||
|
stack: "zs",
|
||||||
|
type: "bar",
|
||||||
|
barMaxWidth: "auto",
|
||||||
|
barWidth: 60,
|
||||||
|
itemStyle: {
|
||||||
|
color: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 0,
|
||||||
|
y2: 1,
|
||||||
|
type: "linear",
|
||||||
|
global: false,
|
||||||
|
colorStops: [{
|
||||||
|
offset: 0,
|
||||||
|
color: "#5EA1FF",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "#90BEFF",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
myChart.setOption(option);
|
||||||
}
|
}
|
||||||
//获取平均时长
|
//获取平均时长纵坐标
|
||||||
const getAvaterTime = () => {
|
const getYValue = () => {
|
||||||
return useOverview.tableList.reduce((acc, cur) => acc + cur.finishtimelength, 0) / useOverview.tableList.length;
|
const arr = [...useOverview.allData[0].timeAnalyse]
|
||||||
|
const num = useOverview.allData[0].hasAnswers.length
|
||||||
|
|
||||||
|
return arr.map(item => {
|
||||||
|
return item ? (item / num).toFixed(2) : 0
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const getEstimateTime = () => {
|
// 获取横纵轴坐标数据
|
||||||
return useOverview.tableList.reduce((acc, cur) => acc + cur.timelength, 0) / useOverview.tableList.length;
|
const getXValue = () => {
|
||||||
|
return useOverview.allData.map(item => item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
watch(() => useOverview.tableList,() => {
|
watch(() => useOverview.tableList,() => {
|
||||||
getyAxisData()
|
//获取横纵坐标
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
initChart();
|
initChart();
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore" style="height: 100%">
|
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore" style="height: 100%">
|
||||||
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
|
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
|
||||||
<div class="teacher_content" :style="{ height: '100%' }">
|
<div class="teacher_content" :style="{ height: '100%',fontSize: '18px' }">
|
||||||
<div style="font-size: 18px; width: 100%; padding: 5px 10px; flex: 0 0 auto;">
|
<div style="font-size: 18px; width: 100%; padding: 5px 10px; flex: 0 0 auto;">
|
||||||
{{ classWorkFormScore.name }} 答题详情
|
{{ classWorkFormScore.name }} 答题详情
|
||||||
</div>
|
</div>
|
||||||
|
@ -284,58 +284,27 @@
|
||||||
|
|
||||||
<!-- 批改评价与评语 -->
|
<!-- 批改评价与评语 -->
|
||||||
<div class="tacher_conten_foot">
|
<div class="tacher_conten_foot">
|
||||||
<el-row style="padding: 1% 4%; border: 2px dotted">
|
<el-row style=" padding: 1% 4%; border: 2px dotted;">
|
||||||
<el-col :span="24" style="display: flex; flex-direction: column">
|
<el-col :span="24" style="display: flex;flex-direction: column;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="14">
|
<el-col :span="24">
|
||||||
<div style="display: flex; margin: 10px auto">
|
<div class="greenLine" style="text-align: left;" v-if="dialogProps.studentObj.worktype == '习题训练'">
|
||||||
<span style="display: flex; align-items: center">
|
<span style="font-weight: bold;">老师点评:</span>
|
||||||
<span v-if="dialogProps.studentObj.worktype == '习题训练'">
|
<span style="margin: 0;">{{ classWorkFormScore.teacherRating.reduce((a, b) => a + b.score, 0).toFixed(2)}}</span>分
|
||||||
<span>得分: </span>
|
</div>
|
||||||
<span style="margin: 0; color: red">{{
|
<div style="display: flex; margin: 10px auto;align-items: center;justify-content: space-between;">
|
||||||
classWorkFormScore.teacherRating.reduce((a, b) => a + b.score, 0).toFixed(2)
|
|
||||||
}}</span>
|
|
||||||
<span>分</span>
|
|
||||||
</span>
|
|
||||||
<span v-else>
|
|
||||||
<span>得分: </span>
|
|
||||||
<span v-if="classWorkFormScore.teacherRating.length > 0">
|
|
||||||
<el-input-number
|
|
||||||
v-model="classWorkFormScore.teacherRating[0].score"
|
|
||||||
:controls="false"
|
|
||||||
type="number"
|
|
||||||
:min="0"
|
|
||||||
:max="classWorkFormScore.teacherRating[0].maxScore"
|
|
||||||
size="small"
|
|
||||||
style="width: 60px"
|
|
||||||
@change="handleChange"
|
|
||||||
></el-input-number>
|
|
||||||
</span>
|
|
||||||
<span>分</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<div class="score-container">
|
<div class="score-container">
|
||||||
<div
|
<div
|
||||||
v-for="(score, index) in teacherRatingList"
|
v-for="(score, index) in teacherRatingList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="[
|
style="white-space: nowrap;"
|
||||||
'score-circle',
|
:class="['score-circle', { 'active': classWorkFormScore.rating == score.ratingKey }]"
|
||||||
{ active: classWorkFormScore.rating == score.ratingKey }
|
|
||||||
]"
|
|
||||||
@click="selectScore(score)"
|
@click="selectScore(score)"
|
||||||
>
|
>
|
||||||
{{ score.ratingValue }}
|
<el-text :style="{fontWeight:'bold', color: classWorkFormScore.rating == score.ratingKey ? 'rgb(225,12,8)':'rgb(131,131,131)' }">{{ score.ratingValue }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<el-select v-model="value" placeholder="常用评语" style="width: 240px" @change="onSelectOption">
|
||||||
</el-col>
|
|
||||||
<el-col :span="10" style="display: flex; align-items: center">
|
|
||||||
<el-select
|
|
||||||
v-model="value"
|
|
||||||
placeholder="常用评语"
|
|
||||||
style="width: 240px"
|
|
||||||
@change="onSelectOption"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in cities"
|
v-for="item in cities"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
@ -353,23 +322,21 @@
|
||||||
placeholder="输入新的常用语"
|
placeholder="输入新的常用语"
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
<el-button type="primary" size="small" @click="onConfirm"> 确定 </el-button>
|
<el-button type="primary" size="small" @click="onConfirm">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
<el-button size="small" @click="clear">取消</el-button>
|
<el-button size="small" @click="clear">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" style="display: flex; flex-direction: column">
|
<el-col :span="24" style="display: flex;flex-direction: column;">
|
||||||
<el-form-item label="评语说明">
|
<el-form-item>
|
||||||
<el-col :span="15" style="padding: 0px">
|
<el-col :span="24" style="padding: 0px">
|
||||||
<el-input
|
<el-input row="5" type="textarea" v-model="classWorkFormScore.teacherremark" rows="1" placeholder="输入评语" />
|
||||||
v-model="classWorkFormScore.teacherremark"
|
|
||||||
type="textarea"
|
|
||||||
rows="1"
|
|
||||||
placeholder="请输入评语说明"
|
|
||||||
/>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -501,11 +468,11 @@ const classWorkFormScore = reactive({
|
||||||
teacherremark: '' //评分说明
|
teacherremark: '' //评分说明
|
||||||
})
|
})
|
||||||
const teacherRatingList = ref([
|
const teacherRatingList = ref([
|
||||||
{ ratingKey: '1', ratingValue: '优' },
|
{ ratingKey: '1', ratingValue: '完美' },
|
||||||
{ ratingKey: '2', ratingValue: '优-' },
|
{ ratingKey: '2', ratingValue: '优秀' },
|
||||||
{ ratingKey: '3', ratingValue: '良' },
|
{ ratingKey: '3', ratingValue: '良好' },
|
||||||
{ ratingKey: '4', ratingValue: '良-' },
|
{ ratingKey: '4', ratingValue: '及格' },
|
||||||
{ ratingKey: '5', ratingValue: '差' }
|
{ ratingKey: '5', ratingValue: '不及格' }
|
||||||
])
|
])
|
||||||
// 确定的线上图片数据
|
// 确定的线上图片数据
|
||||||
//#region 文件内容相关
|
//#region 文件内容相关
|
||||||
|
@ -643,7 +610,33 @@ const selectScore = (score) => {
|
||||||
console.log(score, 'score----')
|
console.log(score, 'score----')
|
||||||
classWorkFormScore.rating = score.ratingKey
|
classWorkFormScore.rating = score.ratingKey
|
||||||
}
|
}
|
||||||
|
const checkWorkType = (params) => {
|
||||||
|
//这里判断题目类型
|
||||||
|
const subType = params.quizlist.map(item => item.worktype)
|
||||||
|
const objectiveQuestion = ['单选题','多选题','判断题']
|
||||||
|
//判断题目是不是客观题
|
||||||
|
if(subType.every(item => objectiveQuestion.includes(item))){
|
||||||
|
// 获取学生答题列表
|
||||||
|
|
||||||
|
const score = extractedNumber(params.studentObj.scoingRate)
|
||||||
|
if(0<=score<=59){
|
||||||
|
classWorkFormScore.rating = 5
|
||||||
|
}else if(60<=score<=69){
|
||||||
|
classWorkFormScore.rating = 4
|
||||||
|
}else if(70<=score<=79){
|
||||||
|
classWorkFormScore.rating = 3
|
||||||
|
}else if(80<=score<=99){
|
||||||
|
classWorkFormScore.rating = 2
|
||||||
|
}else{
|
||||||
|
classWorkFormScore.rating = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取百分比的数字
|
||||||
|
const extractedNumber = (score) => {
|
||||||
|
const match = score.match(/\d+/);
|
||||||
|
return match ? parseInt(match[0], 10) : null;
|
||||||
|
}
|
||||||
// 接收父组件传过来的参数
|
// 接收父组件传过来的参数
|
||||||
const acceptParams = async (params) => {
|
const acceptParams = async (params) => {
|
||||||
console.log(params)
|
console.log(params)
|
||||||
|
@ -664,7 +657,7 @@ const acceptParams = async (params) => {
|
||||||
teacherFeedContentList.value = []
|
teacherFeedContentList.value = []
|
||||||
teachImageList.value = []
|
teachImageList.value = []
|
||||||
teachFileList.value = []
|
teachFileList.value = []
|
||||||
|
checkWorkType(params)
|
||||||
// -----------------
|
// -----------------
|
||||||
dialogProps.value = params
|
dialogProps.value = params
|
||||||
classWorkFormScore.name = params.studentObj.studentname
|
classWorkFormScore.name = params.studentObj.studentname
|
||||||
|
@ -802,7 +795,7 @@ const acceptParams = async (params) => {
|
||||||
console.log(params.studentQuizAllList[0].rating, '----------------------------')
|
console.log(params.studentQuizAllList[0].rating, '----------------------------')
|
||||||
// 为null 或0 则默认为0
|
// 为null 或0 则默认为0
|
||||||
classWorkFormScore.rating =
|
classWorkFormScore.rating =
|
||||||
params.studentQuizAllList[0].rating == 0 ? 0 : params.studentQuizAllList[0].rating
|
params.studentQuizAllList[0].rating == 0 ? classWorkFormScore.rating : params.studentQuizAllList[0].rating
|
||||||
}
|
}
|
||||||
|
|
||||||
analysisScoreOpen.value = true
|
analysisScoreOpen.value = true
|
||||||
|
@ -834,8 +827,10 @@ const formatFeedContent = (stuItem, quItem) => {
|
||||||
const list = quizStrToList(quItem.workdesc);
|
const list = quizStrToList(quItem.workdesc);
|
||||||
format = list.map((item,index) =>{
|
format = list.map((item,index) =>{
|
||||||
if (quItem.worktype == '单选题') {
|
if (quItem.worktype == '单选题') {
|
||||||
const workdesc = item.replace(/<[^>]*>/g,'');
|
// const workdesc = item.replace(/<[^>]*>/g,'');
|
||||||
const feedcontent = stuItem.feedcontent.replace(/<[^>]*>/g,'');
|
// const feedcontent = stuItem.feedcontent.replace(/<[^>]*>/g,'');
|
||||||
|
const workdesc = item;
|
||||||
|
const feedcontent = stuItem.feedcontent;
|
||||||
if(workdesc == feedcontent){
|
if(workdesc == feedcontent){
|
||||||
return (String.fromCharCode(65+Number(index)))
|
return (String.fromCharCode(65+Number(index)))
|
||||||
}
|
}
|
||||||
|
@ -972,23 +967,23 @@ defineExpose({
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-circle {
|
.score-circle {
|
||||||
width: 30px;
|
border: 1px solid rgb(131,131,131,.5);
|
||||||
height: 30px;
|
padding: 5px 0;
|
||||||
border-radius: 50%;
|
background-color: #fff;
|
||||||
background-color: pink;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 13px;
|
|
||||||
margin: 0 10px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s;
|
margin-right: 5px;
|
||||||
|
width: 60px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-circle.active {
|
.score-circle.active {
|
||||||
background-color: red;
|
background-color: rgb(253, 236, 224);
|
||||||
color: white;
|
color: white;
|
||||||
|
border: 1px solid rgb(253, 236, 224);
|
||||||
|
}
|
||||||
|
.greenLine{
|
||||||
|
border-left: 5px solid rgb(14, 209, 22);
|
||||||
|
padding-left: 5px
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header{
|
.card-header{
|
||||||
|
|
|
@ -94,19 +94,19 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
||||||
<template v-if="scope.row.teacherRating == 1"
|
<template v-if="scope.row.teacherRating == 1"
|
||||||
><el-tag type="danger">优</el-tag></template
|
><el-tag type="danger">完美</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 2"
|
<template v-if="scope.row.teacherRating == 2"
|
||||||
><el-tag type="danger">优-</el-tag></template
|
><el-tag type="danger">优秀</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 3"
|
<template v-if="scope.row.teacherRating == 3"
|
||||||
><el-tag type="warning">良</el-tag></template
|
><el-tag type="warning">良好</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 4"
|
<template v-if="scope.row.teacherRating == 4"
|
||||||
><el-tag type="info">良-</el-tag></template
|
><el-tag type="info">及格</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 5"
|
<template v-if="scope.row.teacherRating == 5"
|
||||||
><el-tag type="info">差</el-tag></template
|
><el-tag type="info">不及格</el-tag></template
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -261,6 +261,7 @@ const openDialog = (data) => {
|
||||||
}
|
}
|
||||||
classWorkAnalysis.quizlist = idres.rows
|
classWorkAnalysis.quizlist = idres.rows
|
||||||
classWorkActiveData.quizlist = idres.rows // zdg: 作业概览组件使用
|
classWorkActiveData.quizlist = idres.rows // zdg: 作业概览组件使用
|
||||||
|
processList(classWorkActiveData.quizlist);
|
||||||
|
|
||||||
// 统计每个题目的正误率
|
// 统计每个题目的正误率
|
||||||
// 这个学习任务所有题目+所有学生的答题数据 , pageSize: 100
|
// 这个学习任务所有题目+所有学生的答题数据 , pageSize: 100
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div @click="showExamAnalyseDrawer(scope.row)">
|
||||||
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
|
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
|
||||||
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
||||||
<el-col :span="24" style="display: flex">
|
<el-col :span="24" style="display: flex">
|
||||||
|
@ -224,6 +224,9 @@
|
||||||
|
|
||||||
<!-- 预览框 -->
|
<!-- 预览框 -->
|
||||||
<prevReadMsgDialog ref="prevReadMsgDialogRef" :bookobj="props.bookobj"/>
|
<prevReadMsgDialog ref="prevReadMsgDialogRef" :bookobj="props.bookobj"/>
|
||||||
|
|
||||||
|
<!-- 试题详细信息 -->
|
||||||
|
<examDetailsDrawer ref="examDetailsDrawerRef"></examDetailsDrawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -246,6 +249,7 @@ import { getCurrentTime } from '@/utils/date'
|
||||||
import FileUpload from "@/components/FileUpload/index.vue";
|
import FileUpload from "@/components/FileUpload/index.vue";
|
||||||
import whiteboard from '@/components/whiteboard/whiteboard.vue'
|
import whiteboard from '@/components/whiteboard/whiteboard.vue'
|
||||||
import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-Dialog.vue'
|
import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-Dialog.vue'
|
||||||
|
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
|
||||||
|
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
@ -858,6 +862,19 @@ const editWork = async (cform) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看试题详细信息
|
||||||
|
* @param row 单题数据
|
||||||
|
*/
|
||||||
|
const showExamAnalyseDrawer = (row) => {
|
||||||
|
nextTick(() => {
|
||||||
|
const activeParams = {
|
||||||
|
activeExam: row,
|
||||||
|
}
|
||||||
|
proxy.$refs.examDetailsDrawerRef.acceptParams(activeParams);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row class="c-warp" :gutter="10">
|
<el-row class="c-warp" :gutter="10">
|
||||||
<el-col class="left" :span="14">
|
<el-col class="left" :span="10">
|
||||||
<el-collapse class="c-item" v-model="activeTopic">
|
<el-collapse class="c-item" v-model="activeTopic" accordion>
|
||||||
<template v-for="(item, index) in dataList">
|
<template v-for="(item, index) in dataList">
|
||||||
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
|
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)" @click="clickItem(index)">
|
||||||
<template #title>
|
<template #title>
|
||||||
<el-popover :width="500" placement="right">
|
<el-popover :width="500" placement="right">
|
||||||
<p>{{item.def?.titletext}}</p>
|
<p>{{item.def?.titletext}}</p>
|
||||||
|
@ -54,13 +54,13 @@
|
||||||
</template>
|
</template>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="right" :span="10">
|
<el-col class="right" :span="14">
|
||||||
<div class="c-item">
|
<div class="c-item">
|
||||||
<div class="title">提交情况</div>
|
<!-- <div class="title">提交情况</div>
|
||||||
<div class="respond">
|
<div class="respond">
|
||||||
<el-space wrap>
|
<el-space wrap> -->
|
||||||
<!-- <template v-for="it in 11"> -->
|
<!-- <template v-for="it in 11"> -->
|
||||||
<template v-for="(item, index) in dataList">
|
<!-- <template v-for="(item, index) in dataList">
|
||||||
<el-card shadow="hover" class="card-warp">
|
<el-card shadow="hover" class="card-warp">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<el-progress type="dashboard" :color="colorArr" :width="80" :percentage="ratio_2(item)" />
|
<el-progress type="dashboard" :color="colorArr" :width="80" :percentage="ratio_2(item)" />
|
||||||
|
@ -70,7 +70,41 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
</el-space>
|
</el-space>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
|
<div class="title">试题详情</div>
|
||||||
|
<!-- 习题训练 -->
|
||||||
|
<el-card style="max-width: 100%; margin-bottom: 10px; text-align: left;">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" style="padding: 10px">
|
||||||
|
<!-- 题源、题目标题、题目选项 -->
|
||||||
|
<span>{{ activeExam.worktag }}</span>
|
||||||
|
<span style="margin-left: 4px" v-html="activeExam.titleFormat"></span>
|
||||||
|
<div :span="24" style="padding: 6px" v-html="activeExam.workdescFormat"></div>
|
||||||
|
<!-- 折叠: 详情分析解答 -->
|
||||||
|
<div class="demo-collapse">
|
||||||
|
<el-collapse v-model="activeExamFlag">
|
||||||
|
<el-collapse-item title="详情分析解答" name="1">
|
||||||
|
<el-row style=" padding: 6px 10px; border: 2px dotted;">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-col :span="2" style="padding: 6px 0px"><em>【答案】</em></el-col>
|
||||||
|
<el-col :span="21" style="padding: 6px 0px" v-html="activeExam.workanswerFormat"></el-col>
|
||||||
|
<el-col :span="2" style="padding: 6px 0px"><em>【分析】</em></el-col>
|
||||||
|
<el-col :span="21" style="padding: 6px 0px" v-html="activeExam.method"></el-col>
|
||||||
|
<el-col :span="2" style="padding: 6px 0px"><em>【解答】</em></el-col>
|
||||||
|
<el-col :span="21" style="padding: 6px 0px" v-html="activeExam.analyse"></el-col>
|
||||||
|
<el-col :span="2" style="padding: 6px 0px"><em>【点评】</em></el-col>
|
||||||
|
<el-col :span="21" style="padding: 6px 0px" v-html="activeExam.discuss"></el-col>
|
||||||
|
<!-- <el-col :span="21" style="padding: 6px 0px" v-html="dataList[activeTopic-1].def.discuss"></el-col> -->
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -84,7 +118,9 @@ import { ref, defineExpose, onMounted, reactive, computed, watch, nextTick, watc
|
||||||
// import * as elementPlus from 'element-plus' // ElMessage ElMessageBox
|
// import * as elementPlus from 'element-plus' // ElMessage ElMessageBox
|
||||||
let colorArr = [] // 进度颜色值 -- 静态数据
|
let colorArr = [] // 进度颜色值 -- 静态数据
|
||||||
// const attrs = useAttrs() // props中未定义属性
|
// const attrs = useAttrs() // props中未定义属性
|
||||||
const activeTopic = ref(0) // 展开的题
|
const activeTopic = ref(1) // 展开的题
|
||||||
|
const activeExam = ref({}) // 展开的试题
|
||||||
|
const activeExamFlag = ref(['1']) // 展开的试题
|
||||||
let dataList = ref([]) // 左侧数据
|
let dataList = ref([]) // 左侧数据
|
||||||
let studentList = ref([]) // 学生数据
|
let studentList = ref([]) // 学生数据
|
||||||
const props = defineProps({ // 参数 defineProps
|
const props = defineProps({ // 参数 defineProps
|
||||||
|
@ -115,7 +151,10 @@ colorArr = [
|
||||||
|
|
||||||
// === 初始加载完 ===
|
// === 初始加载完 ===
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
activeTopic.value = dataList.value.map((_, index) => index + 1);
|
//activeTopic.value = dataList.value.map((_, index) => index + 1);
|
||||||
|
if (dataList.value[activeTopic.value-1].def != null && dataList.value[activeTopic.value-1].def != undefined) {
|
||||||
|
activeExam.value = dataList.value[activeTopic.value-1].def;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// === 方法(methods) ===
|
// === 方法(methods) ===
|
||||||
|
@ -285,6 +324,18 @@ const clickInfo = async ind => {
|
||||||
setTimeout(() => {scrollToElement('collapse-' + ind)}, 300);
|
setTimeout(() => {scrollToElement('collapse-' + ind)}, 300);
|
||||||
// elementPlus.ElMessage.warning('功能未开放!')
|
// elementPlus.ElMessage.warning('功能未开放!')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点击试题
|
||||||
|
const clickItem = async (index) => {
|
||||||
|
if (index > dataList.length-1 ) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (dataList.value[index].def == null || dataList.value[index].def == undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
activeExam.value = dataList.value[index].def;
|
||||||
|
}
|
||||||
|
|
||||||
// === 通用工具 ===
|
// === 通用工具 ===
|
||||||
// 滚动到指定位置
|
// 滚动到指定位置
|
||||||
const scrollToElement = id => {
|
const scrollToElement = id => {
|
||||||
|
@ -313,8 +364,14 @@ watchEffect(() => { initData() })
|
||||||
background: #F2F3F5;
|
background: #F2F3F5;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
.left{padding-left: 0 !important; height: 100%;}
|
.left{
|
||||||
.right{padding-right: 0 !important;}
|
padding-left: 0 !important;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.right{
|
||||||
|
padding-right: 0 !important;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
.c-item{
|
.c-item{
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -362,7 +419,7 @@ watchEffect(() => { initData() })
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.respond{
|
.respond{
|
||||||
height: calc(100% - 65px);
|
/* height: calc(100% - 65px);*/
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.el-space{padding: 5px;}
|
.el-space{padding: 5px;}
|
||||||
.card-warp{
|
.card-warp{
|
||||||
|
|
|
@ -84,19 +84,19 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
||||||
<template v-if="scope.row.teacherRating == 1"
|
<template v-if="scope.row.teacherRating == 1"
|
||||||
><el-tag type="danger">优</el-tag></template
|
><el-tag type="danger">完美</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 2"
|
<template v-if="scope.row.teacherRating == 2"
|
||||||
><el-tag type="danger">优-</el-tag></template
|
><el-tag type="danger">优秀</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 3"
|
<template v-if="scope.row.teacherRating == 3"
|
||||||
><el-tag type="warning">良</el-tag></template
|
><el-tag type="warning">良好</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 4"
|
<template v-if="scope.row.teacherRating == 4"
|
||||||
><el-tag type="info">良-</el-tag></template
|
><el-tag type="info">及格</el-tag></template
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.teacherRating == 5"
|
<template v-if="scope.row.teacherRating == 5"
|
||||||
><el-tag type="info">差</el-tag></template
|
><el-tag type="info">不及格</el-tag></template
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
<!-- 训练报告-->
|
<!-- 训练报告-->
|
||||||
<div v-else-if="classWorkAnalysis.view == 'report'" style="width: 100%;overflow-y: scroll">
|
<div v-else-if="classWorkAnalysis.view == 'report'" style="width: 100%;overflow-y: scroll">
|
||||||
<!-- <ClassOverview :table-list="overviewData" :eval-id="courseObj.evalid"></ClassOverview> -->
|
<!-- <ClassOverview :table-list="overviewData" :eval-id="courseObj.evalid"></ClassOverview> -->
|
||||||
<ClassOverview :table-list="overviewData" style="width: 100%;"></ClassOverview>
|
<ClassOverview :active-data="classWorkActiveData" :table-list="overviewData" style="width: 100%;"></ClassOverview>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -157,6 +157,8 @@ import ItemDialogScore from '@/views/classTask/container/classTask/item-dialog-s
|
||||||
import quizStats from '@/views/classTask/container/quizStats.vue'
|
import quizStats from '@/views/classTask/container/quizStats.vue'
|
||||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
||||||
import {sessionStore} from '@/utils/store'
|
import {sessionStore} from '@/utils/store'
|
||||||
|
import Chat from '@/utils/chat' // im 登录初始化
|
||||||
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const emit = defineEmits(['cle-click'])
|
const emit = defineEmits(['cle-click'])
|
||||||
|
@ -203,35 +205,38 @@ const classWorkAnalysisScore = reactive({
|
||||||
// form.name = newValue.label
|
// form.name = newValue.label
|
||||||
// }
|
// }
|
||||||
// )
|
// )
|
||||||
const openDialog = (data) => {
|
const openDialog = (data, isInit=true) => {
|
||||||
console.log(data, '点击的item完成情况')
|
console.log(data, '点击的item完成情况')
|
||||||
|
|
||||||
classWorkAnalysis.title = data.uniquekey ? data.uniquekey + '--' : ''
|
if (isInit) {
|
||||||
classWorkAnalysis.worktype = data.worktype
|
classWorkAnalysis.title = data.uniquekey ? data.uniquekey + '--' : ''
|
||||||
classWorkAnalysis.workclass = data.workclass
|
classWorkAnalysis.worktype = data.worktype
|
||||||
// 重置学生列表
|
classWorkAnalysis.workclass = data.workclass
|
||||||
tableRadio.list = []
|
// 重置学生列表
|
||||||
tableRadio.value = '1'
|
tableRadio.list = []
|
||||||
tableRadio.num0 = 0
|
tableRadio.value = '1'
|
||||||
tableRadio.num1 = 0
|
tableRadio.num0 = 0
|
||||||
|
tableRadio.num1 = 0
|
||||||
|
|
||||||
classWorkAnalysis.open = true
|
classWorkAnalysis.open = true
|
||||||
// 默认显示是学生作业反馈
|
// 默认显示是学生作业反馈
|
||||||
classWorkAnalysis.view = 'studentview'
|
classWorkAnalysis.view = 'studentview'
|
||||||
// 当前学习任务所包含的试题ID
|
// 当前学习任务所包含的试题ID
|
||||||
classWorkAnalysis.entpcourseworklistarray = data.entpcourseworklistarray
|
classWorkAnalysis.entpcourseworklistarray = data.entpcourseworklistarray
|
||||||
// 默认选中的学生
|
// 默认选中的学生
|
||||||
classWorkAnalysis.activeStudentQuizlist = []
|
classWorkAnalysis.activeStudentQuizlist = []
|
||||||
// 默认选中的试题
|
// 默认选中的试题
|
||||||
classWorkAnalysis.activeQuizAnalysisData = []
|
classWorkAnalysis.activeQuizAnalysisData = []
|
||||||
|
|
||||||
|
classWorkAnalysis.row = data
|
||||||
|
window.test = this
|
||||||
|
// zdg: 学生列表
|
||||||
|
const studentArr = data.classworkdatastudentids
|
||||||
|
? JSON.parse(`[${data.classworkdatastudentids}]`)
|
||||||
|
: []
|
||||||
|
classWorkActiveData.studentList = studentArr
|
||||||
|
}
|
||||||
|
|
||||||
classWorkAnalysis.row = data
|
|
||||||
window.test = this
|
|
||||||
// zdg: 学生列表
|
|
||||||
const studentArr = data.classworkdatastudentids
|
|
||||||
? JSON.parse(`[${data.classworkdatastudentids}]`)
|
|
||||||
: []
|
|
||||||
classWorkActiveData.studentList = studentArr
|
|
||||||
/** 学生完成情况分析--获取作业学生list数据 */
|
/** 学生完成情况分析--获取作业学生list数据 */
|
||||||
getClassWorkStudentList(data.id)
|
getClassWorkStudentList(data.id)
|
||||||
|
|
||||||
|
@ -248,6 +253,7 @@ const openDialog = (data) => {
|
||||||
}
|
}
|
||||||
classWorkAnalysis.quizlist = idres.rows
|
classWorkAnalysis.quizlist = idres.rows
|
||||||
classWorkActiveData.quizlist = idres.rows // zdg: 作业概览组件使用
|
classWorkActiveData.quizlist = idres.rows // zdg: 作业概览组件使用
|
||||||
|
processList(classWorkActiveData.quizlist);
|
||||||
|
|
||||||
// 统计每个题目的正误率
|
// 统计每个题目的正误率
|
||||||
// 这个学习任务所有题目+所有学生的答题数据 , pageSize: 100
|
// 这个学习任务所有题目+所有学生的答题数据 , pageSize: 100
|
||||||
|
@ -343,7 +349,7 @@ const getClassWorkStudentList = (rowId) => {
|
||||||
response.rows[i].classworkevallist != 'null'
|
response.rows[i].classworkevallist != 'null'
|
||||||
) {
|
) {
|
||||||
// 将标签中双引号改为转义, 测试数据: "{\"id\":172910, \"feedcontent\":\"毛泽东,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
// 将标签中双引号改为转义, 测试数据: "{\"id\":172910, \"feedcontent\":\"毛泽东,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
||||||
// 常规作业(去除【】前后引号).replace(/"(\[.*\])"/g, '$1'); :eg: "feedcontent\":\"[{\"name\":\"Bliss.jpg\",\"url\":\"https://wzyzoss.3b8daa474.jpg\"}]\",
|
// 主题作业(去除【】前后引号).replace(/"(\[.*\])"/g, '$1'); :eg: "feedcontent\":\"[{\"name\":\"Bliss.jpg\",\"url\":\"https://wzyzoss.3b8daa474.jpg\"}]\",
|
||||||
// json转换会报错; .replace(/""/g, '"') eg: ""宇宙环境安全""
|
// json转换会报错; .replace(/""/g, '"') eg: ""宇宙环境安全""
|
||||||
response.rows[i].classworkevallist = escapeHtmlQuotes(response.rows[i].classworkevallist)
|
response.rows[i].classworkevallist = escapeHtmlQuotes(response.rows[i].classworkevallist)
|
||||||
//console.log('学生完成情况分析classworkevallist', response.rows[i].classworkevallist)
|
//console.log('学生完成情况分析classworkevallist', response.rows[i].classworkevallist)
|
||||||
|
@ -570,6 +576,10 @@ const getWorkFeedList = async() =>{
|
||||||
function: 训练报告的处理
|
function: 训练报告的处理
|
||||||
*/
|
*/
|
||||||
const handleClassOverviewOpen = (type) =>{
|
const handleClassOverviewOpen = (type) =>{
|
||||||
|
// 每次进来都重新调用一次
|
||||||
|
if(type == 'report') {
|
||||||
|
getWorkFeedList();
|
||||||
|
}
|
||||||
// 关闭右侧批阅ui
|
// 关闭右侧批阅ui
|
||||||
isopen_dtwk_table.value = false;
|
isopen_dtwk_table.value = false;
|
||||||
classWorkAnalysis.view = type
|
classWorkAnalysis.view = type
|
||||||
|
@ -632,16 +642,62 @@ const closeDialog = () => {
|
||||||
emit('cle-click')
|
emit('cle-click')
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
// im监听消息回调
|
||||||
|
const msgHandle = (msg) => {
|
||||||
|
const { type, data } = msg
|
||||||
|
switch(type) {
|
||||||
|
case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
||||||
|
{
|
||||||
|
(data||[]).forEach(o => {
|
||||||
|
const msgArr = o?.message_elem_array||[]
|
||||||
|
msgArr.forEach(info => {
|
||||||
|
const msgType = info?.elem_type // 消息类型 TIMElemType
|
||||||
|
const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : ''
|
||||||
|
// 处理学生端反馈得消息
|
||||||
|
//console.log('msgData->', msgData);
|
||||||
|
if (msgData.msgKey == "finishHomework"){
|
||||||
|
// 刷新
|
||||||
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
|
//console.log('data->', data);
|
||||||
|
openDialog(data, false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const reloadTimer = ref(0); // 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
|
const cutid = ref(0); // 当前初始化的作业id
|
||||||
|
onMounted(() => {
|
||||||
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
// const data = sessionStore.get('teachClassWorkItem');
|
// const data = sessionStore.get('teachClassWorkItem');
|
||||||
// const data = localStorage.getItem('teachClassWorkItem');
|
|
||||||
console.log(data,'????????????????????' )
|
|
||||||
if(data){
|
if(data){
|
||||||
openDialog(data)
|
openDialog(data)
|
||||||
}
|
}
|
||||||
|
// 开始定时查询
|
||||||
|
cutid.value = data.id;
|
||||||
|
isReloadTimer();
|
||||||
|
|
||||||
|
// im监听消息
|
||||||
|
if (!Chat.imChat) {
|
||||||
|
Chat.init(true, true, msgHandle);
|
||||||
|
} else {
|
||||||
|
Chat.listenMsg(msgHandle);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
const isReloadTimer = () =>{
|
||||||
|
clearInterval(reloadTimer.value) // 关闭定时器
|
||||||
|
// 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
|
reloadTimer.value = setInterval(() => {
|
||||||
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
|
if(cutid.value != data.id){
|
||||||
|
cutid.value = data.id;
|
||||||
|
openDialog(data)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
watch(classWorkAnalysis, (newVal, oldVal) => {
|
watch(classWorkAnalysis, (newVal, oldVal) => {
|
||||||
if(newVal.view != 'quizStats'){
|
if(newVal.view != 'quizStats'){
|
||||||
|
@ -652,6 +708,7 @@ watch(classWorkAnalysis, (newVal, oldVal) => {
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的
|
clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的
|
||||||
|
clearInterval(reloadTimer.value) // 关闭定时器 查询作业id是否刷新了
|
||||||
})
|
})
|
||||||
|
|
||||||
// defineExpose({
|
// defineExpose({
|
||||||
|
@ -697,7 +754,7 @@ onUnmounted(() => {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.classwork-score{
|
.classwork-score{
|
||||||
// overflow-y: auto;
|
/* overflow-y: auto; */
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,12 @@
|
||||||
<el-table-column align="center" prop="worktag" width="120"></el-table-column>
|
<el-table-column align="center" prop="worktag" width="120"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 试题详情 -->
|
<!-- 试题详细信息 -->
|
||||||
<el-drawer v-model="activeExamInfoDrawer" title="题目详情" :with-header="false" direction="rtl" size="60%">
|
<examDetailsDrawer ref="examDetailsDrawerRef"></examDetailsDrawer>
|
||||||
|
|
||||||
|
<!-- <el-drawer v-model="activeExamInfoDrawer" title="题目详情" :with-header="false" direction="rtl" size="60%">
|
||||||
<div style="height: calc(100% - 50px);">
|
<div style="height: calc(100% - 50px);">
|
||||||
<el-scrollbar style="background: #e9e9e9;border-radius: 8px;">
|
<el-scrollbar style="background: #F3F5F8;border-radius: 8px;">
|
||||||
<el-row class="drawer-main">
|
<el-row class="drawer-main">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<span>{{activeExam.worktag}}</span>
|
<span>{{activeExam.worktag}}</span>
|
||||||
|
@ -42,11 +44,13 @@
|
||||||
<div class="drawer-footer">
|
<div class="drawer-footer">
|
||||||
<el-button type="primary" @click="activeExamInfoDrawer = false">关闭</el-button>
|
<el-button type="primary" @click="activeExamInfoDrawer = false">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, reactive} from 'vue'
|
import {ref, reactive, getCurrentInstance, nextTick} from 'vue'
|
||||||
|
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
listExamQuestion: {type: Array},
|
listExamQuestion: {type: Array},
|
||||||
|
@ -57,8 +61,12 @@ const activeExamInfoDrawer = ref(false);
|
||||||
const activeExam = ref({});
|
const activeExam = ref({});
|
||||||
|
|
||||||
const showExamAnalyseDrawer = (row) => {
|
const showExamAnalyseDrawer = (row) => {
|
||||||
activeExam.value = row;
|
nextTick(() => {
|
||||||
activeExamInfoDrawer.value = true;
|
const activeParams = {
|
||||||
|
activeExam: row,
|
||||||
|
}
|
||||||
|
proxy.$refs.examDetailsDrawerRef.acceptParams(activeParams);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -620,7 +620,7 @@ const changeCursor = (cursorStyle) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFiledf28bf990a4c40ffb7477ed4b65392c27232357022409613439/%E3%80%8A%E9%9D%99%E5%A5%B3%E3%80%8B%E6%B7%B1%E5%BA%A6%E8%A7%A3%E8%AF%BB%E4%B8%8E%E7%A0%94%E7%A9%B6.pptx"
|
// let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFileba724e0344f74e1480535eedf3ebec661601807661085006275/%E9%87%91%E9%A9%AC%E5%A5%96%E5%B0%B4%E5%B0%AC%E4%BA%8B%E4%BB%B6%E5%88%86%E6%9E%90%E4%B8%8E%E5%BA%94%E5%AF%B9%E7%AD%96%E7%95%A5.pptx"
|
||||||
// creatAIPPT(props.currentNode.itemtitle + '.pptx',url, props.uploadData).then((res) => {
|
// creatAIPPT(props.currentNode.itemtitle + '.pptx',url, props.uploadData).then((res) => {
|
||||||
// emit('addSuccess',res)
|
// emit('addSuccess',res)
|
||||||
// })
|
// })
|
||||||
|
|
|
@ -226,7 +226,7 @@ const getClasscourseList = async type => {
|
||||||
const {classid} = classForm.form
|
const {classid} = classForm.form
|
||||||
const {entpcourseid} = myClassActive.value
|
const {entpcourseid} = myClassActive.value
|
||||||
if (!classid || !entpcourseid) return
|
if (!classid || !entpcourseid) return
|
||||||
const params = {classid, entpcourseid, entpcoursefileid: 0}
|
const params = {classid, entpcourseid, entpcoursefileid: 0, pageSize: 1000}
|
||||||
const res = await Http_Classcourse.listClasscourse(params)
|
const res = await Http_Classcourse.listClasscourse(params)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// zdg: 排序id大的在前(最新的)
|
// zdg: 排序id大的在前(最新的)
|
||||||
|
@ -255,9 +255,9 @@ const createClasscourse = async () => {
|
||||||
entpcourseid, evalid, coursetitle,
|
entpcourseid, evalid, coursetitle,
|
||||||
plandate: curDate, opendate: curDate
|
plandate: curDate, opendate: curDate
|
||||||
}
|
}
|
||||||
await Http_Classcourse.addClasscourseReturnId(params)
|
teacherForm.form.classcourseid = await Http_Classcourse.addClasscourseReturnId(params)
|
||||||
dt.loading = false
|
dt.loading = false
|
||||||
getClasscourseList('update') // 更新列表
|
// getClasscourseList('update') // 更新列表
|
||||||
ElMessage.success('创建课程-成功')
|
ElMessage.success('创建课程-成功')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,10 +85,11 @@ import FileImage from '@/components/file-image/index.vue'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
import {createWindow} from '@/utils/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, getClassWorkList, getStudentClassWorkData } from '../createHomework'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -110,7 +111,13 @@ const curNode = reactive({
|
||||||
data: {}
|
data: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const props = defineProps(['curNode'])
|
||||||
|
const emit = defineEmits(['closeActive'])
|
||||||
|
|
||||||
|
|
||||||
const sendHomework = (row,type) => {
|
const sendHomework = (row,type) => {
|
||||||
|
|
||||||
|
|
||||||
if(type == 'item'){
|
if(type == 'item'){
|
||||||
// 布置推送单个作业
|
// 布置推送单个作业
|
||||||
curRow.value = [row]
|
curRow.value = [row]
|
||||||
|
@ -124,11 +131,28 @@ const sendHomework = (row,type) => {
|
||||||
const closeHomework = async() => {
|
const closeHomework = async() => {
|
||||||
ipcMsgSend('tool-sphere:set:ignore', true)
|
ipcMsgSend('tool-sphere:set:ignore', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 推送成功
|
// 推送成功
|
||||||
const successHomework = (data)=>{
|
const successHomework = async (data)=>{
|
||||||
|
// data.msg
|
||||||
// console.log('推送成功', data)
|
// console.log('推送成功', data)
|
||||||
// 发送im消息-推送作业(app|平板)
|
// 发送im消息-推送作业(app|平板)
|
||||||
// ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016)
|
// ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送成功 打开作业批改
|
||||||
|
* 2024/10/23
|
||||||
|
* 以下两个函数 代码 参照"作业批改" 页面
|
||||||
|
*/
|
||||||
|
let result = await getClassWorkList(data.msg)
|
||||||
|
result = await getStudentClassWorkData()
|
||||||
|
localStorage.setItem('teachClassWorkItem', JSON.stringify(result[0]));
|
||||||
|
toolStore.isTaskWin=true; // 设置打开批改窗口
|
||||||
|
emit('closeActive')
|
||||||
|
createWindow('open-taskwin',{url:'/teachClassTask'}); // 调用新窗口批改页面
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 章节目录change
|
// 章节目录change
|
||||||
const changeChapter = async (data)=>{
|
const changeChapter = async (data)=>{
|
||||||
|
@ -222,7 +246,8 @@ onMounted(async () => {
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
// 当前节点 mounted 的时候从缓存里拿
|
// 当前节点 mounted 的时候从缓存里拿
|
||||||
curNode.data = sessionStore.get('subject.curNode')
|
// curNode.data = sessionStore.get('subject.curNode')
|
||||||
|
curNode.data = props.curNode
|
||||||
getHomework()
|
getHomework()
|
||||||
getResource()
|
getResource()
|
||||||
})
|
})
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<div class="c-popover" :style="`--top: ${topPos}px;--height:${hPost}px;`" v-show="isVisible">
|
<div class="c-popover" :style="`--top: ${topPos}px;--height:${hPost}px;`" v-show="isVisible">
|
||||||
<div class="content" v-if="isVisible">
|
<div class="content" v-if="isVisible">
|
||||||
<slot name="content">
|
<slot name="content">
|
||||||
<homework v-if="activeObj?.prop === 'resource'" />
|
<homework v-if="activeObj?.prop === 'resource'" :curNode="curNode" @closeActive="closeActive" />
|
||||||
<span v-else style="color:red;">{{activeObj}}</span>
|
<span v-else style="color:red;">{{activeObj}}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vue'
|
import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vue'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
import homework from './homework.vue';
|
import homework from './homework.vue';
|
||||||
|
|
||||||
// 功能说明:侧边-工具栏
|
// 功能说明:侧边-工具栏
|
||||||
|
@ -63,6 +64,8 @@ const topPos = ref(30) // 顶部距离-内容的距离
|
||||||
const hPost = ref(0) // 顶部距离-内容的距离
|
const hPost = ref(0) // 顶部距离-内容的距离
|
||||||
const isFold = ref(false) // 是否折叠
|
const isFold = ref(false) // 是否折叠
|
||||||
let posBtnAll = {} // 存储位置
|
let posBtnAll = {} // 存储位置
|
||||||
|
|
||||||
|
let curNode = null // 当前节点(作业需要)
|
||||||
// === 计算属性 ===
|
// === 计算属性 ===
|
||||||
const list = computed(() => props.data.map((o,i) => {
|
const list = computed(() => props.data.map((o,i) => {
|
||||||
o.style = getStyle(o.style, i)
|
o.style = getStyle(o.style, i)
|
||||||
|
@ -71,6 +74,8 @@ const list = computed(() => props.data.map((o,i) => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
posBtnAll = btnRef.value.getBoundingClientRect()
|
posBtnAll = btnRef.value.getBoundingClientRect()
|
||||||
hPost.value = posBtnAll.height
|
hPost.value = posBtnAll.height
|
||||||
|
|
||||||
|
curNode = sessionStore.get('subject.curNode')
|
||||||
})
|
})
|
||||||
// === 方法 ===
|
// === 方法 ===
|
||||||
// 获取颜色索引
|
// 获取颜色索引
|
||||||
|
@ -96,6 +101,10 @@ const clickHandel = (o, e) => {
|
||||||
}
|
}
|
||||||
emit('change', o)
|
emit('change', o)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeActive = () =>{
|
||||||
|
isVisible.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.warp{
|
.warp{
|
||||||
|
|
|
@ -1,37 +1,226 @@
|
||||||
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||||
|
import { listClassworkdata } from '@/api/classTask'
|
||||||
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
|
|
||||||
export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) =>{
|
|
||||||
const usertore = useUserStore().user
|
|
||||||
|
|
||||||
var formObj = {};
|
|
||||||
formObj.id = 0;
|
|
||||||
|
|
||||||
formObj.deaddate = '';
|
export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => {
|
||||||
formObj.entpid = usertore.deptId;
|
const usertore = useUserStore().user
|
||||||
formObj.level = 1;
|
|
||||||
formObj.parentid = 0;
|
|
||||||
formObj.worktype = '常规作业';
|
|
||||||
formObj.workkey = '';
|
|
||||||
formObj.worktag = '';
|
|
||||||
|
|
||||||
formObj.uniquekey = uniquekey;
|
var formObj = {}
|
||||||
|
formObj.id = 0
|
||||||
|
|
||||||
formObj.classid = 0;
|
formObj.deaddate = ''
|
||||||
formObj.classcourseid = 0;
|
formObj.entpid = usertore.deptId
|
||||||
|
formObj.level = 1
|
||||||
|
formObj.parentid = 0
|
||||||
|
formObj.worktype = '常规作业'
|
||||||
|
formObj.workkey = ''
|
||||||
|
formObj.worktag = ''
|
||||||
|
|
||||||
formObj.entpcourseid = entpcourseid;
|
formObj.uniquekey = uniquekey
|
||||||
|
|
||||||
formObj.slideid = 0;
|
formObj.classid = 0
|
||||||
|
formObj.classcourseid = 0
|
||||||
|
|
||||||
formObj.workcodes = JSON.stringify(data);
|
formObj.entpcourseid = entpcourseid
|
||||||
|
|
||||||
formObj.edusubject = usertore.edusubject;
|
formObj.slideid = 0
|
||||||
formObj.evalid = evalid
|
|
||||||
|
|
||||||
formObj.edustage = usertore.edustage;
|
formObj.workcodes = JSON.stringify(data)
|
||||||
formObj.status = '';
|
|
||||||
formObj.edituserid = usertore.userId;
|
formObj.edusubject = usertore.edusubject
|
||||||
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
formObj.evalid = evalid
|
||||||
return addClassworkReturnId(formObj)
|
|
||||||
|
formObj.edustage = usertore.edustage
|
||||||
|
formObj.status = ''
|
||||||
|
formObj.edituserid = usertore.userId
|
||||||
|
formObj.entpcourseworklist = JSON.stringify([{ id: -2, score: '10' }])
|
||||||
|
return addClassworkReturnId(formObj)
|
||||||
|
}
|
||||||
|
|
||||||
|
let classWorkList = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取班级作业
|
||||||
|
*/
|
||||||
|
export const getClassWorkList = async (id) => {
|
||||||
|
// 班级作业数据,包含多个班级 homeworklist
|
||||||
|
const response = await homeworklist({ id })
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
||||||
|
* 1、进行中、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
||||||
|
* 2、已结束、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
||||||
|
*/
|
||||||
|
|
||||||
|
let list = response.rows
|
||||||
|
|
||||||
|
for (var i = 0; i < list.length; i++) {
|
||||||
|
// 初始化部分新增字段值
|
||||||
|
list[i].workdatalist = []
|
||||||
|
list[i].workdatacount = 0 // 人数
|
||||||
|
list[i].workdatalistVisible = false
|
||||||
|
list[i].workdatafeedbackcount = 0 // 已交人数
|
||||||
|
list[i].feedtimelength = 0
|
||||||
|
list[i].rightAnswerCount = 0
|
||||||
|
list[i].scoingRate = 0 + '%' // 得分率
|
||||||
|
list[i].averagetime = 0 // 平均用时
|
||||||
|
|
||||||
|
// ----------------------------------------------
|
||||||
|
// 处理任务类型的UI
|
||||||
|
if (list[i].worktype == '学习目标定位') {
|
||||||
|
list[i].workclass = 'success'
|
||||||
|
list[i].workcodesList = JSON.parse(list[i].workcodes)
|
||||||
|
} else if (list[i].worktype == '教材研读') {
|
||||||
|
list[i].workclass = 'primary'
|
||||||
|
} else if (list[i].worktype == '框架梳理') {
|
||||||
|
list[i].workclass = 'warning'
|
||||||
|
} else if (list[i].worktype == '学科定位') {
|
||||||
|
list[i].workclass = 'info'
|
||||||
|
} else if (list[i].worktype == '习题训练') {
|
||||||
|
list[i].workclass = 'danger'
|
||||||
|
} else {
|
||||||
|
list[i].workclass = ''
|
||||||
|
}
|
||||||
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
if (list[i].entpcourseworklist != '') {
|
||||||
|
list[i].entpcourseworklistarray = JSON.parse('[' + list[i].entpcourseworklist + ']')
|
||||||
|
} else {
|
||||||
|
list[i].entpcourseworklistarray = []
|
||||||
|
}
|
||||||
|
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||||
|
if (
|
||||||
|
list[i].classworkdatastudentids != '' &&
|
||||||
|
list[i].classworkdatastudentids != null &&
|
||||||
|
list[i].classworkdatastudentids != 'null'
|
||||||
|
) {
|
||||||
|
const stuList = JSON.parse('[' + list[i].classworkdatastudentids + ']')
|
||||||
|
list[i].workdatacount = stuList.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 显示分配人数(workdatacount)>0 的
|
||||||
|
if (list && list.length > 0) {
|
||||||
|
classWorkList = list && list.filter((item) => item.workdatacount > 0)
|
||||||
|
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||||
|
} else {
|
||||||
|
classWorkList = []
|
||||||
|
}
|
||||||
|
|
||||||
|
return classWorkList
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getStudentClassWorkData = async () => {
|
||||||
|
const ids = classWorkList.map((item) => item.id).join(',')
|
||||||
|
if (ids == '') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const res = await listClassworkdata({
|
||||||
|
classworkids: ids,
|
||||||
|
pageSize: 1000
|
||||||
|
})
|
||||||
|
|
||||||
|
for (var t = 0; t < classWorkList.length; t++) {
|
||||||
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
if (
|
||||||
|
res.rows[i].classworkid == classWorkList[t].id &&
|
||||||
|
res.rows[i].finishtimelength != '0'
|
||||||
|
) {
|
||||||
|
console.log('==================')
|
||||||
|
// 有几个学生完成/正在完成学习任务
|
||||||
|
// 至少resultcount不是0
|
||||||
|
classWorkList[t].workdatafeedbackcount++
|
||||||
|
|
||||||
|
// 在参与学习任务的人中,汇总计算用时
|
||||||
|
classWorkList[t].feedtimelength += parseInt(res.rows[i].finishtimelength)
|
||||||
|
|
||||||
|
// 计算得分率
|
||||||
|
if (
|
||||||
|
res.rows[i].classworkevallist != '' &&
|
||||||
|
res.rows[i].classworkevallist != null &&
|
||||||
|
res.rows[i].classworkevallist != 'null'
|
||||||
|
) {
|
||||||
|
let replacedString = res.rows[i].classworkevallist.replace(/""/g, '"')
|
||||||
|
// 将标签中双引号改为转义, 测试数据: "{\"id\":172907, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358520, \"feedcontent\":\"④①⑤③②\", \"score\":4, \"rightanswer\":\"④①⑤③②\"},{\"id\":172908, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358521, \"feedcontent\":\"气壮山威,鲲鹏展翅楚云飞\", \"score\":4, \"rightanswer\":\"志远天高,春风杨柳麓山青\"},{\"id\":172909, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363096, \"feedcontent\":\"《红烛》化用“蜡矩”这一古典意象,赋予它新的含义,赞美了红烛以“蜡炬成灰”来点亮世界的奉献精神。\", \"score\":4, \"rightanswer\":\"《立在地球边上放号》中,全诗采用间接抒情的方式,描绘了太平洋的浪潮,吟唱了一曲惊心动魄的力的颂歌,意在赞美摧毁旧世界、创造新生活的“五四”精神。\"},{\"id\":172910, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363098, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
||||||
|
replacedString = escapeHtmlQuotes(res.rows[i].classworkevallist).replace(
|
||||||
|
/"(\[.*\])"/g,
|
||||||
|
'$1'
|
||||||
|
)
|
||||||
|
replacedString = escapeHtmlQuotes(res.rows[i].classworkevallist)
|
||||||
|
var evalarray
|
||||||
|
try {
|
||||||
|
evalarray = JSON.parse('[' + res.rows[i].classworkevallist + ']')
|
||||||
|
} catch {
|
||||||
|
evalarray = JSON.parse('[' + replacedString + ']')
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var e = 0; e < evalarray.length; e++) {
|
||||||
|
if (res.rows[i].worktype == '常规作业') {
|
||||||
|
evalarray[e].feedcontent = escapeHtmlQuotes(evalarray[e].feedcontent).replace(
|
||||||
|
/"(\[.*\])"/g,
|
||||||
|
'$1'
|
||||||
|
)
|
||||||
|
evalarray[e].feedcontent = escapeHtmlQuotes(evalarray[e].feedcontent)
|
||||||
|
}
|
||||||
|
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
|
||||||
|
// 正确,得分
|
||||||
|
classWorkList[t].rightAnswerCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 当前这个学习任务,共推送给了几个学生,workdatacount
|
||||||
|
if (res.rows[i].classworkid == classWorkList[t].id) {
|
||||||
|
classWorkList[t].workdatalist.push(res.rows[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算完成进度 workdatacount人数要大于0
|
||||||
|
if (
|
||||||
|
classWorkList[t].workdataresultcount > 0 &&
|
||||||
|
classWorkList[t].workdatacount > 0
|
||||||
|
) {
|
||||||
|
classWorkList[t].finishpercent = parseInt(
|
||||||
|
(classWorkList[t].workdataresultcount / classWorkList[t].workdatacount) * 100
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
classWorkList[t].finishpercent = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 以下四个参数,都要计算
|
||||||
|
// 2024-04-12,酉阳,by jackyshen
|
||||||
|
|
||||||
|
// 计算参与学习任务的平均用时
|
||||||
|
if (classWorkList[t].workdatafeedbackcount > 0) {
|
||||||
|
classWorkList[t].averagetime = Math.ceil(
|
||||||
|
classWorkList[t].feedtimelength / classWorkList[t].workdatafeedbackcount / 60
|
||||||
|
).toFixed(0)
|
||||||
|
} else {
|
||||||
|
classWorkList[t].averagetime = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算批阅异常,需要获取每个题目的类型,找出主观题
|
||||||
|
// 暂缓
|
||||||
|
|
||||||
|
// 计算平均得分率: 正确题数/(题目总数*学生人数)*100
|
||||||
|
if (
|
||||||
|
classWorkList[t].entpcourseworklistarray &&
|
||||||
|
classWorkList[t].entpcourseworklistarray.length > 0
|
||||||
|
) {
|
||||||
|
var dd =
|
||||||
|
(classWorkList[t].rightAnswerCount /
|
||||||
|
(classWorkList[t].entpcourseworklistarray.length *
|
||||||
|
classWorkList[t].workdatacount)) *
|
||||||
|
100
|
||||||
|
classWorkList[t].scoingRate = dd.toFixed(0) + '%'
|
||||||
|
} else {
|
||||||
|
classWorkList[t].scoingRate = '0%'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 设定典型作答,需要获取每个题目的类型,找出主观题
|
||||||
|
// 暂缓
|
||||||
|
}
|
||||||
|
return classWorkList
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue