提交 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'; // 批量审批
...@@ -8,75 +8,71 @@ import { Modal, message, notification, Popconfirm } from 'antd'; ...@@ -8,75 +8,71 @@ import { Modal, message, notification, Popconfirm } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
export const CreateC = createContext({ export const CreateC = createContext({
routerConfig: {}, routerConfig: {},
}); });
window.iframeParentComponent = { window.iframeParentComponent = {
Modal, Modal,
message, message,
notification, notification,
Popconfirm, Popconfirm,
}; };
function ActiveMenuComponent({ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
routerConfig, const { component = '', appId } = routerConfig;
...otherProps const refType = useRef();
}) { const { location } = otherProps;
const { const record = location?.state?.record;
component = '', const [show, setShow] = useState(false);
appId useEffect(
} = routerConfig; () => {
const { location } = otherProps; if ((appId || record.id) && refType.current?.component === component) { // 当同一个组件渲染时 切换show 保证重新调接口并渲染页面
const record = location?.state?.record; setShow(false);
const [show, setShow] = useState(false); setTimeout(() => {
useEffect( setShow(true);
() => { }, 100);
if (appId || record.id) { } else {
setShow(false); setShow(true);
setTimeout(() => { }
setShow(true); refType.current = routerConfig;
}, 100); },
} [appId, record],
}, );
[appId, record], if (!show) {
); return null;
if (!show) { }
return null;
}
let Res = <div>暂无此功能</div>; let Res = <div>暂无此功能</div>;
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} />;
break; break;
case 'Audit': // 审批类 case 'Audit': // 审批类
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;
/>; case 'Detail': // 详情
break; Res = <Detail {...otherProps} />;
case 'Detail': // 详情 break;
Res = <Detail {...otherProps} />; default:
break; break;
default: }
break; return (
} <CreateC.Provider
return ( value={{
<CreateC.Provider value={{ routerConfig,
routerConfig, }}>
}}> {Res}
{Res} </CreateC.Provider>
</CreateC.Provider> );
);
} }
export default connect(({}) => { export default connect(({}) => {
return {}; return {};
})(ActiveMenuComponent); })(ActiveMenuComponent);
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论