fix : 修复save无法刷新界面问题 修改一些样式

This commit is contained in:
zhangxiaolong
2022-04-08 16:39:36 +08:00
parent 8efcb56f34
commit 474b60dce2
3 changed files with 51 additions and 35 deletions

View File

@@ -35,6 +35,16 @@
} }
} }
} }
.check-month_box{
.el-form-item__content{
.el-checkbox-button{
width: calc(100% / 7);
.el-checkbox-button__inner{
width: 100%;
}
}
}
}
.start_at{ .start_at{
.el-form-item__content{ .el-form-item__content{
.el-date-editor--date{ .el-date-editor--date{

View File

@@ -126,42 +126,48 @@ export default {
mounted () { mounted () {
this.getTableData() this.getTableData()
this.monitoring()
}, },
methods: { methods: {
monitoring () { async getTableData (item) {
this.$on('getData', (res) => { if(!item){
console.log('getdata') await get('/sys/backup').then((res) => {
this.getTableData() if (res.code === 200) {
this.$forceUpdate(); if (res.data) {
// window.location.reload() this.tableData[0].retention = res.data.retention
}) this.tableData[0].state = res.data.state
}, this.switchStatus = res.data.state === 1
async getTableData () { for (const i in res.data.schedule) {
await get('/sys/backup').then((res) => { this.tableData[0].schedule[i] = res.data.schedule[i]
if (res.code === 200) { }
if (res.data) { }
this.tableData[0].retention = res.data.retention }
this.tableData[0].state = res.data.state })
this.switchStatus = res.data.state === 1 await post('/sys/backup/list').then((res) => {
for (const i in res.data.schedule) { if (res.code === 200) {
this.tableData[0].schedule[i] = res.data.schedule[i] if (res.data) {
} for (const i in res.data) {
} this.tableData2[i].fileName = res.data[i].fileName
this.tableData2[i].size = bus.getNumStr(res.data[i].size)
this.tableData2[i].time = res.data[i].time
}
}
}
})
}else{
await get('/sys/backup').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData[0].retention = res.data.retention
this.tableData[0].state = res.data.state
this.switchStatus = res.data.state === 1
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
}
}
})
} }
})
await post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
for (const i in res.data) {
this.tableData2[i].fileName = res.data[i].fileName
this.tableData2[i].size = bus.getNumStr(res.data[i].size)
this.tableData2[i].time = res.data[i].time
}
}
}
})
}, },
backupNow (item) { backupNow (item) {
post('/sys/backup').then((res) => { post('/sys/backup').then((res) => {

View File

@@ -11,7 +11,7 @@
> >
<template v-slot="slotProps"> <template v-slot="slotProps">
<backups-table <backups-table
ref="backupsTable" ref="backupsTable1"
:custom-table-title="customTableTitle" :custom-table-title="customTableTitle"
:is-configurations="true" :is-configurations="true"
:is-state ='isState' :is-state ='isState'
@@ -33,7 +33,7 @@
> >
<template v-slot="slotProps"> <template v-slot="slotProps">
<backups-table <backups-table
ref="backupsTable" ref="backupsTable2"
:custom-table-title="customTableTitle2" :custom-table-title="customTableTitle2"
:is-configurations="false" :is-configurations="false"
> >
@@ -111,7 +111,7 @@ export default {
}, },
closeRightBox (refresh) { closeRightBox (refresh) {
if (refresh) { if (refresh) {
this.$refs.backupsTable.$emit('getData') this.$refs.backupsTable1.getTableData('backupsTable1')
} }
this.rightBoxshow = false this.rightBoxshow = false
}, },