提交 3e485400 authored 作者: 钟是志's avatar 钟是志

2073 开发需求1229

上级 df3994ea
......@@ -134,7 +134,6 @@ class AuditPage extends Component {
},
beforeSearchData: (data) => {
let searcherKeyValue = {};
console.log(data);
for (let item of searchCondition) {
if (typeof data[item.key] !== 'undefined'
&& item.key !== 'taskDefKey'
......@@ -178,6 +177,12 @@ class AuditPage extends Component {
};
};
componentDidMount() {
if(this.props.setRefInfo){
this.props.setRefInfo('AuditPage', this);
}
}
render() {
const { workId, dataBaseId, addFields, searchCondition } = this.props;
return (
......@@ -191,6 +196,8 @@ class AuditPage extends Component {
addFields={addFields}
locationState={this.context.locationState}
pageSearch={this.handleSearchSet({})}
setRefInfo={this.props.setRefInfo}
keepAliveData={this.props.keepAliveData}
/>
</PageHeaderWrapper>
);
......
......@@ -11,6 +11,7 @@ import { handleColumns } from '@/webPublic/FormInsertDiy/AffairPage/destruction'
export default class List extends Component {
constructor(props) {
super(props);
const { keepAliveData } = props;
this.state = {
list: [],
selectRows: [],
......@@ -18,7 +19,7 @@ export default class List extends Component {
loading: true,
sortGetPageFields: {},
pagination: {
current: 1,
current: (keepAliveData && keepAliveData.pageCurrent) || 1,
total: 1,
pageSize: this.props.listConfig.pageSize || 10,
pageSizeOptions: ['10', '20', '50', '100', '500'],
......@@ -47,6 +48,12 @@ export default class List extends Component {
}
}
}
if (props.keepAliveData?.searchFormValues) {
formValues = {
...formValues,
...props.keepAliveData?.searchFormValues,
};
}
return formValues;
};
......@@ -189,11 +196,10 @@ export default class List extends Component {
if (!search.noNeedInitData) {
this.getPage();
}
if (this.props.setRefInfo) {
this.props.setRefInfo('List', this);
}
}
componentWillMount() {}
componentWillUnmount() {}
resetFormValues = () => {
const { beforeResetFormValues } = this.props.pageSearch.search;
......
......@@ -11,10 +11,14 @@ const TabPane = Tabs.TabPane;
class ListTab extends Component {
constructor(props) {
super(props);
const { tabList } = this.props;
const { tabList, keepAliveData } = this.props;
const tabKeys = Object.keys(tabList);
let activeKey = this.props.locationState?.activeKey || tabKeys[0];
if(keepAliveData && keepAliveData.activeKey){
activeKey = keepAliveData.activeKey;
}
this.state = {
activeKey: this.props.locationState?.activeKey || tabKeys[0],
activeKey: activeKey,
tabKeys: tabKeys,
};
}
......@@ -34,6 +38,12 @@ class ListTab extends Component {
);
};
componentDidMount() {
if (this.props.setRefInfo) {
this.props.setRefInfo('ListTab', this);
}
}
render() {
const {
tabList,
......@@ -44,17 +54,14 @@ class ListTab extends Component {
addFields,
searchCondition,
} = this.props;
const {
activeKey,
tabKeys
} = this.state;
const { activeKey, tabKeys } = this.state;
return (
<Fragment>
<Shell styleShell={{ marginTop: 0 }}>
{/*<SearchDom />*/}
<Tabs activeKey={activeKey} className={styles.ListTab} onChange={this.handleChangeTab}>
{tabKeys.map((item) => {
return <TabPane tab={tabList[item].name} key={item}/>;
return <TabPane tab={tabList[item].name} key={item} />;
})}
</Tabs>
</Shell>
......@@ -76,6 +83,8 @@ class ListTab extends Component {
dataBaseId={dataBaseId}
pageSearch={pageSearch[item]}
pageButton={pageButton[item]}
setRefInfo={this.props.setRefInfo}
keepAliveData={this.props.keepAliveData}
/>
) : null;
})}
......@@ -86,7 +95,6 @@ class ListTab extends Component {
ListTab.contextType = CreateC;
ListTab.propTypes = {};
ListTab.defaultProps = {};
......
......@@ -12,7 +12,12 @@ import * as destructionFunc from '../destruction';
import { Link } from 'dva/router';
import CreateC from '../../ExportComponent/ContextCreate';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
import { connect } from 'dva';
import router from 'umi/router';
@connect(({ keepAlive }) => ({
keepAlive,
}))
class Index extends React.Component {
static defaultProps = {
hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志
......@@ -36,8 +41,17 @@ class Index extends React.Component {
allConfigSetInfo: {}, // 返回的数据
};
window.callbackSubmitInfoZhiYong = undefined;
this.refInfo = {
AuditPage: null,
ListTab: null,
List: null,
};
}
setRefInfo = (key, component) => {
this.refInfo[key] = component;
};
getFormDetail = (workId) => {
const { dataBaseId } = this.state;
service.getFormDetail(workId).then((response) => {
......@@ -80,9 +94,22 @@ class Index extends React.Component {
title: '操作',
fixed: 'right',
render: (text, record) => {
return (
<Link
to={{
const { refInfo } = this;
const { dispatch } = this.props;
function goDetail() {
const data = {
activeKey: refInfo.ListTab.state.activeKey || 'tab1',
pageCurrent: refInfo.List.state.pagination.current || 1,
searchFormValues: refInfo.List.state.formValues || {},
};
dispatch({
type: 'keepAlive/setAuditPageData',
payload: {
path: window.location.href.split('#')[1],
value: data,
},
});
router.push({
pathname: './Detail',
state: {
workId,
......@@ -92,10 +119,9 @@ class Index extends React.Component {
tableInfo,
showPrint: showPrint || routerConfig.showPrint === '1',
},
}}>
{text || '详情'}
</Link>
);
});
}
return <a onClick={goDetail}>{text || '详情'}</a>;
},
});
this.setState({
......@@ -169,7 +195,7 @@ class Index extends React.Component {
batchAuditButtonName,
showPrint,
noNeedForm,
routerConfig : {
routerConfig: {
isExport = '0', // 解决禅道 32898 在路由中增加配置项 如果 = '1' 表示 开启已处理数据的导出
},
} = this.props;
......@@ -192,8 +218,6 @@ class Index extends React.Component {
}); // 解决禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152
}
if (Array.isArray(columns)) {
let d = [];
for (let item of columns) {
......@@ -205,7 +229,6 @@ class Index extends React.Component {
}
}
}
console.log(columns);
return (
<AuditPage
hasBatchAudit={hasBatchAudit}
......@@ -220,6 +243,8 @@ class Index extends React.Component {
showPrint={showPrint}
noNeedForm={noNeedForm}
tab2Buttons={tab2Buttons}
keepAliveData={this.props.keepAlive?.AuditPageData[window.location.href.split('#')[1]]}
setRefInfo={this.setRefInfo}
/>
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论