mediaDevice.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React from 'react';
  2. import type { DeviceItem } from '@/pages/media/Device/typings';
  3. import { StatusColorEnum } from '@/components/BadgeStatus';
  4. import { TableCard } from '@/components';
  5. import '@/style/common.less';
  6. import '../index.less';
  7. export interface ProductCardProps extends DeviceItem {
  8. detail?: React.ReactNode;
  9. actions?: React.ReactNode[];
  10. }
  11. const defaultImage = require('/public/images/device-media.png');
  12. export default (props: ProductCardProps) => {
  13. return (
  14. <TableCard
  15. showMask={false}
  16. detail={props.detail}
  17. actions={props.actions}
  18. status={props.state.value}
  19. statusText={props.state.text}
  20. statusNames={{
  21. offline: StatusColorEnum.error,
  22. online: StatusColorEnum.processing,
  23. }}
  24. >
  25. <div className={'pro-table-card-item'}>
  26. <div className={'card-item-avatar'}>
  27. <img width={88} height={88} src={props.photoUrl || defaultImage} alt={''} />
  28. </div>
  29. <div className={'card-item-body'}>
  30. <div className={'card-item-header'}>
  31. <span className={'card-item-header-name ellipsis'}>{props.name}</span>
  32. </div>
  33. <div className={'card-item-content'}>
  34. <div>
  35. <label>厂商</label>
  36. <div className={'ellipsis'}>{props.manufacturer || '--'}</div>
  37. </div>
  38. <div>
  39. <label>通道数量</label>
  40. <div className={'ellipsis'}>{props.channelNumber || '--'}</div>
  41. </div>
  42. <div>
  43. <label>型号</label>
  44. <div className={'ellipsis'}>{props.model || '--'}</div>
  45. </div>
  46. <div>
  47. <label>接入方式</label>
  48. <div className={'ellipsis'}>{props.transport || '--'}</div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </TableCard>
  54. );
  55. };