|
@@ -9,8 +9,8 @@
|
|
style="margin: 2px 0px;">图片选取</u-button>
|
|
style="margin: 2px 0px;">图片选取</u-button>
|
|
<!-- 图片预览 -->
|
|
<!-- 图片预览 -->
|
|
<view class="imgView">
|
|
<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>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -24,8 +24,21 @@
|
|
</view>
|
|
</view>
|
|
</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' : '54px 0px 10px 0px' }"
|
|
|
|
+ :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'">
|
|
<view class="top-dialog-area">
|
|
<view class="top-dialog-area">
|
|
<view class="dialog-item">
|
|
<view class="dialog-item">
|
|
<text class="dialog-label">班次:</text>
|
|
<text class="dialog-label">班次:</text>
|
|
@@ -54,7 +67,7 @@
|
|
:disabled="statusShow == 'edit'"></u--input>
|
|
:disabled="statusShow == 'edit'"></u--input>
|
|
</view>
|
|
</view>
|
|
<view class="dialog-item">
|
|
<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>
|
|
<u--input inputAlign="center" disabled v-model="formState.jcy" placeholder="请输入"></u--input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -99,13 +112,13 @@
|
|
@input="changeInput($event, 'jw')"></u--input>
|
|
@input="changeInput($event, 'jw')"></u--input>
|
|
</view>
|
|
</view>
|
|
<view class="dialog-item">
|
|
<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
|
|
<u--input inputAlign="center" type="number" v-model="formState.ch4" placeholder="请输入" clearable
|
|
@input="changeInput($event, 'ch4')"></u--input>
|
|
@input="changeInput($event, 'ch4')"></u--input>
|
|
</view>
|
|
</view>
|
|
<view class="dialog-item">
|
|
<view class="dialog-item">
|
|
- <text class="dialog-label">便携仪测量数据:</text>
|
|
|
|
|
|
+ <text class="dialog-label">便携仪:</text>
|
|
<u--input inputAlign="center" :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
|
|
<u--input inputAlign="center" :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
|
|
:placeholder="isRule3 ? '请输入' : '数据有误'" type="number" v-model="formState.bxy" clearable
|
|
:placeholder="isRule3 ? '请输入' : '数据有误'" type="number" v-model="formState.bxy" clearable
|
|
@blur="getBlurBxy" @input="changeInput($event, 'bxy')"></u--input>
|
|
@blur="getBlurBxy" @input="changeInput($event, 'bxy')"></u--input>
|
|
@@ -172,6 +185,7 @@ export default {
|
|
|
|
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ imageSrcView: '',//任务明细查看图片详情
|
|
tempFilePaths: [],
|
|
tempFilePaths: [],
|
|
gasTitle: '数据采集',//标题
|
|
gasTitle: '数据采集',//标题
|
|
backPic0: "url(/static/topnavbar0.png)",
|
|
backPic0: "url(/static/topnavbar0.png)",
|
|
@@ -183,7 +197,6 @@ export default {
|
|
indexList: [],//识别数据
|
|
indexList: [],//识别数据
|
|
indexParam: {},//当前选中识别的数据
|
|
indexParam: {},//当前选中识别的数据
|
|
imageSrc: '',
|
|
imageSrc: '',
|
|
- imageSrcList: '',
|
|
|
|
deviceId: '',
|
|
deviceId: '',
|
|
rangeBc: [
|
|
rangeBc: [
|
|
{ value: '夜班', text: "夜班" },
|
|
{ value: '夜班', text: "夜班" },
|
|
@@ -250,6 +263,8 @@ export default {
|
|
this.statusShow = 'edit'
|
|
this.statusShow = 'edit'
|
|
this.gasTitle = '数据详情'
|
|
this.gasTitle = '数据详情'
|
|
this.getGasList()
|
|
this.getGasList()
|
|
|
|
+ //获取任务详情图片
|
|
|
|
+ this.getTaskImg()
|
|
} else {
|
|
} else {
|
|
that.isShowAdd = false
|
|
that.isShowAdd = false
|
|
that.statusShow = 'add'
|
|
that.statusShow = 'add'
|
|
@@ -297,13 +312,19 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
RHFselcet.getPicture(parameter, (data) => {
|
|
RHFselcet.getPicture(parameter, (data) => {
|
|
|
|
+ that.tempFilePaths = []
|
|
let arrData = data.mediaArray
|
|
let arrData = data.mediaArray
|
|
console.log(arrData)
|
|
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 +333,19 @@ export default {
|
|
},
|
|
},
|
|
//图片点击预览
|
|
//图片点击预览
|
|
getPreview() {
|
|
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() {
|
|
getScale() {
|
|
@@ -334,7 +363,7 @@ export default {
|
|
// 压缩成功回调
|
|
// 压缩成功回调
|
|
that.loading = true
|
|
that.loading = true
|
|
let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
|
|
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({
|
|
uni.uploadFile({
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
filePath: that.imageSrc,
|
|
filePath: that.imageSrc,
|
|
@@ -343,7 +372,9 @@ export default {
|
|
'user': that.username,
|
|
'user': that.username,
|
|
'order': that.classType,
|
|
'order': that.classType,
|
|
'reportdate': that.searchTime,
|
|
'reportdate': that.searchTime,
|
|
- 'checkorder': jcNum ? jcNum : Number(that.checkNum)
|
|
|
|
|
|
+ 'checkorder': jcNum ? jcNum : Number(that.checkNum),
|
|
|
|
+ 'checkpath': that.deviceName,
|
|
|
|
+ 'imgpath': that.imageSrc,
|
|
},
|
|
},
|
|
|
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
@@ -659,7 +690,7 @@ export default {
|
|
let that = this
|
|
let that = this
|
|
that.loading = true
|
|
that.loading = true
|
|
let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
|
|
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({
|
|
uni.uploadFile({
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
url: `${apiUrlImg}/gasIdentify`,
|
|
filePath: that.saveImg,
|
|
filePath: that.saveImg,
|
|
@@ -668,7 +699,9 @@ export default {
|
|
'user': that.username,
|
|
'user': that.username,
|
|
'order': that.classType,
|
|
'order': that.classType,
|
|
'reportdate': that.searchTime,
|
|
'reportdate': that.searchTime,
|
|
- 'checkorder': jcNum ? jcNum : Number(that.checkNum)
|
|
|
|
|
|
+ 'checkorder': jcNum ? jcNum : Number(that.checkNum),
|
|
|
|
+ 'checkpath': that.deviceName,
|
|
|
|
+ 'imgpath': that.saveImg,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res) {
|
|
if (res) {
|
|
@@ -1683,6 +1716,7 @@ export default {
|
|
that.indexParam = {}
|
|
that.indexParam = {}
|
|
that.imageSrc = ''
|
|
that.imageSrc = ''
|
|
that.clearData()
|
|
that.clearData()
|
|
|
|
+ uni.removeStorageSync(that.deviceID)
|
|
that.$emit('clearImg', true)
|
|
that.$emit('clearImg', true)
|
|
that.$emit('getBackAddress')
|
|
that.$emit('getBackAddress')
|
|
} else {
|
|
} else {
|
|
@@ -2187,7 +2221,6 @@ export default {
|
|
} else {
|
|
} else {
|
|
that.getEditSave()
|
|
that.getEditSave()
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -2362,6 +2395,81 @@ export default {
|
|
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //获取任务详情图片
|
|
|
|
+ getTaskImg() {
|
|
|
|
+ let that = this
|
|
|
|
+ let apiUrlImg = `${configService.apiUrlP}:6008`
|
|
|
|
+ let form = new FormData()
|
|
|
|
+ // form.append('reportdate', '2025-04-10')
|
|
|
|
+ // form.append('checkpath', '22106工作面')
|
|
|
|
+ // form.append('order', '中班')
|
|
|
|
+ // form.append('checkorder', 1)
|
|
|
|
+ form.append('reportdate', that.searchTime)
|
|
|
|
+ form.append('checkpath', that.deviceName)
|
|
|
|
+ form.append('order', that.classType)
|
|
|
|
+ form.append('checkorder', Number(that.checkNum))
|
|
|
|
+ let formDataStr = ''
|
|
|
|
+ form.forEach((value, key) => {
|
|
|
|
+ if (formDataStr != '') {
|
|
|
|
+ formDataStr += '&'
|
|
|
|
+ }
|
|
|
|
+ formDataStr += encodeURIComponent(key) + '=' + encodeURIComponent(value)
|
|
|
|
+ })
|
|
|
|
+ uni.request({
|
|
|
|
+ url: `${apiUrlImg}/gasServerImg`,
|
|
|
|
+ method: 'post',
|
|
|
|
+ responseType: 'arraybuffer', // 或者 'blob'
|
|
|
|
+ data: formDataStr,
|
|
|
|
+ header: {
|
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
+ },
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.statusCode === 200) {
|
|
|
|
+ let imageData = res.data; // 这里是二进制数据
|
|
|
|
+ // 接下来你可以使用这个二进制数据来显示图片
|
|
|
|
+ // 例如,创建一个Image对象并设置src为imageData的URL
|
|
|
|
+ let img = new Image();
|
|
|
|
+ let blob = new Blob([imageData]); // 如果是arraybuffer,需要转换为Blob
|
|
|
|
+ let url = URL.createObjectURL(blob);
|
|
|
|
+ that.imageSrcView = url;
|
|
|
|
+ // document.body.appendChild(img); // 或者添加到你的页面中
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 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 +2571,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.top-gas-list {
|
|
.top-gas-list {
|
|
|
|
+ position: fixed;
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -2471,6 +2580,7 @@ export default {
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
background-color: #FFF;
|
|
background-color: #FFF;
|
|
margin-bottom: 2px;
|
|
margin-bottom: 2px;
|
|
|
|
+ z-index: 999;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2487,7 +2597,7 @@ export default {
|
|
.bot-gas-list1 {
|
|
.bot-gas-list1 {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
- padding: 10px;
|
|
|
|
|
|
+ // padding: 10px;
|
|
margin-bottom: 2px;
|
|
margin-bottom: 2px;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
background-color: #FFF;
|
|
background-color: #FFF;
|
|
@@ -2524,7 +2634,8 @@ export default {
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
|
|
|
.dialog-label {
|
|
.dialog-label {
|
|
- width: 120px;
|
|
|
|
|
|
+ // width: 120px;
|
|
|
|
+ width: 84px;
|
|
text-align: right;
|
|
text-align: right;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2559,6 +2670,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.imgView {
|
|
.imgView {
|
|
|
|
+ width: 100%;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
|
|
|