diff --git a/templates/repo/modelarts/trainjob/version_new.tmpl b/templates/repo/modelarts/trainjob/version_new.tmpl index b2209651a..cf32409ed 100644 --- a/templates/repo/modelarts/trainjob/version_new.tmpl +++ b/templates/repo/modelarts/trainjob/version_new.tmpl @@ -55,6 +55,7 @@
{{template "repo/header" .}}
+ {{template "base/alert" .}}

{{.i18n.Tr "repo.modelarts.train_job.new"}} @@ -152,7 +153,7 @@ {{.i18n.Tr "cloudbrain.view_sample"}}

-
+
+ {{.i18n.Tr "cloudbrain.dataset_path_rule"}}
{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}} diff --git a/web_src/js/components/dataset/selectDataset.vue b/web_src/js/components/dataset/selectDataset.vue index b1670b95a..02343516c 100755 --- a/web_src/js/components/dataset/selectDataset.vue +++ b/web_src/js/components/dataset/selectDataset.vue @@ -75,7 +75,7 @@
@@ -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 = () => {