已修改3个文件
212 ■■■■ 文件已修改
easegen-front/src/components/Table/src/Table.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/chooseTemplate/index.vue 209 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/pptTemplateList/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/components/Table/src/Table.vue
@@ -56,7 +56,7 @@
    // 注册
    onMounted(() => {
      const tableRef = unref(elTableRef)
      emit('register', tableRef?.$parent, elTableRef)
      emit('register', tableRef?.$parent, elTableRef.value)
    })
    const pageSizeRef = ref(props.pageSize)
easegen-front/src/views/chooseTemplate/index.vue
@@ -199,11 +199,15 @@
                :src="selectPPT.pictureUrl"
                style="z-index: 1"
              />
              <!-- 画中画 -->
              <Vue3DraggableResizable
                :key="selectPPT.digitalHuman.x + '-' + selectPPT.digitalHuman.y"
                v-if="selectPPT.innerPicture && selectPPT.innerPicture.src"
                :key="selectPPT.id"
                v-if="
                  selectPPT.innerPicture &&
                  selectPPT.innerPicture.src &&
                  ((selectPPT.innerPicture.marginLeft == 0 && selectPPT.innerPicture.top != 0) ||
                    (selectPPT.innerPicture.marginLeft != 0 && selectPPT.innerPicture.top == 0))
                "
                :parent="true"
                :initW="selectPPT.innerPicture.width"
                :initH="selectPPT.innerPicture.height"
@@ -211,7 +215,6 @@
                v-model:y="selectPPT.innerPicture.top"
                v-model:w="selectPPT.innerPicture.width"
                v-model:h="selectPPT.innerPicture.height"
                v-model:active="selectPPT.innerPicture.active"
                :draggable="true"
                :resizable="true"
                @activated="print('PPT activated')"
@@ -235,6 +238,83 @@
                  <Delete />
                </el-icon>
              </Vue3DraggableResizable>
              <Vue3DraggableResizable
                :key="selectPPT.id"
                v-if="
                  selectPPT.innerPicture &&
                  selectPPT.innerPicture.src &&
                  selectPPT.innerPicture.marginLeft == 0 &&
                  selectPPT.innerPicture.top == 0
                "
                :parent="true"
                :initW="selectPPT.innerPicture.width"
                :initH="selectPPT.innerPicture.height"
                v-model:x="selectPPT.innerPicture.marginLeft"
                v-model:y="selectPPT.innerPicture.top"
                v-model:w="selectPPT.innerPicture.width"
                v-model:h="selectPPT.innerPicture.height"
                :draggable="true"
                :resizable="true"
                @activated="print('PPT activated')"
                @deactivated="print('PPT deactivated')"
                @drag-start="print('PPT drag-start')"
                @resize-start="print('PPT resize-start')"
                @dragging="print('PPT dragging')"
                @resizing="print('PPT resizing')"
                @drag-end="print('PPT drag-end')"
                @resize-end="print('PPT resize-end')"
                style="z-index: 3"
              >
                <el-image class="ppt-bg" :src="selectPPT.innerPicture.src" />
                <el-icon
                  v-if="selectPPT.innerPicture.active"
                  size="20"
                  color="#409eff"
                  style="position: absolute; top: 5px; right: 5px; z-index: 4"
                  @click.stop="deleteInnerPicture"
                >
                  <Delete />
                </el-icon>
              </Vue3DraggableResizable>
              <Vue3DraggableResizable
                :key="selectPPT.id"
                v-if="
                  selectPPT.innerPicture &&
                  selectPPT.innerPicture.marginLeft != 0 &&
                  selectPPT.innerPicture.top != 0 &&
                  selectPPT.innerPicture.src
                "
                :parent="true"
                :initW="selectPPT.innerPicture.width"
                :initH="selectPPT.innerPicture.height"
                v-model:x="selectPPT.innerPicture.marginLeft"
                v-model:y="selectPPT.innerPicture.top"
                v-model:w="selectPPT.innerPicture.width"
                v-model:h="selectPPT.innerPicture.height"
                :draggable="true"
                :resizable="true"
                @activated="print('PPT activated')"
                @deactivated="print('PPT deactivated')"
                @drag-start="print('PPT drag-start')"
                @resize-start="print('PPT resize-start')"
                @dragging="print('PPT dragging')"
                @resizing="print('PPT resizing')"
                @drag-end="print('PPT drag-end')"
                @resize-end="print('PPT resize-end')"
                style="z-index: 3"
              >
                <el-image class="ppt-bg" :src="selectPPT.innerPicture.src" />
                <el-icon
                  v-if="selectPPT.innerPicture.active"
                  size="20"
                  color="#409eff"
                  style="position: absolute; top: 5px; right: 5px; z-index: 4"
                  @click.stop="deleteInnerPicture"
                >
                  <Delete />
                </el-icon>
              </Vue3DraggableResizable>
              <!-- 数字人 -->
              <Vue3DraggableResizable
                v-if="
@@ -245,6 +325,7 @@
                  selectPPT.digitalHuman?.host.pictureUrl !== null &&
                  selectPPT.digitalHuman?.host.videoUrl !== null
                "
                :key="InitDigHuman"
                :parent="false"
                :lockAspectRatio="true"
                :minW="350"
@@ -291,6 +372,7 @@
                  selectPPT.digitalHuman?.host.pictureUrl !== null &&
                  selectPPT.digitalHuman?.host.videoUrl !== null
                "
                :key="InitDigHuman"
                :parent="false"
                :lockAspectRatio="true"
                :minW="350"
@@ -604,7 +686,11 @@
              </el-select>
            </div>
          </div>
          <div class="SoundModelArea" v-loading="soundLoading" v-show="ChangeSoundTypeList?.value === 2 " >
          <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>
@@ -645,7 +731,7 @@
              </div>
            </div>
          </div>
          <div class="ButtonArea" v-show="ChangeSoundTypeList?.value === 2" >
          <div class="ButtonArea" v-show="ChangeSoundTypeList?.value === 2">
            <el-button type="primary" @click="submitForm">{{ t('common.ok') }}</el-button>
          </div>
        </div>
@@ -749,11 +835,10 @@
  Edit,
  ArrowLeft,
  Upload,
  Mic,
  Headset,
  Delete,
  VideoPlay,
  CopyDocument
  CopyDocument,
  Select
} from '@element-plus/icons-vue'
import { generateUUID } from '@/utils'
import { useRoute, useRouter } from 'vue-router'
@@ -778,7 +863,7 @@
const dialogVisible1 = ref(false)
const dialogVisible2 = ref(false)
const isEditing = ref(false)
const inputRef = ref(null)
const inputRef = ref('')
const editName = ref('')
const applyAllHost = ref(false)
//当前是否存在人脸
@@ -827,8 +912,7 @@
    page.digitalHuman.host = host
    initHumanPositon(host, page.digitalHuman)
  })
  selectPPT.value = PPTArr.value[0]
  selectPPT.value.digitalHuman.host = host
}
const saveEdit = () => {
  isEditing.value = false
@@ -858,7 +942,7 @@
}))
const courseInfo = ref({
  id: 0,
  id: null,
  accountId: userId.value,
  aspect: '16:9',
  name: '未命名草稿',
@@ -884,7 +968,7 @@
const TEMPLATE_PRESETS = ref([])
const templates = ref([])
const selectTemplate = ref([])
const selectTemplate = ref({})
const tabs1 = [
  {
@@ -1135,12 +1219,11 @@
    let LanguageArr = {}
    data.list.forEach((item) => {
      if (LanguageArr?.[item.language] !== undefined) {
        LanguageArr[item.language].push(item)
        LanguageArr[item.language].unshift(item)
      } else {
        LanguageArr = { ...LanguageArr, [item.language]: [{ ...item }] }
      }
    })
    console.log(LanguageArr)
    audioList.value = LanguageArr
    total.value = data.total
@@ -1706,7 +1789,7 @@
  pageSize: 100,
  zg: ''
})
const selectHost = ref(null)
const selectHost = ref({})
const getList = async () => {
  loading.value = true
@@ -1723,7 +1806,6 @@
    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
@@ -1745,7 +1827,7 @@
// 所有数字人形象
const AllHumanList = ref<any[]>([])
// 获取所有数字人形象
const GetAllHumanList = () => {
const GetAllHumanList = async () => {
  let query = {
    pageNo: 1,
    pageSize: 100,
@@ -1760,8 +1842,18 @@
}
// 获取单类数字人形象
const GetHumanList = async (query) => {
  let data = await pptTemplateApi.pageList(query)
  const curQuery = {...query}
  let data = await pptTemplateApi.pageList(curQuery)
  AllHumanList.value = [...AllHumanList.value, ...data.list]
  if (curQuery.type === '1') {
    let id = route.query.id?route.query.id:sessionStorage.getItem("courseInfo")
    console.log(id)
    if (id !== "" ) {
      await getCourseDetail(id)
    } else {
      coursesCreate()
    }
  }
}
const choosePPt = (item) => {
@@ -1819,6 +1911,8 @@
  pptTemplateApi.coursesCreate(params).then((res) => {
    if (res) {
      courseInfo.value.id = res
      sessionStorage.setItem( "courseInfo", res )
      console.log( "courseInfo.value.id", res )
    }
  })
}
@@ -1864,7 +1958,12 @@
  return doc.body.textContent || ''
}
// 是否进行过保存
const IsSaved = ref(false)
const saveSubmit = async (type) => {
  console.log('是否删除', DeleteD.value)
  if (!PPTArr.value || PPTArr.value.length === 0) {
@@ -2030,11 +2129,10 @@
      }
    }
    try {
      const res = await pptTemplateApi.coursesSave(JSON.stringify(saveSubmitForm))
      if (res) {
        IsSaved.value = true
        message.success('保存成功!')
        saveTime.value = getSaveTime()
        return true
@@ -2120,9 +2218,7 @@
const applyTemplate = (ppt = null) => {
  let template = selectTemplate.value
  console.log('template', selectTemplate.value)
  const pptList = applyAllTemplate.value ? PPTArr.value : [selectPPT.value]
  pptList.forEach((item) => {
    const originalPPT = item.innerPicture?.src || item.pictureUrl
    console.log(template)
@@ -2138,26 +2234,25 @@
        otherItem.height = item.height
      }
    })
    if (template.showPpt) {
      item.innerPicture = {
        name: '画中画',
        src: originalPPT,
        cover: template.bgImage,
        width: template.pptW,
        height: template.pptH,
        top: template.pptY,
        marginLeft: template.pptX,
        category: 1,
        depth: 1,
        businessId: generateUUID(),
        entityType: 1,
        originHeight: courseInfo.value.height,
        originWidth: courseInfo.value.width,
        entityId: 1,
        templateId: template.id
      }
    item.innerPicture = {
      name: '画中画',
      src: originalPPT,
      cover: template.bgImage,
      width: template.pptW,
      height: template.pptH,
      top: template.pptY,
      marginLeft: template.pptX,
      category: 1,
      depth: 1,
      businessId: generateUUID(),
      entityType: 1,
      originHeight: courseInfo.value.height,
      originWidth: courseInfo.value.width,
      entityId: 1,
      templateId: template.id
    }
  })
  console.log('pptList', selectPPT.value)
}
const replaceDialog = ref(null)
@@ -2196,7 +2291,6 @@
const currentAudio = ref()
const createAudio = async () => {
  const text = editorRef.value.getText()
  if (!text) {
    message.warning('请输入需要试听文本的内容…')
@@ -2319,7 +2413,8 @@
}
const goBack = () => {
  if (PPTArr.value.length == 0) {
  // if () {
  if ( PPTArr.value.length == 0 || !IsSaved.value) {
    pptTemplateApi.coursesDelete(courseInfo.value.id).then((res) => {
      router.go(-1)
    })
@@ -2381,15 +2476,16 @@
    data.y = -100 // 可以设置最小坐标为 -100
  }
}
// 对数字人组件强制刷新
const InitDigHuman = ref(0)
const getCourseDetail = async (id) => {
  IsSaved.value = true
  const res = await pptTemplateApi.coursesDetail(id)
  console.log('res当前信息', res)
  if (res) {
    courseInfo.value = res
    if (res.scenes && res.scenes.length > 0) {
      res.scenes.forEach((item) => {
    item.isActive = false
        item.isActive = false
        item.isChecked = false
        item.pictureUrl = item.background.src
        item.pptRemark = editorHtml.parseElemHtml(item.background.pptRemark)
@@ -2428,8 +2524,8 @@
      PPTArr.value = res.scenes
      PPTArr.value[0].isActive = true
      selectPPT.value = PPTArr.value[0]
      PPTArr.value.forEach((scene, index) => {
        if (res.scenes[index].voice) {
          scene.selectAudio = res.scenes[index].voice
@@ -2447,7 +2543,7 @@
          }
        ]
      }
      InitDigHuman.value = 1
      // 设置音频选择数据
      const firstScene = res.scenes[0]
      if (firstScene.voice) {
@@ -2492,14 +2588,8 @@
  selectTemplate.value = cloneDeep(templates.value[0])
  await getList()
  // 获取所有数字人信息并根据具体情况进行页面初始化
  GetAllHumanList()
  if (route.query.id) {
    await getCourseDetail(route.query.id)
  } else {
    coursesCreate()
  }
})
onUnmounted(() => {
@@ -3076,8 +3166,13 @@
          align-items: center;
          position: relative;
          > .ImgBox {
            width: 26%;
            width: 34%;
            margin: 0 auto;
            border-radius: 50%;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            img {
              width: 100%;
            }
easegen-front/src/views/pptTemplateList/index.vue
@@ -236,6 +236,7 @@
};
const createPPT = () => {
  sessionStorage.setItem( "courseInfo", "" )
  router.push('/chooseTemplate/index');
};