提交 9afe7e95 authored 作者: 钟是志's avatar 钟是志

增加iframe 内嵌 CheckRecord 的查询类页面

上级 1f02599c
import RenderForm from "@/webPublic/FormInsertDiy/RenderForm";
import { fetchTemplateById } from '@/webPublic/Services';
import { useState, useEffect } from "react";
import { Form } from 'antd';
import { getOneStopConfig } from "@/baseComponent/utils";
import { setToken } from '@/utils/authority';
const getUrlInfo = (param) => {
let url = window.document.location.href.toString();
let u = url.split("?");
if (typeof(u[1]) == "string") {
u = u[1].split("&");
let get = {};
for (let i in u) {
let j = u[i].split("=");
get[j[0]] = decodeURIComponent(j[1]);
}
return get;
} else {
return {};
}
};
function OtherCheckRecord({ form, location: { pathname } }) {
const [data, setData] = useState();
useEffect(() => {
const params = getUrlInfo();
const { id, token } = params;
if(token){
setToken(token);
}
console.log(id);
if(!id){
console.error('没有找到id');
}
setData(undefined);
fetchTemplateById(id).then(res => {
if (res) setData({...res, content: "{}"});
});
}, [pathname]);
return !!data && <RenderForm form={form} postData={data} style={{ padding: 0 }} />;
}
export default Form.create()(OtherCheckRecord)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论