Compare commits

..

6 Commits

Author SHA1 Message Date
lyc cb5445f9a9 Merge branch 'main' into lyc-dev 2024-12-06 16:40:03 +08:00
baigl 4010411c9f Merge pull request 'baigl' (#92) from baigl into main
Reviewed-on: #92
2024-12-06 15:30:38 +08:00
白了个白 da1c80406f Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-06 15:29:35 +08:00
白了个白 e3199b43de 1 2024-12-06 15:26:22 +08:00
zhengdegang e5be55f12e Merge pull request '弹窗进度条' (#91) from zdg_dev into main
Reviewed-on: #91
2024-12-06 14:15:42 +08:00
zdg 209ab7fafc 弹窗进度条 2024-12-06 14:15:01 +08:00
5 changed files with 71 additions and 12 deletions

View File

@ -113,16 +113,14 @@
/> />
</Modal> </Modal>
<Modal
v-model:visible="classWorkTaskVisible" <el-dialog v-model="classWorkTaskVisible" append-to-body :show-close="false" width="70%">
:width="880"
>
<QuestToPPTist <QuestToPPTist
class="class-work-task-modal" class="class-work-task-modal"
@close="classWorkTaskVisible = false" @close="classWorkTaskVisible = false"
@update="data => { onhtml2canvas(data); classWorkTaskVisible = false }" @update="data => { onhtml2canvas(data); classWorkTaskVisible = false }"
/> />
</Modal> </el-dialog>
<Modal <Modal
v-model:visible="materiaVisible" v-model:visible="materiaVisible"
@ -390,7 +388,7 @@ const insertMaterial = (item: MaterialParams) =>{
} }
} }
.class-work-task-modal{ .class-work-task-modal{
height: 80vh; height: 70vh;
} }
@media screen and (width <= 1200px) { @media screen and (width <= 1200px) {

View File

@ -154,13 +154,15 @@ const topImgWrapperPositionStyle = computed(() => {
const topImgPositionStyle = computed(() => { const topImgPositionStyle = computed(() => {
const bottomWidth = imgPosition.value.width const bottomWidth = imgPosition.value.width
const bottomHeight = imgPosition.value.height const bottomHeight = imgPosition.value.height
console.log("底层图片位置大小(遮罩区域图片)", imgPosition.value)
const { top, left, width, height } = topImgWrapperPosition.value const { top, left, width, height } = topImgWrapperPosition.value
console.log("width", ((bottomWidth / width * 100) - (left * (100 / width))) + '%')
console.log("height", bottomHeight / height * 100 + '%')
return { return {
left: -left * (100 / width) + '%', left: -left * (100 / width) + '%',
top: -top * (100 / height) + '%', top: -top * (100 / height) + '%',
width: bottomWidth / width * 100 + '%', width: ((bottomWidth / width * 100) - (left * (100 / width))) + '%' ,
height: bottomHeight / height * 100 + '%', height: bottomHeight / height * 100 + '%',
} }
}) })
@ -228,6 +230,7 @@ const updateRange = () => {
width: parseInt(topImgPositionStyle.value.width), width: parseInt(topImgPositionStyle.value.width),
height: parseInt(topImgPositionStyle.value.height), height: parseInt(topImgPositionStyle.value.height),
} }
console.log('retPosition', retPosition)
const widthScale = 100 / retPosition.width const widthScale = 100 / retPosition.width
const heightScale = 100 / retPosition.height const heightScale = 100 / retPosition.height
@ -475,7 +478,7 @@ const scaleClipRange = (e: MouseEvent, type: OperateResizeHandlers) => {
isMouseDown = false isMouseDown = false
document.onmousemove = null document.onmousemove = null
document.onmouseup = null document.onmouseup = null
console.log('----------------------------------')
updateRange() updateRange()
setTimeout(() => isSettingClipRange.value = false, 0) setTimeout(() => isSettingClipRange.value = false, 0)

View File

@ -68,7 +68,7 @@ defineExpose({
.page-resource { .page-resource {
user-select: none; user-select: none;
height: calc(100% - 55px); height: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;

View File

@ -0,0 +1,33 @@
<template>
<el-dialog v-model="open" v-bind="dAttrs">
<el-progress type="dashboard" v-bind="$attrs.pg" />
</el-dialog>
</template>
<script setup>
//
import { computed, useAttrs } from 'vue'
const attrs = useAttrs()
const props = defineProps({
visible: { //
type: Boolean,
default: false
},
})
//
const emit = defineEmits(['update:visible'])
// -
const open = computed({
get: () => props.visible,
set: val => emit('update:visible', val)
})
//
const dAttrs = computed(() => {
const attrsNew = { ...attrs }
delete attrsNew.pg
return attrsNew
})
</script>
<style lang="scss" scoped>
</style>

View File

@ -50,6 +50,7 @@
<EditDialog v-model="isEdit" :item="curItem" /> <EditDialog v-model="isEdit" :item="curItem" />
<AdjustDialog v-model="isAdjust" :item="curItem" /> <AdjustDialog v-model="isAdjust" :item="curItem" />
<PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog"/> <PptDialog @add-success="addAiPPT" :dataList="resultList" v-model="pptDialog"/>
<progress-dialog v-model:visible="pgDialog.visible" v-bind="pgDialog" />
</template> </template>
<script setup> <script setup>
@ -58,6 +59,7 @@ import { sessionStore } from '@/utils/store'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt'
import EditDialog from './edit-dialog.vue' import EditDialog from './edit-dialog.vue'
import AdjustDialog from './adjust-dialog.vue' import AdjustDialog from './adjust-dialog.vue'
import progressDialog from './progress-dialog.vue'
import { completion, tempResult } from '@/api/mode/index.js' import { completion, tempResult } from '@/api/mode/index.js'
// import { dataSetJson } from '@/utils/comm.js' // import { dataSetJson } from '@/utils/comm.js'
import * as commUtils from '@/utils/comm.js' import * as commUtils from '@/utils/comm.js'
@ -77,7 +79,22 @@ const resultList = ref([])
const courseObj = reactive({ const courseObj = reactive({
node: null, // node: null, //
}) })
const pgDialog = reactive({ // -
visible: false,
title: 'PPT解析中...',
width: 300,
showClose: false,
draggable: true,
beforeClose: done => {}, // -
pg: { // -
percentage: 0, //
color: [
{ color: '#1989fa', percentage: 50 }, //
{ color: '#e6a23c', percentage: 80 }, //
{ color: '#5cb87a', percentage: 100 }, // 绿
]
}
})
emitter.on('changeMode', (item) => { emitter.on('changeMode', (item) => {
console.log(item, 'item') console.log(item, 'item')
resultList.value = item.child resultList.value = item.child
@ -115,6 +132,8 @@ const params = reactive(
const addAiPPT = async(res) => { const addAiPPT = async(res) => {
let node = courseObj.node let node = courseObj.node
if (!node) return msgUtils.msgWarning('请选择章节?') if (!node) return msgUtils.msgWarning('请选择章节?')
pgDialog.visible = true
pgDialog.pg.percentage = 0
//TODO resPPT //TODO resPPT
const params = { evalid: node.id, edituserid: userStore.id, pageSize: 1 } const params = { evalid: node.id, edituserid: userStore.id, pageSize: 1 }
const resEnpt = await HTTP_SERVER_API('getCourseList', params) const resEnpt = await HTTP_SERVER_API('getCourseList', params)
@ -129,10 +148,16 @@ const addAiPPT = async(res) => {
const resPptJson = await PPTXFileToJson(buffer) const resPptJson = await PPTXFileToJson(buffer)
const { def, slides, ...content } = resPptJson const { def, slides, ...content } = resPptJson
// || 线 // || 线
let completed = 0
const total = slides.length
for( let o of slides ) { for( let o of slides ) {
completed++
await toRousrceUrl(o) await toRousrceUrl(o)
//
pgDialog.pg.percentage = Math.floor(completed / total * 100)
} }
// return pgDialog.pg.percentage = 0
pgDialog.visible = false
// ppt- // ppt-
const p_params = {parentContent: JSON.stringify(content)} const p_params = {parentContent: JSON.stringify(content)}
const parentid = await HTTP_SERVER_API('addEntpcoursefile', p_params) const parentid = await HTTP_SERVER_API('addEntpcoursefile', p_params)