From 38f7f15f112408c52e3665506a174e8cba977808 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Wed, 27 Jul 2022 19:28:32 +0800 Subject: [PATCH] =?UTF-8?q?fix-2593=20=E9=80=89=E6=8B=A9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=AA=97=E5=8F=A3=E7=9A=84=E6=90=9C=E7=B4=A2=E6=A1=86?= =?UTF-8?q?=E6=8C=89=E5=9B=9E=E8=BD=A6=E9=94=AE=E4=B8=8D=E5=BA=94=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E6=96=B0=E5=BB=BA=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/js/components/dataset/selectDataset.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web_src/js/components/dataset/selectDataset.vue b/web_src/js/components/dataset/selectDataset.vue index 3596fea1f..ec09a0db8 100755 --- a/web_src/js/components/dataset/selectDataset.vue +++ b/web_src/js/components/dataset/selectDataset.vue @@ -76,7 +76,7 @@ type="text" placeholder="搜数据集名称/描述..." v-model="search" - @keyup.enter="searchName" + @keyup.enter.stop="searchName" /> @@ -727,7 +727,7 @@ export default { "currentTree", this.paramsCurrent.page ); - this.initCurrentTreeNode = [this.currentDatasetList[0].id]; + this.initCurrentTreeNode = this.currentDatasetList[0]?.id ? [this.currentDatasetList[0].id] : []; this.totalNumCurrent = parseInt(res.data.count); let setCheckedKeysList = this.currentDatasetList.reduce( (pre, cur) => { @@ -742,7 +742,7 @@ export default { ); this.$refs.currentTree.setCheckedKeys(setCheckedKeysList); }) - .catch(function (error) { + .catch((error) => { this.loadingCurrent = false; console.log(error); }); @@ -763,7 +763,7 @@ export default { "myTree", this.paramsMy.page ); - this.initMyTreeNode = [this.myDatasetList[0].id]; + this.initMyTreeNode = this.myDatasetList[0]?.id ? [this.myDatasetList[0].id] : []; this.totalNumMy = parseInt(res.data.count); let setCheckedKeysList = this.myDatasetList.reduce((pre, cur) => { cur.Attachments.forEach((item) => { @@ -775,7 +775,7 @@ export default { }, []); this.$refs.myTree.setCheckedKeys(setCheckedKeysList); }) - .catch(function (error) { + .catch((error) => { console.log(error); }); }, @@ -796,7 +796,7 @@ export default { "publicTree", this.paramsPublics.page ); - this.initPublicTreeNode = [this.publicDatasetList[0].id]; + this.initPublicTreeNode = this.publicDatasetList[0]?.id ? [this.publicDatasetList[0].id] : []; this.totalNumPublic = parseInt(res.data.count); let setCheckedKeysList = this.publicDatasetList.reduce((pre, cur) => { cur.Attachments.forEach((item) => { @@ -808,7 +808,7 @@ export default { }, []); this.$refs.publicTree.setCheckedKeys(setCheckedKeysList); }) - .catch(function (error) { + .catch((error) => { this.loadingPublic = false; console.log(error); }); @@ -830,7 +830,7 @@ export default { "favoriteTree", this.paramsFavorite.page ); - this.initFavoriteTreeNode = [this.MyFavoriteDatasetList[0].id]; + this.initFavoriteTreeNode = this.MyFavoriteDatasetList[0]?.id ? [this.MyFavoriteDatasetList[0].id] : []; this.totalNumFavorite = parseInt(res.data.count); let setCheckedKeysList = this.MyFavoriteDatasetList.reduce( (pre, cur) => { @@ -845,7 +845,7 @@ export default { ); this.$refs.favoriteTree.setCheckedKeys(setCheckedKeysList); }) - .catch(function (error) { + .catch((error) => { this.loadingFavorite = false; console.log(error); });