|
|
|
@@ -18,6 +18,7 @@ |
|
|
|
<button |
|
|
|
style="margin-right: 2rem" |
|
|
|
class="ui green button" |
|
|
|
:class="{ disabled: !canWrite }" |
|
|
|
@click="openDataset()" |
|
|
|
> |
|
|
|
{{ i18n.linked_datasets }} |
|
|
|
@@ -49,7 +50,7 @@ |
|
|
|
<div style="display: flex"> |
|
|
|
<button |
|
|
|
class="ui mini basic button dataset-card-flavor" |
|
|
|
@click.stop="postStar(item)" |
|
|
|
@click.stop="postStar(item, isSigned)" |
|
|
|
> |
|
|
|
<i class="ri-heart-fill" style="color: #fa8c16"></i> |
|
|
|
<span style="margin-left: 0.3rem">{{ |
|
|
|
@@ -65,7 +66,7 @@ |
|
|
|
<div style="display: flex"> |
|
|
|
<button |
|
|
|
class="ui mini basic button dataset-card-flavor" |
|
|
|
@click.stop="postStar(item)" |
|
|
|
@click.stop="postStar(item, isSigned)" |
|
|
|
> |
|
|
|
<i class="ri-heart-line"></i> |
|
|
|
<span style="margin-left: 0.3rem">{{ |
|
|
|
@@ -160,6 +161,7 @@ |
|
|
|
</span> |
|
|
|
<button |
|
|
|
class="ui mini button" |
|
|
|
:class="{ disabled: !canWrite }" |
|
|
|
@click.stop="cancelReferData(item.ID, item.Title)" |
|
|
|
> |
|
|
|
{{ i18n.disassociate }} |
|
|
|
@@ -380,6 +382,8 @@ export default { |
|
|
|
currentPage: 1, |
|
|
|
loadingLinkPage: false, |
|
|
|
loadingPublicPage: false, |
|
|
|
canWrite: true, |
|
|
|
isSigned: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@@ -388,7 +392,6 @@ export default { |
|
|
|
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title }); |
|
|
|
return item.ID; |
|
|
|
}); |
|
|
|
console.log("open"); |
|
|
|
this.dialogVisible = true; |
|
|
|
this.getDatasetList(); |
|
|
|
}, |
|
|
|
@@ -397,7 +400,6 @@ export default { |
|
|
|
this.selectDatasetArray = []; |
|
|
|
}, |
|
|
|
gotoDataset(item) { |
|
|
|
console.log(item); |
|
|
|
location.href = `/${item.Repo.OwnerName}/${item.Repo.Name}/datasets`; |
|
|
|
}, |
|
|
|
currentChange(page) { |
|
|
|
@@ -414,16 +416,14 @@ export default { |
|
|
|
this.$axios |
|
|
|
.delete(url) |
|
|
|
.then((res) => { |
|
|
|
console.log(res); |
|
|
|
if (res.data.Code === 0) { |
|
|
|
console.log("delete success"); |
|
|
|
this.$message.success(`取消${name}关联数据集成功!`); |
|
|
|
let index = this.datasetList.findIndex((item) => { |
|
|
|
return item.ID === id; |
|
|
|
}); |
|
|
|
this.datasetList.splice(index, 1); |
|
|
|
} else { |
|
|
|
this.$message.error(`取消关联数据集失败!`); |
|
|
|
this.$message.error(res.data.Message); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
@@ -436,7 +436,6 @@ export default { |
|
|
|
this.dialogVisible = false; |
|
|
|
}, |
|
|
|
changeCheckbox(checked, item) { |
|
|
|
console.log(checked, item, this.checkList); |
|
|
|
if (checked) { |
|
|
|
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title }); |
|
|
|
} else { |
|
|
|
@@ -445,20 +444,19 @@ export default { |
|
|
|
}); |
|
|
|
this.selectDatasetArray.splice(index, 1); |
|
|
|
} |
|
|
|
console.log(this.selectDatasetArray); |
|
|
|
}, |
|
|
|
changeCheckSelected(checked, item) { |
|
|
|
console.log(checked, item); |
|
|
|
if (!checked) { |
|
|
|
let index = this.selectDatasetArray.findIndex((element) => { |
|
|
|
return element.ID === item.ID; |
|
|
|
}); |
|
|
|
this.selectDatasetArray.splice(index, 1); |
|
|
|
} |
|
|
|
console.log(this.checkList, this.selectDatasetArray); |
|
|
|
}, |
|
|
|
postStar(item) { |
|
|
|
console.log(item); |
|
|
|
postStar(item, isSigned) { |
|
|
|
if (!isSigned) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (item.IsStaring) { |
|
|
|
let url = `${this.repoLink}/datasets/${item.ID}/unstar`; |
|
|
|
this.$axios.put(url).then((res) => { |
|
|
|
@@ -491,7 +489,6 @@ export default { |
|
|
|
let url = `${this.repoLink}/datasets/reference_datasets_data`; |
|
|
|
this.$axios.get(url).then((res) => { |
|
|
|
this.loadingLinkPage = false; |
|
|
|
console.log(res); |
|
|
|
if (!res.data) { |
|
|
|
this.showFlag = false; |
|
|
|
return; |
|
|
|
@@ -501,7 +498,6 @@ export default { |
|
|
|
? (this.showFlag = true) |
|
|
|
: (this.showFlag = false); |
|
|
|
} |
|
|
|
console.log("this.getDatasetList:", this.datasetList, this.checkList); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getDatasetList() { |
|
|
|
@@ -526,7 +522,6 @@ export default { |
|
|
|
}, |
|
|
|
{ arrayFormat: "repeat" } |
|
|
|
); |
|
|
|
console.log(data); |
|
|
|
this.$axios |
|
|
|
.post(url, data) |
|
|
|
.then((res) => { |
|
|
|
@@ -534,7 +529,7 @@ export default { |
|
|
|
this.$message.success(`关联数据集成功!`); |
|
|
|
this.getSelectDatasetList(); |
|
|
|
} else { |
|
|
|
this.$message.error(`关联数据集失败!`); |
|
|
|
this.$message.error(res.data.Message); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
@@ -571,6 +566,8 @@ export default { |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.repoLink = $(".reference-dataset").data("repolink") || ""; |
|
|
|
this.canWrite = $(".reference-dataset").data("canwrite"); |
|
|
|
this.isSigned = $(".reference-dataset").data("is-sign"); |
|
|
|
if (document.documentElement.attributes["lang"].nodeValue == "en-US") { |
|
|
|
this.i18n = this.$locale.US; |
|
|
|
} else { |
|
|
|
|