NEZ-1779 fix : 恢复和删除接口功能实现
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
<div class="col-resize-area"></div>
|
||||
</template>
|
||||
<template slot-scope="scope" :column="item">
|
||||
<span v-if="item.prop === 'repeat'">
|
||||
{{ tableData[0].schedule && tableData[0].schedule.repeat }}
|
||||
<span v-if="item.prop === 'schedule'">
|
||||
{{ tableData[0].schedule && changeType(tableData[0].schedule.type)? changeType(tableData[0].schedule.type):''}}
|
||||
</span>
|
||||
<span v-if="item.prop === 'retention'">
|
||||
{{ tableData[0].retention }}
|
||||
@@ -113,15 +113,37 @@ export default {
|
||||
|
||||
|
||||
methods: {
|
||||
changeType(item){
|
||||
if(item == 1){
|
||||
return this.$t('backup.only')
|
||||
}else if(item ==2){
|
||||
return this.$t('backup.Daily')
|
||||
|
||||
}else if(item == 3 ){
|
||||
return this.$t('backup.Weekly')
|
||||
|
||||
}else{
|
||||
return this.$t('backup.Monthly')
|
||||
|
||||
}
|
||||
},
|
||||
Restore(row){
|
||||
put('/sys/backup/restore',{filename:row.fileName}).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.$emit('getTableData','backup')
|
||||
this.$emit("getTableData",'recent')
|
||||
}else {
|
||||
this.$message.error(response.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
del(item){
|
||||
console.log(item);
|
||||
del(row){
|
||||
this.$delete('/sys/backup?filename='+row.fileName).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.$emit("getTableData",'recent')
|
||||
}else {
|
||||
this.$message.error(response.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
changeDate(item){
|
||||
let time =Date.parse(item)
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
ref="backupsTable1"
|
||||
:custom-table-title="customTableTitle"
|
||||
:is-configurations="true"
|
||||
@edit="edit"
|
||||
:table-data="tableData"
|
||||
@edit="edit"
|
||||
|
||||
>
|
||||
</backups-table>
|
||||
</template>
|
||||
@@ -38,6 +39,7 @@
|
||||
:is-configurations="false"
|
||||
key="backups2"
|
||||
:table-data2="tableData2"
|
||||
@getTableData="getTableData"
|
||||
|
||||
>
|
||||
</backups-table>
|
||||
@@ -62,9 +64,9 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
url: '/sys/backup/list',
|
||||
url: '/sys/backup',
|
||||
customTableTitle: [
|
||||
{ label: this.$t('backup.schedule'), prop: 'repeat' },
|
||||
{ label: this.$t('backup.schedule'), prop: 'schedule' },
|
||||
{ label: this.$t('backup.backupRetention'), prop: 'retention' },
|
||||
{ label: this.$t('backup.last'), prop: 'last' },
|
||||
{ label: this.$t('backup.Enable'), prop: 'state' }
|
||||
@@ -107,6 +109,7 @@ export default {
|
||||
methods: {
|
||||
|
||||
getTableData (item) {
|
||||
console.log(item);
|
||||
if(!item){
|
||||
this.$get('/sys/backup').then((res) => {
|
||||
if (res.code === 200) {
|
||||
@@ -149,6 +152,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(this.tableData);
|
||||
},
|
||||
edit (row) {
|
||||
this.object = { ...row ,
|
||||
|
||||
Reference in New Issue
Block a user