1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<div class="common-page qyzz page-t1">
<el-row>
<el-button type="primary" @click="bakDatabase">备份数据库</el-button>
</el-row>
</div>
</template>
<script>
import { reqApi, Config } from '@/assets/js/httpApi.js';
import { Tools } from '@/assets/js/common.js';
export default {
name: 'Dashboard',
components: {
},
data() {
return {
Dict:{selectList:[]},
table:{
page: 1,
size: 10,
total: 0,
loading: false,
dataList:[],
},
rules: {},
form: {
title:'', visible:false, reqType:'add', historyDialog:false,
status:{cu:0},
query:{},
search:{},
item:{},
file:0,
},
}
},
mounted() {
var that = this;
// 获取基本信息
this.pageApi = Config.getModuleInfo(this);
},
methods: {
bakDatabase() {
this.$confirm('数据库备份时间较长,您确定要继续吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
var loadingText = '数据备份中,请等待';
var loading = this.$loading({
lock: true,
text: loadingText,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
var i = 0;
var timerA = new qf.Async.intervalLoop(1500, function(){
i %= 6;
var spots = new Array(i+2).join('.');
loading.text = loadingText + spots;
i++
});
this.pageApi.backupDatabase({}).then((res)=>{
timerA.clear();
loading.close();
if(res.code === 200){
this.$notify({
title: '备份成功!',
type: 'success',
duration: 2500
});
};
});
})
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scope>
</style>