|
|
@@ -4,7 +4,6 @@
|
|
|
<van-col span="6" style="" v-if="insert == '1'">
|
|
|
<div class="addImg">
|
|
|
<uploadVNormalTaskPhoto
|
|
|
- :imgArr="imgs"
|
|
|
:shouws="true"
|
|
|
:storeGroupId="storeGroupId"
|
|
|
:taskList="taskIds.split(',')"
|
|
|
@@ -20,35 +19,19 @@
|
|
|
ref="uploadVNormal" />
|
|
|
</div>
|
|
|
</van-col>
|
|
|
- <van-col span="6" v-for="(urls, index) in imgs" :key="urls.id">
|
|
|
+ <van-col span="6" v-for="(id, index) in imgArr" :key="index">
|
|
|
<div class="imgview">
|
|
|
- <van-icon
|
|
|
- v-if="(photoIdentifyType != 6 || photoIdentifyType != 7) && insert == '1'"
|
|
|
- name="close"
|
|
|
- size="16"
|
|
|
- v-on:click="deleteImg(index, urls.fileIdSplicing)" />
|
|
|
- <img
|
|
|
- v-if="urls.type == '2'"
|
|
|
- :src="urls.fileUrl"
|
|
|
- width="100px"
|
|
|
- height="100px"
|
|
|
- @click="previewsImg(index)" />
|
|
|
- <img
|
|
|
+ <van-icon v-if="insert == '1'" name="close" size="16" v-on:click="deleteImg(index)" />
|
|
|
+ <img :src="id" width="100px" height="100px" @click="previewsImg(index)" />
|
|
|
+ <!-- <img
|
|
|
v-else
|
|
|
:src="urls.fileUrl"
|
|
|
width="100px"
|
|
|
height="100px"
|
|
|
- @click="previewsImg(index)" />
|
|
|
+ @click="previewsImg(index)" /> -->
|
|
|
</div>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
- <!-- <div style="padding: 10px 16px 0;">-->
|
|
|
- <!-- <div class="img-box" v-for="(urls, index) in imgs" :key="index">-->
|
|
|
- <!-- <van-icon name="clear" v-on:click="deleteImg(index,urls.id)"/>-->
|
|
|
- <!-- <img v-if="urls.type=='2'" :src="urls.fileUrl" width="100px" height="100px" @click="previewsImg(index)"/>-->
|
|
|
- <!-- <img v-else :src="urls.fileUrl" width="100px" height="100px" @click="previewsImg(index)"/>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </div>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -112,7 +95,9 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
imgs: {
|
|
|
- handler(val) {},
|
|
|
+ handler(val) {
|
|
|
+ this.imgArr = val;
|
|
|
+ },
|
|
|
deep: true,
|
|
|
immediate: true,
|
|
|
},
|
|
|
@@ -123,31 +108,26 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- deleteImg(index, fileIdList) {
|
|
|
- removePhotoBatch({ fileIdList: fileIdList.split(',') }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$toast('删除成功!');
|
|
|
- this.$emit('upDataDetail');
|
|
|
- } else {
|
|
|
- this.$toast('删除失败!');
|
|
|
- }
|
|
|
- });
|
|
|
+ deleteImg(index) {
|
|
|
+ this.imgArr.splice(index, 1);
|
|
|
+ // removePhotoBatch({ fileIdList: fileIdList.split(',') }).then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.$toast('删除成功!');
|
|
|
+ // this.$emit('upDataDetail');
|
|
|
+ // } else {
|
|
|
+ // this.$toast('删除失败!');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
previewsImg(index) {
|
|
|
- var arrimg = [];
|
|
|
- for (var imgi = 0; imgi < this.imgs.length; imgi++) {
|
|
|
- arrimg.push(this.imgs[imgi].fileUrl);
|
|
|
- }
|
|
|
ImagePreview({
|
|
|
- images: arrimg,
|
|
|
+ images: this.imgArr,
|
|
|
startPosition: index,
|
|
|
- onClose() {
|
|
|
- // do something
|
|
|
- },
|
|
|
});
|
|
|
},
|
|
|
- newimgarr() {
|
|
|
- this.$emit('upDataDetail');
|
|
|
+ newimgarr(localIds) {
|
|
|
+ this.imgArr = localIds;
|
|
|
+ // this.$emit('upDataDetail');
|
|
|
},
|
|
|
},
|
|
|
};
|