|
@@ -4,13 +4,7 @@
|
|
|
<el-container style="height: 30px"></el-container>
|
|
|
<el-container>
|
|
|
<span class="span_class">任务名称</span>
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- type="text"
|
|
|
- placeholder="请输入任务名称"
|
|
|
- v-model="formData.taskName"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <el-input style="width: 300px" type="text" placeholder="请输入任务名称" v-model="formData.taskName"> </el-input>
|
|
|
</el-container>
|
|
|
|
|
|
<el-container style="height: 10px"></el-container>
|
|
@@ -34,27 +28,17 @@
|
|
|
<span class="span_class">选择算法</span>
|
|
|
<el-container style="display: flex; flex-direction: column">
|
|
|
<el-container v-for="(item, index) in formData.algorithms" :key="index" style="margin-top: 5px">
|
|
|
- <el-select style="width: 200px" v-model="formData.algoIdx[index]" placeholder="请选择" @change="onModelSelect(index)">
|
|
|
- <el-option
|
|
|
- v-for="(item1,index) in algorithms"
|
|
|
- :key="item1.id"
|
|
|
- :label="item1.name"
|
|
|
- :value="index"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select style="width: 200px" v-model="formData.algoIdx[index]" placeholder="请选择" @change="onAlgorithmModelSelect(index)">
|
|
|
+ <el-option v-for="(item1, index) in algorithms" :key="item1.id" :label="item1.name" :value="index"> </el-option>
|
|
|
</el-select>
|
|
|
- <el-button style="margin-left: 20px" @click="showSuperParameterConfig(item, index)">
|
|
|
- 超参配置
|
|
|
- </el-button>
|
|
|
- <el-button @click="showAddModelDialog">
|
|
|
- 导入模型
|
|
|
- </el-button>
|
|
|
- <el-button v-show="formData.algorithms.length>1" @click="removeItem(index)">
|
|
|
- 删除算法
|
|
|
- </el-button>
|
|
|
- <el-button v-show="formData.taskType === '1' && index + 1 === formData.algorithms.length" @click="appendNewItem">
|
|
|
- 添加算法
|
|
|
- </el-button>
|
|
|
+ <el-button style="margin-left: 20px" @click="showSuperParameterConfig(item, index)"> 超参配置 </el-button>
|
|
|
+ <span class="span_class1">选择模型</span>
|
|
|
+ <el-select style="width: 200px" v-model="formData.algoModelId[index]" placeholder="未选择将使用默认模型">
|
|
|
+ <el-option v-for="item1 in formData.algoModelList[index]" :key="item1.id" :label="item1.modelName" :value="item1.id"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button @click="showAddModelDialog(item, index)"> 导入模型 </el-button>
|
|
|
+ <el-button v-show="formData.algorithms.length > 1" @click="removeItem(index)"> 删除算法 </el-button>
|
|
|
+ <el-button v-show="formData.taskType === '1' && index + 1 === formData.algorithms.length" @click="appendNewItem"> 添加算法 </el-button>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
@@ -64,15 +48,15 @@
|
|
|
<span class="span_class">选择训练数据</span>
|
|
|
<el-container style="display: flex; flex-direction: column">
|
|
|
<el-container v-for="(item, index) in formData.data" :key="index" style="margin-top: 5px">
|
|
|
- <el-button v-show="formData.data" @click="showDataSelectionDialog(index, true)">
|
|
|
- 选择批次
|
|
|
- </el-button>
|
|
|
- <span v-if="!item || item.length === 0" class="span_class" style="color: red; font-size: 15px">未完成</span>
|
|
|
- <span v-else class="span_class" style="color: greenyellow; font-size: 15px">已选择</span>
|
|
|
- <el-button v-show="formData.data.length>1" style="margin-left: 20px" @click="removeDataItem(index, true)">
|
|
|
- 删除数据
|
|
|
- </el-button>
|
|
|
- <el-button v-show="formData.taskType === '2' && index + 1 === formData.data.length" style="margin-left: 20px" @click="appendNewDataItem(true)">
|
|
|
+ <el-button v-show="formData.data" @click="showDataSelectionDialog(index, true)"> 选择批次 </el-button>
|
|
|
+ <span v-if="!item || item.length === 0" class="span_class" style=" font-size: 15px;color: red">未完成</span>
|
|
|
+ <span v-else class="span_class" style=" font-size: 15px;color: greenyellow">已选择</span>
|
|
|
+ <el-button v-show="formData.data.length > 1" style="margin-left: 20px" @click="removeDataItem(index, true)"> 删除数据 </el-button>
|
|
|
+ <el-button
|
|
|
+ v-show="formData.taskType === '2' && index + 1 === formData.data.length"
|
|
|
+ style="margin-left: 20px"
|
|
|
+ @click="appendNewDataItem(true)"
|
|
|
+ >
|
|
|
添加数据
|
|
|
</el-button>
|
|
|
</el-container>
|
|
@@ -84,15 +68,15 @@
|
|
|
<span class="span_class">选择测试数据</span>
|
|
|
<el-container style="display: flex; flex-direction: column">
|
|
|
<el-container v-for="(item, index) in formData.testData" :key="index" style="margin-top: 5px">
|
|
|
- <el-button v-show="formData.testData" @click="showDataSelectionDialog(index, false)">
|
|
|
- 选择批次
|
|
|
- </el-button>
|
|
|
- <span v-if="!item || item.length === 0" class="span_class" style="color: red; font-size: 15px">未完成</span>
|
|
|
- <span v-else class="span_class" style="color: greenyellow; font-size: 15px">已选择</span>
|
|
|
- <el-button v-show="formData.testData.length>1" style="margin-left: 20px" @click="removeDataItem(index, false)">
|
|
|
- 删除数据
|
|
|
- </el-button>
|
|
|
- <el-button v-show="formData.taskType === '2' && index + 1 === formData.testData.length" style="margin-left: 20px" @click="appendNewDataItem(false)">
|
|
|
+ <el-button v-show="formData.testData" @click="showDataSelectionDialog(index, false)"> 选择批次 </el-button>
|
|
|
+ <span v-if="!item || item.length === 0" class="span_class" style=" font-size: 15px;color: red">未完成</span>
|
|
|
+ <span v-else class="span_class" style=" font-size: 15px;color: greenyellow">已选择</span>
|
|
|
+ <el-button v-show="formData.testData.length > 1" style="margin-left: 20px" @click="removeDataItem(index, false)"> 删除数据 </el-button>
|
|
|
+ <el-button
|
|
|
+ v-show="formData.taskType === '2' && index + 1 === formData.testData.length"
|
|
|
+ style="margin-left: 20px"
|
|
|
+ @click="appendNewDataItem(false)"
|
|
|
+ >
|
|
|
添加数据
|
|
|
</el-button>
|
|
|
</el-container>
|
|
@@ -103,161 +87,83 @@
|
|
|
<el-container>
|
|
|
<span class="span_class">是否训练扩增</span>
|
|
|
<el-checkbox v-model="formData.expandData">扩增</el-checkbox>
|
|
|
- <el-button v-show="formData.expandData" style="margin-left: 20px" @click="showExpandDataSuperParameterConfig">
|
|
|
- 超参配置
|
|
|
- </el-button>
|
|
|
+ <el-button v-show="formData.expandData" style="margin-left: 20px" @click="showExpandDataSuperParameterConfig"> 超参配置 </el-button>
|
|
|
</el-container>
|
|
|
|
|
|
- <el-form-item style="margin-left: 30px; margin-top: 20px">
|
|
|
- <el-button type="primary" @click="submit">
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
+ <el-form-item style=" margin-top: 20px;margin-left: 30px">
|
|
|
+ <el-button type="primary" @click="submit"> 提交 </el-button>
|
|
|
|
|
|
- <el-button @click="cancel">
|
|
|
- 取消
|
|
|
- </el-button>
|
|
|
+ <el-button @click="cancel"> 取消 </el-button>
|
|
|
</el-form-item>
|
|
|
</dv-border-box1>
|
|
|
|
|
|
- <FormDialog ref="formDialogRef" v-on:update="handleUpdateModelList" />
|
|
|
+ <FormDialog ref="formDialogRef" @update="handleUpdateModelList" />
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="expandDataDialogVisible"
|
|
|
- title="数据扩增超参配置"
|
|
|
- >
|
|
|
-<!-- <span style="font-size: 16px; color: darkorange; font-weight: bold"> 数据扩增超参 </span>-->
|
|
|
+ <el-dialog v-model="expandDataDialogVisible" title="数据扩增超参配置">
|
|
|
+ <!-- <span style="font-size: 16px; color: darkorange; font-weight: bold"> 数据扩增超参 </span>-->
|
|
|
<el-container v-for="(item, index) in expandDataConfig" :key="index" style="margin-top: 5px">
|
|
|
<span class="span_class"> {{ item.name }}</span>
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- type="text"
|
|
|
- :placeholder="'请输入'+item.name"
|
|
|
- v-model="item.defaultValue"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <el-input style="width: 300px" type="text" :placeholder="'请输入' + item.name" v-model="item.defaultValue"> </el-input>
|
|
|
</el-container>
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
|
|
|
- <span class="dialog-footer" >
|
|
|
+ <span class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitExpandDataConfigDialog">确 定</el-button>
|
|
|
<el-button @click="expandDataDialogVisible = false">取 消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
- :title="superParameterFormData.title"
|
|
|
- >
|
|
|
- <span style="font-size: 16px; color: darkorange; font-weight: bold"> 训练超参 </span>
|
|
|
+ <el-dialog v-model="dialogVisible" :title="superParameterFormData.title">
|
|
|
+ <span style="font-size: 16px; font-weight: bold; color: darkorange"> 训练超参 </span>
|
|
|
<el-container v-for="(item, index) in superParameterFormData.trainParams" :key="index">
|
|
|
<span class="span_class"> {{ item.name }}</span>
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- type="text"
|
|
|
- :placeholder="'请输入'+item.name"
|
|
|
- v-model="item.defaultValue"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <el-input style="width: 300px" type="text" :placeholder="'请输入' + item.name" v-model="item.defaultValue"> </el-input>
|
|
|
</el-container>
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
|
|
|
- <span style="font-size: 16px; color: darkorange; font-weight: bold"> 验证超参 </span>
|
|
|
+ <span style="font-size: 16px; font-weight: bold; color: darkorange"> 验证超参 </span>
|
|
|
<el-container v-for="(item, index) in superParameterFormData.verifyParams" :key="index">
|
|
|
<span class="span_class"> {{ item.name }}</span>
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- type="text"
|
|
|
- :placeholder="'请输入'+item.name"
|
|
|
- v-model="item.defaultValue"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <el-input style="width: 300px" type="text" :placeholder="'请输入' + item.name" v-model="item.defaultValue"> </el-input>
|
|
|
</el-container>
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
|
|
|
- <span style="font-size: 16px; color: darkorange; font-weight: bold"> 测试超参 </span>
|
|
|
+ <span style="font-size: 16px; font-weight: bold; color: darkorange"> 测试超参 </span>
|
|
|
<el-container v-for="(item, index) in superParameterFormData.testParams" :key="index">
|
|
|
<span class="span_class"> {{ item.name }}</span>
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- type="text"
|
|
|
- :placeholder="'请输入'+item.name"
|
|
|
- v-model="item.defaultValue"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <el-input style="width: 300px" type="text" :placeholder="'请输入' + item.name" v-model="item.defaultValue"> </el-input>
|
|
|
</el-container>
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
|
|
|
- <span class="dialog-footer" >
|
|
|
+ <span class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitConfigDialog">确 定</el-button>
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="dataDialogVisible"
|
|
|
- title="选择数据批次"
|
|
|
- style="width: 70vw"
|
|
|
- >
|
|
|
+ <el-dialog v-model="dataDialogVisible" title="选择数据批次" style="width: 70vw">
|
|
|
<el-container>
|
|
|
- <el-table
|
|
|
- :data="batchDataList"
|
|
|
- tooltip-effect="dark"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="batchNum"
|
|
|
- label="所有批次"
|
|
|
- width="120"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="batchSize"
|
|
|
- label="数量"
|
|
|
- width="80"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
+ <el-table :data="batchDataList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
+ <el-table-column prop="batchNum" label="所有批次" width="120"> </el-table-column>
|
|
|
+ <el-table-column prop="batchSize" label="数量" width="80"> </el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <el-container style="margin-left: 10px; margin-right: 10px; display: flex; flex-direction: column; justify-content: center">
|
|
|
+ <el-container style=" display: flex; flex-direction: column; justify-content: center; margin-right: 10px;margin-left: 10px">
|
|
|
<el-button type="primary" :disabled="!canSelect" @click="clickSelectData"> {{ '=>' }} </el-button>
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
<el-button type="primary" :disabled="!canDeselect" @click="clickDeselectData"> {{ '<=' }} </el-button>
|
|
|
</el-container>
|
|
|
|
|
|
- <el-table
|
|
|
- :data="selectedBatchDataList"
|
|
|
- tooltip-effect="dark"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="handleDeselectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="batchNum"
|
|
|
- label="已选批次"
|
|
|
- width="120"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="batchSize"
|
|
|
- label="数量"
|
|
|
- width="80"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
+ <el-table :data="selectedBatchDataList" tooltip-effect="dark" style="width: 100%" @selection-change="handleDeselectionChange">
|
|
|
+ <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
+ <el-table-column prop="batchNum" label="已选批次" width="120"> </el-table-column>
|
|
|
+ <el-table-column prop="batchSize" label="数量" width="80"> </el-table-column>
|
|
|
</el-table>
|
|
|
</el-container>
|
|
|
|
|
|
<el-container style="height: 10px"></el-container>
|
|
|
- <span class="dialog-footer" >
|
|
|
+ <span class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitDataDialog">确 定</el-button>
|
|
|
<el-button @click="dataDialogVisible = false">取 消</el-button>
|
|
|
</span>
|
|
@@ -266,15 +172,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import {reactive, ref, onMounted, computed} from "vue";
|
|
|
-import {addAlgorithmTaskConfigurationApi} from "@/api/modules/ag/model";
|
|
|
-import {createTaskApi, getAlgorithmOptionApi} from "@/api/modules/task/task";
|
|
|
-import FormDialog from "@/components/FormDialog/index.vue";
|
|
|
+import { reactive, ref, onMounted, computed } from 'vue'
|
|
|
+import { addModelApi, queryModelList } from '@/api/modules/ag/model'
|
|
|
+import { createTaskApi } from '@/api/modules/task/task'
|
|
|
+import FormDialog from '@/components/FormDialog/index.vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
-import {listTaskConfigurationApi} from "@/api/modules/task/taskConfiguration";
|
|
|
-import {batchListDataApi} from "@/api/modules/demo/data";
|
|
|
-import {listDataApi} from "@/api/modules/system/dictData";
|
|
|
-import {ElMessage} from "element-plus";
|
|
|
+import { listTaskConfigurationApi } from '@/api/modules/task/taskConfiguration'
|
|
|
+import { batchListDataApi } from '@/api/modules/demo/data'
|
|
|
+import { listDataApi } from '@/api/modules/system/dictData'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
const valid = data => {
|
|
|
let ret = {
|
|
|
code: 400,
|
|
@@ -327,6 +233,7 @@ const valid = data => {
|
|
|
}
|
|
|
|
|
|
const submit = () => {
|
|
|
+ console.log('submit data, formdata is: ', formData)
|
|
|
const params = {
|
|
|
taskName: formData.taskName,
|
|
|
taskType: formData.taskType,
|
|
@@ -344,14 +251,33 @@ const submit = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ let __idx = 0
|
|
|
params.algTaskList.forEach(obj => {
|
|
|
- obj.algorithmId = obj.id;
|
|
|
+ obj.algorithmId = obj.id
|
|
|
// if (!obj.trainParams) {
|
|
|
// return
|
|
|
// }
|
|
|
- obj.params = JSON.stringify(JSON.parse(obj.trainParams)) + ";;;" +
|
|
|
- JSON.stringify(JSON.parse(obj.verifyParams)) + ";;;" +
|
|
|
- JSON.stringify(JSON.parse(obj.testParams))
|
|
|
+ let o1 = JSON.parse(obj.trainParams)
|
|
|
+ let o2 = JSON.parse(obj.verifyParams)
|
|
|
+ let o3 = JSON.parse(obj.testParams)
|
|
|
+ if (formData.algoModelId[__idx] && formData.algoModelId[__idx].length > 0) {
|
|
|
+ const __trained = {
|
|
|
+ agName: 'pretrained_model',
|
|
|
+ defaultValue: true,
|
|
|
+ modelId: formData.algoModelId[__idx]
|
|
|
+ }
|
|
|
+ o1.push(__trained)
|
|
|
+ o2.push(__trained)
|
|
|
+ o3.push(__trained)
|
|
|
+ }
|
|
|
+
|
|
|
+ obj.params =
|
|
|
+ JSON.stringify(o1) +
|
|
|
+ ';;;' +
|
|
|
+ JSON.stringify(o2) +
|
|
|
+ ';;;' +
|
|
|
+ JSON.stringify(o3)
|
|
|
+ __idx++
|
|
|
})
|
|
|
// console.log('submit', params)
|
|
|
|
|
@@ -403,12 +329,14 @@ const submitExpandDataConfigDialog = () => {
|
|
|
|
|
|
const expandDataDialogVisible = ref(false)
|
|
|
|
|
|
-let expandDataConfig = ref(reactive([
|
|
|
- // {
|
|
|
- // name: 'config1',
|
|
|
- // defaultValue: 'a'
|
|
|
- // }
|
|
|
-]))
|
|
|
+let expandDataConfig = ref(
|
|
|
+ reactive([
|
|
|
+ // {
|
|
|
+ // name: 'config1',
|
|
|
+ // defaultValue: 'a'
|
|
|
+ // }
|
|
|
+ ])
|
|
|
+)
|
|
|
|
|
|
const submitConfigDialog = () => {
|
|
|
dialogVisible.value = false
|
|
@@ -439,24 +367,18 @@ const canDeselect = computed(() => {
|
|
|
})
|
|
|
|
|
|
const handleUpdateModelList = () => {
|
|
|
- listTaskConfigurationApi({ pageNum: 1, pageSize: 10000 })
|
|
|
- .then(res => {
|
|
|
- // console.log(res)
|
|
|
- algorithms = reactive(res.data.list)
|
|
|
- })
|
|
|
+ updateModelList(UPDATE_INDEX.value.id, UPDATE_INDEX.value.idx)
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- listTaskConfigurationApi({ pageNum: 1, pageSize: 10000 })
|
|
|
- .then(res => {
|
|
|
- // console.log(res)
|
|
|
- algorithms = reactive(res.data.list)
|
|
|
- })
|
|
|
- batchListDataApi()
|
|
|
- .then(res => {
|
|
|
- // console.log(res)
|
|
|
- queryBatchData.value = reactive(res.data)
|
|
|
- })
|
|
|
+ listTaskConfigurationApi({ pageNum: 1, pageSize: 10000 }).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ algorithms = reactive(res.data.list)
|
|
|
+ })
|
|
|
+ batchListDataApi().then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ queryBatchData.value = reactive(res.data)
|
|
|
+ })
|
|
|
})
|
|
|
let queryBatchData = ref(reactive([]))
|
|
|
const handleSelectionChange = data => {
|
|
@@ -468,7 +390,7 @@ const handleDeselectionChange = data => {
|
|
|
// console.log(data)
|
|
|
}
|
|
|
const clickSelectData = () => {
|
|
|
- let set = new Set
|
|
|
+ let set = new Set()
|
|
|
for (let i = 0; i < tempSelectedBatchDataList.value.length; i++) {
|
|
|
set.add(tempSelectedBatchDataList.value[i].batchNum)
|
|
|
selectedBatchDataList.value.push(tempSelectedBatchDataList.value[i])
|
|
@@ -483,7 +405,7 @@ const clickSelectData = () => {
|
|
|
// console.log(batchDataList)
|
|
|
}
|
|
|
const clickDeselectData = () => {
|
|
|
- let set = new Set
|
|
|
+ let set = new Set()
|
|
|
for (let i = 0; i < tempDeselectedBatchDataList.value.length; i++) {
|
|
|
set.add(tempDeselectedBatchDataList.value[i].batchNum)
|
|
|
batchDataList.value.push(tempDeselectedBatchDataList.value[i])
|
|
@@ -508,20 +430,14 @@ const formData = reactive({
|
|
|
taskName: null,
|
|
|
taskType: '1',
|
|
|
tasks: [],
|
|
|
- algorithms: [
|
|
|
- {}
|
|
|
- ],
|
|
|
- algoIdx: [
|
|
|
- null
|
|
|
- ],
|
|
|
+ algorithms: [{}],
|
|
|
+ algoIdx: [null],
|
|
|
+ algoModelId: [null],
|
|
|
+ algoModelList: [[]],
|
|
|
// 训练数据
|
|
|
- data: [
|
|
|
- null
|
|
|
- ],
|
|
|
+ data: [null],
|
|
|
// 测试数据
|
|
|
- testData: [
|
|
|
- null
|
|
|
- ],
|
|
|
+ testData: [null],
|
|
|
expandData: false,
|
|
|
expandConfig: ''
|
|
|
})
|
|
@@ -549,17 +465,16 @@ const fillCurrentDataDialogList = (index, isTrainData) => {
|
|
|
batchDataList.value = []
|
|
|
selectedBatchDataList.value = []
|
|
|
|
|
|
- batchListDataApi()
|
|
|
- .then(res => {
|
|
|
- // console.log(res)
|
|
|
- for (let i = 0; i < res.data.length; i++) {
|
|
|
- if (selected.has(res.data[i].batchNum)) {
|
|
|
- selectedBatchDataList.value.push(res.data[i])
|
|
|
- } else {
|
|
|
- batchDataList.value.push(res.data[i])
|
|
|
- }
|
|
|
+ batchListDataApi().then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ if (selected.has(res.data[i].batchNum)) {
|
|
|
+ selectedBatchDataList.value.push(res.data[i])
|
|
|
+ } else {
|
|
|
+ batchDataList.value.push(res.data[i])
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
let superParameterFormData = reactive({})
|
|
@@ -578,96 +493,90 @@ const showSuperParameterConfig = (item, index) => {
|
|
|
|
|
|
let algorithms = reactive([])
|
|
|
|
|
|
-const onModelSelect = (index) => {
|
|
|
+const onAlgorithmModelSelect = index => {
|
|
|
formData.algorithms[index] = algorithms[formData.algoIdx[index]]
|
|
|
+ updateModelList(formData.algorithms[index].id, index)
|
|
|
}
|
|
|
|
|
|
const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
|
|
|
|
|
|
-const showAddModelDialog = () => {
|
|
|
- getAlgorithmOptionApi().then(res => {
|
|
|
- let allAgloData = {
|
|
|
- value: res.data
|
|
|
- }
|
|
|
- const params = {
|
|
|
- title: '算法模型配置',
|
|
|
- width: 580,
|
|
|
- isEdit: true,
|
|
|
- itemsOptions: [
|
|
|
- {
|
|
|
- label: '模型名称',
|
|
|
- prop: 'modelName',
|
|
|
- rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入模型名称'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模型',
|
|
|
- prop: 'modelAddress',
|
|
|
- rules: [],//{ required: true, message: '模型不能为空', trigger: 'blur' }
|
|
|
- compOptions: {
|
|
|
- elTagName: 'slot'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '训练算法地址',
|
|
|
- prop: 'trainUrl',
|
|
|
- rules: [{ required: true, message: '训练算法地址不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入训练算法地址'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '训练超参配置',
|
|
|
- prop: 'trainParams',
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入训练超参'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '验证算法地址',
|
|
|
- prop: 'valUrl',
|
|
|
- rules: [{ required: true, message: '验证算法地址不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入验证算法地址'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '验证超参配置',
|
|
|
- prop: 'valParams',
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入验证超参'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '测试算法地址',
|
|
|
- prop: 'testUrl',
|
|
|
- rules: [{ required: true, message: '测试算法地址不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入测试算法地址'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '测试超参配置',
|
|
|
- prop: 'testParams',
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入测试超参'
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- ],
|
|
|
- model: {},
|
|
|
- api: addAlgorithmTaskConfigurationApi
|
|
|
- }
|
|
|
|
|
|
- formDialogRef.value?.openDialog(params)
|
|
|
+let UPDATE_INDEX = ref({ id: null, idx: null })
|
|
|
+const showAddModelDialog = (item, index) => {
|
|
|
+ let _id = null
|
|
|
+ try {
|
|
|
+ _id = item.id
|
|
|
+ } catch (e) {
|
|
|
+ ElMessage.error("请先选择算法模型")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!_id || _id.length === 0) {
|
|
|
+ ElMessage.error("请先选择算法模型")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ UPDATE_INDEX.value = {
|
|
|
+ id: _id,
|
|
|
+ idx: index
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ title: '算法模型配置',
|
|
|
+ width: 580,
|
|
|
+ isEdit: true,
|
|
|
+ itemsOptions: [
|
|
|
+ {
|
|
|
+ label: '模型名称',
|
|
|
+ prop: 'modelName',
|
|
|
+ rules: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入模型名称'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '模型',
|
|
|
+ prop: 'modelAddress',
|
|
|
+ rules: [], //{ required: true, message: '模型不能为空', trigger: 'blur' }
|
|
|
+ compOptions: {
|
|
|
+ elTagName: 'slot'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '训练样本数',
|
|
|
+ prop: 'sampleNumber',
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入训练样本数'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '训练循环次数',
|
|
|
+ prop: 'cycleEpoch',
|
|
|
+ compOptions: {
|
|
|
+ placeholder: '请输入训练循环次数'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ model: {},
|
|
|
+ api: addModelApi
|
|
|
+ }
|
|
|
+ console.log('check item:', item)
|
|
|
+ formDialogRef.value?.openDialog(params, item.id)
|
|
|
+}
|
|
|
+
|
|
|
+// 获取算法模型绑定列表
|
|
|
+const updateModelList = (id, index) => {
|
|
|
+ // 获取算法列表?
|
|
|
+ queryModelList({id: id}).then(res => {
|
|
|
+ console.log('algorithm task model get: ', res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ formData.algoModelList[index] = [ {id: null, modelName: '未选择'} , ...res.data]
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const appendNewItem = () => {
|
|
|
formData.algorithms.push({})
|
|
|
formData.algoIdx.push(null)
|
|
|
+ formData.algoModelId.push(null)
|
|
|
+ formData.algoModelList.push([])
|
|
|
}
|
|
|
const appendNewDataItem = isTrainData => {
|
|
|
if (isTrainData) {
|
|
@@ -679,6 +588,8 @@ const appendNewDataItem = isTrainData => {
|
|
|
const removeItem = idx => {
|
|
|
formData.algorithms.splice(idx, 1)
|
|
|
formData.algoIdx.splice(idx, 1)
|
|
|
+ formData.algoModelId.splice(idx, 1)
|
|
|
+ formData.algoModelList.splice(idx, 1)
|
|
|
}
|
|
|
const removeDataItem = (idx, isTrainData) => {
|
|
|
if (isTrainData) {
|
|
@@ -691,7 +602,6 @@ const cancel = () => {
|
|
|
// console.log('cancel')
|
|
|
router.push(`/index`)
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -704,10 +614,17 @@ const cancel = () => {
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
.span_class {
|
|
|
+ display: flex;
|
|
|
+ align-self: center;
|
|
|
+ justify-content: center;
|
|
|
width: 120px;
|
|
|
font-size: 13px;
|
|
|
+}
|
|
|
+.span_class1 {
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
- justify-content: center
|
|
|
+ justify-content: center;
|
|
|
+ width: 65px;
|
|
|
+ font-size: 13px;
|
|
|
}
|
|
|
</style>
|