4 changed files with 202 additions and 55 deletions
			
			
		@ -0,0 +1,115 @@ | 
				
			|||
import { Table } from "@douyinfe/semi-ui"; | 
				
			|||
 | 
				
			|||
export function skeletonScreen(line, columns) { | 
				
			|||
  //   function TableHead() { | 
				
			|||
  //     let str = []; | 
				
			|||
  //     for (let i = 0; i <= column; i++) { | 
				
			|||
  //         if(i==column-2){ | 
				
			|||
 | 
				
			|||
  //         }else{ | 
				
			|||
  //             str.push(<div>ngfbn</div>) | 
				
			|||
  //         } | 
				
			|||
  //     } | 
				
			|||
  //     return str; | 
				
			|||
  //   } | 
				
			|||
  const data = () => { | 
				
			|||
    let str = []; | 
				
			|||
    for (let i = 0; i < line; i++) { | 
				
			|||
      if (i == line - 1) { | 
				
			|||
        str.push({ | 
				
			|||
          createUserId: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 30, | 
				
			|||
                height: 14, | 
				
			|||
                background: "rgba(217, 216, 216, 0.3)", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
          operation: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 50, | 
				
			|||
                height: 14, | 
				
			|||
                background: "rgba(217, 216, 216, 0.3)", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
        }); | 
				
			|||
      } else { | 
				
			|||
        str.push({ | 
				
			|||
          createUserId: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 30, | 
				
			|||
                height: 14, | 
				
			|||
                background: "rgba(217, 216, 216, 0.3)", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
          operation: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 50, | 
				
			|||
                height: 14, | 
				
			|||
                background: "red", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
        }); | 
				
			|||
      } | 
				
			|||
    } | 
				
			|||
    return str; | 
				
			|||
  }; | 
				
			|||
  const column = () => { | 
				
			|||
    let str = []; | 
				
			|||
    for (let i = 0; i < columns; i++) { | 
				
			|||
      if (i == columns - 1) { | 
				
			|||
        str.push({ | 
				
			|||
          title: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 30, | 
				
			|||
                height: 14, | 
				
			|||
                background: "rgba(217, 216, 216, 0.5)", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
          dataIndex: "operation", | 
				
			|||
          key: i, | 
				
			|||
          width: "20%", | 
				
			|||
        }); | 
				
			|||
      } else { | 
				
			|||
        str.push({ | 
				
			|||
          title: ( | 
				
			|||
            <div | 
				
			|||
              style={{ | 
				
			|||
                width: 30, | 
				
			|||
                height: 14, | 
				
			|||
                background: "rgba(217, 216, 216, 0.5)", | 
				
			|||
              }} | 
				
			|||
            ></div> | 
				
			|||
          ), | 
				
			|||
          dataIndex: "createUserId", | 
				
			|||
          key: i, | 
				
			|||
        }); | 
				
			|||
      } | 
				
			|||
    } | 
				
			|||
    return str; | 
				
			|||
  }; | 
				
			|||
 | 
				
			|||
  return ( | 
				
			|||
    <> | 
				
			|||
      <Table | 
				
			|||
        columns={column()} | 
				
			|||
        dataSource={data()} | 
				
			|||
        bordered={false} | 
				
			|||
        empty="暂无数据" | 
				
			|||
        style={{ | 
				
			|||
          padding: "0px 20px", | 
				
			|||
        }} | 
				
			|||
        pagination={false} | 
				
			|||
      /> | 
				
			|||
    </> | 
				
			|||
  ); | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue