提交 4be61f52 authored 作者: 钟是志's avatar 钟是志

姚鑫国 微信私聊消息发的 北电科老师提的bug

上级 8c5084ed
...@@ -7,6 +7,7 @@ import AuditModal from '@/webPublic/FormInsertDiy/AuditPage/BatchAudit/AuditModa ...@@ -7,6 +7,7 @@ import AuditModal from '@/webPublic/FormInsertDiy/AuditPage/BatchAudit/AuditModa
import { ModalInfo } from '@/baseComponent/Modal'; import { ModalInfo } from '@/baseComponent/Modal';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import CreateC from '@/webPublic/FormInsertDiy/ExportComponent/ContextCreate'; import CreateC from '@/webPublic/FormInsertDiy/ExportComponent/ContextCreate';
import { isJSON } from "@/webPublic/zyd_public/utils/utils";
class AuditPage extends Component { class AuditPage extends Component {
constructor(props) { constructor(props) {
...@@ -82,8 +83,7 @@ class AuditPage extends Component { ...@@ -82,8 +83,7 @@ class AuditPage extends Component {
scroll: { x: 'max-content' }, scroll: { x: 'max-content' },
getPageService: getWaitPage, getPageService: getWaitPage,
beforeSearchData: (data) => { beforeSearchData: (data) => {
console.log(data); const searcherKeyValue = data.searcherKeyValue && isJSON(data.searcherKeyValue) ? JSON.parse(data.searcherKeyValue) : {};
let searcherKeyValue = {};
for (let item of searchCondition) { for (let item of searchCondition) {
if ( if (
typeof data[item.key] !== 'undefined' && typeof data[item.key] !== 'undefined' &&
...@@ -202,6 +202,7 @@ class AuditPage extends Component { ...@@ -202,6 +202,7 @@ class AuditPage extends Component {
pageSearch={this.handleSearchSet({})} pageSearch={this.handleSearchSet({})}
setRefInfo={this.props.setRefInfo} setRefInfo={this.props.setRefInfo}
keepAliveData={this.props.keepAliveData} keepAliveData={this.props.keepAliveData}
dispatch={this.props.dispatch}
/> />
</PageHeaderWrapper> </PageHeaderWrapper>
); );
......
...@@ -32,6 +32,7 @@ export default class List extends Component { ...@@ -32,6 +32,7 @@ export default class List extends Component {
}, },
}, },
}; };
this.trueSearchParams = {}; // 真实的搜索条件
} }
giveDefaultValue = (props) => { giveDefaultValue = (props) => {
...@@ -48,10 +49,10 @@ export default class List extends Component { ...@@ -48,10 +49,10 @@ export default class List extends Component {
} }
} }
} }
if (props.keepAliveData?.searchFormValues) { if (props.keepAliveData?.trueSearchParams) {
formValues = { formValues = {
...formValues, ...formValues,
...props.keepAliveData?.searchFormValues, ...props.keepAliveData?.trueSearchParams,
}; };
} }
return formValues; return formValues;
...@@ -109,7 +110,10 @@ export default class List extends Component { ...@@ -109,7 +110,10 @@ export default class List extends Component {
if (search.beforeSearchDataOutSide && typeof search.beforeSearchDataOutSide === 'function') { if (search.beforeSearchDataOutSide && typeof search.beforeSearchDataOutSide === 'function') {
data = search.beforeSearchDataOutSide(data, { ...this.props }); data = search.beforeSearchDataOutSide(data, { ...this.props });
} }
this.trueSearchParams = { ...data };
delete this.trueSearchParams.pageNo;
delete this.trueSearchParams.pageSize;
console.log("🚀 ~ file:List method:getPage line:116 -----", this.trueSearchParams, "this.trueSearchParams");
search.getPageService({ ...data, appId: workId }).then((response) => { search.getPageService({ ...data, appId: workId }).then((response) => {
this.setState({ this.setState({
loading: false, loading: false,
...@@ -209,8 +213,21 @@ export default class List extends Component { ...@@ -209,8 +213,21 @@ export default class List extends Component {
} else { } else {
formValues = {}; formValues = {};
} }
let pagination = this.state.pagination;
pagination.current = 1;
this.setState({ this.setState({
formValues, formValues,
pagination,
}, () => {
this.getPage();
});
};
handleSearch = () => {
let pagination = this.state.pagination;
pagination.current = 1;
this.setState({
pagination,
}, () => { }, () => {
this.getPage(); this.getPage();
}); });
...@@ -326,7 +343,7 @@ export default class List extends Component { ...@@ -326,7 +343,7 @@ export default class List extends Component {
<SearchDom <SearchDom
formStateChange={this.formStateChange} formStateChange={this.formStateChange}
formValues={formValues} formValues={formValues}
getPage={this.getPage} getPage={this.handleSearch}
resetFormValues={this.resetFormValues} resetFormValues={this.resetFormValues}
config={pageSearch.search} config={pageSearch.search}
/> />
......
...@@ -24,6 +24,18 @@ class ListTab extends Component { ...@@ -24,6 +24,18 @@ class ListTab extends Component {
} }
handleChangeTab = (activeKey) => { handleChangeTab = (activeKey) => {
const { dispatch, keepAliveData } = this.props;
dispatch({
type: 'keepAlive/setAuditPageData',
payload: {
path: window.location.href.split('#')[1],
value: {
...keepAliveData,
pageCurrent: 1,
},
},
});
this.setState( this.setState(
{ {
activeKey: '-111111', activeKey: '-111111',
......
...@@ -100,6 +100,7 @@ class Index extends React.Component { ...@@ -100,6 +100,7 @@ class Index extends React.Component {
activeKey: refInfo.ListTab.state.activeKey || 'tab1', activeKey: refInfo.ListTab.state.activeKey || 'tab1',
pageCurrent: refInfo.List.state.pagination.current || 1, pageCurrent: refInfo.List.state.pagination.current || 1,
searchFormValues: refInfo.List.state.formValues || {}, searchFormValues: refInfo.List.state.formValues || {},
trueSearchParams: refInfo.List.trueSearchParams || {},
}; };
dispatch({ dispatch({
type: 'keepAlive/setAuditPageData', type: 'keepAlive/setAuditPageData',
...@@ -262,6 +263,7 @@ class Index extends React.Component { ...@@ -262,6 +263,7 @@ class Index extends React.Component {
tab1Buttons={tab1Buttons} tab1Buttons={tab1Buttons}
keepAliveData={this.props.keepAlive?.AuditPageData[window.location.href.split('#')[1]]} keepAliveData={this.props.keepAlive?.AuditPageData[window.location.href.split('#')[1]]}
setRefInfo={this.setRefInfo} setRefInfo={this.setRefInfo}
dispatch={this.props.dispatch}
/> />
); );
} }
......
...@@ -85,7 +85,8 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) { ...@@ -85,7 +85,8 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
Res = <Audit workId={appId} {...otherProps} routerConfig={routerConfig}/>; Res = <Audit workId={appId} {...otherProps} routerConfig={routerConfig}/>;
break; break;
case 'BatchAudit': // 批量审批 case 'BatchAudit': // 批量审批
Res = <BatchAudit workId={appId} {...otherProps} Res = <BatchAudit workId={appId}
{...otherProps}
routerConfig={routerConfig} routerConfig={routerConfig}
/>; />;
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论