Merge branch 'main' into zhuhao_dev
This commit is contained in:
commit
b3e75e799e
File diff suppressed because one or more lines are too long
|
@ -2782,7 +2782,8 @@
|
|||
--editor-toolbar-base-offset:105px;
|
||||
|
||||
--main-color:rgb(12 12 13);
|
||||
--body-bg-color:rgb(255, 255, 255);
|
||||
/* --body-bg-color:rgb(255, 255, 255); */
|
||||
--body-bg-color:rgb(241, 241, 252);
|
||||
--progressBar-color:rgb(10 132 255);
|
||||
--progressBar-bg-color:rgb(221 221 222);
|
||||
--progressBar-blend-color:rgb(116 177 239);
|
||||
|
@ -3148,12 +3149,12 @@ body{
|
|||
}
|
||||
|
||||
#toolbarViewer{
|
||||
width: 300px;
|
||||
height: 32px;
|
||||
width: auto;
|
||||
height: 60px;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
bottom: 15px;
|
||||
left: 50%;
|
||||
right: 2%;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
transform: translateX(-50%);
|
||||
|
@ -3477,8 +3478,9 @@ body{
|
|||
}
|
||||
|
||||
#toolbarViewerLeft{
|
||||
padding-inline-start:1px;
|
||||
/* padding-inline-start:1px; 修改样式*/
|
||||
}
|
||||
|
||||
#toolbarViewerRight{
|
||||
padding-inline-end:1px;
|
||||
}
|
||||
|
@ -3693,7 +3695,7 @@ body{
|
|||
mask-image:var(--findbarButton-next-icon);
|
||||
}
|
||||
|
||||
#previous::before{
|
||||
/* #previous::before{
|
||||
-webkit-mask-image:var(--toolbarButton-pageUp-icon);
|
||||
mask-image:var(--toolbarButton-pageUp-icon);
|
||||
}
|
||||
|
@ -3701,8 +3703,27 @@ body{
|
|||
#next::before{
|
||||
-webkit-mask-image:var(--toolbarButton-pageDown-icon);
|
||||
mask-image:var(--toolbarButton-pageDown-icon);
|
||||
} */
|
||||
/* 修改样式 */
|
||||
#toolbarViewerLeft .toolbarButton{
|
||||
width: 80px;
|
||||
height: 60px;
|
||||
margin: 0;
|
||||
}
|
||||
#toolbarViewerLeft .toolbarButton::before{
|
||||
opacity: 0;
|
||||
}
|
||||
#toolbarViewerLeft .toolbarButton span{
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
.toolpageBtn{
|
||||
height: 60px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#zoomOut::before{
|
||||
-webkit-mask-image:var(--toolbarButton-zoomOut-icon);
|
||||
mask-image:var(--toolbarButton-zoomOut-icon);
|
||||
|
|
|
@ -44,11 +44,11 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
<div id="toolbarSidebar">
|
||||
<div id="toolbarSidebarLeft">
|
||||
<div id="sidebarViewButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
|
||||
<span data-l10n-id="pdfjs-thumbs-button-label">Thumbnails</span>
|
||||
</button>
|
||||
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
|
||||
<span data-l10n-id="pdfjs-document-outline-button-label">Document Outline</span>
|
||||
</button>
|
||||
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
|
||||
<span data-l10n-id="pdfjs-thumbs-button-label">Thumbnails</span>
|
||||
</button>
|
||||
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
|
||||
<span data-l10n-id="pdfjs-attachments-button-label">Attachments</span>
|
||||
|
@ -273,14 +273,17 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
<div id="toolbarContainer">
|
||||
<div id="toolbarViewer">
|
||||
<div id="toolbarViewerLeft">
|
||||
<button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
|
||||
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
|
||||
<button id="sidebarToggle" class="toolbarButton" tabindex="11" aria-expanded="false" aria-controls="sidebarContainer">
|
||||
<span>目录</span>
|
||||
</button>
|
||||
<div class="toolbarButtonSpacer"></div>
|
||||
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
|
||||
<!-- <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
|
||||
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
|
||||
</button> -->
|
||||
<!-- <div class="toolbarButtonSpacer"></div> -->
|
||||
<button style="display: none;" id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
|
||||
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
|
||||
</button>
|
||||
<div class="splitToolbarButton hiddenSmallView">
|
||||
<div class="splitToolbarButton toolpageBtn">
|
||||
<button class="toolbarButton" title="Previous Page" id="previous" tabindex="13" data-l10n-id="pdfjs-previous-button">
|
||||
<span data-l10n-id="pdfjs-previous-button-label">Previous</span>
|
||||
</button>
|
||||
|
@ -289,12 +292,12 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
<span data-l10n-id="pdfjs-next-button-label">Next</span>
|
||||
</button>
|
||||
</div>
|
||||
<span class="loadingInput start">
|
||||
<span class="loadingInput start" style="display: none;">
|
||||
<input type="number" id="pageNumber" class="toolbarField" title="Page" value="1" min="1" tabindex="15" data-l10n-id="pdfjs-page-input" autocomplete="off">
|
||||
</span>
|
||||
<span id="numPages" class="toolbarLabel"></span>
|
||||
<span id="numPages" class="toolbarLabel" style="display: none;"></span>
|
||||
</div>
|
||||
<div id="toolbarViewerRight">
|
||||
<div id="toolbarViewerRight" style="display: none;">
|
||||
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
||||
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
||||
|
|
|
@ -7407,7 +7407,8 @@ class PDFSidebar {
|
|||
this.isInitialViewSet = false;
|
||||
this.isInitialEventDispatched = false;
|
||||
this.#hideUINotification(true);
|
||||
this.switchView(SidebarView.THUMBS);
|
||||
// this.switchView(SidebarView.THUMBS);默认开启书签模式
|
||||
this.switchView(SidebarView.OUTLINE);
|
||||
this.outlineButton.disabled = false;
|
||||
this.attachmentsButton.disabled = false;
|
||||
this.layersButton.disabled = false;
|
||||
|
@ -13095,12 +13096,16 @@ const PDFViewerApplication = {
|
|||
this.pdfViewer.scrollMode = scroll;
|
||||
}
|
||||
if (isValidSpreadMode(spread)) {
|
||||
this.pdfViewer.spreadMode = spread;
|
||||
//默认双页
|
||||
// this.pdfViewer.spreadMode = spread;
|
||||
this.pdfViewer.spreadMode = 1;
|
||||
}
|
||||
};
|
||||
this.isInitialViewSet = true;
|
||||
this.pdfSidebar?.setInitialView(sidebarView);
|
||||
setViewerModes(scrollMode, spreadMode);
|
||||
//默认双页
|
||||
// setViewerModes(scrollMode, spreadMode);
|
||||
setViewerModes(scrollMode, 1);
|
||||
if (this.initialBookmark) {
|
||||
setRotation(this.initialRotation);
|
||||
delete this.initialRotation;
|
||||
|
|
|
@ -12,15 +12,20 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
default: ''
|
||||
},
|
||||
isWin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
/**pdf文件地址 */
|
||||
const pdfUrl = ref('');
|
||||
/**pdfjs文件地址 */
|
||||
const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
||||
const fileUrl = props.isWin ? props.url : getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
||||
onMounted(() => {
|
||||
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
||||
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
||||
if(props.isWin) pdfUrl.value = fileUrl
|
||||
else pdfUrl.value = fileUrl + encodeURIComponent(props.url) + '#pageMode=outline'
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ import { useGetSubject } from '@/hooks/useGetSubject'
|
|||
|
||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['nodeClick'])
|
||||
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||
let useSubject = null
|
||||
const subjectList = ref([])
|
||||
const dialogVisible = ref(false)
|
||||
|
@ -164,7 +164,6 @@ const handleNodeClick = (data) => {
|
|||
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
||||
sessionStore.set('subject.curNode', nodeData)
|
||||
emit('nodeClick', curData)
|
||||
|
||||
}
|
||||
onMounted( async () => {
|
||||
treeLoading.value = true
|
||||
|
|
|
@ -1,202 +0,0 @@
|
|||
import { nextTick, toRaw } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { edustage, edusubject } = userStore.user
|
||||
|
||||
let evaluationList = []; // 教材版本list
|
||||
let subjectList = []; // 教材list
|
||||
//当前教材ID
|
||||
let curBookId = -1;
|
||||
|
||||
/**
|
||||
* 外部链接初始化获取 跳转web端的 unitId 专用,
|
||||
* 暂时: 初始化作业设计专用,后期可能会取消
|
||||
*/
|
||||
export const useGetClassWork = async () => {
|
||||
|
||||
const params = {
|
||||
edusubject,
|
||||
edustage,
|
||||
// entpcourseedituserid: userId,
|
||||
itemgroup: 'textbook',
|
||||
orderby: 'orderidx asc',
|
||||
pageSize: 10000
|
||||
}
|
||||
|
||||
if(localStorage.getItem('evaluationList')){
|
||||
evaluationList = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
}else{
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList = rows
|
||||
}
|
||||
|
||||
//获取教材版本
|
||||
await getSubject()
|
||||
//上册
|
||||
/**
|
||||
* 不区分上下册
|
||||
* 2024/08/20调整
|
||||
*/
|
||||
// volumeOne = data.filter(item => item.level == 1 && item.semester == '上册')
|
||||
// volumeTwo = data.filter(item => item.level == 1 && item.semester == '下册')
|
||||
getTreeData()
|
||||
}
|
||||
|
||||
//获取教材
|
||||
const getSubject = async () => {
|
||||
if(localStorage.getItem('subjectList')){
|
||||
subjectList = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}else{
|
||||
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', })
|
||||
|
||||
// subjectList = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
|
||||
subjectList = rows
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList))
|
||||
}
|
||||
|
||||
// 默认第一个
|
||||
if(!subjectList.length) return
|
||||
// curBookName = subjectList[0].itemtitle
|
||||
curBookId = subjectList[0].id
|
||||
// curBookImg = BaseUrl + subjectList[0].avartar
|
||||
// curBookPath = subjectList[0].fileurl
|
||||
}
|
||||
|
||||
|
||||
const getTreeData = () => {
|
||||
//数据过滤
|
||||
let upData = transData(evaluationList)
|
||||
|
||||
if(upData.length){
|
||||
// treeData = [...upData]
|
||||
}else{
|
||||
// treeData = []
|
||||
return
|
||||
}
|
||||
nextTick(() => {
|
||||
// defaultExpandedKeys = [treeData[0].id]
|
||||
// let currentNodeObj = {...getLastLevelData(upData)[0]}
|
||||
let currentNodeId = getLastLevelData(upData)[0].id
|
||||
let currentNodeName = getLastLevelData(upData)[0].label
|
||||
|
||||
let curNode = {
|
||||
id: currentNodeId,
|
||||
label: currentNodeName,
|
||||
// itemtitle: currentNodeObj.itemtitle,
|
||||
// edudegree: currentNodeObj.edudegree,
|
||||
// edustage: currentNodeObj.edustage,
|
||||
// edusubject: currentNodeObj.edusubject,
|
||||
}
|
||||
let parentNode = findParentByChildId(upData, currentNodeId)
|
||||
curNode.parentNode = toRaw(parentNode)
|
||||
|
||||
let levelFirstId = '';
|
||||
let levelSecondId = '';
|
||||
|
||||
if (curNode.parentNode) {
|
||||
levelFirstId = curNode.parentNode.id
|
||||
} else {
|
||||
levelFirstId = curNode.id
|
||||
levelSecondId = ''
|
||||
}
|
||||
let bookeId = curBookId
|
||||
// 头部 教材分析、作业设计:打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
|
||||
|
||||
// const data = {
|
||||
// textBook: {
|
||||
// curBookId: curBookId,
|
||||
// curBookName: curBookName,
|
||||
// curBookImg: curBookImg,
|
||||
// curBookPath: curBookPath
|
||||
// },
|
||||
// node: curNode
|
||||
// }
|
||||
// emit('changeBook', data)
|
||||
})
|
||||
}
|
||||
|
||||
const getLastLevelData = (tree) => {
|
||||
let lastLevelData = [];
|
||||
// 递归函数遍历树形结构
|
||||
function traverseTree(nodes) {
|
||||
nodes.forEach((node) => {
|
||||
// 如果当前节点有子节点,继续遍历
|
||||
if (node.children && node.children.length > 0) {
|
||||
traverseTree(node.children);
|
||||
} else {
|
||||
// 如果没有子节点,说明是最后一层的节点
|
||||
lastLevelData.push(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 调用递归函数开始遍历
|
||||
traverseTree(tree);
|
||||
|
||||
// 返回最后一层的数据
|
||||
return lastLevelData;
|
||||
}
|
||||
|
||||
// 根据id 拿到父节点数据
|
||||
const findParentByChildId = (treeData, targetNodeId) => {
|
||||
// 递归查找函数
|
||||
// 遍历树中的每个节点
|
||||
for (let node of treeData) {
|
||||
// 检查当前节点的子节点是否包含目标子节点 ID
|
||||
if (node.children && node.children.some(child => child.id === targetNodeId)) {
|
||||
// 如果当前节点的某个子节点的 ID 匹配目标子节点 ID,则当前节点即为父节点
|
||||
return node;
|
||||
}
|
||||
// 如果当前节点没有匹配的子节点,则递归检查当前节点的子节点
|
||||
if (node.children) {
|
||||
let parentNode = findParentByChildId(node.children, targetNodeId);
|
||||
if (parentNode) {
|
||||
return parentNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果未找到匹配的父节点,则返回 null 或者适当的默认值
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
const transData = (data) => {
|
||||
let ary = []
|
||||
data.forEach(item => {
|
||||
let obj = {}
|
||||
// 根据当前教材ID 过滤出对应的单元、章节
|
||||
if (item.rootid == curBookId) {
|
||||
if(item.level == 1){
|
||||
obj.label = item.itemtitle
|
||||
obj.id = item.id
|
||||
obj.itemtitle = item.itemtitle
|
||||
obj.edudegree = item.edudegree
|
||||
obj.edustage = item.edustage
|
||||
obj.edusubject = item.edusubject
|
||||
let ary2 = []
|
||||
evaluationList.forEach(el => {
|
||||
let obj2 = {}
|
||||
if (item.id == el.parentid) {
|
||||
obj2 = {
|
||||
label: el.itemtitle,
|
||||
id: el.id,
|
||||
itemtitle : el.itemtitle,
|
||||
edudegree : el.edudegree,
|
||||
edustage : el.edustage,
|
||||
edusubject : el.edusubject,
|
||||
}
|
||||
ary2.push(obj2)
|
||||
}
|
||||
obj.children = ary2
|
||||
})
|
||||
ary.push(obj)
|
||||
}
|
||||
}
|
||||
})
|
||||
return ary
|
||||
}
|
||||
|
|
@ -305,210 +305,11 @@ export const processList = (row) => {
|
|||
.join('、')
|
||||
row[i].workanswerFormat = answer
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//2、处理单选题
|
||||
if(row[i].worktype == '单选题' || row[i].worktype == '多选题' ){
|
||||
//1.选项前增加ABCD workdesc: "①②#&①③#&②④#&③④" || "<div>为了活着</div>#&<div>为了填报肚子</div>#&<div>为了吃饭而吃饭</div>"
|
||||
let workDescArr = [];
|
||||
if(row[i].workdesc.indexOf('[')!==-1 && row[i].workdesc.indexOf(']')!==-1) {
|
||||
//123会直接被转换, 且不是数组对象, 故手动判断是否有[和]两个字符
|
||||
workDescArr = JSON.parse(row[i].workdesc);
|
||||
}
|
||||
else if(row[i].workdesc.indexOf('#&')) {
|
||||
workDescArr = row[i].workdesc.split('#&');
|
||||
}
|
||||
else if(row[i].workdesc.indexOf(',')){
|
||||
workDescArr = row[i].workdesc.split(',');
|
||||
}
|
||||
else {
|
||||
// 待考虑
|
||||
workDescArr.push(item.workdesc)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//2.答案 - 数字转为ABCD
|
||||
if(row[i].worktype == '单选题') {
|
||||
const str2Char = String.fromCharCode(65+Number(row[i].workanswer));
|
||||
row[i].workanswerFormat = str2Char;
|
||||
} else if (row[i].worktype == '多选题') {
|
||||
const answerArr = row[i].workanswer.split('#&');
|
||||
let arr2Char = '';
|
||||
for(let k=0; k<answerArr.length; k++){
|
||||
arr2Char += String.fromCharCode(65+Number(answerArr[k]));
|
||||
}
|
||||
row[i].workanswerFormat = arr2Char;
|
||||
}
|
||||
}
|
||||
else if(row[i].worktype == '填空题') {
|
||||
// console.log(row[i].workanswer.replace(/<[^>]*>/g, "").split('#&'),'????')
|
||||
// 填空题答案
|
||||
row[i].workanswerFormat = row[i].workanswer.replace(/#&/g,", ");
|
||||
// 填空选项不需要展示,
|
||||
row[i].workdescFormat = '';
|
||||
}
|
||||
else if(row[i].worktype == '判断题'){
|
||||
// console.log(row[i].workanswer.replace(/<[^>]*>/g, "").split('#&'),'????')
|
||||
// 判断题答案
|
||||
row[i].workanswerFormat = row[i].workanswer.replace(/#&/g,", ");
|
||||
// 判断选项不需要展示,
|
||||
row[i].workdescFormat = '';
|
||||
}
|
||||
else if(row[i].worktype == '复合题') {
|
||||
// 1.选项解析替换
|
||||
const options = JSON.parse(row[i].workdesc);
|
||||
// 题目(背景材料+复合题目)
|
||||
const bjTitle = row[i].title.split('!@#$%')[0];
|
||||
const tmTitles = row[i].title.split('!@#$%').filter((it,ix)=>ix>0);
|
||||
// console.log(bjTitle,'背景标题');
|
||||
// console.log(tmTitles,'复合题目');
|
||||
let titls = [];
|
||||
options.forEach((element,index1) => {
|
||||
const workDescArr = element.split('#&');
|
||||
let tmp = '';
|
||||
let j=0;
|
||||
for(; j<jsonArr.length; j++){
|
||||
if(j%2 == 0){
|
||||
tmp += `<div style='width:80%;display:flex;'>`;
|
||||
}
|
||||
const char = String.fromCharCode(65+j);
|
||||
tmp += `<div style='display:flex;margin-left: 2%; width: 36%'>${char}.${jsonArr[j]}</div>`;
|
||||
if(j%2 == 1){
|
||||
tmp += '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if(j%2== 0){
|
||||
tmp += '</div>';
|
||||
}
|
||||
workdesc = tmp;
|
||||
}
|
||||
|
||||
row[i].workdescFormat = workdesc; // 题目选项
|
||||
|
||||
|
||||
// 答案处理
|
||||
let workanswer = '';
|
||||
if(row[i].workanswer && row[i].workanswer != '') {
|
||||
// 因答案内容存在多种格式: 1.["123","1234"] 2.123#&1234 3.123
|
||||
if(row[i].workanswer.indexOf('[')!==-1 && row[i].workanswer.indexOf(']')!==-1) {
|
||||
//123会直接被转换, 且不是数组对象, 故手动判断是否有[和]两个字符
|
||||
let json = JSON.parse(row[i].workanswer);
|
||||
// 单选、多选 需要 数字转为ABCD
|
||||
if(row[i].worktype == '单选题') {
|
||||
const str2Char = String.fromCharCode(65+Number(json[0]));
|
||||
workanswer = str2Char;
|
||||
} else if (row[i].worktype == '多选题') {
|
||||
// const answerArr = row[i].workanswer.split('#&');
|
||||
let arr2Char = '';
|
||||
for(let k=0; k<json.length; k++){
|
||||
arr2Char += String.fromCharCode(65+Number(json[k]));
|
||||
}
|
||||
workanswer = arr2Char;
|
||||
} else if(row[i].worktype == '主观题' ) {
|
||||
let arr2Char = '';
|
||||
for(let k=0; k<json.length; k++){
|
||||
const itemArr = json[k];
|
||||
arr2Char += '('+ (parseInt(k) + 1) +')'+ itemArr.join('、')+ '<br />';
|
||||
}
|
||||
workanswer = arr2Char;
|
||||
row[i].titleFormat = row[i].titleFormat.replace(/!@#\$%/g, '');
|
||||
} else {
|
||||
workanswer = json.join('、');
|
||||
}
|
||||
} else if(row[i].workanswer.indexOf('#&')) {
|
||||
// 意味着多个答案或者填空内容
|
||||
let workanswerList = row[i].workanswer.split('#&');
|
||||
if(row[i].worktype == '多选题') {
|
||||
// 数字转为ABCD
|
||||
let arr2Char = '';
|
||||
for(let k=0; k<workanswerList.length; k++){
|
||||
arr2Char += String.fromCharCode(65+Number(workanswerList[k]));
|
||||
}
|
||||
workanswer = arr2Char;
|
||||
}else{
|
||||
workanswer = workanswerList.join('、');
|
||||
}
|
||||
} else if(row[i].workanswer.indexOf(',')){
|
||||
// 意味这同样多个答案或者填空内容
|
||||
let workanswerList = row[i].workanswer.split(',');
|
||||
if(row[i].worktype == '多选题') {
|
||||
// 数字转为ABCD
|
||||
let arr2Char = '';
|
||||
for(let k=0; k<workanswerList.length; k++){
|
||||
arr2Char += String.fromCharCode(65+Number(workanswerList[k]));
|
||||
}
|
||||
workanswer = arr2Char;
|
||||
}else{
|
||||
workanswer = workanswerList.join('、');
|
||||
}
|
||||
} else {
|
||||
// 待考虑
|
||||
workanswer = row[i].workanswer;
|
||||
}
|
||||
}
|
||||
|
||||
row[i].workanswerFormat = workanswer; // 题目正确答案
|
||||
|
||||
|
||||
//2.答案 - 数字转为ABCD
|
||||
const answerArr = JSON.parse(row[i].workanswer);
|
||||
let indexLabel = 1;
|
||||
let arr = [];
|
||||
answerArr.forEach(item => {
|
||||
const arrTmp = item.answer.split('#&');
|
||||
let value = `(${indexLabel})`;
|
||||
arrTmp.forEach((element,i) => {
|
||||
if(item.type == '单选题' || item.type == '多选题'){
|
||||
value += `${String.fromCharCode(65+Number(element))}`;
|
||||
}
|
||||
if(item.type == '判断题' || item.type == '填空题'){
|
||||
// 去除下 html标签
|
||||
value += `${element.replace(/<[^>]+>/g, '')}`+ (i==arrTmp.length-1?'':'、');
|
||||
}
|
||||
})
|
||||
arr.push(value);
|
||||
indexLabel++;
|
||||
})
|
||||
const answer = arr.join('<br />');
|
||||
|
||||
row[i].workanswerFormat = answer;
|
||||
}
|
||||
else if(row[i].worktype == '主观题') {
|
||||
// 1.选项解析替换---主观题没选项
|
||||
// 题目(背景材料+主观题目)
|
||||
const bjTitle = row[i].title.split('!@#$%')[0];
|
||||
const tmTitles = row[i].title.split('!@#$%').filter((it,ix)=>ix>0);
|
||||
// console.log(bjTitle,'背景标题');
|
||||
// console.log(tmTitles,'主观题目');
|
||||
let titls = [];
|
||||
const s = [];
|
||||
tmTitles.map((it,ix)=>{
|
||||
s.push(it);
|
||||
})
|
||||
// console.log(s,'?????????????????')
|
||||
|
||||
row[i].titleFormat = bjTitle + s.join('');
|
||||
// 填空选项不需要展示,
|
||||
row[i].workdescFormat = '';
|
||||
|
||||
//2.答案
|
||||
// 填空题答案
|
||||
const workanswerList = JSON.parse(row[i].workanswer);
|
||||
let tmp='';
|
||||
workanswerList&&workanswerList.map((item,index)=>{
|
||||
tmp += '<div>'+(index+1)+'.'+item.replace(/#&/g, ',')+'</div>';
|
||||
})
|
||||
row[i].workanswerFormat = tmp;
|
||||
|
||||
}
|
||||
else {
|
||||
//处理答案
|
||||
row[i].workanswerFormat = '见试题解答内容';
|
||||
}
|
||||
*/
|
||||
// else {
|
||||
// // 其余类型试题类型(因学科不同, 大多为主观题类型, 结构为数组)
|
||||
// row[i].workanswerFormat = workAnswerArr.join('、')
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,12 @@ export const constantRoutes = [
|
|||
// component: ()=> import('../login/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/fullscreenpdf',
|
||||
component: () => import('@/views/fullScreenPdf/index.vue'),
|
||||
name: 'fullscreenpdf',
|
||||
meta: {title: '全屏显示PDF'}
|
||||
},
|
||||
{
|
||||
path: '/teachClassTask',
|
||||
component: () => import('@/views/classTask/teachClassTask.vue'),
|
||||
|
@ -79,6 +85,7 @@ export const constantRoutes = [
|
|||
name: 'testpdf',
|
||||
meta: {title: '测试PDF'}
|
||||
},
|
||||
|
||||
{
|
||||
path: '/classReserv',
|
||||
component: () => import('@/views/classManage/classReserv.vue'),
|
||||
|
|
|
@ -378,7 +378,22 @@ export const toLinkWeb = (path) => {
|
|||
cookieData: { ...config }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 外部跳转-web网页
|
||||
* @param {*} path
|
||||
* @param {*} params
|
||||
*/
|
||||
export const toRoter = (path) => {
|
||||
const config = baseConfig()
|
||||
// console.log(config)
|
||||
// const fullPath = config.url + path
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
key: `win-${Date.now()}`,
|
||||
fullPath: path,
|
||||
cookieData: { ...config }
|
||||
})
|
||||
}
|
||||
// const taskHandles = () => {
|
||||
// // 设置任务栏上下文菜单
|
||||
// const contextMenu = new Remote.Menu()
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
<!--
|
||||
* @Author: 苦逼程序猿
|
||||
* @Date: 2024-09-06 16:58:59
|
||||
* @Warning: 千行代码,Bug露锋芒。
|
||||
-->
|
||||
<template>
|
||||
<el-container class="class-reserv-wrap">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
|
@ -71,7 +66,8 @@ import { useToolState } from '@/store/modules/tool'
|
|||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from "@/store/modules/classTask";
|
||||
import {sessionStore, createWindow} from '@/utils/tool'
|
||||
import {createWindow} from '@/utils/tool'
|
||||
import {sessionStore} from '@/utils/store'
|
||||
import {throttle,debounce } from '@/utils/comm'
|
||||
|
||||
|
||||
|
|
|
@ -101,11 +101,7 @@
|
|||
|
||||
<!-- 作业内容编辑 -->
|
||||
<el-dialog v-model="workEdit" title="作业内容详情" width="90%" append-to-body>
|
||||
<div v-if="currentTag=='学习目标定位'" style="display: flex;">
|
||||
<degreeevolution :attainmentList="attainmentList" :show-class="true" :courseQualityList="courseQualityList"/>
|
||||
</div>
|
||||
<!-- 课标研读 目标设定 教材研读 框架梳理 学科定位 -->
|
||||
|
||||
<div v-if="currentTag=='习题训练'" :style="{'padding': '15px', 'overflow': 'auto'}">
|
||||
<el-table :data="workConfObj.quizlist" style="width: 100%;">
|
||||
<el-table-column type="index" width="60" />
|
||||
|
@ -130,6 +126,32 @@
|
|||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="currentTag=='框架梳理'" :style="{'padding': '15px', 'overflow': 'auto'}">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
|
||||
<template v-for="(item) in workConfObj.chooseWorkLists" :key="item.id">
|
||||
<div v-if="item.worktype==workConfObj.worktype">
|
||||
<div class="choose-work">
|
||||
<div class="choose-work-title">{{ item.worktype }}</div>
|
||||
<div class="choose-work-content">
|
||||
<div style="color: silver; display: flex;align-items: center;flex: 1;">
|
||||
<el-form-item label="分值">
|
||||
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
|
||||
</el-form-item>
|
||||
<div style="display: flex;align-items: center;flex: 1;justify-content: flex-end;">
|
||||
<el-button @click="prevRead(item)">预览</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<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"
|
||||
|
@ -137,7 +159,6 @@
|
|||
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
||||
@click="submitStudy('submit')">确 定</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
@ -467,7 +488,21 @@ const handleWorkTitleEdit = (row, index) => {
|
|||
};
|
||||
|
||||
|
||||
// 作业内容-查看详情
|
||||
// 作业内容编辑-跳转到设计界面-传参
|
||||
let classtaskObj = reactive({
|
||||
id: '', //
|
||||
bookName: '', // 课程名称
|
||||
uniquekey: '', // 设计中的标题
|
||||
title: '', // 设计中的说明
|
||||
worktype: '', // 设计中的作业类型
|
||||
quizlist: [], // 设计中的试题列表
|
||||
chooseWorkLists: [],// 设计中的框架梳理list
|
||||
fileHomeworkList: [],// 设计中的常规作业list
|
||||
whiteboardObj: '',// 设计中的课堂展示对象
|
||||
})
|
||||
/**
|
||||
* 作业内容-查看详情
|
||||
* */
|
||||
const handleWorkEdit = (row, index) =>{
|
||||
console.log(row, index)
|
||||
workEdit.value = true
|
||||
|
@ -549,34 +584,8 @@ const handleWorkEdit = (row, index) =>{
|
|||
}
|
||||
}
|
||||
};
|
||||
// 作业内容编辑-跳转到设计界面-传参
|
||||
let classtaskObj = reactive({
|
||||
id: '', //
|
||||
bookName: '', // 课程名称
|
||||
uniquekey: '', // 设计中的标题
|
||||
title: '', // 设计中的说明
|
||||
worktype: '', // 设计中的作业类型
|
||||
quizlist: [], // 设计中的试题列表
|
||||
chooseWorkLists: [],// 设计中的框架梳理list
|
||||
fileHomeworkList: [],// 设计中的常规作业list
|
||||
whiteboardObj: '',// 设计中的课堂展示对象
|
||||
})
|
||||
// 作业内容编辑-跳转到设计界面
|
||||
const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
||||
// this.newWorkSpace = true;
|
||||
// this.newWorkSpaceEdit = true;
|
||||
// this.currentTask = row;
|
||||
// this.currentIndex = index;
|
||||
// this.currentTag = row.worktype;
|
||||
// this.attainmentList = row.workcodesList?.attlist;
|
||||
// this.courseQualityList = row.workcodesList?.qualist;
|
||||
|
||||
// 更新新任务中的各数据
|
||||
// this.classWorkForm.uniquekey = this.currentTask.uniquekey;
|
||||
// this.classWorkForm.title = this.currentTask.title;
|
||||
// 更新新任务中作业类型
|
||||
// this.classWorkForm.worktype = this.currentTask.worktype;
|
||||
|
||||
//重新更新[新任务]中右侧列表数据
|
||||
var listCourseWork = [];
|
||||
for (var i=0; i < row.entpcourseworklistarray.length; i++) {
|
||||
|
@ -600,11 +609,6 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
|
||||
if (row.worktype == '框架梳理') {
|
||||
// 框架梳理对应只有一个内容
|
||||
// let queryParams = {}
|
||||
// queryParams.id = listCourseWork[0].id;
|
||||
// queryParams.ppttype = '教材分析';
|
||||
// queryParams.title = '框架梳理';
|
||||
// queryParams.filetype = 'draw';
|
||||
const res = await getEvaluationclue(listCourseWork[0].id);
|
||||
if ( res.data==null || res.data==undefined ) {
|
||||
return;
|
||||
|
@ -615,6 +619,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
res.data.score = listCourseWork[0].score;
|
||||
classtaskObj.chooseWorkLists.push(res.data);
|
||||
//
|
||||
ToNewClassTask(classtaskObj);
|
||||
}
|
||||
else if (row.worktype == '习题训练') {
|
||||
const ids = listCourseWork.map(item => item.id).join(",");
|
||||
|
@ -636,6 +641,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
|
||||
classtaskObj.quizlist = idres.rows;
|
||||
//
|
||||
ToNewClassTask(classtaskObj);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -644,15 +650,22 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
const workcodes = JSON.parse(row.workcodes);
|
||||
classtaskObj.whiteboardObj = JSON.stringify(workcodes.json);
|
||||
//
|
||||
ToNewClassTask(classtaskObj);
|
||||
}
|
||||
else if (row.worktype == '常规作业') {
|
||||
if(isJson(row.workcodes)){
|
||||
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
|
||||
//
|
||||
ToNewClassTask(classtaskObj);
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转 作业设计 进行编辑页面
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 跳转 作业设计 进行编辑页面
|
||||
* @param classtaskObj
|
||||
*/
|
||||
const ToNewClassTask = (classtaskObj) => {
|
||||
router.push({
|
||||
path: '/newClassTask',
|
||||
query: {
|
||||
|
@ -660,7 +673,6 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const isJson = (str) => {
|
||||
if (typeof str == 'string') {
|
||||
|
@ -877,6 +889,8 @@ const handleWorkConfigUpdate = (key,row) => {
|
|||
classWorkConfigForm.classWorkConfigList = [];
|
||||
// 新建的配置方案
|
||||
for (var i=0; i<clist.length; i++) {
|
||||
// clist里面包含多个班级、多个班级的学生。选中的学生中 classWorkConfigForm.studentlist 包含多个班级的学生 studentlist赋值需要根据id判断筛选一下
|
||||
const clsStuList = classWorkConfigForm.studentlist&&classWorkConfigForm.studentlist.filter(item=>item.classid == clist[i].id);
|
||||
classWorkConfigForm.classWorkConfigList.push({
|
||||
id: 0,
|
||||
classid: clist[i].id,
|
||||
|
@ -892,7 +906,7 @@ const handleWorkConfigUpdate = (key,row) => {
|
|||
workdate: '',
|
||||
title: '',
|
||||
workcodes: '',
|
||||
studentlist: classWorkConfigForm.studentlist,
|
||||
studentlist: clsStuList,
|
||||
timelength: classWorkConfigForm.timelength,
|
||||
weights: classWorkConfigForm.weights,
|
||||
feedtype: classWorkConfigForm.feedtype,
|
||||
|
@ -1006,6 +1020,7 @@ const handleTaskAssignToAllClassType = async() => {
|
|||
|
||||
var wForm = {};
|
||||
wForm.classworkarray = JSON.stringify(ttt);
|
||||
console.log(wForm,'推送的配置信息------------')
|
||||
saveByClassWorkArray(wForm).then(response => {
|
||||
console.log(response,'===============response');
|
||||
// this.classWorkToStudent_Loading = false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-row class="c-warp" :gutter="10">
|
||||
<el-col class="left" :span="14">
|
||||
<el-collapse class="c-item" v-model="activeTopic" accordion>
|
||||
<el-collapse class="c-item" v-model="activeTopic">
|
||||
<template v-for="(item, index) in dataList">
|
||||
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
|
||||
<template #title>
|
||||
|
|
|
@ -156,7 +156,7 @@ import ItemDialogScore from '@/views/classTask/container/item-dialog-score.vue'
|
|||
// zdg: 组件导入
|
||||
import quizStats from '@/views/classTask/container/quizStats.vue'
|
||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
||||
import {sessionStore} from '@/utils/tool'
|
||||
import {sessionStore} from '@/utils/store'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emit = defineEmits(['cle-click'])
|
||||
|
@ -636,7 +636,7 @@ onMounted(() => {
|
|||
|
||||
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||
const data = sessionStore.get('teachClassWorkItem');
|
||||
// console.log(data,'????????????????????' )
|
||||
console.log(data,'????????????????????' )
|
||||
if(data){
|
||||
openDialog(data)
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ import { ref, onMounted, watch } from 'vue'
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||
import {sessionStore, createWindow} from '@/utils/tool'
|
||||
import {sessionStore} from '@/utils/store'
|
||||
import {createWindow} from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import {throttle,debounce } from '@/utils/comm'
|
||||
|
||||
|
|
|
@ -58,8 +58,8 @@
|
|||
v-else-if="curTask.viewkey=='考点分析' "
|
||||
/>
|
||||
|
||||
<examMocks v-else
|
||||
|
||||
<examMocks
|
||||
v-else
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,12 +75,13 @@ import { ArrowRight } from '@element-plus/icons-vue'
|
|||
import useResoureStore from '@/views/resource/store'
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
|
||||
import {processExamQuestion} from '@/utils/examQuestion/tool'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
import { JYApiListCT} from "@/utils/examQuestion/jyeoo"
|
||||
|
||||
import examReview from './container/examReview.vue'
|
||||
import pointAnalysis from './container/pointAnalysis.vue'
|
||||
import examMocks from './container/examMocks.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
const sourceStore = useResoureStore();
|
||||
|
@ -106,6 +107,19 @@ const listWorkType = ref([{
|
|||
value: 0,
|
||||
}]);
|
||||
|
||||
const getCourseWorkList = async (params) => {
|
||||
const res = await listEntpcourseworkNew(params);
|
||||
if(res.data == null) {
|
||||
listExamQuestion.value = [];
|
||||
// queryParams.total = 0
|
||||
return;
|
||||
}
|
||||
listExamQuestion.value = res.data;
|
||||
// queryParams.total = res.total;
|
||||
// 格式化试题
|
||||
processList(listExamQuestion.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 选中单元章节后的回调, 获取单元章节信息
|
||||
* @return: {*}
|
||||
|
@ -134,6 +148,15 @@ const getData = async (data) => {
|
|||
// const res = await listEntpcoursework(params);
|
||||
// listExamQuestion.value = res.rows;
|
||||
|
||||
// 当前不存在对应绑定的菁优网章节id时, 不进行处理
|
||||
// 注意: 菁优网章节id绑定需在网页端[/evaluation/bind]中进行绑定
|
||||
if (curNode.value.bookId == null || curNode.value.bookId == '' || curNode.value.bookId == '0') {
|
||||
listExamQuestion.value = [];
|
||||
loading.value = false;
|
||||
ElMessage.error("当前单元/章节下无试题");
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询本地+菁优网(后端处理)
|
||||
const params = {
|
||||
eid: curNode.value.id,
|
||||
|
@ -144,17 +167,7 @@ const getData = async (data) => {
|
|||
edustage: curNode.value.edustage,
|
||||
sectionName: curNode.value.itemtitle,
|
||||
}
|
||||
const res = await listEntpcourseworkNew(params);
|
||||
if(res.data == null) {
|
||||
listExamQuestion.value = [];
|
||||
// queryParams.total = 0
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
listExamQuestion.value = res.data;
|
||||
// queryParams.total = res.total;
|
||||
// 格式化试题
|
||||
processExamQuestion(listExamQuestion.value);
|
||||
await getCourseWorkList(params);
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
|
@ -202,6 +215,13 @@ const queryExamQuestionByParams = async () => {
|
|||
// const res = await listEntpcoursework(params);
|
||||
// listExamQuestion.value = res.rows;
|
||||
|
||||
if (curNode.value.bookId == null || curNode.value.bookId == '' || curNode.value.bookId == '0') {
|
||||
listExamQuestion.value = [];
|
||||
loading.value = false;
|
||||
ElMessage.error("当前单元/章节下无试题");
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询本地+菁优网(后端处理)
|
||||
const params = {
|
||||
eid: curNode.value.id,
|
||||
|
@ -212,17 +232,7 @@ const queryExamQuestionByParams = async () => {
|
|||
edustage: curNode.value.edustage,
|
||||
sectionName: curNode.value.itemtitle,
|
||||
}
|
||||
const res = await listEntpcourseworkNew(params);
|
||||
if(res.data == null) {
|
||||
listExamQuestion.value = [];
|
||||
// queryParams.total = 0
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
listExamQuestion.value = res.data;
|
||||
// queryParams.total = res.total;
|
||||
// 格式化试题
|
||||
processExamQuestion(listExamQuestion.value);
|
||||
await getCourseWorkList(params);
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<PDF :url="pdfUrl" :isWin="true" v-if="pdfUrl" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import PDF from '@/components/PdfJs/index.vue'
|
||||
import { useRoute } from 'vue-router';
|
||||
import { getStaticUrl } from '@/utils/tool'
|
||||
const route = useRoute();
|
||||
|
||||
const pdfUrl = ref('');
|
||||
const loadPdfAnimation = (path) => {
|
||||
console.log('书本地址====',path);
|
||||
const timer = setTimeout(() => {
|
||||
pdfUrl.value = path
|
||||
clearTimeout(timer);
|
||||
},2000)
|
||||
}
|
||||
onMounted(() => {
|
||||
const bookpath = localStorage.getItem('PDF-LOCAL-PATH')
|
||||
// const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + bookpath
|
||||
// const isDev = process.env.NODE_ENV == 'development'
|
||||
// if (isDev)
|
||||
// pdfUrl.value = getStaticUrl(bookpath, 'user', 'selfFile', true) //本地
|
||||
// else
|
||||
// pdfUrl.value = getStaticUrl(bookpath, 'user', 'selfFile', true) //线上
|
||||
// const newpath = getStaticUrl(bookpath, 'user', 'selfFile', true)
|
||||
loadPdfAnimation(bookpath)
|
||||
// pdfUrl.value = filepath
|
||||
// console.log('课件路径',newpath);
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
|
@ -155,7 +155,7 @@ import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
|||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||
import SetHomework from '@/components/set-homework/index.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import { createWindow, sessionStore } from '@/utils/tool'
|
||||
import { createWindow, sessionStore, getAppInstallUrl } from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
|
||||
import { getClassInfo, getSelfReserv } from '@/api/classManage'
|
||||
|
@ -298,8 +298,8 @@ export default {
|
|||
this.$refs['kjItemRef'+this.activeClass.id][0].openFileWin(this.activeClass);
|
||||
})
|
||||
},
|
||||
getBookPathFromServer() {
|
||||
let fileName = this.curBookPath
|
||||
getBookPathFromServer(path) {
|
||||
let fileName = path ? path : this.curBookPath
|
||||
if (!fileName) return
|
||||
fileName = fileName.replace('.txt', '.pdf')
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -549,6 +549,9 @@ export default {
|
|||
if (this.currentNode.id === data.node.id) return
|
||||
this.curBookImg = data.textBook.curBookImg
|
||||
this.curBookPath = data.textBook.curBookPath
|
||||
const path = await this.getBookPathFromServer(data.textBook.curBookPath)
|
||||
const localpath = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file="
|
||||
localStorage.setItem('PDF-LOCAL-PATH',localpath + encodeURIComponent(import.meta.env.VITE_APP_RES_FILE_PATH + path))
|
||||
this.checkFileList = []
|
||||
this.currentWorkList = []
|
||||
let cata = parseCataByNode(data.node)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
||||
</div>
|
||||
<div class="stand-head-right">
|
||||
<div class="stand-head-right-tit">{{booktitle}}</div>
|
||||
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName: ''}}</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>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<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 class="bookname">{{item.bookName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -84,11 +84,13 @@ 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 { 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'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||
const userStore = useUserStore()
|
||||
const sourceStore = useResoureStore()
|
||||
// import { getStaticUrl } from '@/utils/tool'
|
||||
|
@ -105,7 +107,6 @@ 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([])
|
||||
|
@ -248,31 +249,45 @@ const getAllSubject = async () => {
|
|||
const dataList = [];
|
||||
rows && rows.map((item,idx) => {
|
||||
if(item.fileurl !== ''){
|
||||
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
||||
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')})
|
||||
}
|
||||
})
|
||||
bookList.value = dataList
|
||||
bookInfo.value = {...dataList[0],avartar: dataList[0].avartar}
|
||||
booktitle.value = dataList[0].fileurl.replace('.txt','')
|
||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + dataList[0].fileurl.replace('.txt','.pdf')
|
||||
const session = sessionStore.get('subject.curNode')
|
||||
console.log('session',session);
|
||||
let filePath = import.meta.env.VITE_APP_RES_FILE_PATH;
|
||||
if(session.rootid){
|
||||
const idx = dataList.findIndex(item => item.id === session.rootid)
|
||||
if(idx > -1){
|
||||
bookInfo.value = {...dataList[idx]}
|
||||
filePath += dataList[idx].fileurl.replace('.txt','.pdf')
|
||||
}else{
|
||||
bookInfo.value = {...dataList[0]}
|
||||
filePath += dataList[0].fileurl.replace('.txt','.pdf')
|
||||
}
|
||||
await loadPdfAnimation(filePath)
|
||||
}else{
|
||||
bookInfo.value = {...dataList[0]}
|
||||
filePath += dataList[0].fileurl.replace('.txt','.pdf')
|
||||
}
|
||||
}
|
||||
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) => {
|
||||
console.log('书本地址====',path);
|
||||
const timer = setTimeout(() => {
|
||||
pdfUrl.value = path
|
||||
clearTimeout(timer);
|
||||
},2000)
|
||||
}
|
||||
onMounted(async () => {
|
||||
await useGetSubject();
|
||||
await getAllSubject();
|
||||
if(cardref.value && headref.value){
|
||||
const cardH = cardref.value.offsetHeight;
|
||||
|
@ -423,13 +438,18 @@ onMounted(async () => {
|
|||
z-index: 2;
|
||||
&-tit{
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
line-height: 22px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #3b3b3b;
|
||||
text-align: left;
|
||||
padding-right: 30px;
|
||||
}
|
||||
&-icon{
|
||||
position: absolute;
|
||||
|
@ -443,7 +463,6 @@ onMounted(async () => {
|
|||
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);
|
||||
|
@ -537,9 +556,10 @@ onMounted(async () => {
|
|||
width: 130px;
|
||||
height: 180px;
|
||||
}
|
||||
.name{
|
||||
.bookname{
|
||||
height: 60px;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
color: #3b3b3b;
|
||||
}
|
||||
}
|
||||
.item:hover{
|
||||
|
|
|
@ -38,7 +38,7 @@ import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vu
|
|||
import homework from './homework.vue';
|
||||
|
||||
// 功能说明:侧边-工具栏
|
||||
const colors = ['#00f389', '#ff7f00', '#ffff00', '#409EFF', '#00baff', '#13b189', '#F56C6C']
|
||||
const colors = ['#409EFF','#00f389', '#ff7f00', '#ffff00', '#00baff', '#13b189', '#F56C6C']
|
||||
const emit = defineEmits(['update:modelValue','change'])
|
||||
const props = defineProps({
|
||||
modelValue: { // 是否显示
|
||||
|
@ -48,6 +48,7 @@ const props = defineProps({
|
|||
data: { // 数据
|
||||
type: Array,
|
||||
default: () => [
|
||||
{ label: '课件', prop: 'book', isExtra: true, icon: 'icon--kejian' },
|
||||
{ label: '活动', prop: 'resource', icon: 'icon-kechengziyuan1' },
|
||||
// { label: '互动', prop: 'interact', icon: 'icon-hudong' },
|
||||
// { label: '窗口', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' },
|
||||
|
|
|
@ -52,7 +52,7 @@ import imChat from './components/imChat.vue' // im-chat-子组件
|
|||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
||||
import { ipcMsgSend, ipcMain, sessionStore } from '@/utils/tool' // 相关工具
|
||||
import { ipcMsgSend, ipcMain, sessionStore, toRoter } from '@/utils/tool' // 相关工具
|
||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息头-相关定义(nuem)
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -62,6 +62,7 @@ const isDrag = ref(false) // 开始拖拽
|
|||
const dragtime = ref(0) // 拖拽时间-计算点击还是拖动
|
||||
const isShow = ref(false) // 是否显示-画板
|
||||
const isOver = ref(false) // 是否下课
|
||||
const isOpenBook = ref(false)
|
||||
const toolStore = useToolState() // 状态管理
|
||||
const boardVueRef=ref(null) // 画板ref
|
||||
const upvoteRef = ref(null) // 点赞 ref
|
||||
|
@ -70,6 +71,7 @@ const classObj = reactive({ // 课程相关
|
|||
id: route.query.reservId, // 课程id
|
||||
data: {} // 课程信息
|
||||
})
|
||||
const bookInfo = ref(null)
|
||||
const msgIds = [] // 消息id
|
||||
const electron = window.electron // electron
|
||||
const btnList = [ // 工具栏按钮列表
|
||||
|
@ -88,6 +90,7 @@ onMounted(async() => {
|
|||
// window.test1 = toolStore
|
||||
getClassInfo() // 获取课堂详情 ex3
|
||||
resetStatus() // 开启重置状态-监听
|
||||
|
||||
})
|
||||
|
||||
// ==== 方法 ===
|
||||
|
@ -204,6 +207,16 @@ const sideMouse = e => {
|
|||
const sideChange = async o => {
|
||||
// console.log(o)
|
||||
switch(o.prop) {
|
||||
case 'book':
|
||||
if(isOpenBook.value) {
|
||||
isOpenBook.value = false
|
||||
ElMessage.info('已经打开课本了哦')
|
||||
}else {
|
||||
// createWindow('fullScreen-PDF',{url: '/fullscreenpdf'})
|
||||
toRoter(`${process.env['ELECTRON_RENDERER_URL']}/#/fullscreenpdf`)
|
||||
isOpenBook.value = true
|
||||
}
|
||||
break
|
||||
case 'resource': // 资源
|
||||
break
|
||||
case 'interact': // 互动
|
||||
|
|
Loading…
Reference in New Issue