29771447 by renchao@pashanhoo.com

style:材料信息模块功能的完善

1 parent f1fe14da
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-16 11:12:13
* @LastEditTime: 2023-06-21 15:35:29
-->
<template>
<div class="rlPopup">
......@@ -22,7 +22,7 @@
<!--缩略图-->
<div class="thumb-wrap">
<div class="thumb-wrap-button">
<el-button type="primary" @click="clickImage">(放大) 显示(缩小)</el-button>
<el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button>
<el-upload class="fileUpdate" ref="upload" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
:on-change="handleChange"
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload">
......@@ -30,9 +30,11 @@
</el-upload>
<el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
v-if="!this.$route.query.viewtype && thumbnailImages.length>0">删除</el-button>
<div v-if="!this.$route.query.viewtype" class="pl-5">
<el-button type="primary" @click="handleOpenScan">{{scanTitle}}</el-button>
<el-button type="primary" @click="handleViewScan" v-if="isScan">拍照</el-button>
</div>
</div>
<ul>
<li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }"
@click="showCurrent(index)">
......@@ -46,8 +48,8 @@
</div>
</template>
<script>
import { getAltimeterInfo } from '@/utils/operation.js'
import PhotoZoom from '@/components/PhotoZoom'
import { getAltimeterInfo, getUuid } from '@/utils/operation.js'
import { uploadSjClmx, deleteClmx } from "@/api/clxx.js";
import publicPicture from '@/components/publicPicture/index.vue'
export default {
......@@ -82,12 +84,16 @@
watch: {
previewImg: {
handler (newValue, oldValue) {
if (newValue.imgList.length > 0) {
if (newValue.imgList && newValue.imgList.length > 0) {
this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl)
this.thumbnailImages = newValue.imgList
} else {
this.allLi = []
this.thumbnailImages = []
}
},
deep: true
deep: true,
immediate: true
}
},
created () {
......@@ -145,8 +151,8 @@
return new Blob([u8arr], { type: mime });
}
function blobToFile (blob) {
const options = { type: blob.type };
const file = new File([blob], options);
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
}
getAltimeterInfo().then(res => {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-16 11:12:40
* @LastEditTime: 2023-06-21 15:34:44
-->
<template>
<div class="clxx">
......@@ -384,7 +384,7 @@
this.previewImg.index = 0
this.treeCheckId = item?.bsmSj
this.treeCheckIndex = index
this.previewImg.imgList = item?.children
this.previewImg.imgList = item.children ? item.children : []
this.previewImg.bsmSj = item?.bsmSj
},
// 小图片点击
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-19 13:15:13
* @LastEditTime: 2023-06-21 15:30:43
-->
<template>
<div class="clxx">
......@@ -173,7 +173,7 @@
this.previewImg.index = 0
this.treeCheckId = item?.bsmSj
this.treeCheckIndex = index
this.previewImg.imgList = item?.children
this.previewImg.imgList = item.children? item.children: []
this.previewImg.bsmSj = item?.bsmSj
},
// 小图片点击
......