index.jsx 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import { getEvaluateList } from "@/services/evaluate";
  2. import { queryTable } from "@/utils/request";
  3. import { PageContainer, ProTable } from "@ant-design/pro-components";
  4. import { Link, useNavigate, useSearchParams } from "react-router-dom";
  5. import { Button, message, Popconfirm } from "antd";
  6. import moment from "moment";
  7. import { useRef, useState } from "react";
  8. import AddeValuate from "./addeValuate";
  9. const EvaluateList = (props) => {
  10. const [searchParams] = useSearchParams();
  11. const id = searchParams.get("id");
  12. const navigate = useNavigate();
  13. // const [storeTypeDict, setStoreTypeDict] = useState([]);
  14. const actionRef = useRef();
  15. const formRef = useRef();
  16. const valueEnum= {
  17. 2: { text: "优", status: "Success" },
  18. 1: { text: "良", status: "Processing" },
  19. 0: { text: "差", status: "Default" },
  20. }
  21. const columns = [
  22. // {
  23. // title: "任务ID",
  24. // dataIndex: "taskId",
  25. // },
  26. {
  27. title: "服务质量",
  28. dataIndex: "item1",
  29. search: false,
  30. valueEnum
  31. },
  32. {
  33. title: "供应住宿",
  34. dataIndex: "item2",
  35. search: false,
  36. valueEnum
  37. },
  38. {
  39. title: "供应餐饮",
  40. dataIndex: "item3",
  41. search: false,
  42. valueEnum
  43. },
  44. {
  45. title: "洗浴评价",
  46. dataIndex: "item4",
  47. search: false,
  48. valueEnum
  49. },
  50. {
  51. title: "娱乐评价",
  52. dataIndex: "item5",
  53. search: false,
  54. valueEnum
  55. },
  56. {
  57. title: "军供文化",
  58. dataIndex: "item6",
  59. search: false,
  60. valueEnum
  61. },
  62. ];
  63. return (
  64. <PageContainer>
  65. <ProTable
  66. actionRef={actionRef}
  67. formRef={formRef}
  68. search={false}
  69. params={{ taskId: id }}
  70. rowKey="id"
  71. toolBarRender={() => [
  72. <AddeValuate
  73. taskId={id}
  74. key="2"
  75. onsuccess={() => {
  76. actionRef.current.reload();
  77. }}
  78. ></AddeValuate>,
  79. // <Button
  80. // key="2"
  81. // type="primary"
  82. // onClick={() => {
  83. // }}
  84. // >
  85. // 新增评价
  86. // </Button>,
  87. ]}
  88. request={queryTable(getEvaluateList)}
  89. columns={columns}
  90. />
  91. </PageContainer>
  92. );
  93. };
  94. export default EvaluateList;