!160 图片预览

Merge pull request !160 from 德仔/develop
This commit is contained in:
德仔 2021-03-23 15:08:01 +08:00 committed by Gitee
commit af7c5f9588
2 changed files with 222 additions and 264 deletions

View File

@ -36,13 +36,15 @@
/> />
<div v-else> <div v-else>
<span :style="{ color: '#8c8c8c' }">{{ con.title }}:</span> <span :style="{ color: '#8c8c8c' }">{{ con.title }}:</span>
<el-button <el-image
v-if="data[con.value]" title="点击大图预览"
type="text" fit="contain"
size="mini" style="width: auto; height: 80px"
@click="handleOnPreviewClick(data[con.value])" :src="`${window.location.origin}${data[con.value]}`"
>查看</el-button :preview-src-list="[
> `${window.location.origin}${data[con.value]}`,
]"
/>
</div> </div>
</div> </div>
</el-collapse-item> </el-collapse-item>
@ -63,17 +65,6 @@
<el-button @click="onClosed"> </el-button> <el-button @click="onClosed"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 预览弹窗 -->
<el-dialog
:visible.sync="previewVisible"
title="体检报告"
class="preview_dialog_wrapper"
>
<div class="preview_content">
<img :src="previewUrl" alt="" class="preview_img" />
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -125,8 +116,6 @@ export default {
return { return {
open: false, open: false,
previewVisible: false,
previewUrl: "",
basicInfo, basicInfo,
healthyInvestigate: [ healthyInvestigate: [
{ {
@ -268,10 +257,6 @@ export default {
} }
}); });
}, },
handleOnPreviewClick(url) {
this.previewVisible = true;
this.previewUrl = `${window.location.origin}${url}`;
},
}, },
}; };
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<div>
<el-dialog <el-dialog
:visible.sync="visible" :visible.sync="visible"
:title="title" :title="title"
@ -130,20 +129,16 @@
</el-table-column> </el-table-column>
<el-table-column prop="value_one"> <el-table-column prop="value_one">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <auto-hide-message <el-image
:data=" v-if="scope.row.value_one"
scope.row.value_one == null title="点击大图预览"
? '' style="width: auto; height: 80px"
: scope.row.value_one + '' fit="contain"
" :src="`${window.location.origin}${medicalReportPathArray[0]}`"
:maxLength="20" :preview-src-list="[
/> --> `${window.location.origin}${medicalReportPathArray[0]}`,
<el-button ]"
type="text" />
v-show="scope.row.value_one"
@click="downloadFile(medicalReportPathArray[0])"
>查看</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -152,20 +147,16 @@
></el-table-column> ></el-table-column>
<el-table-column prop="value_two"> <el-table-column prop="value_two">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <auto-hide-message <el-image
:data=" v-if="scope.row.value_two"
scope.row.value_two == null title="点击大图预览"
? '' fit="contain"
: scope.row.value_two + '' style="width: auto; height: 80px"
" :src="`${window.location.origin}${medicalReportPathArray[1]}`"
:maxLength="20" :preview-src-list="[
/> --> `${window.location.origin}${medicalReportPathArray[1]}`,
<el-button ]"
type="text" />
v-show="scope.row.value_two"
@click="downloadFile(medicalReportPathArray[1])"
>查看</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -174,20 +165,16 @@
></el-table-column> ></el-table-column>
<el-table-column prop="value_three"> <el-table-column prop="value_three">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <auto-hide-message <el-image
:data=" v-if="scope.row.value_two"
scope.row.value_three == null title="点击大图预览"
? '' fit="contain"
: scope.row.value_three + '' style="width: auto; height: 80px"
" :src="`${window.location.origin}${medicalReportPathArray[3]}`"
:maxLength="20" :preview-src-list="[
/> --> `${window.location.origin}${medicalReportPathArray[3]}`,
<el-button ]"
type="text" />
v-show="scope.row.value_three"
@click="downloadFile(medicalReportPathArray[2])"
>查看</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -241,18 +228,6 @@
@refreshHealthyData="getCustomerHealthyByCusId()" @refreshHealthyData="getCustomerHealthyByCusId()"
></physicalSigns-remark> ></physicalSigns-remark>
</el-dialog> </el-dialog>
<!-- 预览弹窗 -->
<el-dialog
:visible.sync="previewVisible"
title="体检报告"
class="preview_dialog_wrapper"
>
<div class="preview_content">
<img :src="previewUrl" alt="" class="preview_img" />
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { import {
@ -282,8 +257,6 @@ export default {
data() { data() {
return { return {
logo, logo,
previewVisible: false,
previewUrl: "",
visible: false, visible: false,
showFlag: false, showFlag: false,
title: "", title: "",
@ -796,8 +769,8 @@ export default {
}, },
downloadFile(fileName) { downloadFile(fileName) {
// this.downloadResource(fileName); // this.downloadResource(fileName);
this.previewVisible = true; // this.previewVisible = true;
this.previewUrl = `${window.location.origin}${fileName}`; // this.previewUrl = `${window.location.origin}${fileName}`;
}, },
generateReport() { generateReport() {
let data = this.detailHealthy; let data = this.detailHealthy;