提交 a6d1ac92 authored 作者: 王腾飞's avatar 王腾飞

1107

上级 ebe9cb6c
......@@ -53,7 +53,7 @@ Vue.prototype.$echarts = echarts
require('echarts-wordcloud')
import EXIF from 'exif-js'
Vue.prototype.$EXIF = EXIF
Vue.prototype.EXIF = EXIF
Vue.config.productionTip = false
import VeeValidate from 'vee-validate';
......
......@@ -9,7 +9,8 @@ const photo = {
},
actions: {
set_photo_id: ({commit}, value) => {
commit('SET_PHOTO_ID', value)
commit('SET_PHOTO_ID', value);
localStorage.setItem('photoId', value)
}
}
}
......
......@@ -95,9 +95,10 @@
<script>
import { uploadUrl, uploadPath, requestPath } from "@/utils/global";
import { getItemDetailByIdAPI, resourceCommitAPI, myAtlasDeleteItemAPI } from '@/api/resourcecommit'
import { getItemDetailByIdAPI, resourceCommitAPI, deleteMyCommitResItemAPI } from '@/api/resourcecommit'
import pagination from '@/components/pagination/pagination'
import store from '@/store'
import { operationMsg, confirm } from '@/utils/publicFunctions'
export default {
name: 'photolook',
components:{pagination},
......@@ -211,15 +212,17 @@ export default {
})
},
deleteItem(item, key) {
myAtlasDeleteItemAPI([item.id])
.then(res => {
console.log(res,'删除')
if (res.data.code === 0) {
this.photoInfo.splice(key, 1)
this.$message.success('删除成功');
} else {
this.$message.error('删除失败')
}
confirm.apply(this, ['确认删除当前选中的照片吗?']).then(() => {
deleteMyCommitResItemAPI([item.id])
.then(res => {
console.log(res,'删除')
if (res.data.code === 0) {
this.photoInfo.splice(key, 1)
this.$message.success('删除成功');
} else {
this.$message.error('删除失败')
}
})
})
},
refPage() {
......
......@@ -42,6 +42,7 @@
import { myAtlasListAPI, myAtlasInfoAPI, myAtlasDeleteItemAPI } from '@/api/resourcecommit'
import { uploadUrl } from "@/utils/global";
import pagination from '@/components/pagination/pagination'
import { operationMsg, confirm } from '@/utils/publicFunctions'
export default {
name: 'atlas',
components:{pagination},
......@@ -107,16 +108,18 @@ export default {
})
},
deleteAtlasItem(item, key) {
console.log(key,"2222sdas")
myAtlasDeleteItemAPI([item.id])
.then(res => {
console.log(res,'删除')
if (res.data.code === 0) {
this.myAtlasListData.splice(key, 1)
this.$message.success('删除成功');
} else {
this.$message.error('删除失败')
}
confirm.apply(this, ['确认删除当前选中的图册吗?']).then(() => {
console.log(key,"2222sdas")
myAtlasDeleteItemAPI([item.id])
.then(res => {
console.log(res,'删除')
if (res.data.code === 0) {
this.myAtlasListData.splice(key, 1)
this.$message.success('删除成功');
} else {
this.$message.error('删除失败')
}
})
})
},
resetSearch() {
......
......@@ -7,8 +7,8 @@
<div class="formLeft">
<h2>>资源内容描述类</h2>
<swiper v-if="photoList.length" :options="swiperOption" ref="swiperOne">
<swiper-slide v-for="(item, key) in photoList" :key="key">
<img :src="`${uploadUrl}?fileName=${item.fileName}`" alt="">
<swiper-slide v-for="(item, key) in photoList" :key="key" :style="{backgroundImage: 'url('+`${uploadUrl}?fileName=${item.fileName}`+')', backgroundRepeat: 'no-repeat', backgroundPosition: '50%', backgroundSize: 'contain'}">
<!-- <img :src="`${uploadUrl}?fileName=${item.fileName}`" alt=""> -->
</swiper-slide>
<div class="swiper-button-next swiper-button-black" slot="button-next"></div>
<div class="swiper-button-prev swiper-button-black" slot="button-prev"></div>
......@@ -370,10 +370,10 @@ export default {
})
},
getLookContent() {//查看
console.log(store.getters.photoId, "IIIIIIIIOOOO")
if (store.getters.photoId) {
console.log(localStorage.getItem('photoId'), "IIIIIIIIOOOO")
if (localStorage.getItem('photoId')) {
this.isShowSavaBtn = true;
editItemAPI(store.getters.photoId)
editItemAPI(localStorage.getItem('photoId'))
.then(res => {
console.log(res, 'OPOPOPO');
if (res.data.code === 0) {
......@@ -540,8 +540,8 @@ export default {
.swiper-slide {
text-align:center;
img {
width:100%;
height:auto;
width:auto;
height:100%;
}
}
}
......
......@@ -140,11 +140,11 @@
</tr>
<tr>
<th>像高 (Image Height)</th>
<td>测试</td>
<td>{{ photoDetailInfo.PixelXDimension }}</td>
</tr>
<tr>
<th>像宽 (Image Width)</th>
<td>测试</td>
<td>{{ photoDetailInfo.PixelYDimension }}</td>
</tr>
</table>
</div>
......@@ -158,7 +158,6 @@ import { uploadUrl } from "@/utils/global";
import 'swiper/dist/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import store from '@/store'
import EXIF from 'exif-js'
export default {
name: 'photolook',
components: {
......@@ -173,8 +172,9 @@ export default {
photoInfo: [],
photoItemId: null,
activeIndex: 0,
photoDetailInfo: {},
swiperOptionTop: {
spaceBetween: 10,
spaceBetween: 20,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev'
......@@ -185,49 +185,17 @@ export default {
click: ()=>{
const swiperTop = this.$refs.swiperTop.swiper
this.activeIndex = swiperTop.activeIndex;
console.log(this.activeIndex,"当前索引");
let flag = this.photoInfo[this.activeIndex];
console.log(flag,"不知道是什么")
console.log(this.uploadUrl, "LL")
this.photoItemId = flag.id
this.exifImgPath = this.uploadUrl + '?fileName=' + flag.fileName;
var imageObj = new Image();
console.log(imageObj, "KLKLk")
if (this.exifImgPath) {
imageObj.src = this.exifImgPath;
console.log(imageObj, 'ILIL')
console.log(this.exifImgPath)
//var _this = this;
EXIF.getData([imageObj], function () {
alert(22222)
console.log(EXIF.pretty(this),"33333");
console.log(EXIF.getAllTags(this), "::::") // 此处打印的为选中图片的数据
})
var res = EXIF.getAllTags(imageObj);
console.log(res,"22222222222222");
console.log(res,"22222222222222");
/*var http = new XMLHttpRequest();
http.open("GET", this.exifImgPath, true);
http.responseType = "blob";
http.onload = function(e) {
if (this.status === 200) {
var image = new Image();
image.onload = function() {
EXIF.getData(image, function() {
console.log(22)
alert(EXIF.pretty(this));
});
};
image.src = URL.createObjectURL(http.response);
}
};
http.send();*/
this.getPhotoInfo();
}
}
}
},
swiperOptionThumbs: {
spaceBetween: 10,
spaceBetween: 20,
centeredSlides: true,
slidesPerView: 'auto',
touchRatio: 0.2,
......@@ -247,23 +215,8 @@ export default {
console.log(this.uploadUrl, "LL")
this.photoItemId = flag.id
this.exifImgPath = this.uploadUrl + '?fileName=' + flag.fileName;
const imageObj = new Image();
if (this.exifImgPath) {
imageObj.src = this.exifImgPath;
console.log(imageObj, 'ILIL')
console.log(this.exifImgPath)
EXIF.getData(imageObj, function() {
console.log(EXIF.pretty(this));
});
// var _this = this;
// this.EXIF.getData(imageObj, function () {
// console.log(_this.EXIF.getAllTags(this), '()()()9999') // 此处打印的为选中图片的数据
// })
// var res = _this.EXIF.getAllTags(imageObj);
// console.log(res,"22222222222222");
this.getPhotoInfo();
}
}
}
......@@ -275,6 +228,21 @@ export default {
this.lunbo();
},
methods: {
getPhotoInfo() {//获取图片信息
const imageObj = new Image();
imageObj.src = this.exifImgPath;
console.log(imageObj, 'ILIL')
console.log(this.exifImgPath)
var _this = this;
setTimeout(() => {
this.EXIF.getData(imageObj, function () {
console.log(_this.EXIF.getAllTags(this), "::::") // 此处打印的为选中图片的数据
_this.photoDetailInfo = _this.EXIF.getAllTags(this);
console.log(_this.photoDetailInfo,"老子最帅")
console.log(_this.photoDetailInfo.PixelXDimension,)
})
}, 500)
},
editPhotoBasicInfo() {
this.$router.push({
path: 'addatlas'
......@@ -477,7 +445,7 @@ export default {
padding: 10px 0;
}
.gallery-thumbs .swiper-slide {
width: 25%;
width: 100px;
height: 100%;
opacity: 0.4;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论