This commit is contained in:
zwgczx committed 2026-03-02 11:05:52 +08:00
1 parent ea6a244942
commit 757de9a43f
9 files changed
+312 -90

No files matched your search

+3 -24
View File
@@ -220,8 +220,9 @@ const columnDefs: ColDef<DetailRow>[] = [
editable: params => !params.node?.group && !params.node?.rowPinned,
cellClass: params => (!params.node?.group && !params.node?.rowPinned ? 'ag-right-aligned-cell editable-cell-line' : 'ag-right-aligned-cell'),
cellClassRules: {
'editable-cell-empty': params =>
!params.node?.group && !params.node?.rowPinned && (params.value == null || params.value === '')
'editable-cell-empty': params =>{
// console.log(!params.node?.group && !params.node?.rowPinned && (params.value == null || params.value === ''))
return !params.node?.group && !params.node?.rowPinned && (params.value == null || params.value === '')}
},
aggFunc: decimalAggSum,
valueParser: params => {
@@ -396,25 +397,6 @@ const processCellFromClipboard = (params:any) => {
return params.value;
};
const fitColumnsToGrid = () => {
if (!gridApi.value) return
requestAnimationFrame(() => {
gridApi.value?.sizeColumnsToFit({ defaultMinWidth: 80 })
})
}
const handleGridReady = (event: GridReadyEvent<DetailRow>) => {
gridApi.value = event.api
fitColumnsToGrid()
}
const handleGridSizeChanged = (_event: GridSizeChangedEvent<DetailRow>) => {
fitColumnsToGrid()
}
const handleFirstDataRendered = (_event: FirstDataRenderedEvent<DetailRow>) => {
fitColumnsToGrid()
}
const scrollToGridSection = () => {
const target = gridSectionRef.value || agGridRef.value
@@ -476,9 +458,6 @@ const scrollToGridSection = () => {
:processCellFromClipboard="processCellFromClipboard"
:undoRedoCellEditing="true"
:undoRedoCellEditingLimit="20"
@grid-ready="handleGridReady"
@grid-size-changed="handleGridSizeChanged"
@first-data-rendered="handleFirstDataRendered"
/>
</div>
</div>