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

prepareShow 修改

上级 e850188f
import React, {useEffect, useState, useRef, memo} from 'react';
import {isJSON} from '@/webPublic/one_stop_public/copy';
import {uaaRequest} from '@/webPublic/one_stop_public/utils/request';
import { Spin } from 'antd';
import {deepCopy} from "@/webPublic/one_stop_public/utils/myutils";
import React from 'react';
import { isJSON } from '@/webPublic/one_stop_public/copy';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import { deepCopy } from '@/webPublic/one_stop_public/utils/myutils';
import { getMessage, getModal } from '@/webPublic/one_stop_public/utils/utils';
import moment from 'moment';
const Modal = getModal();
const message = getMessage();
export default function prepareShow(postData = {} , content = '') { // 模板挂载前执行的公式
export default function prepareShow(postData = {}, content = '') {
// 模板挂载前执行的公式
let agg = deepCopy(postData);
window.message = message;
window.Modal = Modal;
......@@ -17,13 +18,13 @@ export default function prepareShow(postData = {} , content = '') { // 模板挂
let data = agg?.unifiedServicePatternModel?.content || content;
let g = !!data && isJSON(data) && JSON.parse(data)?.templateWillMount;
if (g && typeof g === 'string' && g.length > 10) {
let p = { // 函数参数
// message,
// Modal,
let p = {
// 函数参数
message,
Modal,
uaaRequest,
userNowInfo:
(isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) ||
{},
(isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
templateData: agg,
};
let newFunc = new Function('props', g);
......@@ -47,7 +48,7 @@ export default function prepareShow(postData = {} , content = '') { // 模板挂
resolve(true);
console.log(e);
}
}else{
} else {
resolve(true);
}
});
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论