合并代码并固定进度计划宽度
This commit is contained in:
@ -82,7 +82,14 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</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 type="selection" width="55" align="center" />
|
||||||
<el-table-column label="手续办理清单" align="left" prop="formalitiesName">
|
<el-table-column label="手续办理清单" align="left" prop="formalitiesName">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="isShowDialog"
|
v-model="isShowDialog"
|
||||||
@close="onCancel"
|
@close="onCancel"
|
||||||
width="70vw"
|
width="1350"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
:lock-scroll="false"
|
:lock-scroll="false"
|
||||||
@ -96,6 +96,7 @@
|
|||||||
height="58vh"
|
height="58vh"
|
||||||
:data="detialList"
|
:data="detialList"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
|
@row-click="onRowClick"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row) => row.id"
|
||||||
ref="multipleTableRef"
|
ref="multipleTableRef"
|
||||||
>
|
>
|
||||||
@ -136,6 +137,7 @@
|
|||||||
@selection-change="handleSelectionChangeWork"
|
@selection-change="handleSelectionChangeWork"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row) => row.id"
|
||||||
ref="multipleTableWorkRef"
|
ref="multipleTableWorkRef"
|
||||||
|
@row-click="onRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column label="已完成工作" align="center">
|
<el-table-column label="已完成工作" align="center">
|
||||||
<el-table-column :reserve-selection="true" type="selection" width="55" 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;
|
state.updateRow = row;
|
||||||
getPvModuleList();
|
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;
|
const tableKey = (row: any) => row.id;
|
||||||
|
|
||||||
@ -391,6 +409,7 @@ const clickOpen = (row: any) => {
|
|||||||
// 多选框处理
|
// 多选框处理
|
||||||
const handleSelectionChange = (selection: any[]) => {
|
const handleSelectionChange = (selection: any[]) => {
|
||||||
state.checkedList = selection.map((item: any) => item.id);
|
state.checkedList = selection.map((item: any) => item.id);
|
||||||
|
selectedRows.value = selection;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交日报
|
// 提交日报
|
||||||
@ -454,6 +473,7 @@ const getDailyBookList = (doneTime: string) => {
|
|||||||
const handleSelectionChangeWork = (selection: any[]) => {
|
const handleSelectionChangeWork = (selection: any[]) => {
|
||||||
state.checkList = selection.map((item: any) => item.id);
|
state.checkList = selection.map((item: any) => item.id);
|
||||||
state.single = selection.length === 0;
|
state.single = selection.length === 0;
|
||||||
|
selectedRows.value = selection;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 移除日报
|
// 移除日报
|
||||||
|
|||||||
Reference in New Issue
Block a user