mediaDevice.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. showMask?: boolean;
  11. }
  12. const defaultImage = require('/public/images/device-media.png');
  13. export default (props: ProductCardProps) => {
  14. return (
  15. <TableCard
  16. showMask={props.showMask}
  17. detail={props.detail}
  18. actions={props.actions}
  19. status={props.state.value}
  20. statusText={props.state.text}
  21. statusNames={{
  22. offline: StatusColorEnum.error,
  23. online: StatusColorEnum.processing,
  24. notActive: StatusColorEnum.warning,
  25. }}
  26. >
  27. <div className={'pro-table-card-item'}>
  28. <div className={'card-item-avatar'}>
  29. <img width={88} height={88} src={props.photoUrl || defaultImage} alt={''} />
  30. </div>
  31. <div className={'card-item-body'}>
  32. <div className={'card-item-header'}>
  33. <span className={'card-item-header-name ellipsis'}>{props.name}</span>
  34. </div>
  35. <div className={'card-item-content'}>
  36. <div>
  37. <label>厂商</label>
  38. <div className={'ellipsis'}>{props.manufacturer || '--'}</div>
  39. </div>
  40. <div>
  41. <label>通道数量</label>
  42. <div className={'ellipsis'}>{props.channelNumber || '--'}</div>
  43. </div>
  44. <div>
  45. <label>型号</label>
  46. <div className={'ellipsis'}>{props.model || '--'}</div>
  47. </div>
  48. <div>
  49. <label>接入方式</label>
  50. <div className={'ellipsis'}>{props.provider || '--'}</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </TableCard>
  56. );
  57. };