Merge remote-tracking branch 'origin/main'

This commit is contained in:
朱浩 2024-12-05 15:47:38 +08:00
commit 87dcd9d5c3
23 changed files with 720 additions and 81 deletions

View File

@ -57,6 +57,7 @@
"file-saver": "^2.0.5",
"hfmath": "^0.0.2",
"html-to-image": "^1.11.11",
"html2canvas": "^1.4.1",
"im_electron_sdk": "^8.0.5904",
"js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2",

View File

@ -8,7 +8,7 @@
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/> -->
<meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; default-src 'self'; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net;" />
<meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; default-src 'self' https://wzyzoss.eos-chongqing-3.cmecloud.cn/; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net;" />
</head>

View File

@ -60,14 +60,6 @@ window.addEventListener('unload', () => {
const newDiscardedDB = JSON.stringify(discardedDBList)
localStorage.setItem(LOCALSTORAGE_KEY_DISCARDED_DB, newDiscardedDB)
})
/** 接口类型 */
interface Result {
code?: number,
msg?: string,
data?: any
rows?: Array<any>,
total?: number
}
//
const initLoad: Function = () => {
// ppt

View File

@ -4,6 +4,7 @@
* @date 2024-11-26
*/
import { toRaw } from 'vue'
import type { Result } from './types' // 接口类型
import msgUtils from '@/plugins/modal' // 消息工具
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
import * as API_smarttalk from '@/api/file' // 相关api
@ -54,6 +55,7 @@ export class PPTApi {
return new Promise(async (resolve, reject) => {
const params: object = { parentid, orderByColumn: 'fileidx', isAsc: 'asc', pageSize: 9999 }
const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params)
console.log(res.rows,'res.rows');
if (res.code === 200) {
const slides = (res.rows || []).map(o => {
if (!!o.datacontent) {
@ -64,8 +66,15 @@ export class PPTApi {
// 如果没有数据,默认空白页
return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}}
})
// 活动列表处理
const workList = (res.rows || []).map(o => o.activityContent)
const workItem = [...res.rows]
slidesStore.updateSlideIndex(0) // 下标0 为第一页
slidesStore.setSlides(slides) // 写入数据
// 写入作业列表数据
slidesStore.setWorkList(workList)
// 获取所有的pptlist的数据
slidesStore.setWorkItem(workItem)
resolve(true)
} else msgUtils.msgError(res.msg || '获取数据失败');resolve(false)
})

View File

@ -2,6 +2,7 @@
* @description api store循环引用
* @author zdg
*/
import type { Result } from './types' // 接口类型
import msgUtils from '@/plugins/modal' // 消息工具
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api

View File

@ -0,0 +1,8 @@
/** 返回-接口类型 */
export interface Result {
code?: number,
msg?: string,
data?: any
rows?: Array<any>,
total?: number
}

View File

@ -31,6 +31,8 @@ export interface SlidesState {
slideIndex: number
viewportSize: number
viewportRatio: number
workList:Object[],
workItem:Object[],
}
export const useSlidesStore = defineStore('slides', {
@ -41,6 +43,8 @@ export const useSlidesStore = defineStore('slides', {
slideIndex: 0, // 当前页面索引
viewportSize: 1000, // 可视区域宽度基数
viewportRatio: 0.5625, // 可视区域比例默认16:9
workList:[],// 活动的列表
workItem:[],// 获取到的所有pptlist
}),
getters: {
@ -131,6 +135,13 @@ export const useSlidesStore = defineStore('slides', {
setSlides(slides: Slide[]) {
this.slides = slides
},
// 更新活动列表
setWorkList(list: Object[]) {
this.workList = list
},
setWorkItem(list: Object[]) {
this.workItem = list
},
addSlide(slide: Slide | Slide[]) {
const slides = Array.isArray(slide) ? slide : [slide]

View File

@ -6,4 +6,5 @@ export const enum ToolbarStates {
SLIDE_DESIGN = 'slideDesign',
SLIDE_ANIMATION = 'slideAnimation',
MULTI_POSITION = 'multiPosition',
EL_ACTIVE = 'elActive',
}

View File

@ -81,6 +81,7 @@
</template>
<IconVideoTwo class="handler-item" v-tooltip="'插入音视频'" />
</Popover>
<IconPreviewOpen class="handler-item" v-tooltip="'插入试题'" @click="classWorkTaskVisible = true" />
</div>
<div class="right-handler">
@ -110,6 +111,18 @@
@update="data => { createLatexElement(data); latexEditorVisible = false }"
/>
</Modal>
<Modal
v-model:visible="classWorkTaskVisible"
:width="880"
>
<QuestToPPTist
class="class-work-task-modal"
@close="classWorkTaskVisible = false"
@update="data => { onhtml2canvas(data); classWorkTaskVisible = false }"
/>
</Modal>
</div>
</template>
@ -135,6 +148,7 @@ import Modal from '../../../components/Modal.vue'
import Divider from '../../../components/Divider.vue'
import Popover from '../../../components/Popover.vue'
import PopoverMenuItem from '../../../components/PopoverMenuItem.vue'
import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue'
const mainStore = useMainStore()
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
@ -172,12 +186,17 @@ const insertImageElement = (files: FileList) => {
getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))
}
const onhtml2canvas = (imgbs64: string) => {
createImageElement(imgbs64)
}
const shapePoolVisible = ref(false)
const linePoolVisible = ref(false)
const chartPoolVisible = ref(false)
const tableGeneratorVisible = ref(false)
const mediaInputVisible = ref(false)
const latexEditorVisible = ref(false)
const classWorkTaskVisible = ref(false)
const textTypeSelectVisible = ref(false)
const shapeMenuVisible = ref(false)
const moreVisible = ref(false)
@ -343,6 +362,9 @@ const toggleNotesPanel = () => {
font-size: 13px;
}
}
.class-work-task-modal{
height: 80vh;
}
@media screen and (width <= 1200px) {
.right-handler .text {

View File

@ -66,6 +66,9 @@
</Draggable>
<div class="page-number">幻灯片 {{slideIndex + 1}} / {{slides.length}}</div>
<!-- 引入活动的列表页面 -->
<Active ref="activeRef" v-show="false"/>
</div>
</template>
@ -85,12 +88,13 @@ import ThumbnailSlide from '../../../views/components/ThumbnailSlide/index.vue'
import LayoutPool from './LayoutPool.vue'
import Popover from '../../../components/Popover.vue'
import Draggable from 'vuedraggable'
import Active from '../Toolbar/ElementStylePanel/Active/index.vue'
const mainStore = useMainStore()
const slidesStore = useSlidesStore()
const keyboardStore = useKeyboardStore()
const { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore)
const { slides, slideIndex, currentSlide } = storeToRefs(slidesStore)
const { slides, slideIndex, currentSlide, workList, workItem } = storeToRefs(slidesStore)
const { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore)
const { slidesLoadLimit } = useLoadSlides()
@ -123,6 +127,8 @@ const {
updateSectionTitle,
} = useSectionHandler()
const activeRef = ref()
//
const thumbnailsRef = ref<InstanceType<typeof Draggable>>()
watch(() => slideIndex.value, () => {
@ -145,6 +151,9 @@ watch(() => slideIndex.value, () => {
//
const changeSlideIndex = (index: number) => {
console.log(workItem.value[index],'hasSection');
activeRef.value.clickPPTList(workItem.value[index])
mainStore.setActiveElementIdList([])
if (slideIndex.value === index) return

View File

@ -0,0 +1,291 @@
<template>
<div>
<div style="display: flex;flex-wrap: wrap;">
<el-button size="small" title="活动引用" text style="height: 54px" @click="openList()">
<div class="buttonDiv">
<svg width="26" height="26" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#646473"><path d="M133.36576 308.12842667v407.74314666c0 96.39253333 78.31552 174.76266667 174.76266667 174.76266667h407.74314666c96.39253333 0 174.76266667-78.31552 174.76266667-174.76266667V308.12842667c0-96.39253333-78.31552-174.76266667-174.76266667-174.76266667H308.12842667a174.87189333 174.87189333 0 0 0-174.76266667 174.76266667zM75.09333333 308.12842667A233.19893333 233.19893333 0 0 1 308.12842667 75.09333333h407.74314666A233.19893333 233.19893333 0 0 1 948.90666667 308.12842667v407.74314666A233.19893333 233.19893333 0 0 1 715.87157333 948.90666667H308.12842667A233.19893333 233.19893333 0 0 1 75.09333333 715.87157333V308.12842667z m706.9696 192.07509333c0 24.46677333-5.67978667 48.22357333-16.98474666 71.21578667-11.35957333 22.99221333-26.76053333 43.52682667-46.25749334 61.54922666-19.44234667 18.0224-42.05226667 32.44032-67.61130666 43.25376a207.20298667 207.20298667 0 0 1-81.21002667 16.16554667h-26.54208c-10.37653333 0-21.62688 0.10922667-33.64181333 0.27306667-12.01493333 0.21845333-23.86602667 0.32768-35.66250667 0.32768h-31.9488c-13.1072 0-23.53834667 1.25610667-31.23882667 3.71370666-7.70048 2.51221333-11.35957333 7.91893333-10.92266666 16.16554667 0 6.22592-0.10922667 13.38026667-0.32768 21.46304-0.21845333 8.08277333-0.32768 15.45557333-0.32768 22.06378667 0 10.81344-3.16757333 17.74933333-9.50272 20.86229333-6.33514667 3.11296-14.7456 0.92842667-25.12213334-6.5536-10.92266667-7.42741333-23.37450667-16.27477333-37.41013333-26.43285333a36528.56490667 36528.56490667 0 0 0-126.42986667-91.09504c-10.37653333-7.42741333-15.72864-14.47253333-15.94709333-21.13536-0.27306667-6.60821333 4.36906667-13.65333333 13.9264-21.13536 9.93962667-7.48202667 21.62688-16.27477333 34.95253333-26.43285334 13.38026667-10.15808 27.30666667-20.58922667 41.83381334-31.40266666l42.81685333-31.67573334c14.03562667-10.37653333 26.48746667-19.71541333 37.41013333-28.01664 11.74186667-9.12042667 21.62688-12.61568 29.4912-10.54037333 7.97354667 2.07530667 11.96032 8.73813333 11.96032 19.87925333 0 3.2768 0.10922667 7.3728 0.32768 12.12416a2794.40042667 2794.40042667 0 0 1 1.69301334 43.85450667c0 7.86432 2.62144 12.72490667 7.80970666 14.58176 5.24288 1.85685333 12.34261333 2.83989333 21.40842667 2.83989333 20.42538667-0.43690667 43.30837333-0.65536 68.64896-0.65536h70.66965333c10.43114667 0 20.86229333-2.18453333 31.29344-6.5536 10.37653333-4.36906667 19.93386667-10.10346667 28.56277334-17.36704 8.57429333-7.26357333 15.61941333-15.67402667 21.02613333-25.17674666 5.46133333-9.55733333 8.192-19.6608 8.192-30.47424v-43.52682667c0-16.60245333-0.10922667-32.65877333-0.32768-48.22357333a2840.00256 2840.00256 0 0 1-0.38229333-40.68693334V341.6064c0-9.12042667 3.05834667-16.65706667 9.17504-22.66453333 6.11669333-6.00746667 13.81717333-10.59498667 23.10144-13.70794667 9.28426667-3.11296 19.38773333-4.64213333 30.25578666-4.64213333 10.92266667 0 20.97152 1.41994667 30.25578667 4.36906666 9.28426667 2.83989333 16.98474667 7.09973333 23.10144 12.72490667 6.11669333 5.57056 9.17504 12.56106667 9.17504 20.80768v46.03904c0 10.75882667 0.10922667 22.28224 0.32768 34.51562667 0.27306667 12.23338667 0.38229333 23.92064 0.38229333 35.11637333V500.20352z" p-id="7882"></path></svg>
<div style="margin-top: 10px">活动引用</div>
</div>
</el-button>
<el-button size="small" title="习题训练" text style="height: 54px" @click="showDialog('习题训练')">
<div class="buttonDiv">
<svg width="26" height="26" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#646473"><path d="M473.6 204.8c21.2 0 38.4 17.2 38.4 38.4s-17.2 38.4-38.4 38.4H243.2c-21.2 0-38.4-17.2-38.4-38.4s17.2-38.4 38.4-38.4h230.4z m-51.2 153.6c21.2 0 38.4 17.2 38.4 38.4s-17.2 38.4-38.4 38.4H243.2c-21.2 0-38.4-17.2-38.4-38.4s17.2-38.4 38.4-38.4h179.2zM371.2 512c21.2 0 38.4 17.2 38.4 38.4s-17.2 38.4-38.4 38.4h-128c-21.2 0-38.4-17.2-38.4-38.4S222 512 243.2 512h128z m192-384H153.6c-12.6 0-23 9.1-25.2 21l-0.4 4.6v512c0 12.6 9.1 23 21 25.2l4.6 0.4h257.1c-0.7-8.5-1.1-17-1.1-25.6 0-124 73.5-230.8 179.2-279.4V153.6c0-12.6-9.1-23-21-25.2l-4.6-0.4zM768 460.8H665.6v153.6H512v102.4h153.6v153.6H768V716.8h153.6V614.4H768V460.8zM563.2 51.2c56.6 0 102.4 45.8 102.4 102.4v209c16.6-2.8 33.7-4.2 51.2-4.2 169.7 0 307.2 137.5 307.2 307.2S886.5 972.8 716.8 972.8c-133.7 0-247.5-85.5-289.7-204.8H153.6C97 768 51.2 722.2 51.2 665.6v-512C51.2 97 97 51.2 153.6 51.2h409.6z" p-id="13225"></path></svg>
<div style="margin-top: 10px">习题训练</div>
</div>
</el-button>
<el-button size="small" title="课堂展示" text style="height: 54px" @click="showDialog('课堂展示')">
<div class="buttonDiv">
<svg width="26" height="26" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#646473"><path d="M741.75298 604.605763l3.836774 0.697596 17.43988 3.767014c154.656857 35.089039 260.133252 103.732407 260.133252 194.070985 0 88.455072-101.360583 156.261326-251.134274 191.838682l-9.068737 2.092785-17.370121 3.836774-17.788678 3.487976c-23.927515 4.39485-48.831664 8.092104-74.642686 11.022004l-19.462907 2.023026-24.69487 2.092786-5.022685 0.348797-20.090742 1.325431-10.18489 0.488317-10.25465 0.418557-20.579058 0.697595c-10.324409 0.209279-20.788337 0.348798-31.322025 0.348798l-15.695892-0.139519-15.556373-0.279038-20.648818-0.627836-10.18489-0.418557-10.18489-0.488317-20.160501-1.325431-9.975612-0.697595-19.741944-1.743988a1100.665713 1100.665713 0 0 1-75.968118-9.905852l-18.137475-3.139178-17.788678-3.487976-17.37012-3.767014C105.406635 961.983786 0 893.410178 0 803.141358c0-88.594591 101.360583-156.261326 251.134273-191.9782l8.998979-2.092785 17.43988-3.767014 3.767014-0.697596v93.756796l-10.952245 2.581102-15.207575 3.906533-14.6495 4.046052-13.951904 4.185572c-75.340282 23.857756-121.660604 61.946454-121.660603 89.989781 0 27.206213 43.250903 61.527897 114.196335 85.036855l7.394509 2.371824 14.021663 4.255331 14.6495 4.046052 15.207575 3.906533c8.580421 2.092786 17.43988 4.115812 26.578377 5.999319l13.951904 2.790381 17.021323 3.139178 8.7897 1.39519 17.788678 2.790381 9.068737 1.255672 18.556033 2.302064 14.161182 1.604469 14.370462 1.39519 19.532665 1.53471a1139.731044 1139.731044 0 0 0 142.867498 1.255671l19.881463-1.255671 19.532666-1.53471c8.580421-0.767355 17.021323-1.674228 25.392466-2.581102l12.417194-1.53471 18.276995-2.441583 17.858437-2.790381 8.71994-1.39519 17.091082-3.139178c9.417535-1.813748 18.486273-3.697255 27.415492-5.720281l13.11479-3.069419 15.207575-3.906533 14.649499-4.046052 13.951904-4.185572c75.340282-23.857756 121.590844-59.365352 121.590845-87.408679 0-27.206213-43.250903-64.178759-114.196335-87.617957l-7.39451-2.371824-14.021663-4.255331-14.649499-4.115811-15.207576-3.836774-10.952245-2.581102V604.605763zM451.204578 588.072757l121.660604 69.82928-131.078139 86.153008 9.417535-155.982288z m280.921589-484.131072l121.660603 69.82928-257.552149 443.810069-121.590844-69.899039 257.48239-443.74031zM842.904285 6.278357l40.530281 23.22992a46.459841 46.459841 0 0 1 17.160842 63.690442l-23.439198 40.321003L755.565365 63.620683l23.36944-40.321003a46.948157 46.948157 0 0 1 63.96948-17.021323z" p-id="59383"></path></svg>
<div style="margin-top: 10px">课堂展示</div>
</div>
</el-button>
<el-button size="small" title="常规作业" text style="height: 54px;margin-left: 0" @click="showDialog('常规作业')">
<div class="buttonDiv">
<svg width="26" height="26" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#646473"><path d="M901.705143 511.926857h-55.954286a8.045714 8.045714 0 0 1-8.045714-8.045714V183.881143H181.686857v656.091428H501.76c4.388571 0 8.045714 3.510857 8.045714 7.899429v56.027429c0 4.388571-3.657143 8.045714-8.045714 8.045714H141.750857a31.963429 31.963429 0 0 1-32.036571-32.036572V143.872c0-17.627429 14.336-31.963429 32.036571-31.963429H877.714286c17.700571 0 32.036571 14.336 32.036571 31.963429V503.954286c0 4.388571-3.657143 8.045714-8.045714 8.045714zM731.428571 911.945143a36.571429 36.571429 0 0 1-36.571428-36.571429v-109.714285H585.142857a36.571429 36.571429 0 0 1 0-73.142858h109.714286v-109.714285a36.571429 36.571429 0 0 1 73.142857 0v109.714285H877.714286a36.571429 36.571429 0 1 1 0 73.142858h-109.714286v109.714285a36.571429 36.571429 0 0 1-36.571429 36.571429z" p-id="22184"></path></svg>
<div style="margin-top: 10px">常规作业</div>
</div>
</el-button>
</div>
<Divider />
<!-- 作业列表 -->
<div class="c-apt-r">
<!-- 显示-作业内容 -->
<template v-for="(item, index) in workList">
<div class="item">
<div class="item-title">
<el-tag :type="getTagType(item.worktype) || 'primary'">{{item.worktype}}</el-tag>
<el-tooltip :content="item.title||item.uniquekey" placement="top">
<div class="tt">{{item.title||item.uniquekey}}</div>
</el-tooltip>
<el-button class="btn-del" type="danger" link @click="handleRemoveDemoActivityClassWork(item)">删除</el-button>
</div>
</div>
</template>
</div>
<!-- // -->
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="80%">
<NewClassTsakAssign :currentCourse='currentCourse'/>
</el-dialog>
<!-- 活动引用 -->
<el-dialog
v-loading="tasklist_loading"
v-model="activeVisible"
append-to-body
:show-close="false"
width="40%"
@selection-change="handleSelectionChange">
<el-table :data="taskList" style="width: 100%" height="500">
<el-table-column type="selection" :selectable="selectable" width="55" />
<el-table-column prop="evaltitle" label="活动名称" width="150" />
<el-table-column prop="worktype" label="活动类型" width="120" sortable>
<template #default="scope">
<el-tag :type="getTagType(scope.row.worktype) || 'primary'">{{ scope.row.worktype }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="timestamp" label="创建时间" sortable/>
</el-table>
<template #footer>
<el-button @click="activeVisible = false"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onBeforeMount, defineExpose } from 'vue'
import Divider from '../../../../../components/Divider.vue'
import {listEntpcoursefile} from '@/api/education/entpcoursefile'
import {homeworklist} from '@/api/teaching/classwork'
import { processList } from "@/hooks/useProcessList";
import { listEntpcoursework } from "@/api/classTask/index";
import { ElMessageBox } from 'element-plus'
import NewClassTsakAssign from '@/views/classTask/newClassTaskAssign/index.vue'
import { sessionStore } from '@/utils/store'
import { useGetHomework } from '@/hooks/useGetHomework'
const currentCourse = reactive({
textbookId:0,
levelFirstId:0,
levelSecondId:0,
coursetitle:'',
node:{},
id:1,
worktype:'',
})
const dataList = ref([])
const dialogVisible = ref(false)
const tasklist_loading = ref(false)
//
const taskList = ref([])
//
const activeVisible = ref(false)
const params = reactive({
parentid:14766,
pageSize:500,
orderby:'fileidx'
})
const type = ref([
{
label:'习题训练',
value:'danger'
},
{
label:'课堂展示',
value:'success'
},
{
label:'常规作业',
value:'primary'
},
])
//
const workList = ref([])
const selectable = (row,index) => {
console.log(row,index,'row,index');
return true
}
const clickPPTList = (item) => {
console.log(item,'点击了')
workList.value = []
let datacontent = item.datacontent;
let pptJson = "";
if(typeof datacontent === 'string') pptJson = JSON.parse(datacontent)
if(pptJson&&pptJson[0]&&pptJson[0].classworkList) {
homeworklist({ids:pptJson[0].classworkList, pageSize: 100}).then( async res => {
await formatClassWorkFile(res.rows)
})
}
}
const formatClassWorkFile = async (postData) => {
return new Promise(async (resolve, reject)=>{
for (let i = 0; i < postData.length; i++) {
let item = postData[i];
switch (item.worktype) {
case '框架梳理': {
}
break;
case '习题训练': {
item.entpcourseworklistarray = item.entpcourseworklist?JSON.parse('['+item.entpcourseworklist+']'):[];
let workIds = item.entpcourseworklistarray.map(items=>items.id).join(',')
let ress = await listEntpcoursework({ids:workIds})
processList(ress.rows)
item.workShowList = ress.rows
}
break;
case '课堂展示': {
item.base64 = JSON.parse(item.workcodes).base64
}
break;
case '常规作业': {
item.prevData = JSON.parse(item.workcodes)
}
}
workList.value.push(item)
}
resolve()
})
}
//
const handleRemoveDemoActivityClassWork = (item) => {
ElMessageBox.confirm('是否确认删除?')
.then(function () {
workList.value.splice(workList.value.indexOf(item), 1);
})
.catch(() => {});
}
// tag
const getTagType = (worktype) => {
return type.value.find(item => item.label == worktype).value
}
//
const initHomeWork = async()=> {
tasklist_loading.value = true;
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
taskList.value = res;
tasklist_loading.value = false;
}
//
const handleSelectionChange = (val) => {
console.log(val,'多选')
}
//
const showDialog = (item) => {
currentCourse.worktype = item
dialogVisible.value = true
}
const openList = () => {
activeVisible.value = true
initHomeWork()
}
//
const save = () => {
console.log('添加了')
activeVisible.value = false
}
onMounted(() => {
// console.log(sessionStore.get('subject.curBook'),'curBook');
// console.log(sessionStore.get('subject.subjectTree'),'subjectTree');
// console.log(sessionStore.get('subject.bookList'),'bookList');
console.log(sessionStore.get('subject.curNode'),'curNode');
const curNode = sessionStore.get('subject.curNode')
currentCourse.textbookId = curNode.rootid
currentCourse.levelFirstId = curNode.parentNode.id
currentCourse.levelSecondId = curNode.id
currentCourse.coursetitle = curNode.itemtitle,
currentCourse.node = curNode
listEntpcoursefile(params).then((res) => {
dataList.value = [...res.rows]
})
})
defineExpose({
clickPPTList
})
</script>
<style scoped lang="scss">
.buttonDiv{
margin-top: 4px;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
}
// (apt)-
.c-apt-r{
flex:1;
overflow: auto;
.item{
position: relative;
margin-top: 5px;
.item-title{
display: flex;
align-items: center;
.tt{
flex: 1;
padding-left: 10px;
cursor: default;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 13px;
color: #606266;
}
.btn-del{
margin-right: 10px;
}
}
.item-body{
position: relative;
border: 1px solid silver;
padding: 10px;
background: #fff;
border-radius: 3px;
margin: 5px 10px;
cursor: default;
&:hover{
border-color: var(--el-color-primary);
.el-text{
--el-text-color: var(--el-color-primary);
}
.el-tag{
--el-tag-bg-color: var(--el-color-primary);
--el-tag-border-color: var(--el-color-primary);
--el-tag-text-color: var(--el-color-white);
}
}
.c-icon-info{
position: absolute;
top: -5px;
right: -5px;
}
}
.item-divider{
margin: 5px 0;
margin-left: 10px;
width: calc(100% - 20px);
--el-border-color: var(--current-color);
}
}
}
</style>

View File

@ -25,6 +25,8 @@ import SlideDesignPanel from './SlideDesignPanel.vue'
import SlideAnimationPanel from './SlideAnimationPanel.vue'
import MultiPositionPanel from './MultiPositionPanel.vue'
import SymbolPanel from './SymbolPanel.vue'
//
import SymbolActivePanel from './ElementStylePanel/Active/index.vue'
import Tabs from '../../../components/Tabs.vue'
interface ElementTabs {
@ -54,6 +56,7 @@ const slideTabs = [
{ label: '设计', key: ToolbarStates.SLIDE_DESIGN },
{ label: '切换', key: ToolbarStates.SLIDE_ANIMATION },
{ label: '动画', key: ToolbarStates.EL_ANIMATION },
{ label: '活动', key: ToolbarStates.EL_ACTIVE },
]
const multiSelectTabs = [
{ label: '样式', key: ToolbarStates.EL_STYLE },
@ -86,6 +89,7 @@ const currentPanelComponent = computed(() => {
[ToolbarStates.SLIDE_ANIMATION]: SlideAnimationPanel,
[ToolbarStates.MULTI_POSITION]: MultiPositionPanel,
[ToolbarStates.SYMBOL]: SymbolPanel,
[ToolbarStates.EL_ACTIVE]: SymbolActivePanel,//
}
return panelMap[toolbarState.value] || null
})

View File

@ -36,13 +36,13 @@ export const processList = (row, aloneOption=false) => {
row[i].method = jjj.method
row[i].discuss = jjj.discuss
//row[i].discusscollapse = false;
if (row[i].examdate !== null && row[i].examdate !== undefined) {
if (row[i].examdate && row[i].examdate != "") {
row[i].examdate = row[i].examdate.substring(0, 10)
}
// 具体题型数据结构处理
if (row[i].worktype == '复合题') {
// 旧类型
// 复合题 - 旧格式
if (row[i].title.indexOf('!@#$%') !== -1) {
// 1.选项解析替换
const options = JSON.parse(row[i].workdesc)
@ -129,7 +129,9 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = answer
} else {
// 处理[题干显示] - 不再需要处理
// 复合题 - 现格式
// 处理[题干显示] - 不再需要处理(头部已处理)
// row[i].titleFormat = row[i].title; // 仅占位提示
/**
@ -222,6 +224,7 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = workAnswerHtml
}
} else if (
/** 主观题/非基础题(其中主要为第三方的各类解答题) */
row[i].worktype == '主观题' ||
(row[i].worktype !== '单选题' &&
row[i].worktype !== '多选题' &&
@ -236,7 +239,7 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = JSON.parse(row[i].workanswer)
}
} else {
// 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里)
// 基础题: 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里)
// 通用选项结构 ['ABC123','ABC123'] | ['ABC123','ABC123'] | [](填空题无选项) | [](判断题无选项)
let workDescArr = []
if (

View File

@ -1,6 +1,6 @@
<template>
<div class="page">
<div class="page-top">
<div class="page-top" v-if="!isShow">
<div class="page-top-left">
<el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
<el-button type="success" @click="handleTaskAssignToAllClass()">批量推送</el-button>
@ -10,7 +10,7 @@
</div>
</div>
<div class="page-resource">
<div class="page-left">
<div class="page-left" v-if="!isShow">
<el-table
ref="taskTable"
v-loading="tasklist_loading"
@ -154,7 +154,9 @@ const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance()
const props = defineProps({
currentCourse: Object,
})
const isShow = ref(false)
const propsQueryCourseObj = route.query.courseObj;//
const courseObj = reactive({
@ -186,16 +188,48 @@ const fileLoading = ref(false); // 常规作业loading
onMounted(() => {
currentRow.value = {id:0};
console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId //
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId //
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/)
courseObj.node = JSON.parse(propsQueryCourseObj).node; //
if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId //
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId //
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/)
courseObj.node = JSON.parse(propsQueryCourseObj).node; //
}
}else{
if(props.currentCourse){
courseObj.textbookId = props.currentCourse.textbookId //
courseObj.levelFirstId = props.currentCourse.levelFirstId //
courseObj.levelSecondId = props.currentCourse.levelSecondId //
courseObj.coursetitle = props.currentCourse.coursetitle // (/)
courseObj.node = props.currentCourse.node; //
classWorkForm.worktype = props.currentCourse.worktype
currentRow.value = {
id:props.currentCourse.id,
worktype:props.currentCourse.worktype
}
isShow.value = true;
}else{
isShow.value = false;
}
}
initHomeWork();
})
watch(() => props.currentCourse, (newVal, oldVal) => {
if(newVal){
courseObj.textbookId = newVal.textbookId //
courseObj.levelFirstId = newVal.levelFirstId //
courseObj.levelSecondId = newVal.levelSecondId //
courseObj.coursetitle = newVal.coursetitle // (/)
courseObj.node = newVal.node; //
classWorkForm.worktype = newVal.worktype
currentRow.value = {
id:props.currentCourse.id,
worktype:props.currentCourse.worktype
}
}
console.log(newVal,'newval');
},{deep:true})
//------------
const handleItemClick = (itemName) => {
console.log('itemName', itemName);

View File

@ -19,7 +19,7 @@
</el-col>
<el-col :span="7">
<el-form-item label="年份" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择">
<el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
@ -40,7 +40,7 @@
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
</el-col>
<el-col :span="5">
<el-button type="primary" @click="goToQuestUpload()">添加习题</el-button>
<el-button v-if="!props.isHtml2canvas" type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row>
<!-- 习题表格 -->
@ -58,9 +58,9 @@
</div>
</template>
<template #default="scope">
<div @click="showExamAnalyseDrawer(scope.row)">
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
<div @click="showExamAnalyseDrawer(scope.row)" :id=" `screenshot-target-${scope.row.id}` " style="padding: 5px;">
<div style="overflow: hidden; text-overflow: ellipsis; padding: 2px;" v-html="scope.row.titleFormat"></div>
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px; padding: 2px;" v-html="scope.row.workdescFormat"></div>
<el-col :span="24" style="display: flex">
<div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div>
<div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div>
@ -70,7 +70,8 @@
</el-table-column>
<el-table-column width="100">
<template #default="scope">
<div>
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
<div v-else>
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
<div style="padding: 2px;"></div>
<el-button type="warning" @click="handleImportSingleDlg(scope.row)">纠错</el-button>
@ -117,6 +118,7 @@
import { Search } from '@element-plus/icons-vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import html2canvas from 'html2canvas';
import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork'
import { listEvaluationclue } from '@/api/classTask'
@ -136,7 +138,7 @@ const router = useRouter()
// emit
const emit = defineEmits(['addQuiz'])
let emit = defineEmits(['addQuiz', 'addQuizImgBs64'])
const { proxy } = getCurrentInstance()
const userStore = useUserStore().user
const {
@ -150,6 +152,10 @@ const props = defineProps({
type: Object,
default: () => ({})
},
isHtml2canvas: {//
type: Boolean,
default: () => false
},
})
const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
@ -440,6 +446,22 @@ const handleDelete = async(item, index) => {
// ElMessage('')
// }
};
/**
* 把该题区域id 获取为截屏区域
* @param id 试题id
*/
const captureScreenshot = (id) => {
const targetElement = document.getElementById('screenshot-target-' + id);
html2canvas(targetElement).then(canvas => {
// canvasURL
const screenshotUrl = canvas.toDataURL('image/png');
//
// console.log(screenshotUrl);
emit('addQuizImgBs64', screenshotUrl);
});
}
//
const debounceQueryData = debounce(() => {
console.log("防抖 加载数据中...")

View File

@ -0,0 +1,115 @@
<template>
<div class="page">
<div class="page-resource">
<div class="page-center">
<el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
<SearchQuestion :bookobj="courseObj" :isHtml2canvas="true" @addQuizImgBs64="handleaddQuizImgBs64" />
</el-tab-pane>
<el-tab-pane label="校本题库" name="校本题库" class="prepare-center-xbtk">
<SchoolQuestion />
</el-tab-pane>
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
<MyQuestion :bookobj="courseObj" :isHtml2canvas="true" @addQuizImgBs64="handleaddQuizImgBs64"/>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script setup>
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue'
import MyQuestion from '@/views/classTask/newClassTaskAssign/myQuestion/index.vue'
import SchoolQuestion from '@/views/classTask/newClassTaskAssign/schoolQuestion/index.vue'
import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
import { sessionStore } from '@/utils/store'
import { useRouter, useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const emit = defineEmits(['update']);
const courseObj = reactive({
// : id,id,id,
textbookId: '',
levelFirstId: '',
levelSecondId: '',
coursetitle:'',
node: null, //
//
})
const activeAptTab = ref("自主搜题");
onMounted(() => {
const curNode = sessionStore.get('subject.curNode')
courseObj.textbookId = curNode.rootid
courseObj.levelFirstId = curNode.parentNode.id
courseObj.levelSecondId = curNode.id
courseObj.coursetitle = curNode.itemtitle,
courseObj.node = curNode
})
const handleaddQuizImgBs64 = (quizbs64) => {
emit('update', quizbs64)
}
defineExpose({
})
</script>
<style scoped lang="scss">
.page {
height: 100%;
.page-resource {
user-select: none;
height: calc(100% - 55px);
display: flex;
flex-direction: row;
flex-wrap: nowrap;
flex: 1;
:deep(.el-tabs__nav) {
.el-tabs__item{
font-weight: bold;
font-size: 18px;
}
}
}
.page-center{
flex: 1;
//min-width: calc(100% - 675px);
height: 100%;
padding: 0 5px;
margin: 0 5px;
overflow: hidden;
border-radius: 10px;
background-color: white;
.prepare-center-zzst{
height: 100%;
display: flex;
flex-direction: column;
}
.prepare-center-xbtk{
height: 100%;
}
.prepare-center-grst{
height: 100%;
}
.upload-homework{
padding: 20px;
box-sizing: border-box;
}
}
}
</style>

View File

@ -71,9 +71,9 @@
</div>
</template>
<template #default="scope">
<div @click="showExamAnalyseDrawer(scope.row)">
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
<div @click="showExamAnalyseDrawer(scope.row)" :id=" `screenshot-target-${scope.row.id}` " style="padding: 5px;">
<div style="overflow: hidden; text-overflow: ellipsis; padding: 2px;" v-html="scope.row.titleFormat"></div>
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px; padding: 2px;" v-html="scope.row.workdescFormat"></div>
<el-col :span="24" style="display: flex">
<div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div>
<div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div>
@ -83,7 +83,8 @@
</el-table-column>
<el-table-column align="left" width="100">
<template #default="scope">
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
<el-button v-else type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
</template>
</el-table-column>
</el-table>
@ -104,7 +105,7 @@
</template>
<script setup>
import { Search } from '@element-plus/icons-vue'
import html2canvas from 'html2canvas';
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
@ -122,7 +123,7 @@ import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask'
// emit
const emit = defineEmits(['addQuiz'])
let emit = defineEmits(['addQuiz', 'addQuizImgBs64'])
const { proxy } = getCurrentInstance()
const userStore = useUserStore().user
const {
@ -136,6 +137,10 @@ const props = defineProps({
type: Object,
default: () => ({})
},
isHtml2canvas: {//
type: Boolean,
default: () => false
},
})
const entpCourseWorkPointList = ref([
@ -427,6 +432,20 @@ const getPaginationList = ( page, limit ) => {
// ElMessage('')
// }
};
/**
* 把该题区域id 获取为截屏区域
* @param id 试题id
*/
const captureScreenshot = (id) => {
const targetElement = document.getElementById('screenshot-target-' + id);
html2canvas(targetElement).then(canvas => {
// canvasURL
const screenshotUrl = canvas.toDataURL('image/png');
//
// console.log(screenshotUrl);
emit('addQuizImgBs64', screenshotUrl);
});
}
//

View File

@ -16,6 +16,16 @@
<el-table-column align="center" prop="worktype" width="100"></el-table-column>
<el-table-column align="center" prop="worktag" width="120"></el-table-column>
</el-table>
<!-- 分页-->
<div style="height: 48px;">
<el-pagination
v-show="paginationParams.total > 0"
v-model:page="paginationParams.pageNum"
v-model:limit="paginationParams.pageSize"
:total="paginationParams.total"
:style="{ position: 'relative', 'padding': '8px 20px 0 0' }"
@change="changePageNum" />
</div>
<!-- 试题详细信息 -->
<examDetailsDrawer ref="examDetailsDrawerRef"></examDetailsDrawer>
@ -54,11 +64,13 @@ const { proxy } = getCurrentInstance()
const props = defineProps({
listExamQuestion: {type: Array},
loading: {type: Boolean}
loading: {type: Boolean},
paginationParams: {type: Object},
})
const activeExamInfoDrawer = ref(false);
const activeExam = ref({});
const emit = defineEmits(['updatePageNum'])
const showExamAnalyseDrawer = (row) => {
nextTick(() => {
@ -69,13 +81,17 @@ const showExamAnalyseDrawer = (row) => {
})
}
const changePageNum = (pageNum) => {
emit('updatePageNum', pageNum);
}
</script>
<style lang="scss" scoped>
.table-main {
width: 100%;
height: 100%;
height: calc(100% - 48px);
text-align: left;
.main-title {

View File

@ -47,10 +47,13 @@
</el-select>
</div>
<div :style="{'width': (viewportWidth - 400) + 'px','height': (viewportHeight-38) + 'px','overflow-y': 'auto'}">
<!-- <div :style="{'width': (viewportWidth - 400) + 'px','height': (viewportHeight-38) + 'px','overflow-y': 'auto'}"> -->
<div style="width: 100%; height: 100%; overflow-y: auto; border-radius: 10px;">
<examReview
:loading="loading"
:listExamQuestion="listExamQuestion"
:paginationParams="paginationParams"
@updatePageNum="updatePageNum"
v-if="curTask.viewkey=='真题回顾' "
/>
@ -77,12 +80,15 @@ import ChooseTextbook from '@/components/choose-textbook/index.vue'
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
import { processList } from '@/hooks/useProcessList'
import { JYApiListCT} from "@/utils/examQuestion/jyeoo"
import useClassTaskStore from '@/store/modules/classTask'
import examReview from './container/examReview.vue'
import pointAnalysis from './container/pointAnalysis.vue'
import examMocks from './container/examMocks.vue'
import { ElMessage } from 'element-plus'
const classTaskStore = useClassTaskStore();
const {proxy} = getCurrentInstance();
const sourceStore = useResoureStore();
const viewportHeight = ref(0);
@ -91,6 +97,11 @@ const viewportWidth = ref(0);
const curNode = ref({});
//
const listExamQuestion = ref([]);
const paginationParams = reactive({
pageNum: 1,
pageSize: 10,
total: 0,
});
const loading = ref(false);
const curTask = reactive({
viewkey: '真题回顾',
@ -107,6 +118,22 @@ const listWorkType = ref([{
value: 0,
}]);
/**
* @desc: 翻页
* @return: {*}
* @param {*} pageNum
*/
const updatePageNum = (pageNum) => {
paginationParams.pageNum = pageNum;
queryExamQuestionByParams();
}
/**
* @desc: 具体获取试题及格式化
* @return: {*}
* @param {*} params
*/
const getCourseWorkList = async (params) => {
const res = await listEntpcourseworkNew(params);
if(res.data == null) {
@ -115,7 +142,14 @@ const getCourseWorkList = async (params) => {
return;
}
listExamQuestion.value = res.data;
// queryParams.total = res.total;
//
const total = parseInt(res.msg)
if (!isNaN(total)) {
paginationParams.total = total;
} else {
console.error('无法将 res.msg 转换为数字');
paginationParams.total = 0; //
}
//
processList(listExamQuestion.value);
}
@ -132,7 +166,8 @@ const getData = async (data) => {
loading.value = true;
// 1.
getWorkType(data.node);
//getWorkType(data.node);
listWorkType.value = classTaskStore.entpCourseWorkTypeList;
// 2.
curNode.value = data.node;
@ -166,6 +201,8 @@ const getData = async (data) => {
edusubject: curNode.value.edusubject,
edustage: curNode.value.edustage,
sectionName: curNode.value.itemtitle,
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
}
await getCourseWorkList(params);
loading.value = false;
@ -181,6 +218,7 @@ const changeTaskView = (item, key) => {
curTask.viewkey = item;
}
// 使, classTaskStore
const getWorkType = async (data) => {
const selName = `${data.edustage}${data.edusubject}`
const curName = `${curNode.value.edustage}${curNode.value.edusubject}`
@ -231,6 +269,8 @@ const queryExamQuestionByParams = async () => {
edusubject: curNode.value.edusubject,
edustage: curNode.value.edustage,
sectionName: curNode.value.itemtitle,
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
}
await getCourseWorkList(params);
loading.value = false;

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-model="isDialog" :show-close="false" width="900" destroy-on-close>
<el-dialog v-model="isDialog" :show-close="false" width="900" append-to-body destroy-on-close>
<template #header>
<div class="custom-header flex">
<span>选择{{ title }}</span>
@ -15,8 +15,10 @@
</div>
<div class="content-list">
<ul>
<li v-for="(item, index) in fileList" :class="activeIndex == index ? 'li-active' : ''" @click="clickItem(index, item)">
<li v-for="(item, index) in fileList" :class="activeIndex == index ? 'li-active' : ''"
@click="clickItem(index, item)">
<el-image class="img" :src="url" />
<el-button type="primary" class="prev-btn" @click.stop="onPrevItem(item)">预览</el-button>
<el-text truncated>{{ item.fileName }}</el-text>
</li>
</ul>
@ -24,8 +26,8 @@
</div>
<template #footer>
<div class="dialog-footer">
<el-upload class="upload-demo" :action="uploadFileUrl" :limit="1" :show-file-list="false"
:headers="headers" :on-success="onSuccess">
<el-upload class="upload-demo" :action="uploadFileUrl" :limit="1" :show-file-list="false" :headers="headers"
:on-success="onSuccess">
<el-button type="primary">上传</el-button>
</el-upload>
<div>
@ -37,6 +39,31 @@
</div>
</template>
</el-dialog>
<el-dialog v-model="prevVisible" fullscreen :show-close="false" class="prev-dialog">
<template #header>
<div class="custom-header flex">
<span>预览</span>
<i class="iconfont icon-guanbi" @click="prevVisible = false"></i>
</div>
</template>
<div style="height: calc(100vh - 120px);">
<template v-if="getFileSuffix(prevItem.fileUrl) == 'pdf'">
<iframe :src="prevItem.fileUrl"
frameborder="0" width="100%" height="100%"></iframe>
</template>
<template v-else>
<el-image :src="prevItem.fileUrl" style="height:100%"/>
</template>
</div>
<template #footer>
<div class="dialog-footer">
<div></div>
<el-button type="primary" @click="prevVisible = false">
关闭
</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
@ -47,6 +74,7 @@ import { sessionStore } from '@/utils/store'
import { dataSetJson } from '@/utils/comm.js'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
import { getFileSuffix } from '@/utils/ruoyi.js'
import emitter from '@/utils/mitt';
const userInfo = useUserStore().user
@ -56,6 +84,7 @@ const headers = ref({ Authorization: "Bearer " + getToken() });
const url = 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F11044b08-04c1-41a0-a453-1fd20b58a614%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1732953359&t=7ab1d1b3a903db85b1149914407aea35'
const isDialog = defineModel()
const prevVisible = ref(false)
const props = defineProps({
modeType: {
@ -99,21 +128,20 @@ const activeIndex = ref(0)
const dataset_id = ref('')
//
const onSuccess = async (response) =>{
console.log(response,'response')
const onSuccess = async (response) => {
let data = {
url: response.url,
dataset_id: dataset_id.value
}
const res = await completion(data)
if(res.data.code != 200) return
if (res.data.code != 200) return
let docData = {
fileUrl: response.url,
fileId: response.file.id,
fileName: response.file.fileName,
filesize: response.file.fileSize,
datasetId: dataset_id.value,
datasetId: dataset_id.value,
docId: res.data.document_id,
edustage: curNode.edustage,
edusubject: curNode.edusubject
@ -127,25 +155,29 @@ const curNode = reactive({})
const fileList = ref([])
const curFile = reactive({})
const getList = () =>{
const getList = () => {
docList({
userId: userInfo.userId,
dataset_id: dataset_id.value
}).then( res =>{
dataset_id: dataset_id.value
}).then(res => {
fileList.value = [...res.rows]
Object.assign(curFile, fileList.value[0])
Object.assign(curFile, fileList.value[0])
})
}
const clickItem = (index, item) => {
activeIndex.value = index
Object.assign(curFile, item)
emitter.emit('curFile',item)
Object.assign(curFile, item)
emitter.emit('curFile', item)
}
const prevItem = reactive({})
const onPrevItem = (item) => {
Object.assign(prevItem, item)
prevVisible.value = true
}
onMounted(() =>{
onMounted(() => {
let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data);
@ -155,7 +187,6 @@ onMounted(() =>{
})
</script>
<style lang="scss" scoped>
.custom-header {
justify-content: space-between;
@ -192,6 +223,8 @@ onMounted(() =>{
overflow: hidden;
margin-right: 20px;
margin-bottom: 10px;
position: relative;
overflow: hidden;
.img {
width: 100%;
@ -203,6 +236,10 @@ onMounted(() =>{
&:hover {
background: #E0EAFF;
}
&:hover .prev-btn {
transform: translate(-50%, -50%)
}
}
.li-active {
@ -212,9 +249,20 @@ onMounted(() =>{
}
}
}
.dialog-footer{
.dialog-footer {
display: flex;
align-items: center;
justify-content: space-between;
}
.prev-btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) translateY(-110px);
/* 按钮初始位置在容器外 */
transition: transform 0.3s ease-in-out;
/* 设置过渡效果 */
}
</style>

View File

@ -14,8 +14,14 @@ const pdfUrl = ref('')
onMounted(async () =>{
await nextTick()
const { fileurl } = sessionStore.get('subject.curBook')
pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt','.pdf')
let data = sessionStore.get('subject.curBook')
let fileurl = data.fileurl
if(fileurl == ''){
fileurl = `${data.edustage}-${data.edusubject}-课标.txt`
}
pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf')
})
</script>

View File

@ -197,19 +197,6 @@ const getResourceList = async () => {
// HTTP
const HTTP_SERVER_API = (type, params = {}) => {
switch (type) {
case 'addSmarttalk': { //
const def = {
fileId: '', // id - Entpcoursefile id
fileFlag: 'aptist',
fileShowName: courseObj.coursetitle + '.aptist',
textbookId: courseObj.textbookId,
levelFirstId: courseObj.levelFirstId,
levelSecondId: courseObj.levelSecondId,
fileSource: '个人',
fileRoot: '备课'
}
return API_smarttalk.creatAPT({...def, ...params})
}
case 'addEntpcourse': { //
const node = courseObj.node || {}
if (!node) return msgUtils.msgWarning('请选择章节?')
@ -292,8 +279,6 @@ const handleAll = async(type, row) =>{
}
// ppt-(slide)
await HTTP_SERVER_API('addEntpcoursefile', params)
// -Smarttalk
await HTTP_SERVER_API('addSmarttalk',{fileId: id})
//
await getResourceList()
} else {

View File

@ -210,13 +210,14 @@ emitter.on('changeResult', (item) => {
const HTTP_SERVER_API = (type, params = {}) => {
switch (type) {
case 'addSmarttalk': { //
const node = courseObj.node || {}
const def = {
fileId: '', // id - Entpcoursefile id
fileFlag: 'aptist',
fileShowName: courseObj.coursetitle + '.aptist',
textbookId: courseObj.textbookId,
levelFirstId: courseObj.levelFirstId,
levelSecondId: courseObj.levelSecondId,
fileShowName: node.itemtitle + '.aptist',
textbookId: node.rootid,
levelFirstId: node.parentid||node.id,
levelSecondId: node.parentid && node.id,
fileSource: '个人',
fileRoot: '备课'
}
@ -314,6 +315,7 @@ const toRousrceUrl = async(o) => {
const curNode = reactive({})
onMounted(() => {
let data = sessionStore.get('subject.curNode')
console.log('data', sessionStore)
Object.assign(curNode, data);
courseObj.node = data