From 95db3ac1352e1f98ba934da9e86fca00e661abe9 Mon Sep 17 00:00:00 2001 From: zjk <852185829@qq.com> Date: 星期五, 12 九月 2025 15:01:07 +0800 Subject: [PATCH] feat: IP地址判断 --- laboratory/src/views/reportLibrary/processDevelopment/components/approval/index.vue | 68 +++++++++++++++++----------------- 1 files changed, 34 insertions(+), 34 deletions(-) diff --git a/laboratory/src/views/reportLibrary/processDevelopment/components/approval/index.vue b/laboratory/src/views/reportLibrary/processDevelopment/components/approval/index.vue index 32f2e2f..dff66d0 100644 --- a/laboratory/src/views/reportLibrary/processDevelopment/components/approval/index.vue +++ b/laboratory/src/views/reportLibrary/processDevelopment/components/approval/index.vue @@ -1,7 +1,7 @@ <template> - <el-dialog :title="dialogTitle" :visible.sync="visible" width="90%" @open="open" top="5vh" :close-on-click-modal="false" - @close="handleClose"> - <div class="approval-dialog" :style="{height: obj.isDetail ? '80vh' : '60vh'}"> + <el-dialog :title="dialogTitle" :visible.sync="visible" width="90%" @open="open" top="5vh" + :close-on-click-modal="false" @close="handleClose"> + <div class="approval-dialog" :style="{ height: obj.isDetail ? '80vh' : '60vh' }"> <!-- 左侧审批内容 --> <div class="approval-content"> <Card class="approval-content-card"> @@ -57,15 +57,15 @@ placeholder="请输入报告正文" /> </el-form-item> <div class="header-title" style="width: 100%"> - <div class="header-title-left"> - <img src="@/assets/public/headercard.png" /> - <div>附件</div> - </div> - </div> - <el-form-item prop="name" style="margin-top: -18px"> - <el-upload action="#" :on-preview="handlePreview":file-list="fileList" disabled> - </el-upload> - </el-form-item> + <div class="header-title-left"> + <img src="@/assets/public/headercard.png" /> + <div>附件</div> + </div> + </div> + <el-form-item prop="name" style="margin-top: -18px"> + <el-upload action="#" :on-preview="handlePreview" :file-list="fileList" disabled> + </el-upload> + </el-form-item> </el-form> </template> @@ -105,7 +105,7 @@ </div> <div slot="footer" class="dialog-footer"> - <el-button @click="handleClose">{{obj.isDetail ? '关闭' : '取 消'}}</el-button> + <el-button @click="handleClose">{{ obj.isDetail ? '关闭' : '取 消' }}</el-button> <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail">确定</el-button> </div> </el-dialog> @@ -115,7 +115,7 @@ import ApprovalProcess from '@/components/approvalProcess' import AiEditor from '@/components/AiEditor' import { getDetail } from '../../service'; -import { customUploadRequest, getFullUrl } from "@/utils/utils"; +import { customUploadRequest, getFullUrl, getAllocateIp } from "@/utils/utils"; import apiConfig from '@/utils/baseurl'; @@ -176,10 +176,10 @@ handlePreview(file) { console.log('url', file) if (file && file.url) { - if (file.url && file.url.startsWith(apiConfig.showImgUrl)) { + if (file.url && file.url.startsWith(getAllocateIp())) { window.open(file.url, '_blank'); - }else{ - let newUrl=apiConfig.showImgUrl+file.url; + } else { + let newUrl = getAllocateIp() + file.url; window.open(newUrl, '_blank'); } } @@ -198,22 +198,22 @@ processData: [] }; if ( - data.feasibilityReportFiles && - data.feasibilityReportFiles.length > 0 - ) { - this.fileList = - data.feasibilityReportFiles.map((file) => { - return { - name: file.fileName, - url: getFullUrl(file.fileUrl), - uid: file.id, - }; - }); - this.form.feasibilityReportFiles =data.feasibilityReportFiles; - } else { - this.fileList = []; - this.form.feasibilityReportFiles = []; - } + data.feasibilityReportFiles && + data.feasibilityReportFiles.length > 0 + ) { + this.fileList = + data.feasibilityReportFiles.map((file) => { + return { + name: file.fileName, + url: getFullUrl(file.fileUrl), + uid: file.id, + }; + }); + this.form.feasibilityReportFiles = data.feasibilityReportFiles; + } else { + this.fileList = []; + this.form.feasibilityReportFiles = []; + } this.tableData = data.projectTeam ? [{ ...data.projectTeam, staffName: data.staffNames || '' }] : @@ -235,7 +235,7 @@ type: "primary", mode: "list", fields: [ - { label: "审核结果:", value: data.status == 4 ? '驳回' : "通过" || "" }, + { label: "审核结果:", value: data.status == 4 ? '驳回' : "通过" || "" }, { label: "审批意见:", value: data.auditRemark || "" }, { label: "审核人:", value: data.auditPersonName || "" }, { label: "审核时间:", value: data.auditTime || "" }, -- Gitblit v1.7.1