From 99ee438fd7fe3ebdf1ca861e794425b815921589 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Fri, 23 Aug 2024 09:44:03 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=AF=B9=E6=8E=A5=E7=B4=A0=E6=9D=90;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/file/third.js | 64 ++++ .../src/components/choose-textbook/third.vue | 288 ++++++++++++++++++ .../choose-textbook/third/index.vue | 67 ++++ .../choose-textbook/third/selectSubject.vue | 30 ++ .../src/store/modules/thirdTextbook.js | 23 ++ src/renderer/src/utils/hasPermission.js | 3 +- src/renderer/src/utils/resourceDict.js | 44 ++- .../resource/container/resoure-search.vue | 48 ++- .../views/resource/container/third-list.vue | 260 ++++++++++++++++ src/renderer/src/views/resource/index.vue | 26 +- src/renderer/src/views/resource/store.js | 59 +++- 11 files changed, 888 insertions(+), 24 deletions(-) create mode 100644 src/renderer/src/api/file/third.js create mode 100644 src/renderer/src/components/choose-textbook/third.vue create mode 100644 src/renderer/src/components/choose-textbook/third/index.vue create mode 100644 src/renderer/src/components/choose-textbook/third/selectSubject.vue create mode 100644 src/renderer/src/store/modules/thirdTextbook.js create mode 100644 src/renderer/src/views/resource/container/third-list.vue diff --git a/src/renderer/src/api/file/third.js b/src/renderer/src/api/file/third.js new file mode 100644 index 0000000..5019721 --- /dev/null +++ b/src/renderer/src/api/file/third.js @@ -0,0 +1,64 @@ +//查询第三方课件的接口 +import request from '@/utils/request' +//获取学科 +export const getSubjects = (params) => { + return request({ + url: '/smarttalk/cnjy/getSubjects', + method: 'get', + params + }) +} +//获取教材版本 +export const getTextbookVersion = (params) => { + return request({ + url: '/smarttalk/cnjy/getVersions', + method: 'get', + params + }) +} +//获得书籍 +export const getTextbook = (params) => { + return request({ + url: '/smarttalk/cnjy/getBooks', + method: 'get', + params + }) +} +//获取书籍章节 +export const getBook = (params) => { + return request({ + url: '/smarttalk/cnjy/getChapters', + method: 'get', + params + }) +} +//获取知识点信息 +export const getKnowledge = (params) => { + return request({ + url: '/smarttalk/cnjy/getKnowledgePoints', + method: 'get', + params + }) +} +//查询列表资源 +export const getBookList = (params) => { + return request({ + url: '/smarttalk/cnjy/getDocuments', + method: 'post', + params + }) +} +//获取图片路径 +export const getImgPath = (params) => { + return request({ + url: '/smarttalk/cnjy/getPreview', + method: 'get', + params + }) +} + + + + + + diff --git a/src/renderer/src/components/choose-textbook/third.vue b/src/renderer/src/components/choose-textbook/third.vue new file mode 100644 index 0000000..bc110c2 --- /dev/null +++ b/src/renderer/src/components/choose-textbook/third.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/renderer/src/components/choose-textbook/third/index.vue b/src/renderer/src/components/choose-textbook/third/index.vue new file mode 100644 index 0000000..5ab637f --- /dev/null +++ b/src/renderer/src/components/choose-textbook/third/index.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/renderer/src/components/choose-textbook/third/selectSubject.vue b/src/renderer/src/components/choose-textbook/third/selectSubject.vue new file mode 100644 index 0000000..9512f56 --- /dev/null +++ b/src/renderer/src/components/choose-textbook/third/selectSubject.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/renderer/src/store/modules/thirdTextbook.js b/src/renderer/src/store/modules/thirdTextbook.js new file mode 100644 index 0000000..0c499da --- /dev/null +++ b/src/renderer/src/store/modules/thirdTextbook.js @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia' + +const useThirdStore = defineStore('third', { + state: () => ({ + activeGrade:'', + gradeName:'', + subjectName:'', + textbookVersionId:'' + }), + actions: { + // 登录 + getSelectBookInfo(params){ + this.activeGrade = params.activeGrade + this.gradeName = params.gradeName + this.subjectName = params.subjectName + this.textbookVersionId = params.textbookVersionId + } + + }, + persist: true +}) + +export default useThirdStore diff --git a/src/renderer/src/utils/hasPermission.js b/src/renderer/src/utils/hasPermission.js index 2242209..4d7cb4a 100644 --- a/src/renderer/src/utils/hasPermission.js +++ b/src/renderer/src/utils/hasPermission.js @@ -7,7 +7,6 @@ export const hasPermission = (value, def = true) => { if (!value) { return def } - const allCodeList = useUserStore().roles // 如果不是数组,直接判断pinia里的权限数组有没有相同的元素即可 if (!Array.isArray(value)) { @@ -15,4 +14,4 @@ export const hasPermission = (value, def = true) => { } // intersection是lodash提供的一个方法,用于返回一个所有给定数组都存在的元素组成的数组 return array.intersection(value, allCodeList).length > 0 -} \ No newline at end of file +} diff --git a/src/renderer/src/utils/resourceDict.js b/src/renderer/src/utils/resourceDict.js index a1a1a61..a334ccb 100644 --- a/src/renderer/src/utils/resourceDict.js +++ b/src/renderer/src/utils/resourceDict.js @@ -6,7 +6,11 @@ export const tabs = [ { label: '校本资源', value: '校本' - } + }, + { + label: '第三方资源', + value: '第三方' + }, ] @@ -67,3 +71,41 @@ export const resourceType = [ value: '教案' } ] +// 年级划分 +export const gradeList = [ + { + label:'小学', + value:1 + }, + { + label:'初中', + value:2 + }, + { + label:'高中', + value:3 + }, +] +//课件类别 +export const coursewareTypeList = [ + { + label:'课件', + value:3 + }, + { + label:'教案', + value:8 + }, + { + label:'试卷', + value:7 + }, + { + label:'学案', + value:4 + }, + { + label:'素材', + value:6 + }, +] diff --git a/src/renderer/src/views/resource/container/resoure-search.vue b/src/renderer/src/views/resource/container/resoure-search.vue index 7272c0f..c267157 100644 --- a/src/renderer/src/views/resource/container/resoure-search.vue +++ b/src/renderer/src/views/resource/container/resoure-search.vue @@ -7,12 +7,30 @@ @click="sourceStore.changeTab(item.value)">{{ item.label }} - - + + + + - + + + + +
+ + {{item.label }} + +
+
+
+
@@ -30,13 +48,33 @@
+ \ No newline at end of file + diff --git a/src/renderer/src/views/resource/container/third-list.vue b/src/renderer/src/views/resource/container/third-list.vue new file mode 100644 index 0000000..b163266 --- /dev/null +++ b/src/renderer/src/views/resource/container/third-list.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/src/renderer/src/views/resource/index.vue b/src/renderer/src/views/resource/index.vue index 6438cbb..5629cd2 100644 --- a/src/renderer/src/views/resource/index.vue +++ b/src/renderer/src/views/resource/index.vue @@ -1,7 +1,8 @@