Browse Source

fix issue

pull/2743/head
zhoupzh 2 years ago
parent
commit
c922729f42
2 changed files with 11 additions and 5 deletions
  1. +1
    -1
      templates/repo/header.tmpl
  2. +10
    -4
      web_src/js/components/dataset/referenceDataset.vue

+ 1
- 1
templates/repo/header.tmpl View File

@@ -138,7 +138,7 @@
{{end}} {{end}}


{{if .Permission.CanRead $.UnitTypeDatasets}} {{if .Permission.CanRead $.UnitTypeDatasets}}
<a class="{{if .PageIsDataset}}active{{end}} item" href="{{.RepoLink}}{{if IsShowDataSetOfCurrentRepo $.Repository.ID}}/datasets{{else}}/datasets/reference_datasets{{end}}">
<a class="{{if .PageIsDataset}}active{{end}} item" id="header-dataset" href="{{.RepoLink}}{{if IsShowDataSetOfCurrentRepo $.Repository.ID}}/datasets{{else}}/datasets/reference_datasets{{end}}">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M20.083 15.2l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zm0-4.7l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm-7.569-9.191l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0zM12 3.332L5.887 7 12 10.668 18.113 7 12 3.332z"/></svg> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M20.083 15.2l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zm0-4.7l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm-7.569-9.191l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0zM12 3.332L5.887 7 12 10.668 18.113 7 12 3.332z"/></svg>
{{.i18n.Tr "datasets"}} {{.i18n.Tr "datasets"}}
</a> </a>


+ 10
- 4
web_src/js/components/dataset/referenceDataset.vue View File

@@ -428,6 +428,9 @@ export default {
return item.ID === id; return item.ID === id;
}); });
this.datasetList.splice(index, 1); this.datasetList.splice(index, 1);
if (this.datasetList.length === 0) {
this.showFlag = false;
}
} else { } else {
this.$message.error(res.data.Message); this.$message.error(res.data.Message);
} }
@@ -442,10 +445,8 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
changeCheckbox(checked, item) { changeCheckbox(checked, item) {
console.log(this.checkList, checked);
if (this.checkList.length > this.maxReferenceNum) { if (this.checkList.length > this.maxReferenceNum) {
this.checkList.pop(); this.checkList.pop();
console.log(this.checkList);
this.$message.error("关联超过20个数据集"); this.$message.error("关联超过20个数据集");
return; return;
} }
@@ -505,7 +506,6 @@ export default {
this.loadingLinkPage = true; this.loadingLinkPage = true;
let url = `${this.repoLink}/datasets/reference_datasets_data`; let url = `${this.repoLink}/datasets/reference_datasets_data`;
this.$axios.get(url).then((res) => { this.$axios.get(url).then((res) => {
console.log(res);
this.loadingLinkPage = false; this.loadingLinkPage = false;
if (!res.data) { if (!res.data) {
this.showFlag = false; this.showFlag = false;
@@ -585,7 +585,13 @@ export default {
}, },
showFlag(val) { showFlag(val) {
if (!val) { if (!val) {
location.reload();
document
.getElementById("header-dataset")
.setAttribute("href", this.repoLink + "/datasets");
} else {
document
.getElementById("header-dataset")
.setAttribute("href", this.repoLink + "/reference_datasets");
} }
}, },
}, },


Loading…
Cancel
Save