From 94ada33570ee530dea1d7567671bbb804a75458e Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 13 十一月 2024 09:02:47 +0800 Subject: [PATCH] 1. 修复任务管理中,场景分类数量统计错误问题 --- src/views/fysp/check/components/ArbitraryPhoto.vue | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/views/fysp/check/components/ArbitraryPhoto.vue b/src/views/fysp/check/components/ArbitraryPhoto.vue index bd24994..f880324 100644 --- a/src/views/fysp/check/components/ArbitraryPhoto.vue +++ b/src/views/fysp/check/components/ArbitraryPhoto.vue @@ -27,14 +27,14 @@ v-for="item in typeList" :key="item.businesstypeid" :label=" - item.businesstype + ' (' + typeImgMap.get(activeId).length + ')' + item.businesstype + ' (' + typeImgMap.get(item.businesstypeid).length + ')' " :name="item.businesstypeid" > </el-tab-pane> </el-tabs> <el-empty v-if="isEmpty" description="鏆傛棤璁板綍" /> - <el-scrollbar class="imgs"> + <el-scrollbar v-else class="imgs"> <el-image v-for="(img, i) in typeImgMap.get(activeId)" :key="i" @@ -134,12 +134,11 @@ this.defaultFile.forEach((imgItem) => { if (imgItem.url == i.url) { i.isSelect = true; + this.selectedImgUrlList.push(i); } }); }); }, - - deep: true } }, mounted() { @@ -160,6 +159,9 @@ // } this.typeImgMap.clear(); this.typeList = []; + + const imgMap = new Map(); + const _typeList = []; mediafileApi.getRoutineByStGuid(this.subtask.stGuid).then((res) => { this.isEmpty = false; let data = res.data; @@ -171,7 +173,7 @@ let businesstypeid = e.businesstypeid; let businesstype = e.businesstype; let hasThisType = false; - this.typeImgMap.forEach((v, k, m) => { + imgMap.forEach((v, k, m) => { if (k == businesstypeid) { hasThisType = true; var isAlreadyHas = false; @@ -190,14 +192,16 @@ } }); if (!hasThisType) { - this.typeImgMap.set(businesstypeid, Array.of(e)); - this.typeList.push(e); + imgMap.set(businesstypeid, Array.of(e)); + _typeList.push(e); } this.imgUrlList.push(e); // TODO imgUrl鍏ㄥ眬閰嶇疆 e.url = $fysp.imgUrl + e.extension1 + e.guid + '.jpg'; e.isSelect = false; } + this.typeImgMap = imgMap; + this.typeList = _typeList; this.initSelectedTab(); }); }, @@ -263,14 +267,15 @@ let result = []; if (!isOk) { this.$emit('selectByAnyPhonoEvent', result); - } - for (const item of this.imgUrlList) { - if (item.isSelect == true) { - result.push(item); + } else { + for (const item of this.imgUrlList) { + if (item.isSelect == true) { + result.push(item); + } } + this.isClose = true; + this.$emit('selectByAnyPhonoEvent', result); } - this.isClose = true; - this.$emit('selectByAnyPhonoEvent', result); } } }; -- Gitblit v1.9.3