PumpGeneral.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //大用户用水量排名
  2. import React, { PureComponent } from "react";
  3. import { ScrollBoard } from "@jiaminghi/data-view-react";
  4. class PumpGeneral extends PureComponent {
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. config: {
  9. // 表头背景色
  10. headerBGC: "transparent",
  11. // 奇数行背景色
  12. oddRowBGC: "#0ab8d952",
  13. // 偶数行背景色
  14. evenRowBGC: "transparent",
  15. // 行号
  16. index: false,
  17. // 行号表头
  18. // indexHeader: '序号',
  19. // 宽度
  20. columnWidth: [120, 70, 90, 80],
  21. // 对其方式
  22. align: ["center"],
  23. // 表行数
  24. rowNum: 5,
  25. },
  26. };
  27. }
  28. render() {
  29. const { height } = this.props;
  30. const data = {
  31. header: ["泵站名称", "运行状态", "流量", "能耗", "溢流风险"],
  32. data: [
  33. ["凤凰路一级泵站", "正常", "500m3/h", "1.2kWh", ""],
  34. [
  35. "凤凰路二级泵站 ",
  36. "正常",
  37. "600m3/h",
  38. "1.5kWh",
  39. "<span style='color:#f20a0a;'>!!!</span>",
  40. ],
  41. ["凤凰路三级泵站 ", "正常", "300m3/h", "0.7kWh", ""],
  42. ["大涧沟雨水泵站 ", "正常", "500m3/h", "1.3kWh", ""],
  43. ["改建纬十二路雨水泵站 ", "正常", "450m3/h", "0.9kWh", ""],
  44. ],
  45. };
  46. const config = {
  47. ...this.state.config,
  48. ...data,
  49. };
  50. return (
  51. <div
  52. style={{
  53. width: "calc(100% - 24px)",
  54. margin: "auto",
  55. }}
  56. >
  57. <ScrollBoard
  58. config={config}
  59. style={{
  60. width: "100%",
  61. height: height,
  62. }}
  63. ></ScrollBoard>
  64. </div>
  65. );
  66. }
  67. }
  68. export default PumpGeneral;