Compare commits
21 Commits
a3e6aca890
...
c517fa14af
Author | SHA1 | Date |
---|---|---|
qinqing | c517fa14af | |
qinqing | 443ecf0ecf | |
baigl | 93a5ffef20 | |
白了个白 | d247d22288 | |
白了个白 | a3084e0546 | |
白了个白 | 551bd62ae3 | |
qinqing | b7adda1510 | |
zouyf | 4e478f487a | |
“zouyf” | 2a4b0281c2 | |
“zouyf” | b76a589672 | |
lyc | 5660d8d167 | |
lyc | 7845d0e0a1 | |
lyc | 40089a2cd0 | |
lyc | 9329da9ddf | |
qinqing | f7262effc3 | |
“zouyf” | b6d9082e1b | |
“zouyf” | c957961a0b | |
“zouyf” | 26576ad086 | |
“zouyf” | d1ab430a6c | |
“zouyf” | 7f9afedef9 | |
“zouyf” | 7dcfd487fc |
|
@ -16,6 +16,12 @@ const defaultData = {
|
|||
curSubjectNode: {
|
||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||
querySearch: {} // 查询资源所需参数
|
||||
},
|
||||
subject: {
|
||||
bookList: null, // 教材列表
|
||||
curBook: null, // 当前选中的教材
|
||||
curNode: null, // 当前选中的节点
|
||||
defaultExpandedKeys: [], //展开的节点
|
||||
}
|
||||
},
|
||||
local: { // 本地(永久localStorage)
|
||||
|
|
|
@ -44,11 +44,12 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||
|
||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||
const emit = defineEmits(['nodeClick'])
|
||||
let useSubject = null
|
||||
const subjectList = ref([])
|
||||
const dialogVisible = ref(false)
|
||||
|
@ -74,8 +75,7 @@ const defaultExpandedKeys = ref([])
|
|||
//选择教材
|
||||
const changeBook = (data) => {
|
||||
curBook.data = data
|
||||
|
||||
localStorage.setItem('curBook', JSON.stringify(data))
|
||||
sessionStore.set('subject.curBook', data)
|
||||
treeData.value = useSubject.getTreeData(data.id)
|
||||
|
||||
//切换教材后默认展开第一个并选中
|
||||
|
@ -83,9 +83,7 @@ const changeBook = (data) => {
|
|||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
curNode.data = getLastLevelData(treeData.value)[0]
|
||||
|
||||
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||
localStorage.setItem('curNode',JSON.stringify(curNode.data))
|
||||
emitChangeBook()
|
||||
handleNodeClick(curNode.data)
|
||||
})
|
||||
// 延迟关闭 视觉上选中
|
||||
setTimeout(() => {
|
||||
|
@ -93,40 +91,6 @@ const changeBook = (data) => {
|
|||
}, 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) => {
|
||||
let lastLevelData = [];
|
||||
// 递归函数遍历树形结构
|
||||
|
@ -171,25 +135,22 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
|||
}
|
||||
|
||||
|
||||
const handleNodeClick = (data, node) => {
|
||||
const handleNodeClick = (data) => {
|
||||
/**
|
||||
* data : 当前节点数据
|
||||
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
||||
*/
|
||||
let nodeData = cloneDeep(toRaw(data));
|
||||
//怎加一个label 之前取的label
|
||||
nodeData.label = nodeData.itemtitle
|
||||
const parentNode = node.parent.data;
|
||||
// parentNode 为数组 则点击的是一级节点
|
||||
if (Array.isArray(parentNode)) {
|
||||
//
|
||||
nodeData.parentNode = null
|
||||
}
|
||||
else {
|
||||
// 否则 点击的为二级节点 parentNode 为它的父级节点
|
||||
nodeData.parentNode = toRaw(parentNode)
|
||||
}
|
||||
|
||||
//增加一个label 之前取的label
|
||||
nodeData.label = nodeData.itemtitle
|
||||
// 父级节点 如果当前是一级节点 父级则为null
|
||||
let parent = {
|
||||
id: nodeData.parentid,
|
||||
label: nodeData.parenttitle,
|
||||
itemtitle: nodeData.parenttitle
|
||||
}
|
||||
const parentNode = nodeData.parentid ? parent : null
|
||||
nodeData.parentNode = parentNode
|
||||
let curData = {
|
||||
textBook: {
|
||||
curBookId: curBook.data.id,
|
||||
|
@ -197,63 +158,40 @@ const handleNodeClick = (data, node) => {
|
|||
curBookImg: BaseUrl + curBook.data.avartar,
|
||||
curBookPath: curBook.data.fileurl
|
||||
},
|
||||
node: toRaw(nodeData)
|
||||
node: nodeData
|
||||
}
|
||||
localStorage.setItem('defaultExpandedKeys', parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
|
||||
localStorage.setItem('curNode', JSON.stringify(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}))
|
||||
|
||||
// 本地存储:electron-store
|
||||
let defaultExpandedKeys = parentNode ? [parentNode.id] : [nodeData.id]
|
||||
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
||||
sessionStore.set('subject.curNode', nodeData)
|
||||
emit('nodeClick', curData)
|
||||
|
||||
}
|
||||
onMounted( async () => {
|
||||
treeLoading.value = true
|
||||
|
||||
try{
|
||||
useSubject = await useGetSubject()
|
||||
subjectList.value = useSubject.subjectList
|
||||
subjectList.value = sessionStore.get('subject.bookList')
|
||||
// 当前教材
|
||||
if(sessionStore.get('subject.curBook')){
|
||||
curBook.data = sessionStore.get('subject.curBook')
|
||||
}
|
||||
else{
|
||||
curBook.data = subjectList.value[0]
|
||||
}
|
||||
|
||||
let book = localStorage.getItem('curBook')
|
||||
if(book){
|
||||
book = JSON.parse(book)
|
||||
curBook.data = book
|
||||
treeData.value = useSubject.getTreeData(book.id)
|
||||
}
|
||||
else{
|
||||
curBook.data = useSubject.subjectList[0]
|
||||
localStorage.setItem('curBook', JSON.stringify(curBook.data))
|
||||
treeData.value = useSubject.treeData
|
||||
}
|
||||
// 设置展开并选中
|
||||
// 章节"树"
|
||||
treeData.value = useSubject.getTreeData(curBook.data.id)
|
||||
nextTick(() =>{
|
||||
// 取缓存
|
||||
let node = localStorage.getItem('curNode')
|
||||
if(node){
|
||||
curNode.data = JSON.parse(node)
|
||||
defaultExpandedKeys.value = JSON.parse(localStorage.getItem('defaultExpandedKeys'))
|
||||
}
|
||||
else{
|
||||
// 默认展开 选中
|
||||
if(sessionStore.get('subject.curNode')){
|
||||
defaultExpandedKeys.value = sessionStore.get('subject.defaultExpandedKeys')
|
||||
curNode.data = sessionStore.get('subject.curNode')
|
||||
}else{
|
||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
curNode.data = getLastLevelData(treeData.value)[0]
|
||||
//缓存记录当前展开以及选中节点
|
||||
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||
localStorage.setItem('curNode', JSON.stringify(curNode.data))
|
||||
}
|
||||
emitChangeBook()
|
||||
handleNodeClick(curNode.data)
|
||||
})
|
||||
|
||||
} finally{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { ref } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
export const useGetSubject = async () =>{
|
||||
|
||||
// user store
|
||||
const userStore = useUserStore()
|
||||
const { edustage, edusubject, userId } = userStore.user
|
||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
const { edustage, edusubject } = userStore.user
|
||||
// 章节List
|
||||
const unitList = ref([])
|
||||
// 教材List
|
||||
|
@ -15,12 +15,10 @@ export const useGetSubject = async () =>{
|
|||
// 单元章节树结构
|
||||
let treeData = null
|
||||
|
||||
|
||||
// 根据学科 + 学段 获取所有单元章节
|
||||
const getSubjectUnit = async () =>{
|
||||
let strUnit = localStorage.getItem('unitList')
|
||||
if(strUnit){
|
||||
unitList.value = JSON.parse(strUnit)
|
||||
if(sessionStore.get('subject.unitList')){
|
||||
unitList.value = sessionStore.get('subject.unitList')
|
||||
}
|
||||
else{
|
||||
const unitParams = {
|
||||
|
@ -32,18 +30,16 @@ export const useGetSubject = async () =>{
|
|||
}
|
||||
const { rows } = await listEvaluation(unitParams)
|
||||
unitList.value = rows
|
||||
localStorage.setItem('unitList', JSON.stringify(rows))
|
||||
sessionStore.set('subject.unitList', rows)
|
||||
}
|
||||
|
||||
await getSubject()
|
||||
}
|
||||
|
||||
// 获取 学科 + 学段 获取教材
|
||||
// 根据学科 + 学段 获取教材
|
||||
const getSubject = async () =>{
|
||||
|
||||
let strSubject = localStorage.getItem('subjectList')
|
||||
if(strSubject){
|
||||
subjectList = JSON.parse(strSubject)
|
||||
if(sessionStore.get('subject.bookList')){
|
||||
subjectList = sessionStore.get('subject.bookList')
|
||||
}
|
||||
else{
|
||||
const subjectParams = {
|
||||
|
@ -55,13 +51,19 @@ export const useGetSubject = async () =>{
|
|||
}
|
||||
const { rows } = await listEvaluation(subjectParams)
|
||||
subjectList = rows
|
||||
localStorage.setItem('subjectList', JSON.stringify(rows))
|
||||
sessionStore.set('subject.bookList', 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)
|
||||
}
|
||||
}
|
||||
|
||||
// 单元章节数据转为“树”结构
|
||||
|
@ -71,6 +73,7 @@ export const useGetSubject = async () =>{
|
|||
data.forEach( item => {
|
||||
item.children = unitList.value.filter( item2 => item2.parentid == item.id && item2.level == 2)
|
||||
})
|
||||
sessionStore.set('subject.subjectTree', data)
|
||||
return data
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ const title = reactive([
|
|||
},
|
||||
{
|
||||
name: '教材分析',
|
||||
url: '/teaching/chatwithtextbook',
|
||||
url: '/textbookAnalysis',
|
||||
img: 'iconfont icon-yanjiushi',
|
||||
child1: []
|
||||
},
|
||||
|
|
|
@ -86,30 +86,6 @@ const currentRoute = ref('')
|
|||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||
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 headerMenus = [
|
||||
{
|
||||
|
|
|
@ -54,7 +54,13 @@ export const constantRoutes = [
|
|||
path: '/standardanalysis',
|
||||
component: () => import('@/views/teach/standardAnalysis/index.vue'),
|
||||
name: 'standardanalysis',
|
||||
meta: {title: '课标分析'},
|
||||
meta: {title: '课标分析'}
|
||||
},
|
||||
{
|
||||
path: '/textbookAnalysis',
|
||||
component: () => import('@/views/textbookAnalysis/index.vue'),
|
||||
name: 'textbookAnalysis',
|
||||
meta: {title: '教材分析'}
|
||||
},
|
||||
{
|
||||
path: '/profile',
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
<!-- <el-button type="primary" icon="Postcard" @click="handleNewClassWorkDialog" style="margin-left: 20px; margin-top: 10px">{{initDataProps.queryType!=='single'?'设计新作业':'设计新活动'}}</el-button>
|
||||
<el-button v-if="initDataProps.queryType!=='single'" type="success" icon="Promotion" @click="handleTaskAssignToAllClass()" style="margin-left: 20px; margin-top: 10px">一键推送</el-button>
|
||||
<el-button type="danger" icon="delete" @click="handleDelete" style="margin-left: 20px; margin-top: 10px">删除</el-button> -->
|
||||
<el-button type="primary" @click="handleNewClassWorkDialog" style="margin-left: 20px; margin-top: 10px">设计新作业</el-button>
|
||||
<el-button type="success" @click="handleTaskAssignToAllClass()" style="margin-left: 20px; margin-top: 10px">一键推送</el-button>
|
||||
<el-button type="danger" @click="handleDelete" style="margin-left: 20px; margin-top: 10px">删除</el-button>
|
||||
<el-button type="primary" style="margin-left: 20px; margin-top: 10px" @click="handleNewClassWorkDialog">设计新作业</el-button>
|
||||
<el-button type="success" style="margin-left: 20px; margin-top: 10px" @click="handleTaskAssignToAllClass()">一键推送</el-button>
|
||||
<el-button type="danger" style="margin-left: 20px; margin-top: 10px" @click="handleDelete">删除</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -71,14 +71,14 @@
|
|||
<template #default="scope">
|
||||
<div style="border: 1px solid #ccc; width: 100%; height: auto; display: flex; justify-content: space-between; padding-left: 10px">
|
||||
<div style="display: flex; margin-top: 5px">
|
||||
<div v-html="scope.row.title" style="max-width: 200px" class="singe-line"></div>
|
||||
<div class="singe-line" style="max-width: 200px" v-html="scope.row.title"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="scope.row.status == '10'">
|
||||
<el-button text @click="handleWorkTitleEdit(scope.row, scope.$index)" v-hasPermi="['teaching:classwork:edit']">编辑</el-button>
|
||||
<el-button v-hasPermi="['teaching:classwork:edit']" text @click="handleWorkTitleEdit(scope.row, scope.$index)">编辑</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-button text @click="handleWorkTitleEdit(scope.row, scope.$index)" v-hasPermi="['teaching:classwork:edit']">查看详情</el-button>
|
||||
<el-button v-hasPermi="['teaching:classwork:edit']" text @click="handleWorkTitleEdit(scope.row, scope.$index)">查看详情</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -112,19 +112,19 @@
|
|||
<el-table-column label="题目内容" align="left" >
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<div v-html="scope.row.titleFormat" style="overflow: hidden; text-overflow: ellipsis; font-weight:700"></div>
|
||||
<div v-html="scope.row.workdescFormat" style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;"></div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis; font-weight:700" v-html="scope.row.titleFormat"></div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分值" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.score" :min="1" :max="100" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)"></el-input-number >
|
||||
<el-input-number v-model="scope.row.score" :min="1" :max="100" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"></el-input-number >
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-button @click="handleWorkConfigQuizMinus(scope.$index)" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">删除</el-button>
|
||||
<el-button :disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkConfigQuizMinus(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -133,9 +133,9 @@
|
|||
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
||||
<div style="display: flex">
|
||||
<el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
|
||||
@click="handleWorkEdit2ClassWorkQuizAdd" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">添加作业</el-button>
|
||||
<el-button type="primary" style="margin-left: auto" @click="submitStudy('submit')"
|
||||
:disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">确 定</el-button>
|
||||
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button>
|
||||
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
||||
@click="submitStudy('submit')">确 定</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -143,10 +143,10 @@
|
|||
|
||||
<!-- 作业说明编辑 -->
|
||||
<el-dialog v-model="currentWorkEdit.workTitleEdit" title="作业说明编辑" width="70%" append-to-body>
|
||||
<el-input v-model="currentTitle" type="textarea" rows="5" placeholder="请输入作业说明" :disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)"/>
|
||||
<el-input v-model="currentWorkEdit.currentTitle" type="textarea" rows="5" placeholder="请输入作业说明" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"/>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
||||
<el-button type="primary" @click="submitWorkTitle('submit')"
|
||||
:disabled="taskParams.viewkey=='作业反馈'||checkTaskAssigned(currentTask)">确 定</el-button>
|
||||
<el-button type="primary" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
||||
@click="submitWorkTitle('submit')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@ -154,9 +154,12 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import { homeworklist, listEntpcoursework, listClassworkeval } from '@/api/teaching/classwork'
|
||||
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
||||
import { listEntpcoursework, listClassworkeval,updateClasswork } from '@/api/classTask'
|
||||
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
|
@ -164,6 +167,7 @@ import { processList } from '@/hooks/useProcessList'
|
|||
import { getCurrentTime } from '@/utils/date'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const props = defineProps({
|
||||
initDataProps: {
|
||||
|
@ -232,6 +236,30 @@ const getData = (data) => {
|
|||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除按钮操作 TODO 待完善
|
||||
* */
|
||||
const handleDelete =() => {
|
||||
let rows = proxy.$refs.taskTable.getSelectionRows();
|
||||
if (rows.length > 0) {
|
||||
proxy.$modal.confirm('是否确认选中的学习任务?').then(()=> {
|
||||
let ids = [];
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
ids.push(rows[i].id);
|
||||
}
|
||||
return delClasswork(ids.join(','));
|
||||
}).then(() => {
|
||||
setTimeout(() => {
|
||||
getTaskList();
|
||||
}, 1500);
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {})
|
||||
}else{
|
||||
proxy.$modal.alertWarning("请选择删除项")
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 1.获取作业列表
|
||||
*/
|
||||
|
@ -422,6 +450,54 @@ const handleWorkEdit = (row, index) =>{
|
|||
}
|
||||
};
|
||||
|
||||
// 作业内容编辑-确认
|
||||
const submitWorkTitle = () => {
|
||||
console.log(taskList.value)
|
||||
console.log(currentWorkEdit)
|
||||
// ? taskList是新组合的,有的变成子项了, 根据currentIndex获取不到,下面判断暂弃!
|
||||
// if (taskList.value[currentWorkEdit.currentIndex].title == currentWorkEdit.currentTitle) {
|
||||
// currentWorkEdit.workTitleEdit = false;
|
||||
// return;
|
||||
// }
|
||||
taskList.value&&taskList.value.forEach((item)=>{
|
||||
if(item.children.length>0){
|
||||
item.children.map(_item=>{
|
||||
if(_item.title == currentWorkEdit.currentTitle){
|
||||
currentWorkEdit.workTitleEdit = false;
|
||||
return;
|
||||
}
|
||||
})
|
||||
}else{
|
||||
if(item.title == currentWorkEdit.currentTitle){
|
||||
currentWorkEdit.workTitleEdit = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log('有更改!')
|
||||
// 有修改时才进行更新
|
||||
taskList.value[currentWorkEdit.currentIndex].title = currentWorkEdit.currentTitle;
|
||||
updateClasswork({id: taskList.value[currentWorkEdit.currentIndex].id, title: currentWorkEdit.currentTitle}).then(response => {
|
||||
ElMessage("修改成功");
|
||||
currentWorkEdit.workTitleEdit = false;
|
||||
//this.getClassWorkAllList();
|
||||
});
|
||||
};
|
||||
|
||||
// 当前是否为已推送作业
|
||||
const checkTaskAssigned = (row) => {
|
||||
console.log(row,'checkTaskAssigned')
|
||||
// 只要有一个taskconfig的id不为0,就是已推送过任务了
|
||||
let bAssigned = false;
|
||||
for (let i=0; i<row.taskconfig.length; i++) {
|
||||
if (row.taskconfig[i].id != 0) {
|
||||
bAssigned = true;
|
||||
return bAssigned;
|
||||
}
|
||||
}
|
||||
return bAssigned;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 表格子项背景暗调
|
||||
|
|
|
@ -647,13 +647,15 @@ defineExpose({
|
|||
})
|
||||
</script>
|
||||
|
||||
<style src="@/assets/styles/JYStyle.css"></style>
|
||||
|
||||
<style scoped lang="scss">
|
||||
// :deep(.reserv-date-pick) {
|
||||
// width: 140px;
|
||||
// }
|
||||
// :deep(.reserv-time-pick) {
|
||||
// width: 240px;
|
||||
// }
|
||||
/*:deep(.reserv-date-pick) {
|
||||
width: 140px;
|
||||
}
|
||||
:deep(.reserv-time-pick) {
|
||||
width: 240px;
|
||||
}*/
|
||||
.clwk_dialog {
|
||||
.clwk_dialog_view {
|
||||
display: flex;
|
||||
|
@ -669,7 +671,7 @@ defineExpose({
|
|||
.view_teachrting {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
// overflow-y: auto;
|
||||
/*overflow-y: auto; */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@ import { useRouter } from 'vue-router'
|
|||
import workTrend from './container/work-trend.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import * as echarts from 'echarts'
|
||||
import { useGetClassWork } from '@/hooks/useGetClassWork'
|
||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const router = useRouter()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
@ -65,8 +66,7 @@ const menuList = [{
|
|||
{
|
||||
name: '教材分析',
|
||||
icon: 'icon-jiaocaixuanze',
|
||||
isOuter: true,
|
||||
path: '/teaching/chatwithtextbook',
|
||||
path: '/textbookAnalysis',
|
||||
id: '1-2'
|
||||
},
|
||||
{
|
||||
|
@ -105,10 +105,7 @@ const menuList = [{
|
|||
icon: 'icon-jiaoxuefansi',
|
||||
isOuter: true,
|
||||
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
|
||||
// path: '/newClassTask'
|
||||
//path: '/classTaskAssign'
|
||||
//isOuter: true,
|
||||
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||
// path: '/newClassTask',
|
||||
id: '2-1'
|
||||
},
|
||||
{
|
||||
|
@ -116,8 +113,8 @@ const menuList = [{
|
|||
icon: 'icon-xiezuo1',
|
||||
isOuter: true,
|
||||
path: '/teaching/classtaskassign?titleName=作业布置',
|
||||
// path: '/classTaskAssign',
|
||||
id: '2-2'
|
||||
// path: '/classTaskAssign'
|
||||
},
|
||||
{
|
||||
name: '作业批改',
|
||||
|
@ -174,13 +171,12 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
|||
let fullPath = configObj.fullPath + path
|
||||
if(id == '1-2' || id == '2-1' || id == '2-2' ){
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
|
||||
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
||||
if(fullPath.indexOf('?') == -1){
|
||||
fullPath += `?unitId=${unitId}&bookeId=${bookeId}`
|
||||
fullPath += `?unitId=${id}&bookeId=${rootid}`
|
||||
}
|
||||
else{
|
||||
fullPath += `&unitId=${unitId}&bookeId=${bookeId}`
|
||||
fullPath += `&unitId=${id}&bookeId=${rootid}`
|
||||
}
|
||||
}
|
||||
fullPath = fullPath.replaceAll('//', '/')
|
||||
|
@ -196,6 +192,8 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
|||
}
|
||||
|
||||
onMounted(async ()=>{
|
||||
|
||||
await useGetSubject()
|
||||
// 确保DOM 渲染完成
|
||||
await nextTick()
|
||||
chartInstance = echarts.init(chartDom.value)
|
||||
|
@ -241,21 +239,10 @@ onMounted(async ()=>{
|
|||
]
|
||||
}
|
||||
chartInstance.setOption(option);
|
||||
// 初始化 获取教材下面的单元 + 章节
|
||||
getSubjectInit();
|
||||
|
||||
|
||||
})
|
||||
|
||||
const getSubjectInit = async () => {
|
||||
//查看本地是否有缓存
|
||||
let unitId = localStorage.getItem('unitId')
|
||||
if(unitId){
|
||||
// 有缓存不用管
|
||||
} else{
|
||||
// 没有 就获取 获取教材下面的单元 + 章节
|
||||
useGetClassWork();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -207,8 +207,8 @@ export default {
|
|||
},
|
||||
openFileWin(items) {
|
||||
if (items.fileFlag === 'apt') {
|
||||
let curBook = JSON.parse(localStorage.getItem('curBook'))
|
||||
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
|
||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
||||
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid;
|
||||
let configObj = outLink().getBaseData()
|
||||
let fullPath = configObj.fullPath + path
|
||||
fullPath = fullPath.replaceAll('//', '/')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div v-loading="isLoading" class="page-resource flex">
|
||||
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||
<ChooseTextbook @node-click="nodeClick" />
|
||||
<div class="page-center-wrap">
|
||||
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="page-resource flex">
|
||||
<!--左侧 教材 目录-->
|
||||
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
||||
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
|
||||
<ChooseTextbook v-else @node-click="getData" />
|
||||
|
||||
<div class="page-right">
|
||||
<!-- 搜索 -->
|
||||
|
|
|
@ -70,7 +70,10 @@
|
|||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
|
||||
<div class="booklist">
|
||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item)">{{item.edustage + item.edusubject}}</div>
|
||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
||||
<el-image class="bookimg" :src="item.avartar" />
|
||||
<div class="bookname">{{item.fileurl.replace('.txt', '')}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@ -237,8 +240,6 @@ const getData = (data) => {
|
|||
}
|
||||
sourceStore.handleQuery()
|
||||
getlistEvaluationclue(levelFirstId, levelSecondId)
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
}
|
||||
// 获取学科
|
||||
const getAllSubject = async () => {
|
||||
|
@ -252,12 +253,16 @@ const getAllSubject = async () => {
|
|||
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 textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
||||
booksel.value = textselidx
|
||||
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
|
||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
|
||||
await loadPdfAnimation(filePath)
|
||||
}
|
||||
const bookChange = async (item, idx) => {
|
||||
booksel.value = idx
|
||||
bookInfo.value = {...item}
|
||||
booktitle.value = `${item.edustage + item.edusubject}课程标准`
|
||||
booktitle.value = item.fileurl.replace('.txt','')
|
||||
pdfUrl.value = '';
|
||||
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
||||
await loadPdfAnimation(filepath)
|
||||
|
@ -271,10 +276,6 @@ const loadPdfAnimation = (path) => {
|
|||
}
|
||||
onMounted(async () => {
|
||||
await getAllSubject();
|
||||
const { edustage, edusubject } = userStore.user;
|
||||
booktitle.value = `${edustage + edusubject}课程标准`
|
||||
const filePath = `${import.meta.env.VITE_APP_RES_FILE_PATH}${edustage}-${edusubject}-课标.pdf`
|
||||
await loadPdfAnimation(filePath)
|
||||
if(cardref.value && headref.value){
|
||||
const cardH = cardref.value.offsetHeight;
|
||||
const headh = headref.value.offsetHeight;
|
||||
|
@ -529,14 +530,23 @@ onMounted(async () => {
|
|||
padding-top: 1px;
|
||||
overflow: auto;
|
||||
.item{
|
||||
width: 100%;
|
||||
width: 162px;
|
||||
height: auto;
|
||||
padding: 8px 16px;
|
||||
background-color: #ffffff;
|
||||
border-top: 1px solid #f1f1f1;
|
||||
float: left;
|
||||
.bookimg{
|
||||
width: 130px;
|
||||
height: 180px;
|
||||
}
|
||||
.name{
|
||||
font-size: 14px;
|
||||
color: #3b3b3b;
|
||||
}
|
||||
}
|
||||
.item:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
.active{
|
||||
background-color: #409eff;
|
||||
color: #ffffff;
|
||||
|
|
|
@ -0,0 +1,555 @@
|
|||
<template>
|
||||
<div class="page-con flex" ref="cardref">
|
||||
<!-- <el-button @click="saveJSON">测试保存</el-button> -->
|
||||
<div class="page-con-left">
|
||||
<div class="stand-head" ref="headref">
|
||||
<div class="stand-head-left">
|
||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
||||
</div>
|
||||
<div class="stand-head-right">
|
||||
<div class="stand-head-right-tit">{{booktitle}}</div>
|
||||
<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-time">更新2024.9.10</div>
|
||||
<!-- <el-switch class="stand-head-right-row-switch" v-model="isOpenClass" inline-prompt active-text="公开" inactive-text="非公" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stand-down">
|
||||
<div class="stand-down-search" ref="searchref">
|
||||
<el-input
|
||||
v-model="searchInp"
|
||||
placeholder="搜索课标、学校和老师"
|
||||
clearable
|
||||
@input="searchHandel"
|
||||
/>
|
||||
<el-select v-model="searchSel" placeholder="请选择" style="width: 140px;padding-left:6px" @change="selectHandel">
|
||||
<el-option
|
||||
v-for="item in searchOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="stand-down-con" :style="{overflow: 'auto',height: listHeight + 'px'}">
|
||||
<div class="stand-down-con-list" v-for="item,idx in showData" :key="idx">
|
||||
<div class="stand-down-con-list-icon">
|
||||
<el-image class="imges" :src="item.userheadimgurl" />
|
||||
</div>
|
||||
<div class="stand-down-con-list-txt">
|
||||
<div class="stand-down-con-list-txt-top">
|
||||
<div class="stand-down-con-list-txt-top-name">{{item.username}}</div>
|
||||
<div class="stand-down-con-list-txt-top-tip">{{item.childcount}}条</div>
|
||||
</div>
|
||||
<div class="stand-down-con-list-txt-down">
|
||||
<div class="stand-down-con-list-txt-down-tip">{{ item.userentpname }}</div>
|
||||
<div class="stand-down-con-list-txt-down-tip">{{ item.timeStr }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="loading">加载中...</p>
|
||||
<p v-if="noMore">~没有更多了~</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-con-right">
|
||||
<PDF :url="pdfUrl" v-if="pdfUrl" />
|
||||
<div class="loading" v-else>
|
||||
<div class="setup">
|
||||
<span style="--i:1">文</span>
|
||||
<span style="--i:2">档</span>
|
||||
<span style="--i:3">加</span>
|
||||
<span style="--i:4">载</span>
|
||||
<span style="--i:5">中</span>
|
||||
<span style="--i:6">.</span>
|
||||
<span style="--i:7">.</span>
|
||||
<span style="--i:8">.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="切换教材" append-to-body width="550">
|
||||
<div class="booklist">
|
||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
||||
<el-image class="bookimg" :src="item.avartar" />
|
||||
<div class="bookname">{{item.fileurl.replace('.txt', '')}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import PDF from '@/components/PdfJs/index.vue'
|
||||
import { useRoute } from 'vue-router';
|
||||
import useResoureStore from '../resource/store'
|
||||
import { listEvaluationclue } from '@/api/teaching/classwork'
|
||||
import { uploadServer, getJSONFile } from '@/utils/common'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
||||
import { listEvaluation } from '@/api/classManage/index'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore()
|
||||
const sourceStore = useResoureStore()
|
||||
// import { getStaticUrl } from '@/utils/tool'
|
||||
|
||||
const route = useRoute();
|
||||
const pdfUrl = ref('');
|
||||
const isOpenClass = ref(true);
|
||||
const searchInp = ref('');
|
||||
const searchSel = ref('0');
|
||||
const loading = ref(false);
|
||||
const noMore = ref(false);
|
||||
const cardref = ref(null);
|
||||
const headref = ref(null);
|
||||
const searchref = ref(null);
|
||||
const listHeight = ref(0);
|
||||
const dialogVisible = ref(false);
|
||||
const booktitle = ref('');
|
||||
const bookInfo = ref(null);
|
||||
const booksel = ref(0);
|
||||
const bookList = ref([])
|
||||
|
||||
|
||||
const searchOptions = [{
|
||||
value: '0',
|
||||
label: '按时间',
|
||||
},{
|
||||
value: '1',
|
||||
label: '按内容量',
|
||||
}];
|
||||
const standList = ref([]);
|
||||
const showData = ref([]);
|
||||
|
||||
//查询课标分析列表
|
||||
const getlistEvaluationclue = (firstid, levelid) => {
|
||||
const newid = firstid ? firstid : levelid;
|
||||
listEvaluationclue({evalid: newid, parentid: 0, cluegroup: 'teachresource', orderby: "timestamp desc", pageSize: 100}).then((res) => {
|
||||
if(res.code === 200){
|
||||
const newData = formaterTime(res.rows)
|
||||
standList.value = newData
|
||||
showData.value = filterList(newData)
|
||||
}
|
||||
})
|
||||
}
|
||||
const formaterTime = (data) => {
|
||||
return data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
timeStr: item.timestamp.split(' ')[0].replace('-', '.').replace('-', '.')
|
||||
}
|
||||
})
|
||||
}
|
||||
//筛选分析列表
|
||||
const filterList = (data) => {
|
||||
let standData = JSON.parse(JSON.stringify(data));
|
||||
let arr = [];
|
||||
if (searchSel.value === '0') {
|
||||
arr = standData.sort((a, b)=>{
|
||||
return new Date(b.timestamp) - new Date(a.timestamp);
|
||||
})
|
||||
}
|
||||
else {
|
||||
arr = standData.sort((a, b)=>{
|
||||
return b.childcount - a.childcount;
|
||||
})
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
//文本框文字搜索
|
||||
const searchHandel = (value) => {
|
||||
const newData = [];
|
||||
standList.value.map(item => {
|
||||
const str = JSON.stringify(item)
|
||||
if(str.indexOf(value) !== -1){
|
||||
newData.push(item);
|
||||
}
|
||||
})
|
||||
showData.value = newData
|
||||
}
|
||||
//下拉框条件筛选
|
||||
const selectHandel = (value) => {
|
||||
const filterData = searchInp.value !== '' ? showData.value : standList.value
|
||||
showData.value = filterList(filterData);
|
||||
}
|
||||
//保存json文件
|
||||
const saveJSON = (data) => {
|
||||
|
||||
let filename = ''
|
||||
// const data = {
|
||||
// name: 'txt',
|
||||
// class: '五年级2班',
|
||||
// school: '重庆市酉阳二中',
|
||||
// time: '2024-08-09'
|
||||
// }
|
||||
// saveJSON(jsonStr);
|
||||
if (!data) {
|
||||
console.log('传入的data数据为null');
|
||||
return;
|
||||
}
|
||||
if (!filename) {
|
||||
filename = `json${Date.now()}.json`
|
||||
console.log('未传入文件名,采用默认文件名' + filename);
|
||||
}
|
||||
let newdata = null;
|
||||
if (typeof data === 'object') {
|
||||
newdata = JSON.stringify(data, undefined, 4)
|
||||
}
|
||||
// 创建json文件blob流
|
||||
const blob = new Blob([newdata], { type: 'text/json' });
|
||||
// 创建file文件
|
||||
// const file = new File([blob],filename, {type: blob.type})
|
||||
// 创建上传文件流
|
||||
// const formdata = new FormData();
|
||||
// formdata.append('file', file);
|
||||
//其他参数待添加
|
||||
|
||||
//上传
|
||||
// uploadServer(formdata).then(res => {
|
||||
// console.log('+++++++++++++');
|
||||
// console.log(res.data);
|
||||
// })
|
||||
|
||||
let e = document.createEvent('MouseEvents');
|
||||
let a = document.createElement('a');
|
||||
a.download = filename;
|
||||
a.href = window.URL.createObjectURL(blob);
|
||||
a.dataset.downloadurl = ['text/json', a.download, a.href].join(':');
|
||||
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
a.dispatchEvent(e);
|
||||
}
|
||||
// 查询
|
||||
const getData = (data) => {
|
||||
const { textBook, node } = data
|
||||
let textbookId = textBook.curBookId
|
||||
let levelSecondId = node.id
|
||||
let levelFirstId
|
||||
if (node.parentNode) {
|
||||
levelFirstId = node.parentNode.id
|
||||
} else {
|
||||
levelFirstId = node.id
|
||||
levelSecondId = ''
|
||||
}
|
||||
sourceStore.query.levelFirstId = levelFirstId
|
||||
sourceStore.query.levelSecondId = levelSecondId
|
||||
sourceStore.query.textbookId = textbookId
|
||||
sourceStore.nodeData = {
|
||||
textbookId, //版本
|
||||
levelFirstId, //单元
|
||||
levelSecondId //单元课程
|
||||
}
|
||||
sourceStore.handleQuery()
|
||||
getlistEvaluationclue(levelFirstId, levelSecondId)
|
||||
}
|
||||
// 获取学科
|
||||
const getAllSubject = async () => {
|
||||
const { edustage, edusubject } = userStore.user;
|
||||
const { rows } = await listEvaluation({ itemkey: "version", edustage, edusubject, pageSize: 500 })
|
||||
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})
|
||||
}
|
||||
})
|
||||
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
|
||||
booksel.value = textselidx
|
||||
booktitle.value = bookList.value[textselidx].fileurl.replace('.txt','')
|
||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
|
||||
await loadPdfAnimation(filePath)
|
||||
}
|
||||
const bookChange = async (item, idx) => {
|
||||
booksel.value = idx
|
||||
bookInfo.value = {...item}
|
||||
booktitle.value = item.fileurl.replace('.txt','')
|
||||
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();
|
||||
if(cardref.value && headref.value){
|
||||
const cardH = cardref.value.offsetHeight;
|
||||
const headh = headref.value.offsetHeight;
|
||||
const searchh = searchref.value.offsetHeight;
|
||||
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
|
||||
}
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
if(cardref.value && headref.value){
|
||||
const cardH = cardref.value.offsetHeight;
|
||||
const headh = headref.value.offsetHeight;
|
||||
const searchh = searchref.value.offsetHeight;
|
||||
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
|
||||
}
|
||||
})
|
||||
window.addEventListener('message',(event) => {
|
||||
// console.log('------------');
|
||||
const iframeMes = event.data;
|
||||
if(iframeMes.storageInfo){
|
||||
// saveJSON(iframeMes.storageInfo);
|
||||
// console.log(JSON.stringify(iframeMes.storageInfo));
|
||||
}
|
||||
if(iframeMes.quoteInfo){
|
||||
console.log(iframeMes.quoteInfo);
|
||||
const { textStr, StartStr, EndStr } = iframeMes.quoteInfo;
|
||||
if(textStr === StartStr || textStr === EndStr){
|
||||
ElNotification({
|
||||
title: '引用内容',
|
||||
message: textStr,
|
||||
duration: 0,
|
||||
type: 'info',
|
||||
offset: 120
|
||||
})
|
||||
//如果开头和结尾的文字跟内容相同,那么它要么是开头,要么是整段,不需要替换操作
|
||||
console.log('无需替换------',textStr);
|
||||
return
|
||||
}
|
||||
let midStr = ''
|
||||
if(StartStr === '' && EndStr === '' && textStr === '') return
|
||||
if(StartStr === '' && EndStr !== '') {
|
||||
midStr = textStr.replace(EndStr,'eeeeee').split('eeeeee')[0]
|
||||
}else if(StartStr !== '' && EndStr === ''){
|
||||
midStr = textStr.replace(StartStr,'ssssss').split('ssssss')[1]
|
||||
}else{
|
||||
midStr = textStr.replace(StartStr, 'ssssss').replace(EndStr,'eeeeee').split('ssssss')[1].split('eeeeee')[0];
|
||||
}
|
||||
ElNotification({
|
||||
title: '引用内容',
|
||||
message: StartStr + midStr + EndStr,
|
||||
duration: 0,
|
||||
type: 'info',
|
||||
offset: 120
|
||||
})
|
||||
console.log('中间文字------',midStr);
|
||||
console.log('转换后整体文字------',StartStr + midStr + EndStr);
|
||||
}
|
||||
})
|
||||
|
||||
// const isDev = process.env.NODE_ENV == 'development'
|
||||
// if (isDev)
|
||||
// pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true)
|
||||
// else
|
||||
// pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true)
|
||||
|
||||
// console.log('页面',pdfUrl.value);
|
||||
})
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.page-con {
|
||||
padding-top: 20px;
|
||||
height: 100%;
|
||||
&-left{
|
||||
width: 300px;
|
||||
height: auto;
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
&-right{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
margin-left: 20px;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
||||
}
|
||||
.loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content:center;
|
||||
min-height: 100vh;
|
||||
.setup {
|
||||
position: relative;
|
||||
-webkit-box-reflect: below -12px linear-gradient(transparent, rgba(0, 0, 0, 0.2))
|
||||
}
|
||||
|
||||
.setup span {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
color: #409eff;
|
||||
font-size: 26px;
|
||||
animation: animate 1s ease-in-out infinite;
|
||||
animation-delay: calc(.1s*var(--i))
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animate {
|
||||
0% {
|
||||
transform: translateY(0px)
|
||||
}
|
||||
|
||||
20% {
|
||||
transform: translateY(-24px)
|
||||
}
|
||||
|
||||
40%,
|
||||
100% {
|
||||
transform: translateY(0px)
|
||||
}
|
||||
}
|
||||
}
|
||||
.stand-head{
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
&-left{
|
||||
width: 48px;
|
||||
height: 66px;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
.imges{
|
||||
width: 48px;
|
||||
height: 66px;
|
||||
}
|
||||
}
|
||||
&-right{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-left: 60px;
|
||||
padding-right: 6px;
|
||||
left: 0;
|
||||
top: 6px;
|
||||
z-index: 2;
|
||||
&-tit{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #3b3b3b;
|
||||
text-align: left;
|
||||
}
|
||||
&-icon{
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
top: 0px;
|
||||
z-index: 3;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
&-row{
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 12px;
|
||||
&-time{
|
||||
font-size: var(--el-font-size-extra-small);
|
||||
color: var(--el-color-info-rgb);
|
||||
line-height: 32px;
|
||||
}
|
||||
&-switch{
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.stand-down{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 20px;
|
||||
padding-right: 6px;
|
||||
&-search{
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
&-con{
|
||||
width: 100%;
|
||||
&-list{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
position: relative;
|
||||
padding: 8px 0;
|
||||
border-top: 1px dashed #e1e1e1;
|
||||
&-icon{
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 8px;
|
||||
z-index: 2;
|
||||
overflow: hidden;
|
||||
.imges{
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
&-txt{
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
padding-left: 56px;
|
||||
padding-right: 12px;
|
||||
&-top,&-down{
|
||||
width: 100%;
|
||||
min-height: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
&-name{
|
||||
font-size: 14px;
|
||||
color: #3b3b3b;
|
||||
font-weight: 600;
|
||||
}
|
||||
&-tip{
|
||||
font-size: 12px;
|
||||
color: #787878;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
&-down{
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-list:first-of-type{
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.booklist{
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
padding-top: 1px;
|
||||
overflow: auto;
|
||||
.item{
|
||||
width: 162px;
|
||||
height: auto;
|
||||
padding: 8px 16px;
|
||||
background-color: #ffffff;
|
||||
float: left;
|
||||
.bookimg{
|
||||
width: 130px;
|
||||
height: 180px;
|
||||
}
|
||||
.name{
|
||||
font-size: 14px;
|
||||
color: #3b3b3b;
|
||||
}
|
||||
}
|
||||
.item:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
.active{
|
||||
background-color: #409eff;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue