From 049bde5457aff109f17f552d2bf5790bed2e68d3 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 17 Nov 2025 17:27:53 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/UploadFile.vue | 5 ++--- .../personnel/components/PersonnelForm.vue | 3 ++- .../personnel/components/child/QualificationInfo.vue | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/common/UploadFile.vue b/src/views/common/UploadFile.vue index 3ecefb7..b6573fb 100644 --- a/src/views/common/UploadFile.vue +++ b/src/views/common/UploadFile.vue @@ -169,13 +169,12 @@ export default { watch: { fileList: { handler(newVal) { - if (this.files.length === 0 && newVal.length > 0) { + if (newVal.length > 0) { this.$nextTick(() => { this.files = this.formatFileList(newVal) this.handlePreviewFromExternal(newVal) }) - } - if(newVal.length === 0){ + }else{ this.$nextTick(() => { this.files = []; this.handlePreviewFromExternal(newVal) diff --git a/src/views/enterpriseLibrary/personnel/components/PersonnelForm.vue b/src/views/enterpriseLibrary/personnel/components/PersonnelForm.vue index 6ac1f66..296757c 100644 --- a/src/views/enterpriseLibrary/personnel/components/PersonnelForm.vue +++ b/src/views/enterpriseLibrary/personnel/components/PersonnelForm.vue @@ -344,7 +344,8 @@ export default { this.isProjectChiefEngineer ? Promise.resolve(EMPTY_OBJECT) : this.qualificationInfoRef?.validate?.() || Promise.resolve(EMPTY_OBJECT), this.$refs.otherInfoPersonnel.validate() ]) - + console.log(basicInfoData, qualificationData, otherData); + // 组装完整数据 const formData = this.assembleFormData(basicInfoData, qualificationData, otherData) diff --git a/src/views/enterpriseLibrary/personnel/components/child/QualificationInfo.vue b/src/views/enterpriseLibrary/personnel/components/child/QualificationInfo.vue index 9bd164f..26402f1 100644 --- a/src/views/enterpriseLibrary/personnel/components/child/QualificationInfo.vue +++ b/src/views/enterpriseLibrary/personnel/components/child/QualificationInfo.vue @@ -359,6 +359,8 @@ export default { this.$set(this.personnelCertificateId, 0, this.getFormData(item.fileUploadType, 'personnelCertificateId')); } else if (Object.keys(item).length > 0 && item.fileUploadType !== fileUploadType) { // 安全考核B证、安全考核C证、其他人员证书 this.form.fileList2 = this.getFileList(item.fileUploadType); + console.log(this.form.fileList2); + this.form.registerProfessional = this.getFormData(item.fileUploadType, 'registerProfessional'); this.form.certificateCode2 = this.getFormData(item.fileUploadType, 'certificateCode'); this.form.certificateValidityPeriod2 = this.getFormData(item.fileUploadType, 'certificateValidityPeriod').split(' - '); @@ -366,7 +368,7 @@ export default { } }) console.log(this.form); - + }, getFileList(businessType) { @@ -453,12 +455,12 @@ export default { }, detailData: { handler(newVal) { - console.log(newVal); - if (Object.keys(newVal).length > 0) { const { enterprisePersonnel: { personnelPosition } = {} } = newVal; if (personnelPosition !== 'project_chief_engineer') { - this.setFormData(); + this.$nextTick(() => { + this.setFormData(); + }) } } }, From 3faf9717753029cffb248abce6d4e2db681c0874 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 17 Nov 2025 18:04:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/FileOrImageDisplay.vue | 51 +++++++++++++++++++++---- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/src/views/common/FileOrImageDisplay.vue b/src/views/common/FileOrImageDisplay.vue index 032fa98..40677bf 100644 --- a/src/views/common/FileOrImageDisplay.vue +++ b/src/views/common/FileOrImageDisplay.vue @@ -11,8 +11,15 @@
- +
图片加载失败 @@ -52,6 +59,7 @@ export default { documentKey: '', mode: 'view', type: 'desktop', + imageDimensions: null, } }, props: { @@ -112,7 +120,22 @@ export default { // 最终预览列表 finalPreviewList() { return this.previewSrcList.length > 0 ? this.previewSrcList : [this.imageUrl] - } + }, + imageStyle() { + if (!this.imageDimensions) { + return {} + } + const maxWidth = 600 + const maxHeight = 400 + const widthRatio = maxWidth / this.imageDimensions.width + const heightRatio = maxHeight / this.imageDimensions.height + const ratio = Math.min(widthRatio, heightRatio, 1) + + return { + width: `${Math.round(this.imageDimensions.width * ratio)}px`, + height: `${Math.round(this.imageDimensions.height * ratio)}px` + } + }, }, methods: { // 文件点击事件 @@ -126,6 +149,15 @@ export default { handleImageClick() { this.$emit('image-click', this.imageUrl) }, + handleImageLoad(event) { + const { naturalWidth, naturalHeight } = event?.target || {} + if (naturalWidth && naturalHeight) { + this.imageDimensions = { + width: naturalWidth, + height: naturalHeight + } + } + }, handleDocumentReady() { console.log('文档已准备就绪') }, @@ -138,6 +170,11 @@ export default { handleInitialized() { console.log('初始化完成') }, + }, + watch: { + imageUrl() { + this.imageDimensions = null + } } } @@ -215,10 +252,10 @@ export default { } .license-image { - width: 60%; - height: 60%; - max-width: 60%; - max-height: 60%; + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; display: block; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); From d2d8b89f1c193bf3dba8c024b1d364e968b51d98 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 17 Nov 2025 18:35:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/FileOrImageDisplay.vue | 41 +++++++++---------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/views/common/FileOrImageDisplay.vue b/src/views/common/FileOrImageDisplay.vue index 40677bf..a0537fe 100644 --- a/src/views/common/FileOrImageDisplay.vue +++ b/src/views/common/FileOrImageDisplay.vue @@ -18,7 +18,6 @@ fit="fill" hide-on-click-modal :style="imageStyle" - @load="handleImageLoad" >
@@ -59,7 +58,6 @@ export default { documentKey: '', mode: 'view', type: 'desktop', - imageDimensions: null, } }, props: { @@ -102,6 +100,16 @@ export default { fileTypeValue: { type: [Number, String], default: '2' + }, + // 固定图片宽度 + imageWidth: { + type: [Number, String], + default: 600 + }, + // 固定图片高度 + imageHeight: { + type: [Number, String], + default: 400 } }, computed: { @@ -122,18 +130,11 @@ export default { return this.previewSrcList.length > 0 ? this.previewSrcList : [this.imageUrl] }, imageStyle() { - if (!this.imageDimensions) { - return {} - } - const maxWidth = 600 - const maxHeight = 400 - const widthRatio = maxWidth / this.imageDimensions.width - const heightRatio = maxHeight / this.imageDimensions.height - const ratio = Math.min(widthRatio, heightRatio, 1) - + const width = typeof this.imageWidth === 'number' ? `${this.imageWidth}px` : this.imageWidth + const height = typeof this.imageHeight === 'number' ? `${this.imageHeight}px` : this.imageHeight return { - width: `${Math.round(this.imageDimensions.width * ratio)}px`, - height: `${Math.round(this.imageDimensions.height * ratio)}px` + width, + height } }, }, @@ -149,15 +150,6 @@ export default { handleImageClick() { this.$emit('image-click', this.imageUrl) }, - handleImageLoad(event) { - const { naturalWidth, naturalHeight } = event?.target || {} - if (naturalWidth && naturalHeight) { - this.imageDimensions = { - width: naturalWidth, - height: naturalHeight - } - } - }, handleDocumentReady() { console.log('文档已准备就绪') }, @@ -170,11 +162,6 @@ export default { handleInitialized() { console.log('初始化完成') }, - }, - watch: { - imageUrl() { - this.imageDimensions = null - } } } From 6316c46625a0a4b02e0adb12ff2a5ca58b71700a Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 17 Nov 2025 19:21:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E5=BA=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enterpriseLibrary/enterprise/index.vue | 4 ++-- .../enterpriseLibrary/technical/components/RightTable.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/enterpriseLibrary/enterprise/index.vue b/src/views/enterpriseLibrary/enterprise/index.vue index c47ffb5..9c80e4e 100644 --- a/src/views/enterpriseLibrary/enterprise/index.vue +++ b/src/views/enterpriseLibrary/enterprise/index.vue @@ -113,7 +113,7 @@ import EnterpriseDetail from '@/assets/enterpriseLibrary/enterprise/enterprise-d import EnterpriseEdit from '@/assets/enterpriseLibrary/enterprise/enterprise-edit.png'; import EnterpriseDelete from '@/assets/enterpriseLibrary/enterprise/enterprise-delete.png'; import { encryptWithSM4 } from '@/utils/sm' -import { listAPI, delAPI } from '@/api/enterpriseLibrary/enterprise/enterprise' +import { listAPI, delDataAPI } from '@/api/enterpriseLibrary/enterprise/enterprise' export default { name: 'Enterprise', components: { @@ -193,7 +193,7 @@ export default { dangerouslyUseHTMLString: true, customClass: 'delete-confirm-dialog' }).then(() => { - delAPI({enterpriseId: item.enterpriseId}).then(res => { + delDataAPI({enterpriseId: item.enterpriseId}).then(res => { if(res.code === 200){ this.$message.success('删除成功'); this.getList(); diff --git a/src/views/enterpriseLibrary/technical/components/RightTable.vue b/src/views/enterpriseLibrary/technical/components/RightTable.vue index 287e96e..d6522bb 100644 --- a/src/views/enterpriseLibrary/technical/components/RightTable.vue +++ b/src/views/enterpriseLibrary/technical/components/RightTable.vue @@ -174,8 +174,8 @@ export default { console.log('初始化完成') }, /** 删除操作 */ - handleDelete(row) { - this.$confirm(`确定要删除方案类型"${raw.technicalSolutionName}"吗?删除后将无法恢复!`, '操作提示', { + handleDelete(raw) { + this.$confirm(`确定要删除方案名称"${raw.technicalName}"吗?删除后将无法恢复!`, '操作提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', @@ -185,7 +185,7 @@ export default { delDataAPI( { technicalSolutionTypeId: raw.technicalSolutionTypeId, - technicalSolutionId: row.technicalSolutionId + technicalSolutionId: raw.technicalSolutionId } ).then(res => { if (res.code === 200) {