Kaynağa Gözat

新增全屏页面的功能

xiaochan 1 yıl önce
ebeveyn
işleme
5fa7414311

+ 1 - 0
src/api/settings/menu-settings.ts

@@ -22,6 +22,7 @@ export interface IntergrationMenu {
     children: IntergrationMenu[] | null;
     completePath: string
     cascaders: number[] | null
+    fullscreen: boolean
 }
 
 export function getMenuSettings() {

+ 3 - 8
src/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue

@@ -10,7 +10,7 @@
         <table style="width: 100%;table-layout: fixed;">
           <thead style="text-align: center;">
           <tr>
-            <th colspan="3">{{SYSTEM_CONFIG.HOSPITAL_NAME}}</th>
+            <th colspan="3">{{ SYSTEM_CONFIG.HOSPITAL_NAME }}</th>
           </tr>
           <tr>
             <th style="font-size: 10.5pt" colspan="3">
@@ -165,11 +165,7 @@ const data = ref<OpRecord>({})
 const css = '*{font-size:12pt}.tanXingHeZiHeng{display:flex;justify-content:space-between;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiHeng2{display:flex;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiShu{display:flex;flex-direction:column}.wen-zi{display:flex;margin-top:3pt;margin-left:3.75pt;height:23.75pt}.wen-zi div:first-child{display:flex;flex-direction:row;justify-content:center;text-align:right}.wen-zi div:nth-child(2){margin-left:3pt;display:table}.ge-zi{display:table-column}'
 
 const situationFunc = () => {
-  if (XEUtils.isEmpty(data.value.urgentClinicFlag)) {
-    return '';
-  }
-
-  return findValueByListCode(surgicalSituation, data.value.urgentClinicFlag)
+  return findValueByListCode(surgicalSituation, data.value!.urgentClinicFlag)
 }
 
 const printClick = () => {
@@ -177,7 +173,7 @@ const printClick = () => {
     return ElMessage.error('请先选择患者')
   }
   let LODOP = getLodop();
-  const strFormHtml = '<style>' + css + '</style>' + '<body>' + printRef.value.innerHTML + '</body>';
+  const strFormHtml = '<style>' + css + '</style>' + '<body>' + printRef!.value.innerHTML + '</body>';
   LODOP.PRINT_INIT(0, 0, 522, 333, '检查申请') // 初始化打印机 名字
   // 整宽不变形
   if (zhiZhang.value === 1) {
@@ -249,5 +245,4 @@ defineExpose({
   display: table-column;
 }
 
-
 </style>

+ 3 - 2
src/layout/MenuV2/MenuItemV2.vue

@@ -73,8 +73,9 @@ function menuItem(value, data: IntergrationMenu) {
   if (data.completePath.includes("/$")) {
     data.completePath = data.completePath.replaceAll("$", "")
   }
-  if (data.metaLink && stringNotBlank(data.redirect)) {
-    window.open(<string>data!.redirect, "_blank")
+  if (data.metaLink) {
+    const url = stringNotBlank(data.redirect) ? data.redirect : data.completePath
+    window.open(url, "_blank")
   } else {
     router.push(data.completePath)
   }

+ 13 - 5
src/router/index.ts

@@ -30,23 +30,26 @@ export const routerMenus: Ref<IntergrationMenu[]> = ref([])
 
 const firstLevelRouter = []
 const secondLevelRouter = []
+const appFullscreens = []
 export const secondLevelRouterKey = new Map<string, string[]>()
 
 function emptyRouter(routers: IntergrationMenu[]) {
     routers.forEach((item) => {
         const hasChildren = item.children !== null && item.children.length > 0
-        if (item.component === 'Layout' && hasChildren) {
+        if (item.fullscreen) {
+            appFullscreens.push(item)
+        } else if (item.component === 'Layout' && hasChildren) {
             item.children?.forEach(child => {
                 child.path = item.path + '/' + child.path
                 firstLevelRouter.push(child)
-            })
+            });
         } else if (hasChildren) {
             item.children!.forEach(child => {
                 child.path = child.path.replace(item.path + '/', '')
-            })
-            secondLevelRouter.push(item)
+            });
+            secondLevelRouter.push(item);
         } else {
-            firstLevelRouter.push(item)
+            firstLevelRouter.push(item);
         }
 
         if (item.children !== null && item.children.length > 0) {
@@ -108,6 +111,11 @@ async function beforeAddRoutes() {
             ...convertToRouter(secondLevelRouter),
         ]
     })
+
+    convertToRouter(appFullscreens).forEach(item => {
+        router.addRoute(item)
+    })
+
 }
 
 function createNameComponent(item) {

+ 1 - 1
src/utils/tutorial-driver.ts

@@ -5,7 +5,7 @@ class TutorialDriver {
     private readonly name: string;
     private readonly len: number;
     private idSet: Set<string> = new Set();
-    private hook: () => void;
+    private readonly hook: () => void;
     private flag = true;
 
     constructor(name: string, len: number, hook: () => void) {

+ 0 - 46
src/utils/useFillHeight.ts

@@ -1,46 +0,0 @@
-import {MaybeComputedElementRef, useElementSize, useResizeObserver} from "@vueuse/core";
-import {onUnmounted, ref, computed, shallowRef} from 'vue'
-
-const useFillHeight = (el: MaybeComputedElementRef | MaybeComputedElementRef[]) => {
-    const height = ref(0)
-    const u = useResizeObserver(el, (entries, observer) => {
-        const entry = entries[0]
-        height.value = window.innerHeight - entry.target.getBoundingClientRect().top
-    })
-
-    onUnmounted(() => {
-        u.stop()
-    })
-
-    return {
-        height: height,
-        u
-    }
-}
-
-export const useContentHeader = () => {
-
-    const contentRef = shallowRef()
-    const headerRef = shallowRef()
-
-    const height = computed(() => {
-        return contentHeight.value - headerHeight.value
-    })
-
-    const style = computed(() => {
-        return {height: height.value + 'px'}
-    })
-
-    const {height: contentHeight} = useElementSize(contentRef)
-    const {height: headerHeight} = useElementSize(headerRef)
-
-    return {
-        height,
-        style,
-        contentRef,
-        headerRef
-    }
-
-}
-
-export default useFillHeight

+ 1 - 3
src/views/data-base/data-base-api/DataBase.vue

@@ -52,9 +52,7 @@ onMounted(async () => {
 <template>
   <DataBaseDialog ref="dialogRef"/>
   <iframe :src="MAGIC_API_IFRAME + '/magic/web/index.html'"
-          width="100%"
-          height="100%"
-          style="border: 0"
+          class="layout_full_iframe"
           ref="iframe"/>
 </template>
 

+ 0 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -514,7 +514,6 @@ const oldHighlightConfig = {
   toggleTitle: true
 }
 
-
 const highlightIcon = (message) => {
   const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement
   oldHighlightConfig.title = document.title
@@ -532,7 +531,6 @@ const highlightIcon = (message) => {
 
 }
 
-
 /**
  * 强制踢出接收方
  * @param forceRefreshUserInfo 踢人方的用户信息

+ 2 - 1
src/views/settings/menu-settings/MenuSettings.vue

@@ -61,7 +61,8 @@ function addRouterClick(row: IntergrationMenu | null = null) {
     pathParams: "",
     redirect: "",
     sort: 9999,
-    type: 0
+    type: 0,
+    fullscreen: false,
   });
 }
 

+ 13 - 1
src/views/settings/menu-settings/dialog.vue

@@ -61,7 +61,8 @@ const currentData = ref<IntergrationMenu>({
   pathParams: "",
   redirect: "",
   sort: 0,
-  type: 0
+  type: 0,
+  fullscreen: false,
 })
 
 const fromRef = useCompRef(ElForm)
@@ -338,6 +339,17 @@ defineExpose({
           </el-form-item>
         </el-col>
 
+        <el-col :span="12">
+          <el-form-item label="全屏(不需要侧边栏)">
+            <el-switch v-model="currentData.fullscreen"
+                       :active-value="true"
+                       :inactive-value="false"
+                       active-text="是"
+                       inactive-text="否"
+            />
+          </el-form-item>
+        </el-col>
+
       </el-row>
     </el-form>