diff --git a/.env.development b/.env.development index df0b713..f3b45f2 100644 --- a/.env.development +++ b/.env.development @@ -15,3 +15,5 @@ VITE_APP_UPLOAD_API = 'https://file.ysaix.com:7868/prod-api' VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktxt/' VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/' + +VITE_SHOW_DEV_TOOLS = 'true' diff --git a/.env.production b/.env.production index 79007b1..05e26a6 100644 --- a/.env.production +++ b/.env.production @@ -17,3 +17,5 @@ VITE_BUILD_COMPRESS = gzip VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/' VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' + +VITE_SHOW_DEV_TOOLS = 'true' diff --git a/src/main/index.js b/src/main/index.js index 44b0d89..87a0ef1 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -73,8 +73,7 @@ function createLoginWindow() { loginWindow.loadFile(join(__dirname, '../renderer/index.html'), { hash: 'login' }) updateInit(loginWindow) } - - loginWindow.webContents.openDevTools() + if (import.meta.env.VITE_SHOW_DEV_TOOLS === 'true') loginWindow.webContents.openDevTools() loginWindow.once('ready-to-show', () => { loginWindow.show() }) @@ -96,7 +95,6 @@ function createMainWindow() { frame: false, // 无边框 autoHideMenuBar: true, maximizable: false, - fullscreen: true, icon: join(__dirname, '../../resources/logo2.ico'), ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { @@ -129,7 +127,7 @@ function createMainWindow() { shell.openExternal(details.url) return { action: 'deny' } }) - mainWindow.webContents.openDevTools() + if (import.meta.env.VITE_SHOW_DEV_TOOLS === 'true') mainWindow.webContents.openDevTools() if (is.dev && process.env['ELECTRON_RENDERER_URL']) { mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']) @@ -139,6 +137,7 @@ function createMainWindow() { // mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口 // mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见 + mainWindow.maximize(); // 第三步: 开启remote服务 remote.enable(mainWindow.webContents) } diff --git a/src/renderer/src/hooks/useClassTask.js b/src/renderer/src/hooks/useClassTask.js index 85966bb..cf960da 100644 --- a/src/renderer/src/hooks/useClassTask.js +++ b/src/renderer/src/hooks/useClassTask.js @@ -34,6 +34,7 @@ export const editListItem = (row, courseObj) => { chooseWorkLists: [],// 设计中的框架梳理list fileHomeworkList: [],// 设计中的常规作业list whiteboardObj: '',// 设计中的课堂展示对象 + question: '', // 设计中的[课堂展示]的问题 }; console.log('编辑的行', row); @@ -99,7 +100,7 @@ export const editListItem = (row, courseObj) => { console.log('row.课堂展示', row.workcodes); const workcodes = JSON.parse(row.workcodes); classtaskObj.whiteboardObj = JSON.stringify(workcodes.json); - // + classtaskObj.question = row.worktag; // console.log('课堂展示', classtaskObj); return resolve(classtaskObj); } diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index 937b498..445cf22 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -138,7 +138,7 @@ export const createWindow = async (type, data) => { wins_tool.setIgnoreMouseEvents(true, {forward: true}) // 忽略鼠标事件但是事件继续传递给窗口 wins_tool.setAlwaysOnTop(true,'screen-saver') // 将窗口设置为顶层窗口 wins_tool.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见 - wins_tool.webContents.openDevTools() // 打开调试工具 + if (import.meta.env.VITE_SHOW_DEV_TOOLS === 'true') wins_tool.webContents.openDevTools() // 打开调试工具 eventHandles(type, wins_tool) // 事件监听处理 return wins_tool } @@ -165,7 +165,7 @@ export const createWindow = async (type, data) => { win.type = type // 唯一标识 win.show() win.setFullScreen(true) // 设置窗口为全屏 - win.webContents.openDevTools() // 打开调试工具 + if (import.meta.env.VITE_SHOW_DEV_TOOLS === 'true') win.webContents.openDevTools() // 打开调试工具 eventHandles(type, win) // 事件监听处理 winPdf=win break diff --git a/src/renderer/src/views/classTask/classTaskAssign.vue b/src/renderer/src/views/classTask/classTaskAssign.vue index 7f16a8d..8b58f5b 100644 --- a/src/renderer/src/views/classTask/classTaskAssign.vue +++ b/src/renderer/src/views/classTask/classTaskAssign.vue @@ -6,7 +6,7 @@ :collapse="isCollapse" > -
+
@@ -34,7 +34,7 @@ -
+
{{ _item.worktype }}
分值:{{ _item.score }}
-
+
预览
@@ -188,7 +188,7 @@
-
+
预览其他类型附件! @@ -220,7 +220,7 @@ -
+
- +
@@ -309,7 +309,7 @@ import SetHomework from '@/components/set-homework/index.vue' import {sessionStore} from '@/utils/store' import {createWindow} from '@/utils/tool' import { useToolState } from '@/store/modules/tool' -import {throttle,debounce } from '@/utils/comm' +import {throttle,debounce } from '@/utils/comm' const toolState = useToolState(); @@ -343,7 +343,7 @@ const courseObj = reactive({ }) const taskList = ref([]); // 作业列表 -const loading = ref(false); +const loading = ref(false); const pushRecordsList = ref([]); // 作业推送历史 const pushRecordsOpen = ref(false); // 推送历史记录弹窗 const pushRecordsLoading = ref(false); // 推送历史记录loading @@ -415,7 +415,7 @@ const initHomeWork = async()=> { } /** * 查看推送历史 - * + * */ const queryPushRecords = (row) => { // 获取已推送历史 @@ -438,7 +438,7 @@ const queryPushRecords = (row) => { // if (res.rows[i].worktype == '学习目标定位') { // res.rows[i].workclass = 'success'; // res.rows[i].workcodesList = JSON.parse(res.rows[i].workcodes); - // } else + // } else // 课标研读 目标设定 教材研读 框架梳理 学科定位 TODO 后续接入在添加 if (res.rows[i].worktype == '课堂展示') { res.rows[i].workclass = 'primary'; @@ -477,12 +477,12 @@ const debounceOpenWin = debounce(() => { // 批改作业 const onClickItem = (item) => { console.log('防抖开启弹窗') - // sessionStore.set('teachClassWorkItem', item); // 缓存点击的item + // sessionStore.set('teachClassWorkItem', item); // 缓存点击的item localStorage.setItem('teachClassWorkItem', JSON.stringify(item)); debounceOpenWin(); } -/** +/** * 删除按钮操作 TODO 待完善 * */ const handleDelete =() => { @@ -620,8 +620,8 @@ const handleWorkTitleEdit = (row, index, type) => { }; /** - * 作业内容-查看详情 - * */ + * 作业内容-查看详情 + * */ const handleWorkEdit = (row, index) =>{ console.log(row, index) workEdit.value = true @@ -639,7 +639,7 @@ const handleWorkTitleEdit = (row, index, type) => { if ( res.data==null || res.data==undefined ) { return; } - + res.data.worktype = '框架梳理'; res.data.score = listCourseWork[0].score; @@ -708,7 +708,7 @@ const handleWorkTitleEdit = (row, index, type) => { }; /** * 作业内容-前往作业设计 编辑页面 - * @param row + * @param row */ const handleWorkEditItem = (row) => { editListItem(row, courseObj).then((obj) => { @@ -780,11 +780,11 @@ const handleTaskAssignToAllClass = () => { */ const handleNewClassWorkDialog = () => { // 打开作业设计页面 - router.push({ + router.push({ path: '/newClassTask', query: { isBack: true, - } + } }); } @@ -880,18 +880,20 @@ watch(() => courseObj.node, (newVal,oldVal) => { + - \ No newline at end of file + diff --git a/src/renderer/src/views/classTask/container/classOverview.vue b/src/renderer/src/views/classTask/container/classOverview.vue index 6b6687a..fbe48ce 100644 --- a/src/renderer/src/views/classTask/container/classOverview.vue +++ b/src/renderer/src/views/classTask/container/classOverview.vue @@ -1,5 +1,5 @@ diff --git a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue index 5447495..3679328 100644 --- a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue +++ b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue @@ -1,32 +1,40 @@ + \ No newline at end of file diff --git a/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue b/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue index c1de098..917cc43 100644 --- a/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue +++ b/src/renderer/src/views/classTask/container/classOverview/distribution/stuList.vue @@ -16,11 +16,14 @@ - + diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index c1ae83a..431913f 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -21,7 +21,7 @@
- +
@@ -29,7 +29,7 @@
-
+
@@ -54,7 +54,7 @@ - 查找 @@ -89,7 +89,7 @@ -
+
@@ -119,10 +119,10 @@ @@ -189,7 +189,7 @@ -
+
预览 删除
@@ -349,6 +349,7 @@ let classWorkForm = reactive({ chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[], // 作业框架梳理list fileHomeworkList: props.propsformobj.fileHomeworkList?cloneDeep(props.propsformobj.fileHomeworkList):[], // 常规作业文件列表 whiteboardObj: props.propsformobj.whiteboardObj?cloneDeep(props.propsformobj.whiteboardObj):'', // 作业资源 - 课堂展示 白板 + question: props.propsformobj.question?cloneDeep(props.propsformobj.question):'', // 作业资源 - 课堂展示 输入的问题 }); // 提交的作业内容 // --------------------------------------------------- // const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型 @@ -363,7 +364,7 @@ const fileLoading = ref(false); // 常规作业loading * 作业类型切换 */ const changeFormType = (val) => { - classWorkForm.worktype = val; + classWorkForm.worktype = val; } /** @@ -372,7 +373,7 @@ const changeFormType = (val) => { * @param {*} queryType * 1 - 按条件查询 * 2 - 按关键词查询 - */ + */ const handleQueryParamFromEntpCourseWork = (queryType) => { // 确保更改了搜索参数后从第一页开始查询 // this.paginationParams = {pageNum: 1,pageSize: 10}; 分页这里展示弃用了 @@ -411,7 +412,7 @@ const handleQueryFromEntpCourseWork= (queryType) => { keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'', } - + // 分页参数 // pageNum: paginationParams.pageNum, // pageSize: paginationParams.pageSize, @@ -421,7 +422,7 @@ const handleQueryFromEntpCourseWork= (queryType) => { // // [初中+政治]需改为[初中+道德与法治] // queryForm.edusubject = '道德与法治'; // } - + listEntpcourseworkNew(queryForm).then(entpcourseworkres => { // if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') { // // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】 @@ -432,7 +433,7 @@ const handleQueryFromEntpCourseWork= (queryType) => { // } else { // workResource.entpCourseWorkList = entpcourseworkres.rows; // } - + if(entpcourseworkres.data&&entpcourseworkres.data.length>0){ workResource.entpCourseWorkList = entpcourseworkres.data; workResource.entpCourseWorkTotal = entpcourseworkres.data.length; @@ -510,7 +511,7 @@ const getEntpCourseWorkPointList = () => { /** * 添加资源 * @param fromsrc - 试题来源 - * @param entpcourseworkid + * @param entpcourseworkid */ const handleClassWorkQuizAdd = (fromsrc, entpcourseworkid) => { var exist = false; @@ -609,11 +610,11 @@ const handleClassWorkSave = async () => { uniquekey: classWorkForm.uniquekey,// 作业名称、编码 classid: 0, classcourseid: 0, - entpcourseid: chapterId, // 这个字段很特别 + entpcourseid: chapterId, // 这个字段很特别 slideid: 0, title: classWorkForm.title, // 作业说明? workcodes: JSON.stringify(classWorkForm.workcodes), // 作业内容? - edusubject: userStore.edusubject, // 学科 语文 数学 + edusubject: userStore.edusubject, // 学科 语文 数学 evalid: props.bookobj.levelSecondId, //userStore.evalid, // // 单元下的课ID edustage: userStore.edustage, // 学段 年纪 高中,初中,小学 status: '10', //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空 @@ -629,16 +630,17 @@ const handleClassWorkSave = async () => { return; } - - + + if (classWorkForm.worktype === "课堂展示") { boardLoading.value = true let canvasJson = proxy.$refs.boardref.getCanvasJson() let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64() // 课堂展示提交内容 - cform.title = classWorkForm.title; + cform.worktag = classWorkForm.question; + cform.title = classWorkForm.title; cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64}); cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]); try { @@ -648,18 +650,19 @@ const handleClassWorkSave = async () => { classWorkForm.worktype = "课堂展示"; classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称 classWorkForm.title = ""; + classWorkForm.question = ""; classWorkForm.quizlist = [], // 作业习题列表内容 // 情况选择的资源缓存 classWorkForm.chooseWorkLists = []; // 框架梳理list classWorkForm.whiteboardObj = ''; // ? // 清空白板 - + boardLoading.value = false }) } finally { boardLoading.value = false } - } + } else if(classWorkForm.worktype === "常规作业"){ fileLoading.value = true cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); @@ -707,7 +710,7 @@ const handleClassWorkSave = async () => { } console.log(cform,'提交的数据'); if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'}); - + addClassworkReturnId(cform).then(workres => { ElMessage({ type: 'success', message: '作业设计成功!'}); // 重置提交表单 @@ -725,7 +728,7 @@ const handleClassWorkSave = async () => { }) } - + if(props.isback){ // 其他页面进入的 返回上一页 router.back(); @@ -764,20 +767,20 @@ const editWork = async (cform) =>{ // 根据作业类型分类处理 if (classWorkForm.worktype=='习题训练'){ - + // 1.判断当前添加的作业是否与原来不同(跟父组件传来的值对比) let needUplEval = false; if (classWorkForm.quizlist.length != props.propsformobj.quizlist.length) { needUplEval = true; }else { // 只要有一个不一致则说明需要更新 - needUplEval = classWorkForm.quizlist.some(cur => - !props.propsformobj.quizlist.some(last => + needUplEval = classWorkForm.quizlist.some(cur => + !props.propsformobj.quizlist.some(last => last.id === cur.id && last.score === cur.score ) ); } - + // 2.需要重新更新eval的数据 if (needUplEval) { // 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加 @@ -788,7 +791,7 @@ const editWork = async (cform) =>{ arrEvalids.push(element.id); }); const ids = arrEvalids.join(','); - + // 2.2.删除原作业 const delRes = await delClassworkeval(ids); @@ -819,8 +822,8 @@ const editWork = async (cform) =>{ needUplEval = true; }else { // 只要有一个不一致则说明需要更新 - needUplEval = classWorkForm.chooseWorkLists.some(cur => - !props.propsformobj.chooseWorkLists.some(last => + needUplEval = classWorkForm.chooseWorkLists.some(cur => + !props.propsformobj.chooseWorkLists.some(last => last.id === cur.id && last.score === cur.score ) ); @@ -839,6 +842,7 @@ const editWork = async (cform) =>{ let canvasJson = proxy.$refs.boardref.getCanvasJson() let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64() cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64}); + cform.worktag = classWorkForm.question; } else if (classWorkForm.worktype=='常规作业') { // 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去) @@ -884,15 +888,15 @@ watch(() => props.bookobj.levelSecondId, (newVal) => { .container { display: flex; flex-direction: column; - height: 100%; + height: 100%; } .top, .bottom { - flex: 0 0 auto; + flex: 0 0 auto; } .middle { - flex: 1; + flex: 1; height: 100%; overflow: hidden; } @@ -919,8 +923,8 @@ watch(() => props.bookobj.levelSecondId, (newVal) => { .work-right { height: 100%; - padding: 0 0 0 5px; - overflow: auto; + padding: 0 0 0 5px; + overflow: auto; line-height: 26px; overflow: hidden; } @@ -931,19 +935,19 @@ watch(() => props.bookobj.levelSecondId, (newVal) => { display: flex; flex-direction: column; align-items: center; - margin-bottom: 5px; + margin-bottom: 5px; .choose-work-title{ - font-size: 1.2em; + font-size: 1.2em; font-weight: bold; margin-right: 5px } .choose-work-content{ - width: 100%; + width: 100%; display: flex; justify-content: space-around; - flex-direction: column; + flex-direction: column; flex: 1; :deep(.el-form-item__label){ width: 50px !important; diff --git a/src/renderer/src/views/classTask/newClassTask.vue b/src/renderer/src/views/classTask/newClassTask.vue index fd4740c..bf73688 100644 --- a/src/renderer/src/views/classTask/newClassTask.vue +++ b/src/renderer/src/views/classTask/newClassTask.vue @@ -6,7 +6,7 @@ :collapse="isCollapse" > -
+
@@ -69,6 +69,7 @@ const classWorkForm = reactive({ chooseWorkLists: classtaskObj? JSON.parse(classtaskObj).chooseWorkLists : [],// 设计中的框架梳理list fileHomeworkList: classtaskObj? JSON.parse(classtaskObj).fileHomeworkList : [],// 设计中的常规文件作业list whiteboardObj: classtaskObj? JSON.parse(classtaskObj).whiteboardObj : '',// 设计中的 课堂展示 板书作业 + question: classtaskObj? JSON.parse(classtaskObj).question : '',// 设计中的 课堂展示 输入的问题 }) diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index d6a5ab2..5f9e3e1 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -23,7 +23,7 @@ v-if="classWorkAnalysis.row.worktype == '习题训练'" :type="classWorkAnalysis.view == 'quizStats' ? 'success' : ''" @click="workHandle('quizStats')" - >逐题分析逐题讲评 完美 优秀 良好 及格 不及格 @@ -131,7 +131,7 @@
- +
@@ -139,7 +139,7 @@
- +
@@ -180,7 +180,7 @@ const tableRadio = reactive({ const loading_dt_table = ref(false) const isopen_dtwk_table = ref(false) -// zdg: 逐题分析 +// zdg: 逐题讲评 const classWorkActiveData = reactive({ quizlist: [], // 当前习题列表 studentList: [], // 当前课程-所有学生 @@ -528,7 +528,7 @@ const escapeHtmlQuotes = (str) => { return result; } -//#region 逐题分析 +//#region 逐题讲评 // 查看学生-作业概览 const workHandle = (type) => { // 关闭右侧批阅ui @@ -633,7 +633,7 @@ const closeDialog = () => { } onMounted(() => { - + const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); // const data = sessionStore.get('teachClassWorkItem'); // const data = localStorage.getItem('teachClassWorkItem'); @@ -646,20 +646,18 @@ onMounted(() => { watch(classWorkAnalysis, (newVal, oldVal) => { if(newVal.view != 'quizStats'){ console.log('关闭zdg: 定时执行') - clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题分析的 + clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的 } }) onUnmounted(() => { - clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题分析的 + clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的 }) // defineExpose({ // }) - - - + diff --git a/src/renderer/src/views/examReport/index.vue b/src/renderer/src/views/examReport/index.vue index 9a4c791..ff4b637 100644 --- a/src/renderer/src/views/examReport/index.vue +++ b/src/renderer/src/views/examReport/index.vue @@ -14,7 +14,7 @@
    
- +
    
- +