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

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

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