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

console.log("start array", this.selectDatasetArray);
if ( if (
this.selectDatasetArray.length === 0 || this.selectDatasetArray.length === 0 ||
this.selectDatasetArray.every((item) => item.id !== data.id) this.selectDatasetArray.every((item) => item.id !== data.id)
) { ) {
console.log("111111111111");
if ( if (
this.selectDatasetArray.some((item) => { this.selectDatasetArray.some((item) => {
console.log(item.label.split(".")[0], data.label.split(".")[0]);
return 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.$refs[data.ref].setChecked(data.id, false, false);
this.$message.error("最多不超过五个文件"); this.$message.error("最多不超过五个文件");
} else { } else {
console.log("push");
this.selectDatasetArray.push(data); this.selectDatasetArray.push(data);
} }
} else { } else {
console.log("55555555555");
let index = this.selectDatasetArray.findIndex((item) => { let index = this.selectDatasetArray.findIndex((item) => {
console.log(item.id, data.id);
return item.id === data.id; return item.id === data.id;
}); });
console.log("index", index);
this.selectDatasetArray.splice(index, 1); this.selectDatasetArray.splice(index, 1);
console.log(this.selectDatasetArray);
} }
this.checkList = this.selectDatasetArray.map((item) => { this.checkList = this.selectDatasetArray.map((item) => {
return item.label; return item.label;
@@ -684,15 +673,9 @@ export default {
return item.UUID; return item.UUID;
}); });
this.confirmDatasetList = this.saveStatusList.join(";"); 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 勾选事件 //已选择数据集checkbox group 勾选事件
changeCheckbox(checked, data) { changeCheckbox(checked, data) {
console.log(checked, data);
this.$refs.currentTree.setChecked(data.id, false, false); this.$refs.currentTree.setChecked(data.id, false, false);
this.$refs.myTree.setChecked(data.id, false, false); this.$refs.myTree.setChecked(data.id, false, false);
this.$refs.publicTree.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) => { let index = this.selectDatasetArray.findIndex((item) => {
return item.id === data.id; return item.id === data.id;
}); });
console.log("index", index);
this.selectDatasetArray.splice(index, 1); this.selectDatasetArray.splice(index, 1);
this.saveStatusList.splice(index, 1); this.saveStatusList.splice(index, 1);
console.log(this.selectDatasetArray);
this.confirmDatasetList = this.saveStatusList.join(";"); 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 }) { tableHeaderStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0) { if (rowIndex === 0) {
@@ -729,7 +706,6 @@ export default {
this.getPublicDataset(); this.getPublicDataset();
}, },
favoriteChangePage(val) { favoriteChangePage(val) {
console.log(val);
this.paramsFavorite.page = val; this.paramsFavorite.page = val;
this.getMyFavoriteDataset(); this.getMyFavoriteDataset();
}, },
@@ -744,19 +720,14 @@ export default {
}) })
.then((res) => { .then((res) => {
this.loadingCurrent = false; this.loadingCurrent = false;
console.log(res);
let data = JSON.parse(res.data.data); let data = JSON.parse(res.data.data);
console.log(data);
this.currentDatasetList = this.transformeTreeData( this.currentDatasetList = this.transformeTreeData(
data, data,
"currentTree", "currentTree",
this.paramsCurrent.page this.paramsCurrent.page
); );
this.initCurrentTreeNode = [this.currentDatasetList[0].id]; this.initCurrentTreeNode = [this.currentDatasetList[0].id];
console.log("this.initCurrentTreeNode", this.initCurrentTreeNode);
this.totalNumCurrent = parseInt(res.data.count); this.totalNumCurrent = parseInt(res.data.count);
console.log(this.selectDatasetArray);
console.log("this.currentDatasetList:", this.currentDatasetList);
let setCheckedKeysList = this.currentDatasetList.reduce( let setCheckedKeysList = this.currentDatasetList.reduce(
(pre, cur) => { (pre, cur) => {
cur.Attachments.forEach((item) => { cur.Attachments.forEach((item) => {
@@ -768,7 +739,6 @@ export default {
}, },
[] []
); );
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.currentTree.setCheckedKeys(setCheckedKeysList); this.$refs.currentTree.setCheckedKeys(setCheckedKeysList);
}) })
.catch(function (error) { .catch(function (error) {
@@ -786,9 +756,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.loadingMy = false; this.loadingMy = false;
console.log(res);
let data = JSON.parse(res.data.data); let data = JSON.parse(res.data.data);
console.log(data);
this.myDatasetList = this.transformeTreeData( this.myDatasetList = this.transformeTreeData(
data, data,
"myTree", "myTree",
@@ -796,7 +764,6 @@ export default {
); );
this.initMyTreeNode = [this.myDatasetList[0].id]; this.initMyTreeNode = [this.myDatasetList[0].id];
this.totalNumMy = parseInt(res.data.count); this.totalNumMy = parseInt(res.data.count);
console.log("this.myDatasetList:", this.myDatasetList);
let setCheckedKeysList = this.myDatasetList.reduce((pre, cur) => { let setCheckedKeysList = this.myDatasetList.reduce((pre, cur) => {
cur.Attachments.forEach((item) => { cur.Attachments.forEach((item) => {
if (this.saveStatusList.includes(item.id)) { if (this.saveStatusList.includes(item.id)) {
@@ -805,7 +772,6 @@ export default {
}); });
return pre; return pre;
}, []); }, []);
console.log("setCheckedKeysList", setCheckedKeysList);
this.$refs.myTree.setCheckedKeys(setCheckedKeysList); this.$refs.myTree.setCheckedKeys(setCheckedKeysList);
}) })
.catch(function (error) { .catch(function (error) {
@@ -823,9 +789,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.loadingPublic = false; this.loadingPublic = false;
console.log(res);
let data = JSON.parse(res.data.data); let data = JSON.parse(res.data.data);
console.log(data);
this.publicDatasetList = this.transformeTreeData( this.publicDatasetList = this.transformeTreeData(
data, data,
"publicTree", "publicTree",
@@ -833,8 +797,6 @@ export default {
); );
this.initPublicTreeNode = [this.publicDatasetList[0].id]; this.initPublicTreeNode = [this.publicDatasetList[0].id];
this.totalNumPublic = parseInt(res.data.count); this.totalNumPublic = parseInt(res.data.count);
console.log("this.publicDatasetList:", this.publicDatasetList);

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

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


Loading…
Cancel
Save