| | |
| | | {{ item }} |
| | | </el-tag> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogVisible1" title="提示" width="500px" style="height: 150px"> |
| | | <p style="margin-bottom: 20px;font-size: 18px">是否要将此模板应用到所有页面</p> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleTemplateSelection1(1)">应用当前页</el-button> |
| | | <el-button type="primary" @click="handleTemplateSelection1(2)">应用所有页</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogVisible2" title="提示" width="500px" style="height: 150px"> |
| | | <p style="margin-bottom: 20px;font-size: 18px">是否要将此数字人应用到所有页面</p> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="chooseHost1(1)">应用当前页</el-button> |
| | | <el-button type="primary" @click="chooseHost1(2)">应用所有页</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | const userStore = useUserStore() |
| | | const userId = computed(() => userStore.user.id) |
| | | const message = useMessage() |
| | | |
| | | const dialogVisible1=ref(false) |
| | | const dialogVisible2=ref(false) |
| | | const isEditing = ref(false) |
| | | const inputRef = ref(null) |
| | | const editName = ref('') |
| | | |
| | | const applyAllHost = ref(false) |
| | | //当前是否存在人脸 |
| | | const IsHaveFace = ref(false) |
| | | //当前是否完成ppt人脸校验 |
| | |
| | | inputRef.value.focus() |
| | | }) |
| | | } |
| | | const hostValue=ref({}) |
| | | const chooseHost = (item) => { |
| | | dialogVisible2.value = true |
| | | hostValue.value = item |
| | | } |
| | | const chooseHost1 = (index) => { |
| | | if (index==1){ |
| | | applyAllHost.value = false |
| | | applyHostToPages(hostValue.value) |
| | | dialogVisible2.value = false |
| | | }else if(index==2){ |
| | | applyAllHost.value = true |
| | | applyHostToPages(hostValue.value) |
| | | dialogVisible2.value = false |
| | | } |
| | | } |
| | | const applyHostToPages = (host) => { |
| | | hostList.value.forEach((el) => { |
| | | el.isActive = el.id === host.id |
| | | }) |
| | | |
| | | const pagesToUpdate = applyAllHost.value ? PPTArr.value : [selectPPT.value] |
| | | |
| | | pagesToUpdate.forEach(page => { |
| | | page.digitalHuman.host = host |
| | | initHumanPositon(host, page.digitalHuman) |
| | | }) |
| | | } |
| | | const saveEdit = () => { |
| | | isEditing.value = false |
| | | courseInfo.value.name = editName.value |
| | |
| | | const showTemplateTool = ref(false) |
| | | const showInnerPictureTool = ref(false) |
| | | const applyAllTemplate = ref(false) |
| | | |
| | | const templateSelection=ref({}) |
| | | const handleTemplateSelection = (template) => { |
| | | ElMessageBox.confirm( |
| | | '是否要将此模板应用到所有页面?', |
| | | '应用模板', |
| | | { |
| | | confirmButtonText: '应用到所有', |
| | | cancelButtonText: '仅当前页', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | // 用户点击"应用到所有" |
| | | dialogVisible1.value=true |
| | | templateSelection.value=template |
| | | console.log(templateSelection.value) |
| | | } |
| | | |
| | | const handleTemplateSelection1 = (index) => { |
| | | if (index==2){ |
| | | applyAllTemplate.value = true |
| | | chooseTemplate(template) |
| | | }).catch(() => { |
| | | // 用户点击"仅当前页"或关闭对话框 |
| | | chooseTemplate(templateSelection.value) |
| | | dialogVisible1.value=false |
| | | }else if(index==1){ |
| | | applyAllTemplate.value = false |
| | | chooseTemplate(template) |
| | | }) |
| | | chooseTemplate(templateSelection.value) |
| | | dialogVisible1.value=false |
| | | } |
| | | } |
| | | const handleChangeTool = (item) => { |
| | | rightTools.forEach((child) => { |
| | |
| | | selectPPT.value = item |
| | | } |
| | | |
| | | const chooseHost = (item) => { |
| | | hostList.value.forEach((el) => { |
| | | el.isActive = el.id === item.id |
| | | }) |
| | | |
| | | // 只更新当前选中的PPT页的数字人 |
| | | if (selectPPT.value) { |
| | | selectPPT.value.digitalHuman.host = item |
| | | initHumanPositon(item, selectPPT.value.digitalHuman) |
| | | } |
| | | } |
| | | // const chooseHost = (item) => { |
| | | // hostList.value.forEach((el) => { |
| | | // el.isActive = el.id === item.id |
| | | // }) |
| | | // |
| | | // // 只更新当前选中的PPT页的数字人 |
| | | // if (selectPPT.value) { |
| | | // selectPPT.value.digitalHuman.host = item |
| | | // initHumanPositon(item, selectPPT.value.digitalHuman) |
| | | // } |
| | | // } |
| | | |
| | | const initHumanPositon = (hostData, digitalHuman) => { |
| | | if (hostData.posture === 1) { |
| | |
| | | background-color: #1989fa; |
| | | } |
| | | } |
| | | .dialog-footer{ |
| | | float: right; |
| | | } |
| | | </style> |