fix(audit-logs): Add ellipsis feature to table columns (#1603)

* fix: text is so long

* feat: don't need rowSelection
This commit is contained in:
Dunqing 2023-03-29 16:54:59 +08:00 committed by GitHub
parent e5ee716702
commit 92d0eab0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import { useCompile } from '@nocobase/client'; import { EllipsisWithTooltip, useCompile } from '@nocobase/client';
import React from 'react'; import React from 'react';
import { observer, useField } from '@formily/react'; import { observer, useField } from '@formily/react';
@ -8,5 +8,9 @@ export const AuditLogsField = observer(() => {
if (!field.value) { if (!field.value) {
return null; return null;
} }
return <div>{field.value?.uiSchema?.title ? compile(field.value?.uiSchema?.title) : field.value.name}</div>; return (
<EllipsisWithTooltip ellipsis>
{field.value?.uiSchema?.title ? compile(field.value?.uiSchema?.title) : field.value.name}
</EllipsisWithTooltip>
);
}); });

View File

@ -1,4 +1,4 @@
import { FormProvider, SchemaComponent, useRecord } from '@nocobase/client'; import { EllipsisWithTooltip, FormProvider, SchemaComponent, useRecord } from '@nocobase/client';
import React from 'react'; import React from 'react';
import { observer, useField } from '@formily/react'; import { observer, useField } from '@formily/react';
@ -19,5 +19,5 @@ export const AuditLogsValue = observer(() => {
</FormProvider> </FormProvider>
); );
} }
return <div>{field.value ? JSON.stringify(field.value) : null}</div>; return <EllipsisWithTooltip ellipsis>{field.value ? JSON.stringify(field.value) : null}</EllipsisWithTooltip>;
}); });

View File

@ -255,9 +255,7 @@ export const AuditLogsViewActionInitializer = (props) => {
type: 'array', type: 'array',
'x-component': 'TableV2', 'x-component': 'TableV2',
'x-component-props': { 'x-component-props': {
rowSelection: { rowSelection: false,
type: 'checkbox',
},
useProps: '{{ useTableFieldProps }}', useProps: '{{ useTableFieldProps }}',
}, },
properties: { properties: {