diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index db0185bcf..cf3c2b9ee 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -430,6 +430,7 @@ const rowDetailDialogRowId = ref(null); const columnDetailDialogOpen = ref(false); const columnDetailDialogColumnIndex = ref(null); const cellDetailJsonView = ref(false); +const sideDetailJsonView = ref(false); const rowDetailSearch = ref(""); const columnDetailSearch = ref(""); const isResizingDetail = ref(false); @@ -2853,6 +2854,7 @@ async function prefetchDetailSqlCondition() { watch(activeCellDetail, (detail) => { void prefetchDetailSqlCondition(); + sideDetailJsonView.value = false; if (activeCellDetailTab.value !== "valueEditor") return; if (!detail?.isEditable) { resetDetailEdit(); @@ -4470,6 +4472,14 @@ function copyDetailFormattedJson() { copyText(detail.formattedJson); } +function copyDetailCurrentValue() { + if (sideDetailJsonView.value && activeCellDetail.value?.formattedJson) { + copyDetailFormattedJson(); + } else { + copyDetailValue(); + } +} + function copyDetailColumnName() { if (!activeCellDetail.value) return; copyText(activeCellDetail.value.column); @@ -5069,7 +5079,7 @@ const ddlDrawerStyle = computed(() => ({ const detailPanelStyle = computed(() => cellDetailPanelIsBottom.value - ? { maxHeight: `min(42vh, ${CELL_DETAIL_PANEL_MAX_HEIGHT}px)` } + ? { height: `${detailPanelHeight.value}px`, maxHeight: `min(70vh, ${CELL_DETAIL_PANEL_MAX_HEIGHT}px)` } : { width: `${detailPanelHeight.value}px` }, ); @@ -5306,16 +5316,18 @@ function onDdlResizeEnd() { function onDetailResizeStart(event: MouseEvent) { isResizingDetail.value = true; - detailResizeStartY = event.clientX; + // 底部布局拖顶部边缘(垂直/clientY),右侧布局拖左边缘(水平/clientX) + detailResizeStartY = cellDetailPanelIsBottom.value ? event.clientY : event.clientX; detailResizeStartHeight = detailPanelHeight.value; - document.body.classList.add("select-none", "cursor-col-resize"); + document.body.classList.add("select-none", cellDetailPanelIsBottom.value ? "cursor-row-resize" : "cursor-col-resize"); window.addEventListener("mousemove", onDetailResizeMove); window.addEventListener("mouseup", onDetailResizeEnd); } function onDetailResizeMove(event: MouseEvent) { if (!isResizingDetail.value) return; - const nextSize = detailResizeStartHeight + detailResizeStartY - event.clientX; + const pos = cellDetailPanelIsBottom.value ? event.clientY : event.clientX; + const nextSize = detailResizeStartHeight + detailResizeStartY - pos; detailPanelHeight.value = clampCellDetailPanelSize(nextSize); } @@ -7499,6 +7511,11 @@ const gridContextMenuItems = computed(() => { class="absolute left-0 top-0 bottom-0 z-20 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/30" @mousedown.prevent="onDetailResizeStart" /> +
{{ t("grid.cellDetails") }} @@ -7562,16 +7579,10 @@ const gridContextMenuItems = computed(() => {
-
+
{{ t("grid.columnName") }}
@@ -7648,6 +7659,17 @@ const gridContextMenuItems = computed(() => {
{{ t("grid.cellValue") }}
+ @@ -7756,57 +7778,26 @@ const gridContextMenuItems = computed(() => {
{{ activeCellDetail.displayValuePreview }}
{{ + sideDetailJsonView && activeCellDetail.formattedJson + ? activeCellDetail.formattedJson + : activeCellDetail.rawValuePreview + }} +
-
{{ t("grid.largeValuePreviewHint", { - count: activeCellDetail.displayValuePreview.length, + count: activeCellDetail.rawValuePreview.length, }) }}
-
-
{{ t("grid.rawValue") }}
-
{{ activeCellDetail.rawValuePreview }}
-
-
-
-
{{ t("grid.formattedJson") }}
- -
-
{{ activeCellDetail.formattedJson }}
-
(() => { {{ t("grid.largeValuePreviewHint", { count: dialogCellDetail.rawValuePreview.length }) }}
- -
-
{{ t("grid.formattedValue") }}
-
{{ dialogCellDetail.displayValuePreview }}
-