|
@@ -3,7 +3,7 @@
|
|
|
* @Author: Rockery
|
|
|
* @Date: 2022-01-04 10:37:17
|
|
|
* @LastEditors: Rockery
|
|
|
- * @LastEditTime: 2022-02-18 16:53:44
|
|
|
+ * @LastEditTime: 2022-03-03 10:52:10
|
|
|
* @FilePath: \party_construct_web\src\components\PartyMemberDetails\index.vue
|
|
|
* @Copyright: Copyright (c) 2016~2021 Rockery(1113269755@qq.com)
|
|
|
-->
|
|
@@ -77,11 +77,11 @@
|
|
|
<template v-if="viewFullPartyInfoObj.resume">
|
|
|
<div
|
|
|
class="basic-info-fourth-info"
|
|
|
- @click="handleViewPageCheckClick(viewFullPartyInfoObj.resume, 'pdf文件')"
|
|
|
+ @click="handleViewPageCheckClick(viewFullPartyInfoObj.resume, '党员详细资料-本人简历(包括学历)')"
|
|
|
>查看</div>
|
|
|
<div
|
|
|
class="basic-info-fourth-info"
|
|
|
- @click="handleViewPageDownloadClick(viewFullPartyInfoObj.resume, 'pdf文件')"
|
|
|
+ @click="handleViewPageDownloadClick(viewFullPartyInfoObj.resume, '党员详细资料-本人简历(包括学历)')"
|
|
|
>下载</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
@@ -93,11 +93,11 @@
|
|
|
<template v-if="viewFullPartyInfoObj.other">
|
|
|
<div
|
|
|
class="basic-info-fourth-info"
|
|
|
- @click="handleViewPageCheckClick(viewFullPartyInfoObj.other, 'pdf文件')"
|
|
|
+ @click="handleViewPageCheckClick(viewFullPartyInfoObj.other, '党员详细资料-其他情况')"
|
|
|
>查看</div>
|
|
|
<div
|
|
|
class="basic-info-fourth-info"
|
|
|
- @click="handleViewPageDownloadClick(viewFullPartyInfoObj.other, 'pdf文件')"
|
|
|
+ @click="handleViewPageDownloadClick(viewFullPartyInfoObj.other, '党员详细资料-其他情况')"
|
|
|
>下载</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
@@ -416,6 +416,22 @@
|
|
|
:dialog-title="viewPdfFileObj.fileName"
|
|
|
:pdfUrl="viewPdfFileObj.filePath"
|
|
|
></roc-vue-pdf-dialog>
|
|
|
+
|
|
|
+ <!-- 图片 文件预览对话框 -->
|
|
|
+ <roc-vue-img-dialog
|
|
|
+ v-if="imgDialogVisible"
|
|
|
+ :visible.sync="imgDialogVisible"
|
|
|
+ :dialog-title="viewImgFileObj.fileName"
|
|
|
+ :img-url="viewImgFileObj.filePath"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- PDF 文件预览对话框 -->
|
|
|
+ <roc-vue-pdf-dialog
|
|
|
+ v-if="pdfDialogVisible"
|
|
|
+ :visible.sync="pdfDialogVisible"
|
|
|
+ :dialog-title="viewPdfFileObj.fileName"
|
|
|
+ :pdf-url="viewPdfFileObj.filePath"
|
|
|
+ ></roc-vue-pdf-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -431,6 +447,7 @@ import { regularDownloadPdfFile } from "@/utils/rockeryutil";
|
|
|
export default {
|
|
|
name: "Partymemberdetails",
|
|
|
components: {
|
|
|
+ 'roc-vue-img-dialog': () => import('@/components/RocVueImgDialog'),
|
|
|
'roc-vue-pdf-dialog': () => import('@/components/RocVuePdfDialog')
|
|
|
},
|
|
|
props: {
|
|
@@ -447,12 +464,14 @@ export default {
|
|
|
viewFullPartyInfoObj: {
|
|
|
thoughtReportRecord: []
|
|
|
},
|
|
|
- viewPdfFileObj: {},
|
|
|
- pdfDialogVisible: false,
|
|
|
tabsEleObjList: [...EleObjArr],
|
|
|
nodeDataObj: { ...NodeDataObj },
|
|
|
atStageNodeDataObj: { ...AtStageNodeDataObj },
|
|
|
- viewPdfFileUrlPrefix: `${window.origin}${process.env.VUE_APP_FILE_VIEW_API}`
|
|
|
+ viewPdfFileUrlPrefix: `${window.origin}${process.env.VUE_APP_FILE_VIEW_API}`,
|
|
|
+ pdfDialogVisible: false,
|
|
|
+ viewPdfFileObj: {},
|
|
|
+ imgDialogVisible: false,
|
|
|
+ viewImgFileObj: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -576,20 +595,39 @@ export default {
|
|
|
/**
|
|
|
* PDF文件查看按钮事件
|
|
|
*/
|
|
|
- handleViewPageCheckClick(pdfFilePath, pdfFileName = 'pdf-file') {
|
|
|
+ handleViewPageCheckClick(pdfFilePath, pdfFileName = '查看文件') {
|
|
|
if (!pdfFilePath) return;
|
|
|
+
|
|
|
+ // 获取文件类型
|
|
|
+ const fileIndex = pdfFilePath.toString().lastIndexOf(".");
|
|
|
+ const fileType = pdfFilePath.toString().substr(fileIndex + 1);
|
|
|
+
|
|
|
+ // 组装文件访问地址
|
|
|
const filePath = `${window.origin}${process.env.VUE_APP_FILE_VIEW_API}${pdfFilePath}`;
|
|
|
- const fileName = `${pdfFileName}-PDF文件预览`;
|
|
|
- this.viewPdfFileObj = {
|
|
|
- filePath,
|
|
|
- fileName
|
|
|
- };
|
|
|
- this.pdfDialogVisible = true;
|
|
|
+
|
|
|
+ // 判断文件类型
|
|
|
+ if (['jpg', 'png'].includes(fileType)) { // Img文件
|
|
|
+ const fileName = '图片文件预览';
|
|
|
+ this.viewImgFileObj = {
|
|
|
+ filePath,
|
|
|
+ fileName
|
|
|
+ };
|
|
|
+ this.imgDialogVisible = true;
|
|
|
+ } else if (['pdf'].includes(fileType)) { // PDF文件
|
|
|
+ const fileName = 'PDF文件预览';
|
|
|
+ this.viewPdfFileObj = {
|
|
|
+ filePath,
|
|
|
+ fileName
|
|
|
+ };
|
|
|
+ this.pdfDialogVisible = true;
|
|
|
+ } else { // 不符合类型文件
|
|
|
+ return;
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* PDF文件下载按钮事件
|
|
|
*/
|
|
|
- handleViewPageDownloadClick(pdfFilePath, pdfFileName = 'pdf-file') {
|
|
|
+ handleViewPageDownloadClick(pdfFilePath, pdfFileName = '下载文件') {
|
|
|
if (!pdfFilePath) return;
|
|
|
regularDownloadPdfFile(`${window.origin}${process.env.VUE_APP_FILE_VIEW_API}${pdfFilePath}`, pdfFileName);
|
|
|
},
|