Merge branch 'main' into lyc-dev

This commit is contained in:
lyc 2024-12-30 17:26:09 +08:00
commit 6fbace8a7f
10 changed files with 193 additions and 104 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win-ws",
"version": "2.5.10",
"version": "2.5.11",
"description": "",
"main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院",

View File

@ -15,7 +15,7 @@ const size = ref('default')
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
/* text-align: center; */
color: #2c3e50;
width: 100%;
}

View File

@ -7,11 +7,20 @@
<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 }">
<span :title="node.label" class="tree-label">{{ node.label }}</span>
<template #default="{ node, data }">
<div v-if="props.isClassTask && (data.bookId == '' || data.bookId == '0')">
<el-tooltip effect="light" placement="right" content="该单元章节无自主试题">
<span class="tree-label" style="color: #A5B3CA">
{{ node.label }}
</span>
</el-tooltip>
</div>
<div v-else>
<span class="tree-label">{{ node.label }}</span>
</div>
</template>
</el-tree>
</div>
@ -51,6 +60,13 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
const props = defineProps({
// []使()
isClassTask: {
default: false
},
})
const isStadium = () => {
let roles = userStore.user.roles
return roles.some(item => item.roleKey === 'stadium')
@ -179,17 +195,6 @@ const handleNodeClick = (data) => {
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

@ -2,6 +2,8 @@ import { defineStore } from 'pinia'
import { } from '@/api/classTask/index.js'
import { listClassmain } from '@/api/classManage/index'
import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
import { listEvaluation } from '@/api/subject'
import { getBindlist, listKnowlegepointFormat } from '@/api/education/knowledgePoint'
const useClassTaskStore = defineStore('classTask',{
state: () => ({
@ -38,6 +40,7 @@ const useClassTaskStore = defineStore('classTask',{
{label: '2021', value: '2021'},
{label: '2020', value: '2020'},
], // 习题查询条件 - 年份
entpCourseWorkPointList: [], // 习题查询条件 - 知识点
}),
actions: {
listClassmain(params) {
@ -69,6 +72,36 @@ const useClassTaskStore = defineStore('classTask',{
console.error('更新第三方题源+题型err:', error);
});
},
// 根据学科和学段获取知识点
initJYPoint(params) {
/**
* 格式化知识点: 分两种情况
* 1. 语文/英语: 获取学科下的所有知识点(该学科对应无章节与知识点绑定, 故只获取全知识点)
* 2. 其他: 获取当前章节下的所有知识点
*/
this.entpCourseWorkPointList = [];
let id = params.levelSecondId!='' ? params.levelSecondId : params.levelFirstId;
if( params.edusubject == '语文' || params.edusubject == '英语'){
id = params.textbookId;
listEvaluation({ edusubject: params.edusubject, edustage: params.edustage, itemkey: "subject", pageSize: 10 }).then((res => {
id = res.rows[0]?.id;
if (id) {
listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,}).then(res => {
this.entpCourseWorkPointList = formatKnowledgePoint(res.rows);
console.log('1.entpCourseWorkPointList->', this.entpCourseWorkPointList);
});
}
}))
}else{
getBindlist({ eid: id }).then(res => {
if (res.data && res.data.length > 0) {
this.entpCourseWorkPointList = res.data;
console.log('2.entpCourseWorkPointList->', this.entpCourseWorkPointList);
}
})
}
},
},
persist: true
})
@ -109,3 +142,20 @@ const getJYCT = (params) => {
})
})
}
/**
* @desc: 遍历原知识点数据, 将title字段转为knowTitle以供knowledgePointProps进行tree的格式转换显示
* @return: {*}
* @param {*} list
*/
const formatKnowledgePoint = (list) => {
list.forEach(item => {
if (item.title && item.title != '') {
item.knowTitle = item.title;
}
if (item.children && Array.isArray(item.children)) {
formatKnowledgePoint(item.children);
}
});
return list;
};

View File

@ -169,6 +169,10 @@ const emits = defineEmits(['getData'])
// ppt
const isShow = ref(false)
const propsQueryTask = {
id: route.query.classTaskId, // id
isInit: false, //
}
const propsQueryCourseObj = route.query.courseObj;//
const courseObj = reactive({
// : id,id,id,
@ -198,7 +202,7 @@ const boardLoading = ref(false);
const fileLoading = ref(false); // loading
onMounted(() => {
console.log("----onMounted-------")
//console.log("----onMounted-------");
currentRow.value.id = 0
if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){
@ -311,7 +315,7 @@ const selectable=(row, index)=>{
/**
* 获取 entpcourseid 获取作业列表
*/
const initHomeWork = async()=> {
const initHomeWork = async ()=> {
tasklist_loading.value = true;
// const { res, chapterId } = await useGetHomework(courseObj.node);
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
@ -319,6 +323,16 @@ const initHomeWork = async()=> {
console.log('res', res);
entpcourseid.value = chapterId;
taskList.value = res;
// , id
const taskId = propsQueryTask?.id ?? 0;
if (!propsQueryTask.isInit && taskId!=0){
const activeRow = taskList.value.find(o => o.id == taskId);
if (activeRow){
propsQueryTask.isInit = true; //
taskTable.value.setCurrentRow(activeRow);
handleCurrentChange(activeRow);
}
}
tasklist_loading.value = false;
}
@ -414,7 +428,6 @@ const successHomework = () => {
initHomeWork();
})
}
// --------------------
let classWorkForm = reactive({
id: '',// cloneDeep(props.propsformobj.id),
@ -814,11 +827,12 @@ const editWork = async (cform) =>{
let res = await updateClasswork(cform);
if (res.code == 200) {
ElMessage.success('更新成功');
taskList.value = []
taskList.value = [];
//
if(isShow.value){
currentRow.value.id = 1;
}else{
handleNewAllClass();
currentRow.value.id = 0;
}
initHomeWork();

View File

@ -17,6 +17,13 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :offset="2">
<el-button v-if="!props.isHtml2canvas" type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row>
<!-- 习题筛选2 -->
<el-row style="width: 100%; height: 50px;">
<el-col :span="7">
<el-form-item label="年份" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择">
@ -24,9 +31,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 习题筛选2 -->
<el-row style="width: 100%; height: 50px;">
<el-col :span="12">
<el-form-item label="关键词" label-width="70">
<el-input
@ -39,9 +43,6 @@
<el-col :span="5">
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
</el-col>
<el-col :span="5">
<el-button v-if="!props.isHtml2canvas" type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row>
<!-- 习题表格 -->
<div class="page-table" >

View File

@ -50,7 +50,7 @@
<el-form-item label="知识点" prop="knowledgePointIdArr">
<el-cascader
v-model="questForm.knowledgePointIdArr"
:options="curKnowledgePointList"
:options="entpCourseWorkPointList"
:props="knowledgePointProps"
popper-class="my-popper"
@change="onchange"
@ -432,7 +432,8 @@ const userStore = useUserStore().user
const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
entpCourseWorkYearList,
entpCourseWorkPointList
} = useClassTaskStore();
const { proxy } = getCurrentInstance()
@ -489,9 +490,9 @@ const fromOptions = reactive({
],
});
// (UpdateForm)
const initKonwPointFlagByUpdateForm = ref(true);
//const initKonwPointFlagByUpdateForm = ref(true);
// []
const curKnowledgePointList = ref([]);
//const curKnowledgePointList = ref([]);
//
const questForm = reactive({
id: 0,
@ -1018,41 +1019,41 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
// []
if (initKonwPointFlagByUpdateForm.value) {
//
initKonwPointFlagByUpdateForm.value = false;
// if (initKonwPointFlagByUpdateForm.value) {
// //
// initKonwPointFlagByUpdateForm.value = false;
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 == '英语' ){
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) {
const res = await listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,});
curKnowledgePointList.value = updateKnowledgePoint(res.rows);
//console.log('updateKnowledgePoint->', res.rows);
}
} else {
const res = await getBindlist({ eid: lessionid.value })
if (!res.data || res.data.length < 1) {
ElMessage.warning('当前章节下未绑定知识点,暂不更新该试题知识点!');
curKnowledgePointList.value = [];
}
else {
curKnowledgePointList.value = res.data;
}
}
}
// 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 == '' ){
// 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) {
// const res = await listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,});
// curKnowledgePointList.value = formatKnowledgePoint(res.rows);
// console.log('updateKnowledgePoint->', curKnowledgePointList.value);
// }
// } else {
// const res = await getBindlist({ eid: lessionid.value })
// if (!res.data || res.data.length < 1) {
// ElMessage.warning('');
// curKnowledgePointList.value = [];
// }
// else {
// curKnowledgePointList.value = res.data;
// }
// }
// }
//item.evalnodeid = '3772b,374112,374233';
let knowledgePointIdArr = [];
const pointArr = item.evalnodeid.split(',');
if (curKnowledgePointList.value.length > 0 && pointArr.length > 0) {
if (entpCourseWorkPointList.length > 0 && pointArr.length > 0) {
pointArr.forEach(element => {
element = element.trim();
let point = [];
if (getCurKnowledgePointToForm(point, element, curKnowledgePointList.value)) {
if (getCurKnowledgePointToForm(point, element, entpCourseWorkPointList)) {
point = point.reverse();
knowledgePointIdArr.push(point);
}
@ -1747,33 +1748,33 @@ watch([
// 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 == '英语'){
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);
});
}
}else{
getBindlist({ eid: id }).then(res => {
if (!res.data || res.data.length < 1) {
ElMessage.warning('当前章节下未绑定知识点,暂不更新该试题知识点!');
curKnowledgePointList.value = [];
}
else {
curKnowledgePointList.value = res.data;
}
})
}
// /**
// * :
// * 1. /: (, )
// * 2. :
// */
// let id = lessionid.value;
// if( 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);
// });
// }
// }else{
// getBindlist({ eid: id }).then(res => {
// if (!res.data || res.data.length < 1) {
// ElMessage.warning('');
// curKnowledgePointList.value = [];
// }
// else {
// curKnowledgePointList.value = res.data;
// }
// })
// }
})

View File

@ -18,9 +18,9 @@
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="知识点" label-width="70">
<!-- <el-form-item label="知识点" label-width="70">
<el-cascader
disabled
:disabled="entpCourseWorkPointList.length==0"
v-model="entpCourseWorkQueryParams.point"
clearable
style="width: 100%"
@ -31,7 +31,7 @@
collapse-tags
collapse-tags-tooltip
/>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<!-- 习题筛选2 -->
@ -132,7 +132,8 @@ const userStore = useUserStore().user
const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
entpCourseWorkYearList,
entpCourseWorkPointList
} = useClassTaskStore();
const props = defineProps({
@ -146,12 +147,11 @@ const props = defineProps({
},
})
const entpCourseWorkPointList = ref([
{label: '不限', value: []},
]); // -
const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
//const knowledgePointProps = ref({value: 'thirdId', label: 'knowTitle'});
// const entpCourseWorkPointList = ref([
// {label: '', value: []},
// ]); // -
const knowledgePointProps = reactive({value: 'thirdId', label: 'knowTitle'});
//const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
//
const entpCourseWorkQueryParams = reactive({
@ -193,7 +193,7 @@ const workResource = reactive({
onMounted(() => {
console.log('entpCourseWorkTypeList', entpCourseWorkTypeList);
// ()
getEntpCourseWorkPointList();
//getEntpCourseWorkPointList();
debounceQueryData(); //
})
@ -258,7 +258,7 @@ const t = function(name, time) {
//
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[entpCourseWorkQueryParams.point.length-1]:'',
//
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
@ -351,6 +351,7 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
}
/**
* 注意: 该方法已不再使用, 具体知识点初始化方法查看 useClassTaskStore - 241230
* 3知识点
*/
const getEntpCourseWorkPointList = async () => {

View File

@ -1,7 +1,7 @@
<template>
<el-row class="model-wrap">
<!-- 左侧 选择教材 目录 -->
<ChooseTextbook @change-book="changeBook" @node-click="changeBook" />
<ChooseTextbook :isClassTask="true" @change-book="changeBook" @node-click="changeBook" />
<!-- 右侧 展示内容 -->
<div class="right-content">
<div class="content-header-wrap">
@ -451,6 +451,14 @@ const changeBook = async(data) => {
}).then((res) => {
currentFileList.value = [...res.rows]
})
//
const pointParams = {
...uploadData.value,
edustage: data.node.edustage,
edusubject: data.node.edusubject,
}
await classTaskStore.initJYPoint(pointParams);
}
const onchange = (item) => {
let path = item.path

View File

@ -209,10 +209,12 @@ import * as commUtils from "@/utils/comm";
import msgUtils from "@/plugins/modal";
import * as Api_server from "@/api/apiService";
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
import useClassTaskStore from '@/store/modules/classTask'
import { slidesToImg } from '@/utils/ppt' // ppt
import ChatWs from '@/plugins/socket' // socket
if (!ChatWs.ws) ChatWs.init()
const classTaskStore = useClassTaskStore();
const toolStore = useToolState()
const fs = require('fs')
const { ipcRenderer } = window.electron || {}
@ -992,8 +994,8 @@ export default {
let cata = parseCataByNode(data.node)
this.currentNode = data.node
this.uploadData.levelFirstId = cata[0]
this.uploadData.levelSecondId = cata[1]
this.uploadData.levelThirdId = cata[2]
this.uploadData.levelSecondId = cata[1] ?? ''
this.uploadData.levelThirdId = cata[2] ?? ''
this.uploadData.textbookId = data.textBook.curBookId
toolStore.curSubjectNode.querySearch = this.uploadData
this.initHomeWork()
@ -1003,6 +1005,14 @@ export default {
const res = await listEntpcourse(params)
this.entp = res?.rows?.[0] || null
sessionStore.set('curr.entp', this.entp) //
//
const pointParams = {
...this.uploadData,
edustage: data.node.edustage,
edusubject: data.node.edusubject,
}
await classTaskStore.initJYPoint(pointParams);
},
//
async initHomeWork() {
@ -1047,7 +1057,7 @@ export default {
goNewClassTask(){
// router.push({ path: '/newClassTask' });
this.$router.push({
path: '/newClassTask',
path: '/model/newClassTaskAssign',
query: {
isBack: true,
}
@ -1074,14 +1084,13 @@ export default {
coursetitle: this.currentNode.itemtitle, // (/) ,
node: this.currentNode, //
}
console.log('courseObj', courseObj)
editListItem(row, courseObj).then((obj) => {
if(obj){
//
this.$router.push({
path: '/newClassTask',
path: '/model/newClassTaskAssign',
query: {
classtaskObj: JSON.stringify(obj),
classTaskId: parseInt(obj.id),
}
})
}