|
|
@@ -38,7 +38,12 @@
|
|
|
<span class="ml-20 font-12 grey-6">*请选择图片类型的文件</span>
|
|
|
</div>
|
|
|
<div class="img-content flex flex-justify-start hide-scrollbar mt-20">
|
|
|
- <img :src="item.url" v-for="item in photoList" :key="item.url" />
|
|
|
+ <img
|
|
|
+ :src="item.url"
|
|
|
+ v-for="(item, index) in photoList"
|
|
|
+ :key="item.url"
|
|
|
+ @click="showImg(index)"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="full-width flex flex-center flex-justify-end">
|
|
|
<el-button type="primary" plain @click="show = false"
|
|
|
@@ -48,6 +53,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-image-viewer
|
|
|
+ v-if="showImage"
|
|
|
+ :url-list="preList"
|
|
|
+ :initial-index="initial"
|
|
|
+ @close="showImage = false"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -60,9 +71,14 @@ export default {
|
|
|
filepicker
|
|
|
},
|
|
|
watch: {
|
|
|
+ projectId: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
show: {
|
|
|
handler(val) {
|
|
|
if (val) {
|
|
|
+ this.getPhoto()
|
|
|
setTimeout(() => {
|
|
|
this.initMap()
|
|
|
}, 1000)
|
|
|
@@ -92,12 +108,17 @@ export default {
|
|
|
},
|
|
|
latLng: {
|
|
|
type: Array,
|
|
|
- default: []
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
show: false,
|
|
|
+ showImage: false,
|
|
|
+ initial: 0,
|
|
|
+ preList: [],
|
|
|
map: null,
|
|
|
geocoder: '',
|
|
|
keyword: '相国',
|
|
|
@@ -113,10 +134,24 @@ export default {
|
|
|
longitude: '',
|
|
|
latitude: ''
|
|
|
},
|
|
|
- photoList: []
|
|
|
+ photoList: [],
|
|
|
+ editPhoto: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getPhoto() {
|
|
|
+ this.$api.project
|
|
|
+ .photoProject({ projectId: this.projectId })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.photoList = res.data.map(ele => {
|
|
|
+ ele.fileVO.url = ele.fileVO.filePath
|
|
|
+ return ele.fileVO
|
|
|
+ })
|
|
|
+ this.preList = this.photoList.map(ele => ele.url)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
initMap() {
|
|
|
window._AMapSecurityConfig = {
|
|
|
securityJsCode: 'b7c07b56f6647ae56ff3d926a42d9565'
|
|
|
@@ -201,7 +236,6 @@ export default {
|
|
|
e.value = e.name + '(' + e.district + ')'
|
|
|
return e
|
|
|
})
|
|
|
- console.log(tmp)
|
|
|
cb(tmp)
|
|
|
})
|
|
|
},
|
|
|
@@ -210,9 +244,10 @@ export default {
|
|
|
this.form.latitude = this.latitude
|
|
|
this.form.longitude = this.longitude
|
|
|
this.show = false
|
|
|
- this.$emit('success', this.form, this.photoList)
|
|
|
+ this.$emit('success', this.form, this.editPhoto ? this.photoList : [])
|
|
|
},
|
|
|
filePicker(list) {
|
|
|
+ this.editPhoto = true
|
|
|
const tmps = list
|
|
|
.filter(ele => !api.offices.includes(ele.suffix))
|
|
|
.map(ele => {
|
|
|
@@ -227,6 +262,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.photoList = this.photoList.concat(tmps)
|
|
|
+ this.preList = this.photoList.map(ele => ele.url)
|
|
|
+ },
|
|
|
+ showImg(index) {
|
|
|
+ this.initial = index
|
|
|
+ this.showImage = true
|
|
|
},
|
|
|
close() {
|
|
|
// this.photoList.length = 0
|