Commit 6a67d162 by 张立顺

Merge branch 'SAAS+V4.55.1' of http://192.168.3.233:8090/saas_plus/dj-car-life-s…

…ystem into SAAS+V4.55.1
2 parents 4b118ff6 4ef25409
...@@ -111,8 +111,28 @@ ...@@ -111,8 +111,28 @@
<template v-if="item.prop == 'agreementFile'"> <template v-if="item.prop == 'agreementFile'">
<div v-for="(f, i) in item.formatter(item)" <div v-for="(f, i) in item.formatter(item)"
:key="i"> :key="i">
<span v-if="f.fileType === 'jpg' || f.fileType === 'png'">
<span class="imageContainer">
<img class="detail-img"
:src="f.fileUrl">
<span class="img-btns"
@click.stop="handleImgLook(f.fileUrl)">
<span class="btn-item">
<i class="el-icon-zoom-in"
style="font-size:30px" />
</span>
</span>
<div class="imageLabel">
{{ f.fileName }} {{ f.fileName }}
</div> </div>
</span>
</span>
<span v-else-if="f.fileType === 'pdf'"
:title="f.fileName">
<el-button type="text"
@click="lookPdf(f.fileUrl)">{{ f.fileName ? (f.fileName.length > 30 ? (f.fileName.slice(0, 30) + '...') : f.fileName) : '' }}</el-button>
</span>
</div>
</template> </template>
<template v-else> <template v-else>
{{ item.formatter(item) }} {{ item.formatter(item) }}
...@@ -579,17 +599,19 @@ export default { ...@@ -579,17 +599,19 @@ export default {
label: '线下协议文件', label: '线下协议文件',
prop: 'agreementFile', prop: 'agreementFile',
formatter: () => { formatter: () => {
const { papersList } = this.detailForm const papersList = deepClone(this.detailForm.papersList)
const files = papersList['32'] ? papersList['32'].split('|') : [] const files = papersList['32'] ? papersList['32'].split('|') : []
console.log('files', files)
if (files.length > 0) { if (files.length > 0) {
this.agreementFile = files.map(item => { return files.map(item => {
return { return {
fileName: item.substring(item.lastIndexOf('/') + 1), fileName: item.substring(item.lastIndexOf('/') + 1),
fileUrl: item fileUrl: item,
fileType: item.substring(item.lastIndexOf('.') + 1)
} }
}) })
} }
return this.agreementFile // return this.agreementFileList
} }
}, },
{ {
...@@ -807,7 +829,7 @@ export default { ...@@ -807,7 +829,7 @@ export default {
label: "对私" label: "对私"
} }
], ],
agreementFile: [] agreementFileList: []
} }
}, },
...@@ -989,6 +1011,23 @@ export default { ...@@ -989,6 +1011,23 @@ export default {
this.detailForm.papersList[item.papersType] = item.imgUrl this.detailForm.papersList[item.papersType] = item.imgUrl
}) })
}) })
},
getFileExtensionFromUrl(url) {
try {
// 解析 URL,获取路径部分
const pathname = new URL(url).pathname
// 提取最后一个 . 之后的内容作为扩展名
const extension = pathname.split('.').pop().toLowerCase()
return extension || 'unknown'
} catch (e) {
console.error('Invalid URL:', e)
return 'unknown'
}
},
lookPdf(pdfUrl) {
window.open(pdfUrl)
} }
} }
} }
......
...@@ -297,7 +297,11 @@ export default { ...@@ -297,7 +297,11 @@ export default {
}, },
idCardBack: { idCardBack: {
attrName: "30", attrName: "30",
url: "" url: "",
validate: {
name: "legalCertType",
list: ['00']
}
}, },
// 客户协议书 // 客户协议书
clientAgreement: { clientAgreement: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!