This commit is contained in:
bb_pan 2025-12-17 11:19:14 +08:00
parent f760c90592
commit 0854f6b21f
3 changed files with 24 additions and 9 deletions

View File

@ -75,7 +75,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="报废附件" width="140"> <el-table-column align="center" label="报废附件" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;"> <div style="display: flex;align-items: center;justify-content: center;">
<el-upload <el-upload
@ -87,13 +87,17 @@
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="(res) => handleFileSuccess(res, scope.row)" :on-success="(res) => handleFileSuccess(res, scope.row)"
:auto-upload="true" :auto-upload="true"
:disabled="!canEdit" :disabled="!canEdit || scope.row.bmFileInfos.length > 0"
:file-list="scope.row.bmFileInfos"
> >
<el-button type="primary" size="mini" :disabled="!canEdit">上传附件</el-button> <el-button type="primary" size="mini" :disabled="!canEdit">上传附件</el-button>
</el-upload> </el-upload>
<el-button v-if="scope.row.bmFileInfos && scope.row.bmFileInfos.length > 0" type="text" size="mini" @click="picturePreview(scope.row)"> <el-button v-if="scope.row.bmFileInfos && scope.row.bmFileInfos.length > 0" type="text" size="mini" @click="picturePreview(scope.row)">
查看 查看
</el-button> </el-button>
<el-button v-if="scope.row.bmFileInfos && scope.row.bmFileInfos.length > 0" type="text" size="mini" style="color: red" @click="deleteFile(scope.row)">
删除附件
</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -341,6 +345,7 @@ export default {
url: response.data.url url: response.data.url
} }
row.bmFileInfos = [fileObj] row.bmFileInfos = [fileObj]
console.log('🚀 ~ row.bmFileInfos:', row.bmFileInfos)
this.$message.success('文件上传成功') this.$message.success('文件上传成功')
} else { } else {
this.$message.error('文件上传失败') this.$message.error('文件上传失败')
@ -353,13 +358,17 @@ export default {
const file = row.bmFileInfos[0] const file = row.bmFileInfos[0]
const parts = file.name.split('.') const parts = file.name.split('.')
const extension = parts.pop() const extension = parts.pop()
if (extension === 'doc' || extension === 'docx' || extension === 'pdf') { window.open(file.url, file.name)
window.open(file.url, file.name) // if (extension === 'doc' || extension === 'docx' || extension === 'pdf') {
} else { // window.open(file.url, file.name)
this.$message.info('预览图片: ' + file.name) // } else {
} // this.$message.info(': ' + file.name)
// }
} }
} },
deleteFile(row) {
row.bmFileInfos = []
},
}, },
created() { created() {

View File

@ -511,12 +511,14 @@ export default {
.card-box { .card-box {
width: 100%; width: 100%;
border-radius: 15px; border-radius: 15px;
height: 380px; min-height: 380px;
height: calc(45vh - 36px);
} }
.card-box2 { .card-box2 {
width: 100%; width: 100%;
border-radius: 15px; border-radius: 15px;
min-height: 430px; min-height: 430px;
height: calc(45vh - 36px);
} }
.title-tip-tip { .title-tip-tip {
font-weight: 900; font-weight: 900;

View File

@ -2905,6 +2905,10 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
margin-top: 88px; margin-top: 88px;
height: calc(100vh - 172px); height: calc(100vh - 172px);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
} }
.flowchart-title { .flowchart-title {
text-align: center; text-align: center;