From 0db91dc48b76629787f0d92ff99917e4547f828b Mon Sep 17 00:00:00 2001 From: Flex <q1406482700@163.com> Date: 星期二, 22 四月 2025 16:51:30 +0800 Subject: [PATCH] 还原至5天前 --- easegen-front/src/views/chooseTemplate/index.vue | 433 ++++++++++++++++++++--------------------------------- 1 files changed, 164 insertions(+), 269 deletions(-) diff --git a/easegen-front/src/views/chooseTemplate/index.vue b/easegen-front/src/views/chooseTemplate/index.vue index 2e7d676..649f5a8 100644 --- a/easegen-front/src/views/chooseTemplate/index.vue +++ b/easegen-front/src/views/chooseTemplate/index.vue @@ -16,7 +16,7 @@ @blur="saveEdit" @keydown.enter="saveEdit" /> - + <!-- 濡傛灉涓嶅湪缂栬緫锛屾樉绀烘枃鏈� --> <div v-else @@ -31,10 +31,8 @@ </div> <div class="top-right"> <span v-if="saveTime">{{ saveTime }} {{ t('courseCenter.saved') }}</span> - <!-- 淇濆瓨鎸夐挳 --> - <el-button size="small" @click="saveSubmit('save')" :loading="SaveLoading" >{{ t('common.save') }}</el-button> - <!-- 鍚堟垚瑙嗛 --> - <el-button type="primary" size="small" @click="saveSubmit('')" :loading="MakeLoading" >{{ + <el-button size="small" @click="saveSubmit('save')">{{ t('common.save') }}</el-button> + <el-button type="primary" size="small" @click="saveSubmit('')">{{ t('courseCenter.composeViode') }}</el-button> </div> @@ -128,7 +126,7 @@ <div class="icon-content"> <el-icon size="20" - color="#FFA500" + color="#ffffff" style="margin-right: 5px" @click.stop="copyDocument(element, index)" > @@ -136,7 +134,7 @@ </el-icon> <el-icon size="20" - color="#FFA500" + color="#ffffff" style="margin-right: 5px" @click.stop="deleteDocument(element)" > @@ -256,7 +254,7 @@ class="minddle-host-image" :src="selectHost ? selectHost.pictureUrl : ''" /> - + <el-icon v-if="PPTpositon.active" size="20" @@ -297,7 +295,7 @@ class="minddle-host-image" :src="selectHost ? selectHost.pictureUrl : ''" /> - + <el-icon v-if="PPTpositon.active" size="20" @@ -560,7 +558,7 @@ <div class="template-box template-right" v-if="showHeadImageTool"> <div class="image-setting"> <!-- 涓婁紶鍥剧墖鎴愬姛鍚庯紝灏嗗綋鍓嶅満鏅殑鑳屾櫙淇敼涓轰笂浼犵殑鍥剧墖url--> - + <div>{{ t('courseCenter.uploadImage') }}</div> <UploadImg v-model="selectPPT.pictureUrl" :limit="1" /> </div> @@ -569,7 +567,7 @@ <div class="template-box template-right" v-if="showInnerPictureTool"> <div class="image-setting"> <!-- 涓婁紶鍥剧墖鎴愬姛鍚庯紝灏嗗綋鍓嶅満鏅殑鐢讳腑鐢讳慨鏀逛负涓婁紶鐨勫浘鐗噓rl--> - + <div>{{ t('courseCenter.uploadImage') }}</div> <UploadImg v-model="selectPPT.innerPicture.src" :limit="1" /> </div> @@ -630,7 +628,7 @@ <script lang="ts" setup> import { ref, reactive, onMounted } from 'vue' import draggable from 'vuedraggable' -import { ElMessage, ElMessageBox } from 'element-plus' + import Vue3DraggableResizable from 'vue3-draggable-resizable' import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css' import { config } from '@/config/axios/config' @@ -679,10 +677,7 @@ import { polyphonic } from 'pinyin-pro'; //缂栬緫鍣ㄥ唴瀹硅浆鎹sml import { useEditorHtml } from '@/hooks/web/useEditorHtml'; -//寮曞叆浜鸿劯璇嗗埆鏂规硶 -import { useFaceDetection } from '@/utils/HaveFace' import {coursesDelete} from "@/api/pptTemplate"; -import { tr } from 'element-plus/es/locale' const editorHtml = useEditorHtml() const router = useRouter() // 璺敱 const route = useRoute() // @@ -692,10 +687,6 @@ const message = useMessage() const isEditing = ref(false) const inputRef = ref(null) -//淇濆瓨鐨勫姞杞藉姩鐢� -const SaveLoading = ref(false) -//瑙嗛鍚堟垚鐨勫姞杞藉姩鐢� -const MakeLoading = ref(false) // 鍒囨崲鍒扮紪杈戞ā寮� const toggleEdit = () => { isEditing.value = true @@ -707,7 +698,7 @@ const onDragMove = (evt, data) => { console.log(evt) console.log(data) - + // 闄愬埗鍧愭爣 if (data.x < -100) { data.x = -100; // 鍙互璁剧疆鏈�灏忓潗鏍囦负 -100 @@ -722,7 +713,7 @@ courseInfo.value.name = editName.value } let humanId = 0 - + //璇剧▼鍩烘湰淇℃伅 const courseInfo = ref({ id: 0, @@ -744,7 +735,7 @@ courseInfo.value.height = newAspect === '16:9' ? 1080 : 1920 } ) - + const editName = ref(courseInfo.value.name) const viewSize = reactive({ width: 800, @@ -763,7 +754,7 @@ width: courseInfo.value.width / viewSize.width, // 1920/800 = 2.4 height: courseInfo.value.height / viewSize.height // 1080/450 = 2.4 })) - + const PPTpositon = reactive({ x: viewSize.width - digitalHumanSize.width, y: viewSize.height - digitalHumanSize.height, @@ -772,7 +763,7 @@ depth: 0, active: false }) - + const componentsInfo = reactive({ width: PPTpositon.w / 5, height: PPTpositon.h / 4, @@ -792,7 +783,7 @@ const showImageSet = ref(false) //鏄惁灏嗘ā鏉垮簲鐢ㄥ埌鎵�鏈夐〉闈� const applyAllTemplate = ref(false) - + const xScale = viewSize.width / thumViewSize.width // const yScale = viewSize.height / thumViewSize.height //宸︿晶ppt鏁板瓧浜轰綅缃� @@ -814,13 +805,13 @@ const state = reactive({ dragging: false }) - + //棰勮妯℃澘 const TEMPLATE_PRESETS = ref([]) const templates = ref([]) - + const selectTemplate = ref([]) - + //鏁板瓧浜簍ab const tabs1 = [ { @@ -949,14 +940,13 @@ showInnerPictureTool.value = true } } - + const PPTArr = ref() //ppt瑙f瀽杩涘害 const percentagePPT = ref(0) const showLeftList = ref(true) - + const selectPPT = ref({ - id:"", pictureUrl: '', innerPicture: { //瀹氫箟鐢讳腑鐢诲璞★紝灞炴�т笌鏁板瓧浜虹浉鍚� @@ -1044,18 +1034,18 @@ file.uid = genFileId() uploadRef.value!.handleStart(file) } - + // 涓婁紶鐩稿叧鐨勫鐞嗗嚱鏁� const handleChange = (files) => { // 鑾峰彇鏂囦欢鎵╁睍鍚� const extension = files.name.split('.').pop().toLowerCase() - + // 璁剧疆鏂囨。绫诲瀷 1:ppt 2:pdf uploadFileObj.docType = extension === 'pdf' ? 2 : 1 uploadFileObj.filename = files.name uploadFileObj.size = files.size } - + const uploadExplainRef = ref() const handleSuccess = (rawFile) => { message.success('涓婁紶鎴愬姛锛�') @@ -1063,12 +1053,12 @@ uploadExplainRef.value.open() uploadRef.value!.clearFiles() } - + const handleError = (err) => { message.error('涓婁紶澶辫触锛岃閲嶈瘯') console.error('Upload error:', err) } - + //涓婁紶闊抽 const uploadAudioRef = ref() const handleAudioSuccess = (rawFile) => { @@ -1120,7 +1110,6 @@ } percentagePPT.value = parseInt(`${progress * 100}`) } else if (res && res.length > 0) { - console.log('瑙f瀽鎴愬姛', res) console.log('courseInfo', courseInfo.value) res.forEach((item) => { item.isActive = false @@ -1188,6 +1177,7 @@ console.log('PPTArr.value', PPTArr.value) PPTArr.value[0].isActive = true selectPPT.value = PPTArr.value[0] + console.log('selectPPT.value', selectPPT.value) showLeftList.value = true clearInterval(schedulePPTTimer.value) //杞淇濆瓨璇剧▼ @@ -1211,7 +1201,7 @@ // 璁$畻鎬诲瓧鏁� - 淇敼涓哄幓闄SML鏍囩鍚庡啀璁$畻闀垮害 videoText.value = val.reduce((prev, curr) => { if (!curr.pptRemark) return prev; - + // 鍘婚櫎鎵�鏈塖SML鏍囩,鍙繚鐣欐枃鏈唴瀹� const plainText = curr.pptRemark; return prev + plainText.length; @@ -1244,48 +1234,13 @@ clearInterval(schedulePPTTimer.value) } const copyDocument = (item, index) => { - ElMessageBox.confirm( - '鏄惁澶嶅埗杩欓〉PPT锛�', - '鎻愮ず', - { - confirmButtonText: '鏄�', - cancelButtonText: '鍚�', - type: 'warning', - } - ) - .then(() => { - let copyItem = cloneDeep(item) - copyItem.id = generateUUID() - copyItem.isActive = false - PPTArr.value.splice(index + 1, 0, copyItem) - }) - .catch(() => { - ElMessage({ - type: 'info', - message: '宸插彇娑堝鍒�', - }) - }) - + let copyItem = cloneDeep(item) + copyItem.id = generateUUID() + copyItem.isActive = false + PPTArr.value.splice(index + 1, 0, copyItem) } const deleteDocument = (item) => { - ElMessageBox.confirm( - '鏄惁鍒犻櫎杩欓〉PPT锛�', - '鎻愮ず', - { - confirmButtonText: '鏄�', - cancelButtonText: '鍚�', - type: 'warning', - } - ) - .then(() => { - PPTArr.value = PPTArr.value.filter((child) => child.id !== item.id) - }).catch(() => { - ElMessage({ - type: 'info', - message: '宸插彇娑堝垹闄�', - }) - }) - + PPTArr.value = PPTArr.value.filter((child) => child.id !== item.id) } const deleteDigitalHuman = () => { selectPPT.value.showDigitalHuman = false @@ -1407,7 +1362,7 @@ scene.selectAudio = data[0] }) } - + } //鐢熸垚璇剧▼id const coursesCreate = () => { @@ -1415,26 +1370,13 @@ accountId: userId.value } pptTemplateApi.coursesCreate(params).then((res) => { + console.log(res) if (res) { courseInfo.value.id = res } }) } - - -//ppt浜鸿劯鏍¢獙 -const PPtIsHaveFace = async ()=>{ - //娣诲姞ppt涓汉鑴告牎楠� - //鍚戝師濮媝pt娣诲姞鏁版嵁锛岀敤浣滃悗缁璸pt涓槸鍚﹀寘鍚汉鑴哥殑鏁版嵁鏍¢獙鍘熷鏁版嵁 - const InitPpt = PPTArr.value.map( (item)=>{ - return item.innerPicture.src - } ) - const { detectFacesInImages } = useFaceDetection() - const IsHaveFace = await detectFacesInImages(InitPpt) - return IsHaveFace -} - - + //鑾峰彇淇濆瓨鏃堕棿 const saveTime = ref() const getSaveTime = () => { @@ -1454,7 +1396,7 @@ return h + ':' + m + ':' + s } const warningDialog = ref() - + // 璇�� 闊抽噺 const voiceData = reactive({ show: false, @@ -1478,26 +1420,14 @@ const doc = parser.parseFromString(html, 'text/html'); return doc.body.textContent || ""; } - -//浼犲叆 save 鍒欎唬琛ㄤ繚瀛橈紝绌哄瓧绗︿紶鍒欐槸鍚堟垚瑙嗛 + const saveSubmit = async (type) => { - if( type.length === 0 ){ - //姝ゆ椂涓鸿棰戝悎鎴� - MakeLoading.value = true - SaveLoading.value = true - }else{ - //姝ゆ椂涓轰繚瀛� - SaveLoading.value = true - } - // 妫�鏌ュ満鏅槸鍚︿负绌� if (!PPTArr.value || PPTArr.value.length === 0) { message.warning('鍦烘櫙涓虹┖锛岃鍏堜笂浼燩PT锛�') - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false return false } + //淇濆瓨璇剧▼ let saveSubmitForm = { accountId: courseInfo.value.accountId, @@ -1520,7 +1450,7 @@ // }else{ // Reflect.set(saveSubmitForm, "courseMediaId", courseInfo.value.id); // } - + //缁勮鏁版嵁 const scenes: any = [] const pageInfo = { @@ -1552,6 +1482,7 @@ matting: 1, marker: 1 } + let pageNum = 1 if (PPTArr.value && PPTArr.value.length > 0) { console.log('寮�濮嬪鐞哖PTArr鏁版嵁') @@ -1564,9 +1495,10 @@ pageNum++ } console.log(item) - + const innerPictureCom = item.innerPicture console.log('innerPictureCom:', JSON.stringify(innerPictureCom)) + console.log(item.pptRemark) item.pptRemark = removeHtmlTags(item.pptRemark) // item.pptRemark = editorRef.value.getText() // item.pptRemark=item.pptRemark.replace(/<[^>]+>/g, '') @@ -1635,78 +1567,54 @@ scenes.push(formatItem) } catch (error) { console.error(`澶勭悊绗� ${index + 1} 涓満鏅椂鍑洪敊:`, error) - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false //鎶涘嚭寮傚父 throw error } }) } - + console.log('pageInfo:', JSON.stringify(pageInfo)) + console.log('thumbnail:', thumbnail) + try { saveSubmitForm.pageInfo = JSON.stringify(pageInfo) saveSubmitForm.thumbnail = thumbnail saveSubmitForm.scenes = cloneDeep(scenes) console.log('saveSubmitForm:', cloneDeep(saveSubmitForm)) } catch (error) { - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false console.error('淇濆瓨琛ㄥ崟鏁版嵁鏃跺嚭閿�:', error) } + if (type == 'save') { - //鍙嶆鎬庝箞璧伴兘浼氳蛋save杩欎竴姝ワ紝閭e氨鍙湪杩欎竴姝ヨ繘琛屼竴娆′汉鑴告牎楠岋紝濡傛灉鍚庣画鍚堟垚瑙嗛鎸夐挳涓嶅啀璧颁繚瀛橈紝璇峰皢杩欎竴姝ヤ篃涓�骞惰繘琛屾洿鏀� - //涓昏鍥犱负wangEditor杩囦簬鏁忔劅 - const isHaveFace = await PPtIsHaveFace() - if( isHaveFace ){ - message.warning('褰撳墠ppt涓寘鍚汉鑴稿厓绱�, 涓烘柟渚垮悗缁棰戠敓鎴� ,璇峰幓闄よ鍏冪礌') - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false - return false - } - try { const res = await pptTemplateApi.coursesSave(stringifySafely(saveSubmitForm)) if (res) { message.success('淇濆瓨鎴愬姛锛�') saveTime.value = getSaveTime() - MakeLoading.value = false - SaveLoading.value = false return true // 杩斿洖淇濆瓨鎴愬姛鏍囧織 } return false } catch (error) { console.error('淇濆瓨璇剧▼鏃跺嚭閿�:', error) message.error('淇濆瓨澶辫触锛岃閲嶈瘯') - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false return false } - } else { // 鍚堟垚瑙嗛鍓嶅厛淇濆瓨 try { const saveResult = await saveSubmit('save') if (!saveResult) { message.error('淇濆瓨澶辫触锛岃閲嶈瘯鍚庡啀鍚堟垚瑙嗛') - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false return } + // 鏍¢獙鍦烘櫙鏁版嵁 let warningStrArr: any = [] for (let i = 0; i < PPTArr.value.length; i++) { const item = PPTArr.value[i] + console.log(item) // 鏍¢獙鑳屾櫙瀹介珮 if (!item.width || !item.height) { message.warning('鑳屾櫙灏哄鏃犳晥锛岃妫�鏌ュ楂樿缃紝鎴栬�呴噸鏂伴�夋嫨妯℃澘') - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false return } if (item.driverType == 1) { @@ -1727,40 +1635,28 @@ } } } + if (warningStrArr.length > 0) { warningDialog.value.open(warningStrArr.map((warning) => `<div>${warning}</div>`).join('')) - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false return } + // 鍚堟垚瑙嗛 try { const res = await pptTemplateApi.megerMedia(saveSubmitForm) if (res) { - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false message.success('鍚堟垚瑙嗛浠诲姟鎻愪氦鎴愬姛锛岃鍒版垜鐨勮棰戜腑鏌ョ湅锛�') } } catch (error) { - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false console.error('鍚堟垚瑙嗛澶辫触:', error) message.error('鍚堟垚瑙嗛澶辫触锛岃閲嶈瘯') } } catch (error) { - //鍏抽棴瑙嗛鍚堟垚涓庝繚瀛樻寜閽殑loading鍔ㄧ敾 - MakeLoading.value = false - SaveLoading.value = false console.error('淇濆瓨鎴栧悎鎴愯繃绋嬪嚭閿�:', error) message.error('鎿嶄綔澶辫触锛岃閲嶈瘯') } } - } - function stringifySafely(obj) { const seen = new WeakSet() return JSON.stringify(obj, (key, value) => { @@ -1795,7 +1691,7 @@ message.warning('鏈�澶氫笂浼犱竴涓0闊抽┍鍔ㄦ枃浠讹紒') } const currentAudio = ref() - + const handlePptRemarkSelection = () => { if (textareaRef.value) { const textarea = textareaRef.value.$el.querySelector('textarea') @@ -1806,7 +1702,6 @@ } } } - //瀵屾枃鏈紪杈戝櫒 -start // 缂栬緫鍣ㄥ疄渚嬶紝蹇呴』鐢� shallowRef const editorRef = shallowRef() @@ -1881,13 +1776,13 @@ const createAudio = async () => { // 鑾峰彇缂栬緫鍣ㄦ枃鏈唴瀹� const text = editorRef.value.getText(); - + // 妫�鏌ユ枃鏈槸鍚︿负绌� if (!text) { message.warning('璇疯緭鍏ラ渶瑕佽瘯鍚枃鏈殑鍐呭鈥�'); return false; } - + // 鎴彇鏂囨湰闀垮害涓嶈秴杩� 100 const truncatedText = text.length > 100 ? text.substring(0, 100) : text; console.log(audioSelectData.value) @@ -1900,26 +1795,26 @@ try { // 鏄剧ず闊抽鎾斁鍔犺浇鐘舵�� showAudioPlay1.value = true; - + // 璋冪敤 API 鍒涘缓闊抽 const res = await pptTemplateApi.createAudio(params); - + // 妫�鏌ュ搷搴旀槸鍚︽湁鏁堜笖鏃犻敊璇� if (res && !res.error) { console.log(res); // 闅愯棌鍔犺浇鐘舵�侊紝鏄剧ず闊抽鎾斁鐘舵�� showAudioPlay1.value = false; showAudioPlay.value = true; - + // 鍒濆鍖� Audio 瀵硅薄 currentAudio.value = new Audio(res); - + // 娣诲姞鎾斁缁撴潫浜嬩欢鐩戝惉鍣� currentAudio.value.addEventListener('ended', () => { showAudioPlay.value = false; currentAudio.value = null; }); - + // 鎾斁闊抽 currentAudio.value.play(); } else { @@ -1940,26 +1835,26 @@ try { // 鏄剧ず闊抽鎾斁鍔犺浇鐘舵�� showAudioPlay1.value = true; - + // 璋冪敤 API 鍒涘缓闊抽 const res = await pptTemplateApi.createAudio(params); - + // 妫�鏌ュ搷搴旀槸鍚︽湁鏁堜笖鏃犻敊璇� if (res && !res.error) { console.log(res); // 闅愯棌鍔犺浇鐘舵�侊紝鏄剧ず闊抽鎾斁鐘舵�� showAudioPlay1.value = false; showAudioPlay.value = true; - + // 鍒濆鍖� Audio 瀵硅薄 currentAudio.value = new Audio(res); - + // 娣诲姞鎾斁缁撴潫浜嬩欢鐩戝惉鍣� currentAudio.value.addEventListener('ended', () => { showAudioPlay.value = false; currentAudio.value = null; }); - + // 鎾斁闊抽 currentAudio.value.play(); } else { @@ -1973,9 +1868,9 @@ } } // 鏋勫缓璇锋眰鍙傛暟 - - - + + + } //鍙栨秷璇曞惉 const pauseAudio = () => { @@ -1997,16 +1892,16 @@ currentAudioFile.value.pause() currentAudioFile.value.currentTime = 0 // 閲嶇疆鎾斁浣嶇疆 } - + // 鍒涘缓鏂扮殑 Audio 瀹炰緥 const audio = new Audio(file.response.data) currentAudioFile.value = audio - + // 鐩戝惉鎾斁缁撴潫浜嬩欢 audio.addEventListener('ended', () => { cancelAudio() }) - + // 寮�濮嬫挱鏀� startAudioPlay.value = true audio.play() @@ -2090,26 +1985,26 @@ const hostInfo = res.scenes[0].components.find((component) => component.category === 2) // 鍏堝湪褰撳墠鏁板瓧浜哄垪琛ㄤ腑鏌ユ壘 let foundHost = hostList.value.find(item => item.code === hostInfo.entityId) - + // 濡傛灉鍦ㄥ綋鍓嶅垪琛ㄤ腑娌℃壘鍒�,涓斿綋鍓嶆槸鍏叡鏁板瓧浜哄垪琛�,鍒欏垏鎹㈠埌鎴戠殑鏁板瓧浜哄垪琛ㄩ噸鏂拌幏鍙� if (!foundHost && tabs1ActiveNum.value === '0') { // 淇濆瓨鍏叡鏁板瓧浜哄垪琛ㄧ殑绗竴涓暟瀛椾汉浣滀负榛樿鍊� const defaultPublicHost = hostList.value[0] - + // 鍒囨崲鍒�"鎴戠殑"鏁板瓧浜� tabs1ActiveNum.value = '1' // 閲嶆柊鑾峰彇鏁板瓧浜哄垪琛� getList().then(() => { // 鍦ㄦ柊鍒楄〃涓煡鎵� foundHost = hostList.value.find(item => item.code === hostInfo.entityId) - + // 濡傛灉鍦�"鎴戠殑"鏁板瓧浜轰腑涔熸病鎵惧埌,鍒欎娇鐢ㄩ粯璁ゅ叕鍏辨暟瀛椾汉 if (!foundHost) { tabs1ActiveNum.value = '0' // 鍒囧洖鍏叡鏁板瓧浜簍ab foundHost = defaultPublicHost // 浣跨敤涔嬪墠淇濆瓨鐨勯粯璁ゅ叕鍏辨暟瀛椾汉 message.warning('鏈壘鍒板師鏁板瓧浜�,宸蹭娇鐢ㄩ粯璁ゅ叕鍏辨暟瀛椾汉鏇夸唬') } - + // 璁剧疆閫変腑鐨勬暟瀛椾汉 selectHost.value = foundHost || hostList.value[0] }) @@ -2117,7 +2012,7 @@ // 璁剧疆閫変腑鐨勬暟瀛椾汉 selectHost.value = foundHost || hostList.value[0] } - + // 璁剧疆閫変腑鐨勬暟瀛椾汉 selectHost.value = foundHost || hostList.value[0] if (hostInfo) { @@ -2156,7 +2051,7 @@ const pageInfo = res.pageInfo ? JSON.parse(res.pageInfo) : '' uploadFileObj.filename = pageInfo ? pageInfo.docInfo.fileName : '' uploadFileObj.size = pageInfo ? pageInfo.docInfo.fileSize : '' - + //搴旂敤妯℃澘 杩欓噷鐢ㄦ埛鍙兘宸茬粡璋冩暣浜嗘ā鏉匡紝鎵�浠ヨ繖閲屼笉搴旂敤妯℃澘 // applyTemplate() } @@ -2173,11 +2068,11 @@ currTemplate.isActive = true applyTemplate() } - + const applyTemplate = (ppt = null) => { const template = selectTemplate.value const pptList = applyAllTemplate.value ? PPTArr.value : [selectPPT.value] - + // 鏁板瓧浜烘槸缁熶竴鐢熸晥鐨勶紝鍏堝鐞� console.log(template) pptList.forEach((item) => { @@ -2209,7 +2104,7 @@ item.pictureUrl = originalPPT item.innerPicture.src = '' } - + item.showDigitalHuman = template.showDigitalHuman // 娣诲姞鍚屾瀹介珮鐨勯�昏緫 const targetTemplate = selectTemplate.value @@ -2221,26 +2116,26 @@ } }) }) - + // 鏁板瓧浜轰綅缃篃闇�瑕佺缉鏀� PPTpositon.w = selectTemplate.value.humanW PPTpositon.h = selectTemplate.value.humanH PPTpositon.x = selectTemplate.value.humanX PPTpositon.y = selectTemplate.value.humanY } - + const replaceDialog = ref(null) - + // 鎵撳紑寮瑰嚭妗� const openReplaceDialog = () => { replaceDialog.value.open() } - + // 澶勭悊鎻愪氦鐨勬浛鎹㈣鍒� const escapeRegExp = (string) => { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // 杞箟姝e垯涓殑鐗规畩瀛楃 } - + const handleReplacement = (replacements) => { PPTArr.value.forEach((item) => { if (item.pptRemark) { @@ -2253,7 +2148,7 @@ }) message.success('鎵归噺鏇挎崲鎴愬姛锛�') } - + onMounted(async () => { let data = await TemplateApi.getTemplatePage(queryParams) TEMPLATE_PRESETS.value = data.list.map((item) => { @@ -2292,13 +2187,13 @@ height: 100%; background-color: #f5f7fa; } - + .minddle-host-image { z-index: 5; width: 100%; height: 100%; } - + .template-top { display: flex; height: 60px; @@ -2308,50 +2203,50 @@ border: 1px solid #ebeef5; box-shadow: 0 3px 6px rgb(175 175 175 / 16%); justify-content: space-between; - + .top-left { display: flex; align-items: center; - + .top-icon { display: flex; align-items: center; } - + .back-text { margin-right: 20px; margin-left: 10px; cursor: pointer; } - + span { margin: 0 25px; } } - + .top-right { span { margin: 0 20px; } } } - + .template-main { display: flex; height: calc(100% - 82px); padding: 10px; justify-content: space-around; - + .template-left { position: relative; width: 180px; background-color: #fff; border: 1px solid #ebeef5; box-shadow: 0 3px 6px rgb(175 175 175 / 16%); - + .page { margin: 0; - + div { // height: 30px; padding: 5px 10px; @@ -2359,7 +2254,7 @@ line-height: 30px; border-bottom: 1px solid #ebeef5; } - + .line { width: 30px; height: 3px; @@ -2367,12 +2262,12 @@ margin: 0; background-color: aqua; } - + .upload-demo { text-align: center; } } - + .left-upload-setting { display: flex; height: calc(100% - 86px); @@ -2381,32 +2276,32 @@ flex-direction: column; justify-content: center; align-items: center; - + div { line-height: 40px; } - + ::v-deep(.el-progress-bar) { width: 180px; } - + .el-button { margin: 20px 0; } } - + .image-list { height: calc(100% - 70px); padding: 10px; overflow: hidden auto; border-bottom: 1px solid #ebeef5; - + .list { position: relative; height: calc(152px * 9 / 16); // 浣跨敤缂╃暐鍥剧殑鍥哄畾楂樺害 margin: 20px 0; box-sizing: content-box; - + .list-index { position: absolute; top: 10px; @@ -2420,7 +2315,7 @@ background: #122121; border-radius: 5px; } - + // 纭繚鑳屾櫙鍥剧墖濉厖鏁翠釜瀹瑰櫒 .background { position: absolute; @@ -2433,18 +2328,18 @@ height: 100%; background-color: rgba(0, 0, 0, 0); } - + .ppt-bg { z-index: 2; // width: 152px; // height: 100%; } - + .host { position: absolute; z-index: 3; } - + .icon-content { position: absolute; top: 0; @@ -2456,7 +2351,7 @@ } } } - + .page-btn { position: absolute; bottom: 10px; @@ -2464,7 +2359,7 @@ padding: 0 10px; } } - + .template-middle { display: flex; width: 56%; @@ -2473,17 +2368,17 @@ flex-grow: 1; // 纭繚涓棿鍖哄煙鍙互鑷�傚簲楂樺害 flex-direction: column; justify-content: flex-start; - + .middle-top { padding: 5px 20px; } - + .main-box { display: flex; padding: 10px 20px; border: 1px solid #ebeef5; justify-content: center; - + .main-image-box { position: relative; // width: 760px; @@ -2491,20 +2386,20 @@ border: 1px solid #ebeef5; box-sizing: content-box; } - + .list { position: relative; display: flex; width: 95%; justify-content: center; } - + .ppt-bg { z-index: 2; width: 100%; height: 100%; } - + .host { position: absolute; right: 0; @@ -2512,12 +2407,12 @@ width: 300px; } } - + .voice-main { display: flex; justify-content: space-between; padding: 10px; - + .voice-item { width: 180px; height: 30px; @@ -2525,7 +2420,7 @@ cursor: pointer; background-color: #c9c9c9; border-radius: 12px; - + span { display: inline-block; width: 50%; @@ -2533,17 +2428,17 @@ line-height: 30px; text-align: center; } - + .active-item { color: #fff; background-color: #409eff; } } - + .media-box { display: flex; align-items: center; - + .mic { display: flex; align-items: center; @@ -2553,30 +2448,30 @@ } } } - + .audio-upload { display: flex; align-items: center; justify-content: center; height: 200px; } - + .middle-textarea { padding: 5px 20px; } - + .tool-box { display: flex; padding: 10px; border-top: 1px solid #ebeef5; justify-content: space-between; - + .tool-btn { display: flex; align-items: center; } } - + .audio-play { position: absolute; top: 0; @@ -2593,25 +2488,25 @@ flex-direction: column; } } - + .template-right { position: relative; width: 20%; background-color: #fff; box-shadow: 0 3px 6px rgb(175 175 175 / 16%); - + .tabs-1 { display: flex; justify-content: space-around; padding: 10px 30px; border-bottom: 1px solid #ebeef5; - + .tabs-item { width: 30px; font-size: 14px; text-align: center; cursor: pointer; - + span { display: block; width: 30px; @@ -2621,12 +2516,12 @@ } } } - + .tabs-2 { display: flex; padding: 10px; justify-content: space-around; - + div { width: 60px; height: 30px; @@ -2635,13 +2530,13 @@ cursor: pointer; border-radius: 5px; } - + .tabs-active { color: #fff !important; background-color: #409eff; } } - + .apply-all { position: absolute; bottom: 80px; @@ -2649,12 +2544,12 @@ width: 100%; justify-content: center; } - + .host-list { height: 80%; overflow-y: auto; border-top: 1px solid #ebeef5; - + .host-item { position: relative; display: inline-block; @@ -2663,7 +2558,7 @@ margin: 5px 0; margin-left: 10px; cursor: pointer; - + .background { position: absolute; top: 0; @@ -2673,7 +2568,7 @@ height: 100%; background-color: #f0f1fa; /* 璁剧疆搴曡壊 */ } - + .host-name { position: absolute; bottom: 10px; @@ -2687,7 +2582,7 @@ background: rgb(225 225 225 / 70%); border-radius: 5px; } - + .ppt-bg { z-index: 2; /* 鍥剧墖鍦ㄨ儗鏅箣涓� */ width: 100%; @@ -2696,31 +2591,31 @@ } } } - + .image-setting { padding: 10px 20px; - + .img-setting { display: flex; align-items: center; line-height: 40px; - + .setting-label { width: 120px; } - + ::v-deep(.el-input) { width: 170px; margin-left: 10px; } } } - + .template-list { height: 90%; overflow-y: auto; border-top: 1px solid #ebeef5; - + .template-item { position: relative; display: inline-block; @@ -2746,14 +2641,14 @@ position: absolute; z-index: 2; /* 鍥剧墖鍦ㄨ儗鏅箣涓� */ } - + .human-image { position: absolute; z-index: 3; /* 鍥剧墖鍦ㄨ儗鏅箣涓� */ } } } - + .background { position: absolute; top: 0; @@ -2763,25 +2658,25 @@ height: 100%; background-color: #f0f1fa; /* 璁剧疆搴曡壊 */ } - + .template-tool { width: 60px; padding: 10px; background-color: #fff; box-shadow: 0 3px 6px rgb(175 175 175 / 16%); - + .tool-item { display: flex; padding: 10px 20px; cursor: pointer; flex-direction: column; align-items: center; - + img { width: 32px; height: 32px; } - + .tool-name { width: 60px; margin-top: 6px; @@ -2792,50 +2687,50 @@ } } } - + ::v-deep(.el-pagination) { position: absolute; bottom: 0; } - + /* 婊氬姩鏉℃牱寮� */ ::-webkit-scrollbar { width: 4px; } - + /* 婊戝潡鏍峰紡 */ ::-webkit-scrollbar-thumb { background-color: #888; border-radius: 6px; } - + /* 婊氬姩鏉¤建閬撴牱寮� */ ::-webkit-scrollbar-track { background-color: #f2f2f2; border-radius: 6px; } - + .voice-card { z-index: 1000 !important; // 娣诲姞鏇撮珮鐨剒-index纭繚鍦ㄦ渶椤跺眰 } - + .voice-card :deep(.el-card__body) { padding: 0; } - + .speech-slider { &:deep(.el-slider__bar) { display: none; } - + &:deep(.el-slider__runway) { height: 2px; } - + &:deep(.el-slider__button-wrapper) { top: -17px; } - + &:deep(.el-slider__marks-stop) { top: -5px; width: 12px; @@ -2843,4 +2738,4 @@ background-color: #1989fa; } } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.3