From 5fae48dee6c88f2bf83d3e429cb018289bb73d24 Mon Sep 17 00:00:00 2001 From: du <13220750630.163.com> Date: 星期四, 29 五月 2025 16:33:19 +0800 Subject: [PATCH] 模板管理加修改功能和页面 课程中心去除背景和画中画设置,去除模板的上传音频功能 --- easegen-front/src/views/chooseTemplate/index.vue | 30 +++++----- easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue | 36 ++++++------ easegen-front/src/views/dialogue/index.vue | 86 ++++++++++++++++++---------- easegen-front/src/views/digitalcourse/digitalhumans/index.vue | 25 +++++-- 4 files changed, 106 insertions(+), 71 deletions(-) diff --git a/easegen-front/src/views/chooseTemplate/index.vue b/easegen-front/src/views/chooseTemplate/index.vue index 69e2192..31bfef9 100644 --- a/easegen-front/src/views/chooseTemplate/index.vue +++ b/easegen-front/src/views/chooseTemplate/index.vue @@ -505,9 +505,9 @@ </div> <el-empty v-if="templates.length==0" description="鏆傛棤鏁版嵁" /> </div> - <div class="apply-all"> - <el-checkbox v-model="applyAllTemplate" :label="t('courseCenter.uploadAudio')" /> - </div> +<!-- <div class="apply-all">--> +<!-- <el-checkbox v-model="applyAllTemplate" :label="t('courseCenter.uploadAudio')" />--> +<!-- </div>--> </div> <!-- 鑳屾櫙璁剧疆 --> <div class="template-box template-right" v-if="showHeadImageTool"> @@ -786,18 +786,18 @@ activeUrl: userActive, isActive: false }, - { - name: t('courseCenter.background'), - url: bg, - activeUrl: bgActive, - isActive: false - }, - { - name: t('courseCenter.pictureInPicture'), - url: innerPicture, - activeUrl: innerPictureActive, - isActive: false - } + // { + // name: t('courseCenter.background'), + // url: bg, + // activeUrl: bgActive, + // isActive: false + // }, + // { + // name: t('courseCenter.pictureInPicture'), + // url: innerPicture, + // activeUrl: innerPictureActive, + // isActive: false + // } ]) const showHeadImageTool = ref(false) diff --git a/easegen-front/src/views/dialogue/index.vue b/easegen-front/src/views/dialogue/index.vue index e9cc1e1..2299f01 100644 --- a/easegen-front/src/views/dialogue/index.vue +++ b/easegen-front/src/views/dialogue/index.vue @@ -1,43 +1,69 @@ <template> -<div> - <div class="remote-container"></div> -</div> + <div> + <div class="remote-container" classNamev> + </div> + </div> </template> <script> -import DUIX from 'duix-guiji-light' -import {getDuixSign} from "../../api/dialogue"; -import * as pptTemplateApi from "../../api/pptTemplate"; - +import DUIX from 'duix-guiji-light'; +import {getDuixSign} from "../../api/dialogue/index.ts"; export default { - name: "index" -} -const tempConversationId ='dev-'+ Math.random().toString(36).substring(2, 11); -const duix = new DUIX() + name: "index", + mounted() { + this.$nextTick(() => { + this.initDuix(); + }); + }, + methods: { - getDuixSign().then(res => { - if (res.code === 200) { - duix.init({ - sign: res.data.sign, - containerLable: '.remote-container', - conversationId: tempConversationId, - }) - } - }) -duix.on('getDuixSign', () => { - // start session - duix.start({ - conversationId: tempConversationId, - openAsr: true - }).then(res => { - console.info(res) - }) -}) + async initDuix() { + // 1. 妫�鏌ュ鍣ㄦ槸鍚﹀瓨鍦� + const container = document.querySelector('.remote-container'); + if (!container) { + console.error("閿欒锛氭湭鎵惧埌 .remote-container 鍏冪礌"); + return; + } + + // 2. 鑾峰彇 Token + let token; + try { + const res = await getDuixSign(); + token = res.data?.sign || res.sign || res; + if (!token) throw new Error("Token 涓虹┖"); + } catch (err) { + console.error("鑾峰彇绛惧悕澶辫触:", err); + return; + } + + // 3. 鍒濆鍖� DUIX + const duix = new DUIX(); + const conversationId = 'dev-'+ Math.random().toString(36).substring(2, 11);; + + try { + await duix.init({ + sign: token, + containerLable: '.remote-container', // 娉ㄦ剰锛氬彲鑳芥槸 containerLabel锛堟鏌ユ嫾鍐欙級 + conversationId: conversationId, + }); + // 4. 鐩戝惉浜嬩欢 + duix.on('getDuixSign', () => { + duix.start({conversationId, openAsr: true}) + .then(() => console.log("DUIX 鍚姩鎴愬姛")) + .catch(err => console.error("DUIX 鍚姩澶辫触:", err)); + }); + } catch (initErr) { + console.error("DUIX 鍒濆鍖栧け璐�:", initErr); + } + }, + }, +}; </script> <style scoped> -.remote-container{ +.remote-container { width: 500px; height: 500px; + border: 1px solid red; /* 璋冭瘯鏃堕珮浜鍣� */ } </style> diff --git a/easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue b/easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue index 8064faf..0baeae1 100644 --- a/easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue +++ b/easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue @@ -43,7 +43,7 @@ <UploadImg v-if="formData" v-model="formData.fixPictureUrl" /> <UploadImg v-else v-model="formData.pictureUrl" /> </el-form-item> - + <!-- <el-form-item v-if="formData.useModel == 2" :label="t('digitalhumans.video')" prop="videoUrl"> --> <el-form-item v-if="false" :label="t('digitalhumans.video')" prop="videoUrl"> <!-- 鍘熸湰鑷甫鐨勮棰戜笂浼� --> @@ -85,8 +85,9 @@ </el-form-item> </el-form> <template #footer> - <el-button @click="submitForm" type="primary" :disabled="formLoading" :loading="isUploading" >{{t('common.ok')}}</el-button> - <el-button @click="dialogVisible = false">{{t('common.cancel')}}</el-button> + <el-button @click="submitForm" type="primary" :disabled="formLoading" :loading="isUploading" v-if="formType=='updata'">{{t('common.ok')}}</el-button> + <el-button @click="dialogVisible = false" v-if="formType=='updata'">{{t('common.cancel')}}</el-button> + <el-button @click="dialogVisible = false" v-if="formType=='detail'">鍏抽棴</el-button> </template> </Dialog> </template> @@ -100,10 +101,10 @@ import { useUpload } from '@/components/UploadFile/src/useUpload' import { el } from 'element-plus/es/locale'; import { any } from 'vue-types'; - + const { t } = useI18n() // 鍥介檯鍖� const message = useMessage() // 娑堟伅寮圭獥 - + const { uploadUrl, httpRequest } = useUpload() //涓婁紶鏂规硶 const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀� const dialogTitle = ref('') // 寮圭獥鐨勬爣棰� @@ -128,10 +129,10 @@ status: undefined, isTransparent: undefined, }) - + // 褰撳墠鏄惁姝e湪涓婁紶瑙嗛 const isUploading = ref(false) - + const videoProperty = { videoUrl: '', posterUrl: '', @@ -143,7 +144,7 @@ height: 300 } } as DiyComponent<VideoPlayerProperty> - + watch(()=> formData.value.videoUrl,(newVal,oldValue)=>{ if (newVal && newVal.length > 0){ videoProperty.videoUrl = formData.value.fixVideoUrl || newVal @@ -164,12 +165,12 @@ videoUrl: [{ required: true, message: '瑙嗛涓嶈兘涓虹┖', trigger: 'blur' }] }) const formRef = ref() // 琛ㄥ崟 Ref - + const StartCes = () => { console.log( " ----- 寮�濮� ----- " ) isUploading.value = true } - + const End = (res)=>{ const FileObject = { file:res @@ -180,9 +181,9 @@ } ).finally( res => { isUploading.value = false } ) - + } - + /** 鎵撳紑寮圭獥 */ const open = async (type: string, id?: number) => { dialogVisible.value = true @@ -202,7 +203,7 @@ } } defineExpose({ open }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥 - + /** 鎻愪氦琛ㄥ崟 */ const emit = defineEmits(['success']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋� const submitForm = async () => { @@ -226,7 +227,7 @@ formLoading.value = false } } - + /** 閲嶇疆琛ㄥ崟 */ const resetForm = () => { formData.value = { @@ -254,9 +255,9 @@ formData.value.videoUrl = response.data; } }; - + // 淇敼榛樿鐨勬暟瀛椾汉瑙嗛妯″紡涓鸿棰� - + const InitHumMODEL = ()=>{ let ModelList = getIntDictOptions( DICT_TYPE.USE_MODEL ) for (let index = 0; index < ModelList.length; index++) { @@ -266,6 +267,5 @@ } } } - + </script> - \ No newline at end of file diff --git a/easegen-front/src/views/digitalcourse/digitalhumans/index.vue b/easegen-front/src/views/digitalcourse/digitalhumans/index.vue index ac070a6..98bd833 100644 --- a/easegen-front/src/views/digitalcourse/digitalhumans/index.vue +++ b/easegen-front/src/views/digitalcourse/digitalhumans/index.vue @@ -161,6 +161,23 @@ > {{t('digitalhumans.handle')}} </el-button> + + <el-button + link + type="primary" + @click="OpenLookformRef('detail', scope.row.id)" + v-hasPermi="['digitalcourse:digital-humans:delete']" + > + {{t('digitalhumans.view')}} + </el-button> + <el-button + link + type="primary" + @click="OpenLookformRef('updata', scope.row.id)" + v-hasPermi="['digitalcourse:digital-humans:delete']" + > + 淇敼 + </el-button> <el-button :disabled="scope.row.status == 3 || scope.row.status == 6" link @@ -169,14 +186,6 @@ v-hasPermi="['digitalcourse:digital-humans:delete']" > {{ t('action.del') }} - </el-button> - <el-button - link - type="primary" - @click="OpenLookformRef('detail', scope.row.id)" - v-hasPermi="['digitalcourse:digital-humans:delete']" - > - {{t('digitalhumans.view')}} </el-button> </template> </el-table-column> -- Gitblit v1.9.3