diff --git a/openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue b/openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue index 2b4b1c85..cc069088 100644 --- a/openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue +++ b/openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue @@ -327,7 +327,7 @@ export default { }, created() { this.getResource(); - this.getAlgorithmNameList(); + // this.getAlgorithmNameList(); }, methods: { getErrorMsg(code) { @@ -657,10 +657,15 @@ export default { this.getAlgorithmNameList(this.algorithmNameTemp); }, getAlgorithmItem() { - this.algorithmNameOption = [] this.algorithmNameTemp = '' this.algorithmNameCount = 1 - this.getAlgorithmNameList(); + getMyAlgorithmList({ + pageIndex: this.algorithmNameCount, + pageSize: 10, + }).then(response => { + this.algorithmNameOption = response.data.algorithms; + this.algorithmNameTotal = response.data.totalSize + }) }, // 远程请求镜像名称 remoteImage(searchKey) { @@ -674,10 +679,55 @@ export default { this.getImageNameList(this.imageTemp); }, getImageItem() { - this.imageNameOption = [] this.imageTemp = '' this.imageNameCount = 1 - this.getImageNameList(); + if (this.ruleForm.imageSource === "my") { + getMyImage({ + pageIndex: this.imageNameCount, + pageSize: 10, + imageStatus: 3, + imageType: 1, + }).then(response => { + if (response.data.images.length !== 0) { + const data = response.data.images; + const tableData = []; + this.imageNameTotal = response.data.totalSize; + data.forEach(item => { + tableData.push({ + ...item.image, + isShared: item.isShared + }); + }); + this.imageNameOption = tableData + } + }); + } + if (this.ruleForm.imageSource === "pre") { + getPreImage({ + pageIndex: this.imageNameCount, + pageSize: 10, + imageStatus: 3, + imageType: 1, + }).then(response => { + if (response.data.images.length !== 0) { + this.imageNameOption = response.data.images + this.imageNameTotal = response.data.totalSize; + } + }); + } + if (this.ruleForm.imageSource === "common") { + getPublicImage({ + pageIndex: this.imageNameCount, + pageSize: 10, + imageStatus: 3, + imageType: 1, + }).then(response => { + if (response.data.images.length !== 0) { + this.imageNameOption = response.data.images + this.imageNameTotal = response.data.totalSize; + } + }); + } }, // 远程请求数据集名称 remoteDataSet(searchKey) { @@ -691,10 +741,47 @@ export default { this.getDataSetNameList(this.dataSetTemp); }, getDataSetItem() { - this.dataSetNameOption = [] this.dataSetTemp = '' this.dataSetNameCount = 1 - this.getDataSetNameList(); + if (this.ruleForm.dataSetSource === "my") { + getMyDatasetList({ + pageIndex: this.dataSetNameCount, + pageSize: 10, + }).then(response => { + if (response.data.datasets === null) { + response.data.datasets = [] + } else { + this.dataSetNameOption = response.data.datasets; + this.dataSetNameTotal = response.data.totalSize; + } + }); + } + if (this.ruleForm.dataSetSource === "pre") { + getPresetDatasetList({ + pageIndex: this.dataSetNameCount, + pageSize: 10, + }).then(response => { + if (response.data.datasets !== null) { + this.dataSetNameOption = response.data.datasets + this.dataSetNameTotal = response.data.totalSize; + } else { + response.data.datasets = []; + } + }); + } + if (this.ruleForm.dataSetSource === "common") { + getPublicDatasetList({ + pageIndex: this.dataSetNameCount, + pageSize: 10, + }).then(response => { + if (response.data.datasets !== null) { + this.dataSetNameOption = response.data.datasets + this.dataSetNameTotal = response.data.totalSize; + } else { + response.data.datasets = []; + } + }); + } } } }; diff --git a/openai-portal/src/views/trainingManager/components/createDialog/index.vue b/openai-portal/src/views/trainingManager/components/createDialog/index.vue index eee77ab4..c06b7006 100644 --- a/openai-portal/src/views/trainingManager/components/createDialog/index.vue +++ b/openai-portal/src/views/trainingManager/components/createDialog/index.vue @@ -38,6 +38,7 @@ remote :remote-method="remoteAlgorithm" @change="changeAlgorithmName" + @click.native="getAlgorithmItem" > { - if (response.data.images.length !== 0) { this.imageNameOption = this.imageNameOption.concat(response.data.images); this.imageNameTotal = response.data.totalSize } + if (response.data.images.length !== 0) { + this.imageNameOption = this.imageNameOption.concat(response.data.images); + this.imageNameTotal = response.data.totalSize + } }) } if (this.ruleForm.imageSource === 'common') { getPublicImage({ pageIndex: this.imageNameCount, pageSize: 10, imageStatus: 3, imageType: 2, nameVerLike: searchKey }).then(response => { - if (response.data.images.length !== 0) { this.imageNameOption = this.imageNameOption.concat(response.data.images); this.imageNameTotal = response.data.totalSize } + if (response.data.images.length !== 0) { + this.imageNameOption = this.imageNameOption.concat(response.data.images); + this.imageNameTotal = response.data.totalSize + } }) } }, @@ -683,7 +692,8 @@ if (response.data.datasets === null) { response.data.datasets = [] } - this.dataSetNameOption = this.dataSetNameOption.concat(response.data.datasets); this.dataSetNameTotal = response.data.totalSize + this.dataSetNameOption = this.dataSetNameOption.concat(response.data.datasets); + this.dataSetNameTotal = response.data.totalSize }) } if (this.ruleForm.dataSetSource === 'common') { @@ -691,7 +701,8 @@ if (response.data.datasets === null) { response.data.datasets = [] } - this.dataSetNameOption = this.dataSetNameOption.concat(response.data.datasets); this.dataSetNameTotal = response.data.totalSize + this.dataSetNameOption = this.dataSetNameOption.concat(response.data.datasets); + this.dataSetNameTotal = response.data.totalSize }) } }, @@ -733,25 +744,127 @@ }); }, // 远程请求算法名称 - remoteAlgorithm(a) { - if (a == '') { this.algorithmNameTemp = '' } else { this.algorithmNameTemp = a } + remoteAlgorithm(searchName) { + if (searchName == '') { + this.algorithmNameTemp = '' + } else { + this.algorithmNameTemp = searchName + } this.algorithmNameOption = [] this.algorithmNameCount = 1 this.getAlgorithmNameList(this.algorithmNameTemp) }, + getAlgorithmItem() { + this.algorithmNameTemp = '' + this.algorithmNameCount = 1 + if (this.ruleForm.algorithmSource === 'my') { + getMyAlgorithmList({ pageIndex: this.algorithmNameCount, pageSize: 10 }).then(response => { + this.algorithmNameOption = response.data.algorithms; + this.algorithmNameTotal = response.data.totalSize + }) + } + if (this.ruleForm.algorithmSource === 'pre') { + getPresetAlgorithmList({ pageIndex: this.algorithmNameCount, pageSize: 10 }).then(response => { + if (response.data.algorithms.length !== 0) { + this.algorithmNameOption = response.data.algorithms; + this.algorithmNameTotal = response.data.totalSize + } + }) + } + if (this.ruleForm.algorithmSource === 'common') { + getPublicAlgorithmList({ pageIndex: this.algorithmNameCount, pageSize: 10 }).then(response => { + if (response.data.algorithms.length !== 0) { + this.algorithmNameOption = response.data.algorithms; + this.algorithmNameTotal = response.data.totalSize + } + }) + } + }, // 远程请求镜像名称 - remoteImage(a) { - if (a == '') { this.imageTemp = '' } else { this.imageTemp = a } + remoteImage(searchName) { + if (searchName == '') { + this.imageTemp = '' + } else { + this.imageTemp = searchName + } this.imageNameOption = [] this.imageNameCount = 1 this.getImageNameList(this.imageTemp) }, + getImageItem() { + this.imageTemp = '' + this.imageNameCount = 1 + if (this.ruleForm.imageSource === 'my') { + getMyImage({ pageIndex: this.imageNameCount, pageSize: 10, imageStatus: 3, imageType: 2 }).then(response => { + if (response.data.images.length !== 0) { + const data = response.data.images; + const tableData = []; + this.imageNameTotal = response.data.totalSize + data.forEach(item => { + tableData.push({ ...item.image, isShared: item.isShared }) + }) + this.imageNameOption = tableData + } + }) + } + if (this.ruleForm.imageSource === 'pre') { + getPreImage({ pageIndex: this.imageNameCount, pageSize: 10, imageStatus: 3, imageType: 2 }).then(response => { + if (response.data.images.length !== 0) { + this.imageNameOption = response.data.images; + this.imageNameTotal = response.data.totalSize + } + }) + } + if (this.ruleForm.imageSource === 'common') { + getPublicImage({ pageIndex: this.imageNameCount, pageSize: 10, imageStatus: 3, imageType: 2 }).then(response => { + if (response.data.images.length !== 0) { + this.imageNameOption = response.data.images; + this.imageNameTotal = response.data.totalSize + } + }) + } + }, // 远程请求数据集名称 - remoteDataSet(a) { - if (a == '') { this.dataSetTemp = '' } else { this.dataSetTemp = a } + remoteDataSet(searchName) { + if (searchName == '') { + this.dataSetTemp = '' + } else { + this.dataSetTemp = searchName + } this.dataSetNameOption = [] this.dataSetNameCount = 1 this.getDataSetNameList(this.dataSetTemp) + }, + getDataSetItem() { + this.dataSetTemp = '' + this.dataSetNameCount = 1 + if (this.ruleForm.dataSetSource === 'my') { + getMyDatasetList({ pageIndex: this.dataSetNameCount, pageSize: 10 }).then(response => { + if (response.data.datasets === null) { + response.data.datasets = [] + } + this.dataSetNameOption = response.data.datasets + this.dataSetNameTotal = response.data.totalSize + }) + } + if (this.ruleForm.dataSetSource === 'pre') { + getPresetDatasetList({ pageIndex: this.dataSetNameCount, pageSize: 10 }).then(response => { + if (response.data.datasets === null) { + response.data.datasets = [] + } + this.dataSetNameOption = response.data.datasets; + this.dataSetNameTotal = response.data.totalSize + }) + } + if (this.ruleForm.dataSetSource === 'common') { + getPublicDatasetList({ pageIndex: this.dataSetNameCount, pageSize: 10 }).then(response => { + if (response.data.datasets === null) { + response.data.datasets = [] + } + this.dataSetNameOption = response.data.datasets; + this.dataSetNameTotal = response.data.totalSize + }) + } } } }