From e405eb041bf5eb1acfcfedaa30964011fbe0096b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Tue, 26 Nov 2024 17:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AB=A0=E8=8A=82=E4=B8=8B?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/store/modules/classTask.js | 59 ++++++++++++++++++- src/renderer/src/utils/examQuestion/jyeoo.js | 52 +++++++++++----- .../newClassTaskAssign/Right/index.vue | 10 ++-- .../classTask/newClassTaskAssign/index.vue | 8 +-- .../newClassTaskAssign/myQuestion/index.vue | 15 ++++- .../questionUpload/quesItem/index.vue | 35 +++++++---- .../searchQuestion/index.vue | 16 ++++- src/renderer/src/views/desktop/index.vue | 10 +++- src/renderer/src/views/profile/userInfo.vue | 10 +++- 9 files changed, 173 insertions(+), 42 deletions(-) diff --git a/src/renderer/src/store/modules/classTask.js b/src/renderer/src/store/modules/classTask.js index f0008cf..18b06b0 100644 --- a/src/renderer/src/store/modules/classTask.js +++ b/src/renderer/src/store/modules/classTask.js @@ -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) + }) + }) +} \ No newline at end of file diff --git a/src/renderer/src/utils/examQuestion/jyeoo.js b/src/renderer/src/utils/examQuestion/jyeoo.js index d04c34d..2371efb 100644 --- a/src/renderer/src/utils/examQuestion/jyeoo.js +++ b/src/renderer/src/utils/examQuestion/jyeoo.js @@ -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 = { diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue index b338d76..b911c6c 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue @@ -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' }, diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index 3f39eea..55ff885 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -126,10 +126,10 @@