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