diff --git a/packages/ui-vue/components/data-grid/src/components/data/data-area.component.tsx b/packages/ui-vue/components/data-grid/src/components/data/data-area.component.tsx index d788f415e3966aac5f6eb731876cf27a6b24418b..158f82aa69171988404b56111fca848b095a9044 100644 --- a/packages/ui-vue/components/data-grid/src/components/data/data-area.component.tsx +++ b/packages/ui-vue/components/data-grid/src/components/data/data-area.component.tsx @@ -89,7 +89,7 @@ export default function ( return { display: 'flex', flexGrow: '1', - overflow:'hidden' + overflow: 'hidden' }; } return { @@ -223,6 +223,13 @@ export default function ( } function renderFormatter(cell: VisualDataCell, row: VisualData) { + if (cell.showTips && typeof cell.column?.formatter !== 'function') { + return
+ { + cell.formatter!(cell, row) + } +
; + } return
{ cell.formatter!(cell, row) diff --git a/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts b/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts index 2a058a2e7ae0dd2be4bf1c10c188e6e338c6459b..7914a2e8554fdb5af7e637f4a90065d66b15a2ae 100644 --- a/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts +++ b/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts @@ -30,7 +30,7 @@ export class DataGriColumnProperty extends BaseControlProperty { this.propertyConfig.categories['behavior'] = this.getBehaviorConfig(propertyData, 'gridFieldEditor'); // 编辑器 this.getFieldEditorProperties(propertyData, gridData); - // this.propertyConfig.categories['template'] = this.getTemplateProperties(propertyData); + this.propertyConfig.categories['template'] = this.getTemplateProperties(propertyData); return this.propertyConfig; } @@ -95,6 +95,16 @@ export class DataGriColumnProperty extends BaseControlProperty { title: '拖拽改变列宽', type: 'boolean' }, + width: { + description: '列宽', + title: '列宽', + type: 'number' + }, + showTips: { + description: '启用鼠标悬浮提示', + title: '鼠标悬浮提示', + type: 'boolean' + }, halign: { description: '标题对齐方式', title: '标题对齐方式', @@ -131,6 +141,17 @@ export class DataGriColumnProperty extends BaseControlProperty { ] } } + }, + setPropertyRelates(changeObject, prop, paramters: any) { + if (!changeObject) { + return; + } + switch (changeObject && changeObject.propertyID) { + case 'width': { + prop.actualWidth = changeObject.propertyValue; + break; + } + } } }; } diff --git a/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts b/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts index d194efe246f95f2c36d6abee0f45944239fd6486..bc456777faccc2a28fa80a5f3c5e15fa3a2a6da3 100644 --- a/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts +++ b/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts @@ -255,6 +255,10 @@ export class DataGridProperty extends BaseControlProperty { { "label": "onSelectionChange", "name": "行切换事件" + }, + { + "label": "onDoubleClickRow", + "name": "行双击事件" } ]; if (propertyData.pagination?.enable !== false) { diff --git a/packages/ui-vue/components/data-view/composition/visualization/use-visual-data-cell.ts b/packages/ui-vue/components/data-view/composition/visualization/use-visual-data-cell.ts index 5eaf99b1c2bff558cd2b77f276fbc95056f416b9..4ac815290bad7aeb25fa1e0eefffb4f15072e42a 100644 --- a/packages/ui-vue/components/data-view/composition/visualization/use-visual-data-cell.ts +++ b/packages/ui-vue/components/data-view/composition/visualization/use-visual-data-cell.ts @@ -7,7 +7,7 @@ import { import getCommandColumn from '../../components/editors/commands.component'; import getFormatColumn from '../../components/column-format/column-format.component'; -import { resolveField, setFieldValue } from "@farris/ui-vue/components/common"; +import { resolveField, setFieldValue, useCommonUtils } from "@farris/ui-vue/components/common"; import { isUndefined } from "lodash"; export function useVisualDataCell( @@ -15,6 +15,7 @@ export function useVisualDataCell( useCellEditorComposition: UseCellEditor, useVisualDataBoundComposition: UseVisualDataBound ): UseVisualDataCell { + const { isUndefined } = useCommonUtils(); const mergingCell = ref(props.mergeCell); const rowOption = ref(props.rowOption); const autoRowHeight = rowOption.value?.wrapContent || false; @@ -112,7 +113,8 @@ export function useVisualDataCell( if (column.showEllipsis !== undefined) { targetCell.showEllipsis = column.showEllipsis; } - targetCell.showTips = column.showTips; + // targetCell.showTips = column.showTips; + targetCell.showTips = isUndefined(column.showTips)? true: column.showTips; targetCell.column = column; targetCell.align = column.align || 'left'; targetCell.valign = column.valign || 'middle';