diff --git a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue index 794eae1..d277c75 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue @@ -114,7 +114,7 @@ @@ -125,7 +125,7 @@ @@ -136,7 +136,7 @@ @@ -147,7 +147,7 @@ @@ -158,7 +158,7 @@ @@ -224,7 +224,7 @@ @@ -235,7 +235,7 @@ @@ -246,7 +246,7 @@ @@ -257,7 +257,7 @@ @@ -268,7 +268,7 @@ @@ -297,6 +297,7 @@ export default { components: {Pagination, SelectTree}, data() { return { + uploadUrl: config.httpurl + '/mkmj/management/fileUpload', listQuery: { page: 1, limit: 10 @@ -483,6 +484,14 @@ export default { this.addForm.ENVIRONMENTAL_SCREENSHOTS = response.uploadPath; }, beforeUpload(file) { + //文件格式限制 + const isJPG = file.type === 'image/jpeg'; + const isPNG = file.type === 'image/png'; + + if (!isJPG && !isPNG) { + this.$message.error('上传图片只能是 JPG 或 PNG 格式!'); + return false; + } // 文件上传前的校验逻辑 const isLt2M = file.size / 1024 / 1024 < 2; if (!isLt2M) {