Compare commits

...

34 Commits

Author SHA1 Message Date
baigl 53ccb2236e Merge pull request 'baigl' (#185) from baigl into main
Reviewed-on: #185
2024-12-26 14:20:33 +08:00
白了个白 00119e4a49 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-26 14:18:47 +08:00
白了个白 4bbe89ed31 课堂展示:画布选中物品,移除优化 2024-12-26 14:18:12 +08:00
zhangxuelin 49e16c458f Merge pull request '1' (#184) from zxl into main
Reviewed-on: #184
2024-12-26 14:13:31 +08:00
zhangxuelin 5fb447d5e6 1 2024-12-26 14:12:47 +08:00
yangws 9aa17ed786 Merge pull request 'fix:头像的样式问题;' (#183) from yws_dev into main
Reviewed-on: #183
2024-12-26 10:40:29 +08:00
白了个白 ccbafea3d4 Merge branch 'zouyf_dev' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-26 10:26:19 +08:00
白了个白 1f9111a89d 课堂展示:画布拖选问题修复 2024-12-26 10:25:54 +08:00
“zouyf” be78520410 Merge branch 'main' into zouyf_dev 2024-12-26 10:08:10 +08:00
“zouyf” 4b935b9110 1 2024-12-25 17:30:42 +08:00
白了个白 1a3598d7c0 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-25 17:26:45 +08:00
白了个白 2fdd997c5e 1 2024-12-25 17:26:14 +08:00
“zouyf” 96e01ae711 Merge branch 'main' into zouyf_dev 2024-12-25 17:04:50 +08:00
“zouyf” d8c4876119 [科学实验] - 更新作业学段学科回显 2024-12-25 17:04:29 +08:00
“zouyf” d9a0f2f8c3 1 2024-12-25 11:20:18 +08:00
“zouyf” 89cba04b8c Merge branch 'main' into zouyf_dev
# Conflicts:
#	src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue
2024-12-25 11:02:19 +08:00
“zouyf” dd0160865b Merge branch 'main' into zouyf_dev 2024-12-25 10:09:57 +08:00
“zouyf” ff0dd3600c 1 2024-12-25 10:06:03 +08:00
“zouyf” 63b8a0d5c6 Merge branch 'main' into zouyf_dev 2024-12-23 15:28:49 +08:00
“zouyf” f6b08169b6 Merge branch 'main' into zouyf_dev 2024-12-23 10:11:48 +08:00
“zouyf” af60c5cc17 Merge branch 'baigl' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into zouyf_dev 2024-12-20 14:49:02 +08:00
“zouyf” e67756192a Merge branch 'main' into zouyf_dev 2024-12-20 14:48:30 +08:00
“zouyf” 73d4ee03ba Merge branch 'main' into zouyf_dev 2024-12-20 14:08:27 +08:00
“zouyf” 8863e05a1a Merge branch 'main' into zouyf_dev 2024-12-20 11:18:03 +08:00
“zouyf” debd5e1942 Merge branch 'main' into zouyf_dev 2024-12-20 10:27:19 +08:00
“zouyf” c8b8c21875 Merge branch 'main' into zouyf_dev 2024-12-19 15:51:19 +08:00
“zouyf” c8729a7008 [试题上传] - 兼容优化菁优网题型 2024-12-19 15:51:06 +08:00
“zouyf” 2bdac6e2ea Merge branch 'main' into zouyf_dev 2024-12-18 10:31:46 +08:00
“zouyf” 058509b29c 1 2024-12-18 10:31:20 +08:00
“zouyf” 9a2a55c62b 1 2024-12-16 17:30:00 +08:00
“zouyf” 19efe185c5 Merge branch 'main' into zouyf_dev 2024-12-16 17:14:22 +08:00
“zouyf” 78ecf6ea55 [查询试题] - 单元查询优化 2024-12-16 17:13:56 +08:00
“zouyf” cccf109499 Merge branch 'main' into zouyf_dev 2024-12-13 10:12:14 +08:00
“zouyf” 4a0e9b0b84 批改作业 2024-12-13 10:11:33 +08:00
21 changed files with 459 additions and 209 deletions

View File

@ -89,8 +89,6 @@ import ButtonGroup from '../../../../components/ButtonGroup.vue'
import Popover from '../../../../components/Popover.vue' import Popover from '../../../../components/Popover.vue'
import NumberInput from '../../../../components/NumberInput.vue' import NumberInput from '../../../../components/NumberInput.vue'
import { PPTApi } from '../../../../api' import { PPTApi } from '../../../../api'
import { Console } from 'node:console'
import { x64 } from 'crypto-js'
const shapeClipPathOptions = CLIPPATHS const shapeClipPathOptions = CLIPPATHS
const ratioClipOptions = [ const ratioClipOptions = [
{ {

View File

@ -71,6 +71,14 @@ export function updateClassworkeval(data) {
}) })
} }
export function updateClassworkevalList(data) {
return request({
url: '/education/classworkeval/updateList',
method: 'put',
data: data
})
}
// 修改classworkdata // 修改classworkdata
export function updateClassworkdata(data) { export function updateClassworkdata(data) {
return request({ return request({

View File

@ -135,4 +135,18 @@ export function getJYPath(url,config) {
method: config.method||"get", method: config.method||"get",
params: config.params params: config.params
}) })
}
/**
* @desc: 百度识图转发
* @return: {*}
* @param {*} data
*/
export function getOcrContent(data) {
return request({
url: '/ocr/exam',
method: 'post',
data: data
})
} }

View File

@ -7,7 +7,7 @@
<i class="iconfont icon-xiangyou"></i> <i class="iconfont icon-xiangyou"></i>
</div> </div>
<div class="book-list" v-loading="treeLoading"> <div class="book-list" v-loading="treeLoading">
<el-tree :data="treeData" accordion :props="defaultProps" node-key="id" <el-tree :data="treeData" accordion :props="defaultProps" node-key="id" :render-content="renderContent"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current :default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
@node-click="handleNodeClick"> @node-click="handleNodeClick">
<template #default="{ node }"> <template #default="{ node }">
@ -178,6 +178,18 @@ const handleNodeClick = (data) => {
sessionStore.set('subject.curNode', nodeData) sessionStore.set('subject.curNode', nodeData)
emit('nodeClick', curData) emit('nodeClick', curData)
} }
const renderContent = (h, { node, data, store }) => {
return h(
'span',
{
style: {
color: data.bookId==''||data.bookId=='0' ? '#A5B3CA' : 'black',
},
},
node.label
);
}
onMounted( async () => { onMounted( async () => {
treeLoading.value = true treeLoading.value = true
try{ try{

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="whiteboart-container" :style="{ height: height + 'px' }"> <div class="whiteboart-container" :style="{ height: height + 'px' }">
<div class="canvasBox" ref="box"></div> <div class="canvasBox" ref="box" @mouseleave="handleMouseLeave" ></div>
<div class="footerLeft" @click.stop <div class="footerLeft" @click.stop
:style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']"> :style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']">
@ -278,7 +278,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue' import { onMounted, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue'
import TinyWhiteboard from 'whiteboard_lyc' import TinyWhiteboard from 'whiteboard_lyc'
import ColorPicker from './components/ColorPicker.vue' import ColorPicker from './components/ColorPicker.vue'
import { import {
@ -305,6 +305,7 @@ import { fontFamilyList, fontSizeList } from './constants'
const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href
const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href
const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -507,10 +508,6 @@ const backToCenter = () => {
app.scrollToCenter() app.scrollToCenter()
} }
const cancelActiveElement = () =>{
app.cancelActiveElement()
}
// //
const showFit = () => { const showFit = () => {
@ -716,8 +713,15 @@ watch(() => props.data, (newVal) => {
// dom // dom
onMounted(() => { onMounted(() => {
// init();
app = new TinyWhiteboard({ })
/**
* 初始化画布内容
*/
const init = () => {
//
app = new TinyWhiteboard({
container: box.value, container: box.value,
drawType: currentType.value, drawType: currentType.value,
state: { state: {
@ -737,6 +741,7 @@ onMounted(() => {
}) })
// //
app.on('activeElementChange', element => { app.on('activeElementChange', element => {
console.log('点击元素 监听 activeElementChange-----------')
if (activeElement.value) { if (activeElement.value) {
activeElement.value.off('elementRotateChange', onElementRotateChange) activeElement.value.off('elementRotateChange', onElementRotateChange)
} }
@ -784,7 +789,17 @@ onMounted(() => {
app.resize() app.resize()
}, 300) }, 300)
}) })
}) }
/**
* 课堂展示-鼠标离开白板监听事件该事件是避免选中状态在其他地方点击后退删除等事件会删除白板内选中的元素
*/
const handleMouseLeave = () => {
console.log('离开白板')
// --
app.cancelActiveElement()
// TODO
};
// //
defineExpose({ defineExpose({
@ -795,7 +810,6 @@ defineExpose({
getCanvasBase64, getCanvasBase64,
setCanvasData, setCanvasData,
getCanvasBlob, getCanvasBlob,
cancelActiveElement
}) })
</script> </script>

View File

@ -1,5 +1,7 @@
import { listEntpcoursework,getEvaluationclue } from '@/api/classTask'; import { listEntpcoursework,getEvaluationclue } from '@/api/classTask';
import { processList } from '@/hooks/useProcessList'; import { processList } from '@/hooks/useProcessList';
import useClassTaskStore from '@/store/modules/classTask'
const useClassTaskStores = useClassTaskStore();
const isJson = (str) => { const isJson = (str) => {
if (typeof str == 'string') { if (typeof str == 'string') {
@ -114,6 +116,14 @@ export const editListItem = (row, courseObj) => {
} }
else if (row.worktype == '科学实验') { else if (row.worktype == '科学实验') {
if(isJson(row.workcodes)){ if(isJson(row.workcodes)){
// 同步更新实验内部的科目信息
if (row.worktag && row.worktag.indexOf('-') > -1){
const eduInfo = row.worktag.split('-');
useClassTaskStores.experimentObj.edustage = eduInfo[0];
useClassTaskStores.experimentObj.edusubject = eduInfo[1];
useClassTaskStores.experimentObj.updateEduInfo = row.worktag;
}
// 更新科学实验内容
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes); classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
// //
// console.log('科学实验', classtaskObj); // console.log('科学实验', classtaskObj);

View File

@ -299,21 +299,28 @@ export const processList = (row, aloneOption=false) => {
if(!aloneOption && j%2== 0){ if(!aloneOption && j%2== 0){
tmp += '</div>'; tmp += '</div>';
} }
row[i].workdescFormat = tmp row[i].workdescFormat = tmp;
// 处理[答案显示] - 转换ABCD // 处理[答案显示] - 转换ABCD
let arr2Char = workAnswerArr let arr2Char = workAnswerArr
.map((item) => { .map((item) => {
return String.fromCharCode(65 + Number(item)) return String.fromCharCode(65 + Number(item))
}) })
.join('') .join('');
row[i].workanswerFormat = arr2Char row[i].workanswerFormat = arr2Char;
} else if (row[i].worktype == '填空题') { } else if (row[i].worktype == '填空题') {
// 处理[选项显示] - 填空题中无选项, 故置空 // 处理[选项显示] - 填空题中无选项, 故置空
row[i].workdescFormat = '' row[i].workdescFormat = '';
// 处理[答案显示] - 逗号连接 // 处理[答案显示] - 逗号连接
row[i].workanswerFormat = workAnswerArr.join('、')
// 当[答案显示]为 [<div] 开头时,不再需逗号连接(一般为自主上传, 当前答案每个自带div标签)
let linkChar = '、';
if (workAnswerArr.length != 0 && workAnswerArr[0].indexOf('<div') == 0) {
linkChar = '';
}
row[i].workanswerFormat = workAnswerArr.join(linkChar);
} else if (row[i].worktype == '判断题') { } else if (row[i].worktype == '判断题') {
// 处理[选项显示] - 判断题中无选项, 故置空 // 处理[选项显示] - 判断题中无选项, 故置空
row[i].workdescFormat = '' row[i].workdescFormat = ''

View File

@ -7,8 +7,9 @@ const useClassTaskStore = defineStore('classTask',{
state: () => ({ state: () => ({
experimentObj:{ experimentObj:{
edustage: '小学', // 教育阶段 edustage: '小学', // 教育阶段
edusubject: '', // 学科 edusubject: '数学', // 学科
experimentList: [], // 实验科目列表 experimentList: [], // 实验科目列表
updateEduInfo: '小学-数学', //实际需上传的学段+学科信息(用于上传及回显实验内的学段学科)
}, },
isOpenQuestUploadView: false, // 是否打开习题上传的页面 isOpenQuestUploadView: false, // 是否打开习题上传的页面
classListIds: [], classListIds: [],

View File

@ -435,7 +435,7 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue' // import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { updateClassworkeval, getClassworkdata, updateClassWorkDataAutoFinish } from '@/api/classTask' import { getClassworkdata, updateClassworkevalList, updateClassWorkDataAutoFinish } from '@/api/classTask'
import { getTimeDate } from '@/utils/date' import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm'; import { quizStrToList } from '@/utils/comm';
@ -894,22 +894,41 @@ const onSubmit = () => {
}) })
// //
classWorkFormScore.teacherRating && const queryList = [];
classWorkFormScore.teacherRating.map((item, index) => { classWorkFormScore.teacherRating && classWorkFormScore.teacherRating.map((item, index) => {
const queryParams = { const queryParams = {
id: item.id, id: item.id,
teacherRating: item.score, // teacherRating: item.score, //
rating: classWorkFormScore.rating, // rating: classWorkFormScore.rating, //
teacherremark: classWorkFormScore.teacherremark, // teacherremark: classWorkFormScore.teacherremark, //
timestamp: getTimeDate() // timestamp: getTimeDate() //
} }
console.log(queryParams) queryList.push(queryParams)
updateClassworkeval(queryParams).then((res) => { })
// if(res.code == 200){ //console.log('queryList->', queryList)
// updateClassworkevalList(queryList).then((res) => {
// } // if(res.code == 200){
}) //
}) // }
})
//
// classWorkFormScore.teacherRating &&
// classWorkFormScore.teacherRating.map((item, index) => {
// const queryParams = {
// id: item.id,
// teacherRating: item.score, //
// rating: classWorkFormScore.rating, //
// teacherremark: classWorkFormScore.teacherremark, //
// timestamp: getTimeDate() //
// }
// console.log(queryParams)
// updateClassworkeval(queryParams).then((res) => {
// // if(res.code == 200){
// //
// // }
// })
// })
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '提交成功!' message: '提交成功!'

View File

@ -55,6 +55,7 @@
<el-col :span="11"> <el-col :span="11">
<el-form-item label="知识点" label-width="70"> <el-form-item label="知识点" label-width="70">
<el-cascader <el-cascader
disabled
v-model="entpCourseWorkQueryParams.point" v-model="entpCourseWorkQueryParams.point"
clearable clearable
style="width: 100%" style="width: 100%"
@ -172,7 +173,7 @@
<!-- 非习题训练常规作业 --> <!-- 非习题训练常规作业 -->
<div v-if="classWorkForm.worktype!='习题训练'"> <div v-if="classWorkForm.worktype!='习题训练'">
<div :style="{ 'overflow': 'auto'}"> <div :style="{ 'overflow': 'auto'}">
<template v-if="classWorkForm.worktype!='常规作业'"> <!-- <template v-if="classWorkForm.worktype!='常规作业'">
<template v-for="(item, index) in workResource.teachResourceList" :key="item"> <template v-for="(item, index) in workResource.teachResourceList" :key="item">
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;"> <div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;"> <div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
@ -193,7 +194,7 @@
</div> </div>
</div> </div>
</template> </template>
</template> </template> -->
<template v-if="classWorkForm.worktype =='常规作业'"> <template v-if="classWorkForm.worktype =='常规作业'">
<div v-loading="fileLoading" class="upload-homework"> <div v-loading="fileLoading" class="upload-homework">
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/> <FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
@ -285,6 +286,7 @@ import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval
import { listEvaluation } from '@/api/subject' import { listEvaluation } from '@/api/subject'
import { listEntpcoursefile } from '@/api/education/entpcoursefile' import { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint"; import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
@ -459,12 +461,13 @@ const client = new Apis('/paht');
*/ */
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = { const queryForm = {
// //
currentPage: paginationParams.pageNum, currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize, pageSize: paginationParams.pageSize,
// //
eid: props.bookobj.levelSecondId, eid: evalId, // id
sectionName: props.bookobj.coursetitle, sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject, edusubject: userStore.edusubject,
edustage: userStore.edustage, edustage: userStore.edustage,
@ -557,9 +560,12 @@ const getQueryFromEvaluationclue = () => {
} }
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']'); const tmpJson = '['+clueres.rows[i].childlist+']';
for (var j=0; j<clueres.rows[i].childArray.length; j++) { if (isJson(tmpJson)){
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
}
} }
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
@ -990,6 +996,8 @@ const initPageParams = () => {
onMounted(async() => { onMounted(async() => {
//
getEntpCourseWorkPointList();
}) })
// const refreshData = () => { // const refreshData = () => {
@ -1016,9 +1024,9 @@ const debounceQueryData = debounce(() => {
// //
handleQueryFromEntpCourseWork(0); handleQueryFromEntpCourseWork(0);
// //
getQueryFromEvaluationclue(); //getQueryFromEvaluationclue();
// //
getEntpCourseWorkPointList(); //getEntpCourseWorkPointList();
}, 1000); }, 1000);
watch(() => props.propsformobj.uniquekey, (newVal) => { watch(() => props.propsformobj.uniquekey, (newVal) => {
@ -1027,8 +1035,20 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; // classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
} }
}) })
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData(); debounceQueryData();
}) })

View File

@ -36,16 +36,24 @@ const props = defineProps({
}) })
const value = ref('') const value = ref('')
const updateLabel = (val) => {
value.value = val;
}
const onSelectOption = (option) => {
classTaskStore.updateEduInfo = `${classTaskStore.edustage}-${classTaskStore.edusubject}`;
console.log('updateEduInfo->', classTaskStore.updateEduInfo);
console.log(option,'选择的实验课-------')
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
}
onMounted(() => { onMounted(() => {
}) })
const onSelectOption = (option) => { defineExpose({
console.log(option,'选择的实验课-------') updateLabel
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0]) })
}
</script> </script>
<style scoped> <style scoped>

View File

@ -56,7 +56,7 @@ const subjectList = ref([])
const chooseGrade= ref({}) const chooseGrade= ref({})
const expList = ref([]) // const expList = ref([]) //
const checkList = ref([])// const checkList = ref([])//
const isLoaded = ref(false);
// //
const getSubject = () => { const getSubject = () => {
@ -80,8 +80,15 @@ const getSubject = () => {
}) })
}) })
console.log(subjectList,'subjectList'); console.log(subjectList,'subjectList');
// //
handleUserEduStage(useClassTaskStore().experimentObj.edustage) const edusubject = useClassTaskStore().experimentObj.edusubject;
handleUserEduStage(useClassTaskStore().experimentObj.edustage);
// , , .
useClassTaskStore().experimentObj.edusubject = edusubject;
// []
isLoaded.value = true;
//console.log('----');
} }
// //
const isExpList = (edusubject) => { const isExpList = (edusubject) => {
@ -108,7 +115,8 @@ const isExpList = (edusubject) => {
// //
const handleUserEduStage = (item) => { const handleUserEduStage = (item) => {
// userStore.edustage = item // userStore.edustage = item
useClassTaskStore().experimentObj.edustage = item useClassTaskStore().experimentObj.edustage = item;
// //
expList.value = [] expList.value = []
if(item === '小学'){ if(item === '小学'){
@ -117,10 +125,11 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '小学'); const newSubjectList = subjectList.value.filter(item => item.edustage === '小学');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name)){ if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
useClassTaskStore().experimentObj.edusubject = name; //useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
}else if(item === '初中'){ }else if(item === '初中'){
@ -129,10 +138,11 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '初中'); const newSubjectList = subjectList.value.filter(item => item.edustage === '初中');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name)){ if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
useClassTaskStore().experimentObj.edusubject = name; //useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
}else if(item === '高中'){ }else if(item === '高中'){
@ -141,10 +151,11 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '高中'); const newSubjectList = subjectList.value.filter(item => item.edustage === '高中');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name)){ if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
useClassTaskStore().experimentObj.edusubject = name; //useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
} }
@ -177,10 +188,59 @@ const handleUserEduSubject = (item) => {
// emit('experlist',checkList.value) // emit('experlist',checkList.value)
} }
const updateCheckList = async () => {
try {
await waitForSubjectData();
//console.log('-------', );
//console.log('experimentObj-> ', useClassTaskStore().experimentObj);
//
const edustage = useClassTaskStore().experimentObj.edustage;
if(edustage === '小学'){
chooseGrade.value = jsonData.data.primary
}else if(edustage === '初中'){
chooseGrade.value = jsonData.data.junior
}else if(edustage === '高中'){
chooseGrade.value = jsonData.data.senior
}
expList.value = chooseGrade.value
const edusubject = useClassTaskStore().experimentObj.edusubject;
handleUserEduSubject(edusubject);
} catch (error) {
console.error(error);
}
}
const waitForSubjectData = () => {
return new Promise((resolve, reject) => {
let timeoutId;
let intervalId;
const checkIsLoaded = () => {
if (isLoaded.value) {
clearInterval(intervalId);
clearTimeout(timeoutId);
resolve();
}
};
intervalId = setInterval(checkIsLoaded, 100);
timeoutId = setTimeout(() => {
clearInterval(intervalId);
reject(new Error('该作业-等待[科学实验]学科学段初始化超时'));
}, 5000);
});
};
onMounted(() => { onMounted(() => {
getSubject() getSubject()
}) })
defineExpose({
updateCheckList
})
</script> </script>
<style scoped> <style scoped>
.custom-button { .custom-button {

View File

@ -3,10 +3,10 @@
<div class="activeExp-header"> <div class="activeExp-header">
<div class="infomation" v-if="isStadium() !== true" > <div class="infomation" v-if="isStadium() !== true" >
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> --> <!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
<selectClass v-if="!isSubject" /> <selectClass ref="selectClassRef"/>
</div> </div>
<div> <div>
<selectExperiment @selectItem="getExperimentListItem" /> <selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
</div> </div>
</div> </div>
<div ref="mainDiv" class="activeExp-main" style="overflow: auto"> <div ref="mainDiv" class="activeExp-main" style="overflow: auto">
@ -19,7 +19,7 @@
<script setup> <script setup>
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
//import html2canvas from 'html2canvas'; //import html2canvas from 'html2canvas';
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask' import useClassTaskStore from '@/store/modules/classTask'
import selectClass from './components/selectClass.vue' // import selectClass from './components/selectClass.vue' //
@ -44,6 +44,8 @@ const props = defineProps({
// //
// const experimentList = ref([]); // const experimentList = ref([]);
const activeExp = ref({}); const activeExp = ref({});
const selectExperimentRef = ref();
const selectClassRef = ref();
const isStadium = () => { const isStadium = () => {
let roles = userStore.roles let roles = userStore.roles
@ -82,6 +84,13 @@ const getExperimentListItem = (val) => {
watch(() => props.expObj.fileurl, (newVal, oldVal) => { watch(() => props.expObj.fileurl, (newVal, oldVal) => {
console.log(props.expObj,'科学实验科目') console.log(props.expObj,'科学实验科目')
activeExp.value = props.expObj; activeExp.value = props.expObj;
//
nextTick(() => {
selectClassRef.value.updateCheckList();
selectExperimentRef.value.updateLabel(props.expObj.label);
})
}) })
</script> </script>

View File

@ -68,8 +68,7 @@
</div> </div>
<div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center"> <div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center">
<div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;"> <div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;">
<!-- <whiteboard v-if="isShowBoard" ref="boardref" :height="mainHeight - 150" :isShowSave="false" :data="whiteboardObj"/> --> <whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj" />
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj"/>
</div> </div>
</div> </div>
<div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业')&& currentRow.id>0" class="page-center"> <div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业')&& currentRow.id>0" class="page-center">
@ -537,7 +536,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
if(isShow.value === false){ if(isShow.value === false){
if(classWorkForm.id != '' ) {// id if(classWorkForm.id != '' ) {// id
editWork(cform); // editWork(cform); //
return; return;
} }
} }
@ -600,7 +599,8 @@ const handleClassWorkFormQuizRemove = (index) =>{
} }
else if(classWorkForm.worktype === "科学实验"){ else if(classWorkForm.worktype === "科学实验"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'}); if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.worktag = useClassTaskStores.experimentObj.updateEduInfo; // , [-]
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); //
cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]); cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
try { try {
console.log(cform,'科学实验') console.log(cform,'科学实验')
@ -807,12 +807,14 @@ const editWork = async (cform) =>{
else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList
// 1. (, ) // 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
} }
// 3. // 3.
let res = await updateClasswork(cform); let res = await updateClasswork(cform);
if (res.code == 200) { if (res.code == 200) {
ElMessage.success('更新成功'); ElMessage.success('更新成功');
taskList.value = []
// //
if(isShow.value){ if(isShow.value){
currentRow.value.id = 1; currentRow.value.id = 1;

View File

@ -129,6 +129,7 @@ import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue"; import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
import { useHandleData } from "@/hooks/useHandleData"; import { useHandleData } from "@/hooks/useHandleData";
import { processList } from '@/hooks/useProcessList'; import { processList } from '@/hooks/useProcessList';
import { isJson } from "@/utils/comm";
import { debounce } from '@/utils/comm' import { debounce } from '@/utils/comm'
@ -254,6 +255,7 @@ function Apis(key) {
const client = new Apis('/paht'); const client = new Apis('/paht');
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = { const queryForm = {
// //
worktype: entpCourseWorkQueryParams.worktype.label, worktype: entpCourseWorkQueryParams.worktype.label,
@ -266,7 +268,7 @@ const t = function(name, time) {
// //
edustage: userStore.edustage, // this.userStore.edustage, edustage: userStore.edustage, // this.userStore.edustage,
edusubject: userStore.edusubject, // this.userStore.edusubject, edusubject: userStore.edusubject, // this.userStore.edusubject,
eid: props.bookobj.levelSecondId, // this.activeParams.lession.id, eid: evalId, // id
status: "1", status: "1",
editUserId: userStore.userId, editUserId: userStore.userId,
//orderby: 'concat(worktype,timestamp) DESC', //orderby: 'concat(worktype,timestamp) DESC',
@ -326,9 +328,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
} }
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist); //console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']'); const tmpJson = '['+clueres.rows[i].childlist+']';
for (var j=0; j<clueres.rows[i].childArray.length; j++) { if (isJson(tmpJson)){
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
}
} }
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
@ -482,8 +487,16 @@ const debounceQueryData = debounce(() => {
}, 1000); }, 1000);
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => { watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData(); debounceQueryData();
}) })

View File

@ -43,7 +43,7 @@
</div> </div>
<!-- orc 使用说明 --> <!-- orc 使用说明 -->
<div class="import-manual-explain"> <div class="import-manual-explain">
<p>orc 使用说明</p> <p>orc 使用说明填空题暂无法整题识别</p>
<p>1本地浏览 </p> <p>1本地浏览 </p>
<p>2获取剪贴板图片 </p> <p>2获取剪贴板图片 </p>
<p>3整题识别可识别整张图片自动填充到对应内容 </p> <p>3整题识别可识别整张图片自动填充到对应内容 </p>
@ -127,7 +127,7 @@ const courseObj = reactive({
const activeAptTab = ref("人工录入"); const activeAptTab = ref("人工录入");
// false - api true - json // false - api true - json
const OCR_WORK_TEST = false; const OCR_WORK_TEST = true;
// [] // []
const cropOption = reactive({ const cropOption = reactive({
img: '', // url , base64, blob img: '', // url , base64, blob

View File

@ -2,7 +2,8 @@ import { ElMessageBox, ElMessage } from "element-plus";
import qs from "qs"; import qs from "qs";
import axios from 'axios' import axios from 'axios'
import request from '@/utils/request' import request from '@/utils/request'
import { pyOCRAPI } from "@/api/education/entpcoursework"; import { pyOCRAPI, getOcrContent } from "@/api/education/entpcoursework";
import useClassTaskStore from '@/store/modules/classTask'
const EXAM_JUDGED_DICTIONARY = ["正确", "对", "√", "T", "错误", "错", "×", "F"]; const EXAM_JUDGED_DICTIONARY = ["正确", "对", "√", "T", "错误", "错", "×", "F"];
@ -17,13 +18,10 @@ const baidubceConfig = {
'client_secret': 'oWb0M0YWMmZPMQIhIUkJX99ddr7h61qf', 'client_secret': 'oWb0M0YWMmZPMQIhIUkJX99ddr7h61qf',
}; };
export function getOcrContent(data) {
return request({ const {
url: '/ocr/exam', entpCourseWorkTypeList
method: 'post', } = useClassTaskStore();
data: data
})
}
/** /**
@ -45,7 +43,7 @@ export const ocrImg2ItemByManualUpl = async (isLocalTest = false, imgBase64 = ''
if (isLocalTest) { if (isLocalTest) {
// 临时本地测试json格式跟百度ocr一致 // 临时本地测试json格式跟百度ocr一致
const response = await fetch('/cropImgTest/single.json'); const response = await fetch('/cropImgTest/single2.json');
const resOcr = await response.json(); const resOcr = await response.json();
ocrJson = resOcr.results; ocrJson = resOcr.results;
// 识别内容拼接 // 识别内容拼接
@ -115,7 +113,6 @@ export const ocrImg2ItemByManualUpl = async (isLocalTest = false, imgBase64 = ''
examItem.params.push(obj); examItem.params.push(obj);
}); });
return examItem; return examItem;
} }
else if (examType.includes('单选题') || examType.includes('多选题')) { else if (examType.includes('单选题') || examType.includes('多选题')) {
/** 单选题/多选题 - 选项 */ /** 单选题/多选题 - 选项 */
@ -150,10 +147,10 @@ export const ocrImg2ItemByManualUpl = async (isLocalTest = false, imgBase64 = ''
} }
else if (curItem === 'workanswer') { else if (curItem === 'workanswer') {
// 该类型下只做[主观题]和[复合题]的处理 // 该类型下只做[主观题]和[复合题]的处理
if (examType.includes('主观题')) { ocrTxt = ocrTxt.replace(/<br \/>/g, '');
ocrTxt = ocrTxt.replace(/<br \/>/g, ''); examItem = ocrTxt;
examItem = ocrTxt; } else {
} examItem = ocrTxt;
} }
// 返回转换格式后的识别内容 // 返回转换格式后的识别内容
@ -174,7 +171,7 @@ export const ocrImg2ExamByManualUpl = async (isLocalTest = false, imgBase64 = ''
if (isLocalTest) { if (isLocalTest) {
// 临时本地测试json格式跟百度ocr一致 // 临时本地测试json格式跟百度ocr一致
const response = await fetch('/cropImgTest/single.json'); const response = await fetch('/cropImgTest/single1.json');
const resOcr = await response.json(); const resOcr = await response.json();
ocrJson = resOcr.results; ocrJson = resOcr.results;
// 识别内容拼接 // 识别内容拼接
@ -234,12 +231,14 @@ const ocrImg2Json = async (urlBase64) => {
ElMessage.error("未检测到截图图片, 请截取图片后再识别"); ElMessage.error("未检测到截图图片, 请截取图片后再识别");
return null; return null;
} }
let base64Code = urlBase64.split(",")[1]; let base64Code = urlBase64.split(",")[1];
const resOcr = await getOcrContent({ base64Code: base64Code }); const resOcr = await getOcrContent({ base64Code: base64Code });
if (resOcr.code !== 200) { if (resOcr.code !== 200) {
ElMessage.error("图片识别错误"); ElMessage.error("图片识别错误");
return null; return null;
} }
// const resToken = await bdyAPI_getToken(); // const resToken = await bdyAPI_getToken();
// if (resToken.status !== 200) { // if (resToken.status !== 200) {
// ElMessage.error("百度智能云用户标识有误"); // ElMessage.error("百度智能云用户标识有误");
@ -394,8 +393,8 @@ const assembleExam = (eachSub) => {
} }
// 第一部分[题干-选项] 处理 // 第一部分[题干-选项] 处理
titleAndWorkDesc = tmpList[0]; titleAndWorkDesc = tmpList[0];
// 将4个以上连续的下划线统一替换为5个 // 将3个以上连续的下划线统一替换为5个
titleAndWorkDesc = titleAndWorkDesc.replace(/_{4,}/g, '_____'); titleAndWorkDesc = titleAndWorkDesc.replace(/_{3,}/g, '_____');
// 第二部分[分析-答案] 处理 // 第二部分[分析-答案] 处理
let answerAndAnswer = {}; let answerAndAnswer = {};
@ -456,32 +455,35 @@ const assembleExam = (eachSub) => {
} }
} }
let tmpExam = null; // 目前暂屏蔽无[复合题], 故所有都算基础题
if (answer === '') { let tmpExam = processExamSingle(titleAndWorkDesc, answer);
/**
* 基础题型 - [单选题] [多选题] [填空题] [判断题] [主观题] // let tmpExam = null;
*/ // if (answer === '') {
tmpExam = processExamSingle(titleAndWorkDesc, answer); // /**
} // * 基础题型 - [单选题] [多选题] [填空题] [判断题] [主观题]
else { // */
// 匹配是否存在 1. 1 (1)的存在, 题目与答案都存在则说明题型为复合题(嵌套题) // tmpExam = processExamSingle(titleAndWorkDesc, answer);
regex = /^(\d+[..。]|\(\d+\)|\d+)/; // }
let answerFind = regex.test(answer); // else {
regex = /(\d+[..。]|\(\d+\)|\d+)/; // // 匹配是否存在 1. 1 (1)的存在, 题目与答案都存在则说明题型为复合题(嵌套题)
let titleFind = regex.test(titleAndWorkDesc); // regex = /^(\d+[..。]|\(\d+\)|\d+)/;
if (titleFind && answerFind) { // let answerFind = regex.test(answer);
/** // regex = /(\d+[..。]|\(\d+\)|\d+)/;
* [复合题] - 处理逻辑 // let titleFind = regex.test(titleAndWorkDesc);
*/ // if (titleFind && answerFind) {
tmpExam = processExamMulti(titleAndWorkDesc, answer); // /**
} // * [复合题] - 处理逻辑
else { // */
/** // tmpExam = processExamMulti(titleAndWorkDesc, answer);
* 基础题型 - [单选题] [多选题] [填空题] [判断题] [主观题] // }
*/ // else {
tmpExam = processExamSingle(titleAndWorkDesc, answer); // /**
} // * 基础题型 - [单选题] [多选题] [填空题] [判断题] [主观题]
} // */
// tmpExam = processExamSingle(titleAndWorkDesc, answer);
// }
// }
if (tmpExam) { if (tmpExam) {
// 错误信息 // 错误信息
@ -607,13 +609,21 @@ const processExamSingle = function (titleAndWorkDesc, answer) {
* 主观题 * 主观题
*/ */
// [题型] - 格式化 // [题型] - 格式化
examSingle.workType = "主观题"; const flagDict = ['单选题', '多选题', '判断题', '填空题'];
const another = entpCourseWorkTypeList.filter(item => !flagDict.includes(item.label));
if (another.length > 0) {
examSingle.workType = another[another.length-1].label;
// [题干]-格式化
examSingle.title = titleAndWorkDesc;
}
// [题干]-格式化 // examSingle.workType = "主观题";
examSingle.title = titleAndWorkDesc;
// [选项] - 格式化 --- 主观题无选项 // // [题干]-格式化
//examSingle.arrWorkDesc = []; // examSingle.title = titleAndWorkDesc;
// // [选项] - 格式化 --- 主观题无选项
// //examSingle.arrWorkDesc = [];
// [题目答案] - 处理 --- ['qweasd123'] // [题目答案] - 处理 --- ['qweasd123']
if (answer !== '') { if (answer !== '') {

View File

@ -8,7 +8,7 @@
<el-form ref="questFormRef" :model="questForm" :rules="MainRules" label-width="80px"> <el-form ref="questFormRef" :model="questForm" :rules="MainRules" label-width="80px">
<el-form-item label="题型" prop="worktype"> <el-form-item label="题型" prop="worktype">
<el-select v-model="questForm.worktype" placeholder="请选择题型" style="width:20%" :disabled="questForm.id==0?false:true"> <el-select v-model="questForm.worktype" placeholder="请选择题型" style="width:20%" :disabled="questForm.id==0?false:true">
<el-option v-for="item in fromOptions.type" :key="item.value" :label="item.label" :value="item.label"></el-option> <el-option v-for="item in fromOptions.type" :key="item.value" :label="item.label" :value="item.label" :disabled="item.label=='不限'"></el-option>
</el-select> </el-select>
<el-tag v-if="questForm.worktype=='填空题'" type="danger" style=" margin-left: 10px ">温馨提示填空题题目的填空位置下划线请连续输入3-10个 _ <el-tag v-if="questForm.worktype=='填空题'" type="danger" style=" margin-left: 10px ">温馨提示填空题题目的填空位置下划线请连续输入3-10个 _
符号eg今天___好日子</el-tag> 符号eg今天___好日子</el-tag>
@ -103,7 +103,7 @@
</div> </div>
<!-- 多选题 --> <!-- 多选题 -->
<div v-if="questForm.worktype=='多选题'" class="questForm-item-cover"> <div v-else-if="questForm.worktype=='多选题'" class="questForm-item-cover">
<div v-for="(item,index) in questForm.list" :key='index'> <div v-for="(item,index) in questForm.list" :key='index'>
<el-form-item <el-form-item
:label=Options(1,index) :label=Options(1,index)
@ -134,7 +134,7 @@
</div> </div>
<!-- 填空题 --> <!-- 填空题 -->
<div v-if="questForm.worktype=='填空题'" class="questForm-item-cover"> <div v-else-if="questForm.worktype=='填空题'" class="questForm-item-cover">
<div v-for="(item,index) in questForm.list" :key='index'> <div v-for="(item,index) in questForm.list" :key='index'>
<el-form-item :label=Options(3,index) :prop="`list.${index}.text`" <el-form-item :label=Options(3,index) :prop="`list.${index}.text`"
:rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}"> :rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}">
@ -157,7 +157,7 @@
</div> </div>
<!-- 判断题 --> <!-- 判断题 -->
<div v-if="questForm.worktype=='判断题'" class="questForm-item-cover"> <div v-else-if="questForm.worktype=='判断题'" class="questForm-item-cover">
<div v-for="(item,index) in questForm.list" :key='index'> <div v-for="(item,index) in questForm.list" :key='index'>
<el-form-item <el-form-item
v-if="index==0" v-if="index==0"
@ -176,7 +176,7 @@
</div> </div>
<!-- 主观题 --> <!-- 主观题 -->
<div v-if="questForm.worktype.indexOf('主观题') != -1" class="questForm-item-cover"> <div v-else-if="questForm.worktype.indexOf('主观题') != -1" class="questForm-item-cover">
<el-form-item label="答案"> <el-form-item label="答案">
<Tinymce v-model="questForm.workanswer" :upFileParams="{ <Tinymce v-model="questForm.workanswer" :upFileParams="{
lessionId: lessionid, lessionId: lessionid,
@ -239,7 +239,7 @@
<!-- 复合题 --> <!-- 复合题 -->
<div v-if="questForm.worktype=='复合题'" class="questForm-item-cover"> <div v-else-if="questForm.worktype=='复合题'" class="questForm-item-cover">
<el-form-item label="单项题型" :prop="worktype"> <el-form-item label="单项题型" :prop="worktype">
<el-select v-model="questForm.mulList.worktype" placeholder="请选择题型" style="width:20%"> <el-select v-model="questForm.mulList.worktype" placeholder="请选择题型" style="width:20%">
<!-- <el-option key="1" label="单选题" value="单选题"></el-option> --> <!-- <el-option key="1" label="单选题" value="单选题"></el-option> -->
@ -350,6 +350,19 @@
</div> </div>
</div> </div>
<!-- 非统一标准名称的解答题 -->
<div v-else class="questForm-item-cover">
<el-form-item label="答案">
<Tinymce v-model="questForm.workanswer" :upFileParams="{
lessionId: lessionid,
fileAlias: '单题上传',
}" />
</el-form-item>
<div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('workanswer')"><el-icon><Search /></el-icon></el-button>
</div>
</div>
<!-- 答案分析 --> <!-- 答案分析 -->
<div class="questForm-item-cover"> <div class="questForm-item-cover">
<el-form-item label="答案分析" prop="method"> <el-form-item label="答案分析" prop="method">
@ -623,8 +636,9 @@ onMounted(() => {
// //
if (entpCourseWorkTypeList.length>0) { if (entpCourseWorkTypeList.length>0) {
const flagDict = ['单选题', '多选题', '判断题', '填空题']; //const flagDict = ['', '', '', ''];
fromOptions.type = entpCourseWorkTypeList.filter(item => flagDict.includes(item.label)); //fromOptions.type = entpCourseWorkTypeList.filter(item => flagDict.includes(item.label));
fromOptions.type = entpCourseWorkTypeList
} }
if (entpCourseWorkGroupList.length>0) { if (entpCourseWorkGroupList.length>0) {
fromOptions.flag = entpCourseWorkGroupList; fromOptions.flag = entpCourseWorkGroupList;
@ -748,8 +762,8 @@ const resetForm = () =>{
const updateForm= async(item, submitIndex=0, submitType=1) =>{ const updateForm= async(item, submitIndex=0, submitType=1) =>{
console.log(item,'item'); console.log(item,'item');
// []1 // []1
if (!item.hasOwnProperty('stutus')) { if (!item.hasOwnProperty('status')) {
item.stutus = '1'; item.status = '1';
} }
// [], // [],
if (!item.hasOwnProperty('evalnodeid')) { if (!item.hasOwnProperty('evalnodeid')) {
@ -764,7 +778,6 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
// 线线() // 线线()
item.title = item.title.replace(/<!--BA--><div class="quizPutTag" contenteditable="true">(?:&nbsp;)?<\/div><!--EA-->/g, '_____'); item.title = item.title.replace(/<!--BA--><div class="quizPutTag" contenteditable="true">(?:&nbsp;)?<\/div><!--EA-->/g, '_____');
if(item.worktype == '复合题') { if(item.worktype == '复合题') {
// [] // []
@ -902,11 +915,14 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
}], }],
}, },
]; ];
newList = [];
//
newList = [{text:""}];
// [] // []
item.worktype = item.worktype.replace(/\(主观题\)/g, ''); //item.worktype = item.worktype.replace(/\(\)/g, '');
item.worktype = `${item.worktype}(主观题)`; //item.worktype = `${item.worktype}()`;
// //
// //
if(isJson(item.workanswer)){ if(isJson(item.workanswer)){
@ -1008,9 +1024,8 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
lessionid.value = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId; lessionid.value = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId;
console.log('lessionid', lessionid.value); console.log('lessionid', lessionid.value);
// //
if( props.bookobj.node.edustage == '高中' && (props.bookobj.node.edusubject == '语文' || props.bookobj.node.edusubject == '英语') ){ if( props.bookobj.node.edusubject == '语文' || props.bookobj.node.edusubject == '英语' ){
const res = await listEvaluation({ edusubject: props.bookobj.node.edusubject, edustage: props.bookobj.node.edustage, itemkey: "subject", pageSize: 10 }); const res = await listEvaluation({ edusubject: props.bookobj.node.edusubject, edustage: props.bookobj.node.edustage, itemkey: "subject", pageSize: 10 });
const id = res.rows[0]?.id; const id = res.rows[0]?.id;
if (id) { if (id) {
@ -1083,6 +1098,7 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
// status = 1, // status = 1,
// } // }
// emit('update-exam-single', updateStatus); // emit('update-exam-single', updateStatus);
console.log('updateFormone->', questForm)
}; };
const updateFormone=(item, submitIndex, submitType, formdataitem)=>{ const updateFormone=(item, submitIndex, submitType, formdataitem)=>{
@ -1437,14 +1453,9 @@ const submitForm=(formName) =>{
//param.workdesc = questForm.list.map(item => item.text).join('#&'); //param.workdesc = questForm.list.map(item => item.text).join('#&');
param.workdesc = JSON.stringify(questForm.list.map(item => item.text)); param.workdesc = JSON.stringify(questForm.list.map(item => item.text));
// [][] //
if (questForm.worktype === '单选题' || questForm.worktype === '多选题') {
//param.workanswer = questForm.checkAnswer.map(item => item).join('#&');
param.workanswer = JSON.stringify(questForm.checkAnswer);
}
// []
if(questForm.worktype === '复合题') { if(questForm.worktype === '复合题') {
// []
let workdesc = []; let workdesc = [];
let answer = []; let answer = [];
// 1.: (, 使form.title) // 1.: (, 使form.title)
@ -1501,9 +1512,33 @@ const submitForm=(formName) =>{
param.workdesc = JSON.stringify(workdesc); param.workdesc = JSON.stringify(workdesc);
param.workanswer = JSON.stringify(answer); param.workanswer = JSON.stringify(answer);
} }
else if (questForm.worktype === '单选题' || questForm.worktype === '多选题') {
// [][]
//param.workanswer = questForm.checkAnswer.map(item => item).join('#&');
param.workanswer = JSON.stringify(questForm.checkAnswer);
}
// [] "<div></div>#&<div></div>".replace(/<[^>]*>/g, "")
else if(questForm.worktype === '填空题'){
//
//param.workanswer = questForm.list.map(item => item.text).join('#&').replace(/<[^>]*>/g, "");
//
param.workdesc = '';
param.workanswer = JSON.stringify(questForm.list.map(item => item.text));
}
// [] ([] [][()], ) // []
if(questForm.worktype.indexOf('主观题') !== -1) { else if(questForm.worktype === '判断题'){
//
//param.workanswer = questForm.list.map(item => item.text).join('#&').replace(/<[^>]*>/g, "");
//
param.workdesc = '';
param.workanswer = JSON.stringify(questForm.checkAnswer);
}
else if(questForm.worktype.indexOf('主观题') !== -1) {
// warn: [] ([] [][()], )
// //
param.workdesc = ''; // param.workdesc = ''; //
// workanswer // workanswer
@ -1533,27 +1568,16 @@ const submitForm=(formName) =>{
// param.workdesc = ''; // // param.workdesc = ''; //
// param.workanswer = JSON.stringify(answer).replace(/<[^>]*>/g, ""); // param.workanswer = JSON.stringify(answer).replace(/<[^>]*>/g, "");
} }
else {
// [] "<div></div>#&<div></div>".replace(/<[^>]*>/g, "") // (), [], ocr
if(questForm.worktype === '填空题'){ param.workdesc = ''; //
// // workanswer
//param.workanswer = questForm.list.map(item => item.text).join('#&').replace(/<[^>]*>/g, ""); if (questForm.workanswer && questForm.workanswer != '') {
param.workanswer = JSON.stringify([questForm.workanswer]);
// }
param.workdesc = '';
param.workanswer = JSON.stringify(questForm.list.map(item => item.text));
} }
// []
if(questForm.worktype === '判断题'){
//
//param.workanswer = questForm.list.map(item => item.text).join('#&').replace(/<[^>]*>/g, "");
//
param.workdesc = '';
param.workanswer = JSON.stringify(questForm.checkAnswer);
}
// , (3) // , (3)
if (questForm.submitType === 3) { if (questForm.submitType === 3) {
@ -1703,37 +1727,40 @@ const myMessageShow=(title, msg, status)=>{
* @return: {*} * @return: {*}
* @param {*} list * @param {*} list
*/ */
const updateKnowledgePoint = (list) => { const formatKnowledgePoint = (list) => {
list.forEach(item => { list.forEach(item => {
if (item.title && item.title != '') { if (item.title && item.title != '') {
item.knowTitle = item.title; item.knowTitle = item.title;
} }
if (item.children && Array.isArray(item.children)) { if (item.children && Array.isArray(item.children)) {
updateKnowledgePoint(item.children); formatKnowledgePoint(item.children);
} }
}); });
return list; return list;
}; };
watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => { watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], async([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId // props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId
lessionid.value = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId; lessionid.value = props.bookobj.levelSecondId!='' ? props.bookobj.levelSecondId : props.bookobj.levelFirstId;
/** /**
* 格式化知识点: 分两种情况 * 格式化知识点: 分两种情况
* 1. 语文/英语: 获取学科下的所有知识点(该学科对应无章节与知识点绑定, 故只获取全知识点) * 1. 语文/英语: 获取学科下的所有知识点(该学科对应无章节与知识点绑定, 故只获取全知识点)
* 2. 其他: 获取当前章节下的所有知识点 * 2. 其他: 获取当前章节下的所有知识点
*/ */
let id = props.bookobj.levelSecondId; let id = lessionid.value;
if( props.bookobj.node.edustage == '高中' && (props.bookobj.node.edusubject == '语文' || props.bookobj.node.edusubject == '英语') ){ if( props.bookobj.node.edusubject == '语文' || props.bookobj.node.edusubject == '英语'){
id = props.bookobj.node.rootid; id = props.bookobj.node.rootid;
const res = await listEvaluation({ edusubject: props.bookobj.node.edusubject, edustage: props.bookobj.node.edustage, itemkey: "subject", pageSize: 10 }); const res = await listEvaluation({ edusubject: props.bookobj.node.edusubject, edustage: props.bookobj.node.edustage, itemkey: "subject", pageSize: 10 });
id = res.rows[0]?.id; id = res.rows[0]?.id;
if (id) { if (id) {
listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,}).then(res => { listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,}).then(res => {
//console.log('listKnowlegepointFormat->', res.rows); //console.log('listKnowlegepointFormat->', res.rows);
curKnowledgePointList.value = updateKnowledgePoint(res.rows); curKnowledgePointList.value = formatKnowledgePoint(res.rows);
}); });
} }
}else{ }else{

View File

@ -117,6 +117,8 @@ import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { getBindlist } from '@/api/education/knowledgePoint' import { getBindlist } from '@/api/education/knowledgePoint'
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue' import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList'
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import {throttle,debounce } from '@/utils/comm' import {throttle,debounce } from '@/utils/comm'
@ -190,6 +192,8 @@ const workResource = reactive({
onMounted(() => { onMounted(() => {
console.log('entpCourseWorkTypeList', entpCourseWorkTypeList); console.log('entpCourseWorkTypeList', entpCourseWorkTypeList);
// ()
getEntpCourseWorkPointList();
debounceQueryData(); // debounceQueryData(); //
}) })
@ -235,32 +239,33 @@ function Apis(key) {
const client = new Apis('/paht'); const client = new Apis('/paht');
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const queryForm = { const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
// const queryForm = {
currentPage: paginationParams.pageNum, //
pageSize: paginationParams.pageSize, currentPage: paginationParams.pageNum,
// pageSize: paginationParams.pageSize,
eid: props.bookobj.levelSecondId, //
sectionName: props.bookobj.coursetitle, eid: evalId, // id
edusubject: userStore.edusubject, sectionName: props.bookobj.coursetitle,
edustage: userStore.edustage, edusubject: userStore.edusubject,
// edustage: userStore.edustage,
// //
worktype: entpCourseWorkQueryParams.worktype.label, //
workTypeId: entpCourseWorkQueryParams.worktype.value, worktype: entpCourseWorkQueryParams.worktype.label,
// workTypeId: entpCourseWorkQueryParams.worktype.value,
workgroup: entpCourseWorkQueryParams.workgroup, //
// workgroup: entpCourseWorkQueryParams.workgroup,
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'', //
// yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
thirdId: entpCourseWorkQueryParams.point&&entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'', //
// thirdId: entpCourseWorkQueryParams.point&&entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'', //
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
} }
const entpcourseworkres = listEntpcourseworkNew(queryForm); const entpcourseworkres = listEntpcourseworkNew(queryForm);
resolve(entpcourseworkres); resolve(entpcourseworkres);
}) })
} }
const handleQueryFromEntpCourseWork= async (queryType) => { const handleQueryFromEntpCourseWork= async (queryType) => {
@ -329,9 +334,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
} }
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist); //console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']'); const tmpJson = '['+clueres.rows[i].childlist+']';
for (var j=0; j<clueres.rows[i].childArray.length; j++) { if (isJson(tmpJson)){
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
}
} }
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
@ -460,19 +468,29 @@ const captureScreenshot = (id) => {
// //
const debounceQueryData = debounce(() => { const debounceQueryData = debounce(() => {
console.log("防抖 加载数据中...") console.log("防抖 加载数据中...")
console.log(props.bookobj,'课程选择')
// //
initPageParams(); initPageParams();
// //
handleQueryFromEntpCourseWork(0); handleQueryFromEntpCourseWork(0);
// //
getQueryFromEvaluationclue(); //getQueryFromEvaluationclue();
// //
getEntpCourseWorkPointList(); //getEntpCourseWorkPointList();
}, 1000); }, 1000);
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => { watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData(); debounceQueryData();
}) })

View File

@ -58,10 +58,10 @@ import { useGetSubject } from '@/hooks/useGetSubject'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { debounce } from 'lodash' import { debounce } from 'lodash'
import useUserStore from '@/store/modules/user' // import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask' // import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore() // const userStore = useUserStore()
const classTaskStore = useClassTaskStore(); // const classTaskStore = useClassTaskStore();
const router = useRouter() const router = useRouter()
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
@ -217,7 +217,7 @@ onMounted(async ()=>{
chartInstance = echarts.init(chartDom.value) chartInstance = echarts.init(chartDom.value)
// //
await classTaskStore.initJYInfo(userStore.user); //await classTaskStore.initJYInfo(userStore.user);
const option = { const option = {

View File

@ -410,8 +410,8 @@ const changeBook = async(data) => {
let cata = parseCataByNode(data.node) let cata = parseCataByNode(data.node)
currentNode.value = data.node currentNode.value = data.node
uploadData.value.levelFirstId = cata[0] uploadData.value.levelFirstId = cata[0]
uploadData.value.levelSecondId = cata[1] uploadData.value.levelSecondId = cata[1] ?? ''
uploadData.value.levelThirdId = cata[2] uploadData.value.levelThirdId = cata[2] ?? ''
uploadData.value.textbookId = data.textBook.curBookId uploadData.value.textbookId = data.textBook.curBookId
getModelInfo({cataid: currentNode.value.id}).then(res=>{ getModelInfo({cataid: currentNode.value.id}).then(res=>{
console.log(res) console.log(res)