From 2a2f65296c8e3f731845d3e776a5826391a8792f Mon Sep 17 00:00:00 2001 From: lichuanyang <1176537920@qq.com> Date: Thu, 5 Dec 2024 12:10:42 +0800 Subject: [PATCH] =?UTF-8?q?ecg=E6=89=93=E5=8D=B0=E3=80=81sso=E5=8D=95?= =?UTF-8?q?=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 2 +- src/permission.ts | 38 +- src/views/ECG/ECGForm.vue | 118 ++- .../reportPrintStatistics/ReportInfoECG.vue | 681 ++++++++++++++++++ .../reportPrintStatistics/index.vue | 16 - .../reportPrintStatistics/reportPrint.scss | 12 + 6 files changed, 836 insertions(+), 31 deletions(-) create mode 100644 src/views/applyregistration/reportPrintStatistics/ReportInfoECG.vue create mode 100644 src/views/applyregistration/reportPrintStatistics/reportPrint.scss diff --git a/src/main.ts b/src/main.ts index 7d105b48..256b0dae 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,7 +42,7 @@ import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐 import print from "vue3-print-nb";//打印的 import vue3videoPlay from 'vue3-video-play' // 引入组件 import 'vue3-video-play/dist/style.css' // 引入css - +import '@/views/applyregistration/reportPrintStatistics/reportPrint.scss' //打印(全局) import * as ElementPlusIconsVue from '@element-plus/icons-vue' // 创建实例 const setupAll = async () => { diff --git a/src/permission.ts b/src/permission.ts index 6f4aa055..df92d3b9 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -1,7 +1,7 @@ import router from './router' import type { RouteRecordRaw } from 'vue-router' import { isRelogin } from '@/config/axios/service' -import { getAccessToken } from '@/utils/auth' +import { getAccessToken, setToken, removeToken } from '@/utils/auth' import { useTitle } from '@/hooks/web/useTitle' import { useNProgress } from '@/hooks/web/useNProgress' import { usePageLoading } from '@/hooks/web/usePageLoading' @@ -56,10 +56,44 @@ const whiteList = [ '/oauthLogin/gitee' ] -// 路由加载前 +//获取URL参数 +const getQueryString = (name) => { + const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + const r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); + return null; +} + +//移除URL参数 +const removeQueryString = (url, paramToRemove) => { + if (url && url.trim()) { + const urlObj = new URL(url); + if (urlObj.searchParams && urlObj.searchParams.has(paramToRemove)) { + urlObj.searchParams.delete(paramToRemove); + } + return urlObj.toString(); + } + return ""; +} + +//路由加载前 router.beforeEach(async (to, from, next) => { start() loadStart() + //sso单点登录 + if (getQueryString("accessToken") && getQueryString("refreshToken")) { + const token: any = { + accessToken: getQueryString("accessToken")?.trim(), + refreshToken: getQueryString("refreshToken")?.trim() + } + let urlStr = window.location.href; + urlStr = removeQueryString(urlStr, "accessToken"); + urlStr = removeQueryString(urlStr, "refreshToken"); + removeToken() + setToken(token) + window.location.href = urlStr; + return; + } if (getAccessToken()) { if (to.path === '/login') { next({ path: '/' }) diff --git a/src/views/ECG/ECGForm.vue b/src/views/ECG/ECGForm.vue index ffb02427..2309d747 100644 --- a/src/views/ECG/ECGForm.vue +++ b/src/views/ECG/ECGForm.vue @@ -64,7 +64,7 @@ 危急值 - 已上报 @@ -430,9 +430,10 @@ :expand-on-click-node="false" /> - + -
-
+
+ + + +
+
+ + 打印 + +
+ +
+
+
+ +
+
+
+
+ +
@@ -487,9 +555,11 @@ import { ultrasoniccomApi, updateexamineimageVO } from '@/api/ultrasoniccom' import { PatientexamlistApi, PatientexamlistVO } from '@/api/tblist/patientexamlist' import QRCode from 'qrcode' import ECGprint from '@/views/ECG/ECGprint.vue' +import ReportInfoECG from '@/views/applyregistration/reportPrintStatistics/ReportInfoECG.vue' import htmlToPdf from '@/utils/htmlPdf' import ECGWarningDialog from '@/views/ECG/ECGWaring/ECGWarningDialog.vue' import ECGReport from '@/views/ECG/ECGWaring/ECGReport.vue' + /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const message = useMessage() // 消息弹窗 @@ -519,7 +589,7 @@ const eltextrow = ref(4) //诊断内容占据的行 const isshare = ref(true) //是否展示分享二维码 const qrcodeRef = ref(null) const isdiagshow = ref(false) //是否显示打印窗体 -const imagebase64 = ref() +const imagebase64 = ref('') const isprintimage = ref(false) //是否生成打印文件base64 const ECGDialog = ref() //危急值消息弹窗 const isshowwjz = ref(false) @@ -549,9 +619,9 @@ const open = async (row: any) => { calculateAge(row.birthday) Isgrid.value = 1 // 没次打开都是显示的 只有点击网格才会变化 isChildVisible.value = true - isshowwjz.value=true + isshowwjz.value = true //判断是否显示危急值上报功能 条件是当前机构等于上级机构 - // isshowwjz.value=Profilevo.value.orgId===row.highLevelOrgId?true:false + // isshowwjz.value=Profilevo.value.orgId===row.highLevelOrgId?true:false nextTick(() => { /* 计算右侧诊断*/ const canvasContainer = document.getElementById('elform') @@ -652,6 +722,8 @@ async function save() { console.log(error) }) } finally { + isprintimage.value = false + imagebase64.value = '' } }, 1000) }) @@ -673,19 +745,19 @@ function resetForm() { //关闭打印窗口 function printclose() { + isprintimage.value = false imagebase64.value = '' isdiagshow.value = false - isprintimage.value = false } //打印 function print() { if (!queryParams.value.autoDiagTime) { isdiagshow.value = false - isprintimage.value = false + //isprintimage.value = false message.alertError('请保存后再进行打印') } else { isdiagshow.value = true - isprintimage.value = true + //isprintimage.value = true } } //纠错窗体回传值 @@ -697,7 +769,7 @@ function openECGDialog() { ECGDialog.value.opendiag('1', rowinfo.value) } //已上报危急值弹窗 -function openreprotdiag(){ +function openreprotdiag() { ECGReportDialog.value.opendiag(rowinfo.value) } //纠错 @@ -849,7 +921,7 @@ defineOptions({ name: 'ECGForm' }) defineExpose({ open }) // 提供 open 方法,用于打开弹窗 - diff --git a/src/views/applyregistration/reportPrintStatistics/ReportInfoECG.vue b/src/views/applyregistration/reportPrintStatistics/ReportInfoECG.vue new file mode 100644 index 00000000..68d847d2 --- /dev/null +++ b/src/views/applyregistration/reportPrintStatistics/ReportInfoECG.vue @@ -0,0 +1,681 @@ + + + + + diff --git a/src/views/applyregistration/reportPrintStatistics/index.vue b/src/views/applyregistration/reportPrintStatistics/index.vue index 2d01e482..c9ccac1f 100644 --- a/src/views/applyregistration/reportPrintStatistics/index.vue +++ b/src/views/applyregistration/reportPrintStatistics/index.vue @@ -779,19 +779,3 @@ console.log(download) } } - - diff --git a/src/views/applyregistration/reportPrintStatistics/reportPrint.scss b/src/views/applyregistration/reportPrintStatistics/reportPrint.scss new file mode 100644 index 00000000..4e591887 --- /dev/null +++ b/src/views/applyregistration/reportPrintStatistics/reportPrint.scss @@ -0,0 +1,12 @@ +/* 打印(全局) */ +@media print { + @page { + size: auto; + margin: 1mm 0; + } + + body, + html { + height: auto !important; + } +}