提交 7f411293 authored 作者: 钟是志's avatar 钟是志

28803 评奖评优管理/优秀毕业生/优秀毕业生审核,点击详情时--审核界面显示两行提示等待数据(100661,bdk@2022*$)

上级 9c13cead
......@@ -87,7 +87,8 @@ class Index extends React.Component {
columns.push({
dataIndex: 'operation',
title: '操作',
fixed: columns.length > 12 ? 'right' : false,
// fixed: columns.length > 12 ? 'right' : false,
fixed: 'right',
render: (text, record) => {
return (
<Link
......@@ -119,6 +120,7 @@ class Index extends React.Component {
if (!response || !Array.isArray(response)) {
response = [];
}
// console.log('columns', response);
for (let item of response) {
if (item.dataIndex === 'taskName' && !item.width) {
item.width = 200;
......
import React, { useEffect, useState, createContext } from 'react';
import React, { useEffect, useState, createContext, useRef } from 'react';
import CheckRecord from '@/webPublic/FormInsertDiy/ExportComponent/CheckRecord'; // 查询类
import Apply from '@/webPublic/FormInsertDiy/AffairPage/ApplyPage'; // 申请
import BatchAudit from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit'; // 批量审批
......@@ -11,7 +11,6 @@ export const CreateC = createContext({
routerConfig: {},
});
window.iframeParentComponent = {
Modal,
message,
......@@ -19,25 +18,23 @@ window.iframeParentComponent = {
Popconfirm,
};
function ActiveMenuComponent({
routerConfig,
...otherProps
}) {
const {
component = '',
appId
} = routerConfig;
function ActiveMenuComponent({ routerConfig, ...otherProps }) {
const { component = '', appId } = routerConfig;
const refType = useRef();
const { location } = otherProps;
const record = location?.state?.record;
const [show, setShow] = useState(false);
useEffect(
() => {
if (appId || record.id) {
if ((appId || record.id) && refType.current?.component === component) { // 当同一个组件渲染时 切换show 保证重新调接口并渲染页面
setShow(false);
setTimeout(() => {
setShow(true);
}, 100);
} else {
setShow(true);
}
refType.current = routerConfig;
},
[appId, record],
);
......@@ -49,7 +46,7 @@ function ActiveMenuComponent({
switch (component) {
case 'CheckRecord': // 查询类应用
Res = <CheckRecord workId={appId}/>;
Res = <CheckRecord workId={appId} />;
break;
case 'Apply': // 申请类
Res = <Apply workId={appId} {...otherProps} />;
......@@ -58,9 +55,7 @@ function ActiveMenuComponent({
Res = <Audit workId={appId} {...otherProps} />;
break;
case 'BatchAudit': // 批量审批
Res = <BatchAudit workId={appId}
{...otherProps}
/>;
Res = <BatchAudit workId={appId} {...otherProps} />;
break;
case 'Detail': // 详情
Res = <Detail {...otherProps} />;
......@@ -69,7 +64,8 @@ function ActiveMenuComponent({
break;
}
return (
<CreateC.Provider value={{
<CreateC.Provider
value={{
routerConfig,
}}>
{Res}
......
......@@ -3,7 +3,7 @@
* 2019年9月19日
* 查看详情页面
*/
import React, { Component, Fragment, useEffect, useState } from 'react';
import React, { Component, Fragment, useEffect, useState, useRef } from 'react';
import {
Row,
Col,
......@@ -973,6 +973,7 @@ class DetailSplit extends Component {
function Index(props) {
const { dispatch, history } = props;
const [prepare, setPrepare] = useState(false);
const DetailSplitFormNew = useRef();
useEffect(() => {
const id = history.location.state && history.location.state.id;
const code = history.location.state && history.location.state.code;
......@@ -996,7 +997,11 @@ function Index(props) {
lite: true,
},
callback: (val) => {
message.destroy();
if (val) {
DetailSplitFormNew.current = Form.create(
window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined,
)(DetailSplit);
setPrepare(val);
}
},
......@@ -1006,11 +1011,7 @@ function Index(props) {
if (!prepare) {
return <Spin size="large" spinning={true} />;
}
const DetailSplitFormNew = Form.create(
window.zdyTableTemplateWillMountProps?.formCreateOptions || undefined,
)(DetailSplit);
return <DetailSplitFormNew {...props} formPrepareData={prepare} />;
return <DetailSplitFormNew.current {...props} formPrepareData={prepare} />;
}
export default connect(() => {
......
......@@ -19,7 +19,7 @@ import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson';
export default class ZdyTable extends Component {
constructor(props) {
super(props);
console.log(props);
// console.log(props);
this.state = {
objRealTime: {},
isChange: false,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论