Commit 08ba2334 authored by 姬鋆屾's avatar 姬鋆屾

推,网络理政详情页附件下载

parent a4c034bf
......@@ -78,11 +78,44 @@
<div class="card">
<div class="cardTitle">附件</div>
<div class="cardContent" v-if="fromData.url">
<img
v-for="(item, index) in fromData.url"
:key="index"
:src="baseUrl + item"
/>
<template v-for="(item, index) in fromData.url">
<img
v-if="/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(item)"
:key="index"
:src="baseUrl + item"
@click="$viewerApi({ images: [baseUrl + item] })"
/>
<video
width="320"
height="240"
v-if="/\.(mp4|rmvb|avi|)$/.test(item)"
:key="index"
:src="baseUrl + item"
></video>
<a-button
:href="baseUrl + item"
v-else
:key="index"
type="primary"
>
点击下载
</a-button>
</template>
<!-- <template v-if="checkVideo">
<img
v-for="(item, index) in fromData.url"
:key="index"
:src="baseUrl + item"
/>
</template>
<template v-if="checkWav">
<img
v-for="(item, index) in fromData.url"
:key="index"
:src="baseUrl + item"
/>
</template> -->
</div>
<div v-else>--</div>
</div>
......@@ -273,7 +306,10 @@ export default {
data() {
return {
fromData: {},
baseUrl: process.env.VUE_APP_API_BASE_URL,
baseUrl: process.env.VUE_APP_API_BASE_URL + "/zwfw_api/",
checkImg: false,
checkVideo: false,
checkWav: false,
};
},
computed: {
......@@ -286,6 +322,21 @@ export default {
},
},
},
watch: {
fromData: {
deep: true,
immediate: true,
handler(val) {
console.log(val);
if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(val.name)) {
return false;
} else {
return true;
}
},
},
},
methods: {
onClose() {
this.Visible = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment