Compare commits
No commits in common. "2a4b0281c26ce5f0fc8a8f5dbd53723271f02fb9" and "b76a5896729e999f9e4ddbc2c4b2ba0a786a48da" have entirely different histories.
2a4b0281c2
...
b76a589672
|
@ -16,12 +16,6 @@ const defaultData = {
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
|
||||||
subject: {
|
|
||||||
bookList: null, // 教材列表
|
|
||||||
curBook: null, // 当前选中的教材
|
|
||||||
curNode: null, // 当前选中的节点
|
|
||||||
defaultExpandedKeys: [], //展开的节点
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
local: { // 本地(永久localStorage)
|
local: { // 本地(永久localStorage)
|
||||||
|
|
|
@ -44,12 +44,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||||
|
|
||||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['nodeClick'])
|
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||||
let useSubject = null
|
let useSubject = null
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
@ -75,7 +74,8 @@ const defaultExpandedKeys = ref([])
|
||||||
//选择教材
|
//选择教材
|
||||||
const changeBook = (data) => {
|
const changeBook = (data) => {
|
||||||
curBook.data = data
|
curBook.data = data
|
||||||
sessionStore.set('subject.curBook', data)
|
|
||||||
|
localStorage.setItem('curBook', JSON.stringify(data))
|
||||||
treeData.value = useSubject.getTreeData(data.id)
|
treeData.value = useSubject.getTreeData(data.id)
|
||||||
|
|
||||||
//切换教材后默认展开第一个并选中
|
//切换教材后默认展开第一个并选中
|
||||||
|
@ -83,7 +83,9 @@ const changeBook = (data) => {
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
curNode.data = getLastLevelData(treeData.value)[0]
|
||||||
|
|
||||||
handleNodeClick(curNode.data)
|
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||||
|
localStorage.setItem('curNode',JSON.stringify(curNode.data))
|
||||||
|
emitChangeBook()
|
||||||
})
|
})
|
||||||
// 延迟关闭 视觉上选中
|
// 延迟关闭 视觉上选中
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -91,6 +93,40 @@ const changeBook = (data) => {
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const emitChangeBook = async () => {
|
||||||
|
let curData = cloneDeep(toRaw(curNode.data))
|
||||||
|
let parentNode = findParentByChildId(treeData.value, curData.id)
|
||||||
|
curData.parentNode = toRaw(parentNode)
|
||||||
|
//怎加一个label 之前取的label
|
||||||
|
curData.label = curData.itemtitle
|
||||||
|
const data = {
|
||||||
|
textBook: {
|
||||||
|
curBookId: curBook.data.id,
|
||||||
|
curBookName: curBook.data.itemtitle,
|
||||||
|
curBookImg: BaseUrl + curBook.data.avartar,
|
||||||
|
curBookPath: curBook.data.fileurl
|
||||||
|
},
|
||||||
|
node: curData
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 临时用 后续删除 unitId
|
||||||
|
*/
|
||||||
|
let levelFirstId = null
|
||||||
|
let levelSecondId = null
|
||||||
|
let bookeId = curBook.data.id
|
||||||
|
if (curData.parentNode) {
|
||||||
|
levelFirstId = curData.parentNode.id
|
||||||
|
levelSecondId = curData.id
|
||||||
|
} else {
|
||||||
|
levelFirstId = curData.id
|
||||||
|
levelSecondId = ''
|
||||||
|
}
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
|
||||||
|
emit('changeBook', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const getLastLevelData = (tree) => {
|
const getLastLevelData = (tree) => {
|
||||||
let lastLevelData = [];
|
let lastLevelData = [];
|
||||||
// 递归函数遍历树形结构
|
// 递归函数遍历树形结构
|
||||||
|
@ -135,22 +171,25 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data) => {
|
const handleNodeClick = (data, node) => {
|
||||||
/**
|
/**
|
||||||
* data : 当前节点数据
|
* data : 当前节点数据
|
||||||
|
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
||||||
*/
|
*/
|
||||||
let nodeData = cloneDeep(toRaw(data));
|
let nodeData = cloneDeep(toRaw(data));
|
||||||
|
//怎加一个label 之前取的label
|
||||||
//增加一个label 之前取的label
|
|
||||||
nodeData.label = nodeData.itemtitle
|
nodeData.label = nodeData.itemtitle
|
||||||
// 父级节点 如果当前是一级节点 父级则为null
|
const parentNode = node.parent.data;
|
||||||
let parent = {
|
// parentNode 为数组 则点击的是一级节点
|
||||||
id: nodeData.parentid,
|
if (Array.isArray(parentNode)) {
|
||||||
label: nodeData.parenttitle,
|
//
|
||||||
itemtitle: nodeData.parenttitle
|
nodeData.parentNode = null
|
||||||
}
|
}
|
||||||
const parentNode = nodeData.parentid ? parent : null
|
else {
|
||||||
nodeData.parentNode = parentNode
|
// 否则 点击的为二级节点 parentNode 为它的父级节点
|
||||||
|
nodeData.parentNode = toRaw(parentNode)
|
||||||
|
}
|
||||||
|
|
||||||
let curData = {
|
let curData = {
|
||||||
textBook: {
|
textBook: {
|
||||||
curBookId: curBook.data.id,
|
curBookId: curBook.data.id,
|
||||||
|
@ -158,40 +197,63 @@ const handleNodeClick = (data) => {
|
||||||
curBookImg: BaseUrl + curBook.data.avartar,
|
curBookImg: BaseUrl + curBook.data.avartar,
|
||||||
curBookPath: curBook.data.fileurl
|
curBookPath: curBook.data.fileurl
|
||||||
},
|
},
|
||||||
node: nodeData
|
node: toRaw(nodeData)
|
||||||
}
|
}
|
||||||
// 本地存储:electron-store
|
localStorage.setItem('defaultExpandedKeys', parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
|
||||||
let defaultExpandedKeys = parentNode ? [parentNode.id] : [nodeData.id]
|
localStorage.setItem('curNode', JSON.stringify(nodeData))
|
||||||
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
|
||||||
sessionStore.set('subject.curNode', nodeData)
|
/**
|
||||||
|
* 临时用 后续删除 unitId
|
||||||
|
*/
|
||||||
|
let levelFirstId = null
|
||||||
|
let levelSecondId = null
|
||||||
|
let bookeId = curBook.data.id
|
||||||
|
if (nodeData.parentNode) {
|
||||||
|
levelFirstId = nodeData.parentNode.id
|
||||||
|
levelSecondId = nodeData.id
|
||||||
|
} else {
|
||||||
|
levelFirstId = nodeData.id
|
||||||
|
levelSecondId = ''
|
||||||
|
}
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
|
||||||
|
|
||||||
emit('nodeClick', curData)
|
emit('nodeClick', curData)
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted( async () => {
|
onMounted( async () => {
|
||||||
treeLoading.value = true
|
treeLoading.value = true
|
||||||
|
|
||||||
try{
|
try{
|
||||||
useSubject = await useGetSubject()
|
useSubject = await useGetSubject()
|
||||||
subjectList.value = sessionStore.get('subject.bookList')
|
subjectList.value = useSubject.subjectList
|
||||||
// 当前教材
|
|
||||||
if(sessionStore.get('subject.curBook')){
|
let book = localStorage.getItem('curBook')
|
||||||
curBook.data = sessionStore.get('subject.curBook')
|
if(book){
|
||||||
|
book = JSON.parse(book)
|
||||||
|
curBook.data = book
|
||||||
|
treeData.value = useSubject.getTreeData(book.id)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
curBook.data = subjectList.value[0]
|
curBook.data = useSubject.subjectList[0]
|
||||||
|
localStorage.setItem('curBook', JSON.stringify(curBook.data))
|
||||||
|
treeData.value = useSubject.treeData
|
||||||
}
|
}
|
||||||
|
// 设置展开并选中
|
||||||
// 章节"树"
|
|
||||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
|
||||||
nextTick(() =>{
|
nextTick(() =>{
|
||||||
// 默认展开 选中
|
// 取缓存
|
||||||
if(sessionStore.get('subject.curNode')){
|
let node = localStorage.getItem('curNode')
|
||||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
if(node){
|
||||||
curNode.data = sessionStore.get('subject.curNode')
|
curNode.data = JSON.parse(node)
|
||||||
}else{
|
defaultExpandedKeys.value = JSON.parse(localStorage.getItem('defaultExpandedKeys'))
|
||||||
|
}
|
||||||
|
else{
|
||||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||||
curNode.data = getLastLevelData(treeData.value)[0]
|
curNode.data = getLastLevelData(treeData.value)[0]
|
||||||
|
//缓存记录当前展开以及选中节点
|
||||||
|
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||||
|
localStorage.setItem('curNode', JSON.stringify(curNode.data))
|
||||||
}
|
}
|
||||||
handleNodeClick(curNode.data)
|
emitChangeBook()
|
||||||
})
|
})
|
||||||
|
|
||||||
} finally{
|
} finally{
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
export const useGetSubject = async () =>{
|
export const useGetSubject = async () =>{
|
||||||
|
|
||||||
// user store
|
// user store
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { edustage, edusubject } = userStore.user
|
const { edustage, edusubject, userId } = userStore.user
|
||||||
|
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
// 章节List
|
// 章节List
|
||||||
const unitList = ref([])
|
const unitList = ref([])
|
||||||
// 教材List
|
// 教材List
|
||||||
|
@ -15,10 +15,12 @@ export const useGetSubject = async () =>{
|
||||||
// 单元章节树结构
|
// 单元章节树结构
|
||||||
let treeData = null
|
let treeData = null
|
||||||
|
|
||||||
|
|
||||||
// 根据 学科 + 学段 获取所有单元章节
|
// 根据 学科 + 学段 获取所有单元章节
|
||||||
const getSubjectUnit = async () =>{
|
const getSubjectUnit = async () =>{
|
||||||
if(sessionStore.get('subject.unitList')){
|
let strUnit = localStorage.getItem('unitList')
|
||||||
unitList.value = sessionStore.get('subject.unitList')
|
if(strUnit){
|
||||||
|
unitList.value = JSON.parse(strUnit)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const unitParams = {
|
const unitParams = {
|
||||||
|
@ -30,16 +32,18 @@ export const useGetSubject = async () =>{
|
||||||
}
|
}
|
||||||
const { rows } = await listEvaluation(unitParams)
|
const { rows } = await listEvaluation(unitParams)
|
||||||
unitList.value = rows
|
unitList.value = rows
|
||||||
sessionStore.set('subject.unitList', rows)
|
localStorage.setItem('unitList', JSON.stringify(rows))
|
||||||
}
|
}
|
||||||
|
|
||||||
await getSubject()
|
await getSubject()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据学科 + 学段 获取教材
|
// 获取 学科 + 学段 获取教材
|
||||||
const getSubject = async () =>{
|
const getSubject = async () =>{
|
||||||
|
|
||||||
if(sessionStore.get('subject.bookList')){
|
let strSubject = localStorage.getItem('subjectList')
|
||||||
subjectList = sessionStore.get('subject.bookList')
|
if(strSubject){
|
||||||
|
subjectList = JSON.parse(strSubject)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const subjectParams = {
|
const subjectParams = {
|
||||||
|
@ -51,19 +55,13 @@ export const useGetSubject = async () =>{
|
||||||
}
|
}
|
||||||
const { rows } = await listEvaluation(subjectParams)
|
const { rows } = await listEvaluation(subjectParams)
|
||||||
subjectList = rows
|
subjectList = rows
|
||||||
sessionStore.set('subject.bookList', rows)
|
localStorage.setItem('subjectList', JSON.stringify(rows))
|
||||||
treeData = getTreeData(subjectList[0].id)
|
|
||||||
// 设置一个默认的curNode
|
|
||||||
let curNode
|
|
||||||
if(treeData[0].children){
|
|
||||||
curNode = treeData[0].children[0]
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
curNode = treeData[0]
|
|
||||||
}
|
|
||||||
sessionStore.set('subject.curNode', curNode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 默认选中第一个教材
|
||||||
|
if(subjectList && subjectList.length){
|
||||||
|
treeData = getTreeData(subjectList[0].id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单元章节数据转为“树”结构
|
// 单元章节数据转为“树”结构
|
||||||
|
@ -73,7 +71,6 @@ export const useGetSubject = async () =>{
|
||||||
data.forEach( item => {
|
data.forEach( item => {
|
||||||
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
|
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
|
||||||
})
|
})
|
||||||
sessionStore.set('subject.subjectTree', data)
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,30 @@ const currentRoute = ref('')
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||||
const userSubjectList = ref([])
|
const userSubjectList = ref([])
|
||||||
|
|
||||||
|
const handleOutLink = (path, type, name) => {
|
||||||
|
if (!path) return
|
||||||
|
if (type === 'hash') {
|
||||||
|
router.push(path)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// key 对应的 linkConfig.js 外部链接配置
|
||||||
|
let configObj = outLink().getBaseData()
|
||||||
|
let fullPath = configObj.fullPath + path
|
||||||
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
|
||||||
|
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||||
|
if (name == '教材分析' || name == '考试分析') {
|
||||||
|
fullPath += `?unitId=${unitId}`
|
||||||
|
}
|
||||||
|
// 通知主进程
|
||||||
|
ipcRenderer.send('openWindow', {
|
||||||
|
key: path,
|
||||||
|
fullPath: fullPath,
|
||||||
|
cookieData: { ...configObj.data }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const activeId = ref('/home')
|
const activeId = ref('/home')
|
||||||
const headerMenus = [
|
const headerMenus = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,8 +45,7 @@ import { useRouter } from 'vue-router'
|
||||||
import workTrend from './container/work-trend.vue'
|
import workTrend from './container/work-trend.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
import { useGetClassWork } from '@/hooks/useGetClassWork'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
@ -175,12 +174,13 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
if(id == '1-2' || id == '2-1' || id == '2-2' ){
|
if(id == '1-2' || id == '2-1' || id == '2-2' ){
|
||||||
// 头部 教材分析打开外部链接需要当前章节ID
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
|
||||||
|
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||||
if(fullPath.indexOf('?') == -1){
|
if(fullPath.indexOf('?') == -1){
|
||||||
fullPath += `?unitId=${id}&bookeId=${rootid}`
|
fullPath += `?unitId=${unitId}&bookeId=${bookeId}`
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
fullPath += `&unitId=${id}&bookeId=${rootid}`
|
fullPath += `&unitId=${unitId}&bookeId=${bookeId}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
@ -196,8 +196,6 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async ()=>{
|
onMounted(async ()=>{
|
||||||
|
|
||||||
await useGetSubject()
|
|
||||||
// 确保DOM 渲染完成
|
// 确保DOM 渲染完成
|
||||||
await nextTick()
|
await nextTick()
|
||||||
chartInstance = echarts.init(chartDom.value)
|
chartInstance = echarts.init(chartDom.value)
|
||||||
|
@ -243,10 +241,21 @@ onMounted(async ()=>{
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
chartInstance.setOption(option);
|
chartInstance.setOption(option);
|
||||||
|
// 初始化 获取教材下面的单元 + 章节
|
||||||
|
getSubjectInit();
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getSubjectInit = async () => {
|
||||||
|
//查看本地是否有缓存
|
||||||
|
let unitId = localStorage.getItem('unitId')
|
||||||
|
if(unitId){
|
||||||
|
// 有缓存不用管
|
||||||
|
} else{
|
||||||
|
// 没有 就获取 获取教材下面的单元 + 章节
|
||||||
|
useGetClassWork();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -207,8 +207,8 @@ export default {
|
||||||
},
|
},
|
||||||
openFileWin(items) {
|
openFileWin(items) {
|
||||||
if (items.fileFlag === 'apt') {
|
if (items.fileFlag === 'apt') {
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
let curBook = JSON.parse(localStorage.getItem('curBook'))
|
||||||
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid;
|
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
|
||||||
let configObj = outLink().getBaseData()
|
let configObj = outLink().getBaseData()
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="isLoading" class="page-resource flex">
|
<div v-loading="isLoading" class="page-resource flex">
|
||||||
<ChooseTextbook @node-click="nodeClick" />
|
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||||
<div class="page-center-wrap">
|
<div class="page-center-wrap">
|
||||||
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||||
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="page-resource flex">
|
<div class="page-resource flex">
|
||||||
<!--左侧 教材 目录-->
|
<!--左侧 教材 目录-->
|
||||||
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
||||||
<ChooseTextbook v-else @node-click="getData" />
|
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
|
||||||
|
|
||||||
<div class="page-right">
|
<div class="page-right">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
<div class="page-con-left">
|
<div class="page-con-left">
|
||||||
<div class="stand-head" ref="headref">
|
<div class="stand-head" ref="headref">
|
||||||
<div class="stand-head-left">
|
<div class="stand-head-left">
|
||||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
<el-image class="imges" src="https://file.ysaix.com:7868//src/assets/images/高中语文必修上册.jpg" />
|
||||||
</div>
|
</div>
|
||||||
<div class="stand-head-right">
|
<div class="stand-head-right">
|
||||||
<div class="stand-head-right-tit">{{booktitle}}</div>
|
<div class="stand-head-right-tit">{{booktitle}}</div>
|
||||||
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
||||||
<div class="stand-head-right-row">
|
<div class="stand-head-right-row">
|
||||||
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
||||||
<!-- <el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" /> -->
|
<el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,10 +68,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="550">
|
||||||
<div class="booklist">
|
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item)">{{item.edustage + item.edusubject}}</div>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -84,7 +82,7 @@ import { listEvaluationclue } from '@/api/teaching/classwork'
|
||||||
import { uploadServer, getJSONFile } from '@/utils/common'
|
import { uploadServer, getJSONFile } from '@/utils/common'
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus'
|
||||||
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const sourceStore = useResoureStore()
|
const sourceStore = useResoureStore()
|
||||||
|
@ -103,10 +101,6 @@ const searchref = ref(null);
|
||||||
const listHeight = ref(0);
|
const listHeight = ref(0);
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const booktitle = ref('');
|
const booktitle = ref('');
|
||||||
const bookInfo = ref(null);
|
|
||||||
const booksel = ref(0);
|
|
||||||
const bookList = ref([])
|
|
||||||
|
|
||||||
|
|
||||||
const searchOptions = [{
|
const searchOptions = [{
|
||||||
value: '0',
|
value: '0',
|
||||||
|
@ -115,7 +109,7 @@ const searchOptions = [{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '按内容量',
|
label: '按内容量',
|
||||||
}];
|
}];
|
||||||
const standList = ref([]);
|
const standList = ref([])
|
||||||
const showData = ref([]);
|
const showData = ref([]);
|
||||||
|
|
||||||
//查询课标分析列表
|
//查询课标分析列表
|
||||||
|
@ -240,41 +234,16 @@ const getData = (data) => {
|
||||||
// 头部 教材分析打开外部链接需要当前章节ID
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||||
}
|
}
|
||||||
// 获取学科
|
onMounted(() => {
|
||||||
const getAllSubject = async () => {
|
|
||||||
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
|
||||||
const { edustage, edusubject } = userStore.user;
|
|
||||||
rows && rows.map(item => {
|
|
||||||
if(item.edustage === edustage && item.edusubject === edusubject){
|
|
||||||
bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar}
|
|
||||||
}
|
|
||||||
if(item.fileurl !== ''){
|
|
||||||
bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
booksel.value = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
|
||||||
}
|
|
||||||
const bookChange = async (item, idx) => {
|
|
||||||
booksel.value = idx
|
|
||||||
bookInfo.value = {...item}
|
|
||||||
booktitle.value = `${item.edustage + item.edusubject}课程标准`
|
|
||||||
pdfUrl.value = '';
|
|
||||||
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
|
||||||
await loadPdfAnimation(filepath)
|
|
||||||
dialogVisible.value = false
|
|
||||||
}
|
|
||||||
const loadPdfAnimation = (path) => {
|
|
||||||
const timer = setTimeout(() => {
|
|
||||||
pdfUrl.value = path
|
|
||||||
clearTimeout(timer);
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
onMounted(async () => {
|
|
||||||
await getAllSubject();
|
|
||||||
const { edustage, edusubject } = userStore.user;
|
const { edustage, edusubject } = userStore.user;
|
||||||
booktitle.value = `${edustage + edusubject}课程标准`
|
booktitle.value = `${edustage + edusubject}课程标准`
|
||||||
const filePath = `${import.meta.env.VITE_APP_RES_FILE_PATH}${edustage}-${edusubject}-课标.pdf`
|
const filePath = `${import.meta.env.VITE_APP_RES_FILE_PATH}${edustage}-${edusubject}-课标.pdf`
|
||||||
await loadPdfAnimation(filePath)
|
const timer = setTimeout(() => {
|
||||||
|
pdfUrl.value = filePath
|
||||||
|
clearTimeout(timer);
|
||||||
|
},2000)
|
||||||
|
|
||||||
if(cardref.value && headref.value){
|
if(cardref.value && headref.value){
|
||||||
const cardH = cardref.value.offsetHeight;
|
const cardH = cardref.value.offsetHeight;
|
||||||
const headh = headref.value.offsetHeight;
|
const headh = headref.value.offsetHeight;
|
||||||
|
@ -523,23 +492,4 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.booklist{
|
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
|
||||||
padding-top: 1px;
|
|
||||||
overflow: auto;
|
|
||||||
.item{
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-top: 1px solid #f1f1f1;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #3b3b3b;
|
|
||||||
}
|
|
||||||
.active{
|
|
||||||
background-color: #409eff;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue