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

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

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