style:材料信息模块功能的完善
Showing
3 changed files
with
19 additions
and
13 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-06-16 11:12:13 | 4 | * @LastEditTime: 2023-06-21 15:35:29 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
22 | <!--缩略图--> | 22 | <!--缩略图--> |
23 | <div class="thumb-wrap"> | 23 | <div class="thumb-wrap"> |
24 | <div class="thumb-wrap-button"> | 24 | <div class="thumb-wrap-button"> |
25 | <el-button type="primary" @click="clickImage">(放大) 显示(缩小)</el-button> | 25 | <el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button> |
26 | <el-upload class="fileUpdate" ref="upload" action="" :show-file-list="false" :multiple="true" :auto-upload="false" | 26 | <el-upload class="fileUpdate" ref="upload" action="" :show-file-list="false" :multiple="true" :auto-upload="false" |
27 | :on-change="handleChange" | 27 | :on-change="handleChange" |
28 | accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload"> | 28 | accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload"> |
... | @@ -30,8 +30,10 @@ | ... | @@ -30,8 +30,10 @@ |
30 | </el-upload> | 30 | </el-upload> |
31 | <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete" | 31 | <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete" |
32 | v-if="!this.$route.query.viewtype && thumbnailImages.length>0">删除</el-button> | 32 | v-if="!this.$route.query.viewtype && thumbnailImages.length>0">删除</el-button> |
33 | <el-button type="primary" @click="handleOpenScan">{{scanTitle}}</el-button> | 33 | <div v-if="!this.$route.query.viewtype" class="pl-5"> |
34 | <el-button type="primary" @click="handleViewScan" v-if="isScan">拍照</el-button> | 34 | <el-button type="primary" @click="handleOpenScan">{{scanTitle}}</el-button> |
35 | <el-button type="primary" @click="handleViewScan" v-if="isScan">拍照</el-button> | ||
36 | </div> | ||
35 | </div> | 37 | </div> |
36 | <ul> | 38 | <ul> |
37 | <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" | 39 | <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" |
... | @@ -46,8 +48,8 @@ | ... | @@ -46,8 +48,8 @@ |
46 | </div> | 48 | </div> |
47 | </template> | 49 | </template> |
48 | <script> | 50 | <script> |
49 | import { getAltimeterInfo } from '@/utils/operation.js' | ||
50 | import PhotoZoom from '@/components/PhotoZoom' | 51 | import PhotoZoom from '@/components/PhotoZoom' |
52 | import { getAltimeterInfo, getUuid } from '@/utils/operation.js' | ||
51 | import { uploadSjClmx, deleteClmx } from "@/api/clxx.js"; | 53 | import { uploadSjClmx, deleteClmx } from "@/api/clxx.js"; |
52 | import publicPicture from '@/components/publicPicture/index.vue' | 54 | import publicPicture from '@/components/publicPicture/index.vue' |
53 | export default { | 55 | export default { |
... | @@ -82,12 +84,16 @@ | ... | @@ -82,12 +84,16 @@ |
82 | watch: { | 84 | watch: { |
83 | previewImg: { | 85 | previewImg: { |
84 | handler (newValue, oldValue) { | 86 | handler (newValue, oldValue) { |
85 | if (newValue.imgList.length > 0) { | 87 | if (newValue.imgList && newValue.imgList.length > 0) { |
86 | this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl) | 88 | this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl) |
87 | this.thumbnailImages = newValue.imgList | 89 | this.thumbnailImages = newValue.imgList |
90 | } else { | ||
91 | this.allLi = [] | ||
92 | this.thumbnailImages = [] | ||
88 | } | 93 | } |
89 | }, | 94 | }, |
90 | deep: true | 95 | deep: true, |
96 | immediate: true | ||
91 | } | 97 | } |
92 | }, | 98 | }, |
93 | created () { | 99 | created () { |
... | @@ -145,8 +151,8 @@ | ... | @@ -145,8 +151,8 @@ |
145 | return new Blob([u8arr], { type: mime }); | 151 | return new Blob([u8arr], { type: mime }); |
146 | } | 152 | } |
147 | function blobToFile (blob) { | 153 | function blobToFile (blob) { |
148 | const options = { type: blob.type }; | 154 | let name = getUuid(8) + '.jpg' |
149 | const file = new File([blob], options); | 155 | const file = new File([blob], name); |
150 | return file; | 156 | return file; |
151 | } | 157 | } |
152 | getAltimeterInfo().then(res => { | 158 | getAltimeterInfo().then(res => { | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-06-16 11:12:40 | 4 | * @LastEditTime: 2023-06-21 15:34:44 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="clxx"> | 7 | <div class="clxx"> |
... | @@ -384,7 +384,7 @@ | ... | @@ -384,7 +384,7 @@ |
384 | this.previewImg.index = 0 | 384 | this.previewImg.index = 0 |
385 | this.treeCheckId = item?.bsmSj | 385 | this.treeCheckId = item?.bsmSj |
386 | this.treeCheckIndex = index | 386 | this.treeCheckIndex = index |
387 | this.previewImg.imgList = item?.children | 387 | this.previewImg.imgList = item.children ? item.children : [] |
388 | this.previewImg.bsmSj = item?.bsmSj | 388 | this.previewImg.bsmSj = item?.bsmSj |
389 | }, | 389 | }, |
390 | // 小图片点击 | 390 | // 小图片点击 | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-06-19 13:15:13 | 4 | * @LastEditTime: 2023-06-21 15:30:43 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="clxx"> | 7 | <div class="clxx"> |
... | @@ -173,7 +173,7 @@ | ... | @@ -173,7 +173,7 @@ |
173 | this.previewImg.index = 0 | 173 | this.previewImg.index = 0 |
174 | this.treeCheckId = item?.bsmSj | 174 | this.treeCheckId = item?.bsmSj |
175 | this.treeCheckIndex = index | 175 | this.treeCheckIndex = index |
176 | this.previewImg.imgList = item?.children | 176 | this.previewImg.imgList = item.children? item.children: [] |
177 | this.previewImg.bsmSj = item?.bsmSj | 177 | this.previewImg.bsmSj = item?.bsmSj |
178 | }, | 178 | }, |
179 | // 小图片点击 | 179 | // 小图片点击 | ... | ... |
-
Please register or sign in to post a comment