Browse Source

fix issue

tags/v1.22.6.2^2
zhoupzh 3 years ago
parent
commit
be9a381981
1 changed files with 0 additions and 48 deletions
  1. +0
    -48
      web_src/js/components/dataset/selectDataset.vue

+ 0
- 48
web_src/js/components/dataset/selectDataset.vue View File

@@ -643,18 +643,12 @@ export default {

//tree 勾选触发事件
onCheck(data, checkedInfo) {
console.log("--ref------", this.$refs[data.ref]);
console.log("---------oncheck-----", data, checkedInfo);

console.log("start array", this.selectDatasetArray);
if (
this.selectDatasetArray.length === 0 ||
this.selectDatasetArray.every((item) => item.id !== data.id)
) {
console.log("111111111111");
if (
this.selectDatasetArray.some((item) => {
console.log(item.label.split(".")[0], data.label.split(".")[0]);
return item.label.split(".")[0] === data.label.split(".")[0];
})
) {
@@ -664,18 +658,13 @@ export default {
this.$refs[data.ref].setChecked(data.id, false, false);
this.$message.error("最多不超过五个文件");
} else {
console.log("push");
this.selectDatasetArray.push(data);
}
} else {
console.log("55555555555");
let index = this.selectDatasetArray.findIndex((item) => {
console.log(item.id, data.id);
return item.id === data.id;
});
console.log("index", index);
this.selectDatasetArray.splice(index, 1);
console.log(this.selectDatasetArray);
}
this.checkList = this.selectDatasetArray.map((item) => {
return item.label;
@@ -684,15 +673,9 @@ export default {
return item.UUID;
});
this.confirmDatasetList = this.saveStatusList.join(";");
console.log(this.selectDatasetArray, this.checkList);
console.log("this.saveStatusList", this.saveStatusList);
console.log("this.confirmDatasetList", this.confirmDatasetList);

console.log("======================================");
},
//已选择数据集checkbox group 勾选事件
changeCheckbox(checked, data) {
console.log(checked, data);
this.$refs.currentTree.setChecked(data.id, false, false);
this.$refs.myTree.setChecked(data.id, false, false);
this.$refs.publicTree.setChecked(data.id, false, false);
@@ -700,15 +683,9 @@ export default {
let index = this.selectDatasetArray.findIndex((item) => {
return item.id === data.id;
});
console.log("index", index);
this.selectDatasetArray.splice(index, 1);
this.saveStatusList.splice(index, 1);
console.log(this.selectDatasetArray);
this.confirmDatasetList = this.saveStatusList.join(";");
console.log("selectDatasetArray--:", this.selectDatasetArray);
console.log("saveStatusList----:", this.saveStatusList);
console.log("confirmDatasetList----:", this.confirmDatasetList);
console.log("==================================================");
},
tableHeaderStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0) {
@@ -729,7 +706,6 @@ export default {
this.getPublicDataset();
},
favoriteChangePage(val) {
console.log(val);
this.paramsFavorite.page = val;
this.getMyFavoriteDataset();
},
@@ -744,19 +720,14 @@ export default {
})
.then((res) => {
this.loadingCurrent = false;
console.log(res);
let data = JSON.parse(res.data.data);
console.log(data);
this.currentDatasetList = this.transformeTreeData(
data,
"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);
console.log("this.currentDatasetList:", this.currentDatasetList);
let setCheckedKeysList = this.currentDatasetList.reduce(
(pre, cur) => {
cur.Attachments.forEach((item) => {
@@ -768,7 +739,6 @@ export default {
},
[]
);
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.currentTree.setCheckedKeys(setCheckedKeysList);
})
.catch(function (error) {
@@ -786,9 +756,7 @@ export default {
})
.then((res) => {
this.loadingMy = false;
console.log(res);
let data = JSON.parse(res.data.data);
console.log(data);
this.myDatasetList = this.transformeTreeData(
data,
"myTree",
@@ -796,7 +764,6 @@ export default {
);
this.initMyTreeNode = [this.myDatasetList[0].id];
this.totalNumMy = parseInt(res.data.count);
console.log("this.myDatasetList:", this.myDatasetList);
let setCheckedKeysList = this.myDatasetList.reduce((pre, cur) => {
cur.Attachments.forEach((item) => {
if (this.saveStatusList.includes(item.id)) {
@@ -805,7 +772,6 @@ export default {
});
return pre;
}, []);
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.myTree.setCheckedKeys(setCheckedKeysList);
})
.catch(function (error) {
@@ -823,9 +789,7 @@ export default {
})
.then((res) => {
this.loadingPublic = false;
console.log(res);
let data = JSON.parse(res.data.data);
console.log(data);
this.publicDatasetList = this.transformeTreeData(
data,
"publicTree",
@@ -833,8 +797,6 @@ export default {
);
this.initPublicTreeNode = [this.publicDatasetList[0].id];
this.totalNumPublic = parseInt(res.data.count);
console.log("this.publicDatasetList:", this.publicDatasetList);

let setCheckedKeysList = this.publicDatasetList.reduce((pre, cur) => {
cur.Attachments.forEach((item) => {
if (this.saveStatusList.includes(item.id)) {
@@ -843,7 +805,6 @@ export default {
});
return pre;
}, []);
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.publicTree.setCheckedKeys(setCheckedKeysList);
})
.catch(function (error) {
@@ -862,9 +823,7 @@ export default {
})
.then((res) => {
this.loadingFavorite = false;
console.log(res);
let data = JSON.parse(res.data.data);
console.log(data);
this.MyFavoriteDatasetList = this.transformeTreeData(
data,
"favoriteTree",
@@ -872,11 +831,6 @@ export default {
);
this.initFavoriteTreeNode = [this.MyFavoriteDatasetList[0].id];
this.totalNumFavorite = parseInt(res.data.count);
console.log(
"this.MyFavoriteDatasetList:",
this.MyFavoriteDatasetList
);

let setCheckedKeysList = this.MyFavoriteDatasetList.reduce(
(pre, cur) => {
cur.Attachments.forEach((item) => {
@@ -888,7 +842,6 @@ export default {
},
[]
);
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.favoriteTree.setCheckedKeys(setCheckedKeysList);
})
.catch(function (error) {
@@ -993,7 +946,6 @@ export default {
mounted() {
this.type = $(".cloudbrain-type").data("cloudbrain-type");
this.repoLink = $(".cloudbrain-type").data("repo-link");
console.log(this.type, this.repoLink);
if (
location.href.indexOf("benchmark") !== -1 ||
location.href.indexOf("train-job") !== -1


Loading…
Cancel
Save