|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<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-input
|
|
|
v-model="queryParams.taskName"
|
|
@@ -10,15 +17,26 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="算法" prop="algorithmId">
|
|
|
- <el-input
|
|
|
+ <el-select
|
|
|
v-model="queryParams.algorithmId"
|
|
|
- placeholder="请输入算法"
|
|
|
- clearable
|
|
|
+ placeholder="请选择算法"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in configOptions"
|
|
|
+ :key="option.id"
|
|
|
+ :label="option.name"
|
|
|
+ :value="option.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.status"
|
|
|
+ placeholder="请选择状态"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.biz_status"
|
|
|
:key="dict.value"
|
|
@@ -27,25 +45,37 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="开始时间" prop="startTime">
|
|
|
- <el-date-picker clearable
|
|
|
+ <!-- <el-form-item label="开始时间" prop="startTime">
|
|
|
+ <el-date-picker
|
|
|
+ clearable
|
|
|
v-model="queryParams.startTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择开始时间">
|
|
|
+ placeholder="请选择开始时间"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结束时间" prop="endTime">
|
|
|
- <el-date-picker clearable
|
|
|
+ <el-date-picker
|
|
|
+ clearable
|
|
|
v-model="queryParams.endTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择结束时间">
|
|
|
+ placeholder="请选择结束时间"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="handleQuery"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -58,7 +88,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['biz:distillation:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -69,7 +100,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['biz:distillation:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -80,7 +112,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['biz:distillation:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -90,54 +123,94 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['biz:distillation:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
+ @queryTable="getList"
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="distillationList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="distillationList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
|
<el-table-column label="任务名称" align="center" prop="taskName" />
|
|
|
- <el-table-column label="算法" align="center" prop="algorithmId" />
|
|
|
+ <el-table-column label="算法" align="center" prop="algorithmName" />
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
|
|
|
+ <dict-tag :options="dict.type.biz_status" :value="scope.row.status" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
|
|
+ <el-table-column
|
|
|
+ label="开始时间"
|
|
|
+ align="center"
|
|
|
+ prop="startTime"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.startTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
|
|
+ <el-table-column
|
|
|
+ label="结束时间"
|
|
|
+ align="center"
|
|
|
+ prop="endTime"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.endTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleRun(scope.row)"
|
|
|
+ v-hasPermi="['biz:preprocessed:add']"
|
|
|
+ >运行</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleGetResult(scope.row)"
|
|
|
+ v-hasPermi="['biz:preprocessed:add']"
|
|
|
+ >查看结果</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['biz:distillation:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['biz:distillation:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
@@ -145,13 +218,31 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改知识蒸馏对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="任务名称" prop="taskName">
|
|
|
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="算法" prop="algorithmId">
|
|
|
- <el-input v-model="form.algorithmId" placeholder="请输入算法" />
|
|
|
+ <el-select
|
|
|
+ v-model="form.algorithmId"
|
|
|
+ placeholder="请选择算法"
|
|
|
+ @change="changeAlgorithmId"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in configOptions"
|
|
|
+ :key="option.id"
|
|
|
+ :label="option.name"
|
|
|
+ :value="option.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="输入路径" prop="inputPath">
|
|
|
<el-input v-model="form.inputPath" placeholder="请输入输入路径" />
|
|
@@ -160,10 +251,18 @@
|
|
|
<el-input v-model="form.outputPath" placeholder="请输入输出路径" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="算法参数" prop="algorithmParams">
|
|
|
- <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.algorithmParams"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -175,13 +274,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listDistillation, getDistillation, delDistillation, addDistillation, updateDistillation } from "@/api/biz/distillation";
|
|
|
+import {
|
|
|
+ listDistillation,
|
|
|
+ getDistillation,
|
|
|
+ delDistillation,
|
|
|
+ addDistillation,
|
|
|
+ updateDistillation,
|
|
|
+ run,
|
|
|
+ getResultDetails,
|
|
|
+} from "@/api/biz/distillation";
|
|
|
|
|
|
+import { getStatic } from "@/api/biz/common";
|
|
|
+import { getOptionsByType } from "@/api/biz/config";
|
|
|
export default {
|
|
|
name: "Distillation",
|
|
|
- dicts: ['biz_status'],
|
|
|
+ dicts: ["biz_status"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ staticsUrl: process.env.VUE_APP_BASE_API + "/biz/common/getStatic",
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
@@ -214,18 +324,27 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {},
|
|
|
+ configOptions: [],
|
|
|
+ resultDetails: {},
|
|
|
+ detailsOpen: false,
|
|
|
+ jsonResult: {},
|
|
|
+ selectFileName: "",
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getOptions();
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.getList();
|
|
|
+ this.getOptions();
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询知识蒸馏列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listDistillation(this.queryParams).then(response => {
|
|
|
+ listDistillation(this.queryParams).then((response) => {
|
|
|
this.distillationList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
@@ -252,7 +371,7 @@ export default {
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
- updateTime: null
|
|
|
+ updateTime: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -268,9 +387,9 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
@@ -281,25 +400,31 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getDistillation(id).then(response => {
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getDistillation(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改知识蒸馏";
|
|
|
});
|
|
|
},
|
|
|
+ handleRun(row) {
|
|
|
+ const id = row.id;
|
|
|
+ run(id).then((response) => {
|
|
|
+ alert("任务开始运行!");
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- updateDistillation(this.form).then(response => {
|
|
|
+ updateDistillation(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addDistillation(this.form).then(response => {
|
|
|
+ addDistillation(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -311,19 +436,50 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除知识蒸馏编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delDistillation(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除知识蒸馏编号为"' + ids + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delDistillation(ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('biz/distillation/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `distillation_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.download(
|
|
|
+ "biz/distillation/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `distillation_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ getOptions() {
|
|
|
+ getOptionsByType("4").then((response) => {
|
|
|
+ this.configOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeAlgorithmId() {
|
|
|
+ const algorithmId = this.form.algorithmId;
|
|
|
+ const config = this.configOptions.find((item) => item.id === algorithmId);
|
|
|
+ if (config && config.params) {
|
|
|
+ this.form.algorithmParams = config.params;
|
|
|
+ } else {
|
|
|
+ this.form.algorithmParams = "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleGetResult(row) {
|
|
|
+ this.resultDetails = {};
|
|
|
+ this.selectFileName = "";
|
|
|
+ const id = row.id;
|
|
|
+ getResultDetails(id).then((response) => {
|
|
|
+ this.resultDetails = response.data;
|
|
|
+ this.detailsOpen = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|