detailnode.jsx 1.21 KB
Newer Older
TZW's avatar
TZW committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'antd';
import React, { useState, useEffect } from 'react';
const DetailNode = (props) => {
  const { data, index, columns, hasTable = false, operationType } = props;
  console.log(props);
  return (
    <>
      <div className="fault-detail">
        <div style={{ flex: 1, display: 'flex', flexDirection: 'row' }}>
          <div className="fault-index">{Number(index) + 1}</div>
          <div style={{ display: 'flex', flexDirection: 'column' }}>
            <label style={{ width: '80px', fontSize: 18, fontWeight: 600 }}>
              {data?.operationTypeName}
            </label>
            <span>{data?.updateUserName}</span>
            <span>{data?.updateTime}</span>
          </div>
        </div>
        <div style={{ flex: 6 }}>
          <div>
            <h2 className="page-title" style={{ marginBottom: 16 }}>
              {operationType == 0 ? '基础信息' : data?.operationTypeName}
            </h2>
          </div>
          <ProDescriptions dataSource={data} columns={columns} />
          {hasTable ? props.children : null}
          <Divider />
        </div>
      </div>
    </>
  );
};

export default DetailNode;