Browse Source

1、修复打包失败

master
bjang03 7 months ago
parent
commit
2057781144
  1. 11
      src/api/upload.ts
  2. 2
      src/components/search/index.vue
  3. 25
      src/pages/deviceReport/addForm.vue

11
src/api/upload.ts

@ -1,11 +0,0 @@
import upload from '@/api/uploadHttp'
// import request from '@/utils/request'
// 上传
export function uploadFile(data) {
return upload({
url: '/infra/file/upload',
method: 'post',
filePath:data.filePath,
name: data.name
})
}

2
src/components/search/index.vue

@ -16,7 +16,7 @@
</u-search> </u-search>
</view> </view>
<view class="screen-btn" @click="screen" v-if="isShowScreen"> <view class="screen-btn" @click="screen" v-if="isShowScreen">
<image src="../../static/icon/screen.png" mode="widthFix"></image> <image src="../../static/icons/screen.png" mode="widthFix"></image>
<view>筛选</view> <view>筛选</view>
</view> </view>
</view> </view>

25
src/pages/deviceReport/addForm.vue

@ -73,7 +73,6 @@
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
import * as uploadApi from "@/api/upload.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -278,18 +277,18 @@
success: (res) => { success: (res) => {
let filePath = res.tempFilePaths[0] let filePath = res.tempFilePaths[0]
proxy.$modal.loading() proxy.$modal.loading()
uploadApi.uploadFile({ // uploadApi.uploadFile({
filePath: filePath, // filePath: filePath,
name: 'file', // name: 'file',
formData: { // formData: {
'user': 'test' // 'user': 'test'
}, // },
}).then(ret => { // }).then(ret => {
proxy.$modal.closeLoading() // proxy.$modal.closeLoading()
imgList.value.push(ret.data) // imgList.value.push(ret.data)
}).catch((err) => { // }).catch((err) => {
proxy.$modal.closeLoading() // proxy.$modal.closeLoading()
}); // });
}, },
}); });
} }

Loading…
Cancel
Save