| | |
| | | <!-- 空状态 --> |
| | | <view class="empty" v-if="currentFileList.length === 0"> |
| | | <uni-icons type="info" size="24" color="#999" /> |
| | | <text v-if="currentTab === 'base' || !showGradeSlip">暂无基础附件</text> |
| | | <text v-if="currentTab === 'base' || !showGradeSlip">暂无附件</text> |
| | | <text v-else-if="currentTab === 'grade'">暂无成绩单附件</text> |
| | | </view> |
| | | </scroll-view> |
| | | |
| | | <!-- 操作按钮 --> |
| | | <view class="popup-footer" v-if="!readonly"> |
| | | <button class="btn" @click="chooseFile">添加{{ currentTab === 'grade' ? '成绩单' : '基础' }}附件</button> |
| | | <button class="btn" @click="chooseFile">添加</button> |
| | | <button class="btn primary" @click="confirmUpload">确认上传</button> |
| | | </view> |
| | | </view> |
| | |
| | | success: (res) => { |
| | | if (res.statusCode === 200) { |
| | | const data = JSON.parse(res.data); |
| | | console.log(data,'文件'); |
| | | |
| | | if (data.code === 200) { |
| | | resolve({ |
| | | ...data, |
| | |
| | | file.status = 'uploading'; |
| | | const res = await uploadFile(file.file, 'base'); |
| | | Object.assign(file, { |
| | | url: res.fileName, |
| | | fileName: res.fileName, |
| | | url: res.url, |
| | | fileName: res.name, |
| | | newFileName: res.newFileName, |
| | | originalFilename: res.originalFilename, |
| | | status: 'success' |
| | | status: 'success', |
| | | size:res.size |
| | | }); |
| | | emit("upload-base", file); |
| | | } catch (error) { |
| | | console.error('基础附件上传失败:', error); |
| | | console.error('上传失败:', error); |
| | | file.status = 'error'; |
| | | uni.showToast({ |
| | | title: `文件 ${file.name} 上传失败`, |