康鲁杰
2025-05-29 0d9844060912192819486a499ad987d216e33b6e
Merge remote-tracking branch 'origin/master'
已修改4个文件
177 ■■■■■ 文件已修改
easegen-front/src/views/chooseTemplate/index.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/dialogue/index.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/digitalcourse/digitalhumans/LookDigitalHumansForm.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/digitalcourse/digitalhumans/index.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)
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>
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,
  })
  // 当前是否正在上传视频
  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>
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>