diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 513ad2b..e78aa17 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -265,3 +265,19 @@ export const formatUploadSpeed = (bytesPerSecond: number): string => { return `${(bytesPerSecond / (1024 * 1024)).toFixed(2)} MB/s`; } }; + + export function convertVideoUrlToCoverUrl(videoUrl: string): string { + if (!videoUrl || typeof videoUrl !== 'string') { + console.error('Invalid video URL'); + return ''; + } + + const urlWithCovers = videoUrl.replace('/videos/', '/covers/'); + + const lastDotIndex = urlWithCovers.lastIndexOf('.'); + if (lastDotIndex !== -1) { + return urlWithCovers.substring(0, lastDotIndex) + '.jpg'; + } + + return urlWithCovers + '.jpg'; +} diff --git a/src/views/creative-generation-workshop/manuscript/components/edit-form/index.vue b/src/views/creative-generation-workshop/manuscript/components/edit-form/index.vue index 8523ec7..025c97e 100644 --- a/src/views/creative-generation-workshop/manuscript/components/edit-form/index.vue +++ b/src/views/creative-generation-workshop/manuscript/components/edit-form/index.vue @@ -26,7 +26,6 @@ export const INITIAL_VIDEO_INFO = { name: '', size: '', percent: 0, - poster: '', time: '', uploadSpeed: '0 KB/s', startTime: 0, @@ -76,7 +75,6 @@ export default { getVideoInfo(file) .then(({ duration, firstFrame }) => { - console.log({ duration, firstFrame }); formData.value.videoInfo.poster = firstFrame; formData.value.videoInfo.time = formatDuration(duration); emit('updateVideoInfo', formData.value.videoInfo); diff --git a/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/constants.ts b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/constants.ts new file mode 100644 index 0000000..19964f0 --- /dev/null +++ b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/constants.ts @@ -0,0 +1,40 @@ +export const INITIAL_FORM = { + audit_status: '', + sort_column: undefined, + sort_order: undefined, +}; + +export const TABLE_COLUMNS = [ + { + title: '序号', + dataIndex: 'uid', + width: 120, + fixed: 'left', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '内容稿件标题', + dataIndex: 'title', + width: 220, + }, + { + title: '审核状态', + dataIndex: 'audit_status', + width: 120, + }, + { + title: '稿件类型', + dataIndex: 'type', + width: 120, + }, + { + title: '最后修改时间', + dataIndex: 'last_modified_at', + width: 160, + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, +]; diff --git a/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/index.vue b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/index.vue new file mode 100644 index 0000000..469cbfb --- /dev/null +++ b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/index.vue @@ -0,0 +1,267 @@ + + + diff --git a/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/style.scss b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/style.scss new file mode 100644 index 0000000..ee9ff54 --- /dev/null +++ b/src/views/creative-generation-workshop/manuscript/components/share-manuscript-modal/style.scss @@ -0,0 +1,17 @@ +.share-manuscript-modal { + .filter-row-item { + .label { + color: var(--Text-1, #211f24); + font-family: $font-family-regular; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + } + .arco-modal-body { + height: 464px; + display: flex; + flex-direction: column; + } +} diff --git a/src/views/creative-generation-workshop/manuscript/edit/index.vue b/src/views/creative-generation-workshop/manuscript/edit/index.vue index eec286f..0d93070 100644 --- a/src/views/creative-generation-workshop/manuscript/edit/index.vue +++ b/src/views/creative-generation-workshop/manuscript/edit/index.vue @@ -5,14 +5,14 @@ import CancelEditModal from './cancel-edit-modal.vue'; import { getWorksDetail, putWorksUpdate } from '@/api/all/generationWorkshop'; import { EnumManuscriptType } from '@/views/creative-generation-workshop/manuscript/list/constants.ts'; -const INITIAL_DATA = { - title: '', - content: '', - type: EnumManuscriptType.Video, - // project_ids: [], - files: [], - videoInfo: cloneDeep(INITIAL_VIDEO_INFO), -}; +// const INITIAL_DATA = { +// title: '', +// content: '', +// type: EnumManuscriptType.Video, +// // project_ids: [], +// files: [], +// videoInfo: cloneDeep(INITIAL_VIDEO_INFO), +// }; export default { components: { @@ -41,6 +41,11 @@ export default { const onSave = async (check = false) => { formRef.value?.validate().then(async () => { + if (dataSource.value.videoInfo.uploadStatus === ENUM_UPLOAD_STATUS.UPLOADING) { + AMessage.warning('有视频正在上传中,请等待上传完成后再提交'); + return; + } + const filteredWorks = omit(dataSource.value, 'videoInfo'); const { code, data } = await putWorksUpdate({ id: workId.value, ...filteredWorks }); if (code === 200) { @@ -62,8 +67,9 @@ export default { const getData = async () => { const { code, data } = await getWorksDetail(workId.value); if (code === 200) { - dataSource.value = cloneDeep(data); - remoteDataSource.value = cloneDeep(data); + const _data = { ...data, videoInfo: cloneDeep(INITIAL_VIDEO_INFO) }; + dataSource.value = cloneDeep(_data); + remoteDataSource.value = cloneDeep(_data); } }; const onChange = (val) => { @@ -76,7 +82,7 @@ export default { router.push({ name: 'ManuscriptList' }); }; onMounted(() => { - init(); + // init(); workId && getData(); }); diff --git a/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/constants.ts b/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/constants.ts index 84c8903..2020a01 100644 --- a/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/constants.ts +++ b/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/constants.ts @@ -18,11 +18,11 @@ export const TABLE_COLUMNS = [ dataIndex: 'title', width: 240, }, - { - title: '所属项目', - dataIndex: 'projects', - width: 240, - }, + // { + // title: '所属项目', + // dataIndex: 'projects', + // width: 240, + // }, { title: '稿件类型', dataIndex: 'type', @@ -43,7 +43,7 @@ export const TABLE_COLUMNS = [ }, { title: '上传人员', - dataIndex: 'uploader.name', + dataIndex: 'uploader', width: 180, }, { @@ -56,7 +56,7 @@ export const TABLE_COLUMNS = [ }, { title: '最后修改人员', - dataIndex: 'last_modifier.name', + dataIndex: 'last_modifier', width: 180, }, { diff --git a/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/index.vue b/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/index.vue index 9d9ac11..b39cac1 100644 --- a/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/index.vue +++ b/src/views/creative-generation-workshop/manuscript/list/components/manuscript-table/index.vue @@ -41,9 +41,6 @@ - +