perf: 表格自定义字段调整

This commit is contained in:
rd
2025-07-07 10:01:59 +08:00
parent 1dae78f770
commit 5d237ec618
7 changed files with 140 additions and 130 deletions

View File

@ -28,7 +28,7 @@
:disabled="option.is_require === ENUM_STATUS.NO"
@change="(checked) => onCheckChange(checked, option)"
>
{{ option.label }}
{{ localFields.find((item) => item.prop === option.value)?.title }}
</a-checkbox>
</div>
</div>
@ -77,7 +77,7 @@ import { ref, defineExpose } from 'vue';
import { VueDraggable } from 'vue-draggable-plus';
import { getCustomColumns, updateCustomColumns } from '@/api/all/common';
import { getPropPrefix } from '@/views/property-marketing/media-account/account-dashboard/constants';
import { getPropPrefix, getDefaultColumns } from '@/views/property-marketing/media-account/account-dashboard/constants';
import icon1 from './img/icon-lock.png';
@ -106,9 +106,13 @@ const dataSource = ref([]);
const checkColumns = ref([]); // 选中字段
const allColumns = ref([]); // 所有字段
const requiredGroupNames = ref([]); // 必选分组名称
const localFields = ref([]);
const open = () => {
initData();
localFields.value = getDefaultColumns(props.dateType);
visible.value = true;
};
@ -118,6 +122,7 @@ const close = () => {
dataSource.value = [];
checkColumns.value = [];
allColumns.value = [];
localFields.value = [];
requiredGroupNames.value = [];
};
@ -150,8 +155,8 @@ const isCheck = (option) => {
return checkColumns.value.includes(option.value);
};
const getCheckColumnLabel = (value) => {
const column = allColumns.value.find((column) => column.value === value);
return column?.label;
const column = localFields.value.find((column) => column.prop === value);
return column?.title;
};
const isRequiredColumn = (value) => {
const column = allColumns.value.find((column) => column.value === value);

View File

@ -72,7 +72,7 @@ export const getDefaultColumns = (type = 'week') => {
fixed: 'left',
},
{
title: '项目分组',
title: '账号分组',
dataIndex: 'group.name',
prop: 'group',
width: 180,
@ -111,7 +111,7 @@ export const getDefaultColumns = (type = 'week') => {
{
title: '总赞藏数',
dataIndex: 'like_collect_number',
prop: 'like_collect_number',
prop: 'like_number',
width: 180,
tooltip: '账号所有内容获得的点赞数与收藏数总和,用于衡量历史内容的整体吸引力与认可度。',
align: 'right',
@ -222,6 +222,17 @@ export const getDefaultColumns = (type = 'week') => {
sortDirections: ['ascend', 'descend'],
},
},
{
title: '次新作品收藏数',
dataIndex: 'second_new_work_collect_number',
prop: 'second_new_work_collect_number',
width: 180,
tooltip: '次新作品内容的收藏数',
align: 'right',
sortable: {
sortDirections: ['ascend', 'descend'],
},
},
{
title: '次新作品评论数',
dataIndex: 'second_new_work_comment_number',