feat: 内容稿件列表相关接口对接
This commit is contained in:
55
src/api/all/generationWorkshop.ts
Normal file
55
src/api/all/generationWorkshop.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import Http from '@/api';
|
||||||
|
|
||||||
|
// 内容稿件-列表
|
||||||
|
export const getWorksList = (params = {}) => {
|
||||||
|
return Http.get('/v1/works/list', params);
|
||||||
|
};
|
||||||
|
// 内容稿件-批量添加
|
||||||
|
export const postWorksBatch = (params = {}) => {
|
||||||
|
return Http.post('/v1/works/batch', params);
|
||||||
|
};
|
||||||
|
// 内容稿件-修改
|
||||||
|
export const putWorksUpdate = (params = {}) => {
|
||||||
|
const { id, ...rest } = params as { id: string; [key: string]: any };
|
||||||
|
return Http.put(`/v1/works/${id}`, rest);
|
||||||
|
};
|
||||||
|
// 内容稿件-删除
|
||||||
|
export const deleteWork = (id: string) => {
|
||||||
|
return Http.delete(`/v1/works/${id}`);
|
||||||
|
};
|
||||||
|
// 内容稿件-分页
|
||||||
|
export const getWorksPage = (params = {}) => {
|
||||||
|
return Http.get('/v1/works', params);
|
||||||
|
};
|
||||||
|
// 内容稿件-详情
|
||||||
|
export const getWorksDetail = (id: string) => {
|
||||||
|
return Http.get(`/v1/works/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 内容稿件审核-分页
|
||||||
|
export const getWorkAuditsPage = (params = {}) => {
|
||||||
|
return Http.get('/v1/work-audits', params);
|
||||||
|
};
|
||||||
|
// 内容稿件审核-详情
|
||||||
|
export const getWorkAuditsDetail = (id: string) => {
|
||||||
|
return Http.get(`/v1/work-audits/${id}`);
|
||||||
|
};
|
||||||
|
// 内容稿件-审核
|
||||||
|
export const patchWorkAuditsAudit = (params = {}) => {
|
||||||
|
const { id: auditId, ...rest } = params as { id: string; [key: string]: any };
|
||||||
|
return Http.patch(`/v1/work-audits/${auditId}/audit`, rest);
|
||||||
|
};
|
||||||
|
// 内容稿件-批量审核
|
||||||
|
export const patchWorkAuditsBatchAudit = (params = {}) => {
|
||||||
|
return Http.patch('/v1/work-audits/batch-audit', params);
|
||||||
|
};
|
||||||
|
// 内容稿件审核-修改
|
||||||
|
export const putWorkAuditsUpdate = (params = {}) => {
|
||||||
|
const { id: auditId, ...rest } = params as { id: string; [key: string]: any };
|
||||||
|
return Http.put(`/v1/work-audits/${auditId}`, rest);
|
||||||
|
};
|
||||||
|
// 内容稿件审核-审核通过
|
||||||
|
export const putWorkAuditsAuditPass = (params = {}) => {
|
||||||
|
const { id: auditId, ...rest } = params as { id: string; [key: string]: any };
|
||||||
|
return Http.put(`/v1/work-audits/${auditId}/audit-pass`, rest);
|
||||||
|
};
|
||||||
@ -71,7 +71,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'check-list',
|
path: 'check-list',
|
||||||
name: 'ManuscriptCheck',
|
name: 'ManuscriptCheckList',
|
||||||
meta: {
|
meta: {
|
||||||
locale: '内容稿件审核',
|
locale: '内容稿件审核',
|
||||||
requiresAuth: false,
|
requiresAuth: false,
|
||||||
@ -80,6 +80,19 @@ const COMPONENTS: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
component: () => import('@/views/creative-generation-workshop/manuscript/check/index.vue'),
|
component: () => import('@/views/creative-generation-workshop/manuscript/check/index.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'check/:id',
|
||||||
|
name: 'ManuscriptCheck',
|
||||||
|
meta: {
|
||||||
|
locale: '内容稿件审核',
|
||||||
|
requiresAuth: false,
|
||||||
|
requireLogin: false,
|
||||||
|
roles: ['*'],
|
||||||
|
hideInMenu: true,
|
||||||
|
activeMenu: 'ManuscriptCheckList',
|
||||||
|
},
|
||||||
|
component: () => import('@/views/creative-generation-workshop/manuscript-analysis/components/check/index.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
<script lang="jsx">
|
||||||
|
import { Button, Message as AMessage } from '@arco-design/web-vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup(props, { emit, expose }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const workId = ref(route.params.id);
|
||||||
|
|
||||||
|
const onBack = () => {
|
||||||
|
router.push({ name: 'ManuscriptCheckList' });
|
||||||
|
};
|
||||||
|
const renderFooterRow = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button size="medium" type="outline" class="mr-12px">
|
||||||
|
退出
|
||||||
|
</Button>
|
||||||
|
<Button size="medium" type="outline" class="mr-12px">
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
<Button type="primary" size="medium">
|
||||||
|
通过审核
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
return () => (
|
||||||
|
<>
|
||||||
|
<div class="manuscript-check-wrap">
|
||||||
|
<div class="flex items-center mb-8px">
|
||||||
|
<span class="cts color-#4E5969 cursor-pointer" onClick={onBack}>
|
||||||
|
内容稿件审核
|
||||||
|
</span>
|
||||||
|
<icon-oblique-line size="12" class="color-#C9CDD4 mx-4px" />
|
||||||
|
<span class="cts bold !color-#1D2129">批量审核内容稿件</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end items-center px-16px py-20px w-full bg-#fff footer-row">{renderFooterRow()}</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './style.scss';
|
||||||
|
</style>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
$footer-height: 68px;
|
||||||
|
.manuscript-check-wrap {
|
||||||
|
height: calc(100% - 72px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.cts {
|
||||||
|
color: #939499;
|
||||||
|
font-family: $font-family-regular;
|
||||||
|
font-size: 14px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px;
|
||||||
|
&.bold {
|
||||||
|
font-family: $font-family-medium;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.footer-row {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: $sidebar-width;
|
||||||
|
width: calc(100% - $sidebar-width);
|
||||||
|
border-top: 1px solid #e6e6e8;
|
||||||
|
height: $footer-height;
|
||||||
|
}
|
||||||
@ -63,15 +63,8 @@ export default {
|
|||||||
AMessage.error('最多只能上传18张图片!');
|
AMessage.error('最多只能上传18张图片!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const newFile = {
|
|
||||||
id: Date.now(),
|
|
||||||
name: file.name,
|
|
||||||
url: URL.createObjectURL(file),
|
|
||||||
size: file.size,
|
|
||||||
type: file.type,
|
|
||||||
};
|
|
||||||
|
|
||||||
props.modelValue.files.push(newFile);
|
props.modelValue.files.push(URL.createObjectURL(file));
|
||||||
emit('change');
|
emit('change');
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -79,7 +72,6 @@ export default {
|
|||||||
const handleDeleteFile = (index) => {
|
const handleDeleteFile = (index) => {
|
||||||
props.modelValue.files.splice(index, 1);
|
props.modelValue.files.splice(index, 1);
|
||||||
emit('change');
|
emit('change');
|
||||||
AMessage.success('删除成功!');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取项目列表
|
// 获取项目列表
|
||||||
@ -136,12 +128,14 @@ export default {
|
|||||||
placeholder="请输入标题"
|
placeholder="请输入标题"
|
||||||
size="large"
|
size="large"
|
||||||
class="!w-500px"
|
class="!w-500px"
|
||||||
|
maxLength={30}
|
||||||
|
show-word-limit
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="作品描述" field="desc">
|
<FormItem label="作品描述" field="desc">
|
||||||
<Textarea
|
<Textarea
|
||||||
v-model={props.modelValue.desc}
|
v-model={props.modelValue.content}
|
||||||
onChange={() => emit('change')}
|
onChange={() => emit('change')}
|
||||||
placeholder="请输入作品描述"
|
placeholder="请输入作品描述"
|
||||||
size="large"
|
size="large"
|
||||||
@ -158,8 +152,8 @@ export default {
|
|||||||
label: () => (
|
label: () => (
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<span class="cts !color-#211F24 mr-4px">图片</span>
|
<span class="cts !color-#211F24 mr-4px">图片</span>
|
||||||
<span class="cts mr-8px">{`(${props.modelValue.files?.length ?? 0}/18)`}</span>
|
<span class="cts mr-8px !color-#939499">{`(${props.modelValue.files?.length ?? 0}/18)`}</span>
|
||||||
<span class="cts">第一张为首图,支持拖拽排序</span>
|
<span class="cts !color-#939499">第一张为首图,支持拖拽排序</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
@ -169,12 +163,8 @@ export default {
|
|||||||
{/* 已上传的图片列表 */}
|
{/* 已上传的图片列表 */}
|
||||||
<VueDraggable v-model={props.modelValue.files} class="grid grid-cols-7 gap-8px">
|
<VueDraggable v-model={props.modelValue.files} class="grid grid-cols-7 gap-8px">
|
||||||
{props.modelValue.files?.map((file, index) => (
|
{props.modelValue.files?.map((file, index) => (
|
||||||
<div key={file.id} class="group relative cursor-move">
|
<div key={index} class="group relative cursor-move">
|
||||||
<img
|
<img src={file} class="w-100px h-100px object-cover rounded-8px border-1px border-#E6E6E8" />
|
||||||
src={file.url}
|
|
||||||
alt={file.name}
|
|
||||||
class="w-100px h-100px object-cover rounded-8px border-1px border-#E6E6E8"
|
|
||||||
/>
|
|
||||||
<img
|
<img
|
||||||
src={icon1}
|
src={icon1}
|
||||||
width={16}
|
width={16}
|
||||||
|
|||||||
@ -1,5 +1,53 @@
|
|||||||
<template>
|
<script lang="jsx">
|
||||||
<div class="manuscript-detail-wrap">
|
import { Button, Message as AMessage } from '@arco-design/web-vue';
|
||||||
<div class="bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid mb-24px">详情</div>
|
|
||||||
</div>
|
export default {
|
||||||
</template>
|
setup(props, { emit, expose }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const workId = ref(route.params.id);
|
||||||
|
|
||||||
|
const onBack = () => {
|
||||||
|
router.push({ name: 'ManuscriptList' });
|
||||||
|
};
|
||||||
|
const renderFooterRow = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button size="medium" type="outline" class="mr-12px" onClick={onBack}>
|
||||||
|
退出
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size="medium"
|
||||||
|
type="outline"
|
||||||
|
class="mr-12px"
|
||||||
|
onClick={() => router.push(`/manuscript/edit/${workId.value}`)}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button type="primary" size="medium" onClick={() => router.push(`/manuscript/check/${workId.value}`)}>
|
||||||
|
去审核
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
return () => (
|
||||||
|
<>
|
||||||
|
<div class="manuscript-check-wrap">
|
||||||
|
<div class="flex items-center mb-8px">
|
||||||
|
<span class="cts color-#4E5969 cursor-pointer" onClick={onBack}>
|
||||||
|
内容稿件列表
|
||||||
|
</span>
|
||||||
|
<icon-oblique-line size="12" class="color-#C9CDD4 mx-4px" />
|
||||||
|
<span class="cts bold !color-#1D2129">内容稿件详情</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end items-center px-16px py-20px w-full bg-#fff footer-row">{renderFooterRow()}</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './style.scss';
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,3 +1,25 @@
|
|||||||
.manuscript-edit-wrap {
|
$footer-height: 68px;
|
||||||
|
.manuscript-detail-wrap {
|
||||||
|
height: calc(100% - 72px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.cts {
|
||||||
|
color: #939499;
|
||||||
|
font-family: $font-family-regular;
|
||||||
|
font-size: 14px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px;
|
||||||
|
&.bold {
|
||||||
|
font-family: $font-family-medium;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.footer-row {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: $sidebar-width;
|
||||||
|
width: calc(100% - $sidebar-width);
|
||||||
|
border-top: 1px solid #e6e6e8;
|
||||||
|
height: $footer-height;
|
||||||
}
|
}
|
||||||
@ -2,6 +2,15 @@
|
|||||||
import { Button, Message as AMessage } from '@arco-design/web-vue';
|
import { Button, Message as AMessage } from '@arco-design/web-vue';
|
||||||
import EditForm from '../components/edit-form';
|
import EditForm from '../components/edit-form';
|
||||||
import CancelEditModal from './cancel-edit-modal.vue';
|
import CancelEditModal from './cancel-edit-modal.vue';
|
||||||
|
import { getWorksDetail, putWorksUpdate } from '@/api/all/generationWorkshop';
|
||||||
|
|
||||||
|
const INITIAL_DATA = {
|
||||||
|
title: '',
|
||||||
|
desc: '',
|
||||||
|
content: '',
|
||||||
|
project_ids: [],
|
||||||
|
files: [],
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -9,15 +18,18 @@ export default {
|
|||||||
},
|
},
|
||||||
setup(props, { emit, expose }) {
|
setup(props, { emit, expose }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
const cancelEditModal = ref(null);
|
const cancelEditModal = ref(null);
|
||||||
const dataSource = ref({});
|
const dataSource = ref({});
|
||||||
const editDataSource = ref({});
|
const remoteDataSource = ref({});
|
||||||
const uploadLoading = ref(false);
|
const uploadLoading = ref(false);
|
||||||
const isSaved = ref(false);
|
const isSaved = ref(false);
|
||||||
|
|
||||||
|
const workId = ref(route.params.id);
|
||||||
|
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
const isModified = !isEqual(dataSource.value, editDataSource.value);
|
const isModified = !isEqual(dataSource.value, remoteDataSource.value);
|
||||||
if (isModified && isSaved.value) {
|
if (isModified && isSaved.value) {
|
||||||
cancelEditModal.value?.open();
|
cancelEditModal.value?.open();
|
||||||
} else {
|
} else {
|
||||||
@ -25,31 +37,29 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSave = async (check = false) => {
|
||||||
formRef.value?.validate().then(() => {
|
formRef.value?.validate().then(async () => {
|
||||||
AMessage.success('保存成功');
|
const { code, data } = await putWorksUpdate({ id: workId.value, ...dataSource.value });
|
||||||
isSaved.value = true;
|
if (code === 200) {
|
||||||
console.log('success');
|
AMessage.success('保存成功');
|
||||||
|
isSaved.value = true;
|
||||||
|
|
||||||
|
if (check) {
|
||||||
|
router.push({ name: 'ManuscriptCheck', params: { id: workId.value } });
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const init = () => {
|
||||||
const onSubmitAndCheck = () => {
|
dataSource.value = cloneDeep(INITIAL_DATA);
|
||||||
console.log('onSubmitAndCheck');
|
remoteDataSource.value = cloneDeep(INITIAL_DATA);
|
||||||
isSaved.value = false;
|
|
||||||
};
|
};
|
||||||
|
const getData = async () => {
|
||||||
const getData = () => {
|
const { code, data } = await getWorksDetail(workId.value);
|
||||||
const _data = {
|
if (code === 200) {
|
||||||
id: 1,
|
dataSource.value = cloneDeep(data);
|
||||||
title: '',
|
remoteDataSource.value = cloneDeep(data);
|
||||||
desc: '',
|
}
|
||||||
content: '挖到宝了!这个平价好物让我素颜出门都自信✨挖到宝了!这个平价好物让我素颜出门都自信✨',
|
|
||||||
type: 1,
|
|
||||||
project_ids: [],
|
|
||||||
files: [],
|
|
||||||
};
|
|
||||||
dataSource.value = cloneDeep(_data);
|
|
||||||
editDataSource.value = cloneDeep(_data);
|
|
||||||
};
|
};
|
||||||
const handleFormChange = () => {
|
const handleFormChange = () => {
|
||||||
console.log('handleFormChange');
|
console.log('handleFormChange');
|
||||||
@ -58,7 +68,8 @@ export default {
|
|||||||
router.push({ name: 'ManuscriptList' });
|
router.push({ name: 'ManuscriptList' });
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData();
|
init();
|
||||||
|
workId && getData();
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
@ -79,10 +90,10 @@ export default {
|
|||||||
<Button size="medium" type="outline" onClick={onCancel} class="mr-12px">
|
<Button size="medium" type="outline" onClick={onCancel} class="mr-12px">
|
||||||
退出
|
退出
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="medium" type="outline" onClick={onSubmit} class="mr-12px">
|
<Button size="medium" type="outline" onClick={() => onSave()} class="mr-12px">
|
||||||
保存
|
保存
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="primary" size="medium" onClick={onSubmitAndCheck} loading={uploadLoading.value}>
|
<Button type="primary" size="medium" onClick={() => onSave(true)} loading={uploadLoading.value}>
|
||||||
保存并审核
|
保存并审核
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,7 +18,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="filter-row-item">
|
<div class="filter-row-item">
|
||||||
<span class="label">所属项目</span>
|
<span class="label">所属项目</span>
|
||||||
<CommonSelect placeholder="请选择所属项目" v-model="query.project_id" class="!w-166px" />
|
<CommonSelect
|
||||||
|
placeholder="请选择所属项目"
|
||||||
|
v-model="query.project_id"
|
||||||
|
:options="projects"
|
||||||
|
class="!w-166px"
|
||||||
|
@change="handleSearch"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-row-item">
|
<div class="filter-row-item">
|
||||||
<span class="label">序号</span>
|
<span class="label">序号</span>
|
||||||
@ -39,12 +45,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="filter-row-item">
|
<div class="filter-row-item">
|
||||||
<span class="label">审核状态</span>
|
<span class="label">审核状态</span>
|
||||||
<CommonSelect placeholder="请选择审核状态" v-model="query.audit_status" class="!w-166px" />
|
<CommonSelect
|
||||||
|
placeholder="全部"
|
||||||
|
:options="CHECK_STATUS"
|
||||||
|
v-model="query.audit_status"
|
||||||
|
class="!w-166px"
|
||||||
|
:multiple="false"
|
||||||
|
@change="handleSearch"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-row-item">
|
<div class="filter-row-item">
|
||||||
<span class="label">上传时间</span>
|
<span class="label">上传时间</span>
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model="published_at"
|
v-model="created_at"
|
||||||
size="medium"
|
size="medium"
|
||||||
allow-clear
|
allow-clear
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
@ -72,7 +85,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineEmits, defineProps } from 'vue';
|
import { defineEmits, defineProps } from 'vue';
|
||||||
|
import { CHECK_STATUS } from '@/views/creative-generation-workshop/manuscript/list/constants';
|
||||||
import CommonSelect from '@/components/common-select';
|
import CommonSelect from '@/components/common-select';
|
||||||
|
import { getProjectList } from '@/api/all/propertyMarketing';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
query: {
|
query: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -83,6 +99,7 @@ const props = defineProps({
|
|||||||
const emits = defineEmits('search', 'reset', 'update:query');
|
const emits = defineEmits('search', 'reset', 'update:query');
|
||||||
|
|
||||||
const created_at = ref([]);
|
const created_at = ref([]);
|
||||||
|
const projects = ref([]);
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
emits('update:query', props.query);
|
emits('update:query', props.query);
|
||||||
@ -92,6 +109,12 @@ const handleSearch = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onDateChange = (value) => {
|
const onDateChange = (value) => {
|
||||||
|
if (!value) {
|
||||||
|
props.query.created_at = [];
|
||||||
|
handleSearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const [start, end] = value;
|
const [start, end] = value;
|
||||||
const FORMAT_DATE = 'YYYY-MM-DD HH:mm:ss';
|
const FORMAT_DATE = 'YYYY-MM-DD HH:mm:ss';
|
||||||
props.query.created_at = [
|
props.query.created_at = [
|
||||||
@ -102,8 +125,25 @@ const onDateChange = (value) => {
|
|||||||
handleSearch();
|
handleSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取项目列表
|
||||||
|
const getProjects = async () => {
|
||||||
|
try {
|
||||||
|
const { code, data } = await getProjectList();
|
||||||
|
if (code === 200) {
|
||||||
|
projects.value = data;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取项目列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
created_at.value = [];
|
created_at.value = [];
|
||||||
|
projects.value = [];
|
||||||
emits('reset');
|
emits('reset');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getProjects();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
export const TABLE_COLUMNS = [
|
export const TABLE_COLUMNS = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
dataIndex: 'index',
|
dataIndex: 'uid',
|
||||||
width: 120,
|
width: 120,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
sortable: {
|
sortable: {
|
||||||
@ -10,32 +10,32 @@ export const TABLE_COLUMNS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '图片/视频',
|
title: '图片/视频',
|
||||||
dataIndex: 'picker',
|
dataIndex: 'cover',
|
||||||
width: 240,
|
width: 240,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '内容稿件标题',
|
title: '内容稿件标题',
|
||||||
dataIndex: 'manuscript_name',
|
dataIndex: 'title',
|
||||||
width: 240,
|
width: 240,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '所属项目',
|
title: '所属项目',
|
||||||
dataIndex: 'project_name',
|
dataIndex: 'projects',
|
||||||
width: 240,
|
width: 240,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '稿件类型',
|
title: '稿件类型',
|
||||||
dataIndex: 'budget',
|
dataIndex: 'type',
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '审核状态',
|
title: '审核状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'audit_status',
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '上传时间',
|
title: '上传时间',
|
||||||
dataIndex: 'create_at',
|
dataIndex: 'updated_at',
|
||||||
width: 180,
|
width: 180,
|
||||||
sortable: {
|
sortable: {
|
||||||
sortDirections: ['ascend', 'descend'],
|
sortDirections: ['ascend', 'descend'],
|
||||||
@ -43,12 +43,12 @@ export const TABLE_COLUMNS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '上传人员',
|
title: '上传人员',
|
||||||
dataIndex: 'placement_account_count',
|
dataIndex: 'uploader.name',
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最后修改时间',
|
title: '最后修改时间',
|
||||||
dataIndex: 'last_create_at',
|
dataIndex: 'last_modified_at',
|
||||||
width: 180,
|
width: 180,
|
||||||
sortable: {
|
sortable: {
|
||||||
sortDirections: ['ascend', 'descend'],
|
sortDirections: ['ascend', 'descend'],
|
||||||
@ -56,7 +56,7 @@ export const TABLE_COLUMNS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最后修改人员',
|
title: '最后修改人员',
|
||||||
dataIndex: 'placement_account_count1',
|
dataIndex: 'last_modifier.name',
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { deleteProject } from '@/api/all/propertyMarketing';
|
import { deleteWork } from '@/api/all/generationWorkshop';
|
||||||
import icon1 from '@/assets/img/media-account/icon-warn-1.png';
|
import icon1 from '@/assets/img/media-account/icon-warn-1.png';
|
||||||
|
|
||||||
const update = inject('update');
|
const update = inject('update');
|
||||||
@ -46,7 +46,7 @@ const open = (record) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
const { code } = await deleteProject(projectId.value);
|
const { code } = await deleteWork(projectId.value);
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
AMessage.success('删除成功');
|
AMessage.success('删除成功');
|
||||||
update()
|
update()
|
||||||
|
|||||||
@ -38,42 +38,42 @@
|
|||||||
<template v-if="column.dataIndex === 'create_at'" #cell="{ record }">
|
<template v-if="column.dataIndex === 'create_at'" #cell="{ record }">
|
||||||
{{ exactFormatTime(record.create_at) }}
|
{{ exactFormatTime(record.create_at) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'manuscript_name'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'title'" #cell="{ record }">
|
||||||
<TextOverTips :context="record.name" :line="3" class="manuscript_name" />
|
<TextOverTips :context="record.title" :line="3" class="title" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'project_name'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'projects'" #cell="{ record }">
|
||||||
<TextOverTips :context="record.project_name" :line="3" />
|
<TextOverTips :context="record.projects.map((item) => item).join(',')" :line="3" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'status'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'audit_status'" #cell="{ record }">
|
||||||
<div
|
<div
|
||||||
class="flex items-center w-fit h-28px px-8px rounded-2px"
|
class="flex items-center w-fit h-28px px-8px rounded-2px"
|
||||||
:style="{ backgroundColor: getStatusInfo(record.status).backgroundColor }"
|
:style="{ backgroundColor: getStatusInfo(record.audit_status).backgroundColor }"
|
||||||
>
|
>
|
||||||
<span class="cts s1" :style="{ color: getStatusInfo(record.status).color }">{{
|
<span class="cts s1" :style="{ color: getStatusInfo(record.audit_status).color }">{{
|
||||||
getStatusInfo(record.status).label
|
getStatusInfo(record.audit_status).name
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'budget'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'type'" #cell="{ record }">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img
|
<img
|
||||||
:src="record.budget === EnumManuscriptType.Image ? icon2 : icon3"
|
:src="record.type === EnumManuscriptType.Image ? icon2 : icon3"
|
||||||
width="16"
|
width="16"
|
||||||
height="16"
|
height="16"
|
||||||
class="mr-4px"
|
class="mr-4px"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="cts"
|
class="cts"
|
||||||
:class="record.budget === EnumManuscriptType.Image ? '!color-#25C883' : '!color-#6D4CFE'"
|
:class="record.type === EnumManuscriptType.Image ? '!color-#25C883' : '!color-#6D4CFE'"
|
||||||
>{{ record.budget === EnumManuscriptType.Image ? '图文' : '视频' }}</span
|
>{{ record.type === EnumManuscriptType.Image ? '图文' : '视频' }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="['create_at', 'last_create_at'].includes(column.dataIndex)" #cell="{ record }">
|
<template v-else-if="['updated_at', 'last_modified_at'].includes(column.dataIndex)" #cell="{ record }">
|
||||||
{{ exactFormatTime(record[column.dataIndex]) }}
|
{{ exactFormatTime(record[column.dataIndex]) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'picker'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'cover'" #cell="{ record }">
|
||||||
<a-image :width="64" :height="64" :src="record.picker" class="rounded-6px" />
|
<a-image :width="64" :height="64" :src="record.cover" class="rounded-6px" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
|
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
@ -121,15 +121,14 @@ const onDelete = (item) => {
|
|||||||
emits('delete', item);
|
emits('delete', item);
|
||||||
};
|
};
|
||||||
const onEdit = (item) => {
|
const onEdit = (item) => {
|
||||||
router.push(`/manuscript/edit/${item.index}`);
|
router.push(`/manuscript/edit/${item.id}`);
|
||||||
};
|
};
|
||||||
const onDetail = (item) => {
|
const onDetail = (item) => {
|
||||||
console.log('onDetail');
|
router.push(`/manuscript/detail/${item.id}`);
|
||||||
router.push(`/manuscript/detail/${item.index}`);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStatusInfo = (status) => {
|
const getStatusInfo = (audit_status) => {
|
||||||
return CHECK_STATUS.find((v) => v.value === status) ?? {};
|
return CHECK_STATUS.find((v) => v.id === audit_status) ?? {};
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
:deep(.manuscript_name) {
|
:deep(.title) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #6d4cfe;
|
color: #6d4cfe;
|
||||||
|
|||||||
@ -10,36 +10,32 @@ export const INITIAL_QUERY = {
|
|||||||
|
|
||||||
export enum EnumCheckStatus {
|
export enum EnumCheckStatus {
|
||||||
All = '',
|
All = '',
|
||||||
Wait = 0,
|
Wait = 1,
|
||||||
Checking = 1,
|
Checking = 2,
|
||||||
Passed = 2,
|
Passed = 3,
|
||||||
}
|
}
|
||||||
export enum EnumManuscriptType {
|
export enum EnumManuscriptType {
|
||||||
All = '',
|
All = '',
|
||||||
Image = 1,
|
Image = 0,
|
||||||
Video = 2,
|
Video = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CHECK_STATUS = [
|
export const CHECK_STATUS = [
|
||||||
{
|
{
|
||||||
label: '全部',
|
name: '待审核',
|
||||||
value: EnumCheckStatus.All,
|
id: EnumCheckStatus.Wait,
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '待审核',
|
|
||||||
value: EnumCheckStatus.Wait,
|
|
||||||
backgroundColor: '#F2F3F5',
|
backgroundColor: '#F2F3F5',
|
||||||
color: '#3C4043'
|
color: '#3C4043'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '审核中',
|
name: '审核中',
|
||||||
value: EnumCheckStatus.Checking,
|
id: EnumCheckStatus.Checking,
|
||||||
backgroundColor: '#FFF7E5',
|
backgroundColor: '#FFF7E5',
|
||||||
color: '#FFAE00'
|
color: '#FFAE00'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '已通过',
|
name: '已通过',
|
||||||
value: EnumCheckStatus.Passed,
|
id: EnumCheckStatus.Passed,
|
||||||
backgroundColor: '#EBF7F2',
|
backgroundColor: '#EBF7F2',
|
||||||
color: '#25C883'
|
color: '#25C883'
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,11 +20,7 @@
|
|||||||
<div
|
<div
|
||||||
class="table-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px py-24px flex-1 flex flex-col"
|
class="table-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px py-24px flex-1 flex flex-col"
|
||||||
>
|
>
|
||||||
<ManuscriptTable
|
<ManuscriptTable :dataSource="dataSource" @sorterChange="handleSorterChange" @delete="handleDelete" />
|
||||||
:dataSource="dataSource"
|
|
||||||
@sorterChange="handleSorterChange"
|
|
||||||
@delete="handleDelete"
|
|
||||||
/>
|
|
||||||
<div v-if="pageInfo.total > 0" class="pagination-box">
|
<div v-if="pageInfo.total > 0" class="pagination-box">
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:total="pageInfo.total"
|
:total="pageInfo.total"
|
||||||
@ -53,11 +49,8 @@ import DeleteManuscriptModal from './components/manuscript-table/delete-manuscri
|
|||||||
import UploadManuscriptModal from './components/upload-manascript-modal';
|
import UploadManuscriptModal from './components/upload-manascript-modal';
|
||||||
|
|
||||||
import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination';
|
import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination';
|
||||||
import { getProjects } from '@/api/all/propertyMarketing';
|
import { getWorksPage } from '@/api/all/generationWorkshop.ts';
|
||||||
import {
|
import { INITIAL_QUERY, EnumCheckStatus } from '@/views/creative-generation-workshop/manuscript/list/constants.ts';
|
||||||
INITIAL_QUERY,
|
|
||||||
EnumCheckStatus,
|
|
||||||
} from '@/views/creative-generation-workshop/manuscript/list/constants.ts';
|
|
||||||
|
|
||||||
const { dataSource, pageInfo, onPageChange, onPageSizeChange, resetPageInfo } = useTableSelectionWithPagination({
|
const { dataSource, pageInfo, onPageChange, onPageSizeChange, resetPageInfo } = useTableSelectionWithPagination({
|
||||||
onPageChange: () => {
|
onPageChange: () => {
|
||||||
@ -73,43 +66,67 @@ const deleteManuscriptModalRef = ref(null);
|
|||||||
const uploadManuscriptModalRef = ref(null);
|
const uploadManuscriptModalRef = ref(null);
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
|
const { page, page_size } = pageInfo.value;
|
||||||
|
const { code, data } = await getWorksPage({
|
||||||
|
...query.value,
|
||||||
|
page,
|
||||||
|
page_size,
|
||||||
|
});
|
||||||
|
if (code === 200) {
|
||||||
|
dataSource.value = data?.data ?? [];
|
||||||
|
pageInfo.value.total = data.total;
|
||||||
|
}
|
||||||
|
|
||||||
dataSource.value = [
|
dataSource.value = [
|
||||||
{
|
{
|
||||||
index: 1,
|
uid: 1,
|
||||||
name: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
id:1,
|
||||||
project_name: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
projects: ['内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1', '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1'],
|
||||||
status: EnumCheckStatus.Wait,
|
title: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
||||||
budget: 1,
|
audit_status: EnumCheckStatus.Wait,
|
||||||
create_at: 1753682671,
|
type: 0,
|
||||||
|
updated_at: 1753682671,
|
||||||
|
last_modified_at: 1753682671,
|
||||||
|
uploader: {
|
||||||
|
name: '1111'
|
||||||
|
},
|
||||||
|
last_modifier: {
|
||||||
|
name: '1111'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 2,
|
uid: 2,
|
||||||
name: '内容稿件2',
|
id:2,
|
||||||
project_name: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
projects: ['内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1', '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1'],
|
||||||
status: EnumCheckStatus.Checking,
|
title: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
||||||
budget: 2,
|
audit_status: EnumCheckStatus.Checking,
|
||||||
create_at: 1753682672,
|
type: 1,
|
||||||
|
updated_at: 1753682672,
|
||||||
|
last_modified_at: 1753682672,
|
||||||
|
uploader: {
|
||||||
|
name: '1111'
|
||||||
|
},
|
||||||
|
last_modifier: {
|
||||||
|
name: '1111'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 3,
|
uid: 3,
|
||||||
name: '内容稿件3',
|
id:3,
|
||||||
project_name: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
projects: ['内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1', '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1'],
|
||||||
status: EnumCheckStatus.Passed,
|
title: '内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1内容稿件1',
|
||||||
budget: 1,
|
audit_status: EnumCheckStatus.Passed,
|
||||||
create_at: 1753682673,
|
type: 1,
|
||||||
|
updated_at: 1753682673,
|
||||||
|
last_modified_at: 1753682673,
|
||||||
|
uploader: {
|
||||||
|
name: '1111'
|
||||||
|
},
|
||||||
|
last_modifier: {
|
||||||
|
name: '1111'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
pageInfo.value.total = 3;
|
|
||||||
// const { page, page_size } = pageInfo.value;
|
|
||||||
// const { code, data } = await getProjects({
|
|
||||||
// ...query.value,
|
|
||||||
// page,
|
|
||||||
// page_size,
|
|
||||||
// });
|
|
||||||
// if (code === 200) {
|
|
||||||
// dataSource.value = data?.data ?? [];
|
|
||||||
// pageInfo.value.total = data.total;
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
reload();
|
reload();
|
||||||
@ -137,8 +154,8 @@ const openUploadModal = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = (item) => {
|
const handleDelete = (item) => {
|
||||||
const { id, name } = item;
|
const { id, title } = item;
|
||||||
deleteManuscriptModalRef.value?.open({ id, name: `“${name}”` });
|
deleteManuscriptModalRef.value?.open({ id, name: `“${title}”` });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user