This commit is contained in:
白了个白 2024-09-27 11:09:13 +08:00
commit c78c166044
42 changed files with 1485 additions and 856 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win",
"version": "2.1.1",
"version": "2.1.3",
"description": "",
"main": "./out/main/index.js",
"author": "example.com",
@ -17,7 +17,7 @@
"build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
"build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
"build:mac": "npm run build && electron-builder --mac",
"build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml",
"build:linux": "npm run build && electron-builder --linux"
},
"dependencies": {

View File

@ -88,9 +88,10 @@ function createLoginWindow() {
//主窗口
function createMainWindow() {
mainWindow = new BrowserWindow({
width: 1200,
minWidth: 1350,
width: 1350,
minWidth: 1200,
height: 700,
minHeight: 700,
show: false,
frame: false, // 无边框
autoHideMenuBar: true,
@ -118,6 +119,11 @@ function createMainWindow() {
}, 1000)
// app.quit() // 主窗口关闭-结束所有进程
})
mainWindow.on('resize', () => {
const { width, height } = mainWindow.getBounds();
mainWindow.webContents.send('minWinResize', { width, height });
});
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
@ -129,6 +135,7 @@ function createMainWindow() {
} else {
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
}
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
// 第三步: 开启remote服务
@ -273,14 +280,10 @@ function handleAll() {
})
// 用于监听-状态管理变化-同步所有窗口
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
console.log('pinia-state-change-1', storeName, jsonStr)
for(const curWin of BrowserWindow.getAllWindows()){
const id = curWin.webContents.id
const bool = id !== e.sender.id && !curWin.isDestroyed()
if (id === e.sender.id) {
console.log('pinia-state-change-2', 'windows-send', curWin.type)
}
if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送
curWin.webContents.send('pinia-state-set', storeName, jsonStr)
}

View File

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

File diff suppressed because one or more lines are too long

View File

@ -3144,7 +3144,7 @@ body{
background-color:var(--toolbar-bg-color);
box-shadow:var(--toolbar-box-shadow);
border-bottom:var(--toolbar-border-bottom);
z-index: 9;
z-index: 99999;
}
#toolbarViewer{

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 358 KiB

View File

@ -6,6 +6,7 @@
<script setup>
import { onMounted, ref } from 'vue';
import { getAppInstallUrl } from '@/utils/tool'
const props = defineProps({
url: {
type: String,
@ -16,11 +17,10 @@ const props = defineProps({
/**pdf文件地址 */
const pdfUrl = ref('');
/**pdfjs文件地址 */
const fileUrl = '/pdfjs-dist/web/viewer.html?file=';
const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //
onMounted(() => {
/** 将传入的pdf地址进行编码防止中文识别错误 */
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
console.log('组件',pdfUrl.value);
})
</script>

View File

@ -77,12 +77,11 @@ const changeBook = (data) => {
curBook.data = data
sessionStore.set('subject.curBook', data)
treeData.value = useSubject.getTreeData(data.id)
sessionStore.set('subject.subjectTree', useSubject.getTreeData(data.id))
//
nextTick(() =>{
defaultExpandedKeys.value = [treeData.value[0].id]
curNode.data = getLastLevelData(treeData.value)[0]
handleNodeClick(curNode.data)
})
//
@ -182,6 +181,8 @@ onMounted( async () => {
// ""
treeData.value = useSubject.getTreeData(curBook.data.id)
sessionStore.set('subject.subjectTree',useSubject.getTreeData(curBook.data.id))
nextTick(() =>{
//
if(sessionStore.get('subject.curNode')){

View File

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

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="630" :before-close="beforeClose"
<el-dialog v-model="model" append-to-body :show-close="false" width="630"
style="border-radius: 5px;padding-top: 0">
<div class="dialog-title flex">
<span>{{ title }}</span>
@ -7,13 +7,13 @@
</div>
<div class="dialog-content">
<div class="book-name flex" @click="bookVisible = true">
<span>{{ curBookName }}</span>
<span>{{ curNode.data.itemtitle }}</span>
<i class="iconfont icon-yidongdaozu"></i>
</div>
<el-scrollbar height="400px">
<div class="book-data">
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
<el-tree :data="treeData" :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
@node-click="handleNodeClick">
<template #default="{ node }">
<span :title="node.label" class="tree-label">{{ node.label }}</span>
@ -24,7 +24,7 @@
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button @click="model = false">取消</el-button>
<el-button type="primary" @click="onSubmit">
确定
</el-button>
@ -43,9 +43,12 @@
<div class="textbook-container">
<el-scrollbar height="450px">
<div class="textbook-item flex" v-for="item in subjectList" :class="curBookId == item.id ? 'active-item' : ''"
<div class="textbook-item flex" v-for="item in subjectList" :class="curBook.data.id == item.id ? 'active-item' : ''"
:key="item.id" @click="changeBook(item)">
<img :src="item.avartar" class="textbook-img" alt="">
<img v-if="item.avartar" :src="item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + 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>
</div>
</el-scrollbar>
@ -54,9 +57,10 @@
</template>
<script setup>
import { ref, reactive, toRaw, onMounted, nextTick, watch } from 'vue'
import useUserStore from '@/store/modules/user'
import { listEvaluation } from '@/api/subject'
import { ref, reactive, toRaw, onMounted, nextTick } from 'vue'
import { sessionStore } from '@/utils/store'
import { useGetSubject } from '@/hooks/useGetSubject'
import { cloneDeep } from 'lodash'
const props = defineProps({
modelValue: {
@ -68,134 +72,35 @@ const props = defineProps({
default: '移动至'
}
})
const userStore = useUserStore()
const { edustage, edusubject, userId } = userStore.user
const model = defineModel({ type: Boolean, default: false })
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
let useSubject = null
const dialogVisible = ref(false)
const bookVisible = ref(false)
//
const subjectList = ref([])
const evaluationList = ref([])
const treeData = ref([])
const defaultProps = {
children: 'children',
label: 'label',
label: 'itemtitle',
class: 'textbook-tree'
}
//ID
const curBookId = ref(-1)
//
const curBookName = ref('')
//
const volumeOne = ref([])
//
const currentNode = reactive({
//
const curBook = reactive({
data: {}
})
// ID
const currentNodeId = ref(0)
//
const currentNodeName = ref('')
//
const curNode = reactive({
data:{}
})
//
let submitNode = null
//
const defaultExpandedKeys = ref([])
// tree
const refTree = ref(null)
// emit
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
}
const emit = defineEmits(['onSubmit'])
// id
const findParentByChildId = (treeData, targetNodeId) => {
@ -219,70 +124,32 @@ const findParentByChildId = (treeData, targetNodeId) => {
return null;
}
const handleNodeClick = (data, node) => {
const handleNodeClick = (data) => {
/**
* data : 当前节点数据
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
*/
const nodeData = data;
const parentNode = node.parent.data;
if (Array.isArray(parentNode)) {
nodeData.parentNode = null
}
else {
nodeData.parentNode = parentNode
}
let nodeData = cloneDeep(toRaw(data));
//label label
nodeData.label = nodeData.itemtitle
// null
let parent = {
id: nodeData.parentid,
label: nodeData.parenttitle,
itemtitle: nodeData.parenttitle
}
const parentNode = nodeData.parentid ? parent : null
nodeData.parentNode = parentNode
let curData = {
textBook: {
curBookId: curBookId.value,
curBookName: curBookName.value
curBookId: curBook.data.id,
curBookName: curBook.data.itemtitle
},
node: toRaw(nodeData)
node: nodeData
}
currentNode.data = curData
// emit('nodeClick', curData)
submitNode = 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) => {
let lastLevelData = [];
@ -307,33 +174,53 @@ const getLastLevelData = (tree) => {
}
//
const changeBook = ({ id, itemtitle }) => {
curBookId.value = id
curBookName.value = itemtitle
getTreeData()
const changeBook = (data) => {
curBook.data = data
treeData.value = useSubject.getTreeData(data.id)
//
nextTick(() =>{
defaultExpandedKeys.value = [treeData.value[0].id]
curNode.data = getLastLevelData(treeData.value)[0]
handleNodeClick(curNode.data)
})
setTimeout(() => {
bookVisible.value = false
}, 0);
}
const onSubmit = () => {
emit('onSubmit', toRaw(currentNode.data))
closeDialog()
emit('onSubmit', submitNode)
model.value = false
}
const closeDialog = () => {
emit('update:modelValue', false)
}
onMounted(async () => {
//
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]
}
//
const beforeClose = (done) => {
emit('update:modelValue', false)
done()
}
onMounted(() => {
getSubjectContent()
// ""
treeData.value = useSubject.getTreeData(curBook.data.id)
nextTick(() =>{
//
if(sessionStore.get('subject.curNode')){
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
curNode.data = sessionStore.get('subject.curNode')
}else{
defaultExpandedKeys.value = [treeData.value[0].id]
curNode.data = getLastLevelData(treeData.value)[0]
}
handleNodeClick(curNode.data)
})
})
</script>

View File

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

View File

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

View File

@ -55,7 +55,7 @@ export const useGetSubject = async () =>{
treeData = getTreeData(subjectList[0].id)
// 设置一个默认的curNode
let curNode
if(treeData[0].children){
if(treeData[0].children && treeData[0].children.length){
curNode = treeData[0].children[0]
}
else{
@ -63,7 +63,6 @@ export const useGetSubject = async () =>{
}
sessionStore.set('subject.curNode', curNode)
}
}
// 单元章节数据转为“树”结构
@ -73,9 +72,7 @@ export const useGetSubject = async () =>{
data.forEach( item => {
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
})
sessionStore.set('subject.subjectTree', data)
return data
}
await getSubjectUnit()

View File

@ -67,7 +67,7 @@ const title = reactive([
},
{
name: '教材分析',
url: '/teaching/chatwithtextbook',
url: '/textbookAnalysis',
img: 'iconfont icon-yanjiushi',
child1: []
},

View File

@ -9,7 +9,14 @@
<ul class="flex">
<li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
<i class="iconfont" :class="menu.icon"></i>
<div class="icon-box">
<svg class="icon iconfont" aria-hidden="true">
<use :xlink:href="menu.icon"></use>
</svg>
</div>
<span class="text">{{ menu.name }}</span>
</li>
</ul>
@ -38,7 +45,7 @@
<span class="user-name">{{ userStore.user.nickName }}</span>
<div class="flex">
<el-dropdown @command="changeSubject">
<el-dropdown @command="changeSubject" max-height="500">
<div class="user-subject">{{ userStore.user.edusubject }}
<el-icon class="el-icon--right"><arrow-down />
</el-icon>
@ -70,10 +77,8 @@ import { ArrowDown } from '@element-plus/icons-vue'
import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user'
import { updateUserInfo } from '@/api/system/user'
import outLink from '@/utils/linkConfig'
import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index'
import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool'
@ -91,25 +96,25 @@ const headerMenus = [
{
name: '工作台',
id: 1,
icon: 'icon-gongzuotai',
icon: '#icon-gongzuotai_xuanzhong',
path: '/home'
},
{
name: '研究室',
id: 2,
icon: 'icon-yanjiushi',
icon: '#icon-yanjiushi-2',
disabled: true
},
{
name: '资源库',
id: 3,
icon: 'icon-saoyisao',
icon: '#icon-ziyuanku',
path: '/resource'
},
{
name: '朋友圈',
id: 4,
icon: 'icon-pengyouquan1',
icon: '#icon-iconfontzhizuobiaozhunbduan3-1',
disabled: true
}
]
@ -175,8 +180,15 @@ function setLayout() {
}
//
const changeSubject = async (command) =>{
clearBookInfo()
const { userId, userName, phonenumber, plainpwd } = userStore.user
let sessionSubject = {
bookList: null,
curBook: null,
curNode: null,
defaultExpandedKeys: [],
subjectTree: []
}
sessionStore.set( 'subject', sessionSubject)
const { userId, userName, plainpwd } = userStore.user
const data = {
userId,
userName,
@ -184,7 +196,7 @@ const changeSubject = async (command) =>{
edusubject: command.edusubject
}
await updateUserInfo(data)
await userStore.login({username: phonenumber, password: plainpwd})
await userStore.login({username: userName, password: plainpwd})
await userStore.getInfo()
router.go()
}
@ -240,10 +252,19 @@ onMounted(() => {
li {
cursor: pointer;
flex-direction: column;
border-radius: 8px;
margin: 0 10px;
border-radius: 5px;
padding: 5px 8px;
height: 60px;
align-items: center;
.icon-box{
width: 100%;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
}
.text {
margin-top: 3px;
font-size: 13px;
font-weight: bold;
}
@ -252,24 +273,9 @@ onMounted(() => {
font-size: 26px;
}
.icon-resource {
color: #f99b53;
}
.icon-homepage {
color: #0a84ff;
}
.icon-prepare {
color: #b088e8;
}
.icon-teach {
color: #367dea;
}
&:hover {
color: #409eff;
background-color: #fff
}
}
@ -279,11 +285,13 @@ onMounted(() => {
&:hover {
color: #bfbfbf;
background: none;
}
}
.active-li {
color: #409eff;
background-color: #fff
}
}
}

View File

@ -50,7 +50,10 @@ const goBack = () =>{
<style lang="scss" scoped>
.el-container {
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;
}

View File

@ -59,7 +59,13 @@ export const constantRoutes = [
path: '/standardanalysis',
component: () => import('@/views/teach/standardAnalysis/index.vue'),
name: 'standardanalysis',
meta: {title: '课标分析'},
meta: {title: '课标分析'}
},
{
path: '/textbookAnalysis',
component: () => import('@/views/textbookAnalysis/index.vue'),
name: 'textbookAnalysis',
meta: {title: '教材分析'}
},
{
path: '/profile',

View File

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

View File

@ -49,6 +49,18 @@ export const getStaticUrl = (url = '', type = 'app', exitPath = '', isFile = fal
}
}
}
export const getAppInstallUrl = (url = '', type = 'app', exitPath = '', isFile = false) => {
if (isDev) return url
else { // 生产环境获取-url
switch(type) {
case 'app': return path.join(__dirname, url) // 应用目录
case 'user': return (isFile?'file://':'')+path.join(Remote.app.getAppPath(),exitPath, url) // 用户目录
// case 'user': return (isFile?'file://':'')+path.join(Remote.app.getPath('userData'),exitPath, url) // 用户目录
default: return ''
}
}
}
/**
* @description 消息发送-nodejs 消息发送
* @form src/main/tool.js 来源
@ -138,7 +150,7 @@ export const createWindow = async (type, data) => {
winPdf.focus();
// toolState.isPdfWin=true
}
return
}
const option = data.option||{}
@ -300,7 +312,7 @@ const eventHandles = (type, win) => {
winPdf=null
win&&win.destroy()
})
// 监听窗口的激活事件
win.on('focus', async () => {
console.log('激活窗口')
@ -348,8 +360,8 @@ const eventHandles = (type, win) => {
/**
* @description 外部跳转-web网页
* @param {*} path
* @param {*} params
* @param {*} path
* @param {*} params
*/
export const toLinkWeb = (path) => {
const config = baseConfig()

View File

@ -63,8 +63,7 @@
<script setup>
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
import { listByDeadDate, listClassworkdataByDeadDate } from '@/api/classTask'
// import { screen } from 'electron'
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
import TaskItem from '@/views/classTask/container/task-item.vue'
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
@ -117,13 +116,13 @@ const changeEndDate = (val) => {
}
//
const getData = () => {
const getData = async () => {
classWorkList.value = []
loading.value = true
// 1
getClassList()
// 2
getClassWorkList()
await getClassWorkList()
// 3
getStudentClassWorkData()
loading.value = false
@ -141,75 +140,76 @@ const getClassList = () => {
/**
* 2获取班级作业
*/
const getClassWorkList = () => {
const getClassWorkList = async () => {
if(classTaskStore.classListIds.length>0){
//
listByDeadDate({
// homeworklist
const response = await listByDeadDate({
classidarray: classTaskStore.classListIds.join(','),
edustage: userStore.edustage,//
edituserid: userStore.userId, // id
edustage: userStore.edustage, //
edusubject: userStore.edusubject,//
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,//
status: '1', // 1-
orderby: "deaddate DESC",
// orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC',
pageSize: 100,
}).then((response) => {
for (var i = 0; i < response.rows.length; i++) {
//
response.rows[i].workdatalist = []
response.rows[i].workdatacount = 0 //
response.rows[i].workdatalistVisible = false
response.rows[i].workdatafeedbackcount = 0 //
response.rows[i].feedtimelength = 0
response.rows[i].rightAnswerCount = 0
response.rows[i].scoingRate = 0 + '%' //
response.rows[i].averagetime = 0 //
// ----------------------------------------------
// UI
if (response.rows[i].worktype == '学习目标定位') {
response.rows[i].workclass = 'success'
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
} else if (response.rows[i].worktype == '教材研读') {
response.rows[i].workclass = 'primary'
} else if (response.rows[i].worktype == '框架梳理') {
response.rows[i].workclass = 'warning'
} else if (response.rows[i].worktype == '学科定位') {
response.rows[i].workclass = 'info'
} else if (response.rows[i].worktype == '习题训练') {
response.rows[i].workclass = 'danger'
} else {
response.rows[i].workclass = ''
}
//
if (response.rows[i].entpcourseworklist != '') {
response.rows[i].entpcourseworklistarray = JSON.parse(
'[' + response.rows[i].entpcourseworklist + ']'
)
} else {
response.rows[i].entpcourseworklistarray = []
}
// classworkdatastudentids
if (
response.rows[i].classworkdatastudentids != '' &&
response.rows[i].classworkdatastudentids != null &&
response.rows[i].classworkdatastudentids != 'null'
) {
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
response.rows[i].workdatacount = stuList.length
}
}
// (workdatacount)>0
if (response.rows && response.rows.length > 0) {
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
//TODO total
total.value = response.total
}else{
classWorkList.value = []
total.value = 0
}
loading.value = false
})
for (var i = 0; i < response.rows.length; i++) {
//
response.rows[i].workdatalist = []
response.rows[i].workdatacount = 0 //
response.rows[i].workdatalistVisible = false
response.rows[i].workdatafeedbackcount = 0 //
response.rows[i].feedtimelength = 0
response.rows[i].rightAnswerCount = 0
response.rows[i].scoingRate = 0 + '%' //
response.rows[i].averagetime = 0 //
// ----------------------------------------------
// UI
if (response.rows[i].worktype == '学习目标定位') {
response.rows[i].workclass = 'success'
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
} else if (response.rows[i].worktype == '教材研读') {
response.rows[i].workclass = 'primary'
} else if (response.rows[i].worktype == '框架梳理') {
response.rows[i].workclass = 'warning'
} else if (response.rows[i].worktype == '学科定位') {
response.rows[i].workclass = 'info'
} else if (response.rows[i].worktype == '习题训练') {
response.rows[i].workclass = 'danger'
} else {
response.rows[i].workclass = ''
}
//
if (response.rows[i].entpcourseworklist != '') {
response.rows[i].entpcourseworklistarray = JSON.parse(
'[' + response.rows[i].entpcourseworklist + ']'
)
} else {
response.rows[i].entpcourseworklistarray = []
}
// classworkdatastudentids
if (
response.rows[i].classworkdatastudentids != '' &&
response.rows[i].classworkdatastudentids != null &&
response.rows[i].classworkdatastudentids != 'null'
) {
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
response.rows[i].workdatacount = stuList.length
}
}
// (workdatacount)>0
if (response.rows && response.rows.length > 0) {
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
//TODO total
total.value = response.total
}else{
classWorkList.value = []
total.value = 0
}
loading.value = false
}
}
@ -220,15 +220,19 @@ const getStudentClassWorkData = async() => {
// const { chapterId } = await useGetHomework(props.bookobj.node)
// this.entpcourseid = chapterId
if(classTaskStore.classListIds.length>0){
listClassworkdataByDeadDate({
classids: classTaskStore.classListIds.join(','),
edustage: userStore.edustage,//
edusubject: userStore.edusubject,//
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,//
// entpcourseid: '',// id
status: '1', // 1-
orderby: "deaddate DESC",
pageSize: 1000
// listClassworkdataByDeadDate({
// edituserid: userStore.userId, // id
// classids: classTaskStore.classListIds.join(','),
// edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
// //status: '1', // 1-
// orderby: "deaddate DESC",// TODO deaddate
// pageSize: 1000,
// })
const ids = classWorkList.value.map((item) => item.id).join(',');
listClassworkdata({
classworkids: ids,
pageSize: 1000,
}).then((res) => {
for (var t = 0; t < classWorkList.value.length; t++) {
for (var i = 0; i < res.rows.length; i++) {
@ -295,10 +299,10 @@ const getStudentClassWorkData = async() => {
//
// 2024-04-12by jackyshen
//
if (classWorkList.value[t].workdatafeedbackcount > 0) {
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
} else {
classWorkList.value[t].averagetime = 0
}
@ -388,11 +392,13 @@ const getStudentVisible = async () => {
//
const response = await listByDeadDate({
classidarray: classTaskStore.classListIds.join(','),
edituserid: userStore.userId, // id
edustage: userStore.edustage,//
edusubject: userStore.edusubject,//
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,//
status: '1', // 1-
orderby: "deaddate DESC",
// orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC',
pageSize: 100
})
const curWorkList = response.rows
@ -417,7 +423,7 @@ const getStudentVisible = async () => {
)
//
if (classWorkList.value[t].workdatafeedbackcount > 0) {
classWorkList.value[t].averagetime = (classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount).toFixed(0)
classWorkList.value[t].averagetime = Math.ceil(classWorkList.value[t].feedtimelength / classWorkList.value[t].workdatafeedbackcount / 60).toFixed(0)
} else {
classWorkList.value[t].averagetime = 0
}

View File

@ -234,7 +234,7 @@ const openDialog = (data) => {
classWorkAnalysis.activeQuizAnalysisData = []
classWorkAnalysis.row = data
window.test = this
// window.test = this
// zdg:
const studentArr = data.classworkdatastudentids
? JSON.parse(`[${data.classworkdatastudentids}]`)
@ -539,6 +539,10 @@ const workHandle = (type) => {
classWorkAnalysis.view = type
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
//
if(type == 'quizStats') {
getWorkFeedList();
}
if (isClose) clearInterval(classWorkActiveData.timerId) //
if (isOpen) {
//

View File

@ -17,7 +17,13 @@
<div class="respond">
<div class="c-label">
<b t1>作答情况</b>
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> )</span>
<template v-if="item.type=='单选题'||item.type == '多选题'||item.type == '判断题'">
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> -</span>
<span>回答正确 <el-text type="danger">{{item.rightSum}}</el-text> )</span>
</template>
<template v-else>
<span>(已经完成 <el-text type="danger">{{item.accSum}}</el-text> )</span>
</template>
</div>
<div class="c-childen">
<template v-for="(it, ind) in item.children">
@ -111,6 +117,14 @@ colorArr = [
onMounted(() => {})
// === (methods) ===
const isSame = (a,b) => {
if (a.length != b.length) return false
return !a.some(v => !b.includes(v))
}
// -
// -
const initData = () => {
// console.log('xxx', props)
@ -124,43 +138,128 @@ const initData = () => {
const workdesc = o.workdesc || ''
let accSum = 0 //
let activeIds = [] //
let rightIds = [] //
const quizFeedList = activeWorkFeedList.filter(f => f.entpcourseworkid == o.id) //
let children = []
if (['单选题','多选题'].includes(o.worktype)) { // '',''
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[]
const allStudents = [];
if (o.worktype == '单选题') { // '',''
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
children = list.map((v,i) => {
const code = toCode(i) // A-Z
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // ()
// id
const studentIds = quizFeedList.filter(f => f.feedcontent==v&&f.finishtimelength!='0').map(f => f.studentid)||[];
accSum += studentIds.length;
if (isOk) {
activeIds.push(...studentIds)
}
return { def: v, code, isOk, studentIds }
})
}
else if (o.worktype == '多选题') {
//
rightIds = quizFeedList.filter(f => {
const workanswer = (isJson(o.workanswer)) ? JSON.parse(o.workanswer) : o.workanswer || [];
const res = isSame((f.feedcontent||'').split(','), workanswer);
return f.entpcourseworkid == o.id && f.finishtimelength!='0' && res;
});
const list = workdesc.includes('#&') ? workdesc.split('#&') : isJson(workdesc)?JSON.parse(workdesc):[];
children = list.map((v,i) => {
const isOne = o.worktype == '单选题'
const code = toCode(i) // A-Z
// const isOk = isOne ? i == o.workanswer : o.workanswer.includes(i) // ()
const isOk = (isJson(workdesc)?JSON.parse(o.workanswer):o.workanswer||'').includes(i+'') // ()
// id
const studentIds = quizFeedList.filter(f => isOne ? f.feedcontent==v : f.feedcontent.includes(i)).map(f => f.studentid)||[]
accSum += studentIds.length
if(isOk) isOne ? activeIds.push(...studentIds) : activeIds=[...new Set(activeIds.concat(studentIds))] //
const studentIds = quizFeedList.filter(f => f.feedcontent.includes(i)&&f.finishtimelength!='0').map(f => f.studentid)||[];
accSum += studentIds.length;
if (studentIds.length>0) {
allStudents.push(...studentIds);
}
if(isOk) {
activeIds=[...new Set(activeIds.concat(studentIds))] //
}
return { def: v, code, isOk, studentIds }
})
} else if (o.worktype == '填空题') { //
}
else if (o.worktype == '填空题') { //
const regex = /<!--BA-->(.*?)<!--EA-->/g // <!--BA-->xxx<!--EA-->
children = (o.title||'').match(regex).map((v,i) => {
const def = `填空项 ${i+1}`
const code = '(&emsp;)', txt=v
//const code = '(&emsp;)'
const code = '(略)', txt=v
// id
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i]).map(f => f.studentid)||[]
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'').split('#')[i] && f.finishtimelength!='0').map(f => f.studentid)||[]
activeIds=[...new Set(activeIds.concat(studentIds))] //
accSum = activeIds.length
return { def, code, txt, isOk:true, studentIds }
})
} else if (o.worktype == '论述题') { //
const code = '(&emsp;)', def = '论述内容'
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')).map(f => f.studentid)||[]
} else if (o.worktype == '判断题') { //
const list = ['正确', '错误'];
children = list.map((v,i) => {
const workanswer = o.workanswer
.replace('×', '0')
.replace('√', '1')
.replace('错误', '0')
.replace('正确', '1')
.replace('正确。', '1')
.replace('F', '0')
.replace('T', '1')
.replace('错', '0')
.replace('对', '1');
const workanswerFormat = isJson(workanswer) ? JSON.parse(workanswer) : workanswer||''
const code = v=='正确' ? '1' : '0'
let isOk = (workanswerFormat).includes(code)
// warn:
// if (workanswerFormat == '0') {
// isOk = !isOk;
// }
// id
const studentIds = quizFeedList.filter(f => {
const feedcontent = f.feedcontent
.replace('×', '0')
.replace('√', '1')
.replace('错误', '0')
.replace('正确', '1')
.replace('正确。', '1')
.replace('F', '0')
.replace('T', '1')
.replace('错', '0')
.replace('对', '1');
if(feedcontent == code&&f.finishtimelength!='0'){
return f
}
}).map(f => f.studentid)||[];
accSum += studentIds.length;
if(isOk) activeIds.push(...studentIds)
return { def: v, code: v, isOk, studentIds }
})
} else { //
// code = '(&emsp;)'
const code = '(略)', def = '解答内容'
const studentIds = quizFeedList.filter(f => !!(f.feedcontent||'').replace(/#$/,'')&&f.finishtimelength!='0').map(f => f.studentid)||[]
activeIds=[...new Set(activeIds.concat(studentIds))] //
accSum = activeIds.length
children = [{ def, code, isOk:true, studentIds }]
}
const studentSum = studentList.value.length || 0 //
const points = percent((activeIds.length / (studentSum||1)).toFixed(2)) //
let points = percent((activeIds.length / (studentSum||1)).toFixed(2)) //
let rightSum = activeIds.length; //
//
if (o.worktype == '多选题') {
//
const uniqueTmpStuents = [...new Set(allStudents)];
accSum = uniqueTmpStuents.length;
//
points = percent((rightIds.length / (studentSum||1)).toFixed(2)) //
//
rightSum = rightIds.length;
}
// def: type active: points: , accSum
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, children }
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children }
})
console.log('获取数据: ', data)
dataList.value = data
@ -170,7 +269,7 @@ const ratio_1 = (row, sum = 1) => percent(((row.studentIds.length||0) / (sum||1)
// --
const ratio_2 = row => percent(((row.accSum||0) / (studentList.value.length||1)).toFixed(2))
// --txt
const getRatioTxt = row => row.type.includes('选题') ? '得分率' : '完成度'
const getRatioTxt = row => ['单选题', '多选题', '判断题'].includes(row.type) ? '得分率' : '完成度'
// --
const getStatus = row => row.isOk ? 'success' : 'exception'
// -(id)

View File

@ -30,7 +30,7 @@
<div class="class-reserv-item-tool">
<span>
<!-- {{ item.averagetime?item.averagetime:0 }} -->
<span v-if=" item.averagetime<60 ">
<!-- <span v-if=" item.averagetime<60 ">
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
</span>
<span v-if=" item.averagetime==60 ">
@ -39,7 +39,8 @@
<span v-if=" item.averagetime>60 ">
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
</span>
</span> -->
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
</span>
<span>平均用时</span>
</div>

View File

@ -34,30 +34,15 @@
<script setup>
import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { getSelfReserv } from '@/api/classManage'
import { homeworklist } from '@/api/teaching/classwork'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
const type = ref(-1)
const user = useUserStore().user
const loading = ref(false)
const classList = ref([])
const homeworkList = ref([])
const itemDialogRef = ref(null)
//
const getClass = async () => {
loading.value = true
try {
const res = await getSelfReserv()
let list = res.data || []
list.sort((a, b) => { if (a.status == '上课中') return -1; else return 0 })
classList.value = list.filter(item => item.status !== '已结束')
} finally {
loading.value = false
}
}
//
const getHomework = async () => {
loading.value = true
@ -65,7 +50,8 @@ const getHomework = async () => {
try {
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
//
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
// homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getTomorrow() <= item.deaddate) //
homeworkList.value.forEach((item) => {
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
//
@ -98,16 +84,16 @@ const tagType = (time) => {
onMounted(() => {
// getClass()
getHomework()
})
</script>
<style lang="scss" scoped>
.desktop-work-item {
align-items: center;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.item-title {
height: 32px;
text-align: left;
@ -126,7 +112,7 @@ onMounted(() => {
border-radius: 5px;
padding: 10px 15px;
font-size: 13px;
height: calc(100% - 60px);
flex: 1;
.class-item {
justify-content: space-between;

View File

@ -1,40 +1,49 @@
<template>
<div class="page-desktop">
<el-row :gutter="20">
<el-col :span="17">
<el-row :gutter="20">
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
<div class="desktop-item">
<div class="item-title">{{ item.name }}</div>
<div class="item-content">
<ul class="flex con-ul">
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<i class="iconfont" :class="menu.icon"></i>
<span>{{ menu.name }}</span>
</li>
</ul>
<el-row :gutter="20" style="height: 100%;">
<el-col :span="17" class="desktop-left">
<el-row :gutter="20">
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
<div class="desktop-item">
<div class="item-title">{{ item.name }}</div>
<div class="item-content">
<ul class="flex con-ul">
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<div class="icon-box">
<template v-if="menu.disabled">
<i class="iconfont" :class="menu.icon"></i>
</template>
<template v-else>
<svg class="icon iconfont icon-svg" aria-hidden="true">
<use :xlink:href="menu.icon"></use>
</svg>
</template>
</div>
<span>{{ menu.name }}</span>
</li>
</ul>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="desktop-item">
<div class="item-title flex">
<span>教学进度</span>
</el-col>
</el-row>
<el-row style="height: 100%;">
<el-col :span="24">
<div class="desktop-item-chart">
<div class="item-title flex">
<span>教学进度</span>
</div>
<div class="item-content">
<div ref="chartDom" class="chart-box"></div>
</div>
</div>
<div class="item-content">
<div ref="chartDom" class="chart-box"></div>
</div>
</div>
</el-col>
</el-row>
</el-col>
<el-col :span="7">
<!--工作动态-->
<workTrend/>
</el-col>
</el-row>
</el-col>
</el-row>
</el-col>
<el-col :span="7" style="flex: 1;">
<!--工作动态-->
<workTrend/>
</el-col>
</el-row>
</div>
</template>
@ -42,11 +51,12 @@
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import * as echarts from 'echarts'
import workTrend from './container/work-trend.vue'
import outLink from '@/utils/linkConfig'
import * as echarts from 'echarts'
import { useGetSubject } from '@/hooks/useGetSubject'
import { sessionStore } from '@/utils/store'
import { debounce } from 'lodash'
const router = useRouter()
const { ipcRenderer } = window.electron || {}
@ -59,20 +69,19 @@ const menuList = [{
list: [
{
name: '课标分析',
icon: 'icon-kecheng',
icon: '#icon-kebiao',
path: '/standardanalysis?',
id: '1-1'
},
{
name: '教材分析',
icon: 'icon-jiaocaixuanze',
isOuter: true,
path: '/teaching/chatwithtextbook',
icon: '#icon-jiaocaixuanze',
path: '/textbookAnalysis',
id: '1-2'
},
{
name: '考试分析',
icon: 'icon-kaoshi',
icon: '#icon-kaoshi',
path: '/examReport',
id: '1-3'
},
@ -84,13 +93,13 @@ const menuList = [{
},
{
name: '教学实践',
icon: 'icon-jiaoxuefenxi',
icon: '#icon-jiaoxueshijian',
path: '/prepare',
id: '1-5'
},
{
name: '教学反思',
icon: 'icon-jiaoxuefansi',
icon: 'icon-a-1_jiaoxuefansi',
disabled: true,
id: '1-6'
},
@ -103,7 +112,7 @@ const menuList = [{
list: [
{
name: '作业设计',
icon: 'icon-jiaoxuefansi',
icon: '#icon-zuoyesheji',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
// path: '/newClassTask',
@ -111,7 +120,7 @@ const menuList = [{
},
{
name: '作业布置',
icon: 'icon-xiezuo1',
icon: '#icon-zuoyebuzhi',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置',
// path: '/classTaskAssign',
@ -119,7 +128,7 @@ const menuList = [{
},
{
name: '作业批改',
icon: 'icon-pigai',
icon: '#icon-zuoyepigai',
path: '/classTask',
id: '2-3'
},
@ -138,25 +147,25 @@ const menuList = [{
list: [
{
name: '教学计划',
icon: 'icon-jiaoxuejihua',
icon: 'icon-jihua',
disabled: true,
id: '3-1'
},
{
name: '教学组织',
icon: 'icon-organization-framework-line',
icon: 'icon-zuzhi',
disabled: true,
id: '3-2'
},
{
name: '教学质量',
icon: 'icon-jiaoxuezhiliangfenxi',
icon: 'icon-zhiliang',
disabled: true,
id: '3-3'
},
{
name: '教学反馈',
icon: 'icon-fankui',
icon: 'icon-yijianfankui',
disabled: true,
id: '3-4'
},
@ -192,6 +201,10 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
}
}
ipcRenderer.on('minWinResize', debounce((e, data) =>{
chartInstance.resize()
}, 100))
onMounted(async ()=>{
await useGetSubject()
@ -251,7 +264,10 @@ onMounted(async ()=>{
.page-desktop{
height: 100%;
padding-top: 20px;
.desktop-left{
display: flex;
flex-direction: column;
}
.desktop-item{
margin-bottom: 20px;
.item-title{
@ -269,20 +285,37 @@ onMounted(async ()=>{
padding: 10px 0;
.con-ul{
justify-content: space-around;
.item-menu{
cursor: pointer;
flex-direction: column;
font-size: 14px;
align-items: center;
.icon-box{
width: 100%;
height: 45px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.iconfont{
font-size: 28px;
color: #707070;
// font-weight: bold;
}
.icon-svg{
height: 42px;
font-weight: bold;
}
&:hover{
color: #409EFF;
// color: #409EFF;
.iconfont{
color: #409EFF;
}
.icon-box{
background-color: #F2F2F2;
}
}
}
.menu-disabled{
@ -296,15 +329,38 @@ onMounted(async ()=>{
.iconfont{
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>

View File

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

View File

@ -1,14 +1,14 @@
<template>
<el-dialog v-model="visible" width="75%" :close-on-click-modal="false"
<el-dialog v-model="visible" width="35%" :close-on-click-modal="false"
@close="handleClose">
<template #header><b>准备开始上课</b></template>
<template #header><div style="width: 100%;text-align: left"><b>开始上课APT</b></div></template>
<div class="class-all">
<el-row>
<el-col :span="10">
<!-- <el-col :span="10">
<c-form v-bind="classForm">
<template #item_classid="{prop, form}">
<el-select v-model="form[prop]" placeholder="请选择班级">
<el-option v-for="item in listData.classList" :value="item.id"
<el-option v-for="item in listData.classList" :value="item.id"
:label="`${item.caption} (${item.classstudentcount}人)`" />
</el-select>
</template>
@ -20,8 +20,16 @@
</el-scrollbar>
</template>
</c-form>
</el-col>
<el-col :span="14">
</el-col>-->
<el-col :span="24">
<c-form v-bind="classForm">
<template #item_classid="{prop, form}">
<el-select v-model="form[prop]" placeholder="请选择班级">
<el-option v-for="item in listData.classList" :value="item.id"
:label="`${item.caption} (${item.classstudentcount}人)`" />
</el-select>
</template>
</c-form>
<c-form v-bind="teacherForm">
<!-- 上课 -->
<template #item_classcourseid="{prop,form}">
@ -44,7 +52,7 @@
<div :title="value" v-if="!!value">
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
</div>
<el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>
<!-- <el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>-->
</template>
<!-- 手机登录 -->
<template #item_mobile>
@ -90,7 +98,6 @@ const visible = ref(false) // 是否打开窗口
const myClassActive = ref({}) // APT
const imChatRef = ref(null) // im-chat ref
const emit = defineEmits(['close'])
const classForm = reactive({ // ()
form: {}, itemOption: [], option: {}
})
@ -132,7 +139,7 @@ const open = async (id) => {
nextTick(async() => {
chat = await imChatRef.value?.initImChat()
})
}
}
}
//
const handleClose = async () => {
@ -144,15 +151,16 @@ const handleClose = async () => {
// -
const initData = () => {
// -
classForm.option = { labelW: 40 }
classForm.option = { labelW: 80 }
classForm.itemOption = [
{ label: '班级', prop: 'classid' },
{ label: '学生', prop: 'student' },
// { label: '', prop: 'student' },
]
// -
teacherForm.form = { classcourseid: 0 }
teacherForm.itemOption = [
{ label: '上课', prop: 'classcourseid' },
// { label: '', prop: 'classid' },
// { label: '', prop: 'classcourseid' },
{ label: '老师扫码', prop: 'qrUrl', show: false },
{ label: '手机登录', prop: 'mobile', show: false },
{ label: '故障备用', prop: 'backup', show: false },
@ -187,10 +195,10 @@ const getClassList = async () => {
return o
});
//
if (listData.classList.length > 0) {
/*if (listData.classList.length > 0) {
classForm.form.classid = listData.classList[0].id
}
}*/
}
}
// -
@ -217,8 +225,12 @@ const getClasscourseList = async type => {
}
//
const createClasscourse = async () => {
dt.loading = true
const { classid } = classForm.form
if (!classid) {
ElMessage.warning('请选择班级')
return
}
dt.loading = true
const { entpcourseid, evalid, id, coursetitle } = myClassActive.value //
const curDate = commUtil.getDateNow('yyyy-MM-dd')
const params = {
@ -329,4 +341,4 @@ defineExpose({
.class-all{
text-align: left;
}
</style>
</style>

View File

@ -2,10 +2,10 @@
<el-dialog
v-model="centerDialogVisible"
class="reserv-dialog"
title="上课"
title="开始上课PPT"
destroy-on-close
:before-close="closeDialog"
width="600"
width="35%"
style="text-align: left"
>
<el-form
@ -15,7 +15,7 @@
label-width="auto"
style="max-width: 600px"
>
<el-form-item label="课程名称" prop="name">
<!-- <el-form-item label="课程名称" prop="name">
<el-input v-model="form.name" />
</el-form-item>
<el-form-item label="课程类型" prop="type">
@ -59,17 +59,21 @@
/>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item label="授课对象" prop="resource">
<el-checkbox-group v-model="form.resource">
</el-form-item>-->
<el-form-item label-width="80px" label="班级" prop="resource">
<el-select v-model="form.resource" placeholder="请选择班级">
<el-option v-for="(item, index) in classList" :value="item.id"
:label="`${item.caption} (${item.classstudentcount}人)`" />
</el-select>
<!-- <el-checkbox-group v-model="form.resource">
<el-checkbox v-for="(item, index) in classList" :key="index" name="type" :value="item.id"
>{{ item.caption }}({{ item.classstudentcount }})
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>-->
</el-form-item>
<el-form-item label="教室" prop="classRoom">
<!-- <el-form-item label="教室" prop="classRoom">
<el-input v-model="form.classRoom" />
</el-form-item>
</el-form-item>-->
</el-form>
<template #footer>
<div class="dialog-footer">
@ -272,7 +276,7 @@ const updateClassReserv = (formData) => {
})
}
const addClassReserv = (formData) => {
let ids = formData.resource.join(',')
let ids = formData.resource
//
if(!props.bookId){
ElMessage.warning('请选择教材')
@ -293,10 +297,10 @@ const addClassReserv = (formData) => {
addSmartClassReserv(param).then((res) => {
if (res.msg) {
closeDialog()
ElMessage({
/*ElMessage({
type: 'success',
message: '预约成功!'
})
})*/
emit('addSuccess',res.msg)
} else {
ElMessage({

View File

@ -313,7 +313,6 @@ export default {
this.openReserv()
}
if(item.fileFlag === 'apt') {
//TODO apt - fileId: aptId
this.$refs.calssRef.open(item.fileId)
}
// -store
@ -512,6 +511,7 @@ export default {
})
this.currentFileList.splice(index, 1)
})
ElMessage.success('操作成功')
}
})
},
@ -583,11 +583,7 @@ export default {
this.uploadData.levelSecondId = cata[1]
this.uploadData.levelThirdId = cata[2]
this.uploadData.textbookId = data.textBook.curBookId
toolStore.curSubjectNode.data = data
//
this.$nextTick(() => {
toolStore.curSubjectNode.querySearch = this.uploadData
})
toolStore.curSubjectNode.querySearch = this.uploadData
this.initHomeWork()
await this.asyncAllFile()
},

View File

@ -47,6 +47,7 @@ import { listEvaluation } from '@/api/subject/index'
import useUserStore from '@/store/modules/user'
import {ElMessage} from 'element-plus'
import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store'
const props = defineProps({
user: {
@ -148,7 +149,14 @@ function submit() {
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
userStore.getInfo().then(res => {
if(res.code === 200){
clearBookInfo()
let sessionSubject = {
bookList: null,
curBook: null,
curNode: null,
defaultExpandedKeys: [],
subjectTree: []
}
sessionStore.set( 'subject', sessionSubject)
ElMessage.success('修改成功')
}else{
ElMessage.error(response.msg)

View File

@ -7,7 +7,7 @@
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
</div>
<div class="stand-head-right">
<div class="stand-head-right-tit">{{booktitle}}</div>
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName : ''}}</div>
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
<div class="stand-head-right-row">
<div class="stand-head-right-row-time">更新2024.9.10</div>
@ -68,9 +68,12 @@
</div>
</div>
</div>
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
<el-dialog v-model="dialogVisible" title="切换课标" append-to-body width="550">
<div class="booklist">
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item)">{{item.edustage + item.edusubject}}</div>
<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>
</div>
@ -102,7 +105,6 @@ 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([])
@ -237,27 +239,30 @@ const getData = (data) => {
}
sourceStore.handleQuery()
getlistEvaluationclue(levelFirstId, levelSecondId)
// ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
}
//
const getAllSubject = async () => {
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
const { edustage, edusubject } = userStore.user;
rows && rows.map(item => {
if(item.edustage === edustage && item.edusubject === edusubject){
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
if(edustage === item.edustage && item.edusubject === edusubject){
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}
}
if(item.fileurl !== ''){
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)})
}
})
booksel.value = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
booksel.value = textselidx
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
await loadPdfAnimation(filePath)
}
const bookNameFormat = (edustage,edusubject) => {
return `${edustage}-${edusubject}`
}
const bookChange = async (item, idx) => {
booksel.value = idx
bookInfo.value = {...item}
booktitle.value = `${item.edustage + item.edusubject}课程标准`
pdfUrl.value = '';
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
await loadPdfAnimation(filepath)
@ -271,10 +276,6 @@ const loadPdfAnimation = (path) => {
}
onMounted(async () => {
await getAllSubject();
const { edustage, edusubject } = userStore.user;
booktitle.value = `${edustage + edusubject}课程标准`
const filePath = `${import.meta.env.VITE_APP_RES_FILE_PATH}${edustage}-${edusubject}-课标.pdf`
await loadPdfAnimation(filePath)
if(cardref.value && headref.value){
const cardH = cardref.value.offsetHeight;
const headh = headref.value.offsetHeight;
@ -529,13 +530,22 @@ onMounted(async () => {
padding-top: 1px;
overflow: auto;
.item{
width: 100%;
width: 162px;
height: auto;
padding: 8px 16px;
background-color: #ffffff;
border-top: 1px solid #f1f1f1;
font-size: 14px;
color: #3b3b3b;
float: left;
.bookimg{
width: 130px;
height: 180px;
}
.bookname{
font-size: 14px;
text-align: center;
}
}
.item:hover{
cursor: pointer;
}
.active{
background-color: #409eff;

View File

@ -0,0 +1,553 @@
<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)
}
// jsonblob
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>

View File

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

View File

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

View File

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