fix: cbc表格列宽设置

This commit is contained in:
TsMask
2025-08-01 17:51:22 +08:00
parent a0ae414ec6
commit 6ca7181bce

View File

@@ -32,7 +32,7 @@ let queryParams = reactive({
/**网元ID */ /**网元ID */
neId: undefined, neId: undefined,
status: undefined, status: undefined,
eventName:'', eventName: '',
/**记录开始时间 */ /**记录开始时间 */
startTime: '', startTime: '',
/**记录结束时间 */ /**记录结束时间 */
@@ -50,8 +50,8 @@ let queryParams = reactive({
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
eventName:'', eventName: '',
status: '', status: undefined,
sortField: 'id', sortField: 'id',
sortOrder: 'asc', sortOrder: 'asc',
pageNum: 1, pageNum: 1,
@@ -98,7 +98,7 @@ let tableColumns: ColumnsType = [
title: t('views.cbc.cbe.eventName'), title: t('views.cbc.cbe.eventName'),
dataIndex: 'messageJson', dataIndex: 'messageJson',
align: 'left', align: 'left',
width: 150, width: 100,
customRender(opt) { customRender(opt) {
const messageJson = opt.value; const messageJson = opt.value;
return messageJson.eventName; return messageJson.eventName;
@@ -108,7 +108,7 @@ let tableColumns: ColumnsType = [
title: t('views.cbc.cbe.repetitionPeriod'), title: t('views.cbc.cbe.repetitionPeriod'),
dataIndex: 'messageJson', dataIndex: 'messageJson',
align: 'left', align: 'left',
width: 150, width: 100,
customRender(opt) { customRender(opt) {
const messageJson = opt.value; const messageJson = opt.value;
return messageJson.repetitionPeriod; return messageJson.repetitionPeriod;
@@ -118,7 +118,7 @@ let tableColumns: ColumnsType = [
title: t('views.cbc.cbe.numOfBcast'), title: t('views.cbc.cbe.numOfBcast'),
dataIndex: 'messageJson', dataIndex: 'messageJson',
align: 'left', align: 'left',
width: 150, width: 100,
customRender(opt) { customRender(opt) {
const messageJson = opt.value; const messageJson = opt.value;
return messageJson.numOfBcast; return messageJson.numOfBcast;
@@ -128,7 +128,7 @@ let tableColumns: ColumnsType = [
title: t('views.cbc.cbe.startTime'), title: t('views.cbc.cbe.startTime'),
dataIndex: 'messageJson', dataIndex: 'messageJson',
align: 'left', align: 'left',
width: 250, width: 150,
customRender(opt) { customRender(opt) {
const messageJson = opt.value; const messageJson = opt.value;
return messageJson.startTime; return messageJson.startTime;
@@ -145,14 +145,14 @@ let tableColumns: ColumnsType = [
title: t('views.cbc.cbe.detail'), title: t('views.cbc.cbe.detail'),
dataIndex: 'detail', dataIndex: 'detail',
align: 'center', align: 'center',
width: 250, width: 150,
}, },
{ {
title: t('views.cbc.cbe.createdAt'), title: t('views.cbc.cbe.createdAt'),
dataIndex: 'createdAt', dataIndex: 'createdAt',
align: 'center', align: 'center',
width: 250, width: 200,
customRender(opt) { customRender(opt) {
if (!opt.value) return ''; if (!opt.value) return '';
return parseDateToStr(opt.value / 1000); return parseDateToStr(opt.value / 1000);
@@ -161,13 +161,11 @@ let tableColumns: ColumnsType = [
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'cbeId', key: 'cbeId',
width: 100,
align: 'left', align: 'left',
}, },
]; ];
/**表格字段列排序 */
let tableColumnsDnd = ref<ColumnsType>([]);
/**表格分页器参数 */ /**表格分页器参数 */
let tablePagination = reactive({ let tablePagination = reactive({
/**当前页数 */ /**当前页数 */
@@ -698,7 +696,7 @@ function fnRecordSend(record: any) {
duration: 2, duration: 2,
}); });
} }
fnGetList(); fnGetList();
}); });
}, },
onCancel() { onCancel() {
@@ -1017,12 +1015,6 @@ onMounted(() => {
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ y: 'calc(100vh - 480px)' }" :scroll="{ y: 'calc(100vh - 480px)' }"
@change="fnTableChange" @change="fnTableChange"
@resizeColumn="(w: number, col: any) => (col.width = w)"
:row-selection="{
type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys,
onChange: fnTableSelectedRowKeys,
}"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'cbeId'"> <template v-if="column.key === 'cbeId'">