巡检记录接口对接

This commit is contained in:
Zy
2026-05-19 09:23:23 +08:00
parent 9d06785fd2
commit 82200a3617
17 changed files with 880 additions and 467 deletions

View File

@@ -24,6 +24,7 @@
<script setup>
import { ref, watch } from 'vue'
import baseUrl from '@/api/BaseUrl.js'
// ======================
// Props(可配置)
@@ -102,7 +103,6 @@ function choose() {
sizeType: props.sizeType,
success: async res => {
const tempPaths = res.tempFilePaths
// 如果没传上传接口,只返回临时路径
if (!props.uploadUrl) {
const newItems = tempPaths.map(path => ({ url: path }))
@@ -135,9 +135,13 @@ async function uploadSingle(filePath) {
return new Promise((resolve, reject) => {
uni.uploadFile({
url: props.uploadUrl,
url: `${baseUrl}${props.uploadUrl}`,
filePath: filePath,
name: props.fileFieldName,
header: {
Authorization: 'Bearer ' + (uni.getStorageSync('token') || ''),
clientid: 'butler'
},
// ✅ 新增:携带额外参数
formData: props.extraData,
success: res => {