diff --git a/web_src/js/components/dataset/selectDataset.vue b/web_src/js/components/dataset/selectDataset.vue index 1ecbf88f8..91266de19 100644 --- a/web_src/js/components/dataset/selectDataset.vue +++ b/web_src/js/components/dataset/selectDataset.vue @@ -76,9 +76,9 @@ > - +
- {{ data.desc }} + {{ data.Description }}
{{ node.label }} @@ -88,11 +88,11 @@ >{{ node.label }} chen/datset{{data.Repo.OwnerName}}/{{data.Repo.Alias}}
{{ node.label }} @@ -132,9 +132,9 @@ > - +
- {{ data.desc }} + {{ data.Description }}
{{ node.label }} @@ -144,11 +144,11 @@ >{{ node.label }} chen/datset{{data.Repo.OwnerName}}/{{data.Repo.Alias}}
{{ node.label }} @@ -192,9 +192,9 @@ > - +
- {{ data.desc }} + {{ data.Description }}
{{ node.label }} @@ -204,11 +204,11 @@ >{{ node.label }} chen/datset{{data.Repo.OwnerName}}/{{data.Repo.Alias}}
{{ node.label }} @@ -252,9 +252,9 @@ > - +
- {{ data.desc }} + {{ data.Description }}
{{ node.label }} @@ -264,11 +264,11 @@ >{{ node.label }} chen/datset{{data.Repo.OwnerName}}/{{data.Repo.Alias}}
{{ node.label }} @@ -320,6 +320,7 @@ v-for="(item, index) in selectDatasetArray" :key="index" :label="item.label" + :title="item.label" @change="(checked) => changeCheckbox(checked, item)" > @@ -530,6 +531,8 @@ export default { selectDatasetArray: [], checkList: [], checkList1: [], + + saveStutusCheck:[], //当前项目数据集页面配置的初始化 initCurrentPage: 1, totalNumCurrent: 0, @@ -648,6 +651,16 @@ export default { this.checkList1 = this.selectDatasetArray.map((item) => { return item.id; }); + console.log() + this.saveStutusCheck = this.selectDatasetArray.reduce((pre,cur)=>{ + let checkedKeys={} + checkedKeys.treeRef = cur.ref + checkedKeys.id=cur.id + checkedKeys.page = cur.page + pre.push(checkedKeys) + return pre + },[]) + console.log("this.saveStutusCheck",this.saveStutusCheck) console.log(this.selectDatasetArray, this.checkList); }, // onMyCheck(data, checkedInfo) { @@ -687,12 +700,49 @@ export default { //已选择数据集checkbox group 勾选事件 changeCheckbox(checked, data) { console.log(checked, data); - if (this.data[0].children.some((item) => item.id === data.id)) { - console.log("----is data-----------"); - this.$refs.currentTree.setChecked(data.id, false, false); - } else if (this.data1[0].children.some((item) => item.id === data.id)) { - console.log("----is data1-----------"); - this.$refs.myTree.setChecked(data.id, false, false); + + // if (this.data[0].children.some((item) => item.id === data.id)) { + // console.log("----is data-----------"); + // this.$refs.currentTree.setChecked(data.id, false, false); + // } else if (this.data1[0].children.some((item) => item.id === data.id)) { + // console.log("----is data1-----------"); + // this.$refs.myTree.setChecked(data.id, false, false); + // } + + switch(data.ref){ + case "currentTree": + { + this.$refs.currentTree.setChecked(data.id, false, false); + let index = this.saveStutusCheck.findIndex((item) => { + return item.id === data.id; + }); + index!==-1&&this.saveStutusCheck.splice(index, 1); + } + case "myTree": + { + this.$refs.myTree.setChecked(data.id, false, false); + let index = this.saveStutusCheck.findIndex((item) => { + return item.id === data.id; + }); + index!==-1&&this.saveStutusCheck.splice(index, 1); + } + case "publicTree": + { + this.$refs.publicTree.setChecked(data.id, false, false); + let index = this.saveStutusCheck.findIndex((item) => { + return item.id === data.id; + }); + index!==-1&&this.saveStutusCheck.splice(index, 1); + } + case "favoriteTree": + { + this.$refs.myTree.setChecked(data.id, false, false); + let index = this.saveStutusCheck.findIndex((item) => { + return item.id === data.id; + }); + index!==-1&&this.saveStutusCheck.splice(index, 1); + } + default: } let index = this.selectDatasetArray.findIndex((item) => { @@ -742,14 +792,22 @@ export default { console.log(data); this.currentDatasetList = this.transformeTreeData( data, - "currentTree" + "currentTree", + this.paramsCurrent.page ); this.initCurrentTreeNode = [this.currentDatasetList[0].id]; console.log("this.initCurrentTreeNode", this.initCurrentTreeNode); this.totalNumCurrent = parseInt(res.data.count); console.log(this.selectDatasetArray); - this.$refs.currentTree.setCheckedKeys(this.checkList1); console.log("this.currentDatasetList:", this.currentDatasetList); + let setCheckedKeysList=this.saveStutusCheck.reduce((pre,cur)=>{ + if(cur.treeRef==='currentTree' && cur.page===this.paramsCurrent.page){ + pre.push(cur.id) + } + return pre + },[]) + console.log("setCheckedKeysList",setCheckedKeysList) + this.$refs.currentTree.setCheckedKeys(setCheckedKeysList); }) .catch(function (error) { this.loadingCurrent = false; @@ -769,13 +827,23 @@ export default { console.log(res); let data = JSON.parse(res.data.data); console.log(data); - this.myDatasetList = this.transformeTreeData(data, "myTree"); + this.myDatasetList = this.transformeTreeData(data, "myTree",this.paramsMy.page); this.initMyTreeNode = [this.myDatasetList[0].id]; this.totalNumMy = parseInt(res.data.count); console.log("this.myDatasetList:", this.myDatasetList); + console.log("this.aveStutusCheck:", this.saveStutusCheck) + let setCheckedKeysList=this.saveStutusCheck.reduce((pre,cur)=>{ + if(cur.treeRef==='myTree' && cur.page===this.paramsMy.page){ + pre.push(cur.id) + } + return pre + },[]) + console.log("setCheckedKeysList",setCheckedKeysList) + this.$refs.myTree.setCheckedKeys(setCheckedKeysList); + }) .catch(function (error) { - this.loadingMy = false; + console.log(error); }); }, @@ -793,10 +861,18 @@ export default { console.log(res); let data = JSON.parse(res.data.data); console.log(data); - this.publicDatasetList = this.transformeTreeData(data, "publicTree"); + this.publicDatasetList = this.transformeTreeData(data, "publicTree",this.paramsPublics.page); this.initPublicTreeNode = [this.publicDatasetList[0].id]; this.totalNumPublic = parseInt(res.data.count); console.log("this.publicDatasetList:", this.publicDatasetList); + let setCheckedKeysList=this.saveStutusCheck.reduce((pre,cur)=>{ + if(cur.treeRef==='publicTree' && cur.page===this.paramsPublics.page){ + pre.push(cur.id) + } + return pre + },[]) + console.log("setCheckedKeysList",setCheckedKeysList) + this.$refs.publicTree.setCheckedKeys(setCheckedKeysList); }) .catch(function (error) { this.loadingPublic = false; @@ -810,7 +886,7 @@ export default { this.paramsFavorite.type = this.type; this.$axios .get(url, { - params: this.paramsCurrent, + params: this.paramsFavorite, }) .then((res) => { this.loadingFavorite = false; @@ -819,7 +895,8 @@ export default { console.log(data); this.MyFavoriteDatasetList = this.transformeTreeData( data, - "favoriteTree" + "favoriteTree", + this.paramsFavorite.page ); this.initFavoriteTreeNode = [this.MyFavoriteDatasetList[0].id]; this.totalNumFavorite = parseInt(res.data.count); @@ -827,13 +904,21 @@ export default { "this.MyFavoriteDatasetList:", this.MyFavoriteDatasetList ); + let setCheckedKeysList=this.saveStutusCheck.reduce((pre,cur)=>{ + if(cur.treeRef==='favoriteTree' && cur.page===this.paramsFavorite.page){ + pre.push(cur.id) + } + return pre + },[]) + console.log("setCheckedKeysList",setCheckedKeysList) + this.$refs.favoriteTree.setCheckedKeys(setCheckedKeysList); }) .catch(function (error) { this.loadingFavorite = false; console.log(error); }); }, - transformeTreeData(data, ref) { + transformeTreeData(data, ref,page) { return data.reduce((preParent, curParent) => { curParent.id = `paraent-${curParent.ID}`; curParent.disabled = true; @@ -843,6 +928,7 @@ export default { (preChild, curchild) => { curchild.id = `chilrden-${ref}-${curchild.ID}`; curchild.ref = ref; + curchild.page = page if (curchild.DecompressState !== 1) { curchild.disabled = true; } @@ -1004,6 +1090,15 @@ export default { line-height: 20px; font-size: 12px; } +/deep/ .el-checkbox-group .el-checkbox{ + max-width: 100%; +} +/deep/ .el-checkbox-group .el-checkbox .el-checkbox__label{ + max-width:100%; + overflow: hidden; + vertical-align: middle; + text-overflow: ellipsis; +} .dataset-nowrap { overflow: hidden; text-overflow: ellipsis;