合并代码并固定进度计划宽度

This commit is contained in:
Teo
2025-09-15 15:53:13 +08:00
parent a282da0199
commit 9d7a53c0c3
4 changed files with 29 additions and 2 deletions

View File

@ -82,7 +82,14 @@
</el-row>
</template>
<el-table v-loading="loading" :data="formalitiesAreConsolidatedList" @selection-change="handleSelectionChange" row-key="id" default-expand-all>
<el-table
v-loading="loading"
:data="formalitiesAreConsolidatedList"
table-layout="auto"
@selection-change="handleSelectionChange"
row-key="id"
default-expand-all
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="手续办理清单" align="left" prop="formalitiesName">
<template #default="scope">

View File

@ -3,7 +3,7 @@
<el-dialog
v-model="isShowDialog"
@close="onCancel"
width="70vw"
width="1350"
:close-on-click-modal="false"
:destroy-on-close="true"
:lock-scroll="false"
@ -96,6 +96,7 @@
height="58vh"
:data="detialList"
@selection-change="handleSelectionChange"
@row-click="onRowClick"
:row-key="(row) => row.id"
ref="multipleTableRef"
>
@ -136,6 +137,7 @@
@selection-change="handleSelectionChangeWork"
:row-key="(row) => row.id"
ref="multipleTableWorkRef"
@row-click="onRowClick"
>
<el-table-column label="已完成工作" align="center">
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
@ -377,6 +379,22 @@ const handleDayAdd = (row: any, obj: any) => {
state.updateRow = row;
getPvModuleList();
};
const selectedRows = ref([]);
const onRowClick = (row, column, event) => {
// 如果点击来源是复选框本身(或行内其它会触发单独事件的控件),不要再切换
if (event && event.target) {
// 适配 Element UI / Element Plus 的复选框 DOM 结构
const isCheckbox = !!event.target.closest('.el-checkbox');
const isLinkOrBtn = !!event.target.closest('button, a, input, .no-row-click');
if (isCheckbox || isLinkOrBtn) return;
}
// 切换选择:如果已选则取消,否则选中
const dom = showDayWork.value ? multipleTableRef.value : multipleTableWorkRef.value;
// toggleRowSelection 第二个参数可以显式设置选中/取消状态Element UI 支持)
const currentlySelected = selectedRows.value.includes(row);
console.log('🚀 ~ onRowClick ~ currentlySelected:', currentlySelected);
dom.toggleRowSelection(row, !currentlySelected);
};
const tableKey = (row: any) => row.id;
@ -391,6 +409,7 @@ const clickOpen = (row: any) => {
// 多选框处理
const handleSelectionChange = (selection: any[]) => {
state.checkedList = selection.map((item: any) => item.id);
selectedRows.value = selection;
};
// 提交日报
@ -454,6 +473,7 @@ const getDailyBookList = (doneTime: string) => {
const handleSelectionChangeWork = (selection: any[]) => {
state.checkList = selection.map((item: any) => item.id);
state.single = selection.length === 0;
selectedRows.value = selection;
};
// 移除日报