|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="源文件id" prop="taskName">
|
|
|
+ <el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
|
|
|
+ <el-form-item label="任务名称" prop="taskName">
|
|
|
<el-input
|
|
|
v-model="queryParams.taskName"
|
|
|
- placeholder="请输入源文件id"
|
|
|
+ placeholder="请输入任务名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
@@ -17,7 +17,7 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="源文件id" prop="relateSourceFileId">
|
|
|
+ <!-- <el-form-item label="源文件id" prop="relateSourceFileId">
|
|
|
<el-input
|
|
|
v-model="queryParams.relateSourceFileId"
|
|
|
placeholder="请输入源文件id"
|
|
@@ -32,7 +32,7 @@
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </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>
|
|
@@ -42,54 +42,54 @@
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:add']"
|
|
|
type="primary"
|
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['graph:task:add']"
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:edit']"
|
|
|
type="success"
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
- v-hasPermi="['graph:task:edit']"
|
|
|
>修改</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:remove']"
|
|
|
type="danger"
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
- v-hasPermi="['graph:task:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:export']"
|
|
|
type="warning"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- v-hasPermi="['graph:task:export']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="id" align="center" prop="id" />
|
|
|
- <el-table-column label="源文件id" align="center" prop="taskName" />
|
|
|
- <el-table-column label="任务名称" align="center" prop="taskType" />
|
|
|
+ <el-table-column label="任务名称" align="center" prop="taskName" />
|
|
|
+ <el-table-column label="任务类型" align="center" prop="taskType" />
|
|
|
<el-table-column label="子任务" align="center" prop="subtask" />
|
|
|
<el-table-column label="任务状态" align="center" prop="taskStatus" />
|
|
|
<el-table-column label="源文件id" align="center" prop="relateSourceFileId" />
|
|
@@ -98,23 +98,23 @@
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:edit']"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['graph:task:edit']"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
+ v-hasPermi="['graph:task:remove']"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['graph:task:remove']"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
v-show="total>0"
|
|
|
:total="total"
|
|
@@ -124,22 +124,48 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改任务管理对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="源文件id" prop="taskName">
|
|
|
- <el-input v-model="form.taskName" placeholder="请输入源文件id" />
|
|
|
+ <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="700px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-form-item label="任务名称" prop="taskName">
|
|
|
+ <el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="子任务" prop="subtask">
|
|
|
- <el-input v-model="form.subtask" placeholder="请输入子任务" />
|
|
|
+ <el-form-item label="任务类型" prop="taskType">
|
|
|
+ <!-- <el-input v-model="form.taskType" placeholder="请输入任务类型" /> -->
|
|
|
+ <el-radio v-model="form.taskType" label="1" @change="taskTypeChange">数据处理</el-radio>
|
|
|
+ <el-radio v-model="form.taskType" label="2" @change="taskTypeChange">知识抽取</el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="源文件id" prop="relateSourceFileId">
|
|
|
- <el-input v-model="form.relateSourceFileId" placeholder="请输入源文件id" />
|
|
|
+ <el-form-item label="子任务" prop="subtaskArray">
|
|
|
+ <el-checkbox-group v-model="form.subtaskArray">
|
|
|
+ <template v-if="form.taskType==='1'">
|
|
|
+ <el-checkbox v-for="dict in dict.type.biz_data_process" :key="dict.value" :label="dict.value"> {{ dict.label }}</el-checkbox>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-checkbox v-for="dict in dict.type.biz_kg_build" :key="dict.value" :label="dict.value"> {{ dict.label }}</el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="处理文件id" prop="relateProcessedFileId">
|
|
|
- <el-input v-model="form.relateProcessedFileId" placeholder="请输入处理文件id" />
|
|
|
+ <el-form-item label="源文件" prop="relateSourceFileId">
|
|
|
+ <el-select v-model="form.relateSourceFileId" placeholder="请选择源文件" @change="relateSourceFileIdChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in sourceFileOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="处理文件" prop="relateProcessedFileId">
|
|
|
+ <el-select v-model="form.relateProcessedFileId" placeholder="请选择处理文件">
|
|
|
+ <el-option
|
|
|
+ v-for="item in relateProcessedFileOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -151,10 +177,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listTask, getTask, delTask, addTask, updateTask } from "@/api/graph/task";
|
|
|
-
|
|
|
+import { listTask, getTask, delTask, addTask, updateTask } from '@/api/graph/task'
|
|
|
+import { getSourceFileOptions } from '@/api/graph/sourceFile'
|
|
|
+import { getOptionsBySourceFileId } from '@/api/graph/processedFile'
|
|
|
export default {
|
|
|
- name: "Task",
|
|
|
+ name: 'Task',
|
|
|
+ dicts: ['biz_data_process', 'biz_kg_build'],
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -172,7 +200,7 @@ export default {
|
|
|
// 任务管理表格数据
|
|
|
taskList: [],
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
// 查询参数
|
|
@@ -180,44 +208,62 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
taskName: null,
|
|
|
- taskType: null,
|
|
|
+ taskType: '1',
|
|
|
subtask: null,
|
|
|
+ subtaskArray: [],
|
|
|
taskStatus: null,
|
|
|
relateSourceFileId: null,
|
|
|
- relateProcessedFileId: null,
|
|
|
+ relateProcessedFileId: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- }
|
|
|
- };
|
|
|
+ },
|
|
|
+ sourceFileOptions: [],
|
|
|
+ relateProcessedFileOptions: []
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
+ this.getList()
|
|
|
+ this.getOptions()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getOptions() {
|
|
|
+ getSourceFileOptions().then(resp => {
|
|
|
+ this.sourceFileOptions = resp.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getOptionsBySourceFileId(id) {
|
|
|
+ getOptionsBySourceFileId(id).then(resp => {
|
|
|
+ this.relateProcessedFileOptions = resp.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ relateSourceFileIdChange() {
|
|
|
+ this.getOptionsBySourceFileId(this.form.relateSourceFileId)
|
|
|
+ },
|
|
|
/** 查询任务管理列表 */
|
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
listTask(this.queryParams).then(response => {
|
|
|
- this.taskList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ this.taskList = response.rows
|
|
|
+ this.total = response.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
taskName: null,
|
|
|
- taskType: null,
|
|
|
+ taskType: '1',
|
|
|
subtask: null,
|
|
|
+ subtaskArray: [],
|
|
|
taskStatus: null,
|
|
|
relateSourceFileId: null,
|
|
|
relateProcessedFileId: null,
|
|
@@ -226,77 +272,83 @@ export default {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
+ }
|
|
|
+ this.resetForm('form')
|
|
|
+ this.relateProcessedFileOptions = []
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
+ this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加任务管理";
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = '添加任务管理'
|
|
|
+ this.taskTypeChange()
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
+ this.reset()
|
|
|
const id = row.id || this.ids
|
|
|
getTask(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改任务管理";
|
|
|
- });
|
|
|
+ this.form = response.data
|
|
|
+ this.open = true
|
|
|
+ this.title = '修改任务管理'
|
|
|
+ this.getOptionsBySourceFileId(this.form.relateSourceFileId)
|
|
|
+ })
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
updateTask(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
} else {
|
|
|
addTask(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
+ const ids = row.id || this.ids
|
|
|
this.$modal.confirm('是否确认删除任务管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delTask(ids);
|
|
|
+ return delTask(ids)
|
|
|
}).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.getList()
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
+ }).catch(() => {})
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
this.download('graph/task/export', {
|
|
|
...this.queryParams
|
|
|
}, `task_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ taskTypeChange() {
|
|
|
+ this.form.subtask = ''
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|