Commit 94812605 by 莫晓莉

策略增删改查

parent 1eb11b8b
import request from '@/utils/request'
// 分页获取策略配置列表
export function getKettleRepositoryList(data) {
return request({
url: 'kettle/quartz/getKettleQuartzPageList',
data,
method: 'post'
})
}
// 新增策略配置
export function insert(data) {
return request({
url: 'kettle/quartz/insert',
data,
method: 'post'
})
}
//更新策略配置
export function update(data) {
return request({
url: 'kettle/quartz/update',
data,
method: 'post'
})
}
//删除策略配置
export function deleteStrategy(data) {
return request({
url: 'kettle/quartz/delete?id='+data,
method: 'post'
})
}
import request from '@/utils/request'
// 分页获取作业列表
export function getKettleJobList(data) {
return request({
url: 'kettle/job/getKettleJobList',
data,
method: 'post'
})
}
//添加作业
export function insert(data) {
return request({
url: 'kettle/job/insert',
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'
})
}
......@@ -10,6 +10,7 @@
@click="showAll()"
></i>
</div>
<div v-show="jobShow" class="card-body">
<el-button class="btn-brush" icon="el-icon-plus"  @click="closeModal" >新增数据库资源库</el-button>
<div>
<el-table
......@@ -63,7 +64,7 @@
/>
</div>
</div>
</div>
</el-card>
<!-- 新增和编辑弹窗start -->
......@@ -184,7 +185,7 @@ export default {
page: 1,
size: 10,
},
loading: false,
loading: true,
headers: {}, // 头部信息
centerDialogVisible: false,
form: {
......@@ -231,17 +232,17 @@ export default {
{required:true,message:'请输入资源库数据库登录密码',trigger:'blur'}
],
},
options: [{
code: '选项1',
}, {
code: '选项2',
}, {
code: '选项3',
}, {
code: '选项4',
}, {
code: '选项5',
}],
// options: [{
// code: '选项1',
// }, {
// code: '选项2',
// }, {
// code: '选项3',
// }, {
// code: '选项4',
// }, {
// code: '选项5',
// }],
// value: '',
dialogMsgAdd:'添加数据库资源库',
dialogMsgEdit:'编辑数据库资源库',
......@@ -264,6 +265,10 @@ export default {
console.log('分页获取数据库资源库列表',res);
this.tableData = res.data.rows;
this.pageInfo.total = res.data.total;
//关闭加载样式
setTimeout(() => {
this.loading = false;
}, 500);
});
},
showAll(){
......@@ -346,7 +351,7 @@ export default {
// 删除
deleteList(row) {
var params={id:row.id};
this.$confirm('确认删除商品, 是否继续?', '提示', {
this.$confirm('确认删除该条数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......@@ -445,4 +450,11 @@ export default {
color: #c4c4c4;
margin-right: 5px;
}
.el-card__body{
padding:0 !important;
/* padding: 15px 20px 20px 20px; */
}
.card-body{
padding: 15px 20px 20px 20px;
}
</style>
......@@ -13,6 +13,7 @@
></i>
</div>
<div v-show="!jobShow" class="card-body">
<div>
<el-button class="btn-brush" icon="el-icon-plus"
 @click="addModalOne">新增资源库作业</el-button>
......@@ -23,7 +24,7 @@
<el-button class="btn-brush right" icon="el-icon-plus"
 @click="addTask">刷新列表</el-button>
</div>
<div>
<el-table
v-loading="loading"
:data="tableData"
......@@ -32,20 +33,23 @@
:header-cell-style="{ color: '#606266' }"
>
<el-table-column prop="id" label="作业编号" width="100" align="center" />
<el-table-column label="作业类型" width="100" align="center">
文件
<el-table-column prop="type" label="作业类型" width="100" align="center">
<template slot-scope="scope">
{{ jobTypeList[scope.row.type] }}
</template>
</el-table-column>
<el-table-column prop="doctorName" label="作业名称" align="center" />
<el-table-column prop="username" label="作业策略" align="center" />
<el-table-column prop="name" label="作业名称" align="center" />
<el-table-column prop="customerQuarz" label="作业策略" align="center" />
<el-table-column label="作业更新时间" align="center" width="180">
<!-- <template slot-scope="scope">
<span>{{ scope.row.createTime | interceptionDate }}</span>
</template> -->
2020-11-29 14:07:38
<template slot-scope="scope">
{{ scope.row.updateTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="作业状态" width="100" align="center" >
已停止
<el-table-column prop="status" label="作业状态" width="100" align="center" >
<template slot-scope="scope">
{{ jobStatusList[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop label="操作" align="center">
<template slot-scope="scope">
......@@ -74,7 +78,7 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<!-- 分页start -->
<div class="pagination">
<el-pagination
background
......@@ -86,6 +90,7 @@
@current-change="pageChange"
/>
</div>
<!-- 分页end -->
</div>
</el-card>
......@@ -333,18 +338,27 @@
<script>
import {
getNativeArticlePageList,
update,
create,
} from "@/api/communication/announcement";
import { getDoctorList } from "@/api/hospitalapi/doctor";
import { getToken } from "@/utils/auth";
getKettleJobList,
} from "@/api/task/homework";
// import { getDoctorList } from "@/api/hospitalapi/doctor";
// import { getToken } from "@/utils/auth";
export default {
filters: {
interceptionDate: function (value) {
if (!value) return;
return value.substr(0, 10);
},
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
data() {
return {
......@@ -353,38 +367,60 @@ export default {
page: 1,
size: 10,
},
loading: false,
loading: true,
headers: {}, // 头部信息
jobShow: false, //作业监控记录
DialogVisibleOne: false,//新增资源库作业弹窗
DialogVisibleTwo: false,//新增资源库作业弹窗
DialogVisibleThree: false, //编辑资源库作业弹窗
form: {},
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
// options: [{
// value: '选项1',
// label: '黄金糕'
// }, {
// value: '选项2',
// label: '双皮奶'
// }, {
// value: '选项3',
// label: '蚵仔煎'
// }, {
// value: '选项4',
// label: '龙须面'
// }, {
// value: '选项5',
// label: '北京烤鸭'
// }],
jobStatusList:['','正在运行', '已停止'],
jobTypeList:['','数据库资源库','上传的文件']
};
},
created() {
this.getNativeArticlePageListFun();
this.setHeaders();
this.getKettleJobList();//分页获取作业列表
// this.setHeaders();
},
methods: {
showAll(){
this.jobShow=!this.jobShow;
},
//分页获取作业列表
getKettleJobList() {
getKettleJobList({ ...this.pageInfo}).then((res) => {
console.log('分页获取作业列表:',res);
this.tableData = res.data.rows;
this.pageInfo.total = res.data.total;
//关闭加载样式
setTimeout(() => {
this.loading = false;
}, 500);
});
},
// 新增资源库作业弹窗
addModalOne() {
this.DialogVisibleOne=true;   
......@@ -399,20 +435,20 @@ export default {
    },
setHeaders() {
this.headers = {
contentType: "application/x-www-form-urlencoded",
Authorization: getToken(),
};
},
// setHeaders() {
// this.headers = {
// contentType: "application/x-www-form-urlencoded",
// Authorization: getToken(),
// };
// },
getNativeArticlePageListFun() {
getNativeArticlePageList({ ...this.pageInfo, status: 1 }).then((res) => {
console.log(res);
this.tableData = res.data.rows;
this.pageInfo.total = res.data.total;
});
},
// getNativeArticlePageListFun() {
// getNativeArticlePageList({ ...this.pageInfo, status: 1 }).then((res) => {
// console.log(res);
// this.tableData = res.data.rows;
// this.pageInfo.total = res.data.total;
// });
// },
// 显示数量切换
sizeChange(e) {
......@@ -439,27 +475,27 @@ export default {
// });
// },
// 删除
delJobVacancyFun(val) {
this.article = val;
let param = {
...this.article,
status: 3,
};
update(param).then((res) => {
if (res.success) {
this.$message.success("删除成功");
this.getNativeArticlePageListFun();
} else {
this.$message.error(res.errMsg);
}
});
},
// delJobVacancyFun(val) {
// this.article = val;
// let param = {
// ...this.article,
// status: 3,
// };
// update(param).then((res) => {
// if (res.success) {
// this.$message.success("删除成功");
// this.getNativeArticlePageListFun();
// } else {
// this.$message.error(res.errMsg);
// }
// });
// },
// 添加活动
    addTask() {
      console.log('传递添加活动写死传递1:')
      this.$router.push({ path: '/oracle/add', query: { id: '1' }})
    },
//     addTask() {
//       console.log('传递添加活动写死传递1:')
//       this.$router.push({ path: '/oracle/add', query: { id: '1' }})
//     },
    // 编辑活动
//     goPage(id) {
//       console.log('传递编辑活动di:', id)
......@@ -512,4 +548,11 @@ export default {
.input-length{
width: 500px;
}
.el-card__body{
padding:0 !important;
/* padding: 15px 20px 20px 20px; */
}
.card-body{
padding: 15px 20px 20px 20px;
}
</style>
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