|
@@ -104,10 +104,21 @@
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
+ :disabled="single"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['algoManager:algorithm:export']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-mouse"
|
|
|
+ size="mini"
|
|
|
+ @click="handleRun"
|
|
|
+ v-hasPermi="['algoManager:algorithm:run']"
|
|
|
+ >算法运行</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -119,7 +130,7 @@
|
|
|
<dict-tag :options="dict.type.algorithm_type" :value="scope.row.type"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="算法子类型" align="center" prop="subTypeId" />
|
|
|
+ <el-table-column label="算法子类型" align="center" prop="algoSubName" />
|
|
|
<el-table-column label="名称" align="center" prop="name" />
|
|
|
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
@@ -180,7 +191,7 @@
|
|
|
placeholder="请选择算法子类型"
|
|
|
clearable
|
|
|
filterable
|
|
|
- @change='changeFormSubType(form.subTypeId)'
|
|
|
+ @change='changeFormSubType()'
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in algoTypeList"
|
|
@@ -192,10 +203,27 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<template v-if="form.subTypeId">
|
|
|
- <el-form-item v-for="item in ioSubList" :label="item.name" :key="item.id" prop="name">
|
|
|
- <file-upload v-model="form.path"/>
|
|
|
+ <el-form-item v-for="item in form.ioSubList" :label="item.name" :key="item.id">
|
|
|
+ <!-- <file-upload v-model="form.path"/> -->
|
|
|
+ <el-select
|
|
|
+ v-model="item.uploadId"
|
|
|
+ placeholder="请选择文件"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="file in fileList"
|
|
|
+ :key="file.id"
|
|
|
+ :label="file.name"
|
|
|
+ :value="file.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入名称" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
@@ -209,9 +237,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listAlgorithm, getAlgorithm, delAlgorithm, addAlgorithm, updateAlgorithm } from "@/api/algoManager/algorithm";
|
|
|
+import { listAlgorithm, getAlgorithmDto, delAlgorithm, addOrUpdateDto, runAlgorithm } from "@/api/algoManager/algorithm";
|
|
|
import { getAlgoSubOption } from "@/api/algoManager/algorithm";
|
|
|
import { getIoSubList } from "@/api/conf/field";
|
|
|
+import { getFileList } from "@/api/algoManager/file";
|
|
|
|
|
|
export default {
|
|
|
name: "Algorithm",
|
|
@@ -236,8 +265,8 @@ export default {
|
|
|
algorithmSubList: [],
|
|
|
// 算法特定类列表
|
|
|
algoTypeList: [],
|
|
|
- // 具体算法输入输出文件列表
|
|
|
- ioSubList: [],
|
|
|
+ // 已上传文件列表
|
|
|
+ fileList: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
@@ -268,6 +297,7 @@ export default {
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.getAlgoSubOption();
|
|
|
+ this.getFileList();
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询算法列表 */
|
|
@@ -288,6 +318,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ getFileList() {
|
|
|
+ getFileList().then((resp) => {
|
|
|
+ this.fileList = resp.data;
|
|
|
+ console.info(resp);
|
|
|
+ console.info(this);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -307,7 +345,9 @@ export default {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
- remark: null
|
|
|
+ remark: null,
|
|
|
+ // 具体算法输入输出文件列表
|
|
|
+ ioSubList: []
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -337,29 +377,22 @@ export default {
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
- getAlgorithm(id).then(response => {
|
|
|
+ getAlgorithmDto(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改算法";
|
|
|
+ this.algoTypeList = this.typeMap.get(this.form.type);
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updateAlgorithm(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addAlgorithm(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
+ addOrUpdateDto(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -379,6 +412,14 @@ export default {
|
|
|
...this.queryParams
|
|
|
}, `algorithm_${new Date().getTime()}.xlsx`)
|
|
|
},
|
|
|
+ /** 运行算法按钮操作 */
|
|
|
+ handleRun() {
|
|
|
+ const id = row.id || this.ids
|
|
|
+ runAlgorithm(id).then(response => {
|
|
|
+ this.$modal.msgSuccess("成功");
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
createTypeMap() {
|
|
|
for (const algorithmSub of this.algorithmSubList) {
|
|
@@ -408,8 +449,8 @@ export default {
|
|
|
},
|
|
|
|
|
|
changeFormSubType() {
|
|
|
- getIoSubList(this.form.subTypeId).then((resp) => {
|
|
|
- this.ioSubList = resp.data;
|
|
|
+ getIoSubList(this.form.subTypeId,this.form.id).then((resp) => {
|
|
|
+ this.form.ioSubList = resp.data;
|
|
|
console.info(resp);
|
|
|
});
|
|
|
},
|