From 1daf925c24af8dd37f08c551eb4bf41b4fb85456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E9=9D=99?= <17600756968@163.com> Date: Mon, 8 Mar 2021 19:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DataView/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/DataView/index.js b/components/DataView/index.js index fb1a1a6..8ed0589 100644 --- a/components/DataView/index.js +++ b/components/DataView/index.js @@ -37,7 +37,7 @@ function reduceDimension(arr) { // userTree/orgTree数据转成{id,name} function formatUser(obj) { let name = obj.label; - if(!name){ + if (!name) { return undefined; } if (typeof name !== 'string') { @@ -451,11 +451,12 @@ export default class DataView extends React.Component { search() { const { beforeSearch } = this.props; - window.history.replaceState( - { pageNum: 1 }, - '', - `${window.location.search && window.location.search.indexOf('?pageNum') < 0 ? `${window.location.search}&` : '?'}pageNum=1`, - ); + window.history.replaceState({ pageNum: 1 }, '', `?pageNum=${1}`); + // window.history.replaceState( + // { pageNum: 1 }, + // '', + // `${window.location.search && window.location.search.indexOf('?pageNum') < 0 ? `${window.location.search}&` : '?'}pageNum=1`, + // ); if (typeof beforeSearch === 'function') { beforeSearch(); } -- 2.21.0