|
@@ -1,41 +1,63 @@
|
|
|
<!-- 文章查看 -->
|
|
|
<template>
|
|
|
- <el-dialog width="80%" title="文章查看" v-model="dialogVisible">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <h3>{{ formData.title }}</h3>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-space>
|
|
|
- <el-tag type="primary">{{ formData.publishTime }} </el-tag>
|
|
|
- <el-tag type="success">{{ formData.publishUnit }} </el-tag>
|
|
|
- </el-space>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span=24>
|
|
|
- <el-scrollbar ref="scrollbarRef" height="400px">
|
|
|
- <div v-html="formData.content"></div>
|
|
|
- </el-scrollbar>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-dialog>
|
|
|
+ <el-dialog width="85%" title="文章查看" v-model="dialogVisible">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <h3>{{ formData.title }}</h3>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-space>
|
|
|
+ <el-tag type="primary">{{ formData.publishTime }} </el-tag>
|
|
|
+ <el-tag type="success">{{ formData.publishUnit }} </el-tag>
|
|
|
+ </el-space>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div v-if="formData.attachLinks&&formData.attachLinks.length > 0">
|
|
|
+ <el-divider>附件</el-divider>
|
|
|
+ <el-row v-for="(item, name, index) in formData.attachLinks" :key="index">
|
|
|
+ <el-descriptions :title="item.title" direction="vertical" :column="5" border>
|
|
|
+ <el-descriptions-item label="下载">下载</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="文件名">{{ item.fileName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="类型">{{ item.fileType }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="大小">{{ item.fileSize }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="路径">{{ item.filePath }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <el-row>
|
|
|
+ <el-divider>正文</el-divider>
|
|
|
+ <el-col :span=24>
|
|
|
+ <el-scrollbar ref="scrollbarRef" height="300px">
|
|
|
+ <div v-html="formData.content"></div>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, defineExpose } from 'vue';
|
|
|
const dialogVisible = ref(false)
|
|
|
+const scrollbarRef = ref(null)
|
|
|
|
|
|
-const scrollTop=()=>{
|
|
|
- scrollbarRef.wrap.scrollTop = 0
|
|
|
+const scrollTop = () => {
|
|
|
+ //scrollbarRef.wrap.scrollTop = 0
|
|
|
}
|
|
|
//
|
|
|
const formData = ref({})
|
|
|
//这里是重点
|
|
|
defineExpose({
|
|
|
- formData,
|
|
|
- dialogVisible,
|
|
|
- scrollTop
|
|
|
+ formData,
|
|
|
+ dialogVisible,
|
|
|
+ scrollTop
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep {
|
|
|
+ .el-descriptions__cell {
|
|
|
+ white-space: pre-wrap;
|
|
|
+ word-break: break-word;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|