CheckRecord.js 993 Bytes
Newer Older
钟是志's avatar
钟是志 committed
1 2
import React from 'react';
import RenderForm from '@/webPublic/FormInsertDiy/RenderForm';
3
import { fetchTemplateById } from '@/webPublic/Services';
钟是志's avatar
钟是志 committed
4
import { useState, useEffect } from 'react';
5
import { Form } from 'antd';
钟是志's avatar
钟是志 committed
6
import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
7 8 9 10

// const id = '1234718972352397312';

// 考核汇总页面
钟是志's avatar
钟是志 committed
11
function OtherCheckRecord({ workId, ...otherProps }) {
钟是志's avatar
钟是志 committed
12
  const pathname = otherProps?.location?.pathname;
钟是志's avatar
钟是志 committed
13 14
  const [data, setData] = useState();
  const id = workId || getOneStopConfig(pathname);
15 16 17
  useEffect(() => {
    setData(undefined);
    fetchTemplateById(id).then(res => {
钟是志's avatar
钟是志 committed
18
      if (res) setData({ ...res, content: '{}' });
19
    });
钟是志's avatar
钟是志 committed
20
  }, [id]);
21

22
  // console.log(data);
钟是志's avatar
钟是志 committed
23 24 25 26 27 28 29
  if (!data) {
    return null;

  } else {
    const FormNew = Form.create(window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined)(RenderForm);
    return <FormNew postData={data} style={{ padding: 0 }} />;
  }
钟是志's avatar
钟是志 committed
30

31 32
}

钟是志's avatar
钟是志 committed
33
export default OtherCheckRecord;