| | |
| | | :src="selectPPT.pictureUrl" |
| | | style="z-index: 1" |
| | | /> |
| | | |
| | | <!-- 画中画 --> |
| | | <Vue3DraggableResizable |
| | | :key="selectPPT.digitalHuman.x + '-' + selectPPT.digitalHuman.y" |
| | | v-if="selectPPT.innerPicture && selectPPT.innerPicture.src" |
| | | :key="selectPPT.id" |
| | | v-if=" |
| | | selectPPT.innerPicture && |
| | | selectPPT.innerPicture.src && |
| | | ((selectPPT.innerPicture.marginLeft == 0 && selectPPT.innerPicture.top != 0) || |
| | | (selectPPT.innerPicture.marginLeft != 0 && selectPPT.innerPicture.top == 0)) |
| | | " |
| | | :parent="true" |
| | | :initW="selectPPT.innerPicture.width" |
| | | :initH="selectPPT.innerPicture.height" |
| | |
| | | v-model:y="selectPPT.innerPicture.top" |
| | | v-model:w="selectPPT.innerPicture.width" |
| | | v-model:h="selectPPT.innerPicture.height" |
| | | v-model:active="selectPPT.innerPicture.active" |
| | | :draggable="true" |
| | | :resizable="true" |
| | | @activated="print('PPT activated')" |
| | |
| | | <Delete /> |
| | | </el-icon> |
| | | </Vue3DraggableResizable> |
| | | <Vue3DraggableResizable |
| | | :key="selectPPT.id" |
| | | v-if=" |
| | | selectPPT.innerPicture && |
| | | selectPPT.innerPicture.src && |
| | | selectPPT.innerPicture.marginLeft == 0 && |
| | | selectPPT.innerPicture.top == 0 |
| | | " |
| | | :parent="true" |
| | | :initW="selectPPT.innerPicture.width" |
| | | :initH="selectPPT.innerPicture.height" |
| | | v-model:x="selectPPT.innerPicture.marginLeft" |
| | | v-model:y="selectPPT.innerPicture.top" |
| | | v-model:w="selectPPT.innerPicture.width" |
| | | v-model:h="selectPPT.innerPicture.height" |
| | | :draggable="true" |
| | | :resizable="true" |
| | | @activated="print('PPT activated')" |
| | | @deactivated="print('PPT deactivated')" |
| | | @drag-start="print('PPT drag-start')" |
| | | @resize-start="print('PPT resize-start')" |
| | | @dragging="print('PPT dragging')" |
| | | @resizing="print('PPT resizing')" |
| | | @drag-end="print('PPT drag-end')" |
| | | @resize-end="print('PPT resize-end')" |
| | | style="z-index: 3" |
| | | > |
| | | <el-image class="ppt-bg" :src="selectPPT.innerPicture.src" /> |
| | | <el-icon |
| | | v-if="selectPPT.innerPicture.active" |
| | | size="20" |
| | | color="#409eff" |
| | | style="position: absolute; top: 5px; right: 5px; z-index: 4" |
| | | @click.stop="deleteInnerPicture" |
| | | > |
| | | <Delete /> |
| | | </el-icon> |
| | | </Vue3DraggableResizable> |
| | | <Vue3DraggableResizable |
| | | :key="selectPPT.id" |
| | | v-if=" |
| | | selectPPT.innerPicture && |
| | | selectPPT.innerPicture.marginLeft != 0 && |
| | | selectPPT.innerPicture.top != 0 && |
| | | selectPPT.innerPicture.src |
| | | " |
| | | :parent="true" |
| | | :initW="selectPPT.innerPicture.width" |
| | | :initH="selectPPT.innerPicture.height" |
| | | v-model:x="selectPPT.innerPicture.marginLeft" |
| | | v-model:y="selectPPT.innerPicture.top" |
| | | v-model:w="selectPPT.innerPicture.width" |
| | | v-model:h="selectPPT.innerPicture.height" |
| | | :draggable="true" |
| | | :resizable="true" |
| | | @activated="print('PPT activated')" |
| | | @deactivated="print('PPT deactivated')" |
| | | @drag-start="print('PPT drag-start')" |
| | | @resize-start="print('PPT resize-start')" |
| | | @dragging="print('PPT dragging')" |
| | | @resizing="print('PPT resizing')" |
| | | @drag-end="print('PPT drag-end')" |
| | | @resize-end="print('PPT resize-end')" |
| | | style="z-index: 3" |
| | | > |
| | | <el-image class="ppt-bg" :src="selectPPT.innerPicture.src" /> |
| | | <el-icon |
| | | v-if="selectPPT.innerPicture.active" |
| | | size="20" |
| | | color="#409eff" |
| | | style="position: absolute; top: 5px; right: 5px; z-index: 4" |
| | | @click.stop="deleteInnerPicture" |
| | | > |
| | | <Delete /> |
| | | </el-icon> |
| | | </Vue3DraggableResizable> |
| | | |
| | | <!-- 数字人 --> |
| | | <Vue3DraggableResizable |
| | | v-if=" |
| | |
| | | selectPPT.digitalHuman?.host.pictureUrl !== null && |
| | | selectPPT.digitalHuman?.host.videoUrl !== null |
| | | " |
| | | :key="InitDigHuman" |
| | | :parent="false" |
| | | :lockAspectRatio="true" |
| | | :minW="350" |
| | |
| | | selectPPT.digitalHuman?.host.pictureUrl !== null && |
| | | selectPPT.digitalHuman?.host.videoUrl !== null |
| | | " |
| | | :key="InitDigHuman" |
| | | :parent="false" |
| | | :lockAspectRatio="true" |
| | | :minW="350" |
| | |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div class="SoundModelArea" v-loading="soundLoading" v-show="ChangeSoundTypeList?.value === 2 " > |
| | | <div |
| | | class="SoundModelArea" |
| | | v-loading="soundLoading" |
| | | v-show="ChangeSoundTypeList?.value === 2" |
| | | > |
| | | <div class="SoundModelAreaBox" v-for="(value, key, index) in audioList" :key="index"> |
| | | <div class="SoundClassTit"> |
| | | <el-divider content-position="center"> {{ languageClass(key) }} </el-divider> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="ButtonArea" v-show="ChangeSoundTypeList?.value === 2" > |
| | | <div class="ButtonArea" v-show="ChangeSoundTypeList?.value === 2"> |
| | | <el-button type="primary" @click="submitForm">{{ t('common.ok') }}</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | Edit, |
| | | ArrowLeft, |
| | | Upload, |
| | | Mic, |
| | | Headset, |
| | | Delete, |
| | | VideoPlay, |
| | | CopyDocument |
| | | CopyDocument, |
| | | Select |
| | | } from '@element-plus/icons-vue' |
| | | import { generateUUID } from '@/utils' |
| | | import { useRoute, useRouter } from 'vue-router' |
| | |
| | | const dialogVisible1 = ref(false) |
| | | const dialogVisible2 = ref(false) |
| | | const isEditing = ref(false) |
| | | const inputRef = ref(null) |
| | | const inputRef = ref('') |
| | | const editName = ref('') |
| | | const applyAllHost = ref(false) |
| | | //当前是否存在人脸 |
| | |
| | | page.digitalHuman.host = host |
| | | initHumanPositon(host, page.digitalHuman) |
| | | }) |
| | | |
| | | selectPPT.value = PPTArr.value[0] |
| | | selectPPT.value.digitalHuman.host = host |
| | | } |
| | | const saveEdit = () => { |
| | | isEditing.value = false |
| | |
| | | })) |
| | | |
| | | const courseInfo = ref({ |
| | | id: 0, |
| | | id: null, |
| | | accountId: userId.value, |
| | | aspect: '16:9', |
| | | name: '未命名草稿', |
| | |
| | | |
| | | const TEMPLATE_PRESETS = ref([]) |
| | | const templates = ref([]) |
| | | const selectTemplate = ref([]) |
| | | const selectTemplate = ref({}) |
| | | |
| | | const tabs1 = [ |
| | | { |
| | |
| | | let LanguageArr = {} |
| | | data.list.forEach((item) => { |
| | | if (LanguageArr?.[item.language] !== undefined) { |
| | | LanguageArr[item.language].push(item) |
| | | LanguageArr[item.language].unshift(item) |
| | | } else { |
| | | LanguageArr = { ...LanguageArr, [item.language]: [{ ...item }] } |
| | | } |
| | | }) |
| | | console.log(LanguageArr) |
| | | |
| | | audioList.value = LanguageArr |
| | | total.value = data.total |
| | |
| | | pageSize: 100, |
| | | zg: '' |
| | | }) |
| | | const selectHost = ref(null) |
| | | const selectHost = ref({}) |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | |
| | | hostList.value = data.list |
| | | if (hostList.value.length > 0 && !selectHost.value) { |
| | | selectHost.value = hostList.value[0] |
| | | console.log('selectHost.value', selectHost.value) |
| | | if (selectHost.value !== null) { |
| | | selectHost.value.fixVideoUrl = null |
| | | selectHost.value.pictureUrl = null |
| | |
| | | // 所有数字人形象 |
| | | const AllHumanList = ref<any[]>([]) |
| | | // 获取所有数字人形象 |
| | | const GetAllHumanList = () => { |
| | | const GetAllHumanList = async () => { |
| | | let query = { |
| | | pageNo: 1, |
| | | pageSize: 100, |
| | |
| | | } |
| | | // 获取单类数字人形象 |
| | | const GetHumanList = async (query) => { |
| | | let data = await pptTemplateApi.pageList(query) |
| | | const curQuery = {...query} |
| | | let data = await pptTemplateApi.pageList(curQuery) |
| | | AllHumanList.value = [...AllHumanList.value, ...data.list] |
| | | if (curQuery.type === '1') { |
| | | let id = route.query.id?route.query.id:sessionStorage.getItem("courseInfo") |
| | | console.log(id) |
| | | if (id !== "" ) { |
| | | await getCourseDetail(id) |
| | | } else { |
| | | coursesCreate() |
| | | } |
| | | } |
| | | } |
| | | |
| | | const choosePPt = (item) => { |
| | |
| | | pptTemplateApi.coursesCreate(params).then((res) => { |
| | | if (res) { |
| | | courseInfo.value.id = res |
| | | sessionStorage.setItem( "courseInfo", res ) |
| | | console.log( "courseInfo.value.id", res ) |
| | | } |
| | | }) |
| | | } |
| | |
| | | return doc.body.textContent || '' |
| | | } |
| | | |
| | | |
| | | // 是否进行过保存 |
| | | const IsSaved = ref(false) |
| | | |
| | | const saveSubmit = async (type) => { |
| | | |
| | | console.log('是否删除', DeleteD.value) |
| | | |
| | | if (!PPTArr.value || PPTArr.value.length === 0) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | try { |
| | | const res = await pptTemplateApi.coursesSave(JSON.stringify(saveSubmitForm)) |
| | | if (res) { |
| | | IsSaved.value = true |
| | | message.success('保存成功!') |
| | | saveTime.value = getSaveTime() |
| | | return true |
| | |
| | | |
| | | const applyTemplate = (ppt = null) => { |
| | | let template = selectTemplate.value |
| | | console.log('template', selectTemplate.value) |
| | | const pptList = applyAllTemplate.value ? PPTArr.value : [selectPPT.value] |
| | | |
| | | pptList.forEach((item) => { |
| | | const originalPPT = item.innerPicture?.src || item.pictureUrl |
| | | console.log(template) |
| | |
| | | otherItem.height = item.height |
| | | } |
| | | }) |
| | | if (template.showPpt) { |
| | | item.innerPicture = { |
| | | name: '画中画', |
| | | src: originalPPT, |
| | | cover: template.bgImage, |
| | | width: template.pptW, |
| | | height: template.pptH, |
| | | top: template.pptY, |
| | | marginLeft: template.pptX, |
| | | category: 1, |
| | | depth: 1, |
| | | businessId: generateUUID(), |
| | | entityType: 1, |
| | | originHeight: courseInfo.value.height, |
| | | originWidth: courseInfo.value.width, |
| | | entityId: 1, |
| | | templateId: template.id |
| | | } |
| | | item.innerPicture = { |
| | | name: '画中画', |
| | | src: originalPPT, |
| | | cover: template.bgImage, |
| | | width: template.pptW, |
| | | height: template.pptH, |
| | | top: template.pptY, |
| | | marginLeft: template.pptX, |
| | | category: 1, |
| | | depth: 1, |
| | | businessId: generateUUID(), |
| | | entityType: 1, |
| | | originHeight: courseInfo.value.height, |
| | | originWidth: courseInfo.value.width, |
| | | entityId: 1, |
| | | templateId: template.id |
| | | } |
| | | }) |
| | | console.log('pptList', selectPPT.value) |
| | | } |
| | | |
| | | const replaceDialog = ref(null) |
| | |
| | | const currentAudio = ref() |
| | | |
| | | const createAudio = async () => { |
| | | |
| | | const text = editorRef.value.getText() |
| | | if (!text) { |
| | | message.warning('请输入需要试听文本的内容…') |
| | |
| | | } |
| | | |
| | | const goBack = () => { |
| | | if (PPTArr.value.length == 0) { |
| | | // if () { |
| | | if ( PPTArr.value.length == 0 || !IsSaved.value) { |
| | | pptTemplateApi.coursesDelete(courseInfo.value.id).then((res) => { |
| | | router.go(-1) |
| | | }) |
| | |
| | | data.y = -100 // 可以设置最小坐标为 -100 |
| | | } |
| | | } |
| | | |
| | | // 对数字人组件强制刷新 |
| | | const InitDigHuman = ref(0) |
| | | const getCourseDetail = async (id) => { |
| | | IsSaved.value = true |
| | | const res = await pptTemplateApi.coursesDetail(id) |
| | | console.log('res当前信息', res) |
| | | if (res) { |
| | | courseInfo.value = res |
| | | if (res.scenes && res.scenes.length > 0) { |
| | | res.scenes.forEach((item) => { |
| | | item.isActive = false |
| | | item.isActive = false |
| | | item.isChecked = false |
| | | item.pictureUrl = item.background.src |
| | | item.pptRemark = editorHtml.parseElemHtml(item.background.pptRemark) |
| | |
| | | |
| | | PPTArr.value = res.scenes |
| | | PPTArr.value[0].isActive = true |
| | | |
| | | selectPPT.value = PPTArr.value[0] |
| | | |
| | | PPTArr.value.forEach((scene, index) => { |
| | | if (res.scenes[index].voice) { |
| | | scene.selectAudio = res.scenes[index].voice |
| | |
| | | } |
| | | ] |
| | | } |
| | | |
| | | InitDigHuman.value = 1 |
| | | // 设置音频选择数据 |
| | | const firstScene = res.scenes[0] |
| | | if (firstScene.voice) { |
| | |
| | | selectTemplate.value = cloneDeep(templates.value[0]) |
| | | |
| | | await getList() |
| | | |
| | | // 获取所有数字人信息并根据具体情况进行页面初始化 |
| | | GetAllHumanList() |
| | | |
| | | if (route.query.id) { |
| | | await getCourseDetail(route.query.id) |
| | | } else { |
| | | coursesCreate() |
| | | } |
| | | }) |
| | | |
| | | onUnmounted(() => { |
| | |
| | | align-items: center; |
| | | position: relative; |
| | | > .ImgBox { |
| | | width: 26%; |
| | | width: 34%; |
| | | margin: 0 auto; |
| | | border-radius: 50%; |
| | | overflow: hidden; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | img { |
| | | width: 100%; |
| | | } |