This commit is contained in:
ann 2024-06-22 16:58:38 +08:00
parent 17e69af293
commit 23c763b025
4 changed files with 62 additions and 34 deletions

22
package-lock.json generated
View File

@ -42,6 +42,8 @@
"script-loader": "0.7.2",
"sortablejs": "1.8.4",
"spark-md5": "^3.0.2",
"three": "^0.126.1",
"three.meshline": "^1.4.0",
"vue": "2.6.10",
"vue-codemirror": "^4.0.6",
"vue-count-to": "1.0.13",
@ -21769,6 +21771,16 @@
"node": ">=4.0.0"
}
},
"node_modules/three": {
"version": "0.126.1",
"resolved": "https://registry.npmjs.org/three/-/three-0.126.1.tgz",
"integrity": "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ=="
},
"node_modules/three.meshline": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/three.meshline/-/three.meshline-1.4.0.tgz",
"integrity": "sha512-A8IsiMrWP8zmHisGDAJ76ZD7t/dOF/oCe/FUKNE6Bu01ZYEx8N6IlU/1Plb2aOZtAuWM2A8s8qS3hvY0OFuvOw=="
},
"node_modules/throat": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz",
@ -41639,6 +41651,16 @@
}
}
},
"three": {
"version": "0.126.1",
"resolved": "https://registry.npmjs.org/three/-/three-0.126.1.tgz",
"integrity": "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ=="
},
"three.meshline": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/three.meshline/-/three.meshline-1.4.0.tgz",
"integrity": "sha512-A8IsiMrWP8zmHisGDAJ76ZD7t/dOF/oCe/FUKNE6Bu01ZYEx8N6IlU/1Plb2aOZtAuWM2A8s8qS3hvY0OFuvOw=="
},
"throat": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz",

View File

@ -135,7 +135,7 @@
</template>
<script>
import { getModelName, getModelType, addDeductiveTask } from '@/api/task/task'
import { getModelName, getModelType } from '@/api/task/task'
import generate from 'nanoid/generate'
import { getClusterList } from '@/api/container/cluster'
@ -253,14 +253,7 @@ export default {
form.set('strategy', this.formData.strategy)
form.set('adapterId', this.adapterId)
addDeductiveTask(form).then((e) => {
if (e.code === 200) {
this.$message.success('文件上传成功')
this.$router.go(-1)
} else {
returnVal = false
}
})
returnVal = form
} else {
returnVal = false
}

View File

@ -216,7 +216,7 @@
<script>
import List from '@/components/list'
import { addApp, addHpcTask, addAITask, addVirtualMachine, getBalanceById } from '@/api/task/task'
import { addApp, addHpcTask, addAITask, addVirtualMachine, getBalanceById, addDeductiveTask } from '@/api/task/task'
import applicationForm from './components/applicationForm'
import hpcCreate from './components/hpcCreate.vue'
import { getClusterList } from '@/api/container/cluster'
@ -455,33 +455,27 @@ export default {
return false
}
const type = this.taskType === 'aiCard' ? 'aiBase' : this.taskType
if (this.type === 'deductive') {
this.submitLoading = true
const formHook = this.$refs[type].checkForm()
if (!formHook) {
this.submitLoading = false
return false
}
}
let formHook = this.$refs[type].checkForm()
if (!formHook) return false
if (this.taskType !== 'aiCard') {
formHook = { ...formHook, ...this.formData }
if (this.taskType !== 'deductive') {
if (this.taskType !== 'aiCard') {
formHook = { ...formHook, ...this.formData }
}
formHook.adapterId = this.formData.adapterId
if (this.formData.strategy === 'staticWeight') {
const obj = {}
this.formData.staticWeightMap.forEach(e => {
obj[e.id.toString()] = e.value
})
formHook.staticWeightMap = obj
} else {
delete formHook.staticWeight
delete formHook.staticWeightMap
}
formHook.adapterIds = [formHook.adapterId]
delete formHook.adapterId
}
formHook.adapterId = this.formData.adapterId
if (this.formData.strategy === 'staticWeight') {
const obj = {}
this.formData.staticWeightMap.forEach(e => {
obj[e.id.toString()] = e.value
})
formHook.staticWeightMap = obj
} else {
delete formHook.staticWeight
delete formHook.staticWeightMap
}
formHook.adapterIds = [formHook.adapterId]
delete formHook.adapterId
this.submitLoading = true
switch (type) {
case 'application': {
@ -518,6 +512,15 @@ export default {
})
break
}
case 'deductive': {
addDeductiveTask(formHook).then((e) => {
if (e.code === 200) {
this.$message.success('文件上传成功')
this.$router.go(-1)
}
})
break
}
case 'virtualmachine': {
formHook.clusterIds = formHook.aiClusterIds
delete formHook.aiClusterIds

View File

@ -12352,6 +12352,16 @@
"loader-utils" "^1.1.0"
"neo-async" "^2.6.0"
"three.meshline@^1.4.0":
"integrity" "sha512-A8IsiMrWP8zmHisGDAJ76ZD7t/dOF/oCe/FUKNE6Bu01ZYEx8N6IlU/1Plb2aOZtAuWM2A8s8qS3hvY0OFuvOw=="
"resolved" "https://registry.npmjs.org/three.meshline/-/three.meshline-1.4.0.tgz"
"version" "1.4.0"
"three@^0.126.1":
"integrity" "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ=="
"resolved" "https://registry.npmjs.org/three/-/three-0.126.1.tgz"
"version" "0.126.1"
"throat@^4.0.0":
"integrity" "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo="
"resolved" "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz"