Commit 13b59445 authored by ww-xxy's avatar ww-xxy

增加多图

parent ad91f2f3
......@@ -469,13 +469,14 @@ export default {
const regular = new RegExp(`.*\.${suffix}`);
if (regular.test(val)) {
return (
<el-image
src={val.indexOf("http") == -1 ? baseUrl + val : val}
preview-src-list={
val.indexOf("http") == -1 ? [baseUrl + val] : [val]
}
style="width: 100px"
></el-image>
// <el-image
// src={val.indexOf("http") == -1 ? baseUrl + val : val}
// preview-src-list={
// val.indexOf("http") == -1 ? [baseUrl + val] : [val]
// }
// style="width: 100px"
// ></el-image>
<filepReview src={val}/>
);
} else {
return <el-link type="primary">{val}</el-link>;
......
......@@ -15,6 +15,7 @@ import FileUpload from '@/components/FileUpload';
import Editor from '@/components/Editor';
import Map from '@/components/Map';
import MapDetail from '@/components/MapDetail';
import filepReview from '@/components/filepReview';
const Prototype = function() {};
Prototype.install = (Vue, options) => {
......@@ -34,6 +35,7 @@ Prototype.install = (Vue, options) => {
Vue.component('Editor', Editor) // 富文本
Vue.component('Map', Map) // 地图
Vue.component('MapDetail', MapDetail) // 地图
Vue.component('filepReview', filepReview) // 图片文件预览
}
export default Prototype;
<template>
<div class="img-flex">
<el-image
:src="urlVal(item)"
:preview-src-list="[urlVal(item)]" alt="" v-for="item in fileList" :key="item"/>
</div>
</template>
<script>
const baseUrl = process.env.VUE_APP_API_BASE_URL + "/";
export default {
props:['src'],
data() {
return {}
},
created() {
console.log(this.src)
},
computed: {
fileList:function(v){
return this.src?this.src.split(","):[]
}
},
methods: {
urlVal(val){
console.log(val,"2222")
return val.indexOf("http") == -1 ? baseUrl + val : val
}
},
}
</script>
<style lang="less" scoped>
.img-flex{
overflow: hidden;
display: inline-block;
vertical-align: middle;
.el-image{
width: 50px;
float: left;
border:1px solid #ddd;
margin: 2px;
}
}
</style>
\ No newline at end of file
......@@ -82,7 +82,7 @@
<el-col :span="12"
>图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -98,7 +98,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -95,7 +95,7 @@
<el-row>
<el-col :span="12"
>图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -111,7 +111,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -70,7 +70,7 @@
</el-col>
<el-col :span="12">
图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -86,7 +86,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -72,7 +72,7 @@
</el-col>
<el-col :span="12">
图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -88,7 +88,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -68,7 +68,7 @@
</el-col>
<el-col :span="12"
>图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -84,7 +84,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -73,7 +73,7 @@
</el-col>
<el-col :span="12"
>图片凭证:
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -89,7 +89,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</el-col>
</el-row>
......
......@@ -122,7 +122,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -138,7 +138,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
......@@ -175,7 +175,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -191,7 +191,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
......@@ -150,7 +150,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -166,7 +166,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
......@@ -127,7 +127,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -143,7 +143,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
......@@ -87,7 +87,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -103,7 +103,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
......@@ -140,7 +140,7 @@
<el-col :span="22">
<el-form-item label="图片凭证:">
<div v-if="form.view == '查看'">
<el-image
<!-- <el-image
v-if="form.filePaths"
style="width: 100px; height: 100px"
:src="
......@@ -156,7 +156,8 @@
: [form.filePaths]
"
>
</el-image>
</el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span>
</div>
<ImageUpload
......
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