|
@@ -1,5 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
|
+
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item label="任务名称" prop="taskName">
|
|
<el-form-item label="任务名称" prop="taskName">
|
|
<el-input
|
|
<el-input
|
|
@@ -134,7 +135,7 @@
|
|
plain
|
|
plain
|
|
icon="el-icon-document"
|
|
icon="el-icon-document"
|
|
size="mini"
|
|
size="mini"
|
|
- @click="traindata"
|
|
|
|
|
|
+ @click="gettraindata"
|
|
>查询训练数据</el-button>
|
|
>查询训练数据</el-button>
|
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -145,7 +146,7 @@
|
|
plain
|
|
plain
|
|
icon="el-icon-document"
|
|
icon="el-icon-document"
|
|
size="mini"
|
|
size="mini"
|
|
- @click="verificationdata"
|
|
|
|
|
|
+ @click="getverificationdata"
|
|
>查询验证数据</el-button>
|
|
>查询验证数据</el-button>
|
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -165,7 +166,7 @@
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" class="custom-selection"/>
|
|
<el-table-column label="任务编号" align="center" prop="id" />
|
|
<el-table-column label="任务编号" align="center" prop="id" />
|
|
<el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip='true' />
|
|
<el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip='true' />
|
|
<el-table-column label="状态" align="center" prop="taskStatus" :show-overflow-tooltip='true' />
|
|
<el-table-column label="状态" align="center" prop="taskStatus" :show-overflow-tooltip='true' />
|
|
@@ -180,7 +181,17 @@
|
|
<span>{{ parseTime(scope.row.endTime) }}</span>
|
|
<span>{{ parseTime(scope.row.endTime) }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="完成率" align="center" prop="progress" />
|
|
|
|
|
|
+ <el-table-column label="运行进度" align="center" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-progress
|
|
|
|
+ type="circle"
|
|
|
|
+ :percentage="ProgressMap[scope.$index]"
|
|
|
|
+ width="48"
|
|
|
|
+ :status="progressStatus"
|
|
|
|
+ ></el-progress>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="准确率" align="center" prop="accuracyRate" />
|
|
<el-table-column label="准确率" align="center" prop="accuracyRate" />
|
|
<el-table-column label="召回率" align="center" prop="recallRate" />
|
|
<el-table-column label="召回率" align="center" prop="recallRate" />
|
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip='true' />
|
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip='true' />
|
|
@@ -211,6 +222,7 @@
|
|
:total="total"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
+
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
<!-- 任务详情导入对话框 -->
|
|
<!-- 任务详情导入对话框 -->
|
|
@@ -287,15 +299,54 @@
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="训练数据" :visible.sync="traindatavisible" width="500px" append-to-body>
|
|
|
|
- <div style="white-space: pre-wrap;font-size: 17px">
|
|
|
|
- {{traindataset}}
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-dialog title="训练数据" :visible.sync="traindatavisible" width="800px" append-to-body>
|
|
|
|
+
|
|
|
|
+ <el-table :data="traindataset" >
|
|
|
|
+ <el-table-column label="使用场景" align="center" prop="useScene" />
|
|
|
|
+ <el-table-column label="查询条件" align="center" prop="searchCondition" />
|
|
|
|
+ <el-table-column label="标准结果1" align="center" prop="result1" />
|
|
|
|
+ <el-table-column label="标准结果2" align="center" prop="result2" />
|
|
|
|
+ <el-table-column label="标准结果3" align="center" prop="result3" />
|
|
|
|
+ <el-table-column label="标准结果4" align="center" prop="result4" />
|
|
|
|
+ <el-table-column label="标准结果5" align="center" prop="result5" />
|
|
|
|
+ <el-table-column label="trained" align="center" >{{1}}</el-table-column>
|
|
|
|
+ <el-table-column label="tested" align="center" >{{0}}</el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="ttotal>0"
|
|
|
|
+ :total="ttotal"
|
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
|
+ @pagination="gettraindata"
|
|
|
|
+ />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="验证数据" :visible.sync="verificationdatavisible" width="500px" append-to-body>
|
|
|
|
- <div style="white-space: pre-wrap;font-size: 17px">
|
|
|
|
- {{verificationdataset}}
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-dialog title="验证数据" :visible.sync="verificationdatavisible" width="800px" append-to-body>
|
|
|
|
+
|
|
|
|
+ <el-table :data="verificationtabledata" >
|
|
|
|
+ <el-table-column label="使用场景" align="center" prop="useScene" />
|
|
|
|
+ <el-table-column label="查询条件" align="center" prop="searchCondition" />
|
|
|
|
+ <el-table-column label="标准结果1" align="center" prop="result1" />
|
|
|
|
+ <el-table-column label="标准结果2" align="center" prop="result2" />
|
|
|
|
+ <el-table-column label="标准结果3" align="center" prop="result3" />
|
|
|
|
+ <el-table-column label="标准结果4" align="center" prop="result4" />
|
|
|
|
+ <el-table-column label="标准结果5" align="center" prop="result5" />
|
|
|
|
+ <el-table-column label="计算结果1" align="center" prop="calculate1" />
|
|
|
|
+ <el-table-column label="计算结果2" align="center" prop="calculate2" />
|
|
|
|
+ <el-table-column label="计算结果3" align="center" prop="calculate3" />
|
|
|
|
+ <el-table-column label="计算结果4" align="center" prop="calculate4" />
|
|
|
|
+ <el-table-column label="计算结果5" align="center" prop="calculate5" />
|
|
|
|
+
|
|
|
|
+ <el-table-column label="trained" align="center" >{{0}}</el-table-column>
|
|
|
|
+ <el-table-column label="tested" align="center" >{{1}}</el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="vtotal>0"
|
|
|
|
+ :total="vtotal"
|
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
|
+ @pagination="getverificationdata"
|
|
|
|
+ />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -306,18 +357,21 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/biz/task";
|
|
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/biz/task";
|
|
-import { verification,getTraindataset } from "@/api/biz/detail";
|
|
|
|
|
|
+import { verification,getTraindataset,updateDetails,getUpdatedDetails } from "@/api/biz/detail";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import {Loading, Message} from "element-ui";
|
|
import {Loading, Message} from "element-ui";
|
|
import service from "../../../utils/request";
|
|
import service from "../../../utils/request";
|
|
import errorCode from "../../../utils/errorCode";
|
|
import errorCode from "../../../utils/errorCode";
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
|
+import {updateDetail} from "../../../api/biz/detail";
|
|
export default {
|
|
export default {
|
|
name: "Task",
|
|
name: "Task",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
|
|
+ vloading:true,
|
|
|
|
+ tloading:true,
|
|
// 选中数组
|
|
// 选中数组
|
|
ids: [],
|
|
ids: [],
|
|
// 非单个禁用
|
|
// 非单个禁用
|
|
@@ -328,6 +382,8 @@ export default {
|
|
showSearch: true,
|
|
showSearch: true,
|
|
// 总条数
|
|
// 总条数
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ ttotal:0,
|
|
|
|
+ vtotal:0,
|
|
// 验证任务表格数据
|
|
// 验证任务表格数据
|
|
taskList: [],
|
|
taskList: [],
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
@@ -347,6 +403,7 @@ export default {
|
|
accuracyRate: null,
|
|
accuracyRate: null,
|
|
recallRate: null,
|
|
recallRate: null,
|
|
},
|
|
},
|
|
|
|
+
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
@@ -370,69 +427,130 @@ export default {
|
|
traindatavisible:false,
|
|
traindatavisible:false,
|
|
verificationdatavisible:false,
|
|
verificationdatavisible:false,
|
|
traindataset:[],
|
|
traindataset:[],
|
|
- verificationdataset:[]
|
|
|
|
|
|
+ verificationdataset:[],
|
|
|
|
+ ProgressMap: [],
|
|
|
|
+ taskidToIndexMap: new Map(),
|
|
|
|
+ verificationtabledata:[],
|
|
};
|
|
};
|
|
|
|
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ progressStatus() {
|
|
|
|
+ return this.Progress === 100 ? 'success' : '';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
- traindata(){
|
|
|
|
|
|
+
|
|
|
|
+ gettraindata(){
|
|
getTraindataset().then(res=>{
|
|
getTraindataset().then(res=>{
|
|
- console.log(res)
|
|
|
|
- this.traindataset = res.data
|
|
|
|
- this.traindataset.id = undefined
|
|
|
|
|
|
+ this.traindatavisible = true
|
|
|
|
+ // console.log(res)
|
|
|
|
+
|
|
|
|
+ this.tloading = false
|
|
|
|
+ this.ttotal = res.total;
|
|
|
|
+ this.traindataset = res.rows
|
|
|
|
+
|
|
|
|
+
|
|
})
|
|
})
|
|
- this.traindatavisible = true
|
|
|
|
- },
|
|
|
|
- verificationdata(){
|
|
|
|
|
|
|
|
- this.verificationdatavisible = true
|
|
|
|
},
|
|
},
|
|
- handleRun(){
|
|
|
|
- let taskids = this.ids;
|
|
|
|
|
|
+ getverificationdata(){
|
|
|
|
|
|
- const dayjs = require('dayjs');
|
|
|
|
- for(let taskid of taskids){
|
|
|
|
- // getTask(taskid).then(response => {
|
|
|
|
- //
|
|
|
|
- // let task = response.data;
|
|
|
|
- // task.startTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
- // setTimeout(()=>{
|
|
|
|
- // task.taskStatus = "运行成功"
|
|
|
|
- // task.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
- // updateTask(task).then(res => {
|
|
|
|
- // this.$message.success("任务"+taskid+"运行成功!")
|
|
|
|
- //
|
|
|
|
- // this.getList();
|
|
|
|
- // });
|
|
|
|
- // }, 3000);
|
|
|
|
- //
|
|
|
|
- // });
|
|
|
|
- console.log(taskid)
|
|
|
|
- verification(taskid,'D:\\checkpoint\\mymodel.pth').then(res=>{
|
|
|
|
- console.log(res)
|
|
|
|
- if(res.code===200){
|
|
|
|
- this.$modal.msgSuccess(res.msg)
|
|
|
|
- this.verificationdataset = res.data
|
|
|
|
- this.verificationdataset.id = undefined
|
|
|
|
- }
|
|
|
|
|
|
+ getUpdatedDetails(this.ids).then(res=>{
|
|
|
|
+ this.verificationdatavisible = true
|
|
|
|
|
|
- else {
|
|
|
|
- this.$modal.msgError(res.msg)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.verificationtabledata = res.rows
|
|
|
|
+ this.vloading = false
|
|
|
|
+ this.vtotal = res.total;
|
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleRun() {
|
|
|
|
+ let taskids = this.ids;
|
|
|
|
+ const dayjs = require('dayjs');
|
|
|
|
+
|
|
|
|
+ for (let taskid of taskids) {
|
|
|
|
+ let index = this.taskidToIndexMap.get(taskid)
|
|
|
|
+ getTask(taskid).then(response => {
|
|
|
|
+
|
|
|
|
+ let task = response.data;
|
|
|
|
+ task.startTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ let code = 0;
|
|
|
|
+ this.ProgressMap[index] = 0;
|
|
|
|
+ verification(taskid).then(res => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ code = res.code;
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.verificationdataset = JSON.parse(res.data).dataSet;
|
|
|
|
+ //更新任务详情表
|
|
|
|
+ updateDetails(this.verificationdataset).then(res1=>{
|
|
|
|
+ console.log(res1.msg)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ console.log(this.verificationdataset)
|
|
|
|
+
|
|
|
|
+ task.accuracyRate = res.data.accuracyRate
|
|
|
|
+ task.recallRate = res.data.recallRate
|
|
|
|
+ //这里需要更新数据库task
|
|
|
|
+ updateTask(task).then(res2=>{
|
|
|
|
+ console.log(res2.msg)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 使用闭包确保每个循环迭代中创建一个新的 taskid
|
|
|
|
+ const createInterval = (taskId) => {
|
|
|
|
+ // 模拟进度变化,每0.1秒更新一次,共更新100次
|
|
|
|
+ const intervalId = setInterval(() => {
|
|
|
|
+ let idx = this.taskidToIndexMap.get(taskId)
|
|
|
|
+ // this.ProgressMap[index] = this.ProgressMap[index] + 1
|
|
|
|
+ this.$set(this.ProgressMap, idx, this.ProgressMap[idx] + 1);
|
|
|
|
+ if(code!==200&&code!==0){
|
|
|
|
+ clearInterval(intervalId);
|
|
|
|
+ this.$message.error('任务' + taskId + '运行失败!');
|
|
|
|
+ }
|
|
|
|
+ // 如果进度达到100%,清除定时器并调用后端算法
|
|
|
|
+ if (this.ProgressMap[idx] >= 100) {
|
|
|
|
+ clearInterval(intervalId);
|
|
|
|
+ if(code===200){
|
|
|
|
+ task.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ task.taskStatus = '运行成功';
|
|
|
|
+ task.progress = 100;
|
|
|
|
+ updateTask(task).then(res => {
|
|
|
|
+ this.$message.success('任务' + taskId + '运行成功!');
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 100);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 调用闭包函数,传入当前的 taskid
|
|
|
|
+
|
|
|
|
+ createInterval(taskid);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
/** 查询验证任务列表 */
|
|
/** 查询验证任务列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
listTask(this.queryParams).then(response => {
|
|
listTask(this.queryParams).then(response => {
|
|
this.taskList = response.rows;
|
|
this.taskList = response.rows;
|
|
|
|
+ let task;
|
|
|
|
+ let idx = 0;
|
|
|
|
+ for(task of this.taskList){
|
|
|
|
+ this.taskidToIndexMap.set(task.id, idx)
|
|
|
|
+ // this.ProgressMap.push(task.progress)
|
|
|
|
+ this.ProgressMap.push(0)
|
|
|
|
+ idx++;
|
|
|
|
+ }
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
@@ -593,3 +711,13 @@ export default {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
|
|
+<style>
|
|
|
|
+
|
|
|
|
+ .el-checkbox__inner {
|
|
|
|
+ border-color: #8492a6 !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</style>
|