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

增加多图

parent ad91f2f3
...@@ -469,13 +469,14 @@ export default { ...@@ -469,13 +469,14 @@ export default {
const regular = new RegExp(`.*\.${suffix}`); const regular = new RegExp(`.*\.${suffix}`);
if (regular.test(val)) { if (regular.test(val)) {
return ( return (
<el-image // <el-image
src={val.indexOf("http") == -1 ? baseUrl + val : val} // src={val.indexOf("http") == -1 ? baseUrl + val : val}
preview-src-list={ // preview-src-list={
val.indexOf("http") == -1 ? [baseUrl + val] : [val] // val.indexOf("http") == -1 ? [baseUrl + val] : [val]
} // }
style="width: 100px" // style="width: 100px"
></el-image> // ></el-image>
<filepReview src={val}/>
); );
} else { } else {
return <el-link type="primary">{val}</el-link>; return <el-link type="primary">{val}</el-link>;
......
...@@ -15,6 +15,7 @@ import FileUpload from '@/components/FileUpload'; ...@@ -15,6 +15,7 @@ import FileUpload from '@/components/FileUpload';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import Map from '@/components/Map'; import Map from '@/components/Map';
import MapDetail from '@/components/MapDetail'; import MapDetail from '@/components/MapDetail';
import filepReview from '@/components/filepReview';
const Prototype = function() {}; const Prototype = function() {};
Prototype.install = (Vue, options) => { Prototype.install = (Vue, options) => {
...@@ -34,6 +35,7 @@ Prototype.install = (Vue, options) => { ...@@ -34,6 +35,7 @@ Prototype.install = (Vue, options) => {
Vue.component('Editor', Editor) // 富文本 Vue.component('Editor', Editor) // 富文本
Vue.component('Map', Map) // 地图 Vue.component('Map', Map) // 地图
Vue.component('MapDetail', MapDetail) // 地图 Vue.component('MapDetail', MapDetail) // 地图
Vue.component('filepReview', filepReview) // 图片文件预览
} }
export default Prototype; 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 @@ ...@@ -82,7 +82,7 @@
<el-col :span="12" <el-col :span="12"
>图片凭证: >图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -98,7 +98,8 @@ ...@@ -98,7 +98,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<el-row> <el-row>
<el-col :span="12" <el-col :span="12"
>图片凭证: >图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -111,7 +111,8 @@ ...@@ -111,7 +111,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
图片凭证: 图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -86,7 +86,8 @@ ...@@ -86,7 +86,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
图片凭证: 图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -88,7 +88,8 @@ ...@@ -88,7 +88,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</el-col> </el-col>
<el-col :span="12" <el-col :span="12"
>图片凭证: >图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</el-col> </el-col>
<el-col :span="12" <el-col :span="12"
>图片凭证: >图片凭证:
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -89,7 +89,8 @@ ...@@ -89,7 +89,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -138,7 +138,8 @@ ...@@ -138,7 +138,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <ImageUpload
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -191,7 +191,8 @@ ...@@ -191,7 +191,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <ImageUpload
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -166,7 +166,8 @@ ...@@ -166,7 +166,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <ImageUpload
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -143,7 +143,8 @@ ...@@ -143,7 +143,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <ImageUpload
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <ImageUpload
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<el-col :span="22"> <el-col :span="22">
<el-form-item label="图片凭证:"> <el-form-item label="图片凭证:">
<div v-if="form.view == '查看'"> <div v-if="form.view == '查看'">
<el-image <!-- <el-image
v-if="form.filePaths" v-if="form.filePaths"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src=" :src="
...@@ -156,7 +156,8 @@ ...@@ -156,7 +156,8 @@
: [form.filePaths] : [form.filePaths]
" "
> >
</el-image> </el-image> -->
<filepReview v-if="form.filePaths" :src="form.filePaths"/>
<span v-else>--</span> <span v-else>--</span>
</div> </div>
<ImageUpload <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