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

2073 开发需求1229

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