进度条
This commit is contained in:
parent
a6f6516923
commit
e421c87bf2
13
src/api/backup.js
Normal file
13
src/api/backup.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
|
||||
|
||||
const backupAdd = (params)=>postAction("/idcDataBackup/add",params);
|
||||
const backupEdit = (params)=>putAction("/idcDataBackup/edit",params);
|
||||
const backupDeleteById = (params)=>deleteAction("/idcDataBackup/deleteById",params);
|
||||
export {
|
||||
backupAdd,
|
||||
backupEdit,
|
||||
backupDeleteById
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2,21 +2,21 @@
|
|||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<!-- <div class="table-page-search-wrapper">-->
|
||||
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
|
||||
<!-- <a-row :gutter="24">-->
|
||||
<!-- -->
|
||||
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
|
||||
<!-- <a-col :md="4" :sm="4">-->
|
||||
<!-- <a-button type="primary" style="left: 10px" @click="backup" icon="plus">一键备份</a-button>-->
|
||||
<!-- <a-button type="primary" @click="handleAdd" icon="plus"-->
|
||||
<!-- style="margin-left: 8px;left: 10px">添加</a-button>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </span>-->
|
||||
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="4" :sm="4">
|
||||
<a-button type="primary" style="left: 10px" @click="backup" icon="plus">一键备份</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="plus"
|
||||
style="margin-left: 8px;left: 10px">添加</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- </a-row>-->
|
||||
<!-- </a-form>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="linese"></div>
|
||||
<!-- table区域-begin -->
|
||||
|
@ -27,23 +27,24 @@
|
|||
<!-- :locale="myLocale"-->
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<template slot="Status" slot-scope="text">
|
||||
<span style="color:black;" v-if="text === 0">未备份</span>
|
||||
<span style="color:darkorange;" v-if="text === 1">备份中</span>
|
||||
<span style="color:#87d068;" v-if="text === 2">完成</span>
|
||||
<template slot="sourceType" slot-scope="text">
|
||||
<span style="color:black;" v-if="text === 1">原始库</span>
|
||||
<span style="color:darkorange;" v-if="text === 2">标准库</span>
|
||||
<span style="color:#87d068;" v-if="text === 3">专题库</span>
|
||||
</template>
|
||||
<template slot="endisStatus" slot-scope="text">
|
||||
<template slot="backupStatus" slot-scope="text">
|
||||
<span style="color:black;" v-if="text === 0">未启用</span>
|
||||
<span style="color:#87d068;" v-if="text === 1">启用</span>
|
||||
</template>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">详情</a>
|
||||
<!-- <a-divider type="vertical" />
|
||||
<a>查看日志</a>
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm> -->
|
||||
<a v-if="record.backupStatus === 0" @click="handleStartStop(record.id,1)">启动</a>
|
||||
<a v-if="record.backupStatus === 1" @click="handleStartStop(record.id,0)">暂停</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleRun(record.sourceType)">一键备份</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleRun(record.sourceType)">同步日志</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
@ -51,6 +52,7 @@
|
|||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<backupModal ref="modalForm" @ok="modalFormOk"></backupModal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
@ -58,12 +60,14 @@
|
|||
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
import backupModal from './modules/backupModal'
|
||||
|
||||
export default {
|
||||
name: "backup",
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
JEllipsis,
|
||||
backupModal,
|
||||
VNodes: {
|
||||
functional: true,
|
||||
render: (h, ctx) => ctx.props.vnodes,
|
||||
|
@ -94,45 +98,30 @@ export default {
|
|||
{
|
||||
title: '任务名称',
|
||||
align: "center",
|
||||
dataIndex: 'name',
|
||||
dataIndex: 'taskName',
|
||||
},
|
||||
{
|
||||
title: '数据库',
|
||||
align: "center",
|
||||
dataIndex: 'dataBaseName',
|
||||
},
|
||||
{
|
||||
title: '调度开始时间',
|
||||
align: "center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '调度结束时间',
|
||||
align: "center",
|
||||
dataIndex: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '表达式',
|
||||
align: "center",
|
||||
dataIndex: 'larmder',
|
||||
},
|
||||
{
|
||||
title: '调度状态',
|
||||
align: "center",
|
||||
dataIndex: 'Status',
|
||||
scopedSlots: { customRender: 'Status' },
|
||||
dataIndex: 'sourceType',
|
||||
scopedSlots: { customRender: 'sourceType' }
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'endisStatus',
|
||||
scopedSlots: { customRender: 'endisStatus' },
|
||||
dataIndex: 'backupStatus',
|
||||
scopedSlots: { customRender: 'backupStatus' }
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
align: "center",
|
||||
dataIndex: 'remark'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: "center",
|
||||
width: 180,
|
||||
width: 260,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
]
|
||||
|
@ -170,7 +159,25 @@ export default {
|
|||
getAction("/idcDataBackup/list?pageNo=1&pageSize=10").then((res) => {
|
||||
if (res.success) {
|
||||
console.log(res)
|
||||
this.dataSource = res.result;
|
||||
this.dataSource = res.result.records;
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleRun(sourceType) {
|
||||
postAction("/idcDataBackup/dmExportByUserName",{sourceType:sourceType}).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.result);
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleStartStop(id,backupStatus) {
|
||||
postAction("/idcDataBackup/edit",{id:id,backupStatus:backupStatus}).then((res) => {
|
||||
if (res.success) {
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
|
@ -191,6 +198,10 @@ export default {
|
|||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.modalForm.add();
|
||||
this.$refs.modalForm.title = "新增";
|
||||
},
|
||||
handleDistribute: function (id) {
|
||||
var that = this;
|
||||
taskDistributeTask({ id: id }).then((res) => {
|
||||
|
|
126
src/views/securityAndBackup/modules/backupModal.vue
Normal file
126
src/views/securityAndBackup/modules/backupModal.vue
Normal file
|
@ -0,0 +1,126 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="任务名称" >
|
||||
<a-input v-decorator="['taskName']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="仓库类型">
|
||||
<a-select placeholder="选择仓库类型" option-filter-prop="children" size="large" v-decorator="['sourceType']">
|
||||
<a-select-option key="1" :value="1">原始库</a-select-option>
|
||||
<a-select-option key="2" :value="2">标准库</a-select-option>
|
||||
<a-select-option key="3" :value="3">专题库</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="描述">
|
||||
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['remark', {}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
import {backupAdd,backupEdit} from "@api/backup";
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "backupModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
status:'',
|
||||
model: {},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:""
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'taskName','sourceType','remark'));
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
if(!this.model.id){
|
||||
backupAdd(values).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
backupEdit({id:this.model.id,taskName:values.taskName,sourceType:values.sourceType,remark:values.remark}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
|
@ -75,7 +75,7 @@ export default {
|
|||
queryParam: {
|
||||
ipInfo: '',
|
||||
createTimeRange: [],
|
||||
logType: '1',
|
||||
logType: '2',
|
||||
keyWord: '',
|
||||
},
|
||||
tabKey: "1",
|
||||
|
|
Loading…
Reference in New Issue
Block a user