Compare commits
No commits in common. "bd826051096e1ee2af8c3f6fa4daeb6560a0986f" and "918504570f57674fcb1cb7aff37b623365bdc665" have entirely different histories.
bd82605109
...
918504570f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win",
|
||||||
"version": "2.1.3",
|
"version": "2.1.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "example.com",
|
"author": "example.com",
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
"build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
|
"build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
|
||||||
"build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
|
"build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
|
||||||
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
|
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
|
||||||
"build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml",
|
"build:mac": "npm run build && electron-builder --mac",
|
||||||
"build:linux": "npm run build && electron-builder --linux"
|
"build:linux": "npm run build && electron-builder --linux"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -88,10 +88,9 @@ function createLoginWindow() {
|
||||||
//主窗口
|
//主窗口
|
||||||
function createMainWindow() {
|
function createMainWindow() {
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1350,
|
width: 1200,
|
||||||
minWidth: 1200,
|
minWidth: 1350,
|
||||||
height: 700,
|
height: 700,
|
||||||
minHeight: 700,
|
|
||||||
show: false,
|
show: false,
|
||||||
frame: false, // 无边框
|
frame: false, // 无边框
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
|
@ -119,11 +118,6 @@ function createMainWindow() {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
// app.quit() // 主窗口关闭-结束所有进程
|
// app.quit() // 主窗口关闭-结束所有进程
|
||||||
})
|
})
|
||||||
mainWindow.on('resize', () => {
|
|
||||||
const { width, height } = mainWindow.getBounds();
|
|
||||||
mainWindow.webContents.send('minWinResize', { width, height });
|
|
||||||
});
|
|
||||||
|
|
||||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||||
shell.openExternal(details.url)
|
shell.openExternal(details.url)
|
||||||
return { action: 'deny' }
|
return { action: 'deny' }
|
||||||
|
@ -135,7 +129,6 @@ function createMainWindow() {
|
||||||
} else {
|
} else {
|
||||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
|
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
|
||||||
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
|
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
|
||||||
// 第三步: 开启remote服务
|
// 第三步: 开启remote服务
|
||||||
|
@ -280,10 +273,14 @@ function handleAll() {
|
||||||
})
|
})
|
||||||
// 用于监听-状态管理变化-同步所有窗口
|
// 用于监听-状态管理变化-同步所有窗口
|
||||||
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
|
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
|
||||||
|
console.log('pinia-state-change-1', storeName, jsonStr)
|
||||||
|
|
||||||
for(const curWin of BrowserWindow.getAllWindows()){
|
for(const curWin of BrowserWindow.getAllWindows()){
|
||||||
const id = curWin.webContents.id
|
const id = curWin.webContents.id
|
||||||
const bool = id !== e.sender.id && !curWin.isDestroyed()
|
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) { // 除了消息发送窗口和销毁的窗口 其他都发送
|
if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送
|
||||||
curWin.webContents.send('pinia-state-set', storeName, jsonStr)
|
curWin.webContents.send('pinia-state-set', storeName, jsonStr)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,8 @@ const defaultData = {
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
|
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
|
||||||
subject: { // 不走同步 Pinia
|
|
||||||
bookList: null, // 教材列表
|
|
||||||
curBook: null, // 当前选中的教材
|
|
||||||
curNode: null, // 当前选中的节点
|
|
||||||
defaultExpandedKeys: [], //展开的节点
|
|
||||||
subjectTree: [] // "树结构" 章节
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
local: { // 本地(永久localStorage)
|
local: { // 本地(永久localStorage)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3144,7 +3144,7 @@ body{
|
||||||
background-color:var(--toolbar-bg-color);
|
background-color:var(--toolbar-bg-color);
|
||||||
box-shadow:var(--toolbar-box-shadow);
|
box-shadow:var(--toolbar-box-shadow);
|
||||||
border-bottom:var(--toolbar-border-bottom);
|
border-bottom:var(--toolbar-border-bottom);
|
||||||
z-index: 99999;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolbarViewer{
|
#toolbarViewer{
|
||||||
|
|
|
@ -294,7 +294,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||||
</span>
|
</span>
|
||||||
<span id="numPages" class="toolbarLabel"></span>
|
<span id="numPages" class="toolbarLabel"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="toolbarViewerRight">
|
<div id="toolbarViewerRight" style="display: none;">
|
||||||
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||||
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
||||||
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 2794390 */
|
font-family: "iconfont"; /* Project id 2794390 */
|
||||||
src: url('iconfont.woff2?t=1727403518918') format('woff2'),
|
src: url('iconfont.woff2?t=1725847033097') format('woff2'),
|
||||||
url('iconfont.woff?t=1727403518918') format('woff'),
|
url('iconfont.woff?t=1725847033097') format('woff'),
|
||||||
url('iconfont.ttf?t=1727403518918') format('truetype'),
|
url('iconfont.ttf?t=1725847033097') format('truetype'),
|
||||||
url('iconfont.svg?t=1727403518918#iconfont') format('svg');
|
url('iconfont.svg?t=1725847033097#iconfont') format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
@ -14,98 +14,38 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-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 {
|
.icon-aijiqiren:before {
|
||||||
content: "\e73c";
|
content: "\e73c";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-saoyisao:before {
|
||||||
|
content: "\e691";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-jiaoxuezhiliangfenxi:before {
|
||||||
|
content: "\e690";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-jiaoxuejihua:before {
|
||||||
|
content: "\e7e9";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-tongji:before {
|
.icon-tongji:before {
|
||||||
content: "\e68f";
|
content: "\e68f";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-pigai:before {
|
||||||
|
content: "\e68d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-jiaoxuefansi:before {
|
||||||
|
content: "\e6b2";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-kaoshi:before {
|
||||||
|
content: "\e68a";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-yiwen:before {
|
.icon-yiwen:before {
|
||||||
content: "\e687";
|
content: "\e687";
|
||||||
}
|
}
|
||||||
|
@ -234,6 +174,10 @@
|
||||||
content: "\e642";
|
content: "\e642";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-organization-framework-line:before {
|
||||||
|
content: "\e9fe";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-jiaocai:before {
|
.icon-jiaocai:before {
|
||||||
content: "\e67b";
|
content: "\e67b";
|
||||||
}
|
}
|
||||||
|
@ -302,6 +246,10 @@
|
||||||
content: "\eb13";
|
content: "\eb13";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-fankui:before {
|
||||||
|
content: "\e738";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-tiku:before {
|
.icon-tiku:before {
|
||||||
content: "\e621";
|
content: "\e621";
|
||||||
}
|
}
|
||||||
|
@ -322,6 +270,10 @@
|
||||||
content: "\e61c";
|
content: "\e61c";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-jiaoxuefenxi:before {
|
||||||
|
content: "\e605";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-wenjianjia:before {
|
.icon-wenjianjia:before {
|
||||||
content: "\ec17";
|
content: "\ec17";
|
||||||
}
|
}
|
||||||
|
@ -346,6 +298,14 @@
|
||||||
content: "\e675";
|
content: "\e675";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-yanjiushi:before {
|
||||||
|
content: "\e607";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-gongzuotai:before {
|
||||||
|
content: "\e676";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-lunwen:before {
|
.icon-lunwen:before {
|
||||||
content: "\e60e";
|
content: "\e60e";
|
||||||
}
|
}
|
||||||
|
@ -362,6 +322,10 @@
|
||||||
content: "\e6fe";
|
content: "\e6fe";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-pengyouquan1:before {
|
||||||
|
content: "\e635";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-beike1:before {
|
.icon-beike1:before {
|
||||||
content: "\e61b";
|
content: "\e61b";
|
||||||
}
|
}
|
||||||
|
@ -382,6 +346,10 @@
|
||||||
content: "\e612";
|
content: "\e612";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-fankui1:before {
|
||||||
|
content: "\e6fa";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-shezhi:before {
|
.icon-shezhi:before {
|
||||||
content: "\e614";
|
content: "\e614";
|
||||||
}
|
}
|
||||||
|
@ -426,6 +394,10 @@
|
||||||
content: "\e654";
|
content: "\e654";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-kecheng:before {
|
||||||
|
content: "\e619";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-bianji1:before {
|
.icon-bianji1:before {
|
||||||
content: "\e61d";
|
content: "\e61d";
|
||||||
}
|
}
|
||||||
|
@ -454,6 +426,10 @@
|
||||||
content: "\e79a";
|
content: "\e79a";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-xueqingfenxi:before {
|
||||||
|
content: "\e67a";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-check:before {
|
.icon-check:before {
|
||||||
content: "\e622";
|
content: "\e622";
|
||||||
}
|
}
|
||||||
|
@ -570,6 +546,10 @@
|
||||||
content: "\e636";
|
content: "\e636";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-ziyuanfenxi:before {
|
||||||
|
content: "\e637";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-shoucang1:before {
|
.icon-shoucang1:before {
|
||||||
content: "\e638";
|
content: "\e638";
|
||||||
}
|
}
|
||||||
|
@ -586,6 +566,10 @@
|
||||||
content: "\e772";
|
content: "\e772";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-xiezuo1:before {
|
||||||
|
content: "\e63b";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-fenxi1:before {
|
.icon-fenxi1:before {
|
||||||
content: "\e63c";
|
content: "\e63c";
|
||||||
}
|
}
|
||||||
|
@ -814,6 +798,10 @@
|
||||||
content: "\e672";
|
content: "\e672";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-jiaoxueziyuan:before {
|
||||||
|
content: "\e601";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-beike:before {
|
.icon-beike:before {
|
||||||
content: "\e6c2";
|
content: "\e6c2";
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,153 +5,6 @@
|
||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"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",
|
"icon_id": "34666608",
|
||||||
"name": "ai机器人",
|
"name": "ai机器人",
|
||||||
|
@ -159,6 +12,27 @@
|
||||||
"unicode": "e73c",
|
"unicode": "e73c",
|
||||||
"unicode_decimal": 59196
|
"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",
|
"icon_id": "8455509",
|
||||||
"name": "统计",
|
"name": "统计",
|
||||||
|
@ -166,6 +40,27 @@
|
||||||
"unicode": "e68f",
|
"unicode": "e68f",
|
||||||
"unicode_decimal": 59023
|
"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",
|
"icon_id": "20574719",
|
||||||
"name": "疑问",
|
"name": "疑问",
|
||||||
|
@ -390,6 +285,13 @@
|
||||||
"unicode": "e642",
|
"unicode": "e642",
|
||||||
"unicode_decimal": 58946
|
"unicode_decimal": 58946
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "6235034",
|
||||||
|
"name": "组织框架",
|
||||||
|
"font_class": "organization-framework-line",
|
||||||
|
"unicode": "e9fe",
|
||||||
|
"unicode_decimal": 59902
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "10900222",
|
"icon_id": "10900222",
|
||||||
"name": "教材",
|
"name": "教材",
|
||||||
|
@ -509,6 +411,13 @@
|
||||||
"unicode": "eb13",
|
"unicode": "eb13",
|
||||||
"unicode_decimal": 60179
|
"unicode_decimal": 60179
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "577336",
|
||||||
|
"name": "反馈",
|
||||||
|
"font_class": "fankui",
|
||||||
|
"unicode": "e738",
|
||||||
|
"unicode_decimal": 59192
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "1447760",
|
"icon_id": "1447760",
|
||||||
"name": "题库",
|
"name": "题库",
|
||||||
|
@ -544,6 +453,13 @@
|
||||||
"unicode": "e61c",
|
"unicode": "e61c",
|
||||||
"unicode_decimal": 58908
|
"unicode_decimal": 58908
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "4686996",
|
||||||
|
"name": "教学分析",
|
||||||
|
"font_class": "jiaoxuefenxi",
|
||||||
|
"unicode": "e605",
|
||||||
|
"unicode_decimal": 58885
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "4893191",
|
"icon_id": "4893191",
|
||||||
"name": "文件夹",
|
"name": "文件夹",
|
||||||
|
@ -586,6 +502,20 @@
|
||||||
"unicode": "e675",
|
"unicode": "e675",
|
||||||
"unicode_decimal": 58997
|
"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",
|
"icon_id": "9023128",
|
||||||
"name": "论文",
|
"name": "论文",
|
||||||
|
@ -614,6 +544,13 @@
|
||||||
"unicode": "e6fe",
|
"unicode": "e6fe",
|
||||||
"unicode_decimal": 59134
|
"unicode_decimal": 59134
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "16364339",
|
||||||
|
"name": "朋友圈",
|
||||||
|
"font_class": "pengyouquan1",
|
||||||
|
"unicode": "e635",
|
||||||
|
"unicode_decimal": 58933
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "37075078",
|
"icon_id": "37075078",
|
||||||
"name": "备课",
|
"name": "备课",
|
||||||
|
@ -649,6 +586,13 @@
|
||||||
"unicode": "e612",
|
"unicode": "e612",
|
||||||
"unicode_decimal": 58898
|
"unicode_decimal": 58898
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "2680657",
|
||||||
|
"name": "反馈",
|
||||||
|
"font_class": "fankui1",
|
||||||
|
"unicode": "e6fa",
|
||||||
|
"unicode_decimal": 59130
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "4520331",
|
"icon_id": "4520331",
|
||||||
"name": "设置",
|
"name": "设置",
|
||||||
|
@ -726,6 +670,13 @@
|
||||||
"unicode": "e654",
|
"unicode": "e654",
|
||||||
"unicode_decimal": 58964
|
"unicode_decimal": 58964
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "6560965",
|
||||||
|
"name": "课程",
|
||||||
|
"font_class": "kecheng",
|
||||||
|
"unicode": "e619",
|
||||||
|
"unicode_decimal": 58905
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "6682548",
|
"icon_id": "6682548",
|
||||||
"name": "编辑",
|
"name": "编辑",
|
||||||
|
@ -775,6 +726,13 @@
|
||||||
"unicode": "e79a",
|
"unicode": "e79a",
|
||||||
"unicode_decimal": 59290
|
"unicode_decimal": 59290
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "8225912",
|
||||||
|
"name": "学情分析",
|
||||||
|
"font_class": "xueqingfenxi",
|
||||||
|
"unicode": "e67a",
|
||||||
|
"unicode_decimal": 59002
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "9922803",
|
"icon_id": "9922803",
|
||||||
"name": "check",
|
"name": "check",
|
||||||
|
@ -978,6 +936,13 @@
|
||||||
"unicode": "e636",
|
"unicode": "e636",
|
||||||
"unicode_decimal": 58934
|
"unicode_decimal": 58934
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "39506557",
|
||||||
|
"name": "资源分析",
|
||||||
|
"font_class": "ziyuanfenxi",
|
||||||
|
"unicode": "e637",
|
||||||
|
"unicode_decimal": 58935
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "3267408",
|
"icon_id": "3267408",
|
||||||
"name": "收藏",
|
"name": "收藏",
|
||||||
|
@ -1006,6 +971,13 @@
|
||||||
"unicode": "e772",
|
"unicode": "e772",
|
||||||
"unicode_decimal": 59250
|
"unicode_decimal": 59250
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "6837777",
|
||||||
|
"name": "写作",
|
||||||
|
"font_class": "xiezuo1",
|
||||||
|
"unicode": "e63b",
|
||||||
|
"unicode_decimal": 58939
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "7171145",
|
"icon_id": "7171145",
|
||||||
"name": "粮食动态决策分析系统",
|
"name": "粮食动态决策分析系统",
|
||||||
|
@ -1405,6 +1377,13 @@
|
||||||
"unicode": "e672",
|
"unicode": "e672",
|
||||||
"unicode_decimal": 58994
|
"unicode_decimal": 58994
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "15841963",
|
||||||
|
"name": "教学资源",
|
||||||
|
"font_class": "jiaoxueziyuan",
|
||||||
|
"unicode": "e601",
|
||||||
|
"unicode_decimal": 58881
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "5562910",
|
"icon_id": "5562910",
|
||||||
"name": "备课",
|
"name": "备课",
|
||||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 354 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { getAppInstallUrl } from '@/utils/tool'
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -17,10 +16,11 @@ const props = defineProps({
|
||||||
/**pdf文件地址 */
|
/**pdf文件地址 */
|
||||||
const pdfUrl = ref('');
|
const pdfUrl = ref('');
|
||||||
/**pdfjs文件地址 */
|
/**pdfjs文件地址 */
|
||||||
const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
const fileUrl = '/pdfjs-dist/web/viewer.html?file=';
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
||||||
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
||||||
|
console.log('组件',pdfUrl.value);
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -44,12 +44,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||||
|
|
||||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['nodeClick'])
|
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||||
let useSubject = null
|
let useSubject = null
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
@ -75,14 +74,18 @@ const defaultExpandedKeys = ref([])
|
||||||
//选择教材
|
//选择教材
|
||||||
const changeBook = (data) => {
|
const changeBook = (data) => {
|
||||||
curBook.data = data
|
curBook.data = data
|
||||||
sessionStore.set('subject.curBook', data)
|
|
||||||
|
localStorage.setItem('curBook', JSON.stringify(data))
|
||||||
treeData.value = useSubject.getTreeData(data.id)
|
treeData.value = useSubject.getTreeData(data.id)
|
||||||
sessionStore.set('subject.subjectTree', useSubject.getTreeData(data.id))
|
|
||||||
//切换教材后默认展开第一个并选中
|
//切换教材后默认展开第一个并选中
|
||||||
nextTick(() =>{
|
nextTick(() =>{
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
curNode.data = getLastLevelData(treeData.value)[0]
|
||||||
handleNodeClick(curNode.data)
|
|
||||||
|
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||||
|
localStorage.setItem('curNode',JSON.stringify(curNode.data))
|
||||||
|
emitChangeBook()
|
||||||
})
|
})
|
||||||
// 延迟关闭 视觉上选中
|
// 延迟关闭 视觉上选中
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -90,6 +93,40 @@ const changeBook = (data) => {
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const emitChangeBook = async () => {
|
||||||
|
let curData = cloneDeep(toRaw(curNode.data))
|
||||||
|
let parentNode = findParentByChildId(treeData.value, curData.id)
|
||||||
|
curData.parentNode = toRaw(parentNode)
|
||||||
|
//怎加一个label 之前取的label
|
||||||
|
curData.label = curData.itemtitle
|
||||||
|
const data = {
|
||||||
|
textBook: {
|
||||||
|
curBookId: curBook.data.id,
|
||||||
|
curBookName: curBook.data.itemtitle,
|
||||||
|
curBookImg: BaseUrl + curBook.data.avartar,
|
||||||
|
curBookPath: curBook.data.fileurl
|
||||||
|
},
|
||||||
|
node: curData
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 临时用 后续删除 unitId
|
||||||
|
*/
|
||||||
|
let levelFirstId = null
|
||||||
|
let levelSecondId = null
|
||||||
|
let bookeId = curBook.data.id
|
||||||
|
if (curData.parentNode) {
|
||||||
|
levelFirstId = curData.parentNode.id
|
||||||
|
levelSecondId = curData.id
|
||||||
|
} else {
|
||||||
|
levelFirstId = curData.id
|
||||||
|
levelSecondId = ''
|
||||||
|
}
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
|
||||||
|
emit('changeBook', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const getLastLevelData = (tree) => {
|
const getLastLevelData = (tree) => {
|
||||||
let lastLevelData = [];
|
let lastLevelData = [];
|
||||||
// 递归函数遍历树形结构
|
// 递归函数遍历树形结构
|
||||||
|
@ -134,22 +171,25 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data) => {
|
const handleNodeClick = (data, node) => {
|
||||||
/**
|
/**
|
||||||
* data : 当前节点数据
|
* data : 当前节点数据
|
||||||
|
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
||||||
*/
|
*/
|
||||||
let nodeData = cloneDeep(toRaw(data));
|
let nodeData = cloneDeep(toRaw(data));
|
||||||
|
//怎加一个label 之前取的label
|
||||||
//增加一个label 之前取的label
|
|
||||||
nodeData.label = nodeData.itemtitle
|
nodeData.label = nodeData.itemtitle
|
||||||
// 父级节点 如果当前是一级节点 父级则为null
|
const parentNode = node.parent.data;
|
||||||
let parent = {
|
// parentNode 为数组 则点击的是一级节点
|
||||||
id: nodeData.parentid,
|
if (Array.isArray(parentNode)) {
|
||||||
label: nodeData.parenttitle,
|
//
|
||||||
itemtitle: nodeData.parenttitle
|
nodeData.parentNode = null
|
||||||
}
|
}
|
||||||
const parentNode = nodeData.parentid ? parent : null
|
else {
|
||||||
nodeData.parentNode = parentNode
|
// 否则 点击的为二级节点 parentNode 为它的父级节点
|
||||||
|
nodeData.parentNode = toRaw(parentNode)
|
||||||
|
}
|
||||||
|
|
||||||
let curData = {
|
let curData = {
|
||||||
textBook: {
|
textBook: {
|
||||||
curBookId: curBook.data.id,
|
curBookId: curBook.data.id,
|
||||||
|
@ -157,42 +197,63 @@ const handleNodeClick = (data) => {
|
||||||
curBookImg: BaseUrl + curBook.data.avartar,
|
curBookImg: BaseUrl + curBook.data.avartar,
|
||||||
curBookPath: curBook.data.fileurl
|
curBookPath: curBook.data.fileurl
|
||||||
},
|
},
|
||||||
node: nodeData
|
node: toRaw(nodeData)
|
||||||
}
|
}
|
||||||
// 本地存储:electron-store
|
localStorage.setItem('defaultExpandedKeys', parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
|
||||||
let defaultExpandedKeys = parentNode ? [parentNode.id] : [nodeData.id]
|
localStorage.setItem('curNode', JSON.stringify(nodeData))
|
||||||
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
|
||||||
sessionStore.set('subject.curNode', nodeData)
|
/**
|
||||||
|
* 临时用 后续删除 unitId
|
||||||
|
*/
|
||||||
|
let levelFirstId = null
|
||||||
|
let levelSecondId = null
|
||||||
|
let bookeId = curBook.data.id
|
||||||
|
if (nodeData.parentNode) {
|
||||||
|
levelFirstId = nodeData.parentNode.id
|
||||||
|
levelSecondId = nodeData.id
|
||||||
|
} else {
|
||||||
|
levelFirstId = nodeData.id
|
||||||
|
levelSecondId = ''
|
||||||
|
}
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
|
||||||
|
|
||||||
emit('nodeClick', curData)
|
emit('nodeClick', curData)
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted( async () => {
|
onMounted( async () => {
|
||||||
treeLoading.value = true
|
treeLoading.value = true
|
||||||
|
|
||||||
try{
|
try{
|
||||||
useSubject = await useGetSubject()
|
useSubject = await useGetSubject()
|
||||||
subjectList.value = sessionStore.get('subject.bookList')
|
subjectList.value = useSubject.subjectList
|
||||||
// 当前教材
|
|
||||||
if(sessionStore.get('subject.curBook')){
|
let book = localStorage.getItem('curBook')
|
||||||
curBook.data = sessionStore.get('subject.curBook')
|
if(book){
|
||||||
|
book = JSON.parse(book)
|
||||||
|
curBook.data = book
|
||||||
|
treeData.value = useSubject.getTreeData(book.id)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
curBook.data = subjectList.value[0]
|
curBook.data = useSubject.subjectList[0]
|
||||||
|
localStorage.setItem('curBook', JSON.stringify(curBook.data))
|
||||||
|
treeData.value = useSubject.treeData
|
||||||
}
|
}
|
||||||
|
// 设置展开并选中
|
||||||
// 章节"树"
|
|
||||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
|
||||||
sessionStore.set('subject.subjectTree',useSubject.getTreeData(curBook.data.id))
|
|
||||||
|
|
||||||
nextTick(() =>{
|
nextTick(() =>{
|
||||||
// 默认展开 选中
|
// 取缓存
|
||||||
if(sessionStore.get('subject.curNode')){
|
let node = localStorage.getItem('curNode')
|
||||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
if(node){
|
||||||
curNode.data = sessionStore.get('subject.curNode')
|
curNode.data = JSON.parse(node)
|
||||||
}else{
|
defaultExpandedKeys.value = JSON.parse(localStorage.getItem('defaultExpandedKeys'))
|
||||||
|
}
|
||||||
|
else{
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
curNode.data = getLastLevelData(treeData.value)[0]
|
||||||
|
//缓存记录当前展开以及选中节点
|
||||||
|
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||||
|
localStorage.setItem('curNode', JSON.stringify(curNode.data))
|
||||||
}
|
}
|
||||||
handleNodeClick(curNode.data)
|
emitChangeBook()
|
||||||
})
|
})
|
||||||
|
|
||||||
} finally{
|
} finally{
|
||||||
|
|
|
@ -145,6 +145,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
window.test = this
|
||||||
this.slotKeys = Object.keys(this.$slots)
|
this.slotKeys = Object.keys(this.$slots)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="model" append-to-body :show-close="false" width="630"
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="630" :before-close="beforeClose"
|
||||||
style="border-radius: 5px;padding-top: 0">
|
style="border-radius: 5px;padding-top: 0">
|
||||||
<div class="dialog-title flex">
|
<div class="dialog-title flex">
|
||||||
<span>{{ title }}</span>
|
<span>{{ title }}</span>
|
||||||
|
@ -7,13 +7,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<div class="book-name flex" @click="bookVisible = true">
|
<div class="book-name flex" @click="bookVisible = true">
|
||||||
<span>{{ curNode.data.itemtitle }}</span>
|
<span>{{ curBookName }}</span>
|
||||||
<i class="iconfont icon-yidongdaozu"></i>
|
<i class="iconfont icon-yidongdaozu"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar height="400px">
|
<el-scrollbar height="400px">
|
||||||
<div class="book-data">
|
<div class="book-data">
|
||||||
<el-tree :data="treeData" :props="defaultProps" node-key="id"
|
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||||
@node-click="handleNodeClick">
|
@node-click="handleNodeClick">
|
||||||
<template #default="{ node }">
|
<template #default="{ node }">
|
||||||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="model = false">取消</el-button>
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
<el-button type="primary" @click="onSubmit">
|
<el-button type="primary" @click="onSubmit">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -43,12 +43,9 @@
|
||||||
|
|
||||||
<div class="textbook-container">
|
<div class="textbook-container">
|
||||||
<el-scrollbar height="450px">
|
<el-scrollbar height="450px">
|
||||||
<div class="textbook-item flex" v-for="item in subjectList" :class="curBook.data.id == item.id ? 'active-item' : ''"
|
<div class="textbook-item flex" v-for="item in subjectList" :class="curBookId == item.id ? 'active-item' : ''"
|
||||||
:key="item.id" @click="changeBook(item)">
|
:key="item.id" @click="changeBook(item)">
|
||||||
<img v-if="item.avartar" :src="item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + item.avartar" class="textbook-img" alt="">
|
<img :src="item.avartar" class="textbook-img" alt="">
|
||||||
<div v-else class="textbook-img">
|
|
||||||
<i class="iconfont icon-jiaocaixuanze" style="font-size: 40px;"></i>
|
|
||||||
</div>
|
|
||||||
<span class="book-name">{{ item.itemtitle }}</span>
|
<span class="book-name">{{ item.itemtitle }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
@ -57,10 +54,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, toRaw, onMounted, nextTick } from 'vue'
|
import { ref, reactive, toRaw, onMounted, nextTick, watch } from 'vue'
|
||||||
import { sessionStore } from '@/utils/store'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { cloneDeep } from 'lodash'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -72,35 +68,134 @@ const props = defineProps({
|
||||||
default: '移动至'
|
default: '移动至'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const model = defineModel({ type: Boolean, default: false })
|
const userStore = useUserStore()
|
||||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
const { edustage, edusubject, userId } = userStore.user
|
||||||
let useSubject = null
|
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
const bookVisible = ref(false)
|
const bookVisible = ref(false)
|
||||||
//教材
|
//教材
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
|
const evaluationList = ref([])
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'itemtitle',
|
label: 'label',
|
||||||
class: 'textbook-tree'
|
class: 'textbook-tree'
|
||||||
}
|
}
|
||||||
// 当前选中的教材
|
//当前教材ID
|
||||||
const curBook = reactive({
|
const curBookId = ref(-1)
|
||||||
|
//当前教材名称
|
||||||
|
const curBookName = ref('')
|
||||||
|
// 上册
|
||||||
|
const volumeOne = ref([])
|
||||||
|
// 当前节点
|
||||||
|
const currentNode = reactive({
|
||||||
data: {}
|
data: {}
|
||||||
})
|
})
|
||||||
// 当前节点
|
// 当前选中的节点ID
|
||||||
const curNode = reactive({
|
const currentNodeId = ref(0)
|
||||||
data:{}
|
// 当前选中的节点名称
|
||||||
})
|
const currentNodeName = ref('')
|
||||||
// 提交的数据 节点
|
|
||||||
let submitNode = null
|
|
||||||
|
|
||||||
// 默认展开的节点
|
// 默认展开的节点
|
||||||
const defaultExpandedKeys = ref([])
|
const defaultExpandedKeys = ref([])
|
||||||
|
// tree
|
||||||
|
const refTree = ref(null)
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['onSubmit'])
|
const emit = defineEmits(['update:modelValue', 'onSubmit'])
|
||||||
|
|
||||||
|
watch(() => props.modelValue, (newVal) => {
|
||||||
|
dialogVisible.value = newVal
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const getSubjectContent = async () => {
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
edusubject,
|
||||||
|
edustage,
|
||||||
|
// entpcourseedituserid: userId,
|
||||||
|
itemgroup: 'textbook',
|
||||||
|
orderby: 'orderidx asc',
|
||||||
|
pageSize: 10000
|
||||||
|
}
|
||||||
|
let data;
|
||||||
|
const { rows } = await listEvaluation(params)
|
||||||
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
|
evaluationList.value = rows
|
||||||
|
data = rows
|
||||||
|
|
||||||
|
//获取教材版本
|
||||||
|
getSubject()
|
||||||
|
//上册
|
||||||
|
/**
|
||||||
|
* 不区分上下册
|
||||||
|
* 2024/08/20调整
|
||||||
|
*/
|
||||||
|
// volumeOne.value = data.filter(item => item.level == 1)
|
||||||
|
|
||||||
|
getTreeData()
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSubject = async () => {
|
||||||
|
|
||||||
|
|
||||||
|
if (localStorage.getItem('subjectList')) {
|
||||||
|
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000, orderby: 'orderidx asc', })
|
||||||
|
subjectList.value = rows
|
||||||
|
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认第一个
|
||||||
|
if(!subjectList.value.length) return
|
||||||
|
curBookName.value = subjectList.value[0].itemtitle
|
||||||
|
curBookId.value = subjectList.value[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
const isHaveUnit = (id) => {
|
||||||
|
return evaluationList.value.some(item => {
|
||||||
|
return item.rootid == id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getTreeData = () => {
|
||||||
|
//数据过滤
|
||||||
|
let upData = transData(evaluationList.value)
|
||||||
|
if(upData.length){
|
||||||
|
treeData.value = [...upData]
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
treeData.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||||
|
currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||||
|
currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||||
|
emitChangeBook()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const emitChangeBook = () => {
|
||||||
|
let curNode = {
|
||||||
|
id: currentNodeId.value,
|
||||||
|
label: currentNodeName.value
|
||||||
|
}
|
||||||
|
let parentNode = findParentByChildId(treeData.value, currentNodeId.value)
|
||||||
|
curNode.parentNode = toRaw(parentNode)
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
textBook: {
|
||||||
|
curBookId: curBookId.value,
|
||||||
|
curBookName: curBookName.value
|
||||||
|
},
|
||||||
|
node: curNode
|
||||||
|
}
|
||||||
|
currentNode.data = data
|
||||||
|
}
|
||||||
|
|
||||||
// 根据id 拿到父节点数据
|
// 根据id 拿到父节点数据
|
||||||
const findParentByChildId = (treeData, targetNodeId) => {
|
const findParentByChildId = (treeData, targetNodeId) => {
|
||||||
|
@ -124,32 +219,70 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleNodeClick = (data) => {
|
const handleNodeClick = (data, node) => {
|
||||||
/**
|
/**
|
||||||
* data : 当前节点数据
|
* data : 当前节点数据
|
||||||
|
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
||||||
*/
|
*/
|
||||||
let nodeData = cloneDeep(toRaw(data));
|
const nodeData = data;
|
||||||
//增加一个label 之前取的label
|
const parentNode = node.parent.data;
|
||||||
nodeData.label = nodeData.itemtitle
|
|
||||||
// 父级节点 如果当前是一级节点 父级则为null
|
if (Array.isArray(parentNode)) {
|
||||||
let parent = {
|
nodeData.parentNode = null
|
||||||
id: nodeData.parentid,
|
}
|
||||||
label: nodeData.parenttitle,
|
else {
|
||||||
itemtitle: nodeData.parenttitle
|
nodeData.parentNode = parentNode
|
||||||
}
|
}
|
||||||
const parentNode = nodeData.parentid ? parent : null
|
|
||||||
nodeData.parentNode = parentNode
|
|
||||||
|
|
||||||
let curData = {
|
let curData = {
|
||||||
textBook: {
|
textBook: {
|
||||||
curBookId: curBook.data.id,
|
curBookId: curBookId.value,
|
||||||
curBookName: curBook.data.itemtitle
|
curBookName: curBookName.value
|
||||||
},
|
},
|
||||||
node: nodeData
|
node: toRaw(nodeData)
|
||||||
}
|
}
|
||||||
submitNode = curData
|
|
||||||
|
currentNode.data = curData
|
||||||
|
// emit('nodeClick', curData)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const transData = (data) => {
|
||||||
|
let ary = []
|
||||||
|
data.forEach(item => {
|
||||||
|
let obj = {}
|
||||||
|
// 根据当前教材ID 过滤出对应的单元、章节
|
||||||
|
if (item.rootid == curBookId.value) {
|
||||||
|
if(item.level == 1){
|
||||||
|
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
|
||||||
|
}
|
||||||
// 获取最后一层数据
|
// 获取最后一层数据
|
||||||
const getLastLevelData = (tree) => {
|
const getLastLevelData = (tree) => {
|
||||||
let lastLevelData = [];
|
let lastLevelData = [];
|
||||||
|
@ -174,53 +307,33 @@ const getLastLevelData = (tree) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择教材
|
// 选择教材
|
||||||
const changeBook = (data) => {
|
const changeBook = ({ id, itemtitle }) => {
|
||||||
curBook.data = data
|
curBookId.value = id
|
||||||
treeData.value = useSubject.getTreeData(data.id)
|
curBookName.value = itemtitle
|
||||||
|
getTreeData()
|
||||||
//切换教材后默认展开第一个并选中
|
|
||||||
nextTick(() =>{
|
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
|
||||||
handleNodeClick(curNode.data)
|
|
||||||
})
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
bookVisible.value = false
|
bookVisible.value = false
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
emit('onSubmit', submitNode)
|
emit('onSubmit', toRaw(currentNode.data))
|
||||||
model.value = false
|
closeDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
const closeDialog = () => {
|
||||||
// 不缓存记录选择的章节 教材 只获取
|
emit('update:modelValue', false)
|
||||||
useSubject = await useGetSubject()
|
}
|
||||||
subjectList.value = sessionStore.get('subject.bookList')
|
|
||||||
// 当前教材
|
|
||||||
if(sessionStore.get('subject.curBook')){
|
|
||||||
curBook.data = sessionStore.get('subject.curBook')
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
curBook.data = subjectList.value[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 章节"树"
|
// 关闭弹窗前
|
||||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
const beforeClose = (done) => {
|
||||||
nextTick(() =>{
|
emit('update:modelValue', false)
|
||||||
// 默认展开 选中
|
done()
|
||||||
if(sessionStore.get('subject.curNode')){
|
}
|
||||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
|
||||||
curNode.data = sessionStore.get('subject.curNode')
|
onMounted(() => {
|
||||||
}else{
|
getSubjectContent()
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
|
||||||
}
|
|
||||||
handleNodeClick(curNode.data)
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ onMounted(async () => {
|
||||||
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
|
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
|
||||||
// canvas2.canvas.isDrawingMode=false
|
// canvas2.canvas.isDrawingMode=false
|
||||||
canvas1FabricVue.value = canvas2
|
canvas1FabricVue.value = canvas2
|
||||||
// window.test = { canvas1, canvas2 }
|
window.test = { canvas1, canvas2 }
|
||||||
emit('update:numPagesTotal', pdf.numPages)
|
emit('update:numPagesTotal', pdf.numPages)
|
||||||
|
|
||||||
if (props.pdfObj.allPageData.length) {
|
if (props.pdfObj.allPageData.length) {
|
||||||
|
|
|
@ -294,7 +294,7 @@ onMounted(async () => {
|
||||||
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
|
canvas2.canvas.setWidth(window.innerWidth / 2 - 100)
|
||||||
// canvas2.canvas.isDrawingMode=false
|
// canvas2.canvas.isDrawingMode=false
|
||||||
canvas1FabricVue.value = canvas2
|
canvas1FabricVue.value = canvas2
|
||||||
// window.test = { canvas1, canvas2 }
|
window.test = { canvas1, canvas2 }
|
||||||
emit('update:numPagesTotal', pdf.numPages)
|
emit('update:numPagesTotal', pdf.numPages)
|
||||||
|
|
||||||
if (props.pdfObj.allPageData.length) {
|
if (props.pdfObj.allPageData.length) {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
export const useGetSubject = async () =>{
|
export const useGetSubject = async () =>{
|
||||||
|
|
||||||
// user store
|
// user store
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { edustage, edusubject } = userStore.user
|
const { edustage, edusubject, userId } = userStore.user
|
||||||
|
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
// 章节List
|
// 章节List
|
||||||
const unitList = ref([])
|
const unitList = ref([])
|
||||||
// 教材List
|
// 教材List
|
||||||
|
@ -15,10 +15,12 @@ export const useGetSubject = async () =>{
|
||||||
// 单元章节树结构
|
// 单元章节树结构
|
||||||
let treeData = null
|
let treeData = null
|
||||||
|
|
||||||
// 根据学科 + 学段 获取所有单元章节
|
|
||||||
|
// 根据 学科 + 学段 获取所有单元章节
|
||||||
const getSubjectUnit = async () =>{
|
const getSubjectUnit = async () =>{
|
||||||
if(sessionStore.get('subject.unitList')){
|
let strUnit = localStorage.getItem('unitList')
|
||||||
unitList.value = sessionStore.get('subject.unitList')
|
if(strUnit){
|
||||||
|
unitList.value = JSON.parse(strUnit)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const unitParams = {
|
const unitParams = {
|
||||||
|
@ -30,16 +32,18 @@ export const useGetSubject = async () =>{
|
||||||
}
|
}
|
||||||
const { rows } = await listEvaluation(unitParams)
|
const { rows } = await listEvaluation(unitParams)
|
||||||
unitList.value = rows
|
unitList.value = rows
|
||||||
sessionStore.set('subject.unitList', rows)
|
localStorage.setItem('unitList', JSON.stringify(rows))
|
||||||
}
|
}
|
||||||
|
|
||||||
await getSubject()
|
await getSubject()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据学科 + 学段 获取教材
|
// 获取 学科 + 学段 获取教材
|
||||||
const getSubject = async () =>{
|
const getSubject = async () =>{
|
||||||
|
|
||||||
if(sessionStore.get('subject.bookList')){
|
let strSubject = localStorage.getItem('subjectList')
|
||||||
subjectList = sessionStore.get('subject.bookList')
|
if(strSubject){
|
||||||
|
subjectList = JSON.parse(strSubject)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const subjectParams = {
|
const subjectParams = {
|
||||||
|
@ -51,17 +55,12 @@ export const useGetSubject = async () =>{
|
||||||
}
|
}
|
||||||
const { rows } = await listEvaluation(subjectParams)
|
const { rows } = await listEvaluation(subjectParams)
|
||||||
subjectList = rows
|
subjectList = rows
|
||||||
sessionStore.set('subject.bookList', rows)
|
localStorage.setItem('subjectList', JSON.stringify(rows))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认选中第一个教材
|
||||||
|
if(subjectList && subjectList.length){
|
||||||
treeData = getTreeData(subjectList[0].id)
|
treeData = getTreeData(subjectList[0].id)
|
||||||
// 设置一个默认的curNode
|
|
||||||
let curNode
|
|
||||||
if(treeData[0].children && treeData[0].children.length){
|
|
||||||
curNode = treeData[0].children[0]
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
curNode = treeData[0]
|
|
||||||
}
|
|
||||||
sessionStore.set('subject.curNode', curNode)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +72,7 @@ export const useGetSubject = async () =>{
|
||||||
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
|
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await getSubjectUnit()
|
await getSubjectUnit()
|
||||||
|
|
|
@ -67,7 +67,7 @@ const title = reactive([
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教材分析',
|
name: '教材分析',
|
||||||
url: '/textbookAnalysis',
|
url: '/teaching/chatwithtextbook',
|
||||||
img: 'iconfont icon-yanjiushi',
|
img: 'iconfont icon-yanjiushi',
|
||||||
child1: []
|
child1: []
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,14 +9,7 @@
|
||||||
<ul class="flex">
|
<ul class="flex">
|
||||||
<li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
|
<li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
|
||||||
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
|
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
|
||||||
<div class="icon-box">
|
<i class="iconfont" :class="menu.icon"></i>
|
||||||
|
|
||||||
|
|
||||||
<svg class="icon iconfont" aria-hidden="true">
|
|
||||||
<use :xlink:href="menu.icon"></use>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<span class="text">{{ menu.name }}</span>
|
<span class="text">{{ menu.name }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -45,7 +38,7 @@
|
||||||
<span class="user-name">{{ userStore.user.nickName }}</span>
|
<span class="user-name">{{ userStore.user.nickName }}</span>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
||||||
<el-dropdown @command="changeSubject" max-height="500">
|
<el-dropdown @command="changeSubject">
|
||||||
<div class="user-subject">{{ userStore.user.edusubject }}
|
<div class="user-subject">{{ userStore.user.edusubject }}
|
||||||
<el-icon class="el-icon--right"><arrow-down />
|
<el-icon class="el-icon--right"><arrow-down />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
@ -77,8 +70,10 @@ import { ArrowDown } from '@element-plus/icons-vue'
|
||||||
import WindowTools from '@/components/window-tools/index.vue'
|
import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { updateUserInfo } from '@/api/system/user'
|
import { updateUserInfo } from '@/api/system/user'
|
||||||
|
import outLink from '@/utils/linkConfig'
|
||||||
import logoIco from '@/assets/images/logo.png'
|
import logoIco from '@/assets/images/logo.png'
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
import { listEvaluation } from '@/api/classManage/index'
|
||||||
|
import { clearBookInfo } from '@/utils/ruoyi'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
|
||||||
|
@ -91,30 +86,54 @@ const currentRoute = ref('')
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||||
const userSubjectList = ref([])
|
const userSubjectList = ref([])
|
||||||
|
|
||||||
|
const handleOutLink = (path, type, name) => {
|
||||||
|
if (!path) return
|
||||||
|
if (type === 'hash') {
|
||||||
|
router.push(path)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// key 对应的 linkConfig.js 外部链接配置
|
||||||
|
let configObj = outLink().getBaseData()
|
||||||
|
let fullPath = configObj.fullPath + path
|
||||||
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
|
||||||
|
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||||
|
if (name == '教材分析' || name == '考试分析') {
|
||||||
|
fullPath += `?unitId=${unitId}`
|
||||||
|
}
|
||||||
|
// 通知主进程
|
||||||
|
ipcRenderer.send('openWindow', {
|
||||||
|
key: path,
|
||||||
|
fullPath: fullPath,
|
||||||
|
cookieData: { ...configObj.data }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const activeId = ref('/home')
|
const activeId = ref('/home')
|
||||||
const headerMenus = [
|
const headerMenus = [
|
||||||
{
|
{
|
||||||
name: '工作台',
|
name: '工作台',
|
||||||
id: 1,
|
id: 1,
|
||||||
icon: '#icon-gongzuotai_xuanzhong',
|
icon: 'icon-gongzuotai',
|
||||||
path: '/home'
|
path: '/home'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '研究室',
|
name: '研究室',
|
||||||
id: 2,
|
id: 2,
|
||||||
icon: '#icon-yanjiushi-2',
|
icon: 'icon-yanjiushi',
|
||||||
disabled: true
|
disabled: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '资源库',
|
name: '资源库',
|
||||||
id: 3,
|
id: 3,
|
||||||
icon: '#icon-ziyuanku',
|
icon: 'icon-saoyisao',
|
||||||
path: '/resource'
|
path: '/resource'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '朋友圈',
|
name: '朋友圈',
|
||||||
id: 4,
|
id: 4,
|
||||||
icon: '#icon-iconfontzhizuobiaozhunbduan3-1',
|
icon: 'icon-pengyouquan1',
|
||||||
disabled: true
|
disabled: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -180,15 +199,8 @@ function setLayout() {
|
||||||
}
|
}
|
||||||
// 切换学科
|
// 切换学科
|
||||||
const changeSubject = async (command) =>{
|
const changeSubject = async (command) =>{
|
||||||
let sessionSubject = {
|
clearBookInfo()
|
||||||
bookList: null,
|
const { userId, userName, phonenumber, plainpwd } = userStore.user
|
||||||
curBook: null,
|
|
||||||
curNode: null,
|
|
||||||
defaultExpandedKeys: [],
|
|
||||||
subjectTree: []
|
|
||||||
}
|
|
||||||
sessionStore.set( 'subject', sessionSubject)
|
|
||||||
const { userId, userName, plainpwd } = userStore.user
|
|
||||||
const data = {
|
const data = {
|
||||||
userId,
|
userId,
|
||||||
userName,
|
userName,
|
||||||
|
@ -196,7 +208,7 @@ const changeSubject = async (command) =>{
|
||||||
edusubject: command.edusubject
|
edusubject: command.edusubject
|
||||||
}
|
}
|
||||||
await updateUserInfo(data)
|
await updateUserInfo(data)
|
||||||
await userStore.login({username: userName, password: plainpwd})
|
await userStore.login({username: phonenumber, password: plainpwd})
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
router.go()
|
router.go()
|
||||||
}
|
}
|
||||||
|
@ -252,19 +264,10 @@ onMounted(() => {
|
||||||
li {
|
li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-radius: 5px;
|
border-radius: 8px;
|
||||||
padding: 5px 8px;
|
margin: 0 10px;
|
||||||
height: 60px;
|
|
||||||
align-items: center;
|
|
||||||
.icon-box{
|
|
||||||
width: 100%;
|
|
||||||
height: 35px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.text {
|
.text {
|
||||||
margin-top: 3px;
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
@ -273,9 +276,24 @@ onMounted(() => {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-resource {
|
||||||
|
color: #f99b53;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-homepage {
|
||||||
|
color: #0a84ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-prepare {
|
||||||
|
color: #b088e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-teach {
|
||||||
|
color: #367dea;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
background-color: #fff
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,13 +303,11 @@ onMounted(() => {
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
background: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.active-li {
|
.active-li {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
background-color: #fff
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,7 @@ const goBack = () =>{
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.el-container {
|
.el-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
// background: url(@/assets/images/login/login-bg.png) no-repeat center;
|
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-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,13 +54,7 @@ export const constantRoutes = [
|
||||||
path: '/standardanalysis',
|
path: '/standardanalysis',
|
||||||
component: () => import('@/views/teach/standardAnalysis/index.vue'),
|
component: () => import('@/views/teach/standardAnalysis/index.vue'),
|
||||||
name: 'standardanalysis',
|
name: 'standardanalysis',
|
||||||
meta: {title: '课标分析'}
|
meta: {title: '课标分析'},
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/textbookAnalysis',
|
|
||||||
component: () => import('@/views/textbookAnalysis/index.vue'),
|
|
||||||
name: 'textbookAnalysis',
|
|
||||||
meta: {title: '教材分析'}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/profile',
|
path: '/profile',
|
||||||
|
|
|
@ -6,9 +6,6 @@ import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
// 默认数据
|
// 默认数据
|
||||||
const defData = sessionStore.store || {}
|
const defData = sessionStore.store || {}
|
||||||
const exArrs = ['subject']
|
|
||||||
exArrs.forEach(k => Object.keys(defData).includes(k) && (delete defData[k]))
|
|
||||||
|
|
||||||
// 延时
|
// 延时
|
||||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
|
||||||
|
@ -19,6 +16,7 @@ export const useToolState = defineStore('tool', {
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
|
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
},
|
||||||
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
||||||
|
|
|
@ -49,18 +49,6 @@ export const getStaticUrl = (url = '', type = 'app', exitPath = '', isFile = fal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getAppInstallUrl = (url = '', type = 'app', exitPath = '', isFile = false) => {
|
|
||||||
if (isDev) return url
|
|
||||||
else { // 生产环境获取-url
|
|
||||||
switch(type) {
|
|
||||||
case 'app': return path.join(__dirname, url) // 应用目录
|
|
||||||
case 'user': return (isFile?'file://':'')+path.join(Remote.app.getAppPath(),exitPath, url) // 用户目录
|
|
||||||
// case 'user': return (isFile?'file://':'')+path.join(Remote.app.getPath('userData'),exitPath, url) // 用户目录
|
|
||||||
default: return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @description 消息发送-nodejs 消息发送
|
* @description 消息发送-nodejs 消息发送
|
||||||
* @form src/main/tool.js 来源
|
* @form src/main/tool.js 来源
|
||||||
|
@ -149,7 +137,7 @@ export const createWindow = async (type, data) => {
|
||||||
winPdf.focus();
|
winPdf.focus();
|
||||||
// toolState.isPdfWin=true
|
// toolState.isPdfWin=true
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const option = data.option||{}
|
const option = data.option||{}
|
||||||
|
@ -284,7 +272,7 @@ const eventHandles = (type, win) => {
|
||||||
winPdf=null
|
winPdf=null
|
||||||
win&&win.destroy()
|
win&&win.destroy()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听窗口的激活事件
|
// 监听窗口的激活事件
|
||||||
win.on('focus', async () => {
|
win.on('focus', async () => {
|
||||||
console.log('激活窗口')
|
console.log('激活窗口')
|
||||||
|
@ -311,8 +299,8 @@ const eventHandles = (type, win) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 外部跳转-web网页
|
* @description 外部跳转-web网页
|
||||||
* @param {*} path
|
* @param {*} path
|
||||||
* @param {*} params
|
* @param {*} params
|
||||||
*/
|
*/
|
||||||
export const toLinkWeb = (path) => {
|
export const toLinkWeb = (path) => {
|
||||||
const config = baseConfig()
|
const config = baseConfig()
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
||||||
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
|
import { listByDeadDate, listClassworkdataByDeadDate } from '@/api/classTask'
|
||||||
|
|
||||||
import TaskItem from '@/views/classTask/container/task-item.vue'
|
import TaskItem from '@/views/classTask/container/task-item.vue'
|
||||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
|
@ -109,13 +109,13 @@ const changeEndDate = (val) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getData = async () => {
|
const getData = () => {
|
||||||
classWorkList.value = []
|
classWorkList.value = []
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// 1、班级列表
|
// 1、班级列表
|
||||||
getClassList()
|
getClassList()
|
||||||
// 2、班级作业
|
// 2、班级作业
|
||||||
await getClassWorkList()
|
getClassWorkList()
|
||||||
// 3、班级学生作业 包含多个班级
|
// 3、班级学生作业 包含多个班级
|
||||||
getStudentClassWorkData()
|
getStudentClassWorkData()
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
@ -133,76 +133,76 @@ const getClassList = () => {
|
||||||
/**
|
/**
|
||||||
* 2、获取班级作业
|
* 2、获取班级作业
|
||||||
*/
|
*/
|
||||||
const getClassWorkList = async () => {
|
const getClassWorkList = () => {
|
||||||
if(classTaskStore.classListIds.length>0){
|
if(classTaskStore.classListIds.length>0){
|
||||||
// 班级作业数据,包含多个班级 homeworklist
|
// 班级作业数据,包含多个班级 homeworklist
|
||||||
const response = await listByDeadDate({
|
listByDeadDate({
|
||||||
classidarray: classTaskStore.classListIds.join(','),
|
classidarray: classTaskStore.classListIds.join(','),
|
||||||
edituserid: userStore.userId, // 老师的id
|
edustage: userStore.edustage,// 学段
|
||||||
edustage: userStore.edustage, // 学段
|
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||||
orderby: 'deaddate DESC',
|
orderby: 'uniquekey DESC',
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
|
}).then((response) => {
|
||||||
|
for (var i = 0; i < response.rows.length; i++) {
|
||||||
|
// 初始化部分新增字段值
|
||||||
|
response.rows[i].workdatalist = []
|
||||||
|
response.rows[i].workdatacount = 0 // 人数
|
||||||
|
response.rows[i].workdatalistVisible = false
|
||||||
|
response.rows[i].workdatafeedbackcount = 0 // 已交人数
|
||||||
|
response.rows[i].feedtimelength = 0
|
||||||
|
response.rows[i].rightAnswerCount = 0
|
||||||
|
response.rows[i].scoingRate = 0 + '%' // 得分率
|
||||||
|
response.rows[i].averagetime = 0 // 平均用时
|
||||||
|
|
||||||
|
// ----------------------------------------------
|
||||||
|
// 处理任务类型的UI
|
||||||
|
if (response.rows[i].worktype == '学习目标定位') {
|
||||||
|
response.rows[i].workclass = 'success'
|
||||||
|
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
|
||||||
|
} else if (response.rows[i].worktype == '教材研读') {
|
||||||
|
response.rows[i].workclass = 'primary'
|
||||||
|
} else if (response.rows[i].worktype == '框架梳理') {
|
||||||
|
response.rows[i].workclass = 'warning'
|
||||||
|
} else if (response.rows[i].worktype == '学科定位') {
|
||||||
|
response.rows[i].workclass = 'info'
|
||||||
|
} else if (response.rows[i].worktype == '习题训练') {
|
||||||
|
response.rows[i].workclass = 'danger'
|
||||||
|
} else {
|
||||||
|
response.rows[i].workclass = ''
|
||||||
|
}
|
||||||
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
if (response.rows[i].entpcourseworklist != '') {
|
||||||
|
response.rows[i].entpcourseworklistarray = JSON.parse(
|
||||||
|
'[' + response.rows[i].entpcourseworklist + ']'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
response.rows[i].entpcourseworklistarray = []
|
||||||
|
}
|
||||||
|
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||||
|
if (
|
||||||
|
response.rows[i].classworkdatastudentids != '' &&
|
||||||
|
response.rows[i].classworkdatastudentids != null &&
|
||||||
|
response.rows[i].classworkdatastudentids != 'null'
|
||||||
|
) {
|
||||||
|
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
|
||||||
|
response.rows[i].workdatacount = stuList.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示分配人数(workdatacount)>0 的
|
||||||
|
if (response.rows && response.rows.length > 0) {
|
||||||
|
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
||||||
|
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||||
|
total.value = response.total
|
||||||
|
}else{
|
||||||
|
classWorkList.value = []
|
||||||
|
total.value = 0
|
||||||
|
}
|
||||||
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
|
||||||
for (var i = 0; i < response.rows.length; i++) {
|
|
||||||
// 初始化部分新增字段值
|
|
||||||
response.rows[i].workdatalist = []
|
|
||||||
response.rows[i].workdatacount = 0 // 人数
|
|
||||||
response.rows[i].workdatalistVisible = false
|
|
||||||
response.rows[i].workdatafeedbackcount = 0 // 已交人数
|
|
||||||
response.rows[i].feedtimelength = 0
|
|
||||||
response.rows[i].rightAnswerCount = 0
|
|
||||||
response.rows[i].scoingRate = 0 + '%' // 得分率
|
|
||||||
response.rows[i].averagetime = 0 // 平均用时
|
|
||||||
|
|
||||||
// ----------------------------------------------
|
|
||||||
// 处理任务类型的UI
|
|
||||||
if (response.rows[i].worktype == '学习目标定位') {
|
|
||||||
response.rows[i].workclass = 'success'
|
|
||||||
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
|
|
||||||
} else if (response.rows[i].worktype == '教材研读') {
|
|
||||||
response.rows[i].workclass = 'primary'
|
|
||||||
} else if (response.rows[i].worktype == '框架梳理') {
|
|
||||||
response.rows[i].workclass = 'warning'
|
|
||||||
} else if (response.rows[i].worktype == '学科定位') {
|
|
||||||
response.rows[i].workclass = 'info'
|
|
||||||
} else if (response.rows[i].worktype == '习题训练') {
|
|
||||||
response.rows[i].workclass = 'danger'
|
|
||||||
} else {
|
|
||||||
response.rows[i].workclass = ''
|
|
||||||
}
|
|
||||||
// 如果是习题训练任务,则检查一共有多少道
|
|
||||||
if (response.rows[i].entpcourseworklist != '') {
|
|
||||||
response.rows[i].entpcourseworklistarray = JSON.parse(
|
|
||||||
'[' + response.rows[i].entpcourseworklist + ']'
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
response.rows[i].entpcourseworklistarray = []
|
|
||||||
}
|
|
||||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
|
||||||
if (
|
|
||||||
response.rows[i].classworkdatastudentids != '' &&
|
|
||||||
response.rows[i].classworkdatastudentids != null &&
|
|
||||||
response.rows[i].classworkdatastudentids != 'null'
|
|
||||||
) {
|
|
||||||
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
|
|
||||||
response.rows[i].workdatacount = stuList.length
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 显示分配人数(workdatacount)>0 的
|
|
||||||
if (response.rows && response.rows.length > 0) {
|
|
||||||
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
|
|
||||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
|
||||||
total.value = response.total
|
|
||||||
}else{
|
|
||||||
classWorkList.value = []
|
|
||||||
total.value = 0
|
|
||||||
}
|
|
||||||
loading.value = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,19 +211,14 @@ const getClassWorkList = async () => {
|
||||||
*/
|
*/
|
||||||
const getStudentClassWorkData = () => {
|
const getStudentClassWorkData = () => {
|
||||||
if(classTaskStore.classListIds.length>0){
|
if(classTaskStore.classListIds.length>0){
|
||||||
// listClassworkdataByDeadDate({
|
listClassworkdataByDeadDate({
|
||||||
// edituserid: userStore.userId, // 老师的id
|
classids: classTaskStore.classListIds.join(','),
|
||||||
// classids: classTaskStore.classListIds.join(','),
|
edustage: userStore.edustage,// 学段
|
||||||
// edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
// //status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: "deaddate DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
orderby: "uniquekey DESC",// TODO: 这里是否加 deaddate 的排序,后续看
|
||||||
// pageSize: 1000,
|
pageSize: 1000
|
||||||
// })
|
|
||||||
const ids = classWorkList.value.map((item) => item.id).join(',');
|
|
||||||
listClassworkdata({
|
|
||||||
classworkids: ids,
|
|
||||||
pageSize: 1000,
|
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
for (var t = 0; t < classWorkList.value.length; t++) {
|
for (var t = 0; t < classWorkList.value.length; t++) {
|
||||||
for (var i = 0; i < res.rows.length; i++) {
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
@ -290,10 +285,10 @@ const getStudentClassWorkData = () => {
|
||||||
|
|
||||||
// 以下四个参数,都要计算
|
// 以下四个参数,都要计算
|
||||||
// 2024-04-12,酉阳,by jackyshen
|
// 2024-04-12,酉阳,by jackyshen
|
||||||
|
|
||||||
// 计算参与学习任务的平均用时
|
// 计算参与学习任务的平均用时
|
||||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||||
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
||||||
} else {
|
} else {
|
||||||
classWorkList.value[t].averagetime = 0
|
classWorkList.value[t].averagetime = 0
|
||||||
}
|
}
|
||||||
|
@ -375,13 +370,12 @@ const getStudentVisible = async () => {
|
||||||
// 班级作业数据,多个班级
|
// 班级作业数据,多个班级
|
||||||
const response = await listByDeadDate({
|
const response = await listByDeadDate({
|
||||||
classidarray: classTaskStore.classListIds.join(','),
|
classidarray: classTaskStore.classListIds.join(','),
|
||||||
edituserid: userStore.userId, // 老师的id
|
|
||||||
edustage: userStore.edustage,// 学段
|
edustage: userStore.edustage,// 学段
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||||
orderby: 'deaddate DESC',
|
orderby: 'uniquekey DESC',
|
||||||
pageSize: 100
|
pageSize: 100
|
||||||
})
|
})
|
||||||
const curWorkList = response.rows
|
const curWorkList = response.rows
|
||||||
|
@ -406,7 +400,7 @@ const getStudentVisible = async () => {
|
||||||
)
|
)
|
||||||
// 计算参与学习任务的平均用时
|
// 计算参与学习任务的平均用时
|
||||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||||
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
|
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
|
||||||
} else {
|
} else {
|
||||||
classWorkList.value[t].averagetime = 0
|
classWorkList.value[t].averagetime = 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
<!-- <el-button type="primary" icon="Postcard" @click="handleNewClassWorkDialog" style="margin-left: 20px; margin-top: 10px">{{initDataProps.queryType!=='single'?'设计新作业':'设计新活动'}}</el-button>
|
<!-- <el-button type="primary" icon="Postcard" @click="handleNewClassWorkDialog" style="margin-left: 20px; margin-top: 10px">{{initDataProps.queryType!=='single'?'设计新作业':'设计新活动'}}</el-button>
|
||||||
<el-button v-if="initDataProps.queryType!=='single'" type="success" icon="Promotion" @click="handleTaskAssignToAllClass()" style="margin-left: 20px; margin-top: 10px">一键推送</el-button>
|
<el-button v-if="initDataProps.queryType!=='single'" type="success" icon="Promotion" @click="handleTaskAssignToAllClass()" style="margin-left: 20px; margin-top: 10px">一键推送</el-button>
|
||||||
<el-button type="danger" icon="delete" @click="handleDelete" style="margin-left: 20px; margin-top: 10px">删除</el-button> -->
|
<el-button type="danger" icon="delete" @click="handleDelete" style="margin-left: 20px; margin-top: 10px">删除</el-button> -->
|
||||||
<el-button type="primary" style="margin-left: 20px; margin-top: 10px" @click="handleNewClassWorkDialog">设计新作业</el-button>
|
<el-button type="primary" @click="handleNewClassWorkDialog" style="margin-left: 20px; margin-top: 10px">设计新作业</el-button>
|
||||||
<el-button type="success" style="margin-left: 20px; margin-top: 10px" @click="handleTaskAssignToAllClass()">一键推送</el-button>
|
<el-button type="success" @click="handleTaskAssignToAllClass()" style="margin-left: 20px; margin-top: 10px">一键推送</el-button>
|
||||||
<el-button type="danger" style="margin-left: 20px; margin-top: 10px" @click="handleDelete">删除</el-button>
|
<el-button type="danger" @click="handleDelete" style="margin-left: 20px; margin-top: 10px">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -71,14 +71,14 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div style="border: 1px solid #ccc; width: 100%; height: auto; display: flex; justify-content: space-between; padding-left: 10px">
|
<div style="border: 1px solid #ccc; width: 100%; height: auto; display: flex; justify-content: space-between; padding-left: 10px">
|
||||||
<div style="display: flex; margin-top: 5px">
|
<div style="display: flex; margin-top: 5px">
|
||||||
<div class="singe-line" style="max-width: 200px" v-html="scope.row.title"></div>
|
<div v-html="scope.row.title" style="max-width: 200px" class="singe-line"></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="scope.row.status == '10'">
|
<div v-if="scope.row.status == '10'">
|
||||||
<el-button v-hasPermi="['teaching:classwork:edit']" text @click="handleWorkTitleEdit(scope.row, scope.$index)">编辑</el-button>
|
<el-button text @click="handleWorkTitleEdit(scope.row, scope.$index)" v-hasPermi="['teaching:classwork:edit']">编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-button v-hasPermi="['teaching:classwork:edit']" text @click="handleWorkTitleEdit(scope.row, scope.$index)">查看详情</el-button>
|
<el-button text @click="handleWorkTitleEdit(scope.row, scope.$index)" v-hasPermi="['teaching:classwork:edit']">查看详情</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,19 +112,19 @@
|
||||||
<el-table-column label="题目内容" align="left" >
|
<el-table-column label="题目内容" align="left" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
<div style="overflow: hidden; text-overflow: ellipsis; font-weight:700" v-html="scope.row.titleFormat"></div>
|
<div v-html="scope.row.titleFormat" style="overflow: hidden; text-overflow: ellipsis; font-weight:700"></div>
|
||||||
<div style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
<div v-html="scope.row.workdescFormat" style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="分值" align="center" width="180">
|
<el-table-column label="分值" align="center" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input-number v-model="scope.row.score" :min="1" :max="100" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"></el-input-number >
|
<el-input-number v-model="scope.row.score" :min="1" :max="100" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)"></el-input-number >
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button :disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkConfigQuizMinus(scope.$index)">删除</el-button>
|
<el-button @click="handleWorkConfigQuizMinus(scope.$index)" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -133,9 +133,9 @@
|
||||||
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
|
<el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
|
||||||
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button>
|
@click="handleWorkEdit2ClassWorkQuizAdd" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">添加作业</el-button>
|
||||||
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
<el-button type="primary" style="margin-left: auto" @click="submitStudy('submit')"
|
||||||
@click="submitStudy('submit')">确 定</el-button>
|
:disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -143,10 +143,10 @@
|
||||||
|
|
||||||
<!-- 作业说明编辑 -->
|
<!-- 作业说明编辑 -->
|
||||||
<el-dialog v-model="currentWorkEdit.workTitleEdit" title="作业说明编辑" width="70%" append-to-body>
|
<el-dialog v-model="currentWorkEdit.workTitleEdit" title="作业说明编辑" width="70%" append-to-body>
|
||||||
<el-input v-model="currentWorkEdit.currentTitle" type="textarea" rows="5" placeholder="请输入作业说明" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"/>
|
<el-input v-model="currentTitle" type="textarea" rows="5" placeholder="请输入作业说明" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)"/>
|
||||||
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
||||||
<el-button type="primary" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
<el-button type="primary" @click="submitWorkTitle('submit')"
|
||||||
@click="submitWorkTitle('submit')">确 定</el-button>
|
:disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -154,12 +154,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
|
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
|
|
||||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||||
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
import { homeworklist, listEntpcoursework, listClassworkeval } from '@/api/teaching/classwork'
|
||||||
import { listEntpcoursework, listClassworkeval,updateClasswork } from '@/api/classTask'
|
|
||||||
|
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
import { processList } from '@/hooks/useProcessList'
|
import { processList } from '@/hooks/useProcessList'
|
||||||
|
@ -167,7 +164,6 @@ import { processList } from '@/hooks/useProcessList'
|
||||||
import { getCurrentTime } from '@/utils/date'
|
import { getCurrentTime } from '@/utils/date'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const { proxy } = getCurrentInstance()
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
initDataProps: {
|
initDataProps: {
|
||||||
|
@ -236,30 +232,6 @@ const getData = (data) => {
|
||||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除按钮操作 TODO 待完善
|
|
||||||
* */
|
|
||||||
const handleDelete =() => {
|
|
||||||
let rows = proxy.$refs.taskTable.getSelectionRows();
|
|
||||||
if (rows.length > 0) {
|
|
||||||
proxy.$modal.confirm('是否确认选中的学习任务?').then(()=> {
|
|
||||||
let ids = [];
|
|
||||||
for (let i = 0; i < rows.length; i++) {
|
|
||||||
ids.push(rows[i].id);
|
|
||||||
}
|
|
||||||
return delClasswork(ids.join(','));
|
|
||||||
}).then(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
getTaskList();
|
|
||||||
}, 1500);
|
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {})
|
|
||||||
}else{
|
|
||||||
proxy.$modal.alertWarning("请选择删除项")
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1.获取作业列表
|
* 1.获取作业列表
|
||||||
*/
|
*/
|
||||||
|
@ -450,54 +422,6 @@ const handleWorkEdit = (row, index) =>{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 作业内容编辑-确认
|
|
||||||
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(item.title == currentWorkEdit.currentTitle){
|
|
||||||
currentWorkEdit.workTitleEdit = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log('有更改!')
|
|
||||||
// 有修改时才进行更新
|
|
||||||
taskList.value[currentWorkEdit.currentIndex].title = currentWorkEdit.currentTitle;
|
|
||||||
updateClasswork({id: taskList.value[currentWorkEdit.currentIndex].id, title: currentWorkEdit.currentTitle}).then(response => {
|
|
||||||
ElMessage("修改成功");
|
|
||||||
currentWorkEdit.workTitleEdit = false;
|
|
||||||
//this.getClassWorkAllList();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 当前是否为已推送作业
|
|
||||||
const checkTaskAssigned = (row) => {
|
|
||||||
console.log(row,'checkTaskAssigned')
|
|
||||||
// 只要有一个taskconfig的id不为0,就是已推送过任务了
|
|
||||||
let bAssigned = false;
|
|
||||||
for (let i=0; i<row.taskconfig.length; i++) {
|
|
||||||
if (row.taskconfig[i].id != 0) {
|
|
||||||
bAssigned = true;
|
|
||||||
return bAssigned;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bAssigned;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格子项背景暗调
|
* 表格子项背景暗调
|
||||||
|
|
|
@ -234,7 +234,7 @@ const openDialog = (data) => {
|
||||||
classWorkAnalysis.activeQuizAnalysisData = []
|
classWorkAnalysis.activeQuizAnalysisData = []
|
||||||
|
|
||||||
classWorkAnalysis.row = data
|
classWorkAnalysis.row = data
|
||||||
// window.test = this
|
window.test = this
|
||||||
// zdg: 学生列表
|
// zdg: 学生列表
|
||||||
const studentArr = data.classworkdatastudentids
|
const studentArr = data.classworkdatastudentids
|
||||||
? JSON.parse(`[${data.classworkdatastudentids}]`)
|
? JSON.parse(`[${data.classworkdatastudentids}]`)
|
||||||
|
@ -539,10 +539,6 @@ const workHandle = (type) => {
|
||||||
classWorkAnalysis.view = type
|
classWorkAnalysis.view = type
|
||||||
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
||||||
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
||||||
// 每次进来都重新调用一次
|
|
||||||
if(type == 'quizStats') {
|
|
||||||
getWorkFeedList();
|
|
||||||
}
|
|
||||||
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
// 轮询 更新学生作答数据
|
// 轮询 更新学生作答数据
|
||||||
|
@ -651,15 +647,13 @@ defineExpose({
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style src="@/assets/styles/JYStyle.css"></style>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
/*:deep(.reserv-date-pick) {
|
// :deep(.reserv-date-pick) {
|
||||||
width: 140px;
|
// width: 140px;
|
||||||
}
|
// }
|
||||||
:deep(.reserv-time-pick) {
|
// :deep(.reserv-time-pick) {
|
||||||
width: 240px;
|
// width: 240px;
|
||||||
}*/
|
// }
|
||||||
.clwk_dialog {
|
.clwk_dialog {
|
||||||
.clwk_dialog_view {
|
.clwk_dialog_view {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -675,7 +669,7 @@ defineExpose({
|
||||||
.view_teachrting {
|
.view_teachrting {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
/*overflow-y: auto; */
|
// overflow-y: auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,7 @@
|
||||||
<div class="respond">
|
<div class="respond">
|
||||||
<div class="c-label">
|
<div class="c-label">
|
||||||
<b t1>作答情况</b>
|
<b t1>作答情况</b>
|
||||||
<template v-if="item.type=='单选题'||item.type == '多选题'||item.type == '判断题'">
|
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人)</span>
|
||||||
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人-</span>
|
|
||||||
<span>回答正确 <el-text type="danger">{{item.rightSum}}</el-text> 人)</span>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> 人)</span>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="c-childen">
|
<div class="c-childen">
|
||||||
<template v-for="(it, ind) in item.children">
|
<template v-for="(it, ind) in item.children">
|
||||||
|
@ -117,14 +111,6 @@ colorArr = [
|
||||||
onMounted(() => {})
|
onMounted(() => {})
|
||||||
|
|
||||||
// === 方法(methods) ===
|
// === 方法(methods) ===
|
||||||
|
|
||||||
const isSame = (a,b) => {
|
|
||||||
if (a.length != b.length) return false
|
|
||||||
return !a.some(v => !b.includes(v))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 初始-数据处理
|
|
||||||
// 初始-数据处理
|
// 初始-数据处理
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
// console.log('xxx', props)
|
// console.log('xxx', props)
|
||||||
|
@ -138,128 +124,43 @@ const initData = () => {
|
||||||
const workdesc = o.workdesc || ''
|
const workdesc = o.workdesc || ''
|
||||||
let accSum = 0 // 该题总人数
|
let accSum = 0 // 该题总人数
|
||||||
let activeIds = [] // 已做答学生
|
let activeIds = [] // 已做答学生
|
||||||
let rightIds = [] // 正确学生
|
|
||||||
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) // 做该题的列表
|
||||||
let children = []
|
let children = []
|
||||||
const allStudents = [];
|
if (['单选题','多选题'].includes(o.worktype)) { // '单选题','多选题'
|
||||||
if (o.worktype == '单选题') { // '单选题','多选题'
|
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[]
|
||||||
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
|
|
||||||
children = list.map((v,i) => {
|
|
||||||
const code = toCode(i) // 转换 A-Z
|
|
||||||
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
|
||||||
// 改选项的学生id
|
|
||||||
const studentIds = quizFeedList.filter(f => f.feedcontent==v&&f.finishtimelength!='0').map(f => f.studentid)||[];
|
|
||||||
accSum += studentIds.length;
|
|
||||||
if (isOk) {
|
|
||||||
activeIds.push(...studentIds)
|
|
||||||
}
|
|
||||||
return { def: v, code, isOk, studentIds }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else if (o.worktype == '多选题') {
|
|
||||||
// 多选题的正确率单独处理
|
|
||||||
rightIds = quizFeedList.filter(f => {
|
|
||||||
const workanswer = (isJson(o.workanswer)) ? JSON.parse(o.workanswer) : o.workanswer || [];
|
|
||||||
const res = isSame((f.feedcontent||'').split(','), workanswer);
|
|
||||||
return f.entpcourseworkid == o.id && f.finishtimelength!='0' && res;
|
|
||||||
});
|
|
||||||
|
|
||||||
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
|
|
||||||
children = list.map((v,i) => {
|
children = list.map((v,i) => {
|
||||||
const isOne = o.worktype == '单选题'
|
const isOne = o.worktype == '单选题'
|
||||||
const code = toCode(i) // 转换 A-Z
|
const code = toCode(i) // 转换 A-Z
|
||||||
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // 是否(包含)正确答案
|
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // 是否(包含)正确答案
|
||||||
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // 是否(包含)正确答案
|
||||||
// 改选项的学生id
|
// 改选项的学生id
|
||||||
const studentIds = quizFeedList.filter(f => f.feedcontent.includes(i)&&f.finishtimelength!='0').map(f => f.studentid)||[];
|
const studentIds = quizFeedList.filter(f => isOne ? f.feedcontent==v : f.feedcontent.includes(i)).map(f => f.studentid)||[]
|
||||||
accSum += studentIds.length;
|
accSum += studentIds.length
|
||||||
if (studentIds.length>0) {
|
if(isOk) isOne ? activeIds.push(...studentIds) : activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
allStudents.push(...studentIds);
|
|
||||||
}
|
|
||||||
if(isOk) {
|
|
||||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
|
||||||
}
|
|
||||||
return { def: v, code, isOk, studentIds }
|
return { def: v, code, isOk, studentIds }
|
||||||
})
|
})
|
||||||
}
|
} else if (o.worktype == '填空题') { // 填空题
|
||||||
else if (o.worktype == '填空题') { // 填空题
|
|
||||||
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||||
children = (o.title||'').match(regex).map((v,i) => {
|
children = (o.title||'').match(regex).map((v,i) => {
|
||||||
const def = `填空项 ${i+1}`
|
const def = `填空项 ${i+1}`
|
||||||
//const code = '( )'
|
const code = '( )', txt=v
|
||||||
const code = '(略)', txt=v
|
|
||||||
// 改选项的学生id
|
// 改选项的学生id
|
||||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i] && f.finishtimelength!='0').map(f => f.studentid)||[]
|
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i]).map(f => f.studentid)||[]
|
||||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
accSum = activeIds.length
|
accSum = activeIds.length
|
||||||
return { def, code, txt, isOk:true, studentIds }
|
return { def, code, txt, isOk:true, studentIds }
|
||||||
})
|
})
|
||||||
} else if (o.worktype == '判断题') { // 判断题
|
} else if (o.worktype == '论述题') { // 论述题
|
||||||
const list = ['正确', '错误'];
|
const code = '( )', def = '论述内容'
|
||||||
children = list.map((v,i) => {
|
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')).map(f => f.studentid)||[]
|
||||||
const workanswer = o.workanswer
|
|
||||||
.replace('×', '0')
|
|
||||||
.replace('√', '1')
|
|
||||||
.replace('错误', '0')
|
|
||||||
.replace('正确', '1')
|
|
||||||
.replace('正确。', '1')
|
|
||||||
.replace('F', '0')
|
|
||||||
.replace('T', '1')
|
|
||||||
.replace('错', '0')
|
|
||||||
.replace('对', '1');
|
|
||||||
const workanswerFormat = isJson(workanswer) ? JSON.parse(workanswer) : workanswer||''
|
|
||||||
const code = v=='正确' ? '1' : '0'
|
|
||||||
let isOk = (workanswerFormat).includes(code)
|
|
||||||
// warn: 看是否需要转为回答正常的显示, 当前为学生实际回答字面的正确和错误
|
|
||||||
// if (workanswerFormat == '0') {
|
|
||||||
// isOk = !isOk;
|
|
||||||
// }
|
|
||||||
// 改选项的学生id
|
|
||||||
const studentIds = quizFeedList.filter(f => {
|
|
||||||
const feedcontent = f.feedcontent
|
|
||||||
.replace('×', '0')
|
|
||||||
.replace('√', '1')
|
|
||||||
.replace('错误', '0')
|
|
||||||
.replace('正确', '1')
|
|
||||||
.replace('正确。', '1')
|
|
||||||
.replace('F', '0')
|
|
||||||
.replace('T', '1')
|
|
||||||
.replace('错', '0')
|
|
||||||
.replace('对', '1');
|
|
||||||
if(feedcontent == code&&f.finishtimelength!='0'){
|
|
||||||
return f
|
|
||||||
}
|
|
||||||
}).map(f => f.studentid)||[];
|
|
||||||
accSum += studentIds.length;
|
|
||||||
if(isOk) activeIds.push(...studentIds)
|
|
||||||
return { def: v, code: v, isOk, studentIds }
|
|
||||||
})
|
|
||||||
} else { // 论述题
|
|
||||||
// code = '( )'
|
|
||||||
const code = '(略)', def = '解答内容'
|
|
||||||
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')&&f.finishtimelength!='0').map(f => f.studentid)||[]
|
|
||||||
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
activeIds=[...new Set(activeIds.concat(studentIds))] // 多选去重
|
||||||
accSum = activeIds.length
|
accSum = activeIds.length
|
||||||
children = [{ def, code, isOk:true, studentIds }]
|
children = [{ def, code, isOk:true, studentIds }]
|
||||||
}
|
}
|
||||||
|
|
||||||
const studentSum = studentList.value.length || 0 // 当前推送答题人数
|
const studentSum = studentList.value.length || 0 // 当前推送答题人数
|
||||||
let points = percent((activeIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
const points = percent((activeIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
||||||
let rightSum = activeIds.length; // 回答正确人数
|
|
||||||
|
|
||||||
// 多选题单独处理
|
|
||||||
if (o.worktype == '多选题') {
|
|
||||||
// 单独重新处理人数问题
|
|
||||||
const uniqueTmpStuents = [...new Set(allStudents)];
|
|
||||||
accSum = uniqueTmpStuents.length;
|
|
||||||
// 单独处理得分率
|
|
||||||
points = percent((rightIds.length / (studentSum||1)).toFixed(2)) // 计算得分率
|
|
||||||
// 回答正确人数
|
|
||||||
rightSum = rightIds.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
// def: 原始题数据 type 类型 active: 选中 points: 得分率, accSum 题解答人数
|
||||||
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children }
|
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, children }
|
||||||
})
|
})
|
||||||
console.log('获取数据: ', data)
|
console.log('获取数据: ', data)
|
||||||
dataList.value = data
|
dataList.value = data
|
||||||
|
@ -269,7 +170,7 @@ const ratio_1 = (row, sum = 1) => percent(((row.studentIds.length||0) / (sum||1)
|
||||||
// 获取-该题-完成进度
|
// 获取-该题-完成进度
|
||||||
const ratio_2 = row => percent(((row.accSum||0) / (studentList.value.length||1)).toFixed(2))
|
const ratio_2 = row => percent(((row.accSum||0) / (studentList.value.length||1)).toFixed(2))
|
||||||
// 获取-该题进度-txt
|
// 获取-该题进度-txt
|
||||||
const getRatioTxt = row => ['单选题', '多选题', '判断题'].includes(row.type) ? '得分率' : '完成度'
|
const getRatioTxt = row => row.type.includes('选题') ? '得分率' : '完成度'
|
||||||
// 获取-进度条状态-左侧
|
// 获取-进度条状态-左侧
|
||||||
const getStatus = row => row.isOk ? 'success' : 'exception'
|
const getStatus = row => row.isOk ? 'success' : 'exception'
|
||||||
// 获取-学生姓名(id)
|
// 获取-学生姓名(id)
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<div class="class-reserv-item-tool">
|
<div class="class-reserv-item-tool">
|
||||||
<span>
|
<span>
|
||||||
<!-- {{ item.averagetime?item.averagetime:0 }} -->
|
<!-- {{ item.averagetime?item.averagetime:0 }} -->
|
||||||
<!-- <span v-if=" item.averagetime<60 ">
|
<span v-if=" item.averagetime<60 ">
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||||
</span>
|
</span>
|
||||||
<span v-if=" item.averagetime==60 ">
|
<span v-if=" item.averagetime==60 ">
|
||||||
|
@ -39,8 +39,7 @@
|
||||||
<span v-if=" item.averagetime>60 ">
|
<span v-if=" item.averagetime>60 ">
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
|
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
|
||||||
</span> -->
|
</span>
|
||||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
|
||||||
</span>
|
</span>
|
||||||
<span>平均用时</span>
|
<span>平均用时</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,15 +34,30 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import { getSelfReserv } from '@/api/classManage'
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||||
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
|
|
||||||
|
const type = ref(-1)
|
||||||
const user = useUserStore().user
|
const user = useUserStore().user
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const classList = ref([])
|
||||||
const homeworkList = ref([])
|
const homeworkList = ref([])
|
||||||
const itemDialogRef = ref(null)
|
const itemDialogRef = ref(null)
|
||||||
|
|
||||||
|
// 获取上课
|
||||||
|
const getClass = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await getSelfReserv()
|
||||||
|
let list = res.data || []
|
||||||
|
list.sort((a, b) => { if (a.status == '上课中') return -1; else return 0 })
|
||||||
|
classList.value = list.filter(item => item.status !== '已结束')
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
// 获取作业
|
// 获取作业
|
||||||
const getHomework = async () => {
|
const getHomework = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
@ -50,8 +65,7 @@ const getHomework = async () => {
|
||||||
try {
|
try {
|
||||||
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
|
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
|
||||||
// 只展示进行中的
|
// 只展示进行中的
|
||||||
// homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
|
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
|
||||||
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getTomorrow() <= item.deaddate) //大于今天的才算进行中
|
|
||||||
homeworkList.value.forEach((item) => {
|
homeworkList.value.forEach((item) => {
|
||||||
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
||||||
// 如果是习题训练任务,则检查一共有多少道
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
@ -84,16 +98,16 @@ const tagType = (time) => {
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// getClass()
|
||||||
getHomework()
|
getHomework()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.desktop-work-item {
|
.desktop-work-item {
|
||||||
width: 100%;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.item-title {
|
.item-title {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -112,7 +126,7 @@ onMounted(() => {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
flex: 1;
|
height: calc(100% - 60px);
|
||||||
|
|
||||||
.class-item {
|
.class-item {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
|
@ -1,49 +1,40 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page-desktop">
|
<div class="page-desktop">
|
||||||
<el-row :gutter="20" style="height: 100%;">
|
<el-row :gutter="20">
|
||||||
<el-col :span="17" class="desktop-left">
|
<el-col :span="17">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
|
||||||
<div class="desktop-item">
|
<div class="desktop-item">
|
||||||
<div class="item-title">{{ item.name }}</div>
|
<div class="item-title">{{ item.name }}</div>
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
<ul class="flex con-ul">
|
<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' : ''">
|
<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">
|
<i class="iconfont" :class="menu.icon"></i>
|
||||||
<template v-if="menu.disabled">
|
<span>{{ menu.name }}</span>
|
||||||
<i class="iconfont" :class="menu.icon"></i>
|
</li>
|
||||||
</template>
|
</ul>
|
||||||
<template v-else>
|
|
||||||
<svg class="icon iconfont icon-svg" aria-hidden="true">
|
|
||||||
<use :xlink:href="menu.icon"></use>
|
|
||||||
</svg>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<span>{{ menu.name }}</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-row style="height: 100%;">
|
</el-row>
|
||||||
<el-col :span="24">
|
<el-row>
|
||||||
<div class="desktop-item-chart">
|
<el-col :span="24">
|
||||||
<div class="item-title flex">
|
<div class="desktop-item">
|
||||||
<span>教学进度</span>
|
<div class="item-title flex">
|
||||||
</div>
|
<span>教学进度</span>
|
||||||
<div class="item-content">
|
|
||||||
<div ref="chartDom" class="chart-box"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="item-content">
|
||||||
</el-row>
|
<div ref="chartDom" class="chart-box"></div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col :span="7" style="flex: 1;">
|
</div>
|
||||||
<!--工作动态-->
|
</el-col>
|
||||||
<workTrend/>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="7">
|
||||||
|
<!--工作动态-->
|
||||||
|
<workTrend/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -51,12 +42,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick } from 'vue'
|
import { ref, onMounted, nextTick } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import workTrend from './container/work-trend.vue'
|
import workTrend from './container/work-trend.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import * as echarts from 'echarts'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { useGetClassWork } from '@/hooks/useGetClassWork'
|
||||||
import { debounce } from 'lodash'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
@ -69,19 +58,20 @@ const menuList = [{
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: '课标分析',
|
name: '课标分析',
|
||||||
icon: '#icon-kebiao',
|
icon: 'icon-kecheng',
|
||||||
path: '/standardanalysis?',
|
path: '/standardanalysis?',
|
||||||
id: '1-1'
|
id: '1-1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教材分析',
|
name: '教材分析',
|
||||||
icon: '#icon-jiaocaixuanze',
|
icon: 'icon-jiaocaixuanze',
|
||||||
path: '/textbookAnalysis',
|
isOuter: true,
|
||||||
|
path: '/teaching/chatwithtextbook',
|
||||||
id: '1-2'
|
id: '1-2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '考试分析',
|
name: '考试分析',
|
||||||
icon: '#icon-kaoshi',
|
icon: 'icon-kaoshi',
|
||||||
path: '/examReport',
|
path: '/examReport',
|
||||||
id: '1-3'
|
id: '1-3'
|
||||||
},
|
},
|
||||||
|
@ -93,13 +83,13 @@ const menuList = [{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教学实践',
|
name: '教学实践',
|
||||||
icon: '#icon-jiaoxueshijian',
|
icon: 'icon-jiaoxuefenxi',
|
||||||
path: '/prepare',
|
path: '/prepare',
|
||||||
id: '1-5'
|
id: '1-5'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教学反思',
|
name: '教学反思',
|
||||||
icon: 'icon-a-1_jiaoxuefansi',
|
icon: 'icon-jiaoxuefansi',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
id: '1-6'
|
id: '1-6'
|
||||||
},
|
},
|
||||||
|
@ -112,23 +102,26 @@ const menuList = [{
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: '作业设计',
|
name: '作业设计',
|
||||||
icon: '#icon-zuoyesheji',
|
icon: 'icon-jiaoxuefansi',
|
||||||
isOuter: true,
|
isOuter: true,
|
||||||
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
|
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
|
||||||
// path: '/newClassTask',
|
// path: '/newClassTask'
|
||||||
|
//path: '/classTaskAssign'
|
||||||
|
//isOuter: true,
|
||||||
|
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||||
id: '2-1'
|
id: '2-1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '作业布置',
|
name: '作业布置',
|
||||||
icon: '#icon-zuoyebuzhi',
|
icon: 'icon-xiezuo1',
|
||||||
isOuter: true,
|
isOuter: true,
|
||||||
path: '/teaching/classtaskassign?titleName=作业布置',
|
path: '/teaching/classtaskassign?titleName=作业布置',
|
||||||
// path: '/classTaskAssign',
|
|
||||||
id: '2-2'
|
id: '2-2'
|
||||||
|
// path: '/classTaskAssign'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '作业批改',
|
name: '作业批改',
|
||||||
icon: '#icon-zuoyepigai',
|
icon: 'icon-pigai',
|
||||||
path: '/classTask',
|
path: '/classTask',
|
||||||
id: '2-3'
|
id: '2-3'
|
||||||
},
|
},
|
||||||
|
@ -147,25 +140,25 @@ const menuList = [{
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: '教学计划',
|
name: '教学计划',
|
||||||
icon: 'icon-jihua',
|
icon: 'icon-jiaoxuejihua',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
id: '3-1'
|
id: '3-1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教学组织',
|
name: '教学组织',
|
||||||
icon: 'icon-zuzhi',
|
icon: 'icon-organization-framework-line',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
id: '3-2'
|
id: '3-2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教学质量',
|
name: '教学质量',
|
||||||
icon: 'icon-zhiliang',
|
icon: 'icon-jiaoxuezhiliangfenxi',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
id: '3-3'
|
id: '3-3'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '教学反馈',
|
name: '教学反馈',
|
||||||
icon: 'icon-yijianfankui',
|
icon: 'icon-fankui',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
id: '3-4'
|
id: '3-4'
|
||||||
},
|
},
|
||||||
|
@ -181,12 +174,13 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
if(id == '1-2' || id == '2-1' || id == '2-2' ){
|
if(id == '1-2' || id == '2-1' || id == '2-2' ){
|
||||||
// 头部 教材分析打开外部链接需要当前章节ID
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
|
||||||
|
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||||
if(fullPath.indexOf('?') == -1){
|
if(fullPath.indexOf('?') == -1){
|
||||||
fullPath += `?unitId=${id}&bookeId=${rootid}`
|
fullPath += `?unitId=${unitId}&bookeId=${bookeId}`
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
fullPath += `&unitId=${id}&bookeId=${rootid}`
|
fullPath += `&unitId=${unitId}&bookeId=${bookeId}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
@ -201,13 +195,7 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcRenderer.on('minWinResize', debounce((e, data) =>{
|
|
||||||
chartInstance.resize()
|
|
||||||
}, 100))
|
|
||||||
|
|
||||||
onMounted(async ()=>{
|
onMounted(async ()=>{
|
||||||
|
|
||||||
await useGetSubject()
|
|
||||||
// 确保DOM 渲染完成
|
// 确保DOM 渲染完成
|
||||||
await nextTick()
|
await nextTick()
|
||||||
chartInstance = echarts.init(chartDom.value)
|
chartInstance = echarts.init(chartDom.value)
|
||||||
|
@ -253,10 +241,21 @@ onMounted(async ()=>{
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
chartInstance.setOption(option);
|
chartInstance.setOption(option);
|
||||||
|
// 初始化 获取教材下面的单元 + 章节
|
||||||
|
getSubjectInit();
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getSubjectInit = async () => {
|
||||||
|
//查看本地是否有缓存
|
||||||
|
let unitId = localStorage.getItem('unitId')
|
||||||
|
if(unitId){
|
||||||
|
// 有缓存不用管
|
||||||
|
} else{
|
||||||
|
// 没有 就获取 获取教材下面的单元 + 章节
|
||||||
|
useGetClassWork();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -264,10 +263,7 @@ onMounted(async ()=>{
|
||||||
.page-desktop{
|
.page-desktop{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
.desktop-left{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.desktop-item{
|
.desktop-item{
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
.item-title{
|
.item-title{
|
||||||
|
@ -285,37 +281,20 @@ onMounted(async ()=>{
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
.con-ul{
|
.con-ul{
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
.item-menu{
|
.item-menu{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
align-items: center;
|
|
||||||
.icon-box{
|
|
||||||
width: 100%;
|
|
||||||
height: 45px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
.iconfont{
|
.iconfont{
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: #707070;
|
color: #707070;
|
||||||
// font-weight: bold;
|
|
||||||
}
|
|
||||||
.icon-svg{
|
|
||||||
height: 42px;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
&:hover{
|
&:hover{
|
||||||
// color: #409EFF;
|
color: #409EFF;
|
||||||
.iconfont{
|
.iconfont{
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
}
|
}
|
||||||
.icon-box{
|
|
||||||
background-color: #F2F2F2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.menu-disabled{
|
.menu-disabled{
|
||||||
|
@ -329,38 +308,15 @@ onMounted(async ()=>{
|
||||||
.iconfont{
|
.iconfont{
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
}
|
}
|
||||||
.icon-box{
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.chart-box{
|
||||||
|
height: 220px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.desktop-item-chart{
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.item-title{
|
|
||||||
height: 32px;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.item-content{
|
|
||||||
border-radius: 5px;
|
|
||||||
background: #fff;
|
|
||||||
box-sizing: border-box;
|
|
||||||
flex: 1;
|
|
||||||
.chart-box{
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -44,6 +44,7 @@
|
||||||
v-model="ruleForm.address"
|
v-model="ruleForm.address"
|
||||||
:options="regionData"
|
:options="regionData"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
|
:props="{checkStrictly: true}"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学校" prop="school" v-if="activeIndex==2">
|
<el-form-item label="学校" prop="school" v-if="activeIndex==2">
|
||||||
|
@ -232,24 +233,23 @@ const OpenModel = v =>{
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
var restValue={
|
var restValue={
|
||||||
name: '',
|
name: '',
|
||||||
idNumber:'',
|
idNumber:'',
|
||||||
phoneNumber: '',
|
phoneNumber: '',
|
||||||
Code:'',
|
Code:'',
|
||||||
password:'',
|
password:'',
|
||||||
confirmPassword:'',
|
confirmPassword:'',
|
||||||
class:[],
|
class:[],
|
||||||
discipline:[],
|
discipline:[],
|
||||||
school:[100,255,279],
|
school:[],
|
||||||
address:["50","5001","500101"]
|
}
|
||||||
}
|
|
||||||
Object.assign(ruleForm, restValue);
|
Object.assign(ruleForm, restValue);
|
||||||
schoolSubject.value=[]
|
schoolSubject.value=[]
|
||||||
gradeTree.value=[]
|
gradeTree.value=[]
|
||||||
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
||||||
removeToken();
|
removeToken();
|
||||||
|
activeIndex.value=1
|
||||||
dialogVisible.value=false
|
dialogVisible.value=false
|
||||||
activeIndex.value=1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const nextStep = (formEl) => {
|
const nextStep = (formEl) => {
|
||||||
|
@ -346,14 +346,13 @@ const submitForm = async (formEl) => {
|
||||||
confirmPassword:'',
|
confirmPassword:'',
|
||||||
class:[],
|
class:[],
|
||||||
discipline:[],
|
discipline:[],
|
||||||
school:[100,255,279],
|
school:[],
|
||||||
address:["50","5001","500101"]
|
|
||||||
}
|
}
|
||||||
schoolSubject.value=[]
|
schoolSubject.value=[]
|
||||||
gradeTree.value=[]
|
gradeTree.value=[]
|
||||||
Object.assign(ruleForm, restValue);
|
Object.assign(ruleForm, restValue);
|
||||||
dialogVisible.value=false
|
|
||||||
activeIndex.value=1
|
activeIndex.value=1
|
||||||
|
dialogVisible.value=false
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
@ -496,7 +495,7 @@ const gradeName = (key) =>{
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
//默认给到地区重庆
|
//默认给到地区重庆
|
||||||
ruleForm.address = ["50","5001","500101"]
|
ruleForm.address = ['50']
|
||||||
//默认给到学校的值
|
//默认给到学校的值
|
||||||
ruleForm.school = [100,255,279]
|
ruleForm.school = [100,255,279]
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="visible" width="35%" :close-on-click-modal="false"
|
<el-dialog v-model="visible" width="75%" :close-on-click-modal="false"
|
||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<template #header><div style="width: 100%;text-align: left"><b>开始上课(APT)</b></div></template>
|
<template #header><b>准备开始上课</b></template>
|
||||||
<div class="class-all">
|
<div class="class-all">
|
||||||
<el-row>
|
<el-row>
|
||||||
<!-- <el-col :span="10">
|
<el-col :span="10">
|
||||||
<c-form v-bind="classForm">
|
<c-form v-bind="classForm">
|
||||||
<template #item_classid="{prop, form}">
|
<template #item_classid="{prop, form}">
|
||||||
<el-select v-model="form[prop]" placeholder="请选择班级">
|
<el-select v-model="form[prop]" placeholder="请选择班级">
|
||||||
<el-option v-for="item in listData.classList" :value="item.id"
|
<el-option v-for="item in listData.classList" :value="item.id"
|
||||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -20,16 +20,8 @@
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
</c-form>
|
</c-form>
|
||||||
</el-col>-->
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="14">
|
||||||
<c-form v-bind="classForm">
|
|
||||||
<template #item_classid="{prop, form}">
|
|
||||||
<el-select v-model="form[prop]" placeholder="请选择班级">
|
|
||||||
<el-option v-for="item in listData.classList" :value="item.id"
|
|
||||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</c-form>
|
|
||||||
<c-form v-bind="teacherForm">
|
<c-form v-bind="teacherForm">
|
||||||
<!-- 上课 -->
|
<!-- 上课 -->
|
||||||
<template #item_classcourseid="{prop,form}">
|
<template #item_classcourseid="{prop,form}">
|
||||||
|
@ -52,7 +44,7 @@
|
||||||
<div :title="value" v-if="!!value">
|
<div :title="value" v-if="!!value">
|
||||||
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
||||||
</div>
|
</div>
|
||||||
<!-- <el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>-->
|
<el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 手机登录 -->
|
<!-- 手机登录 -->
|
||||||
<template #item_mobile>
|
<template #item_mobile>
|
||||||
|
@ -98,6 +90,7 @@ const visible = ref(false) // 是否打开窗口
|
||||||
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
||||||
const imChatRef = ref(null) // im-chat ref
|
const imChatRef = ref(null) // im-chat ref
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
const classForm = reactive({ // 班级(左侧):表单数据 表单配置
|
const classForm = reactive({ // 班级(左侧):表单数据 表单配置
|
||||||
form: {}, itemOption: [], option: {}
|
form: {}, itemOption: [], option: {}
|
||||||
})
|
})
|
||||||
|
@ -139,7 +132,7 @@ const open = async (id) => {
|
||||||
nextTick(async() => {
|
nextTick(async() => {
|
||||||
chat = await imChatRef.value?.initImChat()
|
chat = await imChatRef.value?.initImChat()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const handleClose = async () => {
|
const handleClose = async () => {
|
||||||
|
@ -151,16 +144,15 @@ const handleClose = async () => {
|
||||||
// 初始化-数据
|
// 初始化-数据
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
// 班级-表单配置
|
// 班级-表单配置
|
||||||
classForm.option = { labelW: 80 }
|
classForm.option = { labelW: 40 }
|
||||||
classForm.itemOption = [
|
classForm.itemOption = [
|
||||||
{ label: '班级', prop: 'classid' },
|
{ label: '班级', prop: 'classid' },
|
||||||
// { label: '学生', prop: 'student' },
|
{ label: '学生', prop: 'student' },
|
||||||
]
|
]
|
||||||
// 老师-表单提交
|
// 老师-表单提交
|
||||||
teacherForm.form = { classcourseid: 0 }
|
teacherForm.form = { classcourseid: 0 }
|
||||||
teacherForm.itemOption = [
|
teacherForm.itemOption = [
|
||||||
// { label: '班级', prop: 'classid' },
|
{ label: '上课', prop: 'classcourseid' },
|
||||||
// { label: '上课', prop: 'classcourseid' },
|
|
||||||
{ label: '老师扫码', prop: 'qrUrl', show: false },
|
{ label: '老师扫码', prop: 'qrUrl', show: false },
|
||||||
{ label: '手机登录', prop: 'mobile', show: false },
|
{ label: '手机登录', prop: 'mobile', show: false },
|
||||||
{ label: '故障备用', prop: 'backup', show: false },
|
{ label: '故障备用', prop: 'backup', show: false },
|
||||||
|
@ -195,10 +187,10 @@ const getClassList = async () => {
|
||||||
return o
|
return o
|
||||||
});
|
});
|
||||||
// 默认选中第一项
|
// 默认选中第一项
|
||||||
/*if (listData.classList.length > 0) {
|
if (listData.classList.length > 0) {
|
||||||
classForm.form.classid = listData.classList[0].id
|
classForm.form.classid = listData.classList[0].id
|
||||||
}*/
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取开课列表 - 历史记录
|
// 获取开课列表 - 历史记录
|
||||||
|
@ -225,12 +217,8 @@ const getClasscourseList = async type => {
|
||||||
}
|
}
|
||||||
// 创建课程
|
// 创建课程
|
||||||
const createClasscourse = async () => {
|
const createClasscourse = async () => {
|
||||||
const { classid } = classForm.form
|
|
||||||
if (!classid) {
|
|
||||||
ElMessage.warning('请选择班级')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dt.loading = true
|
dt.loading = true
|
||||||
|
const { classid } = classForm.form
|
||||||
const { entpcourseid, evalid, id, coursetitle } = myClassActive.value // 课件对象
|
const { entpcourseid, evalid, id, coursetitle } = myClassActive.value // 课件对象
|
||||||
const curDate = commUtil.getDateNow('yyyy-MM-dd')
|
const curDate = commUtil.getDateNow('yyyy-MM-dd')
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -341,4 +329,4 @@ defineExpose({
|
||||||
.class-all{
|
.class-all{
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -207,8 +207,8 @@ export default {
|
||||||
},
|
},
|
||||||
openFileWin(items) {
|
openFileWin(items) {
|
||||||
if (items.fileFlag === 'apt') {
|
if (items.fileFlag === 'apt') {
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
let curBook = JSON.parse(localStorage.getItem('curBook'))
|
||||||
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid;
|
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
|
||||||
let configObj = outLink().getBaseData()
|
let configObj = outLink().getBaseData()
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="centerDialogVisible"
|
v-model="centerDialogVisible"
|
||||||
class="reserv-dialog"
|
class="reserv-dialog"
|
||||||
title="开始上课(PPT)"
|
title="上课"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
:before-close="closeDialog"
|
:before-close="closeDialog"
|
||||||
width="35%"
|
width="600"
|
||||||
style="text-align: left"
|
style="text-align: left"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
label-width="auto"
|
label-width="auto"
|
||||||
style="max-width: 600px"
|
style="max-width: 600px"
|
||||||
>
|
>
|
||||||
<!-- <el-form-item label="课程名称" prop="name">
|
<el-form-item label="课程名称" prop="name">
|
||||||
<el-input v-model="form.name" />
|
<el-input v-model="form.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程类型" prop="type">
|
<el-form-item label="课程类型" prop="type">
|
||||||
|
@ -59,21 +59,17 @@
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item label-width="80px" label="班级" prop="resource">
|
<el-form-item label="授课对象" prop="resource">
|
||||||
<el-select v-model="form.resource" placeholder="请选择班级">
|
<el-checkbox-group v-model="form.resource">
|
||||||
<el-option v-for="(item, index) in classList" :value="item.id"
|
|
||||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
|
||||||
</el-select>
|
|
||||||
<!-- <el-checkbox-group v-model="form.resource">
|
|
||||||
<el-checkbox v-for="(item, index) in classList" :key="index" name="type" :value="item.id"
|
<el-checkbox v-for="(item, index) in classList" :key="index" name="type" :value="item.id"
|
||||||
>{{ item.caption }}({{ item.classstudentcount }})人
|
>{{ item.caption }}({{ item.classstudentcount }})人
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>-->
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="教室" prop="classRoom">
|
<el-form-item label="教室" prop="classRoom">
|
||||||
<el-input v-model="form.classRoom" />
|
<el-input v-model="form.classRoom" />
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
|
@ -276,7 +272,7 @@ const updateClassReserv = (formData) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const addClassReserv = (formData) => {
|
const addClassReserv = (formData) => {
|
||||||
let ids = formData.resource
|
let ids = formData.resource.join(',')
|
||||||
// 判断是否添加教材
|
// 判断是否添加教材
|
||||||
if(!props.bookId){
|
if(!props.bookId){
|
||||||
ElMessage.warning('请选择教材')
|
ElMessage.warning('请选择教材')
|
||||||
|
@ -297,10 +293,10 @@ const addClassReserv = (formData) => {
|
||||||
addSmartClassReserv(param).then((res) => {
|
addSmartClassReserv(param).then((res) => {
|
||||||
if (res.msg) {
|
if (res.msg) {
|
||||||
closeDialog()
|
closeDialog()
|
||||||
/*ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '预约成功!'
|
message: '预约成功!'
|
||||||
})*/
|
})
|
||||||
emit('addSuccess',res.msg)
|
emit('addSuccess',res.msg)
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="isLoading" class="page-resource flex">
|
<div v-loading="isLoading" class="page-resource flex">
|
||||||
<ChooseTextbook @node-click="nodeClick" />
|
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||||
<div class="page-center-wrap">
|
<div class="page-center-wrap">
|
||||||
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||||
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
||||||
|
@ -313,6 +313,7 @@ export default {
|
||||||
this.openReserv()
|
this.openReserv()
|
||||||
}
|
}
|
||||||
if(item.fileFlag === 'apt') {
|
if(item.fileFlag === 'apt') {
|
||||||
|
//TODO 打开apt - fileId: aptId
|
||||||
this.$refs.calssRef.open(item.fileId)
|
this.$refs.calssRef.open(item.fileId)
|
||||||
}
|
}
|
||||||
// 当前上课-store
|
// 当前上课-store
|
||||||
|
@ -511,7 +512,6 @@ export default {
|
||||||
})
|
})
|
||||||
this.currentFileList.splice(index, 1)
|
this.currentFileList.splice(index, 1)
|
||||||
})
|
})
|
||||||
ElMessage.success('操作成功')
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -583,7 +583,11 @@ export default {
|
||||||
this.uploadData.levelSecondId = cata[1]
|
this.uploadData.levelSecondId = cata[1]
|
||||||
this.uploadData.levelThirdId = cata[2]
|
this.uploadData.levelThirdId = cata[2]
|
||||||
this.uploadData.textbookId = data.textBook.curBookId
|
this.uploadData.textbookId = data.textBook.curBookId
|
||||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
toolStore.curSubjectNode.data = data
|
||||||
|
// 不要同时修改共享数据,这样只会触发一次
|
||||||
|
this.$nextTick(() => {
|
||||||
|
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||||
|
})
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
},
|
},
|
||||||
|
|
|
@ -47,7 +47,6 @@ import { listEvaluation } from '@/api/subject/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { clearBookInfo } from '@/utils/ruoyi'
|
import { clearBookInfo } from '@/utils/ruoyi'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
|
@ -149,14 +148,7 @@ function submit() {
|
||||||
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
||||||
userStore.getInfo().then(res => {
|
userStore.getInfo().then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let sessionSubject = {
|
clearBookInfo()
|
||||||
bookList: null,
|
|
||||||
curBook: null,
|
|
||||||
curNode: null,
|
|
||||||
defaultExpandedKeys: [],
|
|
||||||
subjectTree: []
|
|
||||||
}
|
|
||||||
sessionStore.set( 'subject', sessionSubject)
|
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(response.msg)
|
ElMessage.error(response.msg)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="page-resource flex">
|
<div class="page-resource flex">
|
||||||
<!--左侧 教材 目录-->
|
<!--左侧 教材 目录-->
|
||||||
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
||||||
<ChooseTextbook v-else @node-click="getData" />
|
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
|
||||||
|
|
||||||
<div class="page-right">
|
<div class="page-right">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
<div class="page-con-left">
|
<div class="page-con-left">
|
||||||
<div class="stand-head" ref="headref">
|
<div class="stand-head" ref="headref">
|
||||||
<div class="stand-head-left">
|
<div class="stand-head-left">
|
||||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
<el-image class="imges" src="https://file.ysaix.com:7868//src/assets/images/高中语文必修上册.jpg" />
|
||||||
</div>
|
</div>
|
||||||
<div class="stand-head-right">
|
<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>
|
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
||||||
<div class="stand-head-right-row">
|
<div class="stand-head-right-row">
|
||||||
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
||||||
<!-- <el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" /> -->
|
<el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,13 +68,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dialogVisible" title="切换课标" append-to-body width="550">
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="550">
|
||||||
<div class="booklist">
|
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -87,7 +82,7 @@ import { listEvaluationclue } from '@/api/teaching/classwork'
|
||||||
import { uploadServer, getJSONFile } from '@/utils/common'
|
import { uploadServer, getJSONFile } from '@/utils/common'
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus'
|
||||||
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const sourceStore = useResoureStore()
|
const sourceStore = useResoureStore()
|
||||||
|
@ -105,10 +100,7 @@ const headref = ref(null);
|
||||||
const searchref = ref(null);
|
const searchref = ref(null);
|
||||||
const listHeight = ref(0);
|
const listHeight = ref(0);
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const bookInfo = ref(null);
|
const booktitle = ref('');
|
||||||
const booksel = ref(0);
|
|
||||||
const bookList = ref([])
|
|
||||||
|
|
||||||
|
|
||||||
const searchOptions = [{
|
const searchOptions = [{
|
||||||
value: '0',
|
value: '0',
|
||||||
|
@ -117,7 +109,7 @@ const searchOptions = [{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '按内容量',
|
label: '按内容量',
|
||||||
}];
|
}];
|
||||||
const standList = ref([]);
|
const standList = ref([])
|
||||||
const showData = ref([]);
|
const showData = ref([]);
|
||||||
|
|
||||||
//查询课标分析列表
|
//查询课标分析列表
|
||||||
|
@ -239,43 +231,19 @@ const getData = (data) => {
|
||||||
}
|
}
|
||||||
sourceStore.handleQuery()
|
sourceStore.handleQuery()
|
||||||
getlistEvaluationclue(levelFirstId, levelSecondId)
|
getlistEvaluationclue(levelFirstId, levelSecondId)
|
||||||
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||||
}
|
}
|
||||||
// 获取学科
|
onMounted(() => {
|
||||||
const getAllSubject = async () => {
|
|
||||||
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
|
||||||
const { edustage, edusubject } = userStore.user;
|
const { edustage, edusubject } = userStore.user;
|
||||||
rows && rows.map(item => {
|
booktitle.value = `${edustage + edusubject}课程标准`
|
||||||
if(edustage === item.edustage && item.edusubject === edusubject){
|
const filePath = `${import.meta.env.VITE_APP_RES_FILE_PATH}${edustage}-${edusubject}-课标.pdf`
|
||||||
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}
|
|
||||||
}
|
|
||||||
if(item.fileurl !== ''){
|
|
||||||
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
|
||||||
booksel.value = textselidx
|
|
||||||
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}
|
|
||||||
pdfUrl.value = '';
|
|
||||||
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
|
||||||
await loadPdfAnimation(filepath)
|
|
||||||
dialogVisible.value = false
|
|
||||||
}
|
|
||||||
const loadPdfAnimation = (path) => {
|
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
pdfUrl.value = path
|
pdfUrl.value = filePath
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
},2000)
|
},2000)
|
||||||
}
|
|
||||||
onMounted(async () => {
|
|
||||||
await getAllSubject();
|
|
||||||
if(cardref.value && headref.value){
|
if(cardref.value && headref.value){
|
||||||
const cardH = cardref.value.offsetHeight;
|
const cardH = cardref.value.offsetHeight;
|
||||||
const headh = headref.value.offsetHeight;
|
const headh = headref.value.offsetHeight;
|
||||||
|
@ -524,32 +492,4 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.booklist{
|
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
|
||||||
padding-top: 1px;
|
|
||||||
overflow: auto;
|
|
||||||
.item{
|
|
||||||
width: 162px;
|
|
||||||
height: auto;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
float: left;
|
|
||||||
.bookimg{
|
|
||||||
width: 130px;
|
|
||||||
height: 180px;
|
|
||||||
}
|
|
||||||
.bookname{
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.item:hover{
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.active{
|
|
||||||
background-color: #409eff;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -1,553 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="page-con flex" ref="cardref">
|
|
||||||
<!-- <el-button @click="saveJSON">测试保存</el-button> -->
|
|
||||||
<div class="page-con-left">
|
|
||||||
<div class="stand-head" ref="headref">
|
|
||||||
<div class="stand-head-left">
|
|
||||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
|
||||||
</div>
|
|
||||||
<div class="stand-head-right">
|
|
||||||
<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>
|
|
||||||
<!-- <el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" /> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="stand-down">
|
|
||||||
<div class="stand-down-search" ref="searchref">
|
|
||||||
<el-input
|
|
||||||
v-model="searchInp"
|
|
||||||
placeholder="搜索课标、学校和老师"
|
|
||||||
clearable
|
|
||||||
@input="searchHandel"
|
|
||||||
/>
|
|
||||||
<el-select v-model="searchSel" placeholder="请选择" style="width: 140px;padding-left:6px" @change="selectHandel">
|
|
||||||
<el-option
|
|
||||||
v-for="item in searchOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="stand-down-con" :style="{overflow: 'auto',height: listHeight + 'px'}">
|
|
||||||
<div class="stand-down-con-list" v-for="item,idx in showData" :key="idx">
|
|
||||||
<div class="stand-down-con-list-icon">
|
|
||||||
<el-image class="imges" :src="item.userheadimgurl" />
|
|
||||||
</div>
|
|
||||||
<div class="stand-down-con-list-txt">
|
|
||||||
<div class="stand-down-con-list-txt-top">
|
|
||||||
<div class="stand-down-con-list-txt-top-name">{{item.username}}</div>
|
|
||||||
<div class="stand-down-con-list-txt-top-tip">{{item.childcount}}条</div>
|
|
||||||
</div>
|
|
||||||
<div class="stand-down-con-list-txt-down">
|
|
||||||
<div class="stand-down-con-list-txt-down-tip">{{ item.userentpname }}</div>
|
|
||||||
<div class="stand-down-con-list-txt-down-tip">{{ item.timeStr }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p v-if="loading">加载中...</p>
|
|
||||||
<p v-if="noMore">~没有更多了~</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="page-con-right">
|
|
||||||
<PDF :url="pdfUrl" v-if="pdfUrl" />
|
|
||||||
<div class="loading" v-else>
|
|
||||||
<div class="setup">
|
|
||||||
<span style="--i:1">文</span>
|
|
||||||
<span style="--i:2">档</span>
|
|
||||||
<span style="--i:3">加</span>
|
|
||||||
<span style="--i:4">载</span>
|
|
||||||
<span style="--i:5">中</span>
|
|
||||||
<span style="--i:6">.</span>
|
|
||||||
<span style="--i:7">.</span>
|
|
||||||
<span style="--i:8">.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<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.fileurl.replace('.txt', '')}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, ref } from 'vue'
|
|
||||||
import PDF from '@/components/PdfJs/index.vue'
|
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import useResoureStore from '../resource/store'
|
|
||||||
import { listEvaluationclue } from '@/api/teaching/classwork'
|
|
||||||
import { uploadServer, getJSONFile } from '@/utils/common'
|
|
||||||
import { ElNotification } from 'element-plus'
|
|
||||||
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
const userStore = useUserStore()
|
|
||||||
const sourceStore = useResoureStore()
|
|
||||||
// import { getStaticUrl } from '@/utils/tool'
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const pdfUrl = ref('');
|
|
||||||
const isOpenClass = ref(true);
|
|
||||||
const searchInp = ref('');
|
|
||||||
const searchSel = ref('0');
|
|
||||||
const loading = ref(false);
|
|
||||||
const noMore = ref(false);
|
|
||||||
const cardref = ref(null);
|
|
||||||
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([])
|
|
||||||
|
|
||||||
|
|
||||||
const searchOptions = [{
|
|
||||||
value: '0',
|
|
||||||
label: '按时间',
|
|
||||||
},{
|
|
||||||
value: '1',
|
|
||||||
label: '按内容量',
|
|
||||||
}];
|
|
||||||
const standList = ref([]);
|
|
||||||
const showData = ref([]);
|
|
||||||
|
|
||||||
//查询课标分析列表
|
|
||||||
const getlistEvaluationclue = (firstid, levelid) => {
|
|
||||||
const newid = firstid ? firstid : levelid;
|
|
||||||
listEvaluationclue({evalid: newid, parentid: 0, cluegroup: 'teachresource', orderby: "timestamp desc", pageSize: 100}).then((res) => {
|
|
||||||
if(res.code === 200){
|
|
||||||
const newData = formaterTime(res.rows)
|
|
||||||
standList.value = newData
|
|
||||||
showData.value = filterList(newData)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const formaterTime = (data) => {
|
|
||||||
return data.map(item => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
timeStr: item.timestamp.split(' ')[0].replace('-', '.').replace('-', '.')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//筛选分析列表
|
|
||||||
const filterList = (data) => {
|
|
||||||
let standData = JSON.parse(JSON.stringify(data));
|
|
||||||
let arr = [];
|
|
||||||
if (searchSel.value === '0') {
|
|
||||||
arr = standData.sort((a, b)=>{
|
|
||||||
return new Date(b.timestamp) - new Date(a.timestamp);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
arr = standData.sort((a, b)=>{
|
|
||||||
return b.childcount - a.childcount;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
//文本框文字搜索
|
|
||||||
const searchHandel = (value) => {
|
|
||||||
const newData = [];
|
|
||||||
standList.value.map(item => {
|
|
||||||
const str = JSON.stringify(item)
|
|
||||||
if(str.indexOf(value) !== -1){
|
|
||||||
newData.push(item);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
showData.value = newData
|
|
||||||
}
|
|
||||||
//下拉框条件筛选
|
|
||||||
const selectHandel = (value) => {
|
|
||||||
const filterData = searchInp.value !== '' ? showData.value : standList.value
|
|
||||||
showData.value = filterList(filterData);
|
|
||||||
}
|
|
||||||
//保存json文件
|
|
||||||
const saveJSON = (data) => {
|
|
||||||
|
|
||||||
let filename = ''
|
|
||||||
// const data = {
|
|
||||||
// name: 'txt',
|
|
||||||
// class: '五年级2班',
|
|
||||||
// school: '重庆市酉阳二中',
|
|
||||||
// time: '2024-08-09'
|
|
||||||
// }
|
|
||||||
// saveJSON(jsonStr);
|
|
||||||
if (!data) {
|
|
||||||
console.log('传入的data数据为null');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!filename) {
|
|
||||||
filename = `json${Date.now()}.json`
|
|
||||||
console.log('未传入文件名,采用默认文件名' + filename);
|
|
||||||
}
|
|
||||||
let newdata = null;
|
|
||||||
if (typeof data === 'object') {
|
|
||||||
newdata = JSON.stringify(data, undefined, 4)
|
|
||||||
}
|
|
||||||
// 创建json文件blob流
|
|
||||||
const blob = new Blob([newdata], { type: 'text/json' });
|
|
||||||
// 创建file文件
|
|
||||||
// const file = new File([blob],filename, {type: blob.type})
|
|
||||||
// 创建上传文件流
|
|
||||||
// const formdata = new FormData();
|
|
||||||
// formdata.append('file', file);
|
|
||||||
//其他参数待添加
|
|
||||||
|
|
||||||
//上传
|
|
||||||
// uploadServer(formdata).then(res => {
|
|
||||||
// console.log('+++++++++++++');
|
|
||||||
// console.log(res.data);
|
|
||||||
// })
|
|
||||||
|
|
||||||
let e = document.createEvent('MouseEvents');
|
|
||||||
let a = document.createElement('a');
|
|
||||||
a.download = filename;
|
|
||||||
a.href = window.URL.createObjectURL(blob);
|
|
||||||
a.dataset.downloadurl = ['text/json', a.download, a.href].join(':');
|
|
||||||
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
||||||
a.dispatchEvent(e);
|
|
||||||
}
|
|
||||||
// 查询
|
|
||||||
const getData = (data) => {
|
|
||||||
const { textBook, node } = data
|
|
||||||
let textbookId = textBook.curBookId
|
|
||||||
let levelSecondId = node.id
|
|
||||||
let levelFirstId
|
|
||||||
if (node.parentNode) {
|
|
||||||
levelFirstId = node.parentNode.id
|
|
||||||
} else {
|
|
||||||
levelFirstId = node.id
|
|
||||||
levelSecondId = ''
|
|
||||||
}
|
|
||||||
sourceStore.query.levelFirstId = levelFirstId
|
|
||||||
sourceStore.query.levelSecondId = levelSecondId
|
|
||||||
sourceStore.query.textbookId = textbookId
|
|
||||||
sourceStore.nodeData = {
|
|
||||||
textbookId, //版本
|
|
||||||
levelFirstId, //单元
|
|
||||||
levelSecondId //单元课程
|
|
||||||
}
|
|
||||||
sourceStore.handleQuery()
|
|
||||||
getlistEvaluationclue(levelFirstId, levelSecondId)
|
|
||||||
}
|
|
||||||
// 获取学科
|
|
||||||
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) => {
|
|
||||||
if(item.fileurl !== ''){
|
|
||||||
dataList.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')
|
|
||||||
await loadPdfAnimation(filePath)
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
dialogVisible.value = false
|
|
||||||
}
|
|
||||||
const loadPdfAnimation = (path) => {
|
|
||||||
const timer = setTimeout(() => {
|
|
||||||
pdfUrl.value = path
|
|
||||||
clearTimeout(timer);
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
onMounted(async () => {
|
|
||||||
await getAllSubject();
|
|
||||||
if(cardref.value && headref.value){
|
|
||||||
const cardH = cardref.value.offsetHeight;
|
|
||||||
const headh = headref.value.offsetHeight;
|
|
||||||
const searchh = searchref.value.offsetHeight;
|
|
||||||
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
if(cardref.value && headref.value){
|
|
||||||
const cardH = cardref.value.offsetHeight;
|
|
||||||
const headh = headref.value.offsetHeight;
|
|
||||||
const searchh = searchref.value.offsetHeight;
|
|
||||||
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
window.addEventListener('message',(event) => {
|
|
||||||
// console.log('------------');
|
|
||||||
const iframeMes = event.data;
|
|
||||||
if(iframeMes.storageInfo){
|
|
||||||
// saveJSON(iframeMes.storageInfo);
|
|
||||||
// console.log(JSON.stringify(iframeMes.storageInfo));
|
|
||||||
}
|
|
||||||
if(iframeMes.quoteInfo){
|
|
||||||
console.log(iframeMes.quoteInfo);
|
|
||||||
const { textStr, StartStr, EndStr } = iframeMes.quoteInfo;
|
|
||||||
if(textStr === StartStr || textStr === EndStr){
|
|
||||||
ElNotification({
|
|
||||||
title: '引用内容',
|
|
||||||
message: textStr,
|
|
||||||
duration: 0,
|
|
||||||
type: 'info',
|
|
||||||
offset: 120
|
|
||||||
})
|
|
||||||
//如果开头和结尾的文字跟内容相同,那么它要么是开头,要么是整段,不需要替换操作
|
|
||||||
console.log('无需替换------',textStr);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let midStr = ''
|
|
||||||
if(StartStr === '' && EndStr === '' && textStr === '') return
|
|
||||||
if(StartStr === '' && EndStr !== '') {
|
|
||||||
midStr = textStr.replace(EndStr,'eeeeee').split('eeeeee')[0]
|
|
||||||
}else if(StartStr !== '' && EndStr === ''){
|
|
||||||
midStr = textStr.replace(StartStr,'ssssss').split('ssssss')[1]
|
|
||||||
}else{
|
|
||||||
midStr = textStr.replace(StartStr, 'ssssss').replace(EndStr,'eeeeee').split('ssssss')[1].split('eeeeee')[0];
|
|
||||||
}
|
|
||||||
ElNotification({
|
|
||||||
title: '引用内容',
|
|
||||||
message: StartStr + midStr + EndStr,
|
|
||||||
duration: 0,
|
|
||||||
type: 'info',
|
|
||||||
offset: 120
|
|
||||||
})
|
|
||||||
console.log('中间文字------',midStr);
|
|
||||||
console.log('转换后整体文字------',StartStr + midStr + EndStr);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// const isDev = process.env.NODE_ENV == 'development'
|
|
||||||
// if (isDev)
|
|
||||||
// pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true)
|
|
||||||
// else
|
|
||||||
// pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true)
|
|
||||||
|
|
||||||
// console.log('页面',pdfUrl.value);
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.page-con {
|
|
||||||
padding-top: 20px;
|
|
||||||
height: 100%;
|
|
||||||
&-left{
|
|
||||||
width: 300px;
|
|
||||||
height: auto;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
&-right{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
margin-left: 20px;
|
|
||||||
height: 100%;
|
|
||||||
background: #ffffff;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
|
||||||
}
|
|
||||||
.loading {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content:center;
|
|
||||||
min-height: 100vh;
|
|
||||||
.setup {
|
|
||||||
position: relative;
|
|
||||||
-webkit-box-reflect: below -12px linear-gradient(transparent, rgba(0, 0, 0, 0.2))
|
|
||||||
}
|
|
||||||
|
|
||||||
.setup span {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
color: #409eff;
|
|
||||||
font-size: 26px;
|
|
||||||
animation: animate 1s ease-in-out infinite;
|
|
||||||
animation-delay: calc(.1s*var(--i))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes animate {
|
|
||||||
0% {
|
|
||||||
transform: translateY(0px)
|
|
||||||
}
|
|
||||||
|
|
||||||
20% {
|
|
||||||
transform: translateY(-24px)
|
|
||||||
}
|
|
||||||
|
|
||||||
40%,
|
|
||||||
100% {
|
|
||||||
transform: translateY(0px)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.stand-head{
|
|
||||||
width: 100%;
|
|
||||||
padding: 6px;
|
|
||||||
border-radius: 6px;
|
|
||||||
position: relative;
|
|
||||||
&-left{
|
|
||||||
width: 48px;
|
|
||||||
height: 66px;
|
|
||||||
border-radius: 2px;
|
|
||||||
overflow: hidden;
|
|
||||||
.imges{
|
|
||||||
width: 48px;
|
|
||||||
height: 66px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-right{
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
padding-left: 60px;
|
|
||||||
padding-right: 6px;
|
|
||||||
left: 0;
|
|
||||||
top: 6px;
|
|
||||||
z-index: 2;
|
|
||||||
&-tit{
|
|
||||||
width: 100%;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
color: #3b3b3b;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
&-icon{
|
|
||||||
position: absolute;
|
|
||||||
right: 12px;
|
|
||||||
top: 0px;
|
|
||||||
z-index: 3;
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
&-row{
|
|
||||||
width: 100%;
|
|
||||||
height: 32px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top: 12px;
|
|
||||||
&-time{
|
|
||||||
font-size: var(--el-font-size-extra-small);
|
|
||||||
color: var(--el-color-info-rgb);
|
|
||||||
line-height: 32px;
|
|
||||||
}
|
|
||||||
&-switch{
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.stand-down{
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
padding-top: 20px;
|
|
||||||
padding-right: 6px;
|
|
||||||
&-search{
|
|
||||||
width: 100%;
|
|
||||||
height: 32px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
}
|
|
||||||
&-con{
|
|
||||||
width: 100%;
|
|
||||||
&-list{
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
position: relative;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-top: 1px dashed #e1e1e1;
|
|
||||||
&-icon{
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 8px;
|
|
||||||
z-index: 2;
|
|
||||||
overflow: hidden;
|
|
||||||
.imges{
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-txt{
|
|
||||||
width: 100%;
|
|
||||||
min-height: 48px;
|
|
||||||
padding-left: 56px;
|
|
||||||
padding-right: 12px;
|
|
||||||
&-top,&-down{
|
|
||||||
width: 100%;
|
|
||||||
min-height: 24px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
&-name{
|
|
||||||
font-size: 14px;
|
|
||||||
color: #3b3b3b;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
&-tip{
|
|
||||||
font-size: 12px;
|
|
||||||
color: #787878;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-down{
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-list:first-of-type{
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.booklist{
|
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
|
||||||
padding-top: 1px;
|
|
||||||
overflow: auto;
|
|
||||||
.item{
|
|
||||||
width: 162px;
|
|
||||||
height: auto;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
float: left;
|
|
||||||
.bookimg{
|
|
||||||
width: 130px;
|
|
||||||
height: 180px;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
font-size: 14px;
|
|
||||||
color: #3b3b3b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.item:hover{
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.active{
|
|
||||||
background-color: #409eff;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -62,7 +62,7 @@
|
||||||
<span class="unit-top-center">选择目录</span>
|
<span class="unit-top-center">选择目录</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="unit-content">
|
<div class="unit-content">
|
||||||
<Lesson @changeChapter="changeChapter" :curNode="curNode.data" />
|
<Lesson @changeChapter="changeChapter" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -70,20 +70,19 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, toRaw, nextTick, reactive } from 'vue';
|
import { ref, onMounted, toRaw } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { getSmarttalkPage } from '@/api/file'
|
import { getSmarttalkPage } from '@/api/file'
|
||||||
import SetHomework from '@/components/set-homework/index.vue'
|
import SetHomework from '@/components/set-homework/index.vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import Lesson from './lesson.vue';
|
import Lesson from './lesson.vue';
|
||||||
import { parseCataByNode } from '@/utils/talkFile'
|
import { parseCataByNode } from '@/utils/talkFile'
|
||||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
||||||
import { createHomework } from '../createHomework'
|
import { createHomework } from '../createHomework'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const usertore = useUserStore().user
|
const usertore = useUserStore().user
|
||||||
|
@ -100,10 +99,6 @@ const resourceList = ref([])
|
||||||
//当前点击的数据
|
//当前点击的数据
|
||||||
const curRow = ref('')
|
const curRow = ref('')
|
||||||
|
|
||||||
const curNode = reactive({
|
|
||||||
data: {}
|
|
||||||
})
|
|
||||||
|
|
||||||
const sendHomework = (row) => {
|
const sendHomework = (row) => {
|
||||||
curRow.value = row
|
curRow.value = row
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -123,7 +118,6 @@ const successHomework = (data)=>{
|
||||||
}
|
}
|
||||||
// 章节目录change
|
// 章节目录change
|
||||||
const changeChapter = async (data)=>{
|
const changeChapter = async (data)=>{
|
||||||
curNode.data = data
|
|
||||||
const { res } = await useGetHomework(data)
|
const { res } = await useGetHomework(data)
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
let cata = parseCataByNode(data)
|
let cata = parseCataByNode(data)
|
||||||
|
@ -183,10 +177,10 @@ const getResource = () => {
|
||||||
|
|
||||||
//获取作业数据
|
//获取作业数据
|
||||||
const getHomework = async () => {
|
const getHomework = async () => {
|
||||||
|
const data = toRaw(toolStore.curSubjectNode).data.node
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const { res } = await useGetHomework(curNode.data)
|
const { res } = await useGetHomework(data)
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
@ -209,16 +203,13 @@ function leave(el, done) {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
await nextTick()
|
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
// 当前节点 mounted 的时候从缓存里拿
|
setTimeout(()=>{
|
||||||
curNode.data = sessionStore.get('subject.curNode')
|
getHomework()
|
||||||
getHomework()
|
getResource()
|
||||||
getResource()
|
},200)
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode.data.id" highlight-current
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||||
@node-click="handleNodeClick">
|
@node-click="handleNodeClick">
|
||||||
<template #default="{ node }">
|
<template #default="{ node }">
|
||||||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||||
|
@ -13,60 +13,133 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, toRaw, watch } from 'vue'
|
import { ref, onMounted, nextTick, toRaw } from 'vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
import { cloneDeep } from 'lodash'
|
|
||||||
|
|
||||||
const emit = defineEmits(['changeChapter'])
|
const emit = defineEmits(['changeChapter'])
|
||||||
const props = defineProps(['curNode'])
|
|
||||||
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'itemtitle',
|
label: 'label',
|
||||||
class: 'textbook-tree'
|
class: 'textbook-tree'
|
||||||
}
|
}
|
||||||
const currentNode = reactive({
|
// 当前选中的节点ID
|
||||||
data: {}
|
const currentNodeId = ref(0)
|
||||||
})
|
// 当前选中的节点名称
|
||||||
|
const currentNodeName = ref('')
|
||||||
watch(() => props.curNode , (newVal) =>{
|
|
||||||
currentNode.data = newVal
|
|
||||||
console.log(currentNode.data)
|
|
||||||
},
|
|
||||||
{deep: true, immediate: true})
|
|
||||||
|
|
||||||
// 默认展开的节点
|
// 默认展开的节点
|
||||||
const defaultExpandedKeys = ref([])
|
const defaultExpandedKeys = ref([])
|
||||||
// tree
|
// tree
|
||||||
const refTree = ref(null)
|
const refTree = ref(null)
|
||||||
|
// 教材ID
|
||||||
|
const curBookId = ref('')
|
||||||
|
//
|
||||||
|
const evaluationList = ref([])
|
||||||
|
|
||||||
const handleNodeClick = (data) => {
|
const getTreeData = () => {
|
||||||
/**
|
evaluationList.value = JSON.parse(localStorage.getItem('unitList'))
|
||||||
* data : 当前节点数据
|
|
||||||
|
//上册
|
||||||
|
/**
|
||||||
|
* 不区分上下册
|
||||||
|
* 2024/08/20调整
|
||||||
*/
|
*/
|
||||||
currentNode.data = data
|
let volumeOne = evaluationList.value.filter(item => item.level == 1)
|
||||||
let nodeData = cloneDeep(toRaw(data));
|
|
||||||
|
//数据过滤
|
||||||
//增加一个label 之前取的label
|
|
||||||
nodeData.label = nodeData.itemtitle
|
let upData = transData(volumeOne)
|
||||||
// 父级节点 如果当前是一级节点 父级则为null
|
if(upData.length){
|
||||||
let parent = {
|
treeData.value = [...upData]
|
||||||
id: nodeData.parentid,
|
}
|
||||||
label: nodeData.parenttitle,
|
else{
|
||||||
itemtitle: nodeData.parenttitle
|
treeData.value = []
|
||||||
}
|
return
|
||||||
const parentNode = nodeData.parentid ? parent : null
|
}
|
||||||
nodeData.parentNode = parentNode
|
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(()=>{
|
onMounted(()=>{
|
||||||
treeData.value = sessionStore.get('subject.subjectTree')
|
setTimeout(()=>{
|
||||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
let data = toRaw(toolStore.curSubjectNode)
|
||||||
|
curBookId.value = data.data.textBook.curBookId
|
||||||
|
getTreeData()
|
||||||
|
},500)
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,8 @@ const btnList = [ // 工具栏按钮列表
|
||||||
// === 页面加载完毕 ===
|
// === 页面加载完毕 ===
|
||||||
onMounted(async() => {
|
onMounted(async() => {
|
||||||
if (!electron) return // 浏览器端
|
if (!electron) return // 浏览器端
|
||||||
// window.test = sessionStore
|
window.test = sessionStore
|
||||||
// window.test1 = toolStore
|
window.test1 = toolStore
|
||||||
getClassInfo() // 获取课堂详情 ex3
|
getClassInfo() // 获取课堂详情 ex3
|
||||||
resetStatus() // 开启重置状态-监听
|
resetStatus() // 开启重置状态-监听
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue