|
@@ -1,21 +1,33 @@
|
|
|
<template>
|
|
|
<div v-loading="loading" class="data-restore-container">
|
|
|
- <el-button size="small" type="primary" icon="el-icon-document-copy" @click="handleBackUp">数据备份</el-button>
|
|
|
- <el-button size="small" type="danger" icon="el-icon-refresh" @click="handleRestore">数据恢复</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-document-copy"
|
|
|
+ @click="handleBackUp"
|
|
|
+ >数据备份</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ @click="handleRestore"
|
|
|
+ >数据恢复</el-button
|
|
|
+ >
|
|
|
<div class="upload-div">
|
|
|
<el-upload
|
|
|
- class="txt-center"
|
|
|
- :action="uploadUrl"
|
|
|
- accept=".txt"
|
|
|
- :limit="3"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="uploadSuccess"
|
|
|
- :on-error="uploadFail"
|
|
|
+ class="txt-center"
|
|
|
+ :action="uploadUrl"
|
|
|
+ accept=".txt"
|
|
|
+ :limit="3"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :on-error="uploadFail"
|
|
|
>
|
|
|
- <el-button ref="folderInput" size="small" type="primary" >点击上传</el-button>
|
|
|
- <div slot="tip" class="el-upload__tip">
|
|
|
- 请上传.txt类型的文件
|
|
|
- </div>
|
|
|
+ <el-button ref="folderInput" size="small" type="primary"
|
|
|
+ >点击上传</el-button
|
|
|
+ >
|
|
|
+ <div slot="tip" class="el-upload__tip">请上传.txt类型的文件</div>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -49,11 +61,12 @@ export default {
|
|
|
console.log('response:', response)
|
|
|
console.log('-------------data Restore end ---------------')
|
|
|
console.log('')
|
|
|
- this.$alert(response.data, '数据备份成功', {
|
|
|
+ const alert_content = `<p style="word-break: break-all">${response.data}</p>`
|
|
|
+ // const alert_content = response.data
|
|
|
+ this.$alert(alert_content, '数据备份成功', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: () => {
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ customClass: 'msgBox',
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
})
|
|
|
}, () => {
|
|
|
this.loading = false;
|
|
@@ -118,6 +131,9 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.msgBox {
|
|
|
+ width: 500px;
|
|
|
+}
|
|
|
.data-restore-container {
|
|
|
width: 100%;
|
|
|
height: 240px;
|