Browse Source

页面优化

xiaochan 1 year ago
parent
commit
02654bd57c

+ 146 - 0
public/baidumap.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+    <script type="text/javascript"
+            src="https://api.map.baidu.com/api?v=2.0&ak=B74ya3RGhwWIdc8dwN2SfZOYD9G8kXiu"></script>
+    <script src="https://mapv.baidu.com/build/mapv.min.js"></script>
+
+    <meta charset="UTF-8">
+    <title>你好</title>
+
+</head>
+<style>
+    html, body {
+        height: 100%;
+        width: 100%;
+        margin: 0;
+        padding: 0;
+        box-sizing: border-box;
+    }
+</style>
+<body>
+<div id="allmap" style="height: 100%;width: 100%"></div>
+</body>
+
+<script>
+    const thyyLocation = new BMap.Point(112.96716239793697, 28.309655062968343)
+    let thyy = null
+    let event = null
+    let patientInfo = null
+
+    function setIcon(val) {
+        thyy = val
+    }
+
+    function eventFunc(data) {
+        event = data
+    }
+
+    function createADrawing(data) {
+        map.clearOverlays()
+        createAHospitalLogo()
+
+        let points = []
+
+        for (let i = 0, len = data.length; i < len; i++) {
+            let item = data[i];
+            points.push({
+                geometry: {
+                    type: 'Point',
+                    patientData: item,
+                    coordinates: [item.longitude, item.latitude]
+                },
+            })
+        }
+
+        const dataSet = new mapv.DataSet(points);
+
+        const options = {
+            shadowColor: 'rgba(255, 250, 50, 1)',
+            shadowBlur: 10,
+            // 非聚合点的颜色和大小,未设置icon或icon获取失败时使用
+            fillStyle: 'rgba(255, 50, 0, 1.0)',
+            size: 50 / 3 / 2, // 非聚合点的半径
+            minSize: 8, // 聚合点最小半径
+            maxSize: 31, // 聚合点最大半径
+            globalAlpha: 0.8, // 透明度
+            clusterRadius: 150, // 聚合像素半径
+            maxClusterZoom: 18, // 最大聚合的级别
+            maxZoom: 19, // 最大显示级别
+            minPoints: 5, // 最少聚合点数,点数多于此值才会被聚合
+            extent: 400, // 聚合的细腻程度,越高聚合后点越密集
+            label: { // 聚合文本样式
+                show: true, // 是否显示
+                fillStyle: 'white',
+            },
+            gradient: {0: "blue", 0.5: "#28f51a", 1.0: "rgb(255,0,0)"}, // 聚合图标渐变色
+            draw: 'cluster',
+            methods: {
+                click(point) {
+                    if (point?.geometry?.patientData) {
+                        deletePreviousPunctuation()
+                        // 清空上一次的患者信息
+                        if (patientInfo !== null) {
+                            map.removeOverlay(new BMap.Point(patientInfo.longitude, patientInfo.latitude))
+                        }
+                        // 复制下一次患者信息
+                        patientInfo = point?.geometry?.patientData
+                        patientInfo.mapPoint = new BMap.Point(patientInfo.longitude, patientInfo.latitude)
+                        event['pointClick'](patientInfo)
+                        locateThePatient()
+                        marker()
+                    }
+                }
+            }
+        }
+        new mapv.baiduMapLayer(map, dataSet, options);
+
+    }
+
+
+    function deletePreviousPunctuation() {
+        let data = map.getOverlays()
+        for (let i = 0; i < data.length; i++) {
+            let item = data[i]
+            if (data[i].id) {
+                if (data[i].id === patientInfo.patNo) {
+                    map.removeOverlay(item)
+                }
+            }
+        }
+    }
+
+    function locateThePatient() {
+        map.panTo(patientInfo.mapPoint)
+    }
+
+    const marker = () => {
+        const marker = new BMap.Marker(patientInfo.mapPoint);
+        marker.id = patientInfo.patNo
+        map.addOverlay(marker)
+    }
+
+    function createAHospitalLogo() {
+        map.clearOverlays()
+        const myIcon = new BMap.Icon(thyy, new BMap.Size(40, 40));
+        myIcon.setImageSize(new BMap.Size(40, 40))
+        const marker = new BMap.Marker(thyyLocation, {
+            icon: myIcon
+        });
+        map.addOverlay(marker);
+    }
+
+
+    window.onload = () => {
+        // 创建Map实例
+        window.map = new BMap.Map("allmap", {
+            enableMapClick: false
+        });
+        // 初始化地图,设置中心点坐标和地图级别
+        map.centerAndZoom(thyyLocation, 15);
+        // 开启鼠标滚轮缩放
+        map.enableScrollWheelZoom(true);
+    }
+</script>
+</html>

+ 0 - 1
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOrderList.vue

@@ -61,7 +61,6 @@
           <vxe-colgroup title="停止">
             <vxe-column title="时间" field="endTime" min-width="140"/>
             <vxe-column title="医生" field="modifierName" min-width="60"/>
-            <vxe-column title="护士" field="executer1" min-width="60"/>
           </vxe-colgroup>
         </vxe-table>
       </template>

+ 0 - 1
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/DialogDiseases.vue

@@ -547,7 +547,6 @@ import {
 } from "@/api/zhu-yuan-yi-sheng/infectious-diseases";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import {ElMessageBox} from "element-plus";
-import {vxeFormatTime} from "@/utils/vxe-formatter";
 
 const props = defineProps({
   patNo: {

+ 0 - 8
src/router/index.js

@@ -74,14 +74,6 @@ router.beforeEach((to, _from, next) => {
         next(to.meta.parent)
         return
     }
-    if (whiteList.indexOf(to.path) === -1) {
-        const userPaths = [...store.state.user.paths]
-        const toPathArr = to.path.split('/')
-        const target = toPathArr[toPathArr.length - 1]
-        // if (userPaths.indexOf(target) === -1 && userPaths.indexOf('/' + target) === -1) {
-        //     next('/401')
-        // }
-    }
     NProgress.start()
     if (!routesAsynced) {
         addRoutes()

+ 7 - 0
src/utils/emr/edit.ts

@@ -253,6 +253,13 @@ export declare type EditType = {
      * 获取大纲的树状图
      */
     getOutline: () => Outline[];
+
+
+    /**
+     * 设置 setApplicatioinContext
+     * @param data
+     */
+    setApplicationContext: (data: any) => void
 }
 
 export declare type Runtime = {

+ 1 - 1
src/utils/emr/emr-init-v2.ts

@@ -12,7 +12,7 @@ interface Options {
     event?: {
         [key: string]: (...val: any[]) => void
     }
-    tabletMode: boolean
+    tabletMode?: boolean
 }
 
 export interface UseEmrInitReturn {

+ 8 - 10
src/utils/vxe-formatter.ts

@@ -1,12 +1,14 @@
-import {VxeColumnPropTypes} from "vxe-table";
 import {VXETable} from 'vxe-table'
 import XEUtils from "xe-utils";
 
-VXETable.formats.mixin({
-    formatDate({cellValue}, format: string = 'yy-MM-dd HH:mm') {
+VXETable.formats.add('formatDate', {
+    cellFormatMethod({cellValue}, format: string = 'yy-MM-dd HH:mm') {
         return XEUtils.toDateString(cellValue, format)
-    },
-    formatSex({cellValue}) {
+    }
+})
+
+VXETable.formats.add('formatSex', {
+    cellFormatMethod({cellValue}) {
         if (cellValue) {
             if (cellValue == 1) {
                 return '男'
@@ -17,9 +19,5 @@ VXETable.formats.mixin({
             return '其他'
         }
         return ''
-    },
+    }
 })
-
-export const vxeFormatTime: VxeColumnPropTypes.Formatter = ({cellValue}) => {
-    return XEUtils.toDateString(cellValue, 'yy-MM-dd HH:mm')
-}

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

@@ -516,6 +516,29 @@ const emrEvent = {
         emrEditorMounted(categoryCode.value, editor, patientData.value)
       }
     }
+
+    console.log(stringIsBlank(createId) || createId === userInfoStore.value.code)
+    if (stringIsBlank(createId) || createId === userInfoStore.value.code) {
+      editor.setApplicationContext({
+        endpoints: {
+          app: "/bdp/dataservice/api",
+          his: import.meta.env.VITE_BASE_URL,
+        },
+        input: {
+          user: userInfoStore.value.code,
+          name: userInfoStore.value.name
+        },
+        login: {
+          token: userInfoStore.value.token,
+          user: {
+            id: userInfoStore.value.code,
+            name: userInfoStore.value.name
+          }
+        },
+        data: patientInfo.value
+      })
+    }
+
   },
   'contentchange': (e, op) => {
     if (op.batch.type === 'persist') return
@@ -1404,7 +1427,7 @@ const analysisIframeSrcSearch = async () => {
 
 const popupRef = ref<{
   positionChange: (evt: any, view: any, position: any) => void
-} >()
+}>()
 
 const popupFunc = {
   setShortcutKey: () => {
@@ -1718,7 +1741,7 @@ const initEdit = () => {
           name: userInfoStore.value.name
         }
       },
-      data: emrConfig.value.editor ? patientData.value : {}
+      data: {}
     }
   }
 

+ 1 - 1
src/views/reports/patient-distribution/patient-distribution.vue

@@ -123,7 +123,7 @@ onMounted(async () => {
 
     </div>
     <iframe ref="iframeRef" style="width: 100%;height: 100%"
-            src="/src/views/reports/patient-distribution/baidumap.html" class="baidu_iframe"/>
+            src="/baidumap.html" class="baidu_iframe"/>
   </div>
 
 </template>

+ 11 - 25
src/views/system/JumpRedirect.vue

@@ -12,12 +12,16 @@ interface Info {
   code: string
 }
 
+let parseUrl: {
+  searchQuery: any,
+  pathname: string
+}
+
 const openAddress = {
   '/medTecMod/yiJiFeiYongLuRu': () => {
     routerPush(`${info.url}`)
   },
   '/myEmrEditor': () => {
-    const parseUrl = XEUtils.parseUrl(info.url)
     const param = parseUrl.searchQuery
     const data = {
       patNo: param.patNo,
@@ -36,7 +40,6 @@ const openAddress = {
     routerPush(`/myEmrEditor/${window.btoa(JSON.stringify(data))}`)
   },
   '/mzEmr': () => {
-    const parseUrl = XEUtils.parseUrl(info.url)
     const param = parseUrl.searchQuery
     const data = {
       patientId: param.patientId,
@@ -77,24 +80,18 @@ function setMsg(value: string) {
 
 onMounted(async () => {
   info = router.currentRoute.value.query as Info
+  parseUrl = XEUtils.parseUrl(info.url)
 
-  if (info == null) {
-    setMsg('参数不能为空')
-    return
-  }
-
-  if (info.url === null) {
+  if (stringIsBlank(info.url)) {
     setMsg('地址不能为空')
   }
 
-  if (info.code === null) {
+  if (stringIsBlank(info.code)) {
     setMsg('用户编码不能为空')
   }
-  let index = info.url.indexOf("?");
-  let newUrl = (index === -1) ? info.url : info.url.substring(0, index);
 
   try {
-    const func = openAddress[newUrl]
+    const func = openAddress[parseUrl.pathname]
     if (typeof func === 'undefined') {
       setMsg('页面未开放')
     }
@@ -103,24 +100,13 @@ onMounted(async () => {
     }
     func()
   } catch {
-
   }
-
 })
 </script>
 
 <template>
   <el-result
       icon="error"
-      :title="errorMsg"
-      sub-title="错误"
-  >
-    <template #extra>
-      <el-button type="primary">Back</el-button>
-    </template>
-  </el-result>
+      title="错误"
+      :sub-title="errorMsg"/>
 </template>
-
-<style scoped lang="scss">
-
-</style>