Browse Source

fix issue

tags/v1.22.8.2^2
zhoupzh 3 years ago
parent
commit
56cdb91d15
2 changed files with 52 additions and 13 deletions
  1. +4
    -2
      templates/repo/modelarts/trainjob/version_new.tmpl
  2. +48
    -11
      web_src/js/components/dataset/selectDataset.vue

+ 4
- 2
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -55,6 +55,7 @@
<div class="repository">
{{template "repo/header" .}}
<div class="ui container">
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-dataset-uuid="{{.uuid}}" data-dataset-name="{{.dataset_name}}"></div>
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "repo.modelarts.train_job.new"}}
@@ -152,7 +153,7 @@
<a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div>
<div class="required unite min_title inline field">
<!-- <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label>
<select class="ui dropdown width80" id="trainjob_datasets" name="attachment" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}">
{{if .dataset_name}}
@@ -166,10 +167,11 @@
{{end}}
</select>
<span class="tooltips">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span>
</div>
</div> -->
<div id="select-multi-dataset">

</div>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span>
<div class="inline unite min_title field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
<span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>


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

@@ -75,7 +75,7 @@
<input
type="text"
placeholder="搜数据集名称/描述..."
v-model="search"
v-model="search"
@keydown.enter.stop.prevent="searchName"
/>
</div>
@@ -586,6 +586,8 @@ export default {
confirmFlag: false,

saveStatusList: [],
// 初始化已选择的数据集列表
hasSelectDatasetList: [],
//当前项目数据集页面配置的初始化
initCurrentPage: 1,
totalNumCurrent: 0,
@@ -644,6 +646,7 @@ export default {

//tree 勾选触发事件
onCheck(data, checkedInfo) {
this.hasSelectDatasetList = [];
if (
this.selectDatasetArray.length === 0 ||
this.selectDatasetArray.every((item) => item.id !== data.id)
@@ -671,9 +674,8 @@ export default {
return item.label;
});
this.saveStatusList = this.selectDatasetArray.map((item) => {
return item.UUID;
return item.id;
});
// this.confirmDatasetList = this.saveStatusList.join(";");
},
//已选择数据集checkbox group 勾选事件
changeCheckbox(checked, data) {
@@ -686,7 +688,6 @@ export default {
});
this.selectDatasetArray.splice(index, 1);
this.saveStatusList.splice(index, 1);
// this.confirmDatasetList = this.saveStatusList.join(";");
},
tableHeaderStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0) {
@@ -722,17 +723,23 @@ export default {
.then((res) => {
this.loadingCurrent = false;
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 ? [this.currentDatasetList[0].id] : [];
this.initCurrentTreeNode = this.currentDatasetList[0]?.id
? [this.currentDatasetList[0].id]
: [];
this.totalNumCurrent = parseInt(res.data.count);
let setCheckedKeysList = this.currentDatasetList.reduce(
(pre, cur) => {
cur.Attachments.forEach((item) => {
if (this.saveStatusList.includes(item.id)) {
if (
this.saveStatusList.includes(item.id) ||
this.hasSelectDatasetList.includes(item.id)
) {
pre.push(item.id);
}
});
@@ -763,7 +770,9 @@ export default {
"myTree",
this.paramsMy.page
);
this.initMyTreeNode = this.myDatasetList[0]?.id ? [this.myDatasetList[0].id] : [];
this.initMyTreeNode = this.myDatasetList[0]?.id
? [this.myDatasetList[0].id]
: [];
this.totalNumMy = parseInt(res.data.count);
let setCheckedKeysList = this.myDatasetList.reduce((pre, cur) => {
cur.Attachments.forEach((item) => {
@@ -796,7 +805,9 @@ export default {
"publicTree",
this.paramsPublics.page
);
this.initPublicTreeNode = this.publicDatasetList[0]?.id ? [this.publicDatasetList[0].id] : [];
this.initPublicTreeNode = this.publicDatasetList[0]?.id
? [this.publicDatasetList[0].id]
: [];
this.totalNumPublic = parseInt(res.data.count);
let setCheckedKeysList = this.publicDatasetList.reduce((pre, cur) => {
cur.Attachments.forEach((item) => {
@@ -830,7 +841,9 @@ export default {
"favoriteTree",
this.paramsFavorite.page
);
this.initFavoriteTreeNode = this.MyFavoriteDatasetList[0]?.id ? [this.MyFavoriteDatasetList[0].id] : [];
this.initFavoriteTreeNode = this.MyFavoriteDatasetList[0]?.id
? [this.MyFavoriteDatasetList[0].id]
: [];
this.totalNumFavorite = parseInt(res.data.count);
let setCheckedKeysList = this.MyFavoriteDatasetList.reduce(
(pre, cur) => {
@@ -949,14 +962,38 @@ export default {
mounted() {
this.type = $(".cloudbrain-type").data("cloudbrain-type");
this.repoLink = $(".cloudbrain-type").data("repo-link");
if ($(".cloudbrain-type").data("dataset-uuid")) {
this.hasSelectDatasetList = $(".cloudbrain-type")
.data("dataset-uuid")
.split(";");
let hasSelectDatasetName = $(".cloudbrain-type")
.data("dataset-name")
.split(";");
if (this.hasSelectDatasetList.length !== 0) {
this.saveStatusList = this.hasSelectDatasetList;
this.checkList = hasSelectDatasetName;
this.hasSelectDatasetList.forEach((item, index) => {
this.selectDatasetArray.push({
id: item,
label: hasSelectDatasetName[index],
});
});
}
this.confirmDataset();
}

if (
location.href.indexOf("benchmark") !== -1 ||
location.href.indexOf("train-job") !== -1 ||
location.href.indexOf("inference") !== -1
location.href.indexOf("inference") !== -1
) {
console.log("this.benchmarkNew");
this.benchmarkNew = true;
}
if (location.href.indexOf("modelarts/notebook/create") !== -1 || location.href.indexOf("/cloudbrain/create") !== -1) {
if (
location.href.indexOf("modelarts/notebook/create") !== -1 ||
location.href.indexOf("/cloudbrain/create") !== -1
) {
this.required = false;
}
window.onresize = () => {


Loading…
Cancel
Save