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,19 +126,11 @@ 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')
this.getTableData()
this.$forceUpdate();
// window.location.reload()
})
},
async getTableData () {
await get('/sys/backup').then((res) => { await get('/sys/backup').then((res) => {
if (res.code === 200) { if (res.code === 200) {
if (res.data) { if (res.data) {
@@ -162,6 +154,20 @@ export default {
} }
} }
}) })
}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]
}
}
}
})
}
}, },
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
}, },