1
This commit is contained in:
1 parent
ea6a244942
commit
757de9a43f
9 files changed
+312
-90
No files matched your search
+16
-12
@@ -1093,18 +1093,22 @@ onBeforeUnmount(() => {
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
title="回到顶部"
|
||||
aria-label="回到顶部"
|
||||
:class="[
|
||||
'fixed bottom-8 right-8 z-40 inline-flex h-11 w-11 cursor-pointer items-center justify-center rounded-full border border-black/15 bg-white text-black shadow-[0_10px_24px_rgba(0,0,0,0.16)] transition-all duration-300 hover:scale-105 hover:border-black/30 hover:bg-black hover:text-white',
|
||||
showScrollTopFab ? 'translate-y-0 opacity-100' : 'pointer-events-none translate-y-3 opacity-0'
|
||||
]"
|
||||
@click="scrollContractsToTop()"
|
||||
>
|
||||
<ArrowUp class="h-5 w-5" />
|
||||
</button>
|
||||
<TooltipRoot>
|
||||
<TooltipTrigger as-child>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="回到顶部"
|
||||
:class="[
|
||||
'fixed bottom-8 right-8 z-40 inline-flex h-11 w-11 cursor-pointer items-center justify-center rounded-full border border-black/15 bg-white text-black shadow-[0_10px_24px_rgba(0,0,0,0.16)] transition-all duration-300 hover:scale-105 hover:border-black/30 hover:bg-black hover:text-white',
|
||||
showScrollTopFab ? 'translate-y-0 opacity-100' : 'pointer-events-none translate-y-3 opacity-0'
|
||||
]"
|
||||
@click="scrollContractsToTop()"
|
||||
>
|
||||
<ArrowUp class="h-5 w-5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="left">回到顶部</TooltipContent>
|
||||
</TooltipRoot>
|
||||
|
||||
<div
|
||||
v-if="showCreateModal"
|
||||
|
||||
@@ -260,25 +260,6 @@ const processCellFromClipboard = (params: any) => {
|
||||
return params.value
|
||||
}
|
||||
|
||||
const fitColumnsToGrid = () => {
|
||||
if (!gridApi.value) return
|
||||
requestAnimationFrame(() => {
|
||||
gridApi.value?.sizeColumnsToFit({ defaultMinWidth: 68 })
|
||||
})
|
||||
}
|
||||
|
||||
const handleGridReady = (event: GridReadyEvent<FactorRow>) => {
|
||||
gridApi.value = event.api
|
||||
fitColumnsToGrid()
|
||||
}
|
||||
|
||||
const handleGridSizeChanged = (_event: GridSizeChangedEvent<FactorRow>) => {
|
||||
fitColumnsToGrid()
|
||||
}
|
||||
|
||||
const handleFirstDataRendered = (_event: FirstDataRenderedEvent<FactorRow>) => {
|
||||
fitColumnsToGrid()
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadFromIndexedDB()
|
||||
@@ -321,9 +302,7 @@ onBeforeUnmount(() => {
|
||||
:processCellFromClipboard="processCellFromClipboard"
|
||||
:undoRedoCellEditing="true"
|
||||
:undoRedoCellEditingLimit="20"
|
||||
@grid-ready="handleGridReady"
|
||||
@grid-size-changed="handleGridSizeChanged"
|
||||
@first-data-rendered="handleFirstDataRendered"
|
||||
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -317,25 +317,7 @@ 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()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -370,9 +352,7 @@ const handleFirstDataRendered = (_event: FirstDataRenderedEvent<DetailRow>) => {
|
||||
:processCellFromClipboard="processCellFromClipboard"
|
||||
:undoRedoCellEditing="true"
|
||||
:undoRedoCellEditingLimit="20"
|
||||
@grid-ready="handleGridReady"
|
||||
@grid-size-changed="handleGridSizeChanged"
|
||||
@first-data-rendered="handleFirstDataRendered"
|
||||
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user