|
@@ -0,0 +1,88 @@
|
|
|
+<template>
|
|
|
+ <!-- 报告输出弹窗 fullscreen -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="myMission"
|
|
|
+ title="报告输出"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="70%"
|
|
|
+ height="60%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <template slot="title">
|
|
|
+ <div class="dialogTitle">
|
|
|
+ <div class="dialogTitleIcon"></div>
|
|
|
+ 报告输出
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <FilePreView ref="filePreview2" />
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+/**
|
|
|
+ * 底部菜单(报告输出)组件
|
|
|
+ * @author: LiuMengxiang
|
|
|
+ * @Date: 2022年12月7日
|
|
|
+ */
|
|
|
+import FilePreView from "../FilePreView.vue";
|
|
|
+export default {
|
|
|
+ name: "ReportOutput",
|
|
|
+ components: { FilePreView },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 报告输出弹窗显示状态
|
|
|
+ dialogVisible: false,
|
|
|
+ filePath: "./static/word/test.docx"
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // 报告输出事件监听
|
|
|
+ this.$bus.$on("ReportOutput", () => {
|
|
|
+ this.changeShowBottomMenusStatus();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ destroy() {
|
|
|
+ // 当容器销毁时,需要停止监听该事件
|
|
|
+ this.$bus.$off("ReportOutput");
|
|
|
+ },
|
|
|
+ props: [],
|
|
|
+ methods: {
|
|
|
+ // 当用户点击svg底座时,切换底部菜单显示隐藏状态。
|
|
|
+ changeShowBottomMenusStatus() {
|
|
|
+ // 打开弹窗
|
|
|
+ this.dialogVisible = true;
|
|
|
+ // 判断是否存在文件,存在的话自动请求文件并渲染
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.filePath) {
|
|
|
+ this.$refs.filePreview2.showView(this.filePath);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.$ifMenu("3", "")) {
|
|
|
+ this.$emit("changeShowBottomMenusStatus", false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 弹窗关闭询问
|
|
|
+ handleClose() {
|
|
|
+ if (this.dialogVisible) {
|
|
|
+ this.$confirm("确认关闭?")
|
|
|
+ .then(_ => {
|
|
|
+ this.clearDialogVisible();
|
|
|
+ })
|
|
|
+ .catch(_ => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 报告输出取消
|
|
|
+ clearDialogVisible() {
|
|
|
+ // 关闭弹窗
|
|
|
+ this.dialogVisible = false;
|
|
|
+ // 删除文件预览
|
|
|
+ this.$refs.filePreview2.cancel();
|
|
|
+ // 修改父级菜单变量(弹窗显示状态和显示底部菜单)
|
|
|
+ if (this.$ifMenu("3", "")) {
|
|
|
+ this.$emit("changeShowBottomMenusStatus", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {}
|
|
|
+};
|
|
|
+</script>
|