Skip to content

Commit 8ebe4f3

Browse files
committed
[fix]1.延时关闭发布dialog以便于详情可以获取真实数据;2.去掉上传封面的时候的视频操作按钮,以便于不误导用户这里可以操作;3.去掉视频截图的宽高限制展示不变形的图片;4.模型修改的时候回显文件上传状态
1 parent 4215476 commit 8ebe4f3

7 files changed

Lines changed: 34 additions & 8 deletions

File tree

src/components/community/modules/ModelCard.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
return videoUrl
100100
}
101101
const separator = videoUrl.includes('?') ? '&' : '?'
102-
return `${videoUrl}${separator}x-oss-process=video/snapshot,t_0000,f_jpg,w_300,h_600`
102+
return `${videoUrl}${separator}x-oss-process=video/snapshot,t_0000,f_jpg`
103103
}
104104
105105
const currentMediaSrc = computed(() => {
@@ -178,6 +178,7 @@
178178
<video
179179
v-if="isVideo && isHovering && currentMediaSrc"
180180
:src="currentMediaSrc"
181+
controls
181182
class="absolute inset-0 w-full h-full object-cover transition-all duration-300"
182183
:class="{
183184
'opacity-0': !props.imageLoaded,

src/components/model-select/modules/ModelCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}
5454
// 添加OSS视频截图处理参数
5555
const separator = videoUrl.includes('?') ? '&' : '?'
56-
return `${videoUrl}${separator}x-oss-process=video/snapshot,t_000,f_jpg,w_300,h_600`
56+
return `${videoUrl}${separator}x-oss-process=video/snapshot,t_000,f_jpg`
5757
}
5858
5959
// 当前显示的媒体源

src/components/modules/vUpload/index.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</template>
5050

5151
<script setup lang="ts">
52-
import { ref, computed } from 'vue'
52+
import { ref, computed, watchEffect } from 'vue'
5353
import { NButton } from 'naive-ui'
5454
import { DEFAULT_ALLOWED_EXTENSIONS } from './constants'
5555
import { UploadProps } from './types'
@@ -68,6 +68,19 @@
6868
}
6969
)
7070
71+
// 当传入fileName时,设置为已上传完成状态
72+
watchEffect(() => {
73+
if (props.fileName) {
74+
disableUpload.value = true
75+
uploadSuccessful.value = true
76+
emit('progress', 100)
77+
emit('uploadInfo', {
78+
fileName: props.fileName,
79+
status: 'complete'
80+
})
81+
}
82+
})
83+
7184
function highlight(e: DragEvent) {
7285
preventDefaults(e)
7386
isHighlighted.value = true

src/components/modules/vUpload/vUploadImage.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@
8181
}
8282
}
8383
84+
const videoRef = ref<HTMLVideoElement | null>(null)
85+
const handleVideoLoad = () => {
86+
if (videoRef.value) {
87+
videoRef.value.controls = false
88+
}
89+
}
90+
8491
onMounted(() => {
8592
let previewPrc = props.previewPrc as string
8693
if (previewPrc.includes('.mp4')) {
87-
previewPrc = `${previewPrc}?x-oss-process=video/snapshot,t_0000,f_jpg,w_300,h_600`
94+
previewPrc = `${previewPrc}?x-oss-process=video/snapshot,t_0000,f_jpg`
8895
}
8996
mediaSrc.value = previewPrc
9097
})
@@ -115,7 +122,8 @@
115122
:src="mediaSrc"
116123
class="block object-cover w-full h-full rounded-lg absolute left-0 top-0 z-10"
117124
muted
118-
controls
125+
ref="videoRef"
126+
@load="handleVideoLoad"
119127
/>
120128

121129
<!-- 图片预览 -->

src/views/btnPublish/dialogModel.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@
355355
await create_models(tempData)
356356
}
357357
useToaster.success(t('publish.model.success'))
358-
onDialogClose()
358+
setTimeout(() => {
359+
onDialogClose()
360+
}, 1500)
359361
}
360362
const onDialogClose = () => {
361363
modelStoreObject.setDialogStatus(false, 0)

src/views/btnPublish/dialogWorkflow.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@
378378
}
379379
380380
useToaster.success(t('publish.workflow.success'))
381-
onDialogClose()
381+
setTimeout(() => {
382+
onDialogClose()
383+
}, 1500)
382384
}
383385
const onDialogClose = () => {
384386
modelStoreObject.setDialogStatusWorkflow(false, 0)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.22
1+
1.2.23

0 commit comments

Comments
 (0)