Compare commits

..

No commits in common. "34900832ba2ee155b2e10f0fc60ae2eeed8efc36" and "c3bd7b31eea8fdeea406b7cf6e81e33d5edc2c07" have entirely different histories.

41 changed files with 912 additions and 1884 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win",
"version": "2.1.3",
"version": "2.1.1",
"description": "",
"main": "./out/main/index.js",
"author": "example.com",

View File

@ -135,7 +135,7 @@ function createMainWindow() {
} else {
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
}
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
// 第三步: 开启remote服务
@ -280,10 +280,14 @@ function handleAll() {
})
// 用于监听-状态管理变化-同步所有窗口
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
console.log('pinia-state-change-1', storeName, jsonStr)
for(const curWin of BrowserWindow.getAllWindows()){
const id = curWin.webContents.id
const bool = id !== e.sender.id && !curWin.isDestroyed()
if (id === e.sender.id) {
console.log('pinia-state-change-2', 'windows-send', curWin.type)
}
if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送
curWin.webContents.send('pinia-state-set', storeName, jsonStr)
}

View File

@ -14,14 +14,14 @@ const defaultData = {
isPdfWin: false, // pdf窗口是否打开
isToolWin: false, // 工具窗口是否打开
curSubjectNode: {
data: {}, // 当前教材节点 (包含当前教材 单元)
querySearch: {} // 查询资源所需参数
},
subject: { // 不走同步 Pinia
subject: {
bookList: null, // 教材列表
curBook: null, // 当前选中的教材
curNode: null, // 当前选中的节点
defaultExpandedKeys: [], //展开的节点
subjectTree: [] // "树结构" 章节
}
},
local: { // 本地(永久localStorage)

File diff suppressed because one or more lines are too long

View File

@ -294,7 +294,7 @@ See https://github.com/adobe-type-tools/cmap-resources
</span>
<span id="numPages" class="toolbarLabel"></span>
</div>
<div id="toolbarViewerRight">
<div id="toolbarViewerRight" style="display: none;">
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>

View File

@ -72,21 +72,7 @@ export function updateClasswork(data) {
})
}
// 删除classworkeval
export function delClassworkeval(id) {
return request({
url: '/education/classworkeval/' + id,
method: 'delete'
})
}
// 新增classworkeval
export function addClassworkeval(data) {
return request({
url: '/education/classworkeval',
method: 'post',
data: data
})
}
// 查询evaluationclue列表
export function listEvaluationclue(query) {

View File

@ -1,9 +1,9 @@
@font-face {
font-family: "iconfont"; /* Project id 2794390 */
src: url('iconfont.woff2?t=1727403518918') format('woff2'),
url('iconfont.woff?t=1727403518918') format('woff'),
url('iconfont.ttf?t=1727403518918') format('truetype'),
url('iconfont.svg?t=1727403518918#iconfont') format('svg');
src: url('iconfont.woff2?t=1725847033097') format('woff2'),
url('iconfont.woff?t=1725847033097') format('woff'),
url('iconfont.ttf?t=1725847033097') format('truetype'),
url('iconfont.svg?t=1725847033097#iconfont') format('svg');
}
.iconfont {
@ -14,98 +14,38 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-a-1_jiaoxuefansi:before {
content: "\e6cd";
}
.icon-iconfontzhizuobiaozhunbduan3-1:before {
content: "\100af";
}
.icon-gongzuotai_xuanzhong:before {
content: "\e605";
}
.icon-yijianfankui:before {
content: "\e8a1";
}
.icon-zuoyesheji:before {
content: "\e619";
}
.icon-jihua:before {
content: "\e601";
}
.icon-xueqingfenxi:before {
content: "\e68a";
}
.icon-zuoyebuzhi:before {
content: "\e607";
}
.icon-zuoyepigai:before {
content: "\ec35";
}
.icon-jiaocai1:before {
content: "\e781";
}
.icon-yanjiushi:before {
content: "\e70a";
}
.icon-zuzhi:before {
content: "\e63b";
}
.icon-zhiliang:before {
content: "\e642";
}
.icon-jiaoxueshijian:before {
content: "\e676";
}
.icon-kebiao:before {
content: "\e67a";
}
.icon-yanjiuyuan:before {
content: "\e6bf";
}
.icon-kaoshi:before {
content: "\eb14";
}
.icon-iconfontzhizuobiaozhunbduan36:before {
content: "\e6eb";
}
.icon-ziyuanku:before {
content: "\eb01";
}
.icon-yanjiushi-2:before {
content: "\100b0";
}
.icon-fasong:before {
content: "\e692";
}
.icon-aijiqiren:before {
content: "\e73c";
}
.icon-saoyisao:before {
content: "\e691";
}
.icon-jiaoxuezhiliangfenxi:before {
content: "\e690";
}
.icon-jiaoxuejihua:before {
content: "\e7e9";
}
.icon-tongji:before {
content: "\e68f";
}
.icon-pigai:before {
content: "\e68d";
}
.icon-jiaoxuefansi:before {
content: "\e6b2";
}
.icon-kaoshi:before {
content: "\e68a";
}
.icon-yiwen:before {
content: "\e687";
}
@ -234,6 +174,10 @@
content: "\e642";
}
.icon-organization-framework-line:before {
content: "\e9fe";
}
.icon-jiaocai:before {
content: "\e67b";
}
@ -302,6 +246,10 @@
content: "\eb13";
}
.icon-fankui:before {
content: "\e738";
}
.icon-tiku:before {
content: "\e621";
}
@ -322,6 +270,10 @@
content: "\e61c";
}
.icon-jiaoxuefenxi:before {
content: "\e605";
}
.icon-wenjianjia:before {
content: "\ec17";
}
@ -346,6 +298,14 @@
content: "\e675";
}
.icon-yanjiushi:before {
content: "\e607";
}
.icon-gongzuotai:before {
content: "\e676";
}
.icon-lunwen:before {
content: "\e60e";
}
@ -362,6 +322,10 @@
content: "\e6fe";
}
.icon-pengyouquan1:before {
content: "\e635";
}
.icon-beike1:before {
content: "\e61b";
}
@ -382,6 +346,10 @@
content: "\e612";
}
.icon-fankui1:before {
content: "\e6fa";
}
.icon-shezhi:before {
content: "\e614";
}
@ -426,6 +394,10 @@
content: "\e654";
}
.icon-kecheng:before {
content: "\e619";
}
.icon-bianji1:before {
content: "\e61d";
}
@ -454,6 +426,10 @@
content: "\e79a";
}
.icon-xueqingfenxi:before {
content: "\e67a";
}
.icon-check:before {
content: "\e622";
}
@ -570,6 +546,10 @@
content: "\e636";
}
.icon-ziyuanfenxi:before {
content: "\e637";
}
.icon-shoucang1:before {
content: "\e638";
}
@ -586,6 +566,10 @@
content: "\e772";
}
.icon-xiezuo1:before {
content: "\e63b";
}
.icon-fenxi1:before {
content: "\e63c";
}
@ -814,6 +798,10 @@
content: "\e672";
}
.icon-jiaoxueziyuan:before {
content: "\e601";
}
.icon-beike:before {
content: "\e6c2";
}

File diff suppressed because one or more lines are too long

View File

@ -5,153 +5,6 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "37027693",
"name": "教学反思",
"font_class": "a-1_jiaoxuefansi",
"unicode": "e6cd",
"unicode_decimal": 59085
},
{
"icon_id": "41983432",
"name": "朋友圈-copy",
"font_class": "iconfontzhizuobiaozhunbduan3-1",
"unicode": "100af",
"unicode_decimal": 65711
},
{
"icon_id": "9478557",
"name": "工作台_选中",
"font_class": "gongzuotai_xuanzhong",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "2076317",
"name": " 意见反馈",
"font_class": "yijianfankui",
"unicode": "e8a1",
"unicode_decimal": 59553
},
{
"icon_id": "2468169",
"name": "作业指导书",
"font_class": "zuoyesheji",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "3865266",
"name": "计划",
"font_class": "jihua",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "4308245",
"name": "学情概览",
"font_class": "xueqingfenxi",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "5113507",
"name": "教学中心_作业批改",
"font_class": "zuoyebuzhi",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "5767879",
"name": "执行反馈",
"font_class": "zuoyepigai",
"unicode": "ec35",
"unicode_decimal": 60469
},
{
"icon_id": "10992961",
"name": "课程标准",
"font_class": "jiaocai1",
"unicode": "e781",
"unicode_decimal": 59265
},
{
"icon_id": "11744086",
"name": "策略研究 选中",
"font_class": "yanjiushi",
"unicode": "e70a",
"unicode_decimal": 59146
},
{
"icon_id": "12732492",
"name": "组织",
"font_class": "zuzhi",
"unicode": "e63b",
"unicode_decimal": 58939
},
{
"icon_id": "18909227",
"name": "质量管理",
"font_class": "zhiliang",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "21156217",
"name": "培训",
"font_class": "jiaoxueshijian",
"unicode": "e676",
"unicode_decimal": 58998
},
{
"icon_id": "33378945",
"name": "课程标准",
"font_class": "kebiao",
"unicode": "e67a",
"unicode_decimal": 59002
},
{
"icon_id": "33722029",
"name": "研究院",
"font_class": "yanjiuyuan",
"unicode": "e6bf",
"unicode_decimal": 59071
},
{
"icon_id": "35203493",
"name": "考试 (3)",
"font_class": "kaoshi",
"unicode": "eb14",
"unicode_decimal": 60180
},
{
"icon_id": "1236933",
"name": "朋友圈",
"font_class": "iconfontzhizuobiaozhunbduan36",
"unicode": "e6eb",
"unicode_decimal": 59115
},
{
"icon_id": "40912837",
"name": "智慧图书馆",
"font_class": "ziyuanku",
"unicode": "eb01",
"unicode_decimal": 60161
},
{
"icon_id": "41983489",
"name": "策略研究 选中-copy",
"font_class": "yanjiushi-2",
"unicode": "100b0",
"unicode_decimal": 65712
},
{
"icon_id": "34833984",
"name": "发送",
"font_class": "fasong",
"unicode": "e692",
"unicode_decimal": 59026
},
{
"icon_id": "34666608",
"name": "ai机器人",
@ -159,6 +12,27 @@
"unicode": "e73c",
"unicode_decimal": 59196
},
{
"icon_id": "12657402",
"name": "资源库",
"font_class": "saoyisao",
"unicode": "e691",
"unicode_decimal": 59025
},
{
"icon_id": "6513175",
"name": "教学质量分析",
"font_class": "jiaoxuezhiliangfenxi",
"unicode": "e690",
"unicode_decimal": 59024
},
{
"icon_id": "38447338",
"name": "教学计划",
"font_class": "jiaoxuejihua",
"unicode": "e7e9",
"unicode_decimal": 59369
},
{
"icon_id": "8455509",
"name": "统计",
@ -166,6 +40,27 @@
"unicode": "e68f",
"unicode_decimal": 59023
},
{
"icon_id": "5969226",
"name": "批改",
"font_class": "pigai",
"unicode": "e68d",
"unicode_decimal": 59021
},
{
"icon_id": "36295514",
"name": "教学反思",
"font_class": "jiaoxuefansi",
"unicode": "e6b2",
"unicode_decimal": 59058
},
{
"icon_id": "21088705",
"name": "考试",
"font_class": "kaoshi",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "20574719",
"name": "疑问",
@ -390,6 +285,13 @@
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "6235034",
"name": "组织框架",
"font_class": "organization-framework-line",
"unicode": "e9fe",
"unicode_decimal": 59902
},
{
"icon_id": "10900222",
"name": "教材",
@ -509,6 +411,13 @@
"unicode": "eb13",
"unicode_decimal": 60179
},
{
"icon_id": "577336",
"name": "反馈",
"font_class": "fankui",
"unicode": "e738",
"unicode_decimal": 59192
},
{
"icon_id": "1447760",
"name": "题库",
@ -544,6 +453,13 @@
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "4686996",
"name": "教学分析",
"font_class": "jiaoxuefenxi",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "4893191",
"name": "文件夹",
@ -586,6 +502,20 @@
"unicode": "e675",
"unicode_decimal": 58997
},
{
"icon_id": "7327280",
"name": "研究室",
"font_class": "yanjiushi",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "7905547",
"name": "工作台",
"font_class": "gongzuotai",
"unicode": "e676",
"unicode_decimal": 58998
},
{
"icon_id": "9023128",
"name": "论文",
@ -614,6 +544,13 @@
"unicode": "e6fe",
"unicode_decimal": 59134
},
{
"icon_id": "16364339",
"name": "朋友圈",
"font_class": "pengyouquan1",
"unicode": "e635",
"unicode_decimal": 58933
},
{
"icon_id": "37075078",
"name": "备课",
@ -649,6 +586,13 @@
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "2680657",
"name": "反馈",
"font_class": "fankui1",
"unicode": "e6fa",
"unicode_decimal": 59130
},
{
"icon_id": "4520331",
"name": "设置",
@ -726,6 +670,13 @@
"unicode": "e654",
"unicode_decimal": 58964
},
{
"icon_id": "6560965",
"name": "课程",
"font_class": "kecheng",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "6682548",
"name": "编辑",
@ -775,6 +726,13 @@
"unicode": "e79a",
"unicode_decimal": 59290
},
{
"icon_id": "8225912",
"name": "学情分析",
"font_class": "xueqingfenxi",
"unicode": "e67a",
"unicode_decimal": 59002
},
{
"icon_id": "9922803",
"name": "check",
@ -978,6 +936,13 @@
"unicode": "e636",
"unicode_decimal": 58934
},
{
"icon_id": "39506557",
"name": "资源分析",
"font_class": "ziyuanfenxi",
"unicode": "e637",
"unicode_decimal": 58935
},
{
"icon_id": "3267408",
"name": "收藏",
@ -1006,6 +971,13 @@
"unicode": "e772",
"unicode_decimal": 59250
},
{
"icon_id": "6837777",
"name": "写作",
"font_class": "xiezuo1",
"unicode": "e63b",
"unicode_decimal": 58939
},
{
"icon_id": "7171145",
"name": "粮食动态决策分析系统",
@ -1405,6 +1377,13 @@
"unicode": "e672",
"unicode_decimal": 58994
},
{
"icon_id": "15841963",
"name": "教学资源",
"font_class": "jiaoxueziyuan",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "5562910",
"name": "备课",

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 354 KiB

View File

@ -21,6 +21,7 @@ const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\r
onMounted(() => {
/** 将传入的pdf地址进行编码防止中文识别错误 */
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
console.log('组件',pdfUrl.value);
})
</script>

View File

@ -181,8 +181,6 @@ onMounted( async () => {
// ""
treeData.value = useSubject.getTreeData(curBook.data.id)
sessionStore.set('subject.subjectTree',useSubject.getTreeData(curBook.data.id))
nextTick(() =>{
//
if(sessionStore.get('subject.curNode')){

View File

@ -145,6 +145,7 @@ export default {
}
},
created() {
window.test = this
this.slotKeys = Object.keys(this.$slots)
},
methods: {

View File

@ -285,7 +285,7 @@ onMounted(async () => {
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
// canvas2.canvas.isDrawingMode=false
canvas1FabricVue.value = canvas2
// window.test = { canvas1, canvas2 }
window.test = { canvas1, canvas2 }
emit('update:numPagesTotal', pdf.numPages)
if (props.pdfObj.allPageData.length) {

View File

@ -294,7 +294,7 @@ onMounted(async () => {
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
// canvas2.canvas.isDrawingMode=false
canvas1FabricVue.value = canvas2
// window.test = { canvas1, canvas2 }
window.test = { canvas1, canvas2 }
emit('update:numPagesTotal', pdf.numPages)
if (props.pdfObj.allPageData.length) {

View File

@ -9,14 +9,7 @@
<ul class="flex">
<li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
<div class="icon-box">
<svg class="icon iconfont" aria-hidden="true">
<use :xlink:href="menu.icon"></use>
</svg>
</div>
<i class="iconfont" :class="menu.icon"></i>
<span class="text">{{ menu.name }}</span>
</li>
</ul>
@ -96,25 +89,25 @@ const headerMenus = [
{
name: '工作台',
id: 1,
icon: '#icon-gongzuotai_xuanzhong',
icon: 'icon-gongzuotai',
path: '/home'
},
{
name: '研究室',
id: 2,
icon: '#icon-yanjiushi-2',
icon: 'icon-yanjiushi',
disabled: true
},
{
name: '资源库',
id: 3,
icon: '#icon-ziyuanku',
icon: 'icon-saoyisao',
path: '/resource'
},
{
name: '朋友圈',
id: 4,
icon: '#icon-iconfontzhizuobiaozhunbduan3-1',
icon: 'icon-pengyouquan1',
disabled: true
}
]
@ -252,19 +245,10 @@ onMounted(() => {
li {
cursor: pointer;
flex-direction: column;
border-radius: 5px;
padding: 5px 8px;
height: 60px;
align-items: center;
.icon-box{
width: 100%;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
}
border-radius: 8px;
margin: 0 10px;
.text {
margin-top: 3px;
font-size: 13px;
font-weight: bold;
}
@ -273,9 +257,24 @@ onMounted(() => {
font-size: 26px;
}
.icon-resource {
color: #f99b53;
}
.icon-homepage {
color: #0a84ff;
}
.icon-prepare {
color: #b088e8;
}
.icon-teach {
color: #367dea;
}
&:hover {
color: #409eff;
background-color: #fff
}
}
@ -285,13 +284,11 @@ onMounted(() => {
&:hover {
color: #bfbfbf;
background: none;
}
}
.active-li {
color: #409eff;
background-color: #fff
}
}
}

View File

@ -50,10 +50,7 @@ const goBack = () =>{
<style lang="scss" scoped>
.el-container {
height: 100%;
// background: url(@/assets/images/login/login-bg.png) no-repeat center;
// background: #EAEFF8;
background: linear-gradient(to bottom right, #cce6ff 0%, #79d0fc 100%);
// background: linear-gradient(to top, #a6e3e9, #e3fdfd);
background: url(@/assets/images/login/login-bg.png) no-repeat center;
background-size: cover;
}

View File

@ -15,11 +15,6 @@ export const constantRoutes = [
// component: ()=> import('../login/index.vue'),
hidden: true
},
{
path: '/teachClassTask',
component: () => import('@/views/classTask/teachClassTask.vue'),
hidden: true
},
{
path: '/',
component: Layout,

View File

@ -6,9 +6,6 @@ import { sessionStore } from '@/utils/store'
// 默认数据
const defData = sessionStore.store || {}
const exArrs = ['subject']
exArrs.forEach(k => Object.keys(defData).includes(k) && (delete defData[k]))
// 延时
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
@ -18,8 +15,8 @@ export const useToolState = defineStore('tool', {
showBoardAll: false, // 全屏画板-是否显示
isPdfWin: false, // pdf窗口是否打开
isToolWin: false, // 工具窗口是否打开
isTaskWin: false, // 批改窗口是否打开
curSubjectNode: {
data: {}, // 当前教材节点 (包含当前教材 单元)
querySearch: {} // 查询资源所需参数
},
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)

View File

@ -112,7 +112,6 @@ export function ipcHandle(fn,key, cb) {
*/
let wins_tool = null
let winPdf=null
let winChild=null
export const createWindow = async (type, data) => {
switch(type) {
case 'tool-sphere': { // 创建-悬浮球
@ -170,36 +169,6 @@ export const createWindow = async (type, data) => {
winPdf=win
break
}
case 'open-taskwin': { //作业批改-web
if(winChild){ //判断是否已经打开
winChild.focus();
return
}
const option = data.option||{}
const defOption = {
// width: 1280,// 1920,
// height: 720,// 1080,
width: 1450,
minWidth: 1200,
height: 800,
minHeight: 700,
frame: true, // 要创建无边框窗口
// resizable: true, // 禁止窗口大小缩放
alwaysOnTop: false, // 窗口是否总是显示在其他窗口之前
title:'子窗口',
show: false, //创建时窗口不可见
maximizable: true,
autoHideMenuBar: true,// 自动隐藏菜单栏
}
data.isConsole = true // 是否开启控制台
data.option = {...defOption, ...option}
winChild = await toolWindow(data)
winChild.type = type // 唯一标识
winChild.show()
winChild.setFullScreen(false) // 设置窗口为全屏
eventHandles(type, winChild) // 事件监听处理
return winChild
}
default:
break
}
@ -277,7 +246,6 @@ const eventHandles = (type, win) => {
if(onClosed) onClosed() // 自定义关闭事件
win = null
wins_tool = null
winChild=null
})
// 新窗口-创建事件(如:主进程加载远程服务)
@ -336,27 +304,6 @@ const eventHandles = (type, win) => {
}
publicMethods(on) // 加载公共方法
break}
case 'open-taskwin': { // -子窗口
// 监听窗口的激活事件
win.on('focus', async () => {
toolState.isTaskWin=true
win&&win.reload(); //刷新该窗口
});
// 监听窗口关闭事件
win.on('closed', function () {
console.log('关闭窗口')
// 设置状态(再次设置-防止未设置到)
if(toolState.isTaskWin) toolState.isTaskWin = false
winChild=null
win&&win.destroy()
});
const on = {
onClosed: () => {
}
}
publicMethods(on) // 加载公共方法
break;
}
default:
break
}

View File

@ -57,28 +57,24 @@
></el-empty>
</div>
</div>
<!-- <item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog> -->
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
</el-container>
</template>
<script setup>
import { ref, onMounted, onUnmounted, computed, watch } from 'vue'
import { listByDeadDate, listClassworkdata } from '@/api/classTask'
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
import TaskItem from '@/views/classTask/container/task-item.vue'
// import ItemDialog from '@/views/classTask/container/item-dialog.vue'
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
import { useToolState } from '@/store/modules/tool'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import useUserStore from '@/store/modules/user'
import useClassTaskStore from "@/store/modules/classTask";
import {sessionStore, createWindow} from '@/utils/tool'
const toolState = useToolState();
const classTaskStore = useClassTaskStore()
const userStore = useUserStore().user
// const itemDialogRef = ref(null)
const itemDialogRef = ref(null)
const tabOptions = ref(['进行中', '已结束'])
const tabActive = ref('进行中')
const dataList = ref([])
@ -89,8 +85,6 @@ const classWorkList = ref([])
const total = ref(0)
const loading = ref(false)
const activeDataList = computed(() => {
return classWorkList.value
})
@ -215,9 +209,7 @@ const getClassWorkList = async () => {
/**
* 3获取多个班级学生作业数据
*/
const getStudentClassWorkData = async() => {
// const { chapterId } = await useGetHomework(props.bookobj.node)
// this.entpcourseid = chapterId
const getStudentClassWorkData = () => {
if(classTaskStore.classListIds.length>0){
// listClassworkdataByDeadDate({
// edituserid: userStore.userId, // id
@ -331,6 +323,9 @@ const getStudentClassWorkData = async() => {
}
const toolStore = useToolState()
//
const escapeHtmlQuotes = (str) => {
// replace,
@ -344,7 +339,7 @@ const pollingST = ref(null) //轮询定时器标识
onMounted(() => {
getData() //
//
closeDialog();
getStudentClassWorkDataPolling()
})
//
@ -358,25 +353,13 @@ const getStudentClassWorkDataPolling = () => {
}
const closeDialog = () => {
clearInterval(pollingST.value) //
console.log('关闭弹窗,开启作业进度轮询')
getStudentClassWorkDataPolling()
}
/**
* 开启新批改弹窗
* @param item 作业对象
*/
const onClickItem = (item) => {
console.log('开启弹窗,关闭作业进度轮询')
clearInterval(pollingST.value)
// itemDialogRef.value.openDialog(item)
//
// 1item2 3item
// localStorage.setItem('teachClassWorkItem', JSON.stringify(item))
sessionStore.set('teachClassWorkItem', item)
toolState.isTaskWin=true //
createWindow('open-taskwin',{url:'/teachClassTask'})
itemDialogRef.value.openDialog(item)
}
@ -430,11 +413,6 @@ const getStudentVisible = async () => {
//
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
} else {
//
if(curWork && curWork.workdataresultcount == 0){
//
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
}
classWorkList.value[t].finishpercent = 0
}
}
@ -445,13 +423,9 @@ const getStudentVisible = async () => {
watch(
() => [dataList, toolState.isTaskWin],
() => [dataList, toolStore.isToolWin],
() => {
console.log('=监听到批改窗口打开了===', toolState.isTaskWin)
if(!toolState.isTaskWin){
closeDialog();//
}
console.log('====', toolStore)
}
)
watch(tabActive, (newVal,oldVal)=>{

View File

@ -16,9 +16,9 @@
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
<el-col :span="12" style="padding-left: 20px; text-align: left;">
<div class="unit-top-left" @click="isCollapse = !isCollapse">
<i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i>
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
<span>课程目录</span>
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
</div>
</el-col>
<el-col :span="12">
@ -132,8 +132,8 @@
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
<div style="display: flex">
<!-- <el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button> -->
<el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button>
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
@click="submitStudy('submit')"> </el-button>
</div>
@ -155,7 +155,7 @@
<script setup>
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import ChooseTextbook from '@/components/choose-textbook/index.vue'
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
@ -168,7 +168,6 @@ import { getCurrentTime } from '@/utils/date'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const { proxy } = getCurrentInstance()
const router = useRouter()
const props = defineProps({
initDataProps: {
@ -268,7 +267,7 @@ const getTaskList = async () => {
const { chapterId } = await useGetHomework(courseObj.node)
// this.entpcourseid = chapterId
//
homeworklist({entpcourseid: chapterId, orderby: "deaddate DESC" , edituserid: userStore.userId, pageSize: 500}).then(res => {
homeworklist({entpcourseid: chapterId, orderby: "concat(deaddate,uniquekey) DESC" , edituserid: userStore.userId, pageSize: 100}).then(res => {
let model = [];
let mission = [];
@ -354,6 +353,7 @@ const getTaskList = async () => {
}
list.push(item);
}
console.log(list,'========================')
taskList.value = list;
loading.value = false;
})
@ -369,21 +369,20 @@ const handleWorkTitleEdit = (row, index) => {
};
// -
//
const handleWorkEdit = (row, index) =>{
console.log(row, index)
workEdit.value = true
currentWorkEdit.currentTask = row;
// currentWorkEdit.currentIndex = index;
// this.currentTask = row;
// this.currentIndex = index;
currentTag.value = row.worktype;
// this.attainmentList = row.workcodesList?.attlist;
// this.courseQualityList = row.workcodesList?.qualist;
this.attainmentList = row.workcodesList?.attlist;
this.courseQualityList = row.workcodesList?.qualist;
if (row.worktype == '框架梳理') {
this.$nextTick(()=>{
this.getFlowData()
})
}
// if (row.worktype == '') {
// if (currentTag.value.worktype == '') {
// // TODO
// rootid:entpcourseworkid rootid: row.entpcourseworklistarray[0].id,
// listEvaluationclue({ cluegroup: 'graph', edusubject: this.courseObj.edusubject, pageSize: 1000 }).then((res) => {
@ -399,8 +398,7 @@ const handleWorkEdit = (row, index) =>{
// }
// //
if (row.worktype == '习题训练') {
console.log('习题训练')
if (currentTag.value.worktype == '习题训练') {
var idlist = JSON.parse('['+row.entpcourseworklist+']');
var ids = [];
for (var i=0; i<idlist.length; i++) {
@ -428,14 +426,14 @@ const handleWorkEdit = (row, index) =>{
}
});
});
console.log(workConfObj.quizlist,'workConfObj.quizlist');
//
processList(workConfObj.quizlist);
})
}
//
if(row.worktype == '常规作业' || row.worktype == '课堂展示'){
if(currentTag.value.worktype == '常规作业' || row.worktype == '课堂展示'){
console.log(row,'常规作业-课堂展示');
// workcodes
if(row.workcodes != ''){
@ -451,138 +449,44 @@ const handleWorkEdit = (row, index) =>{
}
}
};
// --
let classtaskObj = reactive({
id: '', //
uniquekey: '', //
title: '', //
worktype: '', //
quizlist: [], //
})
// -
const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
// this.newWorkSpace = true;
// this.newWorkSpaceEdit = true;
// this.currentTask = row;
// this.currentIndex = index;
// this.currentTag = row.worktype;
// this.attainmentList = row.workcodesList?.attlist;
// this.courseQualityList = row.workcodesList?.qualist;
//
// this.classWorkForm.uniquekey = this.currentTask.uniquekey;
// this.classWorkForm.title = this.currentTask.title;
//
// this.classWorkForm.worktype = this.currentTask.worktype;
//[]
var listCourseWork = [];
for (var i=0; i < row.entpcourseworklistarray.length; i++) {
listCourseWork.push(row.entpcourseworklistarray[i]);
}
if (listCourseWork.length > 0) {
classtaskObj.id= row.id; //
classtaskObj.uniquekey= row.uniquekey; //
classtaskObj.title= row.title; //
classtaskObj.worktype= row.worktype; //
classtaskObj.quizlist= []; //
if (row.worktype == '框架梳理') {
//
// let queryParams = {}
// queryParams.id = listCourseWork[0].id;
// queryParams.ppttype = '';
// queryParams.title = '';
// queryParams.filetype = 'draw';
// const res = await getEvaluationclue(listCourseWork[0].id);
// if ( res.data==null || res.data==undefined ) {
// return;
// }
// this.chooseWorkLists = [];
// res.data.worktype = '';
// res.data.score = listCourseWork[0].score;
// this.chooseWorkLists.push(res.data);
}
else if (row.worktype == '习题训练') {
const ids = listCourseWork.map(item => item.id).join(",");
listEntpcoursework({ids: ids, pageSize: 50}).then(idres => {
// for (var i=0; i<idres.rows.length; i++) {
// idres.rows[i].titletext = idres.rows[i].title.replace(/<[^>]+>/g, '');
// }
//
if(idres.rows&&idres.rows.length > 0){
processList(idres.rows);
//task
row.entpcourseworklistarray.forEach(item => {
const quizItem = idres.rows.find(quiz => quiz.id === item.id);
if (quizItem) {
quizItem.score = item.score;
quizItem.scoreOrigin = item.score;
}
});
classtaskObj.quizlist = idres.rows;
//
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
// -
const submitWorkTitle = () => {
console.log(taskList.value)
console.log(currentWorkEdit)
// ? taskList currentIndex
// if (taskList.value[currentWorkEdit.currentIndex].title == currentWorkEdit.currentTitle) {
// currentWorkEdit.workTitleEdit = false;
// return;
// }
taskList.value&&taskList.value.forEach((item)=>{
if(item.children.length>0){
item.children.map(_item=>{
if(_item.title == currentWorkEdit.currentTitle){
currentWorkEdit.workTitleEdit = false;
return;
}
})
}
else if (this.classWorkForm.worktype == '课堂展示') {
// const workcodes = JSON.parse(this.currentTask.workcodes);
// const jsonString = JSON.stringify(workcodes.json);
// await this.$nextTick();
// this.isShowBoard = true
// this.whiteboardObj = jsonString;
}else{
if(item.title == currentWorkEdit.currentTitle){
currentWorkEdit.workTitleEdit = false;
return;
}
}
else if (this.classWorkForm.worktype == '常规作业') {
// this.fileHomeworkList = [];
// if(isJson(this.currentTask.workcodes)){
// this.fileHomeworkList = JSON.parse(this.currentTask.workcodes);
// }
}
}
};
// -
const submitWorkTitle = () => {
if(currentWorkEdit.currentTask.title == currentWorkEdit.currentTitle){
currentWorkEdit.workTitleEdit = false;
return;
}
})
console.log('有更改!')
//
updateClasswork({id: currentWorkEdit.currentTask.id, title: currentWorkEdit.currentTitle}).then(response => {
proxy.$modal.msgSuccess("修改成功");
taskList.value[currentWorkEdit.currentIndex].title = currentWorkEdit.currentTitle;
updateClasswork({id: taskList.value[currentWorkEdit.currentIndex].id, title: currentWorkEdit.currentTitle}).then(response => {
ElMessage("修改成功");
currentWorkEdit.workTitleEdit = false;
//
getTaskList();
//this.getClassWorkAllList();
});
};
//
const checkTaskAssigned = (row) => {
console.log(row,'checkTaskAssigned')
// taskconfigid0
let bAssigned = false;
for (let i=0; i<row.taskconfig.length; i++) {

View File

@ -1,8 +1,8 @@
<template>
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore" style="height: 100%">
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore">
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
<div class="teacher_content" :style="{ height: '100%' }">
<div style="font-size: 18px; width: 100%; padding: 5px 10px; flex: 0 0 auto;">
<div class="teacher_content" :style="{ height: '72vh' }">
<div style="font-size: 18px; width: 100%; padding: 5px 10px" class="sticky">
{{ classWorkFormScore.name }} 答题详情
</div>
<div class="teacher_content_con">
@ -24,7 +24,7 @@
<!-- 习题训练 -->
<div v-if="dialogProps.studentObj.worktype == '习题训练'">
<el-row>
<el-col :span="24" style="padding: 10px;text-align: left;">
<el-col :span="24" style="padding: 10px">
<!-- 题源题目标题题目选项 -->
<span>{{ quItem.worktag }}</span>
<span style="margin-left: 4px" v-html="quItem.titleFormat"></span>
@ -924,7 +924,6 @@ defineExpose({
<style scoped>
.teacher_content {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
@ -936,16 +935,11 @@ defineExpose({
width: 100%;
height: 100%;
overflow-y: auto;
}
.tacher_conten_foot {
width: 100%;
}
.card-header{
text-align: left;
}
.image_list {
display: flex;
flex-wrap: nowrap;
@ -991,8 +985,4 @@ defineExpose({
background-color: red;
color: white;
}
.card-header{
align-items: left;
}
</style>

View File

@ -234,7 +234,7 @@ const openDialog = (data) => {
classWorkAnalysis.activeQuizAnalysisData = []
classWorkAnalysis.row = data
// window.test = this
window.test = this
// zdg:
const studentArr = data.classworkdatastudentids
? JSON.parse(`[${data.classworkdatastudentids}]`)

View File

@ -250,7 +250,7 @@ import { ElMessage } from 'element-plus'
import { useToolState } from '@/store/modules/tool'
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
import { addClassworkReturnId } from '@/api/teaching/classwork'
import { updateClasswork, listEvaluationclue,readFile, listClassworkeval,delClassworkeval,addClassworkeval } from '@/api/classTask'
import { updateClasswork, listEvaluationclue,readFile } from '@/api/classTask'
import { listEvaluation } from '@/api/subject'
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
@ -273,9 +273,9 @@ const props = defineProps({
type: Object,
default: () => ({})
},
propsformobj: {
type: Object,
default: () =>({})
uniquekey: {
type: String,
default: ''
}
})
@ -356,11 +356,10 @@ const workResource = reactive({
entpCourseWorkTotal: 0, //
}); //
let classWorkForm = reactive({
id: props.propsformobj.id,
uniquekey: props.propsformobj.uniquekey, //
worktype: props.propsformobj.worktype?props.propsformobj.worktype: '习题训练', //
title: props.propsformobj.title?props.propsformobj.title:'',//
quizlist: props.propsformobj.quizlist?props.propsformobj.quizlist:[] //
uniquekey: props.uniquekey, //
worktype: '习题训练', //
title: '',//
quizlist: [], //
}); //
const chooseWorkLists = ref([]); //
const whiteboardObj = ref(''); // -
@ -386,8 +385,7 @@ const changeFormType = (val) => {
classWorkForm.worktype = val;
}
console.log(props.propsformobj)
console.log(classWorkForm,'==============zizujian===================')
/**
* @desc: 根据查询参数查询试题
* @return: {*}
@ -664,338 +662,322 @@ const handleClassWorkSave = async () => {
await nextTick(); // DOM
proxy.$refs["classWorkFormRef"].validate(async valid => {
if (valid) {
//
const { chapterId } = await useGetHomework(props.bookobj.node)
// this.entpcourseid = chapterId
if (classWorkForm.id != null) {
// []
updateClasswork(classWorkForm).then(response => {
ElMessage("修改成功");
// this.workConfDialogOpen = false;
//
// this.getClassWorkAllList(); //
});
} else {
// [] newWorkSpaceEdit true
if(newWorkSpaceEdit.value ) {
const cform = {
id: 0,
workdate: classWorkForm.workdate, // //web
deaddate: '', //
entpid: userStore.deptId, //
level: 1,
parentid: 0,
worktype: classWorkForm.worktype, //
workkey: '',
worktag: '',
uniquekey: classWorkForm.uniquekey,//
classid: 0,
classcourseid: 0,
entpcourseid: chapterId, //
slideid: 0,
title: classWorkForm.title, //
workcodes: JSON.stringify(classWorkForm.workcodes), //
edusubject: userStore.edusubject, //
evalid: props.bookobj.levelSecondId, //userStore.evalid, // // ID
edustage: userStore.edustage, // ,,
status: '10', //2024-09-11
edituserid: userStore.userId, // id
entpcourseworklist: '', // list
};
// [] newWorkSpaceEdit true
if(classWorkForm.id != '' ) {// id
editWork(cform); //
return;
}
if (classWorkForm.worktype === "课堂展示") {
boardLoading.value = true
let canvasJson = proxy.$refs.boardref.getCanvasJson()
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
//
// cform.worktag = question.value;
cform.title = question.value;
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
try {
addClassworkReturnId(cform).then(() => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "课堂展示";
classWorkForm.uniquekey = props.propsformobj.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
boardLoading.value = false
})
} finally {
boardLoading.value = false
}
}
else if(classWorkForm.worktype === "常规作业"){
fileLoading.value = true
cform.workcodes = JSON.stringify(fileHomeworkList.value);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
try {
addClassworkReturnId(cform).then(() => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "常规作业";
classWorkForm.uniquekey = props.propsformobj.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
fileHomeworkList.value = []; // list
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
fileLoading.value = false
})
} finally {
fileLoading.value = false
}
}
else {
//
var ll = [];
if (classWorkForm.worktype === "习题训练") {
for (var i=0; i< classWorkForm.quizlist.length; i++) {
//
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
}
}else if( classWorkForm.worktype === "框架梳理") {
chooseWorkLists.value.filter((item) => {
if (item.worktype === classWorkForm.worktype) {
ll.push({'id':item.id, 'score': item.score});
// 0.
if (this.currentTag == '习题训练') {
if (this.classWorkForm.quizlist.length == 0) {
ElMessage.error('请先添加作业资源!');
return;
}
})
}
// list
if (ll.length > 0) {
cform.entpcourseworklist = JSON.stringify(ll);
} else {
cform.entpcourseworklist = '';
}
console.log(cform,'提交的数据');
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
addClassworkReturnId(cform).then(workres => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = props.propsformobj.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
}
else if (this.currentTag == '课堂展示' || this.currentTag == '常规作业') {
//
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
}
else {
if (this.chooseWorkLists.length == 0) {
ElMessage.error('请先添加作业资源!');
return;
}
}
//
let classWorkParams = {
id: this.currentTask.id,
uniquekey: this.classWorkForm.uniquekey, // []
//title: classWorkForm.title, // []
}
//
if (this.currentTag=='习题训练'){
// console.log(this.workConfObj.quizlist);
// console.log(this.currentTask);
// console.log(this.classWorkList);
// 1.
let needUplEval = false;
if (this.classWorkForm.quizlist.length !== this.currentTask.entpcourseworklistarray.length) {
needUplEval = true;
}
else {
//
// for (let cur of this.classWorkForm.quizlist){
// let isSame = false;
// for (let last of this.currentTask.entpcourseworklistarray) {
// if (last.id === cur.id && last.score === cur.score){
// isSame = true;
// break;
// }
// }
// if (!isSame) {
// needUplEval = true;
// break;
// }
// }
needUplEval = this.classWorkForm.quizlist.some(cur =>
!this.currentTask.entpcourseworklistarray.some(last =>
last.id === cur.id && last.score === cur.score
)
);
}
// 2.eval
if (needUplEval) {
// : , ,
// 2.1.workidid
let arrEvalids = [];
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
wevalres.rows.forEach(element => {
arrEvalids.push(element.id);
});
const ids = arrEvalids.join(',');
// 2.2.
const delRes = await delClassworkeval(ids);
// 2.3.
for(let i=0; i<this.classWorkForm.quizlist.length; i++){
const addRes = await addClassworkeval({
'workid': this.currentTask.id,
'entpcourseworkid': this.classWorkForm.quizlist[i].id,
'workdataid': 0,
'score': this.classWorkForm.quizlist[i].score}
);
}
}
// 3.
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
// const formObj = {
// id: this.currentTask.id,
// uniquekey: this.classWorkForm.uniquekey, // []
// // warn:
// //evalid = evalid, // []
// }
// let res = await updateClasswork(formObj);
}
else if (this.currentTag=='框架梳理') {
// 1.workidid
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
if (wevalres.rows.length == 0) {
ElMessage.error('未找到原框架梳理任务,请或退出重试');
return;
}
// 2.
let needUplEval = false;
if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
needUplEval = true;
}
else {
//
needUplEval = this.chooseWorkLists.some(cur =>
!this.currentTask.entpcourseworklistarray.some(last =>
last.id === cur.id && last.score === cur.score
)
);
}
if (needUplEval) {
const uplParams = {
id: wevalres.rows[0].id,
entpcourseworkid: this.chooseWorkLists[0].id,
score: this.chooseWorkLists[0].score,
}
let res = await updateClassworkeval(uplParams);
}
}
else if (this.currentTag=='课堂展示') {
}
else if (this.currentTag=='常规作业') {
// 1. (, )
classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
}
// 3.
let res = await updateClasswork(classWorkParams);
this.fileHomeworkList = [];
this.chooseWorkLists = [];
// 4.
//
// this.getClassWorkAllList();
// TODO
this.classWorkForm.worktype = "习题训练";
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
return;
}
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
})
//
const { chapterId } = await useGetHomework(props.bookobj.node)
// this.entpcourseid = chapterId
const cform = {
id: 0,
workdate: classWorkForm.workdate, // //web
deaddate: '', //
entpid: userStore.deptId, //
level: 1,
parentid: 0,
worktype: classWorkForm.worktype, //
workkey: '',
worktag: '',
uniquekey: classWorkForm.uniquekey,//
classid: 0,
classcourseid: 0,
entpcourseid: chapterId, //
slideid: 0,
title: classWorkForm.title, //
workcodes: JSON.stringify(classWorkForm.workcodes), //
edusubject: userStore.edusubject, //
evalid: props.bookobj.levelSecondId, //userStore.evalid, // // ID
edustage: userStore.edustage, // ,,
status: '10', //2024-09-11
edituserid: userStore.userId, // id
entpcourseworklist: '', // list
};
if (classWorkForm.worktype === "课堂展示") {
boardLoading.value = true
let canvasJson = proxy.$refs.boardref.getCanvasJson()
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
//
// cform.worktag = question.value;
cform.title = question.value;
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
try {
addClassworkReturnId(cform).then(() => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "课堂展示";
classWorkForm.uniquekey = props.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
boardLoading.value = false
})
} finally {
boardLoading.value = false
}
}
else if(classWorkForm.worktype === "常规作业"){
fileLoading.value = true
cform.workcodes = JSON.stringify(fileHomeworkList.value);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
try {
addClassworkReturnId(cform).then(() => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "常规作业";
classWorkForm.uniquekey = props.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
fileHomeworkList.value = []; // list
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
fileLoading.value = false
})
} finally {
fileLoading.value = false
}
}
else {
//
var ll = [];
if (classWorkForm.worktype === "习题训练") {
for (var i=0; i< classWorkForm.quizlist.length; i++) {
//
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
}
}else if( classWorkForm.worktype === "框架梳理") {
chooseWorkLists.value.filter((item) => {
if (item.worktype === classWorkForm.worktype) {
ll.push({'id':item.id, 'score': item.score});
}
})
}
// list
if (ll.length > 0) {
cform.entpcourseworklist = JSON.stringify(ll);
} else {
cform.entpcourseworklist = '';
}
console.log(cform,'提交的数据');
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
addClassworkReturnId(cform).then(workres => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = props.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
})
}
}
}
});
};
const editWork = async (cform) =>{
//
cform.id= classWorkForm.id;
// 0.
if (classWorkForm.worktype == '习题训练') {
if (classWorkForm.quizlist.length == 0) {
ElMessage.error('请先添加作业资源!');
return;
}
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
//
}else {
if (chooseWorkLists.value.length == 0) {
//
ElMessage.error('请先添加作业资源!');
return;
}
}
//
if (classWorkForm.worktype=='习题训练'){
// 1.
let needUplEval = false;
if (classWorkForm.quizlist.length !== props.propsformobj.quizlist.length) {
needUplEval = true;
}else {
//
needUplEval = classWorkForm.quizlist.some(cur =>
!props.propsformobj.quizlist.some(last =>
last.id === cur.id && last.score === cur.score
)
);
}
//
if(needUplEval){
//
var ll = [];
for (var i=0; i< classWorkForm.quizlist.length; i++) {
//
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
}
// list
if (ll.length > 0) {
cform.entpcourseworklist = JSON.stringify(ll);
} else {
cform.entpcourseworklist = '';
}
console.log(cform,'提交的数据');
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
addClassworkReturnId(cform).then(workres => {
ElMessage({ type: 'success', message: '修改设计成功!'});
//
classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = props.propsformobj.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
})
}
// 2.eval
// if (needUplEval) {
// : , ,
// 2.1.workidid
// let arrEvalids = [];
// const wevalres = await listClassworkeval({'workid': classWorkForm.id});
// wevalres.rows.forEach(element => {
// arrEvalids.push(element.id);
// });
// const ids = arrEvalids.join(',');
// // 2.2.
// const delRes = await delClassworkeval(ids);
// // 2.3.
// for(let i=0; i< classWorkForm.quizlist.length; i++){
// const addRes = await addClassworkeval({
// 'workid': classWorkForm.id,
// 'entpcourseworkid': classWorkForm.quizlist[i].id,
// 'workdataid': 0,
// 'score': classWorkForm.quizlist[i].score}
// );
// }
// }
// 3.
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
// const formObj = {
// id: this.currentTask.id,
// uniquekey: this.classWorkForm.uniquekey, // []
// // warn:
// //evalid = evalid, // []
// }
// let res = await updateClasswork(cform);
}
// else if (classWorkForm.worktype=='') {
// // 1.workidid
// const wevalres = await listClassworkeval({'workid': this.currentTask.id});
// if (wevalres.rows.length == 0) {
// ElMessage.error('退');
// return;
// }
// // 2.
// let needUplEval = false;
// if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
// needUplEval = true;
// }else {
// //
// needUplEval = this.chooseWorkLists.some(cur =>
// !this.currentTask.entpcourseworklistarray.some(last =>
// last.id === cur.id && last.score === cur.score
// )
// );
// }
// if (needUplEval) {
// const uplParams = {
// id: wevalres.rows[0].id,
// entpcourseworkid: this.chooseWorkLists[0].id,
// score: this.chooseWorkLists[0].score,
// }
// let res = await updateClassworkeval(uplParams);
// }
// }else if (classWorkForm.worktype=='') {
// }else if (classWorkForm.worktype=='') {
// // 1. (, )
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
// }
// // 3.
// let res = await updateClasswork(cform);
// this.fileHomeworkList = [];
// this.chooseWorkLists = [];
// // 4.
// //
// // this.getClassWorkAllList();
// this.classWorkForm.worktype = "";
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
}
onMounted(() => {
})

View File

@ -1,6 +1,6 @@
<template>
<el-row class="c-warp" :gutter="10">
<el-col class="left" :span="12">
<el-col class="left" :span="16">
<el-collapse class="c-item" v-model="activeTopic" accordion>
<template v-for="(item, index) in dataList">
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
@ -54,7 +54,7 @@
</template>
</el-collapse>
</el-col>
<el-col class="right" :span="12">
<el-col class="right" :span="8">
<div class="c-item">
<div class="title">答题情况</div>
<div class="respond">

View File

@ -14,6 +14,7 @@
&nbsp;|&nbsp; 截止时间{{ item.deaddate }} &nbsp;|&nbsp;{{ tabactive }}
</div>
</div>
<!-- <el-switch v-model="value1" active-text="云同步"> </el-switch> -->
<div class="class-reserv-item-tool">
<span>
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</span>
@ -67,8 +68,60 @@ const props = defineProps({
default: () => ''
}
})
import { ref, reactive } from 'vue'
const value1 = ref(true);
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
const toolStore = useToolState() // -tool
const openEdit = () => {
emit('openEdit', props.item)
}
const deleteReserv = () => {
deleteSmartReserv([props.item.id]).then((res) => {
if (res.data === true) {
ElMessage({
message: '删除成功',
type: 'success'
})
emit('deleteReserv', props.item)
}
})
}
const startClassR = (item) => {
// startClass(item.id).then((res) => {
// if (res.data === true) {
// item.status = ''
// openLesson()
// }
// })
item.status = '上课中'
openLesson()
}
// const toolStore = useToolState()
let wins = null;
// -
const openLesson = () => {
// startClass(props.item.id)
listEntpcourse({
evalid: props.item.ex2,
edituserid: useUserStore().user.userId,
pageSize: 500
}).then(async res=>{
if (res.rows[0].id) {
wins = await createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id })
}
})
}
const endClassR = (item) => {
endClass(item.id).then((res) => {
if (res.data === true) {
ElMessage({
message: '下课成功',
type: 'success'
})
item.status = '已结束'
}
})
}
</script>
<style scoped lang="scss">
.class-reserv-item {

View File

@ -16,9 +16,9 @@
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
<el-col :span="12" style="padding-left: 20px; text-align: left;">
<div class="unit-top-left" @click="isCollapse = !isCollapse">
<i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i>
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
<span>课程目录</span>
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
</div>
</el-col>
<el-col :span="12">
@ -30,34 +30,28 @@
</el-col>
</el-row>
<!-- 作业类型:内容 -->
<task-type-view :bookobj="courseObj" :propsformobj="classWorkForm" style="flex: 1; overflow: hidden;"/>
<task-type-view :bookobj="courseObj" :uniquekey="classWorkForm.uniquekey" style="flex: 1; overflow: hidden;"/>
</div>
</div>
</template>
<script setup>
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import ChooseTextbook from '@/components/choose-textbook/index.vue'
import TaskTypeView from '@/views/classTask/container/newTask/taskTypeView.vue'
import { getCurrentTime } from '@/utils/date'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const route = useRoute();
const classtaskObj = route.query.classtaskObj;//
// ---------------------------------------------------
const classWorkForm = reactive({
id: classtaskObj? JSON.parse(classtaskObj).id : '', // id
uniquekey: classtaskObj? JSON.parse(classtaskObj).uniquekey : userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1), //
title: classtaskObj? JSON.parse(classtaskObj).title : '', //
worktype: classtaskObj? JSON.parse(classtaskObj).worktype : '', //
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], //
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1),
})
const isCollapse = ref(false)
const courseObj = reactive({
// : id,id,id,
textbookId: '',
@ -95,15 +89,18 @@ const getData = (data) => {
}
onMounted(() => {
// init()
init()
// sourceStore.getCreate()
})
// const init = () => {
// classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
const init = () => {
classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
// }
}
// watch(() => sourceStore.query.fileSource,() => {
// sourceStore.query.fileSource === ''?isThird.value = true:isThird.value = false
// })
</script>
<style lang="scss" scoped>

View File

@ -1,785 +0,0 @@
<template>
<div class="teachClassTask">
<div class="teachClassTask_header">
<div style="font-size: 18px; display: flex; flex-wrap: nowrap">
<div style="flex: 1">
{{ classWorkAnalysis.title }}答题情况
<el-tag :type="classWorkAnalysis.workclass" size="large" style="height: 25px">{{
classWorkAnalysis.worktype
}}</el-tag>
</div>
<!-- classWorkAnalysis.entpcourseworklistarray 当前学习任务所包含的试题ID -->
<div
v-if="classWorkAnalysis.entpcourseworklistarray.length > 0"
style="margin: 0 auto; flex: 1"
>
<el-button-group style="margin-bottom: 10px">
<el-button
:type="classWorkAnalysis.view == 'studentview' ? 'success' : ''"
@click="classWorkAnalysis.view = 'studentview'"
>作业批阅</el-button
>
<el-button
v-if="classWorkAnalysis.row.worktype == '习题训练'"
:type="classWorkAnalysis.view == 'quizStats' ? 'success' : ''"
@click="workHandle('quizStats')"
>作业概况</el-button
>
<el-button
v-if="classWorkAnalysis.row.worktype == '习题训练'"
:type="classWorkAnalysis.view == 'report' ? 'success' : ''"
@click="handleClassOverviewOpen('report')"
>作业报告</el-button
>
</el-button-group>
</div>
<div style="flex: 1">
<!-- <div
style="float: right; padding: 0 10px; cursor: pointer"
icon="el-icon-close"
@click="closeDialog"
>
x
</div> -->
</div>
</div>
</div>
<div class="teachClassTask_content">
<!-- 如果当前学习没有试题 :height="mainHeight" height:73vh;-->
<div
v-if="classWorkAnalysis.view == 'studentview'"
style="width: 100%; "
class="clwk_dialog_view"
>
<div class="view_table">
<el-radio-group
v-model="tableRadio.value"
style="margin-bottom: 1px"
@change="tableRadioChange"
>
<el-radio-button :value="1" :label="'已交' + '' + tableRadio.num1 + ''" />
<el-radio-button :value="0" :label="'未交' + '' + tableRadio.num0 + ''" />
</el-radio-group>
<!-- 学生列表classWorkAnalysis.classworkdata; 已交未交tableRadio.list -->
<el-table
v-loading="loading_dt_table"
:data="tableRadio.list"
row-key="id"
style="height: 69vh;"
highlight-current-row
@row-click="getStudentClassWorkDataDetail"
>
<el-table-column type="index" label="序号" width="52" reserve-selection align="center" />
<el-table-column label="姓名" prop="studentname" width="100" align="center" />
<el-table-column label="提交时间" prop="updatedate" width="170" align="center" />
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable>
<template #default="scope">
<template v-if="scope.row.teacherRating == 0"
><span style="color: #2196f3">待批阅</span></template
>
<!-- 1- 2-优减 3- 4-良减 5- -->
<template v-if="scope.row.teacherRating == 1"
><el-tag type="danger"></el-tag></template
>
<template v-if="scope.row.teacherRating == 2"
><el-tag type="danger">-</el-tag></template
>
<template v-if="scope.row.teacherRating == 3"
><el-tag type="warning"></el-tag></template
>
<template v-if="scope.row.teacherRating == 4"
><el-tag type="info">-</el-tag></template
>
<template v-if="scope.row.teacherRating == 5"
><el-tag type="info"></el-tag></template
>
</template>
</el-table-column>
</el-table>
</div>
<div class="view_teachrting">
<div class="classwork-score">
<div v-if="classWorkAnalysis.activeStudentQuizlist.length == 0">
<el-empty
description="点击左侧表格学生信息可查看批阅详情"
style="width: 100%; height: 500px"
></el-empty>
</div>
<div v-else style="height: 100%;">
<div v-if="isopen_dtwk_table" style="height: 100%;">
<div v-show="classWorkAnalysis.activeStudentQuizlist.length > 0" style="height: 100%;">
<item-dialog-score
ref="classWorkAnalysisScoreDialogRef"
@class_work_score_submit="onClassWorkScoreSubmit"
/>
</div>
</div>
<div v-else>
<el-empty
description="点击左侧表格学生信息可查看批阅详情"
style="width: 100%; height: 500px"
></el-empty>
</div>
</div>
</div>
</div>
</div>
<!-- 作业概况 -->
<div v-else-if="classWorkAnalysis.view == 'quizStats'" style="width: 100%;">
<quiz-stats :active-data="classWorkActiveData" style="width: 100%;height: 100%;"/>
</div>
<!-- 作业报告-->
<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" style="width: 100%;"></ClassOverview>
</div>
</div>
</div>
</template>
<script setup name="itemDialogRef">
import { ref, defineExpose, onMounted, reactive, computed, watch, onUnmounted, nextTick, getCurrentInstance } from 'vue'
import { listClassworkdata, listEntpcoursework, listClassworkeval } from '@/api/classTask'
import useUserStore from '@/store/modules/user'
import { ElMessage } from 'element-plus'
import { getCurrentTime, getAfterMinutes } from '@/utils/date'
import { processList } from '@/hooks/useProcessList'
import ItemDialogScore from '@/views/classTask/container/item-dialog-score.vue'
// zdg:
import quizStats from '@/views/classTask/container/quizStats.vue'
import ClassOverview from '@/views/classTask/container/classOverview.vue'
import {sessionStore} from '@/utils/tool'
const { proxy } = getCurrentInstance()
const emit = defineEmits(['cle-click'])
const props = defineProps({
bookId: {
type: Number,
default: 0
},
})
const mainHeight = ref(document.documentElement.clientHeight - 110)
const classWorkAnalysis = reactive({
open: false,
entpcourseworklistarray: [], // ID
})
const tableRadio = reactive({
value: '1', //
list: [], // list
num1: 0, //
num0: 0 //
}) //
const loading_dt_table = ref(false)
const isopen_dtwk_table = ref(false)
// zdg:
const classWorkActiveData = reactive({
quizlist: [], //
studentList: [], // -
workFeedList: [], // -
timerId: 0 // id
})
//-
const classWorkAnalysisScore = reactive({
studentObj: {}, //
studentQuizAllList: [], // list
quizlist: [] // list
})
//
const overviewData = ref([])
// watch(
// // () => props.currentNode,
// (newValue, oldValue) => {
// form.name = newValue.label
// }
// )
const openDialog = (data) => {
console.log(data, '点击的item答题情况')
classWorkAnalysis.title = data.uniquekey ? data.uniquekey + '--' : ''
classWorkAnalysis.worktype = data.worktype
classWorkAnalysis.workclass = data.workclass
//
tableRadio.list = []
tableRadio.value = '1'
tableRadio.num0 = 0
tableRadio.num1 = 0
classWorkAnalysis.open = true
//
classWorkAnalysis.view = 'studentview'
// ID
classWorkAnalysis.entpcourseworklistarray = data.entpcourseworklistarray
//
classWorkAnalysis.activeStudentQuizlist = []
//
classWorkAnalysis.activeQuizAnalysisData = []
classWorkAnalysis.row = data
window.test = this
// zdg:
const studentArr = data.classworkdatastudentids
? JSON.parse(`[${data.classworkdatastudentids}]`)
: []
classWorkActiveData.studentList = studentArr
/** 学生完成情况分析--获取作业学生list数据 */
getClassWorkStudentList(data.id)
// idlist
var ids = []
for (var i = 0; i < data.entpcourseworklistarray.length; i++) {
ids.push(data.entpcourseworklistarray[i].id)
}
//
listEntpcoursework({ ids: ids.join(','), pageSize: 500 }).then((idres) => {
for (var i = 0; i < idres.rows.length; i++) {
// // + .replace(/!@#\$%/g,'')
idres.rows[i].titletext = idres.rows[i].title.replace(/!@#\$%/g, '')
}
classWorkAnalysis.quizlist = idres.rows
classWorkActiveData.quizlist = idres.rows // zdg: 使
//
// + , pageSize: 100
listClassworkeval({ workid: data.id, pageSize: 1000 }).then((wevalres) => {
for (var i = 0; i < classWorkAnalysis.quizlist.length; i++) {
//
var scoingCount = 0
var feedcount = 0
//
var evalCount = 0
for (var w = 0; w < wevalres.rows.length; w++) {
if (wevalres.rows[w].entpcourseworkid == classWorkAnalysis.quizlist[i].id) {
evalCount++
//
if (wevalres.rows[w].feedcontent != '') {
//
feedcount++
//
if (wevalres.rows[w].feedcontent == wevalres.rows[w].rightanswer) {
wevalres.rows[w].scoingStatus = true
scoingCount++
// =
wevalres.rows[w].teacherRating = wevalres.rows[w].score
} else {
wevalres.rows[w].scoingStatus = false
}
}
}
}
classWorkAnalysis.quizlist[i].evalCount = evalCount
//
classWorkAnalysis.quizlist[i].feedcount = feedcount
// NaN% scoingRate
if (scoingCount == 0 && feedcount == 0) {
classWorkAnalysis.quizlist[i].scoingRate = '0%'
} else {
classWorkAnalysis.quizlist[i].scoingRate =
((scoingCount / feedcount) * 100).toFixed(0) + '%'
}
}
// zdg:
const getStudentid = (workdataid) => {
// id
const classworkdata = (classWorkAnalysis.classworkdata || []).find(
(o) => o.id === workdataid
)
return classworkdata ? classworkdata.studentid : ''
}
wevalres.rows.forEach((o) => {
o.studentid = getStudentid(o.workdataid)
})
classWorkActiveData.workFeedList = wevalres.rows
})
})
console.log(classWorkAnalysis, '点击进度后获得的数据')
}
//#region
/** 1、获取作业学生列表 */
const getClassWorkStudentList = (rowId) => {
// rowid使
localStorage.setItem('activeClassWorkRowId', rowId)
//
classWorkAnalysis.classworkdata = []
// _
loading_dt_table.value = true
// classworkdata
listClassworkdata({ classworkid: rowId, pageSize: 100 })
.then((response) => {
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].entpcourseworklist != '') {
response.rows[i].entpcourseworkarray = JSON.parse(
'[' + response.rows[i].entpcourseworklist + ']'
)
} else {
response.rows[i].entpcourseworkarray = []
}
// 0
response.rows[i].teacherRating = 0
//
if (
response.rows[i].classworkevallist != '' &&
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>\"}"
// .replace(/"(\[.*\])"/g, '$1'); eg: "feedcontent\":\"[{\"name\":\"Bliss.jpg\",\"url\":\"https://wzyzoss.3b8daa474.jpg\"}]\",
// json .replace(/""/g, '"') eg: """"
response.rows[i].classworkevallist = escapeHtmlQuotes(response.rows[i].classworkevallist)
console.log('学生完成情况分析classworkevallist', response.rows[i].classworkevallist)
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
var scoingCount = 0
var feedcount = 0
for (var e = 0; e < evalarray.length; e++) {
if (evalarray[e].feedcontent != '') {
feedcount++
//
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
scoingCount++
}
}
}
console.log(evalarray, 'evalarray------------------------------------')
if (feedcount > 0) {
// : /*100
response.rows[i].scoingRate = ((scoingCount / feedcount) * 100).toFixed(0) + '%'
} else {
response.rows[i].scoingRate = '0%'
}
// :
if (evalarray[0].rating != '') {
response.rows[i].teacherRating = evalarray[0].rating
}
} else {
response.rows[i].scoingRate = '0%'
}
}
classWorkAnalysis.classworkdata = response.rows
loading_dt_table.value = false
//
tableRadio.list =
classWorkAnalysis.classworkdata &&
classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0')
tableRadio.value = '1'
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length
tableRadio.num1 = tableRadio.list.length
})
.catch(() => {
loading_dt_table.value = false
})
}
/** 2、查看某一个学生的学习任务完成详情*/
const getStudentClassWorkDataDetail = (row) => {
//
// this.classWorkAnalysis.quizlist
console.log(row, '点击了左侧学生')
//
classWorkAnalysisScore.studentObj = row
listClassworkeval({ workdataid: row.id, pageSize: 100 })
.then((wevalres) => {
for (var i = 0; i < classWorkAnalysis.quizlist.length; i++) {
//
for (var w = 0; w < wevalres.rows.length; w++) {
if (wevalres.rows[w].entpcourseworkid == classWorkAnalysis.quizlist[i].id) {
wevalres.rows[w].quiztitle = classWorkAnalysis.quizlist[i].title
wevalres.rows[w].quiztitletext = classWorkAnalysis.quizlist[i].title.replace(
/<[^>]*>/g,
''
)
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html
wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer
// html
wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)
}
if (wevalres.rows[w].feedcontent != '') {
if (wevalres.rows[w].feedcontent == wevalres.rows[w].rightanswer) {
wevalres.rows[w].scoingStatus = true
// =
wevalres.rows[w].teacherRating = wevalres.rows[w].score
} else {
wevalres.rows[w].scoingStatus = false
}
} else {
wevalres.rows[w].scoingStatus = ''
}
//
}
// "" prop="feedcontent" width="200" align="center"></el-table-column>
// <el-table-column label="" prop="rightanswer"
// +
wevalres.rows[w].worktitle = wevalres.rows[w].worktitle.replace(/!@#\$%/g, '')
// feedcontent\r<br />
wevalres.rows[w].feedcontent = wevalres.rows[w].feedcontent.replace(/(?<!\\)\n/g, '<br />'); //\n\\n \\n
}
}
classWorkAnalysis.activeStudentQuizlist = wevalres.rows
//
isopen_dtwk_table.value = true
//
if (wevalres.rows.length > 0) {
handleClassWorkAnalysissScoreOpen(row)
} else {
ElMessage({
type: 'warning',
message: '未获取到答题信息,请稍后再看,或者联系管理员查看情况!'
})
}
})
.catch(() => {
console.log('获取答题情况失败')
ElMessage({
type: 'warning',
message: '未获取到答题信息!'
})
})
}
/** 3、教师批改后返回的方法*/
const onClassWorkScoreSubmit = () => {
console.log('批改后返回的方法')
loading_dt_table.value = true
isopen_dtwk_table.value = false
// 1table- classWorkAnalysis.classworkdata- classWorkAnalysis.activeStudentQuizlist
// -
classWorkAnalysis.classworkdata = []
classWorkAnalysis.activeStudentQuizlist = []
// 2
const rowid = localStorage.getItem('activeClassWorkRowId')
getClassWorkStudentList(rowid)
}
// ()
const handleClassWorkAnalysissScoreOpen = (row) => {
console.log(row, '所选点击的信息')
// list
classWorkAnalysisScore.studentQuizAllList = classWorkAnalysis.activeStudentQuizlist
// list
classWorkAnalysisScore.quizlist = classWorkAnalysis.quizlist
//
processList(classWorkAnalysisScore.quizlist)
//
classWorkAnalysisScore.maxheight = mainHeight.value - 100
//
nextTick(() => {
proxy.$refs.classWorkAnalysisScoreDialogRef.acceptParams(classWorkAnalysisScore)
})
}
//#endregion
/** 批阅:已交未交事件 */
const tableRadioChange = (e) => {
// ui
isopen_dtwk_table.value = false;
console.log(e,'??????')
console.log("学生列表:", classWorkAnalysis.classworkdata)
if(e=='1'){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0')
tableRadio.value = '1';
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
tableRadio.num1 = tableRadio.list.length;
}else if(e=='0'){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0')
tableRadio.value = '0';
tableRadio.num0 = tableRadio.list.length;
tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
}
}
//
const escapeHtmlQuotes = (str) => {
// replace,
const regex1 = /\\+/g; //
let result = str.replace(regex1, '\\');
result = str.replace(/(?<!\\)\n/g, '<br />'); //\n\\n \\n
return result;
}
//#region
// -
const workHandle = (type) => {
// ui
isopen_dtwk_table.value = false;
classWorkAnalysis.view = type
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
if (isClose) clearInterval(classWorkActiveData.timerId) //
if (isOpen) {
//
classWorkActiveData.timerId = setInterval(() => {
console.log('zdg: 定时执行')
getWorkFeedList()
}, 20 * 1000);
}
}
// -
const getWorkFeedList = async() =>{
const workid = classWorkAnalysis.row.id
const res = await listClassworkeval({workid, isFinish: 1, pageSize: 1000})
const getStudentid = (workdataid) => { // id
const classworkdata = (classWorkAnalysis.classworkdata||[]).find(o => o.id === workdataid)
return classworkdata ? classworkdata.studentid : ''
}
res.rows.forEach(o => { o.studentid = getStudentid(o.workdataid) })
classWorkActiveData.workFeedList = res.rows
}
//#endregion
//#regin
/*
author: yangws
time: 2024-8-06 16:35:33
function:作业报告的处理
*/
const handleClassOverviewOpen = (type) =>{
// ui
isopen_dtwk_table.value = false;
classWorkAnalysis.view = type
const data = classWorkAnalysis.row
//
listClassworkdata({classworkid: data.id, pageSize: 100}).then((response) => {
if(response.code === 200){
response.rows.forEach(item => {
let rightAnswer = 0
let answers = 0
if(!item.classworkevallist) return
// 使
let replacedString = item.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(item.classworkevallist);
let allTopic
try{
allTopic = JSON.parse(`[${item.classworkevallist}]`)
}catch{
allTopic = JSON.parse(`[${replacedString}]`)
}
if(item.classworkevallist != ''){
allTopic.forEach(itemTopic => {
if(itemTopic.feedcontent != ''){
answers ++
//
if(itemTopic.feedcontent === itemTopic.rightanswer){
rightAnswer ++
}
}
})
rightAnswer > 0?item.scoingRate = (rightAnswer/answers * 100).toFixed(0):item.scoingRate = ''
}else{
item.scoingRate = ''
}
//
const point = allTopic.reduce((acc, cur) => {
if(cur.rating !== 0){
return acc + cur.teacherRating;
}
},0)
// item.chapter = this.courseObj.evalid
item.point = point || 0
item.rating = allTopic[0].rating
})
overviewData.value = [...response.rows]
}
})
}
//#endregion
const onBeforeClose = () =>{
console.log('非正常关闭dialog?esc、dialog外部区域')
closeDialog()
}
const closeDialog = () => {
classWorkAnalysis.open = false
emit('cle-click')
}
onMounted(() => {
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
const data = sessionStore.get('teachClassWorkItem');
// console.log(data,'????????????????????' )
if(data){
openDialog(data)
}
})
watch(classWorkAnalysis, (newVal, oldVal) => {
if(newVal.view != 'quizStats'){
console.log('关闭zdg: 定时执行')
clearInterval(classWorkActiveData.timerId) //
}
})
onUnmounted(() => {
clearInterval(classWorkActiveData.timerId) //
})
// defineExpose({
// })
</script>
<style src="@/assets/styles/JYStyle.css"></style>
<style scoped lang="scss">
.teachClassTask{
height: 100%;
display: flex;
flex-direction: column;
.teachClassTask_header{
flex: 0 0 auto;
}
.teachClassTask_content{
flex: 1;
height: 100%;
overflow: hidden;
display: flex;
justify-content: center;
overflow: hidden;
.clwk_dialog_view {
display: flex;
flex-direction: row;
justify-content: flex-start;
overflow: hidden;
}
.view_table {
flex: 0 0 auto;
height: 100%;
overflow: hidden;
}
.view_teachrting {
flex: 1;
height: 100%;
/*overflow-y: auto; */
overflow: hidden;
.classwork-score{
// overflow-y: auto;
height: 100%;
}
}
}
}
// .clwk_dialog {
// }
// .clwk_dialog {
// display: flex;
// justify-content: center;
// overflow: hidden;
// }
// .clwk_dialog .el-dialog {
// margin: 0 auto !important;
// height: 85%!important;
// overflow: hidden;
// }
// .clwk_dialog .el-dialog__header {
// /* position: absolute;
// top: 0;
// left: 0; */
// width: 100%!important;
// }
// .clwk_dialog .el-dialog__body {
// position: absolute;
// left: 0;
// top: 15px;
// bottom: 1px;
// right:0;
// padding:5px;
// z-index:1;
// display: flex;
// flex-direction: column;
// overflow: hidden;
// /* overflow:hidden;
// overflow-y: auto; */
// }
// .clwk_dialog .el-dialog__footer{
// position: absolute;
// bottom: 10px;
// right: 10px;
// }
// .clwk_dialog .classwork-score{
// overflow-y: auto;
// }
</style>
<style scoped>
/* .clwk_dialog {
display: flex;
justify-content: center;
overflow: hidden;
}
.clwk_dialog .el-dialog {
margin: 0 auto !important;
height: 85%!important;
overflow: hidden;
}
.clwk_dialog .el-dialog__header {
/* position: absolute;
top: 0;
left: 0;
width: 100%!important;
}
.clwk_dialog .el-dialog__body {
position: absolute;
left: 0;
top: 15px;
bottom: 1px;
right:0;
padding:5px;
z-index:1;
display: flex;
flex-direction: column;
overflow: hidden;
/* overflow:hidden;
overflow-y: auto;
}
.clwk_dialog .el-dialog__footer{
position: absolute;
bottom: 10px;
right: 10px;
}
.clwk_dialog .classwork-score{
overflow-y: auto;
} */
</style>

View File

@ -28,20 +28,20 @@
</ul>
</el-scrollbar>
</div>
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
</div>
</template>
<script setup>
import { ref, onMounted, watch } from 'vue'
import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { homeworklist } from '@/api/teaching/classwork'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import {sessionStore, createWindow} from '@/utils/tool'
import { useToolState } from '@/store/modules/tool'
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
const user = useUserStore().user
const toolState = useToolState();
const loading = ref(false)
const homeworkList = ref([])
const itemDialogRef = ref(null)
//
const getHomework = async () => {
@ -70,11 +70,12 @@ const getHomework = async () => {
//
const onClickItem = (item) => {
console.log('开启弹窗')
// itemDialogRef.value.openDialog(item)
//
sessionStore.set('teachClassWorkItem', item)
toolState.isTaskWin=true //
createWindow('open-taskwin',{url:'/teachClassTask'})
itemDialogRef.value.openDialog(item)
}
//
const closeDialog = () => {
console.log('关闭弹窗,查询一下作业数据,更新界面')
getHomework()
}
const tagType = (time) => {
@ -85,16 +86,6 @@ const tagType = (time) => {
onMounted(() => {
getHomework()
})
watch(
() => [toolState.isTaskWin],
() => {
console.log('=监听到批改窗口是否关闭了===', toolState.isTaskWin)
if(!toolState.isTaskWin){
getHomework()//
}
}
)
</script>
<style lang="scss" scoped>

View File

@ -9,16 +9,7 @@
<div class="item-content">
<ul class="flex con-ul">
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<div class="icon-box">
<template v-if="menu.disabled">
<i class="iconfont" :class="menu.icon"></i>
</template>
<template v-else>
<svg class="icon iconfont icon-svg" aria-hidden="true">
<use :xlink:href="menu.icon"></use>
</svg>
</template>
</div>
<i class="iconfont" :class="menu.icon"></i>
<span>{{ menu.name }}</span>
</li>
</ul>
@ -69,19 +60,19 @@ const menuList = [{
list: [
{
name: '课标分析',
icon: '#icon-kebiao',
icon: 'icon-kecheng',
path: '/standardanalysis?',
id: '1-1'
},
{
name: '教材分析',
icon: '#icon-jiaocaixuanze',
icon: 'icon-jiaocaixuanze',
path: '/textbookAnalysis',
id: '1-2'
},
{
name: '考试分析',
icon: '#icon-kaoshi',
icon: 'icon-kaoshi',
path: '/examReport',
id: '1-3'
},
@ -93,13 +84,13 @@ const menuList = [{
},
{
name: '教学实践',
icon: '#icon-jiaoxueshijian',
icon: 'icon-jiaoxuefenxi',
path: '/prepare',
id: '1-5'
},
{
name: '教学反思',
icon: 'icon-a-1_jiaoxuefansi',
icon: 'icon-jiaoxuefansi',
disabled: true,
id: '1-6'
},
@ -112,7 +103,7 @@ const menuList = [{
list: [
{
name: '作业设计',
icon: '#icon-zuoyesheji',
icon: 'icon-jiaoxuefansi',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
// path: '/newClassTask',
@ -120,7 +111,7 @@ const menuList = [{
},
{
name: '作业布置',
icon: '#icon-zuoyebuzhi',
icon: 'icon-xiezuo1',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置',
// path: '/classTaskAssign',
@ -128,7 +119,7 @@ const menuList = [{
},
{
name: '作业批改',
icon: '#icon-zuoyepigai',
icon: 'icon-pigai',
path: '/classTask',
id: '2-3'
},
@ -147,25 +138,25 @@ const menuList = [{
list: [
{
name: '教学计划',
icon: 'icon-jihua',
icon: 'icon-jiaoxuejihua',
disabled: true,
id: '3-1'
},
{
name: '教学组织',
icon: 'icon-zuzhi',
icon: 'icon-organization-framework-line',
disabled: true,
id: '3-2'
},
{
name: '教学质量',
icon: 'icon-zhiliang',
icon: 'icon-jiaoxuezhiliangfenxi',
disabled: true,
id: '3-3'
},
{
name: '教学反馈',
icon: 'icon-yijianfankui',
icon: 'icon-fankui',
disabled: true,
id: '3-4'
},
@ -285,37 +276,20 @@ onMounted(async ()=>{
padding: 10px 0;
.con-ul{
justify-content: space-around;
.item-menu{
cursor: pointer;
flex-direction: column;
font-size: 14px;
align-items: center;
.icon-box{
width: 100%;
height: 45px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.iconfont{
font-size: 28px;
color: #707070;
// font-weight: bold;
}
.icon-svg{
height: 42px;
font-weight: bold;
}
&:hover{
// color: #409EFF;
color: #409EFF;
.iconfont{
color: #409EFF;
}
.icon-box{
background-color: #F2F2F2;
}
}
}
.menu-disabled{
@ -329,9 +303,6 @@ onMounted(async ()=>{
.iconfont{
color: #bfbfbf;
}
.icon-box{
background-color: #fff;
}
}
}
}
@ -353,9 +324,7 @@ onMounted(async ()=>{
align-items: center;
}
.item-content{
border-radius: 5px;
background: #fff;
box-sizing: border-box;
flex: 1;
.chart-box{
height: 100%;

View File

@ -44,6 +44,7 @@
v-model="ruleForm.address"
:options="regionData"
@change="handleChange"
:props="{checkStrictly: true}"
/>
</el-form-item>
<el-form-item label="学校" prop="school" v-if="activeIndex==2">
@ -232,24 +233,23 @@ const OpenModel = v =>{
//
const handleClose = () => {
var restValue={
name: '',
idNumber:'',
phoneNumber: '',
Code:'',
password:'',
confirmPassword:'',
class:[],
discipline:[],
school:[100,255,279],
address:["50","5001","500101"]
}
name: '',
idNumber:'',
phoneNumber: '',
Code:'',
password:'',
confirmPassword:'',
class:[],
discipline:[],
school:[],
}
Object.assign(ruleForm, restValue);
schoolSubject.value=[]
gradeTree.value=[]
if (ruleFormRef.value) ruleFormRef.value.resetFields()
removeToken();
activeIndex.value=1
dialogVisible.value=false
activeIndex.value=1
}
const nextStep = (formEl) => {
@ -346,14 +346,13 @@ const submitForm = async (formEl) => {
confirmPassword:'',
class:[],
discipline:[],
school:[100,255,279],
address:["50","5001","500101"]
school:[],
}
schoolSubject.value=[]
gradeTree.value=[]
Object.assign(ruleForm, restValue);
dialogVisible.value=false
activeIndex.value=1
dialogVisible.value=false
}else{
ElMessage.error(res.msg)
}
@ -496,7 +495,7 @@ const gradeName = (key) =>{
}
onMounted(()=>{
//
ruleForm.address = ["50","5001","500101"]
ruleForm.address = ['50']
//
ruleForm.school = [100,255,279]
})

View File

@ -583,7 +583,11 @@ export default {
this.uploadData.levelSecondId = cata[1]
this.uploadData.levelThirdId = cata[2]
this.uploadData.textbookId = data.textBook.curBookId
toolStore.curSubjectNode.querySearch = this.uploadData
toolStore.curSubjectNode.data = data
//
this.$nextTick(() => {
toolStore.curSubjectNode.querySearch = this.uploadData
})
this.initHomeWork()
await this.asyncAllFile()
},

View File

@ -7,7 +7,7 @@
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
</div>
<div class="stand-head-right">
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName : ''}}</div>
<div class="stand-head-right-tit">{{booktitle}}</div>
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
<div class="stand-head-right-row">
<div class="stand-head-right-row-time">更新2024.9.10</div>
@ -68,11 +68,11 @@
</div>
</div>
</div>
<el-dialog v-model="dialogVisible" title="切换课标" append-to-body width="550">
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
<div class="booklist">
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
<el-image class="bookimg" :src="item.avartar" />
<div class="bookname">{{item.bookName}}</div>
<div class="bookname">{{item.fileurl.replace('.txt', '')}}</div>
</div>
</div>
</el-dialog>
@ -105,6 +105,7 @@ const headref = ref(null);
const searchref = ref(null);
const listHeight = ref(0);
const dialogVisible = ref(false);
const booktitle = ref('');
const bookInfo = ref(null);
const booksel = ref(0);
const bookList = ref([])
@ -245,24 +246,23 @@ const getAllSubject = async () => {
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
const { edustage, edusubject } = userStore.user;
rows && rows.map(item => {
if(edustage === item.edustage && item.edusubject === edusubject){
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}
if(item.edustage === edustage && item.edusubject === edusubject){
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
}
if(item.fileurl !== ''){
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)})
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
}
})
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
booksel.value = textselidx
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
await loadPdfAnimation(filePath)
}
const bookNameFormat = (edustage,edusubject) => {
return `${edustage}-${edusubject}`
}
const bookChange = async (item, idx) => {
booksel.value = idx
bookInfo.value = {...item}
booktitle.value = item.fileurl.replace('.txt','')
pdfUrl.value = '';
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
await loadPdfAnimation(filepath)
@ -539,9 +539,9 @@ onMounted(async () => {
width: 130px;
height: 180px;
}
.bookname{
.name{
font-size: 14px;
text-align: center;
color: #3b3b3b;
}
}
.item:hover{

View File

@ -244,17 +244,19 @@ const getData = (data) => {
//
const getAllSubject = async () => {
const { edustage, edusubject } = userStore.user;
const { rows } = await listEvaluation({ itemkey: "version", edustage, edusubject, orderby: 'orderidx asc', pageSize: 500 })
const dataList = [];
rows && rows.map((item,idx) => {
const { rows } = await listEvaluation({ itemkey: "version", edustage, edusubject, pageSize: 500 })
rows && rows.map(item => {
if(item.edustage === edustage && item.edusubject === edusubject){
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
}
if(item.fileurl !== ''){
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
}
})
bookList.value = dataList
bookInfo.value = {...dataList[0],avartar: dataList[0].avartar}
booktitle.value = dataList[0].fileurl.replace('.txt','')
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + dataList[0].fileurl.replace('.txt','.pdf')
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
booksel.value = textselidx
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
await loadPdfAnimation(filePath)
}
const bookChange = async (item, idx) => {

View File

@ -62,7 +62,7 @@
<span class="unit-top-center">选择目录</span>
</div>
<div class="unit-content">
<Lesson @changeChapter="changeChapter" :curNode="curNode.data" />
<Lesson @changeChapter="changeChapter" />
</div>
</div>
</transition>
@ -70,20 +70,19 @@
</template>
<script setup>
import { ref, onMounted, toRaw, nextTick, reactive } from 'vue';
import { ref, onMounted, toRaw } from 'vue';
import { useRoute } from 'vue-router';
import useUserStore from '@/store/modules/user'
import { getSmarttalkPage } from '@/api/file'
import SetHomework from '@/components/set-homework/index.vue'
import FileImage from '@/components/file-image/index.vue'
import { useGetHomework } from '@/hooks/useGetHomework'
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool'
import { useToolState } from '@/store/modules/tool'
import Lesson from './lesson.vue';
import { parseCataByNode } from '@/utils/talkFile'
import MsgEnum from '@/plugins/imChat/msgEnum' //
import { createHomework } from '../createHomework'
import { sessionStore } from '@/utils/store'
const route = useRoute();
const usertore = useUserStore().user
@ -100,10 +99,6 @@ const resourceList = ref([])
//
const curRow = ref('')
const curNode = reactive({
data: {}
})
const sendHomework = (row) => {
curRow.value = row
setTimeout(() => {
@ -123,7 +118,6 @@ const successHomework = (data)=>{
}
// change
const changeChapter = async (data)=>{
curNode.data = data
const { res } = await useGetHomework(data)
dataList.value = res
let cata = parseCataByNode(data)
@ -183,10 +177,10 @@ const getResource = () => {
//
const getHomework = async () => {
const data = toRaw(toolStore.curSubjectNode).data.node
loading.value = true
try {
const { res } = await useGetHomework(curNode.data)
const { res } = await useGetHomework(data)
dataList.value = res
} finally {
loading.value = false
@ -209,16 +203,13 @@ function leave(el, done) {
done();
}
onMounted(async () => {
await nextTick()
onMounted(() => {
entpcourseid.value = route.query.entpcourseid
lesson.value = route.query.label
// mounted
curNode.data = sessionStore.get('subject.curNode')
getHomework()
getResource()
setTimeout(()=>{
getHomework()
getResource()
},200)
})
</script>

View File

@ -2,7 +2,7 @@
<el-scrollbar>
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode.data.id" highlight-current
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
@node-click="handleNodeClick">
<template #default="{ node }">
<span :title="node.label" class="tree-label">{{ node.label }}</span>
@ -13,60 +13,133 @@
</template>
<script setup>
import { ref, reactive, onMounted, toRaw, watch } from 'vue'
import { ref, onMounted, nextTick, toRaw } from 'vue'
import { useToolState } from '@/store/modules/tool'
import { sessionStore } from '@/utils/store'
import { cloneDeep } from 'lodash'
const emit = defineEmits(['changeChapter'])
const props = defineProps(['curNode'])
const toolStore = useToolState()
const treeData = ref([])
const defaultProps = {
children: 'children',
label: 'itemtitle',
label: 'label',
class: 'textbook-tree'
}
const currentNode = reactive({
data: {}
})
watch(() => props.curNode , (newVal) =>{
currentNode.data = newVal
console.log(currentNode.data)
},
{deep: true, immediate: true})
// ID
const currentNodeId = ref(0)
//
const currentNodeName = ref('')
//
const defaultExpandedKeys = ref([])
// tree
const refTree = ref(null)
// ID
const curBookId = ref('')
//
const evaluationList = ref([])
const handleNodeClick = (data) => {
/**
* data : 当前节点数据
const getTreeData = () => {
evaluationList.value = JSON.parse(localStorage.getItem('unitList'))
//
/**
* 不区分上下册
* 2024/08/20调整
*/
currentNode.data = data
let nodeData = cloneDeep(toRaw(data));
//label label
nodeData.label = nodeData.itemtitle
// null
let parent = {
id: nodeData.parentid,
label: nodeData.parenttitle,
itemtitle: nodeData.parenttitle
}
const parentNode = nodeData.parentid ? parent : null
nodeData.parentNode = parentNode
let volumeOne = evaluationList.value.filter(item => item.level == 1)
//
let upData = transData(volumeOne)
if(upData.length){
treeData.value = [...upData]
}
else{
treeData.value = []
return
}
nextTick(() => {
let defaultKey
if(toolStore.curSubjectNode.querySearch.levelSecondId){
defaultKey = toolStore.curSubjectNode.querySearch.levelSecondId
}
else{
defaultKey = toolStore.curSubjectNode.querySearch.levelFirstId
}
currentNodeId.value = defaultKey
})
emit('changeChapter', nodeData)
}
const handleNodeClick = (data, node) => {
/**
* data : 当前节点数据
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
*/
const nodeData = data;
const parentNode = node.parent.data;
if (Array.isArray(parentNode)) {
nodeData.parentNode = null
}
else {
nodeData.parentNode = parentNode
}
emit('changeChapter', toRaw(nodeData))
}
// ID ID
const getChapterId = () => {
return listEntpcourse({
evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId,
pageSize: 500
})
}
const transData = (data) => {
let ary = []
data.forEach(item => {
let obj = {}
if (item.rootid == curBookId.value) {
obj.label = item.itemtitle
obj.id = item.id
obj.itemtitle = item.itemtitle
obj.edudegree = item.edudegree
obj.edustage = item.edustage
obj.edusubject = item.edusubject
let ary2 = []
evaluationList.value.forEach(el => {
let obj2 = {}
if (item.id == el.parentid) {
obj2 = {
label: el.itemtitle,
id: el.id,
itemtitle : el.itemtitle,
edudegree : el.edudegree,
edustage : el.edustage,
edusubject : el.edusubject,
}
ary2.push(obj2)
}
obj.children = ary2
})
ary.push(obj)
}
})
return ary
}
onMounted(()=>{
treeData.value = sessionStore.get('subject.subjectTree')
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
setTimeout(()=>{
let data = toRaw(toolStore.curSubjectNode)
curBookId.value = data.data.textBook.curBookId
getTreeData()
},500)
})
</script>

View File

@ -84,8 +84,8 @@ const btnList = [ // 工具栏按钮列表
// === ===
onMounted(async() => {
if (!electron) return //
// window.test = sessionStore
// window.test1 = toolStore
window.test = sessionStore
window.test1 = toolStore
getClassInfo() // ex3
resetStatus() // -
})