From ee500763de6c9a21c4f4fb53ac34b433160f8c86 Mon Sep 17 00:00:00 2001 From: jiangyinzhi <4617248933@YFZMY.COM> Date: Mon, 5 Aug 2024 19:21:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/energyEfficiency/clockIn/index.vue | 67 ++--- .../energyEfficiency/constructionInfo.vue | 60 ++-- src/views/enterprise/acquisition.vue | 9 + src/views/enterprise/bengjiSystem.vue | 3 +- src/views/enterprise/bengjiSystemAddEdit.vue | 4 +- src/views/enterprise/energyManagement.vue | 30 +- src/views/enterprise/kongyajiSystem.vue | 3 +- .../enterprise/kongyajiSystemAddEdit.vue | 2 +- src/views/enterprise/yearEnergyAddEdit.vue | 4 +- .../bursting/burstingDetail.vue | 3 +- .../facilityManage/common-vue/uploader.vue | 277 ++++++++++-------- 11 files changed, 263 insertions(+), 199 deletions(-) diff --git a/src/views/energyEfficiency/clockIn/index.vue b/src/views/energyEfficiency/clockIn/index.vue index 8e462c7..d3dc10c 100644 --- a/src/views/energyEfficiency/clockIn/index.vue +++ b/src/views/energyEfficiency/clockIn/index.vue @@ -48,13 +48,6 @@ required :rules="[{ required: true }]" /> -
+
@@ -102,7 +103,6 @@ import { getPosition, // chooseAlbumAndTakePhoto, } from '@/utils/dsbridge' -import { format } from '@/utils/timeUtil.js' import { insertPositionData, getPositionData } from '@/api/api.js' import { downloadUrl } from '@/settings' export default { @@ -128,7 +128,6 @@ export default { showSubmit: false, taskId: '', customerId: '', - animation: null } }, mounted() { @@ -162,54 +161,62 @@ export default { }else{ this.showSubmit = true this.getLocation() + this.getAddress() } }) }, // 获取当前位置 getLocation() { + console.log('-------------------------getLocation'); if (process.env.NODE_ENV === 'development') { - this.formData.lgitude = 31.560001 - this.formData.ltitude = 118.708980 + this.formData.lgitude = 118.708980 + this.formData.ltitude = 31.560001 this.formData.addressName = '江苏省南京市江宁区' } - try { - // this.formData.clockTime = format(new Date().getTime()) - } catch (error) {} + const that = this getPosition((data) => { + console.log('-------------------------位置信息', data, typeof(data)); if (data) { - console.log(data, '位置信息') - this.formData.lgitude = data.longitude - this.formData.ltitude = data.latitude + console.log(data.longitude, 'lgitude位置信息') + if(typeof(data) == 'string'){ + let dataArr = data.split(',') + that.$set(that.formData, 'lgitude', dataArr[0].match(/\d+\.\d{2}/)[0]) + that.$set(that.formData, 'ltitude', dataArr[1].match(/\d+\.\d{2}/)[0]) + }else{ + that.$set(that.formData, 'lgitude', (data.longitude+'').match(/\d+\.\d{2}/)[0]) + that.$set(that.formData, 'ltitude', (data.latitude+'').match(/\d+\.\d{2}/)[0]) + } } else { Notify({ type: 'warning', message: '未获取到位置信息' }) } }) + }, + getAddress(){ + const that = this getLocationMessage((data) => { + console.log('-------------------------getLocationMessage', data); if (data) { - this.formData.addressName = data + that.$set(that.formData, 'addressName', data) } else { Notify({ type: 'warning', message: '未获取到定位信息' }) } }) - this.animation = requestAnimationFrame(this.getLocation) }, /** * 图片方法 */ //浏览器 ios 会走这个方法 afterRead(data, type) { - this[type].push({ - fileName: data.original_name, - fileId: data.attach_id, - url: `${downloadUrl}${data.attach_id}` - }) - + console.log('-------------------------afterRead', data, type); + this[type] = [data.attach_id] this.formData.fileName = data.original_name this.formData.fileId = data.attach_id }, //安卓会调用的方法 onUpload(data, type) { - this[type].push(data[0]) + console.log('-------------------------onUpload', data, type); + // this[type].push(data[0]) + this[type] = [data[0].url] this.formData.fileName = data[0].fileName this.formData.fileId = data[0].fileId }, @@ -270,12 +277,6 @@ export default { }) }, }, - beforeDestroy(){ - if(this.animation){ - cancelAnimationFrame(this.animation) - this.animation = null - } - } } \ No newline at end of file