NEZ-1779 fix : 恢复和删除接口功能实现 Lint代码

This commit is contained in:
zhangxiaolong
2022-04-12 15:03:33 +08:00
81 changed files with 3562 additions and 14915 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="system">
<div class="system-config-form system-config-backup">
<div class="system-title">{{$t('backup.configurations')}}</div>
<div class="system-title">{{ $t("backup.configurations") }}</div>
<nz-data-list
ref="dataList"
id="modelTable"
@@ -11,12 +11,11 @@
>
<template v-slot="slotProps">
<backups-table
ref="backupsTable1"
ref="backupsTable1"
:custom-table-title="customTableTitle"
:is-configurations="true"
:table-data="tableData"
@edit="edit"
>
</backups-table>
</template>
@@ -24,7 +23,7 @@
</div>
<div class="system-config-form system-config-backup">
<div class="system-title">{{$t('backup.recent')}}</div>
<div class="system-title">{{ $t("backup.recent") }}</div>
<nz-data-list
ref="dataList"
id="modelTable"
@@ -34,20 +33,24 @@
>
<template v-slot="slotProps">
<backups-table
ref="backupsTable2"
ref="backupsTable2"
:custom-table-title="customTableTitle2"
:is-configurations="false"
key="backups2"
:table-data2="tableData2"
@getTableData="getTableData"
>
</backups-table>
</template>
</nz-data-list>
</div>
<transition name="right-box">
<backups-box v-if="rightBoxshow" :obj="object" @close="closeRightBox" class="backup_box"></backups-box>
<backups-box
v-if="rightBoxshow"
:obj="object"
@close="closeRightBox"
class="backup_box"
></backups-box>
</transition>
</div>
</template>
@@ -103,62 +106,67 @@ export default {
created () {},
mounted () {
this.getTableData()
this.getTableData()
},
methods: {
getTableData (item) {
console.log(item);
if(!item){
this.$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 == 1? true :false
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
}
getTableData (item) {
if (!item) {
this.$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 == 1
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
})
this.$post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
}
})
this.$post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
} else if (item == 'backup') {
this.$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 == 1
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
})
}else if(item == 'backup'){
this.$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 == 1? true :false
for (const i in res.data.schedule) {
this.tableData[0].schedule[i] = res.data.schedule[i]
}
}
}
})
}else if(item == 'recent'){
this.$post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
}
console.log(this.tableData);
}
}
})
this.$post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
} else if (item == 'recent') {
this.$post('/sys/backup/list').then((res) => {
if (res.code === 200) {
if (res.data) {
this.tableData2 = res.data
}
}
})
}
},
edit (row) {
this.object = { ...row ,
checkDay:'',
checkDays:'',
datepicker:''
this.object = {
...row,
checkDay: '',
checkDays: '',
datepicker: ''
}
this.object.name = this.$t('backup.edit')
if (this.object.schedule) {
@@ -173,7 +181,7 @@ export default {
this.getTableData('backup')
}
this.rightBoxshow = false
},
}
},
watch: {}