Merge branch 'dev_vite' of ssh://18.167.251.121:10002/aidlab/aida_front into dev_vite
This commit is contained in:
@@ -349,6 +349,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in newVideoList"
|
||||||
|
:key="item.taskId || index"
|
||||||
|
class="result-video-container new-video-container"
|
||||||
|
>
|
||||||
|
<video
|
||||||
|
:ref="el => setNewVideoRef(el, index)"
|
||||||
|
:src="item.videoUrl"
|
||||||
|
controlslist="nodownload nofullscreen noremoteplayback"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<div class="control-container" @click.stop>
|
||||||
|
<div class="icon-list">
|
||||||
|
<SvgIcon
|
||||||
|
class="play-icon"
|
||||||
|
@click.stop="handlePlayNewVideo(index)"
|
||||||
|
:name="isNewVideoPlaying(index) ? 'CPause' : 'CPlay'"
|
||||||
|
size="20"
|
||||||
|
color="#ffffff"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -434,7 +457,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
const firstFrameImage = ref<any | null>(null)
|
const firstFrameImage = ref<any | null>(null)
|
||||||
const lastFrameImage = ref<any | null>(null)
|
const lastFrameImage = ref<any | null>(null)
|
||||||
|
const newVideoList = ref([])
|
||||||
const promptInputRef = useTemplateRef<HTMLTextAreaElement>('promptInputRef')
|
const promptInputRef = useTemplateRef<HTMLTextAreaElement>('promptInputRef')
|
||||||
const prompt = computed(() => {
|
const prompt = computed(() => {
|
||||||
if (videoType.value === 2) {
|
if (videoType.value === 2) {
|
||||||
@@ -608,11 +631,12 @@ export default defineComponent({
|
|||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
const getPoseTransformData = () => {
|
const getPoseTransformData = () => {
|
||||||
|
const currentImage = productimg.scaleImageList[productimg.scaleImageIndex]
|
||||||
const params: any = {
|
const params: any = {
|
||||||
poseId: productimg.selectPose,
|
poseId: productimg.selectPose,
|
||||||
projectId: productimg.selectObject.id,
|
projectId: productimg.selectObject.id,
|
||||||
productImage: getMinioUrl(
|
productImage: getMinioUrl(
|
||||||
productimg.scaleImageList[productimg.scaleImageIndex].sourceUrl
|
currentImage.sourceUrl || currentImage.productImage
|
||||||
),
|
),
|
||||||
modelName: speed.speedData.value,
|
modelName: speed.speedData.value,
|
||||||
mode: videoType.value,
|
mode: videoType.value,
|
||||||
@@ -713,9 +737,11 @@ export default defineComponent({
|
|||||||
data = getPoseTransformData()
|
data = getPoseTransformData()
|
||||||
}
|
}
|
||||||
productimg.productimgIsProductimg = true
|
productimg.productimgIsProductimg = true
|
||||||
if (productimg.openType != 'add' || productimg.generateCourse) {
|
if (
|
||||||
|
(productimg.openType != 'add' || productimg.generateCourse) &&
|
||||||
|
!isPoseTransfer.value
|
||||||
|
) {
|
||||||
await new Promise(async (res, reject) => {
|
await new Promise(async (res, reject) => {
|
||||||
console.log(productimg.generateCourse, productimg.selectGenerate)
|
|
||||||
await props.onlike(
|
await props.onlike(
|
||||||
productimg.generateCourse,
|
productimg.generateCourse,
|
||||||
productimg.selectGenerate.listType
|
productimg.selectGenerate.listType
|
||||||
@@ -724,10 +750,7 @@ export default defineComponent({
|
|||||||
res('')
|
res('')
|
||||||
}, 1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
// await props.onlike(null,null,productimg.selectGenerate.listType,'onLike')
|
|
||||||
}
|
}
|
||||||
// setPrductimg([{taskId:"f785fbbf-425c-4d9b-b4d0-0f38f480c64e-83"}])
|
|
||||||
// return
|
|
||||||
Https.axiosPost(url, data)
|
Https.axiosPost(url, data)
|
||||||
.then(rv => {
|
.then(rv => {
|
||||||
productimg.productimgRemProductimg = true
|
productimg.productimgRemProductimg = true
|
||||||
@@ -749,7 +772,6 @@ export default defineComponent({
|
|||||||
rv.forEach((item: any) => {
|
rv.forEach((item: any) => {
|
||||||
arr.push(item.taskId)
|
arr.push(item.taskId)
|
||||||
})
|
})
|
||||||
console.log(productimg.selectGenerate)
|
|
||||||
productimg.generateCourse = {
|
productimg.generateCourse = {
|
||||||
...rv[0],
|
...rv[0],
|
||||||
prompt: productimg.productimgSearchName,
|
prompt: productimg.productimgSearchName,
|
||||||
@@ -822,13 +844,17 @@ export default defineComponent({
|
|||||||
//防止取消后有正在执行的获取状态
|
//防止取消后有正在执行的获取状态
|
||||||
let isEnd = false
|
let isEnd = false
|
||||||
if (rv[0].status == 'Success') {
|
if (rv[0].status == 'Success') {
|
||||||
productimg.generateCourse.url = rv[0].url
|
if (productimg.openType === 'edit' && isPoseTransfer.value) {
|
||||||
productimg.generateCourse.status = rv[0].status
|
newVideoList.value.push(rv[0])
|
||||||
productimg.generateCourse.designOutfitUrl = rv[0].url
|
} else {
|
||||||
if (rv[0]?.videoUrl) {
|
productimg.generateCourse.url = rv[0].url
|
||||||
productimg.generateCourse.firstFrameUrl = rv[0].firstFrameUrl
|
productimg.generateCourse.status = rv[0].status
|
||||||
productimg.generateCourse.videoUrl = rv[0].videoUrl
|
productimg.generateCourse.designOutfitUrl = rv[0].url
|
||||||
productimg.generateCourse.gifUrl = rv[0].gifUrl
|
if (rv[0]?.videoUrl) {
|
||||||
|
productimg.generateCourse.firstFrameUrl = rv[0].firstFrameUrl
|
||||||
|
productimg.generateCourse.videoUrl = rv[0].videoUrl
|
||||||
|
productimg.generateCourse.gifUrl = rv[0].gifUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isEnd = true
|
isEnd = true
|
||||||
clearInterval(remPrductimgTime)
|
clearInterval(remPrductimgTime)
|
||||||
@@ -937,7 +963,7 @@ export default defineComponent({
|
|||||||
status: any,
|
status: any,
|
||||||
listType: string
|
listType: string
|
||||||
) => {
|
) => {
|
||||||
console.log(list[index])
|
console.log(list[index], dialogueIndex, status, listType)
|
||||||
productimg.scaleImageList = list
|
productimg.scaleImageList = list
|
||||||
productimg.scaleImageIndex = index
|
productimg.scaleImageIndex = index
|
||||||
scaleImage.value = true
|
scaleImage.value = true
|
||||||
@@ -1102,6 +1128,43 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 新生成视频列表的引用和播放状态
|
||||||
|
const newVideoRefs = ref<Record<number, HTMLVideoElement | null>>({})
|
||||||
|
const newVideoPlayingStates = ref<Record<number, boolean>>({})
|
||||||
|
|
||||||
|
const setNewVideoRef = (el: HTMLVideoElement | null, index: number) => {
|
||||||
|
if (el) {
|
||||||
|
newVideoRefs.value[index] = el
|
||||||
|
newVideoPlayingStates.value[index] = !el.paused
|
||||||
|
el.addEventListener('play', () => {
|
||||||
|
newVideoPlayingStates.value[index] = true
|
||||||
|
})
|
||||||
|
el.addEventListener('pause', () => {
|
||||||
|
newVideoPlayingStates.value[index] = false
|
||||||
|
})
|
||||||
|
el.addEventListener('ended', () => {
|
||||||
|
newVideoPlayingStates.value[index] = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const isNewVideoPlaying = (index: number) => {
|
||||||
|
return newVideoPlayingStates.value[index] || false
|
||||||
|
}
|
||||||
|
|
||||||
|
const handlePlayNewVideo = (index: number) => {
|
||||||
|
console.log('视频播放')
|
||||||
|
const video = newVideoRefs.value[index]
|
||||||
|
if (video) {
|
||||||
|
if (video.paused) {
|
||||||
|
video.play().catch(err => {
|
||||||
|
console.error('播放视频失败:', err)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
video.pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
const setSelectPose = (item: any, index: number) => {
|
const setSelectPose = (item: any, index: number) => {
|
||||||
productimg.poseList.forEach((poseItem: any) => {
|
productimg.poseList.forEach((poseItem: any) => {
|
||||||
poseItem.isChecked = false
|
poseItem.isChecked = false
|
||||||
@@ -1262,7 +1325,11 @@ export default defineComponent({
|
|||||||
showProductList,
|
showProductList,
|
||||||
fullProductImages,
|
fullProductImages,
|
||||||
isPoseTransfer,
|
isPoseTransfer,
|
||||||
showCompare
|
showCompare,
|
||||||
|
newVideoList,
|
||||||
|
setNewVideoRef,
|
||||||
|
handlePlayNewVideo,
|
||||||
|
isNewVideoPlaying
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -1578,6 +1645,7 @@ export default defineComponent({
|
|||||||
.play-icon {
|
.play-icon {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1758,6 +1826,10 @@ export default defineComponent({
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
&.new-video-container{
|
||||||
|
margin-left: 2rem;
|
||||||
|
column-gap: 2rem;
|
||||||
|
}
|
||||||
video {
|
video {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -1787,6 +1859,7 @@ export default defineComponent({
|
|||||||
.play-icon {
|
.play-icon {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1922,4 +1995,12 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.posetransfer{
|
||||||
|
.loadBox {
|
||||||
|
.imgBox {
|
||||||
|
overflow-x: auto;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -203,7 +203,10 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const unLike = (item)=>{
|
const unLike = (item)=>{
|
||||||
data.unLikeList.push(item)
|
const hasSame = data.unLikeList.some((unlikeItem:any)=>unlikeItem?.id === item?.id)
|
||||||
|
if(!hasSame){
|
||||||
|
data.unLikeList.push(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let cleardata = async ()=>{
|
let cleardata = async ()=>{
|
||||||
let list = []
|
let list = []
|
||||||
@@ -220,10 +223,12 @@ export default defineComponent({
|
|||||||
const { newLike, ...rest } = item; // 解构赋值移除 newLike
|
const { newLike, ...rest } = item; // 解构赋值移除 newLike
|
||||||
return item.oldSort ? { ...rest, sort: item.oldSort } : rest;
|
return item.oldSort ? { ...rest, sort: item.oldSort } : rest;
|
||||||
});
|
});
|
||||||
|
const addIdSet = new Set(generateCourse.map((item:any)=>item?.id))
|
||||||
|
const deleteList = data.unLikeList.filter((item:any)=>!addIdSet.has(item?.id))
|
||||||
let emitData = {
|
let emitData = {
|
||||||
status:'add',
|
status:'add',
|
||||||
addList:generateCourse,
|
addList:generateCourse,
|
||||||
deleteList:data.unLikeList,
|
deleteList,
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('editToolsSuccess',emitData,'batch')
|
emit('editToolsSuccess',emitData,'batch')
|
||||||
@@ -489,9 +494,6 @@ export default defineComponent({
|
|||||||
// .ant-modal-mask{
|
// .ant-modal-mask{
|
||||||
// position: absolute;
|
// position: absolute;
|
||||||
// }
|
// }
|
||||||
.ant-modal-wrap,.ant-modal-mask{
|
|
||||||
|
|
||||||
}
|
|
||||||
> .ant-modal-root{
|
> .ant-modal-root{
|
||||||
> .ant-modal-centered{
|
> .ant-modal-centered{
|
||||||
> .fullScreen{
|
> .fullScreen{
|
||||||
|
|||||||
Reference in New Issue
Block a user