|
@@ -9,8 +9,8 @@
|
|
|
style="margin: 2px 0px;">图片选取</u-button>
|
|
|
<!-- 图片预览 -->
|
|
|
<view class="imgView">
|
|
|
- <image v-if="saveImg || imageSrc" style="width:300px;" :src="imageSrc ? imageSrc : saveImg"
|
|
|
- mode="aspectFit" @click="getPreview">
|
|
|
+ <image v-if="saveImg || imageSrc" style="width:100%" :src="imageSrc ? imageSrc : saveImg"
|
|
|
+ @click="getPreview">
|
|
|
</image>
|
|
|
</view>
|
|
|
|
|
@@ -24,8 +24,22 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <view v-if="statusShow == 'edit'">
|
|
|
+ <view class="top-gas-list">
|
|
|
+ <u-button type="primary" icon="camera-fill" size="small" @click="GalleryFile"
|
|
|
+ style="margin: 2px 0px;">图片更新</u-button>
|
|
|
+ <!-- 图片预览 -->
|
|
|
+ <view class="imgView">
|
|
|
+ <image v-if="imageSrcView" style="width:100%" :src="imageSrcView" @click="getPreview">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 新增弹窗 -->
|
|
|
- <view v-if="isShowAdd" :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'">
|
|
|
+ <view v-if="isShowAdd"
|
|
|
+ :style="{ padding: imageSrcView ? '295px 0px 10px 0px' : imageSrc ? '330px 0px 10px 0px' : saveImg ? '330px 0px 10px 0px' : '54px 0px 10px 0px' }"
|
|
|
+ :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'">
|
|
|
<view class="top-dialog-area">
|
|
|
<view class="dialog-item">
|
|
|
<text class="dialog-label">班次:</text>
|
|
@@ -54,7 +68,7 @@
|
|
|
:disabled="statusShow == 'edit'"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">瓦斯检查工:</text>
|
|
|
+ <text class="dialog-label">检查工:</text>
|
|
|
<u--input inputAlign="center" disabled v-model="formState.jcy" placeholder="请输入"></u--input>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -99,13 +113,13 @@
|
|
|
@input="changeInput($event, 'jw')"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">光瓦测量数据:</text>
|
|
|
+ <text class="dialog-label">光瓦:</text>
|
|
|
|
|
|
<u--input inputAlign="center" type="number" v-model="formState.ch4" placeholder="请输入" clearable
|
|
|
@input="changeInput($event, 'ch4')"></u--input>
|
|
|
</view>
|
|
|
<view class="dialog-item">
|
|
|
- <text class="dialog-label">便携仪测量数据:</text>
|
|
|
+ <text class="dialog-label">便携仪:</text>
|
|
|
<u--input inputAlign="center" :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
|
|
|
:placeholder="isRule3 ? '请输入' : '数据有误'" type="number" v-model="formState.bxy" clearable
|
|
|
@blur="getBlurBxy" @input="changeInput($event, 'bxy')"></u--input>
|
|
@@ -172,6 +186,7 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ imageSrcView: '',//任务明细查看图片详情
|
|
|
tempFilePaths: [],
|
|
|
gasTitle: '数据采集',//标题
|
|
|
backPic0: "url(/static/topnavbar0.png)",
|
|
@@ -183,7 +198,6 @@ export default {
|
|
|
indexList: [],//识别数据
|
|
|
indexParam: {},//当前选中识别的数据
|
|
|
imageSrc: '',
|
|
|
- imageSrcList: '',
|
|
|
deviceId: '',
|
|
|
rangeBc: [
|
|
|
{ value: '夜班', text: "夜班" },
|
|
@@ -250,6 +264,8 @@ export default {
|
|
|
this.statusShow = 'edit'
|
|
|
this.gasTitle = '数据详情'
|
|
|
this.getGasList()
|
|
|
+ //获取任务详情图片
|
|
|
+ this.getTaskImg()
|
|
|
} else {
|
|
|
that.isShowAdd = false
|
|
|
that.statusShow = 'add'
|
|
@@ -297,13 +313,19 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
RHFselcet.getPicture(parameter, (data) => {
|
|
|
+ that.tempFilePaths = []
|
|
|
let arrData = data.mediaArray
|
|
|
console.log(arrData)
|
|
|
- that.imageSrc = arrData[0].Pathurl
|
|
|
- that.imageSrcList = arrData[0].path
|
|
|
- that.tempFilePaths = []
|
|
|
- that.tempFilePaths.push(that.imageSrc)
|
|
|
- uni.setStorageSync(that.deviceID, that.imageSrc);
|
|
|
+ if (that.statusShow == 'edit') {
|
|
|
+ that.imageSrcView = arrData[0].Pathurl
|
|
|
+ that.tempFilePaths.push(that.imageSrcView)
|
|
|
+ //更新图片
|
|
|
+ that.getUpdateImg()
|
|
|
+ } else {
|
|
|
+ that.imageSrc = arrData[0].Pathurl
|
|
|
+ that.tempFilePaths.push(that.imageSrc)
|
|
|
+ uni.setStorageSync(that.deviceID, that.imageSrc);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
//点击返回上一级
|
|
@@ -312,11 +334,19 @@ export default {
|
|
|
},
|
|
|
//图片点击预览
|
|
|
getPreview() {
|
|
|
+ let that = this
|
|
|
// 预览图片
|
|
|
- uni.previewImage({
|
|
|
- urls: this.saveImg ? [this.saveImg] : this.tempFilePaths,
|
|
|
- current: 0
|
|
|
- });
|
|
|
+ if (statusShow == 'edit') {
|
|
|
+ uni.previewImage({
|
|
|
+ urls: this.tempFilePaths,
|
|
|
+ current: 0
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.previewImage({
|
|
|
+ urls: this.saveImg ? [this.saveImg] : this.tempFilePaths,
|
|
|
+ current: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//先压缩后识别
|
|
|
getScale() {
|
|
@@ -329,12 +359,11 @@ export default {
|
|
|
quality: 0.85,
|
|
|
minSize: 640 //最小压缩尺寸,图片尺寸小于该时值不压缩,非H5平台有效。若需要忽略该设置,可设置为一个极小的值,比如负数。
|
|
|
}).then((res) => {
|
|
|
- console.log(res, '9900===')
|
|
|
that.imageSrc = res
|
|
|
// 压缩成功回调
|
|
|
that.loading = true
|
|
|
let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
|
|
|
- let apiUrlImg = `${configService.apiUrlP.substring(0, configService.apiUrlP.lastIndexOf(':'))}:6006`
|
|
|
+ let apiUrlImg = `${configService.apiUrlP}:6008`
|
|
|
uni.uploadFile({
|
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
|
filePath: that.imageSrc,
|
|
@@ -343,7 +372,9 @@ export default {
|
|
|
'user': that.username,
|
|
|
'order': that.classType,
|
|
|
'reportdate': that.searchTime,
|
|
|
- 'checkorder': jcNum ? jcNum : Number(that.checkNum)
|
|
|
+ 'checkorder': jcNum ? jcNum : Number(that.checkNum),
|
|
|
+ 'checkpath': that.deviceName,
|
|
|
+ 'imgpath': that.imageSrc,
|
|
|
},
|
|
|
|
|
|
success: (res) => {
|
|
@@ -659,7 +690,7 @@ export default {
|
|
|
let that = this
|
|
|
that.loading = true
|
|
|
let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
|
|
|
- let apiUrlImg = `${configService.apiUrlP.substring(0, configService.apiUrlP.lastIndexOf(':'))}:6006`
|
|
|
+ let apiUrlImg = `${configService.apiUrlP}:6008`
|
|
|
uni.uploadFile({
|
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
|
filePath: that.saveImg,
|
|
@@ -668,7 +699,9 @@ export default {
|
|
|
'user': that.username,
|
|
|
'order': that.classType,
|
|
|
'reportdate': that.searchTime,
|
|
|
- 'checkorder': jcNum ? jcNum : Number(that.checkNum)
|
|
|
+ 'checkorder': jcNum ? jcNum : Number(that.checkNum),
|
|
|
+ 'checkpath': that.deviceName,
|
|
|
+ 'imgpath': that.saveImg,
|
|
|
},
|
|
|
success: (res) => {
|
|
|
if (res) {
|
|
@@ -1683,6 +1716,7 @@ export default {
|
|
|
that.indexParam = {}
|
|
|
that.imageSrc = ''
|
|
|
that.clearData()
|
|
|
+ uni.removeStorageSync(that.deviceID)
|
|
|
that.$emit('clearImg', true)
|
|
|
that.$emit('getBackAddress')
|
|
|
} else {
|
|
@@ -2187,7 +2221,6 @@ export default {
|
|
|
} else {
|
|
|
that.getEditSave()
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -2362,6 +2395,71 @@ export default {
|
|
|
|
|
|
});
|
|
|
},
|
|
|
+ //获取任务详情图片
|
|
|
+ getTaskImg() {
|
|
|
+ let that = this
|
|
|
+ let apiUrlImg = `${configService.apiUrlP}:6008`
|
|
|
+ // let formDataStr = {
|
|
|
+ // reportdate: '2025-04-10',
|
|
|
+ // checkpath: '22106工作面',
|
|
|
+ // order: '中班',
|
|
|
+ // checkorder: 1,
|
|
|
+ // }
|
|
|
+ let formDataStr = {
|
|
|
+ reportdate: that.searchTime,
|
|
|
+ checkpath: that.deviceName,
|
|
|
+ order: that.classType,
|
|
|
+ checkorder: Number(that.checkNum),
|
|
|
+ }
|
|
|
+ uni.request({
|
|
|
+ url: `${apiUrlImg}/gasServerImg`,
|
|
|
+ method: 'post',
|
|
|
+ responseType: 'arraybuffer', // 确保以二进制形式接收数据
|
|
|
+ data: formDataStr,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data instanceof ArrayBuffer) {
|
|
|
+ let arrayBufferView = new Uint8Array(res.data);
|
|
|
+ // 你可以在这里对arrayBufferView进行操作
|
|
|
+ console.log(arrayBufferView);
|
|
|
+ const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBufferView)
|
|
|
+ that.imageSrcView = base64 || '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.error('请求失败:', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //更新图片
|
|
|
+ getUpdateImg() {
|
|
|
+ let that = this
|
|
|
+ let apiUrlImg = `${configService.apiUrlP}:6008`
|
|
|
+ uni.uploadFile({
|
|
|
+ url: `${apiUrlImg}/gasImgUpdate`,
|
|
|
+ filePath: that.imageSrcView,
|
|
|
+ name: 'img',
|
|
|
+ formData: {
|
|
|
+ 'order': that.classType,
|
|
|
+ 'checkorder': Number(that.checkNum),
|
|
|
+ 'reportdate': that.searchTime,
|
|
|
+ 'checkpath': that.deviceName,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.statusCode == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: JSON.parse(res.data).res,
|
|
|
+ icon: 'none' // 可选图标,'success', 'loading', 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (error) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '图片更新失败!',
|
|
|
+ icon: 'none' // 可选图标,'success', 'loading', 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
};
|
|
@@ -2463,6 +2561,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.top-gas-list {
|
|
|
+ position: fixed;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
@@ -2471,13 +2570,14 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
background-color: #FFF;
|
|
|
margin-bottom: 2px;
|
|
|
+ z-index: 999;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bot-gas-list {
|
|
|
width: 100%;
|
|
|
- height: calc(100% - 293px);
|
|
|
+ height: 100%;
|
|
|
padding: 10px;
|
|
|
box-sizing: border-box;
|
|
|
background-color: #FFF;
|
|
@@ -2487,7 +2587,7 @@ export default {
|
|
|
.bot-gas-list1 {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- padding: 10px;
|
|
|
+ // padding: 10px;
|
|
|
margin-bottom: 2px;
|
|
|
box-sizing: border-box;
|
|
|
background-color: #FFF;
|
|
@@ -2524,7 +2624,8 @@ export default {
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
.dialog-label {
|
|
|
- width: 120px;
|
|
|
+ // width: 120px;
|
|
|
+ width: 84px;
|
|
|
text-align: right;
|
|
|
}
|
|
|
}
|
|
@@ -2559,6 +2660,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.imgView {
|
|
|
+ width: 100%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|