Flex
2025-06-13 a102948e42134580ecdd36ebb4578755d0a3211f
修改数字人默认显示
已修改1个文件
157 ■■■■ 文件已修改
easegen-front/src/views/chooseTemplate/index.vue 157 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/chooseTemplate/index.vue
@@ -110,7 +110,13 @@
                    />
                    <!-- 数字人(有则显示) -->
                    <el-image
                      v-if="element.digitalHuman?.show && element.digitalHuman?.host"
                      v-if="
                        element.digitalHuman?.show &&
                        element.digitalHuman?.host &&
                        element.digitalHuman?.host.fixVideoUrl !== null &&
                        element.digitalHuman?.host.pictureUrl !== null &&
                        element.digitalHuman?.host.videoUrl !== null
                      "
                      class="host"
                      :style="{
                        width: element.digitalHuman.w * (thumViewSize.width / 800) + 'px',
@@ -231,7 +237,13 @@
              </Vue3DraggableResizable>
              <!-- 数字人 -->
              <Vue3DraggableResizable
                v-if="selectPPT.digitalHuman.show == true && selectPPT.digitalHuman?.host"
                v-if="
                  selectPPT.digitalHuman.show == true &&
                  selectPPT.digitalHuman?.host &&
                  selectPPT.digitalHuman?.host.fixVideoUrl !== null &&
                  selectPPT.digitalHuman?.host.pictureUrl !== null &&
                  selectPPT.digitalHuman?.host.videoUrl !== null
                "
                :parent="false"
                :lockAspectRatio="true"
                :minW="350"
@@ -270,7 +282,13 @@
                </el-icon>
              </Vue3DraggableResizable>
              <Vue3DraggableResizable
                v-if="selectPPT.digitalHuman.show == false && selectPPT.digitalHuman?.host"
                v-if="
                  selectPPT.digitalHuman.show == false &&
                  selectPPT.digitalHuman?.host &&
                  selectPPT.digitalHuman?.host.fixVideoUrl !== null &&
                  selectPPT.digitalHuman?.host.pictureUrl !== null &&
                  selectPPT.digitalHuman?.host.videoUrl !== null
                "
                :parent="false"
                :lockAspectRatio="true"
                :minW="350"
@@ -584,7 +602,7 @@
              </el-select>
            </div>
          </div>
          <div class="SoundModelArea" v-loading="soundLoading">
          <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>
@@ -625,7 +643,7 @@
              </div>
            </div>
          </div>
          <div class="ButtonArea">
          <div class="ButtonArea" v-show="ChangeSoundTypeList?.value === 2" >
            <el-button type="primary" @click="submitForm">{{ t('common.ok') }}</el-button>
          </div>
        </div>
@@ -775,6 +793,11 @@
}
const hostValue = ref({})
const chooseHost = (item) => {
  if (PPTArr.value.length === 0) {
    message.warning('请先上传ppt')
    return false
  }
  // 数字人默认所有页,没有当前页选项
  hostValue.value = item
  chooseHost1(2)
@@ -802,6 +825,8 @@
    page.digitalHuman.host = host
    initHumanPositon(host, page.digitalHuman)
  })
  selectPPT.value = PPTArr.value[0]
}
const saveEdit = () => {
  isEditing.value = false
@@ -1694,6 +1719,13 @@
    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
        selectHost.value.videoUrl = null
        selectHost.value.id = null
      }
      // 更新当前选中PPT的数字人
      if (selectPPT.value) {
        selectPPT.value.digitalHuman.host = selectHost.value
@@ -1704,6 +1736,28 @@
  } finally {
    loading.value = false
  }
}
// 所有数字人形象
const AllHumanList = ref<any[]>([])
// 获取所有数字人形象
const GetAllHumanList = () => {
  let query = {
    pageNo: 1,
    pageSize: 100,
    type: '0',
    gender: tabs2ActiveNum.value,
    posture: tabs3ActiveNum.value,
    status: 0
  }
  GetHumanList(query)
  query.type = '1'
  GetHumanList(query)
}
// 获取单类数字人形象
const GetHumanList = async (query) => {
  let data = await pptTemplateApi.pageList(query)
  AllHumanList.value = [...AllHumanList.value, ...data.list]
}
 
const choosePPt = (item) => {
@@ -1809,17 +1863,18 @@
const saveSubmit = async (type) => {
  console.log('是否删除', DeleteD.value)
 
  if (ChangeSoundTypeList.value.value === 2) {
    //此时为通用
    if (selectList.value === undefined || selectList.value === null) {
      message.warning('请选择声音模型')
      return false
    }
  }
  if (!PPTArr.value || PPTArr.value.length === 0) {
    message.warning('场景为空,请先上传PPT!')
    return false
  }
  if (
    selectPPT.value.digitalHuman?.host.fixVideoUrl === null ||
    selectPPT.value.digitalHuman?.host.pictureUrl === null ||
    selectPPT.value.digitalHuman?.host.videoUrl === null
  ) {
    message.error('请先选择数字人')
    return
  }
 
  //人脸校验
@@ -1985,13 +2040,25 @@
    }
  } else {
    try {
      if (
        ChangeSoundTypeList.value?.value === undefined ||
        selectLanguage.value?.value === undefined
      ) {
        message.error('请先选择语种与声音类型')
        return
      }
      if (ChangeSoundTypeList.value.value === 2) {
        //此时为通用
        if (selectList.value === undefined || selectList.value === null) {
          message.warning('请选择声音模型,并点击确定按钮确定所选声音模型')
          return false
        }
        if (audioSelectData.value == undefined) {
          message.warning('请点击确定按钮确定所选声音模型')
          return false
        }
      }
 
      const saveResult = await saveSubmit('save')
@@ -2121,30 +2188,47 @@
const currentAudio = ref()
 
const createAudio = async () => {
  if (ChangeSoundTypeList.value?.value === undefined || selectLanguage.value?.value === undefined || selectLanguage.value.value === 'all_Language' ) {
    message.error('请先选择语种与声音类型')
    return
  }
  if (ChangeSoundTypeList.value.value === 2) {
    //此时为通用
    if (selectList.value === undefined || selectList.value === null) {
      message.warning('请选择声音模型')
      return false
    }
  }
  if( ChangeSoundTypeList.value.value === 1 ){
    if( selectPPT.value.digitalHuman.host === null || selectPPT.value.digitalHuman.host.id === undefined || selectPPT.value.digitalHuman.host.id === null ){
      message.warning('请选择数字人')
      return false
    }
  }
 
  const text = editorRef.value.getText()
  if (!text) {
    message.warning('请输入需要试听文本的内容…')
    return false
  }
  if (
    ChangeSoundTypeList.value?.value === undefined ||
    selectLanguage.value?.value === undefined ||
    selectLanguage.value.value === 'all_Language'
  ) {
    message.error('请先选择语种与声音类型')
    return
  }
  console.log(ChangeSoundTypeList.value.value)
  console.log(selectList.value)
  if (ChangeSoundTypeList.value.value === 2) {
    //此时为通用
    if (selectList.value === undefined || selectList.value === null) {
      message.warning('请选择声音模型,并点击确定按钮确定所选声音模型')
      return false
    }
    if (audioSelectData.value == undefined) {
      message.warning('请点击确定按钮确定所选声音模型')
      return false
    }
  }
  if (ChangeSoundTypeList.value.value === 1) {
    if (
      selectPPT.value.digitalHuman.host === null ||
      selectPPT.value.digitalHuman.host.id === undefined ||
      selectPPT.value.digitalHuman.host.id === null
    ) {
      message.warning('请选择数字人')
      return false
    }
  }
 
  const truncatedText = text.length > 100 ? text.substring(0, 100) : text
@@ -2292,10 +2376,9 @@
 
const getCourseDetail = async (id) => {
  const res = await pptTemplateApi.coursesDetail(id)
  console.log( "res当前信息", res )
  console.log('res当前信息', res)
  if (res) {
    courseInfo.value = res
    if (res.scenes && res.scenes.length > 0) {
      res.scenes.forEach((item) => {
        item.isActive = false
@@ -2316,7 +2399,7 @@
            h: hostInfo.height / scaleRatio.value.height,
            active: false,
            host: {
              ...hostList.value.find((h) => h.code === hostInfo.entityId),
              ...AllHumanList.value.find((h) => h.code === hostInfo.entityId),
              code: hostInfo.entityId,
              type: hostInfo.entityType
            }
@@ -2402,6 +2485,8 @@
 
  await getList()
 
  GetAllHumanList()
  if (route.query.id) {
    await getCourseDetail(route.query.id)
  } else {