提交 5b206448 authored 作者: 钟是志's avatar 钟是志

iframe嵌入的页面支持移动端自适应

上级 20ce1262
import RenderForm from "@/webPublic/FormInsertDiy/RenderForm"; import RenderForm from "@/webPublic/FormInsertDiy/RenderForm";
import { fetchTemplateById } from '@/webPublic/Services'; import { fetchTemplateById } from '@/webPublic/Services';
import { useState, useEffect } from "react"; import { useState, useEffect, useMemo } from "react";
import { Form } from 'antd'; import { Form } from 'antd';
import { setToken } from '@/utils/authority'; import { setToken } from '@/utils/authority';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
function OtherCheckRecord({ form, location: { pathname }, ...props }) { function OtherCheckRecord({ form, location: { pathname }, ...props }) {
const [data, setData] = useState(); const [data, setData] = useState();
const isMobile = useMemo(() => {
return getUrlInfo().isMobile || window.screen.width < 768;
}, []);
useEffect(() => { useEffect(() => {
let params = getUrlInfo(); let params = getUrlInfo();
let id = params.id || props.id; let id = params.id || props.id;
const { token, isMobile} = params; const { token} = params;
if(token){ if(token){
setToken(token); setToken(token);
} }
...@@ -28,7 +31,9 @@ function OtherCheckRecord({ form, location: { pathname }, ...props }) { ...@@ -28,7 +31,9 @@ function OtherCheckRecord({ form, location: { pathname }, ...props }) {
return !!data && <RenderForm form={form} return !!data && <RenderForm form={form}
postData={data} postData={data}
style={{ padding: 0 }} />; style={{ padding: 0 }}
get={isMobile ? 'mobile' : 'web'}
/>;
} }
export default Form.create()(OtherCheckRecord) export default Form.create()(OtherCheckRecord)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论