康鲁杰
2025-05-29 0d9844060912192819486a499ad987d216e33b6e
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>