更新章节下知识点
This commit is contained in:
parent
09e6bec69f
commit
e405eb041b
|
@ -1,16 +1,21 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { } from '@/api/classTask/index.js'
|
||||
import { listClassmain } from '@/api/classManage/index'
|
||||
import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
|
||||
|
||||
const useClassTaskStore = defineStore('classTask',{
|
||||
state: () => ({
|
||||
classListIds: [],
|
||||
jyCT: [],
|
||||
jySO: [],
|
||||
jyYear: [],
|
||||
}),
|
||||
actions: {
|
||||
listClassmain(params) {
|
||||
// 获取班级列表
|
||||
return new Promise((resolve, reject) => {
|
||||
listClassmain(params)
|
||||
const education = params.edustage + params.edusubject;
|
||||
listClassmain(education)
|
||||
.then((res) => {
|
||||
this.classListIds = res.rows&&res.rows.map((item) => item.id)
|
||||
resolve(res)
|
||||
|
@ -20,9 +25,61 @@ const useClassTaskStore = defineStore('classTask',{
|
|||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 根据学科和学段获取菁优网对应得年份、题源、题型
|
||||
initJYInfo(params){
|
||||
const education = params.edustage + params.edusubject;
|
||||
Promise.all([getJYYear(), getJYSO(education), getJYCT(education)])
|
||||
.then(results => {
|
||||
console.log('更新第三方题源+题型succ:', results);
|
||||
this.jyYear = results[0];
|
||||
this.jyCT = results[2];
|
||||
this.jySO = results[1];
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('更新第三方题源+题型err:', error);
|
||||
this.jyYear = [];
|
||||
this.jySO = [];
|
||||
this.jyCT = [];
|
||||
});
|
||||
},
|
||||
},
|
||||
persist: true
|
||||
})
|
||||
export default useClassTaskStore
|
||||
|
||||
const getJYYear = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
JYApiListOriginYear()
|
||||
.then((res) => {
|
||||
resolve(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getJYSO = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
JYApiListSO(params)
|
||||
.then((res) => {
|
||||
resolve(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getJYCT = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
JYApiListCT(params)
|
||||
.then((res) => {
|
||||
resolve(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -28,7 +28,30 @@ const JY_SUBJECT = [
|
|||
{id: 39, subject: 'history2', name: '高中历史'},
|
||||
];
|
||||
|
||||
/**
|
||||
* @desc: 获取年份
|
||||
* @return: {*}
|
||||
*/
|
||||
export const JYApiListOriginYear = async () => {
|
||||
const arrYear = [{label: '不限', value: '-1'}];
|
||||
let i = 0;
|
||||
for( ; i < 5; i++) {
|
||||
const year = new Date().getFullYear();
|
||||
const s ={
|
||||
label: `${year - i}`,
|
||||
value: `${year - i}`,
|
||||
}
|
||||
arrYear.push(s);
|
||||
};
|
||||
//arrYear.push({label: '更早', value: '0'})
|
||||
return arrYear;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 根据学科+学段获取菁优网-题型
|
||||
* @return: {*}
|
||||
* @param {*} name 学科+学科
|
||||
*/
|
||||
export const JYApiListCT = async (name = '高中历史') => {
|
||||
if (name === '初中政治') {
|
||||
name = '初中道德与法治';
|
||||
|
@ -66,21 +89,12 @@ export const JYApiListCT = async (name = '高中历史') => {
|
|||
return arrCT;
|
||||
}
|
||||
|
||||
export const JYApiListOriginYear = async () => {
|
||||
const arrYear = [{label: '不限', value: '-1'}];
|
||||
let i = 0;
|
||||
for( ; i < 10; i++) {
|
||||
const year = new Date().getFullYear();
|
||||
const s ={
|
||||
label: `${year - i}`,
|
||||
value: `${year - i}`,
|
||||
}
|
||||
arrYear.push(s);
|
||||
};
|
||||
//arrYear.push({label: '更早', value: '0'})
|
||||
return arrYear;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 根据学科+学段获取菁优网-题源
|
||||
* @return: {*}
|
||||
* @param {*} name 学科+学科
|
||||
*/
|
||||
export const JYApiListSO = async (name = '高中历史') => {
|
||||
if (name === '初中政治') {
|
||||
name = '初中道德与法治';
|
||||
|
@ -106,7 +120,11 @@ export const JYApiListSO = async (name = '高中历史') => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 根据学科+学段获取菁优网-知识点
|
||||
* @return: {*}
|
||||
* @param {*} name 学科+学科
|
||||
*/
|
||||
export const JYApiListPoint = async (name = '高中历史') => {
|
||||
if (name === '初中政治') {
|
||||
name = '初中道德与法治';
|
||||
|
@ -129,8 +147,10 @@ export const JYApiListPoint = async (name = '高中历史') => {
|
|||
|
||||
|
||||
/**
|
||||
* @desc: 获取菁优网的版本内容
|
||||
* @desc: 根据查询条件获取菁优网-教材版本
|
||||
* @return: {*}
|
||||
* @param {*} query {}
|
||||
* @param {*} hasPoints
|
||||
*/
|
||||
export const JYApiListVersion = async (query, hasPoints=true) => {
|
||||
const listVersion = {
|
||||
|
|
|
@ -29,11 +29,11 @@ import { ElMessage } from 'element-plus'
|
|||
|
||||
const emit = defineEmits(['itemClick'])
|
||||
const items = shallowRef([
|
||||
{ title: '自主搜题', description: '上千万高质量习题资源,历届考试真题,每道题均有习题解析', icon: '#icon-soutibao-',type:'default' },
|
||||
{ title: '校本题库', description: '本校公共题库资源。', icon: '#icon-soutibao-',type:'default' },
|
||||
{ title: '个人题库', description: '老师上传维护自己的个人题库。', icon: '#icon-soutibao-',type:'default' },
|
||||
{ title: '智能推荐', description: '通过对学生的薄弱知识点分析,推送不同难度的习题进行强化训练。', icon: '#icon-tubiao_wuxing-',type:'default' },
|
||||
{ title: '课堂展示', description: '通过课堂白板绘制作业,提升学生的创作思维能力。', icon: '#icon-huaban',type:'primary' },
|
||||
{ title: '自主搜题', description: '上千万高质量习题资源,历届考试真题,每道题均有习题解析', icon: '#icon-soutibao-',type:'primary' },
|
||||
{ title: '校本题库', description: '本校公共题库资源。', icon: '#icon-soutibao-',type:'primary' },
|
||||
{ title: '个人题库', description: '老师上传维护自己的个人题库。', icon: '#icon-soutibao-',type:'primary' },
|
||||
{ title: '智能推荐', description: '通过对学生的薄弱知识点分析,推送不同难度的习题进行强化训练。', icon: '#icon-tubiao_wuxing-',type:'primary' },
|
||||
{ title: '课堂展示', description: '通过课堂白板绘制作业,提升学生的创作思维能力。', icon: '#icon-huaban',type:'danger' },
|
||||
{ title: '常规作业', description: '推送pdf、视频、音频、图片,学生可以拍照上传。', icon: '#icon-zhaoxiangji',type:'danger' },
|
||||
{ title: 'AI设计作业', description: '通过AI助手,根据课标、教材、考试等分析结果,智能创建作业。', icon: '#icon-jiqiren_o',type:'danger' },
|
||||
{ title: '习题上传', description: '自己上传个人题库。', icon: '#icon-shangchuan',type:'danger' },
|
||||
|
|
|
@ -126,10 +126,10 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
|
||||
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { Plus, Delete } from '@element-plus/icons-vue'
|
||||
import { delClasswork } from '@/api/teaching/classwork'
|
||||
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||
|
@ -144,10 +144,6 @@ import whiteboard from '@/components/whiteboard/whiteboard.vue'
|
|||
import FileUpload from "@/components/FileUpload/index.vue";
|
||||
import Right from './Right/index.vue'
|
||||
|
||||
import {
|
||||
Delete
|
||||
} from '@element-plus/icons-vue'
|
||||
|
||||
import SetHomework from '@/components/set-homework/index.vue'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
|
|
@ -129,12 +129,15 @@ import { processList } from '@/hooks/useProcessList'
|
|||
|
||||
import { debounce } from '@/utils/comm'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
|
||||
const router = useRouter()
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['addQuiz'])
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore().user
|
||||
const classTaskStore = useClassTaskStore();
|
||||
|
||||
const props = defineProps({
|
||||
bookobj: {
|
||||
type: Object,
|
||||
|
@ -218,6 +221,16 @@ const dlgImportSingle = reactive({
|
|||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (classTaskStore.jyCT.length>0) {
|
||||
entpCourseWorkTypeList.value = classTaskStore.jyCT;
|
||||
}
|
||||
if (classTaskStore.jySO.length>0) {
|
||||
entpCourseWorkGroupList.value = classTaskStore.jySO;
|
||||
}
|
||||
if (classTaskStore.jyYear.length>0) {
|
||||
entpCourseWorkYearList.value = classTaskStore.jyYear;
|
||||
}
|
||||
|
||||
debounceQueryData(); // 查询习题列表
|
||||
})
|
||||
|
||||
|
@ -336,7 +349,7 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
|
|||
} else if (clueres.rows[i].cluetag == 'mapview') {
|
||||
clueres.rows[i].worktype = '学科定位';
|
||||
}
|
||||
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 != '') {
|
||||
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
|
|
|
@ -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.Key" :label="item.Value" :value="item.Value"></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>
|
||||
|
@ -414,7 +414,11 @@ import { isJson } from "@/hooks/useProcessList";
|
|||
|
||||
import Tinymce from "@/components/tinymce/tinymce.vue"; // 富文本编辑器
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
|
||||
const userStore = useUserStore().user
|
||||
const classTaskStore = useClassTaskStore();
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['submit-exam-single-callback','cancel-exam-single-callback','cropper-exam-form-item'])
|
||||
|
@ -450,12 +454,13 @@ const fromOptions = reactive({
|
|||
//题型
|
||||
type: [
|
||||
//{"Key": 0, "Value": "不限"},
|
||||
{"Key": 1, "Value": "单选题"},
|
||||
{"Key": 4, "Value": "多选题"},
|
||||
{"Key": 2, "Value": "填空题"},
|
||||
{"Key": 5, "Value": "判断题"},
|
||||
{"Key": 6, "Value": "主观题"},
|
||||
{"Key": 3, "Value": "复合题"},
|
||||
{value: 0, label: "不限"},
|
||||
{value: 1, label: "单选题"},
|
||||
{value: 2, label: "填空题"},
|
||||
{value: 3, label: "多选题"},
|
||||
{value: 4, label: "判断题"},
|
||||
{value: 5, label: "主观题"},
|
||||
{value: 6, label: "复合题"},
|
||||
//{"Key": 4, "Value": "辨析评析题"},
|
||||
],
|
||||
// 复合题型
|
||||
|
@ -476,7 +481,7 @@ const questForm = reactive({
|
|||
id: 0,
|
||||
title: '',
|
||||
worktype: '单选题',
|
||||
worktagYear: '2024',
|
||||
worktagYear: 2024,
|
||||
//worktagArea: '',
|
||||
worktag: '',
|
||||
workgroup: 0,
|
||||
|
@ -602,8 +607,8 @@ onMounted(() => {
|
|||
lessionId: lessionid,
|
||||
fileAlias: '单题上传',
|
||||
};
|
||||
|
||||
// 获取最新年份
|
||||
// yearList =
|
||||
for(var i = 0; i < 15; i++) {
|
||||
const year = new Date().getFullYear();
|
||||
const s ={
|
||||
|
@ -613,7 +618,17 @@ onMounted(() => {
|
|||
yearList.value.push(s)
|
||||
};
|
||||
|
||||
// 拿到当前章节下得所有知识点
|
||||
// 更新第三方题型、题源
|
||||
if (classTaskStore.jyCT.length>0) {
|
||||
const flagDict = ['单选题', '多选题', '判断题', '填空题'];
|
||||
fromOptions.type = classTaskStore.jyCT.filter(item => flagDict.includes(item.label));
|
||||
}
|
||||
if (classTaskStore.jySO.length>0) {
|
||||
fromOptions.flag = classTaskStore.jySO;
|
||||
}
|
||||
// if (classTaskStore.jyYear.length>0) {
|
||||
// yearList.value = classTaskStore.jyYear;
|
||||
// }
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<el-col :span="10">
|
||||
<el-form-item label="知识点" label-width="70">
|
||||
<el-cascader
|
||||
disabled
|
||||
v-model="entpCourseWorkQueryParams.point"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
|
@ -118,11 +119,14 @@ import { useGetHomework } from '@/hooks/useGetHomework'
|
|||
import { sessionStore } from '@/utils/store'
|
||||
import {throttle,debounce } from '@/utils/comm'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['addQuiz'])
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore().user
|
||||
const classTaskStore = useClassTaskStore();
|
||||
|
||||
const props = defineProps({
|
||||
bookobj: {
|
||||
type: Object,
|
||||
|
@ -205,6 +209,16 @@ const workResource = reactive({
|
|||
}); // 作业资源
|
||||
|
||||
onMounted(() => {
|
||||
if (classTaskStore.jyCT.length>0) {
|
||||
entpCourseWorkTypeList.value = classTaskStore.jyCT;
|
||||
}
|
||||
if (classTaskStore.jySO.length>0) {
|
||||
entpCourseWorkGroupList.value = classTaskStore.jySO;
|
||||
}
|
||||
if (classTaskStore.jyYear.length>0) {
|
||||
entpCourseWorkYearList.value = classTaskStore.jyYear;
|
||||
}
|
||||
|
||||
debounceQueryData(); // 查询习题列表
|
||||
})
|
||||
|
||||
|
@ -342,7 +356,7 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
|
|||
} else if (clueres.rows[i].cluetag == 'mapview') {
|
||||
clueres.rows[i].worktype = '学科定位';
|
||||
}
|
||||
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 != '') {
|
||||
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
|
|
|
@ -58,6 +58,11 @@ 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();
|
||||
|
||||
const router = useRouter()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const chartDom = ref(null);
|
||||
|
@ -206,11 +211,14 @@ ipcRenderer.on('minWinResize', debounce((e, data) =>{
|
|||
}, 100))
|
||||
|
||||
onMounted(async ()=>{
|
||||
|
||||
await useGetSubject()
|
||||
// 确保DOM 渲染完成
|
||||
await nextTick()
|
||||
chartInstance = echarts.init(chartDom.value)
|
||||
|
||||
// 更新第三方题型题类
|
||||
await classTaskStore.initJYInfo(userStore.user);
|
||||
|
||||
const option = {
|
||||
|
||||
tooltip: {
|
||||
|
|
|
@ -40,6 +40,9 @@ import {listClassmain} from '@/api/classManage/index'
|
|||
//班级列表
|
||||
import ClassList from './components/classList.vue'
|
||||
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
const classTaskStore = useClassTaskStore();
|
||||
|
||||
//班级列表
|
||||
const classList = ref([])
|
||||
// 未加入的班级
|
||||
|
@ -163,10 +166,11 @@ function submit() {
|
|||
proxy.$refs.userRef.validate((valid) => {
|
||||
if (valid) {
|
||||
userStore.user.avatar = userStore.user.avatar
|
||||
console.log('userStore更新前', userStore.user);
|
||||
updateUserInfo(userStore.user).then((response) => {
|
||||
if(response.code == 200){
|
||||
userStore.login({username:userStore.user.userName,password:userStore.user.plainpwd}).then(() => {
|
||||
userStore.getInfo().then(res => {
|
||||
userStore.getInfo().then(async res => {
|
||||
if(res.code === 200){
|
||||
let sessionSubject = {
|
||||
bookList: null,
|
||||
|
@ -177,6 +181,10 @@ function submit() {
|
|||
}
|
||||
sessionStore.set( 'subject', sessionSubject)
|
||||
ElMessage.success('修改成功')
|
||||
|
||||
console.log('userStore更新后', res);
|
||||
await classTaskStore.initJYInfo(userStore.user);
|
||||
//console.log('classTaskStore->', classTaskStore);
|
||||
}else{
|
||||
ElMessage.error(response.msg)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue