Browse Source

Merge pull request '解决关联数据集checkbox点击两下取消的问题和复制的id' (#2790) from fix-2764 into V20220830

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2790
Reviewed-by: chenshihai <chenshh@pcl.ac.cn>
tags/v1.22.8.2^2
chenshihai 3 years ago
parent
commit
fb76bb1810
3 changed files with 31 additions and 26 deletions
  1. +2
    -3
      templates/repo/modelarts/notebook/show.tmpl
  2. +27
    -21
      web_src/js/components/dataset/referenceDataset.vue
  3. +2
    -2
      web_src/js/features/i18nVue.js

+ 2
- 3
templates/repo/modelarts/notebook/show.tmpl View File

@@ -350,7 +350,7 @@

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-mirror">
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn" style="cursor:pointer"
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn-image" style="cursor:pointer"
data-clipboard-text="{{.Image}}"
data-success="{{$.i18n.Tr "repo.copy_link_success"}}"
data-error="{{$.i18n.Tr "repo.copy_link_error"}}"
@@ -441,7 +441,7 @@
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">{{$.i18n.Tr "dataset.download_copy"}}</a></td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn-dataset" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">{{$.i18n.Tr "dataset.download_copy"}}</a></td>
</tr>
{{end}}
</tbody>
@@ -491,5 +491,4 @@
$(document).ready(function () {
$('.secondary.menu .item').tab();
});
console.log({{$.datasetDownload}})
</script>

+ 27
- 21
web_src/js/components/dataset/referenceDataset.vue View File

@@ -339,19 +339,18 @@
overflow-y: auto;
"
>
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="(item, index) in selectDatasetArray"
:key="index"
:label="item.ID"
:title="item.Title"
@change="(checked) => changeCheckSelected(checked, item)"
style="display: flex; margin: 0.5rem 0"
><span class="select-data-right">{{
item.Title
}}</span></el-checkbox
>
</el-checkbox-group>
<el-checkbox
v-for="(item, index) in selectDatasetArray"
:key="index"
:label="item.ID"
:title="item.Title"
:value="item.isChecked"
@change="(checked) => changeCheckSelected(checked, item)"
style="display: flex; margin: 0.5rem 0"
><span class="select-data-right">{{
item.Title
}}</span></el-checkbox
>
</div>
<div style="text-align: end">
<el-button
@@ -406,7 +405,11 @@ export default {
methods: {
openDataset() {
this.checkList = this.datasetList.map((item) => {
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title });
this.selectDatasetArray.push({
ID: item.ID,
Title: item.Title,
isChecked: true,
});
return item.ID;
});
this.dialogVisible = true;
@@ -473,7 +476,11 @@ export default {
return;
}
if (checked) {
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title });
this.selectDatasetArray.push({
ID: item.ID,
Title: item.Title,
isChecked: true,
});
} else {
let index = this.selectDatasetArray.findIndex((element) => {
return element.ID === item.ID;
@@ -482,12 +489,11 @@ export default {
}
},
changeCheckSelected(checked, item) {
if (!checked) {
let index = this.selectDatasetArray.findIndex((element) => {
return element.ID === item.ID;
});
this.selectDatasetArray.splice(index, 1);
}
let index = this.selectDatasetArray.findIndex((element) => {
return element.ID === item.ID;
});
this.selectDatasetArray.splice(index, 1);
this.checkList.splice(index, 1);
},
postStar(item, isSigned) {
if (!isSigned) {


+ 2
- 2
web_src/js/features/i18nVue.js View File

@@ -142,11 +142,11 @@ export const i18nVue = {
disassociate: "Unlink",
public_dataset: "Public Dataset",
selected_data_file: "Selected DataSets",
sure: "Ok",
sure: "OK",
search_dataset: "Search dataset name/description ...",
citations: "Citations",
downloads: "Downloads",
not_link_dataset: "No datasets have been associated yet",
not_link_dataset: "No datasets have been linked yet",
no_link_dataset_tips1:
"You can display public datasets on the platform here by clicking the New Linked Dataset button.",



Loading…
Cancel
Save