yangyin
2024-08-30 4a3184a03f86dde138301f2d89ad180c0059f24d
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
<template>
    <el-card shadow="hover" :body-style="{ paddingBottom: '0' }" class="h100 right-card w100">
        <div class="bg-[#fff] mb-[10px] flex items-center">
            <el-button style="margin-left: 8px; width: 40px" text @click="handleExitFlow">
                <el-icon style="font-size: 24px !important">
                    <ArrowLeft />
                </el-icon>
            </el-button>
            <span class="text-[24px] text-[#26244c] font-[700]">{{ state.detailTitle }}</span>
        </div>
    </el-card>
</template>
 
<script setup lang="ts">
import { reactive } from 'vue';
import { useRouter } from 'vue-router';
// 定义变量内容
const state = reactive({
    detailTitle: '文档详情',
    currentFile: null, // 当前选中文件的索引
    currentFileData: null, // 当前选中文件的数据
});
const router = useRouter();
//返回
const handleExitFlow = () => {
    //是否显示返回
    router.back();
};
// 预览文件
const previewFile = (file, index) => {
    if (['.pdf', '.doc', '.docx', '.txt', '.md', '.pptx', '.ppt'].includes(file.type)) {
        state.currentFile = index;
        state.currentFileData = file;
    } else {
        // 文件类型不支持,处理错误或给出提示
    }
};
</script>
<style scoped lang="scss"></style>