feat(upload): 封面上传支持横版与前端压缩
- 新增 imageCompress 与 imagePresets,上传前按规格高质量等比压缩 - 短剧封面拆分为竖版/横版两个上传位,带建议尺寸提示 - 轮播图、创作者中心封面与分集封面接入压缩与提示
This commit is contained in:
1 parent
dea414739e
commit
923b7dce1e
9 files changed
+486
-87
No files matched your search
@@ -10,6 +10,7 @@ import { useRbac } from '@/stores/rbac'
|
||||
import { useDramaEdit } from './composables/useDramaEdit'
|
||||
import { useCreatorAccess } from './composables/useCreatorAccess'
|
||||
import { dramaStatusMeta } from './composables/useCreatorWorkspace'
|
||||
import { DRAMA_COVER_PORTRAIT, EPISODE_COVER } from '@/views/contentManagement/upload/imagePresets'
|
||||
|
||||
const { can } = useRbac()
|
||||
const canEdit = can('creator-center:drama:edit')
|
||||
@@ -148,15 +149,18 @@ function requestDramaCover(options) {
|
||||
<img v-if="infoForm.cover" :src="infoForm.cover" alt="" />
|
||||
<span v-else>无</span>
|
||||
</div>
|
||||
<el-upload
|
||||
v-if="canUpload"
|
||||
:show-file-list="false"
|
||||
accept="image/*"
|
||||
:http-request="requestDramaCover"
|
||||
:disabled="uploadingId !== null"
|
||||
>
|
||||
<el-button size="small"> <AppIcon :icon="AppIcons.upload" />上传封面 </el-button>
|
||||
</el-upload>
|
||||
<div class="creator-cover-actions">
|
||||
<el-upload
|
||||
v-if="canUpload"
|
||||
:show-file-list="false"
|
||||
accept="image/*"
|
||||
:http-request="requestDramaCover"
|
||||
:disabled="uploadingId !== null"
|
||||
>
|
||||
<el-button size="small"> <AppIcon :icon="AppIcons.upload" />上传封面 </el-button>
|
||||
</el-upload>
|
||||
<p class="creator-cover-hint">{{ DRAMA_COVER_PORTRAIT.hint }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="预告片地址">
|
||||
@@ -353,14 +357,17 @@ function requestDramaCover(options) {
|
||||
<img v-if="episodeForm.cover" :src="episodeForm.cover" alt="" />
|
||||
<span v-else>无</span>
|
||||
</div>
|
||||
<el-upload
|
||||
v-if="canUpload"
|
||||
:show-file-list="false"
|
||||
accept="image/*"
|
||||
:http-request="(options) => requestEpisodeCover({ id: episodeEditingId }, options)"
|
||||
>
|
||||
<el-button size="small"> <AppIcon :icon="AppIcons.upload" />上传封面 </el-button>
|
||||
</el-upload>
|
||||
<div class="creator-cover-actions">
|
||||
<el-upload
|
||||
v-if="canUpload"
|
||||
:show-file-list="false"
|
||||
accept="image/*"
|
||||
:http-request="(options) => requestEpisodeCover({ id: episodeEditingId }, options)"
|
||||
>
|
||||
<el-button size="small"> <AppIcon :icon="AppIcons.upload" />上传封面 </el-button>
|
||||
</el-upload>
|
||||
<p class="creator-cover-hint">{{ EPISODE_COVER.hint }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="episodeEditingId" label="集号">
|
||||
|
||||
Reference in new issue
Block a user