瀏覽代碼

fix: 确保每个字段都有dataIndex

xyh 2 年之前
父節點
當前提交
1c992d267b
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 1
      packages/app/src/components/table/hooks.ts
  2. 1 0
      packages/app/src/pages/gs-error-log/table/hooks.tsx

+ 1 - 1
packages/app/src/components/table/hooks.ts

@@ -20,7 +20,7 @@ function parseColumn<T>(columns: ColumnType<T>[]) {
     const {dataIndex, title, render, align} = val;
     if (render) {
       return hepler.display({
-        id: dataIndex?.toString() ?? 'id',
+        id: dataIndex!.toString(),
         header: title?.toString(),
         cell(props) {
           return render(

+ 1 - 0
packages/app/src/pages/gs-error-log/table/hooks.tsx

@@ -53,6 +53,7 @@ export function useColumns(fetch: () => void) {
       title: '操作',
       width: SMALL_TABLE_WIDTH,
       fixed: 'right',
+      dataIndex: 'id',
       render(_, data) {
         const {transmissionType, id} = data;