Commit a1f85d63 by 莫晓莉

1.19

parent 7cb7a885
...@@ -16,20 +16,50 @@ export function insert(data) { ...@@ -16,20 +16,50 @@ export function insert(data) {
method: 'post' method: 'post'
}) })
} }
//更新数据库资源库 //更新作业
export function update(data) { export function update(data) {
return request({ return request({
url: 'kettle/repository/update', url: 'kettle/job/update',
data, data,
method: 'post' method: 'post'
}) })
} }
//删除数据库资源库 //删除作业
export function deleteList(data) { export function deleteJob(data) {
return request({ return request({
url: 'kettle/repository/delete?id='+data, url: 'kettle/job/delete?id='+data,
method: 'post' method: 'post'
}) })
} }
//开始作业
export function start(data) {
return request({
url: 'kettle/job/start?jobId='+data,
method: 'post'
})
}
//停止作业
export function stop(data) {
return request({
url: 'kettle/job/stop?jobId='+data,
method: 'post'
})
}
// //更新数据库资源库
// export function update(data) {
// return request({
// url: 'kettle/repository/update',
// data,
// method: 'post'
// })
// }
// //删除数据库资源库
// export function deleteList(data) {
// return request({
// url: 'kettle/repository/delete?id='+data,
// method: 'post'
// })
// }
import request from '@/utils/request'
// 分页获取转换列表
export function getPageList(data) {
return request({
url: 'kettle/trans/getPageList',
data,
method: 'post'
})
}
//添加转换
export function insert(data) {
return request({
url: 'kettle/trans/insert',
data,
method: 'post'
})
}
//删除转换
export function deleteTrans(data) {
return request({
url: 'kettle/trans/delete?id='+data,
method: 'post'
})
}
//更新转换
export function update(data) {
return request({
url: 'kettle/trans/update',
data,
method: 'post'
})
}
//获取数据库资源库列表
export function getList(data) {
return request({
url: 'kettle/repository/getList',
data,
method: 'post'
})
}
//获取策略配置列表
export function getKettleQuartzList(data) {
return request({
url: 'kettle/quartz/getKettleQuartzList',
data,
method: 'post'
})
}
//开始转换
export function start(data) {
return request({
url: 'kettle/trans/start?transId='+data,
method: 'post'
})
}
//停止转换
export function stop(data) {
return request({
url: 'kettle/trans/stop?transId='+data,
method: 'post'
})
}
import request from '@/utils/request'
// 分页获取转换列表
export function getPageList(data) {
return request({
url: 'kettle/trans/getPageList',
data,
method: 'post'
})
}
// //添加转换
// export function insert(data) {
// return request({
// url: 'kettle/trans/insert',
// data,
// method: 'post'
// })
// }
// //删除转换
// export function deleteTrans(data) {
// return request({
// url: 'kettle/trans/delete?id='+data,
// method: 'post'
// })
// }
// //更新转换
// export function update(data) {
// return request({
// url: 'kettle/trans/update',
// data,
// method: 'post'
// })
// }
// //获取数据库资源库列表
// export function getList(data) {
// return request({
// url: 'kettle/repository/getList',
// data,
// method: 'post'
// })
// }
// //获取策略配置列表
// export function getKettleQuartzList(data) {
// return request({
// url: 'kettle/quartz/getKettleQuartzList',
// data,
// method: 'post'
// })
// }
// //开始转换
// export function start(data) {
// return request({
// url: 'kettle/trans/start?transId='+data,
// method: 'post'
// })
// }
// //停止转换
// export function stop(data) {
// return request({
// url: 'kettle/trans/stop?transId='+data,
// method: 'post'
// })
// }
...@@ -326,7 +326,9 @@ export default { ...@@ -326,7 +326,9 @@ export default {
this.row = {}; this.row = {};
this.form = {}; this.form = {};
this.curId=null; this.curId=null;
if (this.$refs['formName']!==undefined) {
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果 this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
}
}, },
...@@ -350,7 +352,6 @@ export default { ...@@ -350,7 +352,6 @@ export default {
    },     },
// 删除 // 删除
deleteList(row) { deleteList(row) {
var params={id:row.id};
this.$confirm('确认删除该条数据, 是否继续?', '提示', { this.$confirm('确认删除该条数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
......
...@@ -182,7 +182,9 @@ export default { ...@@ -182,7 +182,9 @@ export default {
this.row = {}; this.row = {};
this.form = {}; this.form = {};
this.curId=null; this.curId=null;
if (this.$refs['formName']!==undefined) {
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果 this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
}
}, },
//生成cron表达式(生成后填入上面的框中) //生成cron表达式(生成后填入上面的框中)
See(){ See(){
......
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>策略列表</span>
<i @click="deleteTabOne()" class="el-icon-close btn-icon" style=""></i>
<i
class="btn-icon"
:class="jobShow ? 'el-icon-arrow-down' : 'el-icon-arrow-up '"
@click="showAll()"
></i>
</div>
<div v-show="jobShow" class="card-body">
<el-button class="btn-brush" icon="el-icon-plus"
 @click="closeModal">新增策略</el-button>
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%"
:header-cell-style="{ color: '#606266' }"
>
<el-table-column prop="id" label="策略编号" align="center" />
<el-table-column prop="description" label="策略描述" align="center"/>
<el-table-column prop="cron" label="策略Cron" align="center" />
<el-table-column prop label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="editModal(scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="deleteStrategy(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页start -->
<div class="pagination">
<el-pagination
background
layout="total ,prev, pager, next"
:total="pageInfo.total"
:page-size="pageInfo.size"
:current-page="pageInfo.page"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
<!-- 分页end -->
</div>
</el-card>
<!-- 1、新增资源库作业start -->
<el-dialog
:title="curId?dialogMsgEdit:dialogMsgAdd"
:visible="DialogVisibleOne"
:before-close="closeModal"
width="60%"
center
top="2%">
<el-row :gutter="20">
<el-col :span="12" :offset="5">
<el-form ref="formName" :rules="rules" :model="form" label-width="auto">
<el-form-item prop="description" label="策略描述:">
<el-input placeholder="请输入策略描述,例如每天凌晨一点执行" v-model="form.description" class="input-length"></el-input>
</el-form-item>
<el-form-item prop="cron" label="策略Cron:">
<el-input placeholder="请输入策略Cron" v-model="form.cron" class="input-length"></el-input>
<span @click="See()" style="color: #337ab7;">生成cron表达式(生成后填入上面的框中)</span>
</el-form-item>
</el-form>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button class="btn-brush" type="success" icon="el-icon-check" @click.native="curId ? update(): submitForm()" >保存</el-button>
<el-button class="btn-brush" type="success" icon="el-icon-plus" @click="closeModal()">取消</el-button>
</span>
</el-dialog>
<!--1、 新增资源库作业end -->
</div>
</template>
<script>
import {
getKettleRepositoryList,
insert,
update,
deleteStrategy
} from "@/api/sys/strategy";
export default {
data() {
return {
tableData: [],
pageInfo: {
page: 1,
size: 10,
},
loading: true,
jobShow: true, //作业监控记录
DialogVisibleOne: false,//新增资源库作业弹窗
form: {
description:'',
cron:''
},
dialogMsgAdd:'添加用户',
dialogMsgEdit:'编辑用户',
curId: null,
rules:{
description:[
{required:true,message:'请输入策略描述',trigger:'blur'}
],
cron:[
{required:true,message:'请输入策略Cron',trigger:'blur'}
],
},
};
},
created() {
this.getKettleRepositoryList();
},
methods: {
showAll(){
this.jobShow=!this.jobShow;
},
//分页获取策略配置列表
getKettleRepositoryList() {
getKettleRepositoryList({ ...this.pageInfo}).then((res) => {
console.log('分页获取策略配置列表:',res);
this.tableData = res.data.rows;
this.pageInfo.total = res.data.total;
//关闭加载样式
setTimeout(() => {
this.loading = false;
}, 500);
});
},
// 提交新增数据
submitForm(){
this.$refs['formName'].validate((valid) => {
if (valid) {
insert(this.form).then(res=>{
console.log('提交新增数据:',res);
if (res.success) {
this.$message.success('新增成功!');
this.closeModal();//关闭弹窗
this.getKettleRepositoryList();//刷新列表
}else {
this.$message.error(res.errMsg)
}
})
} else {
console.log('error submit!!');
return false;
}
});
},
// 模态框操作
closeModal() {
console.log('打开弹窗------------------',this.DialogVisibleOne);
this.DialogVisibleOne = !this.DialogVisibleOne;
this.row = {};
this.form = {};
this.curId=null;
if (this.$refs['formName']!==undefined) {
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
}
},
//生成cron表达式(生成后填入上面的框中)
See(){
window.open('https://cron.qqe2.com/')
},
//编辑数据库资源库
editModal(row) {
this.curId=row.id;
      console.log('编辑时候id不为为null');
this.form = JSON.parse(JSON.stringify(row)) // 克隆
this.DialogVisibleOne=true;    
    },
// 编辑数据
update(){
this.$refs['formName'].validate((valid) => {
if (valid) {
update(this.form).then(res=>{
console.log('提交编辑数据:',res);
if (res.success) {
this.$message.success('编辑成功!');
this.centerDialogVisible=false;//关闭弹窗
this.form={};
this.curId=null;
this.closeModal();//关闭弹窗
this.getKettleRepositoryList();//刷新列表
}else {
this.$message.error(res.errMsg)
}
})
} else {
console.log('error submit!!');
return false;
}
});
},
// 删除
deleteStrategy(row) {
var params={id:row.id};
this.$confirm('确认删除该条数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteStrategy(row.id).then((res) => {
if (res.success) {
this.$message.success('删除成功')
this.getKettleRepositoryList();
} else {
this.$message.error(res.errMsg)
}
})
})
},
// 显示数量切换
sizeChange(e) {
this.pageInfo.size = e;
this.pageChange(1); // 切换数量时页数为1
},
pageChange(e) {
this.pageInfo.page = e;
this.getKettleRepositoryList();
},
},
};
</script>
<style>
.border {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
border-radius: 2px;
padding: 30px;
}
.above {
margin-top: 50px;
}
.btn-brush {
border-color: #21b9bb;
margin-bottom: 5px;
background-color: #23c6c8;
color: #ffffff;
font-size: 14px;
font-weight: bold;
}
.btn-icon {
float: right;
padding: 3px 0;
font-size: 14px;
font-weight: 700;
color: #c4c4c4;
margin-right: 5px;
}
.right{
float:right;
}
.input-length{
width: 500px;
}
.el-card__body{
padding:0 !important;
}
.card-body{
padding: 15px 20px 20px 20px;
}
</style>
...@@ -263,21 +263,30 @@ export default { ...@@ -263,21 +263,30 @@ export default {
var params={}; var params={};
getKettleJobMonitorList(JSON.stringify(params)).then((res) => { getKettleJobMonitorList(JSON.stringify(params)).then((res) => {
console.log('获取列表',res); console.log('获取列表',res);
if(res.success){
this.allTableData = res.data; this.allTableData = res.data;
}
}); });
}, },
// 获取总执行成功次数 // 获取总执行成功次数
getAllSuccessCount() { getAllSuccessCount() {
getAllSuccessCount().then((res) => { getAllSuccessCount().then((res) => {
console.log('获取列表',res); console.log('获取列表',res);
if(res.success){
this.allSuccessCount = res.data; this.allSuccessCount = res.data;
}
}); });
}, },
// 获取总执行失败次数 // 获取总执行失败次数
getAllFailCount() { getAllFailCount() {
getAllFailCount().then((res) => { getAllFailCount().then((res) => {
console.log('获取列表',res); console.log('获取列表',res);
if(res.success){
this.allFailCount = res.data; this.allFailCount = res.data;
}
}); });
}, },
...@@ -287,12 +296,16 @@ export default { ...@@ -287,12 +296,16 @@ export default {
getKettleJobMonitorPageList() { getKettleJobMonitorPageList() {
getKettleJobMonitorPageList(this.pageInfo).then((res) => { getKettleJobMonitorPageList(this.pageInfo).then((res) => {
console.log('分页获取作业监控列表',res); console.log('分页获取作业监控列表',res);
if(res.success){
this.tableData = res.data.rows; this.tableData = res.data.rows;
this.pageInfo.total = res.data.total; this.pageInfo.total = res.data.total;
//关闭加载样式 //关闭加载样式
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
}, 500); }, 500);
}else{
this.$message.error(res.errMsg)
}
}); });
}, },
//查看详情 //查看详情
......
...@@ -200,8 +200,8 @@ import { ...@@ -200,8 +200,8 @@ import {
update, update,
create, create,
} from "@/api/communication/announcement"; } from "@/api/communication/announcement";
import { getDoctorList } from "@/api/hospitalapi/doctor"; // import { getDoctorList } from "@/api/hospitalapi/doctor";
import { getToken } from "@/utils/auth"; // import { getToken } from "@/utils/auth";
export default { export default {
filters: { filters: {
interceptionDate: function (value) { interceptionDate: function (value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment