Compare commits

..

4 Commits

Author SHA1 Message Date
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
小杨 2a7fbc3577 fix:头像的样式问题; 2024-12-26 10:40:07 +08:00
22 changed files with 197 additions and 436 deletions

View File

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

View File

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

View File

@ -136,17 +136,3 @@ export function getJYPath(url,config) {
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>
</div>
<div class="book-list" v-loading="treeLoading">
<el-tree :data="treeData" accordion :props="defaultProps" node-key="id" :render-content="renderContent"
<el-tree :data="treeData" accordion :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
@node-click="handleNodeClick">
<template #default="{ node }">
@ -178,18 +178,6 @@ const handleNodeClick = (data) => {
sessionStore.set('subject.curNode', nodeData)
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 () => {
treeLoading.value = true
try{

View File

@ -1,7 +1,5 @@
import { listEntpcoursework,getEvaluationclue } from '@/api/classTask';
import { processList } from '@/hooks/useProcessList';
import useClassTaskStore from '@/store/modules/classTask'
const useClassTaskStores = useClassTaskStore();
const isJson = (str) => {
if (typeof str == 'string') {
@ -116,14 +114,6 @@ export const editListItem = (row, courseObj) => {
}
else if (row.worktype == '科学实验') {
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);
//
// console.log('科学实验', classtaskObj);

View File

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

View File

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

View File

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

View File

@ -55,7 +55,6 @@
<el-col :span="11">
<el-form-item label="知识点" label-width="70">
<el-cascader
disabled
v-model="entpCourseWorkQueryParams.point"
clearable
style="width: 100%"
@ -173,7 +172,7 @@
<!-- 非习题训练常规作业 -->
<div v-if="classWorkForm.worktype!='习题训练'">
<div :style="{ 'overflow': 'auto'}">
<!-- <template v-if="classWorkForm.worktype!='常规作业'">
<template v-if="classWorkForm.worktype!='常规作业'">
<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 style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
@ -194,7 +193,7 @@
</div>
</div>
</template>
</template> -->
</template>
<template v-if="classWorkForm.worktype =='常规作业'">
<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']"/>
@ -286,7 +285,6 @@ import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval
import { listEvaluation } from '@/api/subject'
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework'
@ -461,13 +459,12 @@ const client = new Apis('/paht');
*/
const t = function(name, time) {
return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = {
//
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
//
eid: evalId, // id
eid: props.bookobj.levelSecondId,
sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject,
edustage: userStore.edustage,
@ -560,13 +557,10 @@ const getQueryFromEvaluationclue = () => {
}
if (clueres.rows[i].childlist != '') {
const tmpJson = '['+clueres.rows[i].childlist+']';
if (isJson(tmpJson)){
clueres.rows[i].childArray = JSON.parse(tmpJson);
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
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 {
clueres.rows[i].childArray = {};
}
@ -996,8 +990,6 @@ const initPageParams = () => {
onMounted(async() => {
//
getEntpCourseWorkPointList();
})
// const refreshData = () => {
@ -1024,9 +1016,9 @@ const debounceQueryData = debounce(() => {
//
handleQueryFromEntpCourseWork(0);
//
//getQueryFromEvaluationclue();
getQueryFromEvaluationclue();
//
//getEntpCourseWorkPointList();
getEntpCourseWorkPointList();
}, 1000);
watch(() => props.propsformobj.uniquekey, (newVal) => {
@ -1035,20 +1027,8 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
}
})
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData();
})

View File

@ -36,24 +36,16 @@ const props = defineProps({
})
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(() => {
})
defineExpose({
updateLabel
})
const onSelectOption = (option) => {
console.log(option,'选择的实验课-------')
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
}
</script>
<style scoped>

View File

@ -56,7 +56,7 @@ const subjectList = ref([])
const chooseGrade= ref({})
const expList = ref([]) //
const checkList = ref([])//
const isLoaded = ref(false);
//
const getSubject = () => {
@ -80,15 +80,8 @@ const getSubject = () => {
})
})
console.log(subjectList,'subjectList');
//
const edusubject = useClassTaskStore().experimentObj.edusubject;
handleUserEduStage(useClassTaskStore().experimentObj.edustage);
// , , .
useClassTaskStore().experimentObj.edusubject = edusubject;
// []
isLoaded.value = true;
//console.log('----');
handleUserEduStage(useClassTaskStore().experimentObj.edustage)
}
//
const isExpList = (edusubject) => {
@ -115,8 +108,7 @@ const isExpList = (edusubject) => {
//
const handleUserEduStage = (item) => {
// userStore.edustage = item
useClassTaskStore().experimentObj.edustage = item;
useClassTaskStore().experimentObj.edustage = item
//
expList.value = []
if(item === '小学'){
@ -125,11 +117,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '小学');
for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
//useClassTaskStore().experimentObj.edusubject = name;
if(isExpList(name)){
useClassTaskStore().experimentObj.edusubject = name;
//
handleUserEduSubject(name)
break;
}
}
}else if(item === '初中'){
@ -138,11 +129,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '初中');
for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
//useClassTaskStore().experimentObj.edusubject = name;
if(isExpList(name)){
useClassTaskStore().experimentObj.edusubject = name;
//
handleUserEduSubject(name)
break;
}
}
}else if(item === '高中'){
@ -151,11 +141,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '高中');
for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){
//useClassTaskStore().experimentObj.edusubject = name;
if(isExpList(name)){
useClassTaskStore().experimentObj.edusubject = name;
//
handleUserEduSubject(name)
break;
}
}
}
@ -188,59 +177,10 @@ const handleUserEduSubject = (item) => {
// 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(() => {
getSubject()
})
defineExpose({
updateCheckList
})
</script>
<style scoped>
.custom-button {

View File

@ -3,10 +3,10 @@
<div class="activeExp-header">
<div class="infomation" v-if="isStadium() !== true" >
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
<selectClass ref="selectClassRef"/>
<selectClass v-if="!isSubject" />
</div>
<div>
<selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
<selectExperiment @selectItem="getExperimentListItem" />
</div>
</div>
<div ref="mainDiv" class="activeExp-main" style="overflow: auto">
@ -44,8 +44,6 @@ const props = defineProps({
//
// const experimentList = ref([]);
const activeExp = ref({});
const selectExperimentRef = ref();
const selectClassRef = ref();
const isStadium = () => {
let roles = userStore.roles
@ -84,13 +82,6 @@ const getExperimentListItem = (val) => {
watch(() => props.expObj.fileurl, (newVal, oldVal) => {
console.log(props.expObj,'科学实验科目')
activeExp.value = props.expObj;
//
nextTick(() => {
selectClassRef.value.updateCheckList();
selectExperimentRef.value.updateLabel(props.expObj.label);
})
})
</script>

View File

@ -600,8 +600,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
}
else if(classWorkForm.worktype === "科学实验"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo; // , [-]
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); //
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
try {
console.log(cform,'科学实验')
@ -808,7 +807,6 @@ const editWork = async (cform) =>{
else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList
// 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
}
// 3.

View File

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

View File

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

View File

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

View File

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

View File

@ -117,8 +117,6 @@ import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { getBindlist } from '@/api/education/knowledgePoint'
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import { processList } from '@/hooks/useProcessList'
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store'
import {throttle,debounce } from '@/utils/comm'
@ -192,8 +190,6 @@ const workResource = reactive({
onMounted(() => {
console.log('entpCourseWorkTypeList', entpCourseWorkTypeList);
// ()
getEntpCourseWorkPointList();
debounceQueryData(); //
})
@ -239,13 +235,12 @@ function Apis(key) {
const client = new Apis('/paht');
const t = function(name, time) {
return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = {
//
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
//
eid: evalId, // id
eid: props.bookobj.levelSecondId,
sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject,
edustage: userStore.edustage,
@ -334,13 +329,10 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
}
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
if (clueres.rows[i].childlist != '') {
const tmpJson = '['+clueres.rows[i].childlist+']';
if (isJson(tmpJson)){
clueres.rows[i].childArray = JSON.parse(tmpJson);
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
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 {
clueres.rows[i].childArray = {};
}
@ -468,29 +460,19 @@ const captureScreenshot = (id) => {
//
const debounceQueryData = debounce(() => {
console.log("防抖 加载数据中...")
console.log(props.bookobj,'课程选择')
//
initPageParams();
//
handleQueryFromEntpCourseWork(0);
//
//getQueryFromEvaluationclue();
getQueryFromEvaluationclue();
//
//getEntpCourseWorkPointList();
getEntpCourseWorkPointList();
}, 1000);
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData();
})

View File

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

View File

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

View File

@ -206,7 +206,7 @@ export default {
width: 200px;
height: 200px;
position: relative;
left: 150px;
left: 100px;
overflow: hidden;
border-radius: 50%;
}

View File

@ -6,6 +6,7 @@
append-to-body
@opened="modalOpened"
@close="closeDialog"
width="100px"
>
<CropperImage
ref="cropper"