测试:前台任务设计雏形

master
陈思豪 2024-08-23 19:33:38 +08:00
parent 623bb808bb
commit 2dbe085057
2 changed files with 154 additions and 6 deletions

View File

@ -27,4 +27,12 @@ export function updateById(data){
}) })
} }
//删除
export function deleteByTaskId(id) {
return request({
url: "/task/task/deleteById/" + id,
method: "POST"
})
}

View File

@ -116,7 +116,6 @@
<span style="margin-left: 10px" v-if="scope.row.status ==0 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==0 "></span>
<span style="margin-left: 10px" v-if="scope.row.status ==1 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==1 "></span>
<span style="margin-left: 10px" v-if="scope.row.status ==2 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==2 "></span>
<span style="margin-left: 10px">{{ scope.row.status }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -127,7 +126,6 @@
<span style="margin-left: 10px" v-if="scope.row.status ==0 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==0 "></span>
<span style="margin-left: 10px" v-if="scope.row.status ==1 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==1 "></span>
<span style="margin-left: 10px" v-if="scope.row.status ==2 "></span> <span style="margin-left: 10px" v-if="scope.row.status ==2 "></span>
<span style="margin-left: 10px">{{ scope.row.status }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -139,7 +137,7 @@
icon="el-icon-pear" icon="el-icon-pear"
size="mini" size="mini"
type="text" type="text"
@click="update(scope.row)">执行</el-button> @click="executeTask(scope.row)">执行</el-button>
<el-button <el-button
icon="el-icon-delete" icon="el-icon-delete"
@ -181,6 +179,124 @@
</el-dialog> </el-dialog>
<!-- 添加任务详情设计-->
<el-dialog title="添加表" :visible.sync="taskInputAdd">
<el-form label-width="80px" :model="taskInputReq" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
<el-form-item label="任务id">
<el-input v-model="taskInputReq.taskId"></el-input>
</el-form-item>
<el-form-item label="数据库id">
<el-input v-model="taskInputReq.databaseId"></el-input>
</el-form-item>
<el-form-item label="数据表">
<el-select v-model="taskReq.tableName" placeholder="请选择等级">
<el-option label="请选择" value="0"></el-option>
<span v-for="table in tableList">
<el-option :label=table.tableName :value=table.id :key=table.id></el-option>
</span>
</el-select>
</el-form-item>
<el-form-item label="表别名">
<el-input v-model="taskInputReq.tableAsName"></el-input>
</el-form-item>
<div slot="footer" class="dialog-footer">
<el-button @click="taskInputAdd = false"> </el-button>
<el-button type="primary" @click="addTaskInput()"></el-button>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addTask()"> </el-button>
</div>
</el-dialog>
<!-- 字段选择列表-->
<el-dialog title="添加表" :visible.sync="taskInputFieldAdd">
<el-table
:data="taskList"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="字段"
width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column
label="类型/长度"
width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column
label="非空"
width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column
label="注释"
width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column
label="处理规则"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px" v-if="scope.row.weigh ==1 "></span>
<span style="margin-left: 10px" v-if="scope.row.weigh ==2 "></span>
<span style="margin-left: 10px" v-if="scope.row.weigh ==3 "></span>
<span style="margin-left: 10px" v-if="scope.row.weigh ==4 "></span>
</template>
</el-table-column>
<el-table-column
label="表别名"
width="180">
<template slot-scope="scope">
<input type="text">
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addTask()"> </el-button>
</div>
</el-dialog>
</div> </div>
@ -194,7 +310,7 @@ import {selectSourceExport} from "@/api/etl/switch";
import {connectionTest} from "@/api/etl/switch"; import {connectionTest} from "@/api/etl/switch";
import {insertAdd} from "@/api/etl/switch"; import {insertAdd} from "@/api/etl/switch";
import {getInfo} from "@/api/etl/switch"; import {getInfo} from "@/api/etl/switch";
import { addTask, selectTaskList, updateById } from '@/api/task/task' import { addTask, deleteById, deleteByTaskId, selectTaskList, updateById } from '@/api/task/task'
export default { export default {
//import使" //import使"
@ -205,11 +321,17 @@ export default {
return { return {
dialogFormVisible:false, dialogFormVisible:false,
//
taskInputAdd:false,
//
taskInputFieldAdd:false,
taskReq:{ taskReq:{
}, },
taskAddReq:{}, taskAddReq:{},
taskInputReq:{},
taskList:[], taskList:[],
tableList:[],
}; };
}, },
// data", // data",
@ -218,6 +340,15 @@ export default {
watch: {}, watch: {},
//", //",
methods: { methods: {
executeTask(){
},
addTaskInput(){
this.taskInputAdd = false;
this.taskInputFieldAdd = true;
},
// //
handleAdd(){ handleAdd(){
this.dialogFormVisible = true; this.dialogFormVisible = true;
@ -246,6 +377,15 @@ export default {
}, },
handleDelete(row){
deleteByTaskId(row.getId).then(res=>{
alert(res.msg);
if(res.code == 200){
location.reload();
}
})
},
handleSelectionChange(row){ handleSelectionChange(row){
}, },