fix : 备份页面组件修改 样式修改
This commit is contained in:
@@ -1,50 +1,105 @@
|
|||||||
.right-box{
|
.right-box{
|
||||||
|
|
||||||
.right-box__container{
|
.right-box__container{
|
||||||
|
.form-item__switch{
|
||||||
|
text-align: unset !important;
|
||||||
|
}
|
||||||
.container__form{
|
.container__form{
|
||||||
.el-tabs--card>.el-tabs__header{
|
.form-tabs{
|
||||||
.el-tabs__nav{
|
|
||||||
width: 100%;
|
.el-tabs--card>.el-tabs__header{
|
||||||
> div{
|
.el-tabs__nav{
|
||||||
width: 25%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
> div{
|
||||||
text-align: center;
|
width: 25%;
|
||||||
padding: 0!important;
|
box-sizing: border-box;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
||||||
.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
color: $--color-primary;
|
||||||
color: $--color-primary;
|
border: 1px solid $--color-primary;
|
||||||
border: 1px solid $--color-primary;
|
|
||||||
|
}
|
||||||
}
|
.el-tabs--card>.el-tabs__header .el-tabs__item{
|
||||||
.el-tabs--card>.el-tabs__header .el-tabs__item{
|
border-bottom: 1px solid $--border-color-light ;
|
||||||
border-bottom: 1px solid $--border-color-light ;
|
|
||||||
|
}
|
||||||
}
|
.el-tabs--card>.el-tabs__content{
|
||||||
.el-tabs--card>.el-tabs__content{
|
display: none;
|
||||||
display: none;
|
}
|
||||||
}
|
}
|
||||||
.check_box{
|
.check_box{
|
||||||
|
|
||||||
.el-form-item__content{
|
.el-form-item__content{
|
||||||
|
text-align: unset !important;
|
||||||
|
|
||||||
.el-checkbox-button{
|
.el-checkbox-button{
|
||||||
width: calc(100% / 7);
|
width: calc(100% / 7);
|
||||||
.el-checkbox-button__inner{
|
.el-checkbox-button__inner{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 11px 3px;
|
padding: 11px 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.el-checkbox-button .is-focus {
|
||||||
|
.el-checkbox-button__inner{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.check-month_box{
|
.check-month_box{
|
||||||
.el-form-item__content{
|
.el-form-item__content{
|
||||||
.el-checkbox-button{
|
.el-checkbox-button{
|
||||||
width: calc(100% / 7);
|
border: 1px solid $--border-color-base;
|
||||||
|
width: calc((100% / 7) - 2px);
|
||||||
.el-checkbox-button__inner{
|
.el-checkbox-button__inner{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.el-checkbox-button .is-checked{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.el-checkbox-button .is-focus{
|
||||||
|
border: 1px solid $--border-color-base;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// .el-checkbox-button:nth-of-type(8){
|
||||||
|
// border-left: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(15){
|
||||||
|
// border-left: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(22){
|
||||||
|
// border-left: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(29){
|
||||||
|
// border-left: 1px solid $--border-color-base;
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(26){
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(27){
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(28){
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(30){
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:nth-of-type(31){
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
|
// .el-checkbox-button:last-of-type{
|
||||||
|
// border-bottom: 1px solid $--border-color-base;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
.start_at{
|
.start_at{
|
||||||
.el-form-item__content{
|
.el-form-item__content{
|
||||||
@@ -57,4 +112,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,39 +1,54 @@
|
|||||||
|
.backups-table{
|
||||||
.nz-table2 {
|
.nz-table2 {
|
||||||
.el-table:not(.chart-table) {
|
.el-table__row{
|
||||||
.table-operation-items {
|
td:last-of-type{
|
||||||
display: flex;
|
// border-bottom: 1px solid $--border-color-light !important;
|
||||||
justify-content: center;
|
border: none !important;
|
||||||
.el-dropdown{
|
|
||||||
.table-operation-item{
|
|
||||||
width: 30px !important;
|
|
||||||
height: 30px !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.table-operation-del {
|
}
|
||||||
background: $--button-primary-color;
|
.el-table:not(.chart-table) {
|
||||||
border: 1px solid #DEDEDE;
|
.table-operation-items {
|
||||||
border-radius: 2px;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
.table-operation-button {
|
|
||||||
border: none;
|
|
||||||
background-color: $--color-primary;
|
|
||||||
color: $--button-primary-color;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: center;
|
|
||||||
line-height: 30px;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
|
||||||
height: 30px;
|
.table-operation-edit {
|
||||||
// width: 130px;
|
background: $--background-color-2;
|
||||||
max-width: 98px;
|
border: 1px solid $--border-color-base;
|
||||||
min-width: 74px;
|
border-radius: 2px;
|
||||||
padding: 0 5px 0 5px;
|
width: 22px;
|
||||||
margin-right: 10px;
|
height: 22px;
|
||||||
cursor: pointer;
|
i{
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table-operation-del{
|
||||||
|
background: $--background-color-2;
|
||||||
|
border: 1px solid $--border-color-base;
|
||||||
|
border-radius: 2px;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
i{
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table-operation-button {
|
||||||
|
border: none;
|
||||||
|
background-color: $--color-primary;
|
||||||
|
color: $--button-primary-color;
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 22px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 22px;
|
||||||
|
// width: 130px;
|
||||||
|
max-width: 98px;
|
||||||
|
min-width: 74px;
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
margin-right: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,4 +37,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.backup_box{
|
||||||
|
.el-form-item:last-of-type {
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
text-align: unset !important;
|
||||||
|
}
|
||||||
|
.nz-btn {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import vm from '../../../main'
|
import vm from '../../../main'
|
||||||
|
import lodash from 'lodash'
|
||||||
|
|
||||||
// ipv4 ip校验
|
// ipv4 ip校验
|
||||||
export function host (rule, value, callback) {
|
export function host (rule, value, callback) {
|
||||||
if (!value || value.trim() == '') {
|
if (!value || value.trim() == '') {
|
||||||
@@ -197,6 +199,15 @@ export function arrLength (rule, value, callback) { // 校验数组
|
|||||||
callback(new Error(vm.$t('validate.required')))
|
callback(new Error(vm.$t('validate.required')))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export function datePicker (rule, value, callback) { // 校验时间选择
|
||||||
|
if(value[0]&&value[1]){
|
||||||
|
callback()
|
||||||
|
}else{
|
||||||
|
callback(new Error(vm.$t('validate.required')))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export function sysObjectIdInput (rule, value, callback) {
|
export function sysObjectIdInput (rule, value, callback) {
|
||||||
const sysId = /^(\d{1,9}\.){0,}[\d]+$/
|
const sysId = /^(\d{1,9}\.){0,}[\d]+$/
|
||||||
|
|||||||
@@ -17,7 +17,11 @@
|
|||||||
label-width="120px"
|
label-width="120px"
|
||||||
ref="backupsForm"
|
ref="backupsForm"
|
||||||
>
|
>
|
||||||
<el-form-item :label="$t('backup.schedule')" prop="type">
|
<el-form-item
|
||||||
|
:label="$t('backup.schedule')"
|
||||||
|
prop="type"
|
||||||
|
class="form-tabs"
|
||||||
|
>
|
||||||
<el-tabs
|
<el-tabs
|
||||||
v-model="editBackup.type"
|
v-model="editBackup.type"
|
||||||
@tab-click="datasourceChange"
|
@tab-click="datasourceChange"
|
||||||
@@ -27,7 +31,8 @@
|
|||||||
<el-tab-pane :label="$t('backup.only')" name="1"> </el-tab-pane>
|
<el-tab-pane :label="$t('backup.only')" name="1"> </el-tab-pane>
|
||||||
<el-tab-pane :label="$t('backup.Daily')" name="2"> </el-tab-pane>
|
<el-tab-pane :label="$t('backup.Daily')" name="2"> </el-tab-pane>
|
||||||
<el-tab-pane :label="$t('backup.Weekly')" name="3"> </el-tab-pane>
|
<el-tab-pane :label="$t('backup.Weekly')" name="3"> </el-tab-pane>
|
||||||
<el-tab-pane :label="$t('backup.Monthly')" name="4"> </el-tab-pane>
|
<el-tab-pane :label="$t('backup.Monthly')" name="4">
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@@ -53,18 +58,28 @@
|
|||||||
</el-time-picker>
|
</el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('backup.Enable')"
|
:label="$t('backup.RepeatEvery')"
|
||||||
|
prop="repeat"
|
||||||
prop="status"
|
v-if="whoshow === 2 || whoshow === 3 ? true : false"
|
||||||
class="form-item__switch"
|
|
||||||
v-if="whoshow !== 2 ? true : false"
|
|
||||||
>
|
>
|
||||||
<el-switch
|
<el-input
|
||||||
class="switch"
|
v-if="whoshow === 3 ? true : false"
|
||||||
v-model="editBackup.status"
|
size="small"
|
||||||
@change="statusChange"
|
v-model="editBackup.repeat"
|
||||||
|
id="chart-box-title"
|
||||||
|
@change="inputchange"
|
||||||
>
|
>
|
||||||
</el-switch>
|
<template slot="append">{{ $t("backup.week") }}</template>
|
||||||
|
</el-input>
|
||||||
|
<el-input
|
||||||
|
v-if="whoshow === 2 ? true : false"
|
||||||
|
size="small"
|
||||||
|
v-model="editBackup.repeat"
|
||||||
|
id="chart-box-title"
|
||||||
|
@change="inputchange"
|
||||||
|
>
|
||||||
|
<template slot="append">{{ $t("backup.day") }}</template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('backup.DayOfMonth')"
|
:label="$t('backup.DayOfMonth')"
|
||||||
@@ -84,20 +99,6 @@
|
|||||||
>
|
>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
|
||||||
:label="$t('backup.backupRetention')"
|
|
||||||
|
|
||||||
prop="retention"
|
|
||||||
v-if="whoshow !== 2 ? true : false"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
maxlength="64"
|
|
||||||
size="small"
|
|
||||||
v-model="editBackup.retention"
|
|
||||||
id="chart-box-title"
|
|
||||||
@change="inputchange"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('backup.WeekOn')"
|
:label="$t('backup.WeekOn')"
|
||||||
prop="checkDay"
|
prop="checkDay"
|
||||||
@@ -117,28 +118,31 @@
|
|||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('backup.RepeatEvery')"
|
:label="$t('backup.backupRetention')"
|
||||||
prop="repeat"
|
prop="retention"
|
||||||
v-if="whoshow === 2 || whoshow === 3 ? true : false"
|
v-if="whoshow !== 2 ? true : false"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="whoshow === 3 ? true : false"
|
maxlength="64"
|
||||||
size="small"
|
size="small"
|
||||||
v-model="editBackup.repeat"
|
v-model="editBackup.retention"
|
||||||
id="chart-box-title"
|
id="chart-box-title"
|
||||||
@change="inputchange"
|
@change="inputchange"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('backup.Enable')"
|
||||||
|
prop="status"
|
||||||
|
class="form-item__switch"
|
||||||
|
v-if="whoshow !== 2 ? true : false"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
class="switch"
|
||||||
|
v-model="editBackup.status"
|
||||||
|
@change="statusChange"
|
||||||
>
|
>
|
||||||
<template slot="append">{{$t('backup.week')}}</template>
|
</el-switch>
|
||||||
</el-input>
|
|
||||||
<el-input
|
|
||||||
v-if="whoshow === 2 ? true : false"
|
|
||||||
size="small"
|
|
||||||
v-model="editBackup.repeat"
|
|
||||||
id="chart-box-title"
|
|
||||||
@change="inputchange"
|
|
||||||
>
|
|
||||||
<template slot="append">{{$t('backup.day')}}</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -167,7 +171,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import bus from "@/libs/bus";
|
import bus from "@/libs/bus";
|
||||||
import { put } from "@/http";
|
import { put } from "@/http";
|
||||||
import { arrLength } from "@/components/common/js/validate";
|
import { arrLength, datePicker } from "@/components/common/js/validate";
|
||||||
|
import moment from "moment-timezone";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "backupsBox",
|
name: "backupsBox",
|
||||||
@@ -206,13 +211,7 @@ export default {
|
|||||||
trigger: "change",
|
trigger: "change",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
datepicker: [
|
datepicker: [{ validator: datePicker, trigger: "blur" }],
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: this.$t("validate.required"),
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
checkDays: [
|
checkDays: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -244,7 +243,15 @@ export default {
|
|||||||
],
|
],
|
||||||
checkDay: [{ validator: arrLength, trigger: "blur" }],
|
checkDay: [{ validator: arrLength, trigger: "blur" }],
|
||||||
},
|
},
|
||||||
week: [this.$t('week.Mon'),this.$t('week.Tue'),this.$t('week.Wed'),this.$t('week.Thu'),this.$t('week.Fri'),this.$t('week.Sat'),this.$t('week.Sun'),],
|
week: [
|
||||||
|
this.$t("week.Mon"),
|
||||||
|
this.$t("week.Tue"),
|
||||||
|
this.$t("week.Wed"),
|
||||||
|
this.$t("week.Thu"),
|
||||||
|
this.$t("week.Fri"),
|
||||||
|
this.$t("week.Sat"),
|
||||||
|
this.$t("week.Sun"),
|
||||||
|
],
|
||||||
month: [
|
month: [
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
@@ -326,20 +333,26 @@ export default {
|
|||||||
},
|
},
|
||||||
statusChange(item) {
|
statusChange(item) {
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
console.log(item);
|
if (item == true) {
|
||||||
if (item) {
|
|
||||||
this.editBackup.state = 1;
|
this.editBackup.state = 1;
|
||||||
this.$emit("statechange", true);
|
|
||||||
} else {
|
} else {
|
||||||
this.editBackup.state = 0;
|
this.editBackup.state = 0;
|
||||||
this.$emit("statechange", false);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
this.$refs.backupsForm.validate((valid) => {
|
this.$refs.backupsForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.editBackup.datepicker[0] = bus
|
||||||
|
.timeFormate(this.editBackup.datepicker[0])
|
||||||
|
.split(" ")[0];
|
||||||
|
|
||||||
this.editBackup.stime = this.editBackup.datepicker.join(" ");
|
this.editBackup.stime = this.editBackup.datepicker.join(" ");
|
||||||
this.editBackup.stime = this.timezoneToUtcTime(this.editBackup.stime); // 将本地时间转 utc时间
|
let offset = localStorage.getItem("nz-sys-timezone");
|
||||||
|
offset = moment.tz(offset).format("Z");
|
||||||
|
this.editBackup.stime = new Date(this.editBackup.stime).getTime();
|
||||||
|
offset = Number.parseInt(offset);
|
||||||
|
this.editBackup.stime -= offset * 60 * 60 * 1000;
|
||||||
|
|
||||||
put("/sys/backup", {
|
put("/sys/backup", {
|
||||||
state: Number(this.editBackup.state),
|
state: Number(this.editBackup.state),
|
||||||
schedule: {
|
schedule: {
|
||||||
@@ -352,7 +365,6 @@ export default {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.esc(true);
|
this.esc(true);
|
||||||
console.log(this.editBackup);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -362,7 +374,6 @@ export default {
|
|||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
datasourceChange(tab) {
|
datasourceChange(tab) {
|
||||||
console.log(tab.name);
|
|
||||||
switch (tab.name) {
|
switch (tab.name) {
|
||||||
case "2":
|
case "2":
|
||||||
this.whoshow = 2;
|
this.whoshow = 2;
|
||||||
@@ -377,8 +388,6 @@ export default {
|
|||||||
this.whoshow = 4;
|
this.whoshow = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log(this.whoshow);
|
|
||||||
console.log(this.editBackup);
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
clickOutside() {
|
clickOutside() {
|
||||||
@@ -395,8 +404,6 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(n) {
|
handler(n) {
|
||||||
// debugger
|
|
||||||
console.log(n);
|
|
||||||
this.editBackup = JSON.parse(JSON.stringify(n));
|
this.editBackup = JSON.parse(JSON.stringify(n));
|
||||||
this.editBackup.checkDay = [];
|
this.editBackup.checkDay = [];
|
||||||
this.editBackup.checkDays = [];
|
this.editBackup.checkDays = [];
|
||||||
@@ -406,7 +413,6 @@ export default {
|
|||||||
const time = stime1.split(" ");
|
const time = stime1.split(" ");
|
||||||
time[0] = stime;
|
time[0] = stime;
|
||||||
this.$set(this.editBackup, "datepicker", time);
|
this.$set(this.editBackup, "datepicker", time);
|
||||||
console.log("obj", this.editBackup);
|
|
||||||
if (this.editBackup.state == 1) {
|
if (this.editBackup.state == 1) {
|
||||||
this.editBackup.status = true;
|
this.editBackup.status = true;
|
||||||
this.$emit("statechange", true);
|
this.$emit("statechange", true);
|
||||||
@@ -494,10 +500,11 @@ export default {
|
|||||||
"editBackup.datepicker": {
|
"editBackup.datepicker": {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(n) {
|
handler(n) {
|
||||||
this.editBackup.datepicker[0] = bus.timeFormate(
|
console.log(n);
|
||||||
new Date(n[0]),
|
this.editBackup.datepicker[0] = bus
|
||||||
"YYYY-MM-DD"
|
.timeFormate(new Date(n[0]))
|
||||||
);
|
.split(" ")[0];
|
||||||
|
console.log(this.editBackup.datepicker[0]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="backups-table">
|
||||||
<el-table :data="isConfigurations ? tableData : tableData2" border>
|
<el-table :data="isConfigurations ? tableData : tableData2" border>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
class="table-column__head"
|
class="table-column__head"
|
||||||
@@ -23,10 +24,10 @@
|
|||||||
{{ tableData[0].schedule && utcTimeToTimezoneStr(tableData[0].schedule.stime) ?utcTimeToTimezoneStr(tableData[0].schedule.stime):'' }}
|
{{ tableData[0].schedule && utcTimeToTimezoneStr(tableData[0].schedule.stime) ?utcTimeToTimezoneStr(tableData[0].schedule.stime):'' }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="item.prop === 'state'">
|
<span v-if="item.prop === 'state'">
|
||||||
<el-switch class="switch" v-model="switchStatus"> </el-switch>
|
<el-switch class="switch" v-model="tableData[0].state" disabled> </el-switch>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="item.prop === 'time'">
|
<span v-if="item.prop === 'time'">
|
||||||
{{ scope.row.time ? scope.row.time : "" }}
|
{{ scope.row.time ? changeDate(scope.row.time ) : "" }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="item.prop === 'size'">
|
<span v-if="item.prop === 'size'">
|
||||||
{{ scope.row.size ? getNum(scope.row.size) : "" }}
|
{{ scope.row.size ? getNum(scope.row.size) : "" }}
|
||||||
@@ -34,7 +35,9 @@
|
|||||||
<span v-if="item.prop === 'fileName'"> {{ scope.row.fileName }} </span>
|
<span v-if="item.prop === 'fileName'"> {{ scope.row.fileName }} </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :resizable="false" fixed="right">
|
<el-table-column :resizable="false" fixed="right"
|
||||||
|
width="165px"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
slot-scope="scope"
|
slot-scope="scope"
|
||||||
class="table-operation-items"
|
class="table-operation-items"
|
||||||
@@ -43,46 +46,30 @@
|
|||||||
<button class="table-operation-button" @click="backupNow(scope.row)">
|
<button class="table-operation-button" @click="backupNow(scope.row)">
|
||||||
{{$t('backup.backupNow')}}
|
{{$t('backup.backupNow')}}
|
||||||
</button>
|
</button>
|
||||||
<el-dropdown size="medium" trigger="click" @command="tableOperation">
|
<button class="table-operation-edit" @click="edit(scope.row)">
|
||||||
<div class="table-operation-item table-operation-item--more">
|
<i class="nz-icon-gear nz-icon"></i>
|
||||||
<i class="nz-icon nz-icon-more3"></i>
|
</button>
|
||||||
</div>
|
|
||||||
<el-dropdown-menu
|
|
||||||
slot="dropdown"
|
|
||||||
class="right-box-select-top right-public-box-dropdown-top"
|
|
||||||
>
|
|
||||||
<el-dropdown-item command="edit"
|
|
||||||
><i class="nz-icon nz-icon-edit"></i
|
|
||||||
><span class="operation-dropdown-text">{{
|
|
||||||
$t("overall.edit")
|
|
||||||
}}</span></el-dropdown-item
|
|
||||||
>
|
|
||||||
<el-dropdown-item @click="tableOperation('del', scope.row)"
|
|
||||||
><i class="nz-icon nz-icon-delete"></i
|
|
||||||
><span class="operation-dropdown-text">{{
|
|
||||||
$t("overall.delete")
|
|
||||||
}}</span></el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot-scope="scope" v-else class="table-operation-items">
|
<div slot-scope="scope" v-else class="table-operation-items">
|
||||||
<button class="table-operation-button" @click="Restore(scope.row)">
|
<button class="table-operation-button" @click="Restore(scope.row)">
|
||||||
{{$t('backup.Restore')}}
|
{{$t('backup.Restore')}}
|
||||||
</button>
|
</button>
|
||||||
<button class="table-operation-del" @click="del(scope.row)">
|
<button class="table-operation-edit" @click="del(scope.row)">
|
||||||
<i class="nz-icon nz-icon-delete"></i>
|
<i class="nz-icon nz-icon-delete" style="font-size='12px'"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { get, post } from '@/http'
|
import { get, post ,put} from '@/http'
|
||||||
import lodash from 'lodash'
|
import lodash from 'lodash'
|
||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'backupsTable',
|
name: 'backupsTable',
|
||||||
mixins: [],
|
mixins: [],
|
||||||
@@ -91,11 +78,10 @@ export default {
|
|||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
customTableTitle: Array,
|
customTableTitle: Array,
|
||||||
isConfigurations: Boolean,
|
isConfigurations: Boolean,
|
||||||
isState: Boolean
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
switchStatus: true,
|
|
||||||
tableData: [
|
tableData: [
|
||||||
{
|
{
|
||||||
retention: '',
|
retention: '',
|
||||||
@@ -129,6 +115,21 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
Restore(row){
|
||||||
|
put('/sys/backup/restore',{filename:row.fileName}).then(res=>{
|
||||||
|
if(res.code == 200){
|
||||||
|
this.getTableData('backup')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
del(item){
|
||||||
|
console.log(item);
|
||||||
|
},
|
||||||
|
changeDate(item){
|
||||||
|
let time =Date.parse(item)
|
||||||
|
let time1 = this.timeFormate(time)
|
||||||
|
return time1
|
||||||
|
},
|
||||||
getNum(item){
|
getNum(item){
|
||||||
return bus.getNumStr(item)
|
return bus.getNumStr(item)
|
||||||
},
|
},
|
||||||
@@ -138,8 +139,7 @@ export default {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.tableData[0].retention = res.data.retention
|
this.tableData[0].retention = res.data.retention
|
||||||
this.tableData[0].state = res.data.state
|
this.tableData[0].state = res.data.state == 1? true :false
|
||||||
this.switchStatus = res.data.state === 1
|
|
||||||
for (const i in res.data.schedule) {
|
for (const i in res.data.schedule) {
|
||||||
this.tableData[0].schedule[i] = res.data.schedule[i]
|
this.tableData[0].schedule[i] = res.data.schedule[i]
|
||||||
}
|
}
|
||||||
@@ -154,19 +154,31 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else if(item == 'backup'){
|
||||||
await get('/sys/backup').then((res) => {
|
get('/sys/backup').then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.tableData[0].retention = res.data.retention
|
this.tableData[0].retention = res.data.retention
|
||||||
this.tableData[0].state = res.data.state
|
this.tableData[0].state = res.data.state == 1? true :false
|
||||||
this.switchStatus = res.data.state === 1
|
|
||||||
for (const i in res.data.schedule) {
|
for (const i in res.data.schedule) {
|
||||||
this.tableData[0].schedule[i] = res.data.schedule[i]
|
this.tableData[0].schedule[i] = res.data.schedule[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.$forceUpdate();
|
||||||
|
|
||||||
|
}else if(item == 'recent'){
|
||||||
|
post('/sys/backup/list').then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
if (res.data) {
|
||||||
|
this.tableData2 = res.data
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$forceUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
backupNow (item) {
|
backupNow (item) {
|
||||||
@@ -174,30 +186,12 @@ export default {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tableOperation (command) {
|
edit () {
|
||||||
if (command) {
|
|
||||||
if (command === 'edit') {
|
|
||||||
this.$emit('edit', this.tableData[0])
|
this.$emit('edit', this.tableData[0])
|
||||||
} else if (command === 'del') {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
isState: {
|
|
||||||
deep: true,
|
|
||||||
handler (n) {
|
|
||||||
this.switchStatus = n
|
|
||||||
this.tableData[0].state = n === true ? 1 : 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
switchStatus: {
|
|
||||||
deep: true,
|
|
||||||
handler (n) {
|
|
||||||
this.tableData[0].state = n === true ? 1 : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
ref="backupsTable1"
|
ref="backupsTable1"
|
||||||
:custom-table-title="customTableTitle"
|
:custom-table-title="customTableTitle"
|
||||||
:is-configurations="true"
|
:is-configurations="true"
|
||||||
:is-state ='isState'
|
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
>
|
>
|
||||||
</backups-table>
|
</backups-table>
|
||||||
@@ -42,7 +41,7 @@
|
|||||||
</nz-data-list>
|
</nz-data-list>
|
||||||
</div>
|
</div>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<backups-box v-if="rightBoxshow" :obj="object" @close="closeRightBox" @statechange='statechange'></backups-box>
|
<backups-box v-if="rightBoxshow" :obj="object" @close="closeRightBox" class="backup_box"></backups-box>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -82,12 +81,11 @@ export default {
|
|||||||
tableData2: [
|
tableData2: [
|
||||||
{
|
{
|
||||||
list: {
|
list: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
rightBoxshow: false,
|
rightBoxshow: false,
|
||||||
isState: '',
|
|
||||||
isRefresh: ''
|
isRefresh: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -117,13 +115,10 @@ export default {
|
|||||||
},
|
},
|
||||||
closeRightBox (refresh) {
|
closeRightBox (refresh) {
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
this.$refs.backupsTable1.getTableData('backupsTable1')
|
this.$refs.backupsTable1.getTableData('backup')
|
||||||
}
|
}
|
||||||
this.rightBoxshow = false
|
this.rightBoxshow = false
|
||||||
},
|
},
|
||||||
statechange (Boolean) {
|
|
||||||
this.isState = Boolean
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {}
|
watch: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user