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