<template>
|
<div class="all">
|
<div class="backup-content">
|
<div class="backup-center" ref="left">
|
<div class="menu-item" @click="openRight(0)">
|
<div class="con">
|
<span class="icon iconfont"></span>
|
<span class="menu-text">自动备份设置</span>
|
</div>
|
</div>
|
<div class="menu-item" @click="openRight(1)">
|
<div class="con">
|
<span class="icon iconfont"></span>
|
|
<span class="menu-text">从备份中恢复</span>
|
</div>
|
</div>
|
</div>
|
<div class="backup-right">
|
<div class="auto" v-if="activePage == 0">
|
<div class="bar">
|
<div class="name">自动备份</div>
|
<el-switch
|
v-model="isBackUp"
|
active-color="rgba(61, 104, 225, 1)"
|
@change="switchChange"
|
>
|
</el-switch>
|
</div>
|
<div class="bar">
|
<div class="name">备份目录</div>
|
<input type="file" id="file_input" webkitdirectory directory />
|
</div>
|
<div class="bar">
|
<div class="name">备份间隔 / 天</div>
|
<el-input
|
v-model="interval"
|
:placeholder="'请输入天数'"
|
@change="handleChange"
|
size="small"
|
></el-input>
|
<!-- :controls="false" -->
|
</div>
|
<div class="bar">
|
<div class="name">备份数据保存时间 / 天</div>
|
<el-input
|
v-model="lifeSpan"
|
placeholder="请输入天数"
|
@change="handleChange"
|
size="small"
|
></el-input>
|
</div>
|
<div class="bar">
|
<div class="name">自动备份</div>
|
<el-button type="primary" size="small" @click="backUpNow"
|
>立即备份</el-button
|
>
|
</div>
|
</div>
|
<div class="recover" v-if="activePage == 1">
|
<div class="title">显示备份的文件范围:{{ 5 }}</div>
|
|
<div class="table-head">
|
<span class="line1">自动备份时间</span>
|
<span class="line1">备份文件名称</span>
|
<span class="line2">操作</span>
|
</div>
|
|
<div class="bar" v-for="(item, i) in fileList" :key="i">
|
<span class="time">{{ item.time }}</span>
|
<span class="time">{{ item.name }}</span>
|
<span class="operation">恢复</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
mounted() {},
|
data() {
|
return {
|
langList: [
|
{ name: "简体中文" },
|
{ name: "英文" },
|
{ name: "繁体中文(香港)" },
|
],
|
fileList: [
|
{ time: "2010-10-02 12:30:09", name: "文件1" },
|
{ time: "2010-10-02 12:30:09", name: "文件12121212121" },
|
{ time: "2010-10-02", name: "文件2211" },
|
{ time: "2011", name: "备份文件2" },
|
],
|
activePage: 0,
|
interval: "",
|
lifeSpan: "",
|
options: [
|
{
|
value: "选项1",
|
label: "手动",
|
},
|
{
|
value: "选项2",
|
label: "自动",
|
},
|
],
|
isBackUp: true,
|
};
|
},
|
methods: {
|
openRight(typ) {
|
const es = document.getElementsByClassName("menu-item");
|
es[this.activePage].style.backgroundColor = "#f8f8f8";
|
es[this.activePage].style.color = "rgba(54, 54, 54, 1)";
|
es[typ].style.backgroundColor = "rgba(61, 104, 225, 1)";
|
es[typ].style.color = "#fff";
|
this.activePage = typ;
|
},
|
handleChange() {},
|
backUpNow() {
|
this.$confirm("您是否确认立即备份所有应用的配置数据?", "立即备份", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
}).then(() => {
|
this.$message({
|
type: "success",
|
message: "备份成功",
|
});
|
});
|
// .then((resp) => {
|
// if (resp.success) {
|
// this.$message({
|
// type: "success",
|
// message: "删除数据成功",
|
// });
|
// this.loading = false;
|
// }
|
// })
|
// .catch((err) => {
|
// this.$message({
|
// type: "error",
|
// message: "删除数据失败!",
|
// });
|
// this.loading = false;
|
// });
|
},
|
switchChange(val) {
|
console.log(val);
|
},
|
},
|
};
|
</script>
|
<style lang="scss">
|
.all {
|
width: 100%;
|
}
|
|
.backup-content {
|
height: 100%;
|
display: flex;
|
flex-direction: row;
|
flex: 1;
|
flex-basis: auto;
|
box-sizing: border-box;
|
.backup-center {
|
height: 100%;
|
width: 280px;
|
overflow: auto;
|
box-sizing: border-box;
|
flex-shrink: 0;
|
padding: 10px;
|
border-right: 5px solid #f8f8f8;
|
.menu-item {
|
background-color: #f8f8f8;
|
height: 50px;
|
margin-bottom: 10px;
|
border-radius: 8px;
|
line-height: 50px;
|
box-sizing: border-box;
|
font-size: 14px;
|
cursor: pointer;
|
padding: 0 20px;
|
display: flex;
|
justify-content: space-between;
|
.con {
|
.iconfont {
|
margin-right: 10px;
|
}
|
.menu-text {
|
font-size: 15px;
|
}
|
}
|
}
|
}
|
.backup-right {
|
flex: 1;
|
flex-basis: auto;
|
overflow: auto;
|
box-sizing: border-box;
|
position: relative;
|
padding: 20px 40px;
|
.el-form-item.is-required:not(.is-no-asterisk)
|
> .el-form-item__label:before,
|
.el-form-item.is-required:not(.is-no-asterisk)
|
.el-form-item__label-wrap
|
> .el-form-item__label:before {
|
display: none;
|
}
|
.el-select {
|
width: 100%;
|
}
|
.el-form-item {
|
margin-bottom: 10px;
|
height: 50px;
|
background: #f8f8f8;
|
padding: 4px 20px;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
border-radius: 10px;
|
.el-form-item__label {
|
text-align: left;
|
line-height: 42px;
|
}
|
}
|
.el-form-item__content {
|
line-height: 40px;
|
position: relative;
|
font-size: 14px;
|
}
|
.ip-input-container {
|
max-width: none !important;
|
}
|
.auto {
|
.bar {
|
display: flex;
|
align-items: center;
|
height: 50px;
|
padding: 0 25px;
|
background-color: #f8f8f8;
|
justify-content: space-between;
|
border-radius: 12px;
|
margin-bottom: 10px;
|
.name {
|
font-size: 15px;
|
text-align: left;
|
min-width: 180px;
|
}
|
.el-input {
|
width: 100%;
|
.el-input {
|
height: auto;
|
}
|
.el-input__inner {
|
border: none;
|
border-radius: 8px;
|
background-color: rgba(240, 240, 240, 1);
|
text-align: left;
|
}
|
}
|
}
|
}
|
.recover {
|
.title {
|
font-size: 13px;
|
color: #868686;
|
text-align: left;
|
padding: 0 10px;
|
margin-bottom: 10px;
|
}
|
.table-head {
|
height: 30px;
|
line-height: 30px;
|
display: flex;
|
// justify-content: space-between;
|
box-sizing: border-box;
|
font-size: 15px;
|
padding: 0 10px;
|
margin-bottom: 5px;
|
.line1 {
|
flex: 4;
|
text-align: left;
|
}
|
.line2 {
|
flex: 1;
|
text-align: right;
|
}
|
}
|
.bar {
|
height: 40px;
|
background-color: rgba(248, 248, 248, 1);
|
display: flex;
|
box-sizing: border-box;
|
padding: 0 10px;
|
align-items: center;
|
border-radius: 8px;
|
color: #797979;
|
font-size: 14px;
|
margin-bottom: 10px;
|
.time {
|
width: 45%;
|
text-align: left;
|
}
|
.operation {
|
color: rgba(26, 115, 232, 1);
|
cursor: pointer;
|
width: 10%;
|
text-align: right;
|
}
|
}
|
}
|
.save-btn {
|
background-color: #3d68e1;
|
width: 240px;
|
height: 40px;
|
margin: 0 auto;
|
border-radius: 10px;
|
color: #fff;
|
line-height: 40px;
|
font-size: 14px;
|
margin-top: 20px;
|
}
|
}
|
}
|
</style>
|