上传下载
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user