上传下载

This commit is contained in:
caoyan
2026-09-03 13:53:54 +08:00
parent 63dc3bcc89
commit f0da970904
18 changed files with 233 additions and 447 deletions
+21 -26
View File
@@ -104,7 +104,7 @@ import {
// chooseAlbumAndTakePhoto,
} from '@/utils/dsbridge'
import { insertPositionData, getPositionData } from '@/api/api.js'
import { downloadUrl } from '@/settings'
import { getImageBlobUrl } from '@/utils/index'
import {debounce} from '@/utils/common.js'
export default {
components: {
@@ -143,33 +143,28 @@ export default {
},
methods: {
// 查询打卡记录
getHistory(){
async getHistory(){
this.text1 = []
getPositionData({taskId: this.taskId}).then(res => {
console.log(res.code , res.data);
if(res.code == 0&&res.data){
// for (const key in this.formData) {
// if (Object.hasOwnProperty.call(this.formData, key)) {
// this.formData[key] = res.data[key]
// }
// }
this.formData = res.data
if (res.data.fileId) {
this.$set(this.text1,0, {
fileName: res.data.fileName,
fileId: res.data.fileId,
url: `${downloadUrl}${res.data.fileId}`
})
console.log(this.text1);
}
this.$forceUpdate()
this.showSubmit = true
}else{
this.showSubmit = true
this.getLocation()
this.getAddress()
const res = await getPositionData({taskId: this.taskId})
console.log(res.code , res.data);
if(res.code == 0&&res.data){
this.formData = res.data
if (res.data.fileId) {
const blobUrl = await getImageBlobUrl(res.data.fileId)
this.$set(this.text1,0, {
fileName: res.data.fileName,
fileId: res.data.fileId,
url: blobUrl
})
console.log(this.text1);
}
})
this.$forceUpdate()
this.showSubmit = true
}else{
this.showSubmit = true
this.getLocation()
this.getAddress()
}
},
// 获取当前位置
getLocation() {