12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import React, { useCallback, useEffect, useRef } from "react";
  2. import Edit from "@/components/Page/Edit";
  3. import { Radio, Form } from 'antd';
  4. import {
  5. ProForm,
  6. ProFormDatePicker,
  7. ProFormText,
  8. ProFormSelect,
  9. ProFormRadio
  10. } from "@ant-design/pro-components/es";
  11. import { postTaIncompatible, putTaIncompatible, getTaIncompatibleById } from "@/service/taIncompatible";
  12. import { getSysPosition } from "@/service/sysposition";
  13. import { queryDict } from "@/utils/request";
  14. const queryPosition = queryDict(getSysPosition, { labelKey: "name", valueKey: "positionId" });
  15. const request = {
  16. save: postTaIncompatible,
  17. update: putTaIncompatible,
  18. get: getTaIncompatibleById
  19. };
  20. export default (props) => {
  21. const formRef = useRef();
  22. const initialValues = { status: 1 };
  23. const statusOpt = [
  24. { label: "正常", value: 1 },
  25. { label: "不正常", value: 0 },
  26. ];
  27. const ruleOpt = [
  28. { label: "普通规则", value: "regularRules" },
  29. { label: "三个月规则", value: "monthRules" },
  30. ]
  31. return (
  32. <Edit
  33. formRef={formRef}
  34. request={request}
  35. initialValues={initialValues}
  36. renderItems={() => (
  37. <>
  38. <ProFormSelect
  39. labelCol={{ span: 6 }}
  40. name="primaryPost"
  41. label="原岗位"
  42. request={queryPosition}
  43. />
  44. <ProFormSelect
  45. labelCol={{ span: 6 }}
  46. name="targetPost"
  47. label="目标岗位"
  48. request={queryPosition}
  49. />
  50. {/* <ProFormText labelCol={{ span: 6 }} name="rule" label="规则" /> */}
  51. <ProFormRadio.Group
  52. labelCol={{ span: 6 }}
  53. name="rule"
  54. label="规则"
  55. options={ruleOpt}
  56. />
  57. <ProFormRadio.Group
  58. labelCol={{ span: 6 }}
  59. name="status"
  60. label="状态"
  61. options={statusOpt}
  62. />
  63. {/* <Form.Item labelCol={{ span: 6 }} label="状态" name="status">
  64. <Radio.Group>
  65. <Radio value={1}>正常</Radio>
  66. <Radio value={0}>不正常</Radio>
  67. </Radio.Group>
  68. </Form.Item> */}
  69. </>
  70. )}
  71. />
  72. )
  73. }