zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
    <!-- 还原文件对话框 -->
    <el-dialog
        title="还原文件"
        :visible.sync="visible"
        :close-on-click-modal="false"
        width="550px"
        @open="handleDialogOpen"
        @close="handleDialogClose"
    >
        <div class="restore-text">
            <i class="el-icon-loading"></i> 正在还原文件,请稍等片刻...
        </div>
    </el-dialog>
</template>
 
<script>
//import { restoreRecoveryFile } from '_r/file.js'
import {
  deleteAction,
  getAction,
  postAction,
  downFile,
  getFileAccessHttpUrl, getDeskDownloadHttpUrl
} from '@/api/manage'
export default {
    name: 'DeleteFileDialog',
    data() {
        return {
            visible: false //  对话框是否可见
        }
    },
    methods: {
        /**
         * 还原文件对话框 | 对话框打开的回调
         * @description 调用还原文件接口
         */
        handleDialogOpen() {
            postAction('/recoveryfile/restorefile', {
                deleteBatchNum: this.deleteBatchNum,
                filePath: this.filePath
            }).then((res) => {
                if (res.success) {
                    this.$message.success('文件已还原')
                    this.visible = false
                    this.callback('confirm')
                } else {
                    this.$message.error(res.message)
                }
            })
        },
        /**
         * 还原文件对话框 | 对话框关闭的回调
         * @description 关闭对话框,重置表单
         */
        handleDialogClose() {
            this.visible = false
            this.callback('cancel')
        }
    }
}
</script>
 
<style lang="less" scoped>
.restore-text {
  padding: 40px 0 64px 0;
    text-align: center;
}
</style>