diff --git a/packages/shared/lib/api/sqle/service/common.d.ts b/packages/shared/lib/api/sqle/service/common.d.ts index 097180964..6c7db94a7 100644 --- a/packages/shared/lib/api/sqle/service/common.d.ts +++ b/packages/shared/lib/api/sqle/service/common.d.ts @@ -2347,7 +2347,7 @@ export interface ISqlManage { audit_status?: SqlManageAuditStatusEnum; - endpoints?: string; + endpoints?: string[]; first_appear_timestamp?: string; diff --git a/packages/sqle/src/page/SqlManagement/component/SQLEEIndex/__snapshots__/index.test.tsx.snap b/packages/sqle/src/page/SqlManagement/component/SQLEEIndex/__snapshots__/index.test.tsx.snap index 53c115593..b24889644 100644 --- a/packages/sqle/src/page/SqlManagement/component/SQLEEIndex/__snapshots__/index.test.tsx.snap +++ b/packages/sqle/src/page/SqlManagement/component/SQLEEIndex/__snapshots__/index.test.tsx.snap @@ -1207,12 +1207,26 @@ exports[`page/SqlManagement/SQLEEIndex filter data with rule name 1`] = ` - - 12 - +
+ + 12 + +
+
+ ... +
+ - - 12 - +
+ + 12 + +
+
+ ... +
+ - - 12 - +
+ + 12 + +
+
+ ... +
+ - - 12 - +
+ + 12 + +
+
+ ... +
+ t('sqlManagement.table.column.endpoints'), width: 200, render: (endpoints) => { - if (!endpoints) { + if (!Array.isArray(endpoints) || endpoints.length === 0) { return '-'; } - // todo 暂时调整成 string - return {endpoints}; + + return ( + 1 ? ( + + {endpoints.map((v) => ( + {v} + ))} + + ) : null + } + > + {endpoints[0]} + {endpoints.length > 1 ? '...' : null} + + ); } }, { diff --git a/packages/sqle/src/testUtils/mockApi/sqlManage/data.ts b/packages/sqle/src/testUtils/mockApi/sqlManage/data.ts index 50035b79f..0fc2c816e 100644 --- a/packages/sqle/src/testUtils/mockApi/sqlManage/data.ts +++ b/packages/sqle/src/testUtils/mockApi/sqlManage/data.ts @@ -48,7 +48,7 @@ export const sqlManageListData = { assignees: ['test'], status: 'unhandled', remark: 'this is remark text', - endpoints: '12', + endpoints: ['12', '35', '32'], priority: 'high' }, { @@ -120,7 +120,7 @@ export const sqlManageListData = { assignees: null, status: 'unhandled', remark: '', - endpoints: '34' + endpoints: ['34'] }, { id: 1150087, @@ -146,7 +146,7 @@ export const sqlManageListData = { assignees: ['t3', 't2'], status: 'unhandled', remark: '', - endpoints: '', + endpoints: [], priority: '' }, { @@ -173,7 +173,7 @@ export const sqlManageListData = { assignees: ['t3', 't2'], status: 'unhandled', remark: '', - endpoints: '', + endpoints: [], priority: '', audit_status: SqlManageAuditStatusEnum.being_audited }