Kaynağa Gözat

Merge branch 'master' into test-ca

# Conflicts:
#	src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue
xiaochan 10 ay önce
ebeveyn
işleme
d5f93e3171

+ 0 - 37
public/test.html

@@ -1,37 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Title</title>
-    <style>
-        html, body {
-            height: 100%;
-            width: 100%;
-            margin: 0;
-            padding: 0;
-        }
-
-        iframe {
-            width: 100%;
-            height: 100%;
-            border-style: unset;
-            display: block;
-            padding: 0;
-            margin: 0;
-        }
-
-    </style>
-</head>
-<script>
-    function test() {
-        console.log(123)
-    }
-</script>
-<body>
-<iframe
-        id="iframe"
-        class="layout_full_iframe"
-        src="http://172.16.30.66:5173/#/hospitalEmr?patNo=0425985&times=1"
-/>
-</body>
-</html>

+ 92 - 79
src/App.vue

@@ -1,65 +1,66 @@
 <template>
-  <router-view/>
-  <soctet-dialog v-if="socketErrDialog"/>
-  <progress-bar/>
-  <JsDialogComp/>
-  <CyDialogV2/>
+  <router-view />
+  <SocketDialog v-if="socketErrDialog" />
+  <progress-bar />
+  <JsDialogComp />
+  <CyDialogV2 />
 </template>
 
 <script setup lang="jsx">
-import {setCallback, socketErrDialog} from "@/utils/websocket";
-import {ElMessageBox, ElNotification} from "element-plus";
+import { setCallback, socketErrDialog } from "@/utils/websocket";
+import { ElMessageBox, ElNotification } from "element-plus";
 import sleep from "@/utils/sleep";
-import SoctetDialog from "@/components/xiao-chan/websocket/SoctetDialog.vue";
+import SocketDialog from "@/components/xiao-chan/websocket/SocketDialog.vue";
 import router from "@/router";
 import ProgressBar from "@/components/xiao-chan/progress-bar/ProgressBar.vue";
-import {formatDateToStr} from '@/utils/moment-utils'
-import {ElLink} from 'element-plus'
+import { formatDateToStr } from "@/utils/moment-utils";
+import { ElLink } from "element-plus";
 import JsDialogComp from "@/components/js-dialog-comp/JsDialogComp.vue";
-import {CyMessageBox} from "@/components/cy/message-box";
-import {useProgressBarStore} from "@/pinia/progress-bar-store";
-import {useUserStore} from "@/pinia/user-store";
-import {useSystemStore} from "@/pinia/system-store";
+import { CyMessageBox } from "@/components/cy/message-box";
+import { useProgressBarStore } from "@/pinia/progress-bar-store";
+import { useUserStore } from "@/pinia/user-store";
+import { useSystemStore } from "@/pinia/system-store";
 import useChangeToken from "@/utils/cy-use/useChangeToken";
 import CyDialogV2 from "@/components/cy/CyDialog/index.vue";
 
-const progressBarStore = useProgressBarStore()
-const systemStore = useSystemStore()
+const progressBarStore = useProgressBarStore();
+const systemStore = useSystemStore();
 
-useChangeToken()
+useChangeToken();
 
 progressBarStore.initialize({
-  title: '数据上传',
+  title: "数据上传",
   isOpen: false,
   abnormalClosing: false,
-})
+});
 
 function avatarNotification(data) {
   const message = (
-      <div>
-        <div>
-          科室: {data.deptName}
-        </div>
-        <div>
-          {data.msg}
-        </div>
-      </div>
-  )
+    <div>
+      <div>科室: {data.deptName}</div>
+      <div>{data.msg}</div>
+    </div>
+  );
 
   ElNotification({
-    icon: <img src={data.avatar} style={{width: '32px', height: "32px", borderRadius: '16px'}} alt=""/>,
+    icon: (
+      <img
+        src={data.avatar}
+        style={{ width: "32px", height: "32px", borderRadius: "16px" }}
+        alt=""
+      />
+    ),
     title: data.title,
     message: message,
     dangerouslyUseHTMLString: true,
     duration: 0,
-  })
+  });
 }
 
-
-function checkTheCallbacks({data, isAdd}) {
+function checkTheCallbacks({ data, isAdd }) {
   const message = (
-      <table style="width: 100%">
-        <tbody>
+    <table style="width: 100%">
+      <tbody>
         <tr>
           <td style="padding-right: 8px">患者:</td>
           <td>{data.patientName}</td>
@@ -74,82 +75,94 @@ function checkTheCallbacks({data, isAdd}) {
         </tr>
         <tr>
           <td colspan="2" style="text-ali">
-            <ElLink type="primary" target="_blank"
-                    href={`http://172.16.32.122:8099/mReport?REQUISITIONID=${data.reqNo}`}>
+            <ElLink
+              type="primary"
+              target="_blank"
+              href={`http://172.16.32.122:8099/mReport?REQUISITIONID=${data.reqNo}`}
+            >
               查看图像
             </ElLink>
           </td>
         </tr>
-        </tbody>
-      </table>
-  )
+      </tbody>
+    </table>
+  );
 
   ElNotification({
-    title: isAdd ? '检查结果返回' : '修改检查结果',
+    title: isAdd ? "检查结果返回" : "修改检查结果",
     message: message,
     dangerouslyUseHTMLString: true,
-    type: 'success',
-    position: 'bottom-right',
-    duration: 0
-  })
+    type: "success",
+    position: "bottom-right",
+    duration: 0,
+  });
 }
 
 function systemNotification(data) {
   if (data.count) {
-    systemStore.addUnreadMessageCount(data.count)
+    systemStore.addUnreadMessageCount(data.count);
   }
 
   if (data.refreshDelay) {
     sleep(data.refreshDelay).then(() => {
       location.reload();
-    })
+    });
   }
 
   if (data?.donTDisplay) {
-    return
+    return;
   }
 
   ElNotification({
-    title: data.title ?? '新消息',
-    message: h('pre', {
-      class: 'message_pre'
-    }, data.message),
+    title: data.title ?? "新消息",
+    message: h(
+      "pre",
+      {
+        class: "message_pre",
+      },
+      data.message
+    ),
     dangerouslyUseHTMLString: true,
-    type: data.title ?? 'warning',
+    type: data.title ?? "warning",
     duration: 0,
-  })
+  });
 }
 
 onMounted(() => {
-  setCallback('refreshToken', (data) => {
-    useUserStore().setToken(data.token)
-  })
-
-  setCallback('sidSingle', async () => {
-    localStorage.clear()
-    await router.push('/login')
-    await ElMessageBox.alert('您的账号已在其他地方登陆,如需修改密码请在个人中心中修改。', '提示', {
-      type: 'warning',
-    })
-  })
-
-  setCallback('criticalValue', (data) => {
+  setCallback("refreshToken", data => {
+    useUserStore().setToken(data.token);
+  });
+
+  setCallback("sidSingle", async () => {
+    localStorage.clear();
+    await router.push("/login");
+    await ElMessageBox.alert(
+      "您的账号已在其他地方登陆,如需修改密码请在个人中心中修改。",
+      "提示",
+      {
+        type: "warning",
+      }
+    );
+  });
+
+  setCallback("criticalValue", data => {
     CyMessageBox({
-      title: '患者危急值',
+      title: "患者危急值",
       message: data.message,
-      type: 'error',
-      confirmButtonText: '前往处理',
-      cancelButtonText: '关闭'
-    }).then(() => {
-      router.push(`/inpatient/zhuYuanYiSheng/criticalValue?id=${data.id}`)
-    }).catch(() => {
+      type: "error",
+      confirmButtonText: "前往处理",
+      cancelButtonText: "关闭",
     })
-  })
-
-  setCallback('systemNotification', systemNotification)
-  setCallback('checkTheCallbacks', checkTheCallbacks)
-  setCallback('avatarNotification', avatarNotification);
-})
+      .then(() => {
+        router.push(`/inpatient/zhuYuanYiSheng/criticalValue?id=${data.id}`);
+      })
+      .catch(() => {});
+  });
+
+  setCallback("systemNotification", systemNotification);
+  setCallback("checkTheCallbacks", checkTheCallbacks);
+  setCallback("avatarNotification", avatarNotification);
+});
 </script>
 
 <style lang="scss">

+ 15 - 18
src/components/xiao-chan/websocket/SoctetDialog.vue → src/components/xiao-chan/websocket/SocketDialog.vue

@@ -1,30 +1,28 @@
 <template>
   <div class="dialog_main">
     <div class="loading">
-      <div class="header">
-        服务器断开连接
-      </div>
+      <div class="header">服务器断开连接</div>
       <div class="dialog_body">
-       <span class="svg-icon">
-        <i>
-          <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728="">
-            <path fill="currentColor"
-                  d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path>
-          </svg>
+        <span class="svg-icon">
+          <i>
+            <svg
+              viewBox="0 0 1024 1024"
+              xmlns="http://www.w3.org/2000/svg"
+              data-v-ea893728=""
+            >
+              <path
+                fill="currentColor"
+                d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
+              ></path>
+            </svg>
           </i>
-        <span style="color: red">
-          服务器升级中,重新连接 ...
+          <span style="color: red"> 服务器升级中,重新连接 ... </span>
         </span>
-      </span>
       </div>
     </div>
   </div>
 </template>
 
-<script setup name='SoctetDialog'>
-
-</script>
-
 <style scoped lang="scss">
 .dialog_main {
   position: fixed;
@@ -34,7 +32,7 @@
   left: 0;
   display: flex;
   justify-content: center;
-  background-color: rgba(0, 0, 0, .5);
+  background-color: rgba(0, 0, 0, 0.5);
   z-index: 99;
 
   .header {
@@ -80,7 +78,6 @@
   }
 }
 
-
 @keyframes fadenum {
   100% {
     transform: rotate(360deg);

+ 0 - 7
src/components/zhu-yuan-yi-sheng/emr/emr-template/comp/PatientEmrData.vue

@@ -176,13 +176,6 @@ const nullToEmpty = val => {
 };
 
 const fileName = val => {
-  if (val.jump) {
-    let tempDate = val.trueCreationTime;
-    if (!tempDate) {
-      tempDate = val.createDate;
-    }
-    return val.name + nullToEmpty(val.createName) + nullToEmpty(tempDate);
-  }
   return val.name + nullToEmpty(val.createName) + nullToEmpty(val.createDate);
 };
 </script>

+ 46 - 47
src/directives/v-waves.ts

@@ -1,53 +1,52 @@
-import {DirectiveBinding} from "vue";
+import { DirectiveBinding } from "vue";
 
 const VWaves = {
-    mounted(el: any, binding: DirectiveBinding<any>) {
-        el.classList.add('waves-effect');
-        binding.value && el.classList.add(`waves-${binding.value}`);
+  mounted(el: any, binding: DirectiveBinding) {
+    el.classList.add("waves-effect");
+    binding.value && el.classList.add(`waves-${binding.value}`);
 
-        function setConvertStyle(obj: { [key: string]: unknown }) {
-            let style: string = '';
-            for (let i in obj) {
-                if (obj.hasOwnProperty(i)) style += `${i}:${obj[i]};`;
-            }
-            return style;
-        }
+    function setConvertStyle(obj: { [key: string]: unknown }) {
+      let style: string = "";
+      for (let i in obj) {
+        if (obj.hasOwnProperty(i)) style += `${i}:${obj[i]};`;
+      }
+      return style;
+    }
 
-        function onCurrentClick(e: { [key: string]: unknown }) {
-            let elDiv = document.createElement('div');
-            elDiv.classList.add('waves-ripple');
-            el.appendChild(elDiv);
-            let styles = {
-                left: `${e.layerX}px`,
-                top: `${e.layerY}px`,
-                opacity: 1,
-                transform: `scale(${(el.clientWidth / 100) * 10})`,
-                'transition-duration': `750ms`,
-                'transition-timing-function': `cubic-bezier(0.250, 0.460, 0.450, 0.940)`,
-            };
-            elDiv.setAttribute('style', setConvertStyle(styles));
-            setTimeout(() => {
-                elDiv.setAttribute(
-                    'style',
-                    setConvertStyle({
-                        opacity: 0,
-                        transform: styles.transform,
-                        left: styles.left,
-                        top: styles.top,
-                    })
-                );
-                setTimeout(() => {
-                    elDiv && el.removeChild(elDiv);
-                }, 750);
-            }, 450);
-        }
+    function onCurrentClick(e: { [key: string]: unknown }) {
+      let elDiv = document.createElement("div");
+      elDiv.classList.add("waves-ripple");
+      el.appendChild(elDiv);
+      let styles = {
+        left: `${e.layerX}px`,
+        top: `${e.layerY}px`,
+        opacity: 1,
+        transform: `scale(${(el.clientWidth / 100) * 10})`,
+        "transition-duration": `750ms`,
+        "transition-timing-function": `cubic-bezier(0.250, 0.460, 0.450, 0.940)`,
+      };
+      elDiv.setAttribute("style", setConvertStyle(styles));
+      setTimeout(() => {
+        elDiv.setAttribute(
+          "style",
+          setConvertStyle({
+            opacity: 0,
+            transform: styles.transform,
+            left: styles.left,
+            top: styles.top,
+          })
+        );
+        setTimeout(() => {
+          elDiv && el.removeChild(elDiv);
+        }, 750);
+      }, 450);
+    }
 
-        el.addEventListener('mousedown', onCurrentClick, false);
-    },
-    unmounted(el: HTMLElement) {
-        el.addEventListener('mousedown', () => {
-        });
-    },
-}
+    el.addEventListener("mousedown", onCurrentClick, false);
+  },
+  unmounted(el: HTMLElement) {
+    el.addEventListener("mousedown", () => {});
+  },
+};
 
-export default VWaves
+export default VWaves;

+ 80 - 80
src/pinia/user-store.ts

@@ -1,88 +1,88 @@
 //@ts-nocheck
-import {defineStore} from 'pinia';
-import {getUserInfoByCode} from "@/api/login";
-import {useSystemStore} from "@/pinia/system-store";
+import { defineStore } from "pinia";
+import { getUserInfoByCode } from "@/api/login";
+import { useSystemStore } from "@/pinia/system-store";
 
 export declare type UserInfo = {
-    avatar: string;
-    token: string;
-    sid: string;
-    ip: string;
-    menus: string[]; // 菜单列表,字符串数组
-    code: string;
-    codeRs: string;
-    name: string;
-    deptCode: string;
-    deptName: string;
-    ybCode: string;
-    roles: number[]; // 角色列表,字符串数组
-    partTimeDept: string[]; // 兼职部门列表,字符串数组
-    partTimeDeptCode: string;
-    partTimeDeptName: string;
-    partTimeDeptMap: Record<string, string>; // 兼职部门映射,键为部门编码,值为部门名称
+  avatar: string;
+  token: string;
+  sid: string;
+  ip: string;
+  menus: string[]; // 菜单列表,字符串数组
+  code: string;
+  codeRs: string;
+  name: string;
+  deptCode: string;
+  deptName: string;
+  ybCode: string;
+  roles: number[]; // 角色列表,字符串数组
+  partTimeDept: string[]; // 兼职部门列表,字符串数组
+  partTimeDeptCode: string;
+  partTimeDeptName: string;
+  partTimeDeptMap: Record<string, string>; // 兼职部门映射,键为部门编码,值为部门名称
 };
 
-let initUserInfo = false
+let initUserInfo = false;
 
-export const useUserStore = defineStore('user', {
-    state: (): {
-        userInfo: UserInfo,
-        randomSid: string
-    } => ({
-        userInfo: {
-            avatar: '',
-            token: '',
-            sid: '',
-            ip: '',
-            menus: [],
-            code: '',
-            codeRs: '',
-            name: '',
-            deptCode: '',
-            deptName: '',
-            ybCode: '',
-            roles: [],
-            partTimeDept: [],
-            partTimeDeptCode: '',
-            partTimeDeptName: '',
-            partTimeDeptMap: {}
-        },
-        randomSid: ''
-    }),
-    getters: {
-        getUserInfo: async (state): Promise<boolean> => {
-            if (initUserInfo) return true
-            if (localStorage.token !== null) {
-                const userInfo = await getUserInfoByCode().catch(() => {
-                    return null
-                })
-                if (userInfo !== null) {
-                    state.userInfo = userInfo
-                    useSystemStore().setConfig(userInfo.userConfigJson)
-                    initUserInfo = true
-                    return true
-                } else {
-                    return false
-                }
-            }
-        },
-        getToken: () => {
-            return localStorage.token
-        },
-        getSid(state): string {
-            return state.userInfo.sid + state.randomSid
-        },
+export const useUserStore = defineStore("user", {
+  state: (): {
+    userInfo: UserInfo;
+    randomSid: string;
+  } => ({
+    userInfo: {
+      avatar: "",
+      token: "",
+      sid: "",
+      ip: "",
+      menus: [],
+      code: "",
+      codeRs: "",
+      name: "",
+      deptCode: "",
+      deptName: "",
+      ybCode: "",
+      roles: [],
+      partTimeDept: [],
+      partTimeDeptCode: "",
+      partTimeDeptName: "",
+      partTimeDeptMap: {},
     },
-    actions: {
-        setToken(val: string) {
-            localStorage.token = val
-        },
-        setUserInfo(val: UserInfo) {
-            localStorage.token = val.token
-            this.userInfo = val
-        },
-        setRandomSid(val: string) {
-            this.randomSid = val
+    randomSid: "",
+  }),
+  getters: {
+    getUserInfo: async (state): Promise<boolean> => {
+      if (initUserInfo) return true;
+      if (localStorage.token !== null) {
+        const userInfo = await getUserInfoByCode().catch(() => {
+          return null;
+        });
+        if (userInfo !== null) {
+          state.userInfo = userInfo;
+          useSystemStore().setConfig(userInfo.userConfigJson);
+          initUserInfo = true;
+          return true;
+        } else {
+          return false;
         }
-    }
-})
+      }
+    },
+    getToken: () => {
+      return localStorage.token;
+    },
+    getSid(state): string {
+      return state.userInfo.sid + state.randomSid;
+    },
+  },
+  actions: {
+    setToken(val: string) {
+      localStorage.token = val;
+    },
+    setUserInfo(val: UserInfo) {
+      localStorage.token = val.token;
+      this.userInfo = val;
+    },
+    setRandomSid(val: string) {
+      this.randomSid = val;
+    },
+  },
+});

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

@@ -1,11 +1,11 @@
 // @ts-nocheck
-import {EditType, Runtime} from './edit'
-import {UnwrapRef} from 'vue'
-import {BizException, ExceptionEnum} from "../BizException";
-import {ElMessageBox} from "element-plus";
+import { EditType, Runtime } from "./edit";
+import { UnwrapRef } from "vue";
+import { BizException, ExceptionEnum } from "../BizException";
+import { ElMessageBox } from "element-plus";
 import XEUtils from "xe-utils";
 import useDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
-import {magicApi} from "@/utils/database/magic-api-request";
+import { magicApi } from "@/utils/database/magic-api-request";
 
 const GenerateSignature = defineAsyncComponent(() =>
     import("@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/GenerateSignature.vue"))
@@ -268,7 +268,7 @@ async function useHandleMdt(evt, view, patientData) {
     let value = view.value
 
     if (XEUtils.isArray(value)) {
-        value = XEUtils.eachAndReturnList(value, (item) => {
+        value = XEUtils.map(value, (item) => {
             return item.cascader
         })
     } else {

+ 9 - 4
src/views/clinic/interactive/QuestionnaireV2.vue

@@ -6,8 +6,13 @@
         <el-option label="急诊" value="EMERGENCY"></el-option>
         <el-option label="住院" value="INPATIENT"></el-option>
       </el-select>
-      <el-date-picker type="daterange" v-model="dateRange" style="width: 200px" start-placeholder="开始日期"
-                      end-placeholder="结束日期"></el-date-picker>
+      <el-date-picker
+          type="daterange"
+          v-model="dateRange"
+          style="width: 200px"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+      ></el-date-picker>
       <el-divider direction="vertical"></el-divider>
       <el-checkbox v-model="inquiry.onlyShowUnsatisfied" @change="handleSatisfiedChange">只看含有“不满意”的问卷
       </el-checkbox>
@@ -17,7 +22,7 @@
       </el-button>
       <el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
     </header>
-    <div class="layout_container layout_el-table">
+    <div class="layout_main layout_el-table">
       <el-table :data="assessments.listV2" stripe highlight-current-row>
         <el-table-column prop="patientId" label="门诊号" width="70"></el-table-column>
         <el-table-column v-if="inquiry.visitType === 'INPATIENT'" prop="zykshl" label="住院科室护理"></el-table-column>
@@ -939,7 +944,7 @@ const dateRange = ref([])
 const formatDateRange = () => {
   if (dateRange.value.length === 2) {
     const format = getDateRangeFormatDate(dateRange.value)
-    inquiry.yystart = format.yystartTime
+    inquiry.start = format.startTime
     inquiry.end = format.endTime
   }
 }

+ 13 - 3
src/views/examination/component/JyResult.vue

@@ -91,15 +91,25 @@
         <div style="width: 75%">结果</div>
       </div>
       <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+      <div
+          v-if="data.inspectionDetail?.items.length > 0"
+          style="margin: 0 30px;"
+          v-for="item in data.inspectionDetail.items"
+      >
+        <div style="display: flex;width: 70%;margin: 2px 0">
+          <div style="width: 32%">{{ item.itmName }}</div>
+          <div style="width: 66%">{{ item.rsltStrs }}</div>
+        </div>
+      </div>
       <div
           v-if="data.bacterias.length > 0"
           style="margin: 0 30px; padding-bottom: 5px;"
           v-for="(antibioticItem,index) in data.bacterias"
           :style="index > 0 ? {borderTop: '1px dashed gray'} : {}"
       >
-        <div style="display: flex;width: 49.7%;margin: 8px 0 4px 0">
-          <div style="width: 33.33%">{{ antibioticItem.type }}</div>
-          <div style="width: 60%">{{ antibioticItem.germName }}</div>
+        <div style="display: flex;width: 70%;margin: 8px 0 4px 0">
+          <div style="width: 32%">{{ antibioticItem.type }}</div>
+          <div style="width: 66%">{{ antibioticItem.germName }}</div>
         </div>
         <div style="display: inline-block; width: 49.7%; vertical-align: top">
           <div style="display: flex">

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

@@ -404,6 +404,7 @@ const emrEvent = {
     if (!isCourse()) {
       openTheTraceByUser(createId);
     }
+    courseJump();
     // 可以编辑的才能触发
     if (emrConfig.value.editor) {
       // 只有是空的才触发
@@ -598,11 +599,11 @@ const sendEmrSocketMessageAndHighlight = (message, flag, userInfo) => {
 const oldHighlightConfig = {
   icon: "",
   title: "",
-  interval: 0,
+  interval: null as NodeJS.Timeout,
   toggleTitle: true,
 };
 
-const highlightIcon = message => {
+const highlightIcon = (message: string) => {
   const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
   oldHighlightConfig.title = document.title;
   oldHighlightConfig.icon = link.href;
@@ -1132,27 +1133,20 @@ const courseSegmentLocking = async () => {
   const courseTitles = [];
 
   循环病程返回数据元((value, node) => {
-    let fragment = node.getAttribute("fragment");
     const tmpInfo = getBcjlUserInfo(value);
-    let pushData = {
-      code: "查房时间",
+    const pushData = {
       name: value["查房标题"]?.value,
-      value: value["查房时间"]?.value,
       emrDocumentId: getId(),
       emrCategoryCode: categoryCode.value,
-      jump: true,
       createName: tmpInfo.name,
       createDate: value["查房时间"]?.value,
       createId: tmpInfo.code,
       type: "category",
-      trueCreationTime: "",
+      jump: true,
+      courseJumpId: value["查房时间"].id,
     };
-    if (fragment != null) {
-      pushData.trueCreationTime = fragment?.creationTime;
-    }
     courseTitles.push(pushData);
     if (emrConfig.value.editor) {
-      // lockNode(node, pushData)
       node.view.setReadonly(false);
       node.view.setDeletable(true);
     } else {
@@ -1163,6 +1157,27 @@ const courseSegmentLocking = async () => {
   emrSidebarRef.value!.diseaseDurationRecordTime(getId(), courseTitles);
 };
 
+function courseJump() {
+  if (emrStore.store.courseJumpId) {
+    jumpById(emrStore.store.courseJumpId);
+    emrStore.store.courseJumpId = null;
+  }
+}
+
+function jumpById(id: string) {
+  const find = emrStore.store.editor?.view?.container?.find(`#${id}`);
+  if (XEUtils.isEmpty(find)) {
+    return;
+  }
+  const element = find[0];
+  if (element) {
+    element.view.focusEnter();
+    emrStore.store.editor.scrollToCursor();
+    emrStore.store.editor.highlight(element.view, 1500);
+    emrStore.store.editor.scrollToCursor(true);
+  }
+}
+
 /**
  * 重新设置提取的数据, 这里是强制替换
  */
@@ -1200,30 +1215,6 @@ function syncDisabled() {
   }
 }
 
-function lockNode(node, nodeInfo) {
-  const editorCode = nodeInfo.createId;
-  // 如果这个为空的话,就让她删了重新写,只能删除不能写
-  if (stringIsBlank(editorCode)) {
-    node.view.setReadonly(false);
-    node.view.setDeletable(true);
-  } else {
-    const isEdit = emrEditCreateLimit.isEdit(editorCode);
-    if (isEdit) {
-      node.view.setReadonly(false);
-      //  自己创建的病历片段才可以删除
-      node.view.setDeletable(editorCode === userInfo.code);
-    } else {
-      node.view.setReadonly(true);
-      node.view.setDeletable(false);
-    }
-  }
-  // 测试环境下面随便删除
-  if (isDev) {
-    node.view.setReadonly(false);
-    node.view.setDeletable(true);
-  }
-}
-
 /**
  * 单击“提交病历”
  */
@@ -1268,7 +1259,7 @@ const readonlyPattern = () => {
 };
 
 // 判断 一级 二级 三级医生
-let doctorLevel = ref(1);
+const doctorLevel = ref(1);
 const doctorLevelFunc = () => {
   doctorLevel.value = emrEditCreateLimit.getDoctorLevelById(userInfo.code);
   createLevel.value = emrEditCreateLimit.getDoctorLevelById(createId);
@@ -1506,6 +1497,8 @@ const loadDocument = (param: EmrParam): Promise<void> => {
       return;
     }
     if (param.documentId && getId() === param.documentId) {
+      emrStore.store.courseJumpId = param.courseJumpId;
+      courseJump();
       resolve();
       return;
     }
@@ -1517,10 +1510,18 @@ const loadDocument = (param: EmrParam): Promise<void> => {
       createId = param.createId;
       parent = param.parent;
       createName.value = param.createName as string;
+      emrStore.store.courseJumpId = param.courseJumpId;
       emrMitt.emit(
         "changeRightTabs",
         isCourse() ? EmrRightTabs.fragment : EmrRightTabs.outline
       );
+      emrMitt.emit("auditV2", {
+        patNo: patientInfo.value.inpatientNo,
+        times: patientInfo.value.admissTimes,
+        emrId: param?.id,
+        finalControl: patientInfo.value.finalControl,
+        emrCategoryCode: param.categoryCode,
+      });
     }
 
     await checkEmrChange();
@@ -1573,8 +1574,6 @@ const emrMittInit = () => {
     return editMain!.iframe;
   });
 
-  emrMitt.on("fragmentJump", fragmentJump);
-
   emrMitt.on("setShowIframe", val => {
     showIframe.value = val;
   });
@@ -1678,122 +1677,7 @@ const initEdit = () => {
     emrStore.cache.open();
     setRevisionShowMode(userConfig.emr_review_mode);
     if (isDev) {
-      editor.execute("insertContents", {
-        value: [
-          {
-            required: false,
-            readonly: false,
-            deletable: true,
-            privacy: false,
-            script: {
-              content: null,
-              dynamicScript: "2154eae0167611ef8717efceee160e36",
-            },
-            format: {
-              dataType: null,
-              showType: null,
-              minLength: null,
-              maxLength: null,
-              minRows: null,
-              maxRows: null,
-              scale: null,
-              enums: null,
-              dictionary: null,
-            },
-            element: {
-              type: "element",
-              name: "编辑者签名",
-              code: {
-                business: "",
-                internal: "编辑者签名",
-                dataElement: "",
-              },
-              labels: "",
-            },
-            tips: "编辑者签名",
-            borderStyle: "none",
-            style: {
-              id: "dcTzLm3tAs",
-            },
-            picker: {
-              type: null,
-              propertiesConfig: {
-                signCount: {
-                  name: "签名数量",
-                  code: "signCount",
-                  category: "extend",
-                  categoryName: "扩展",
-                  value: 1,
-                  editor: {
-                    type: "numberfield",
-                    minvalue: 1,
-                  },
-                },
-                maxHeight: {
-                  name: "最大高度",
-                  code: "maxHeight",
-                  category: "extend",
-                  categoryName: "扩展",
-                  editor: {
-                    type: "numberfield",
-                  },
-                },
-                valign: {
-                  name: "对齐方式",
-                  code: "valign",
-                  category: "extend",
-                  categoryName: "扩展",
-                  editor: {
-                    type: "select",
-                    valueField: "code",
-                    displayField: "name",
-                    store: {
-                      type: "store",
-                      fields: ["code", "name"],
-                      data: [
-                        {
-                          code: "top",
-                          name: "上对齐",
-                        },
-                        {
-                          code: "middle",
-                          name: "中对齐",
-                        },
-                        {
-                          code: "bottom",
-                          name: "下对齐",
-                        },
-                      ],
-                    },
-                  },
-                },
-              },
-            },
-            editable: false,
-            contentWrap: true,
-            signCount: 1,
-            type: "smarttext",
-          },
-        ],
-        isPuzzlepiece: true,
-        defaultValue: [
-          {
-            signature: "asdsad",
-            name: "我去",
-          },
-        ],
-      });
       // emrStore.mutation.installPlugins(res);
-      // sleep(500).then(() => {
-      //   emrMitt.emit("loadTemplate", {
-      //     parent: "fb4c44f057ff11eda93f1fd7ab32baa6",
-      //     code: "ffc98fb057ff11eda93f1fd7ab32baa6",
-      //     name: "化验结果粘贴单",
-      //     description: "",
-      //     _id: "03cd3da0580011eda93f1fd7ab32baa6",
-      //     type: "category",
-      //   });
-      // });
     }
   });
 };
@@ -1876,7 +1760,7 @@ const openOrClosePage = val => {
  * 解析病程记录,改变val病程记录只要首次的下面的片段不管
  * @param val 传入的值
  */
-const 解析病程记录 = val => {
+const 解析病程记录: any[] = val => {
   if (!isCourse()) {
     return [];
   }

+ 5 - 18
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrSidebar.tsx

@@ -19,6 +19,7 @@ import {
   canIUnlockIt,
   emrConfig,
   emrMitt,
+  EmrParam,
   patientInfo,
   unlockEnum,
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
@@ -283,7 +284,8 @@ const EmrSidebar = defineComponent({
     };
 
     function saveEmr(val: any) {
-      const data = {
+      const data: EmrParam = {
+        ...val,
         categoryCode: val.emrCategoryCode,
         categoryId: val._id,
         patientId:
@@ -293,23 +295,9 @@ const EmrSidebar = defineComponent({
         templateName: val.name,
         createId: val.createId,
         createName: val.createName,
-        trueCreationTime: null,
+        courseJumpId: val.courseJumpId,
       };
-      if (val.jump) {
-        data.trueCreationTime = val.value;
-        // @ts-ignore
-        emrMitt.emit("fragmentJump", data);
-      } else {
-        emrMitt.emit("auditV2", {
-          patNo: patientInfo.value.inpatientNo,
-          times: patientInfo.value.admissTimes,
-          emrId: val.id,
-          finalControl: patientInfo.value.finalControl,
-          emrCategoryCode: val.emrCategoryCode,
-        });
-        // @ts-ignore
-        emrMitt.emit("loadDocument", data);
-      }
+      emrMitt.emit("loadDocument", data);
     }
 
     emrMitt.on("loadTemplate", template);
@@ -362,7 +350,6 @@ const EmrSidebar = defineComponent({
           item.children = roundTimes;
           return;
         }
-
         if (item.children) {
           findMedicalRecordById(id, roundTimes, item.children);
         }

+ 3 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init.ts

@@ -595,9 +595,10 @@ export interface EmrParam extends LoadParams {
   createId?: string | null;
   // 创建人姓名
   createName?: string;
-  trueCreationTime?: string;
+  // 父节点
   parent: string;
-  categoryId: string;
+  // 病程记录跳转节点
+  courseJumpId?: string;
 }
 
 export interface Audit {
@@ -630,7 +631,6 @@ export interface EmrMitt {
   querySidebar: () => void;
   editor: () => EditType;
   getIframe: () => HTMLIFrameElement;
-  fragmentJump: (param: EmrParam) => void;
   setShowIframe: (val: number) => void;
   只读病历: (id: string) => void;
   loadDocument: (param: EmrParam) => void;

+ 4 - 8
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/useEmrStore.ts

@@ -38,6 +38,8 @@ export const useEmrStore = (patId: string) => {
     currentPlugins: {} as ReturnPlugins,
     plugins: [] as ReturnPlugins[],
     right: EmrRightTabs.fragment,
+    courseJumpId: null,
+    editor: null as EditType,
   });
 
   const plugins = getPlugins();
@@ -48,6 +50,7 @@ export const useEmrStore = (patId: string) => {
     },
     setEditor(value: EditType) {
       editor = value;
+      store.editor = editor;
     },
     setOutline(value: Outline[]) {
       outline.value = value;
@@ -169,11 +172,7 @@ export const useEmrStore = (patId: string) => {
     patInfo,
     emrPatientData,
     mutation,
-    editor,
     outline,
-    getEditor(): EditType {
-      return editor as EditType;
-    },
     cache,
     plugins,
     store,
@@ -181,11 +180,8 @@ export const useEmrStore = (patId: string) => {
   };
 };
 
-class HelperStore {
-  Return = useEmrStore("");
-}
+type PageStore = ReturnType<typeof useEmrStore>;
 
-type PageStore = HelperStore["Return"];
 export type { PageStore };
 
 interface EmrRootContext {

+ 90 - 65
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/InspectionRequisition.vue

@@ -15,48 +15,51 @@
         <el-col :span="12">
           <el-form-item class="bi_tian" label="检查时间:">
             <el-date-picker
-                v-model="props.data.startTime"
-                ref="checkTheTimeRef"
-                format="YYYY-MM-DD HH:mm:ss"
-                style="width: 180px"
-                type="datetime"
-                value-format="YYYY-MM-DD HH:mm:ss">
+              v-model="props.data.startTime"
+              ref="checkTheTimeRef"
+              format="YYYY-MM-DD HH:mm:ss"
+              style="width: 180px"
+              type="datetime"
+              value-format="YYYY-MM-DD HH:mm:ss"
+            >
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item class="bi_tian" label="执行科室:">
             <xc-select-v3
-                style="width: 120px"
-                v-model="props.data"
-                :data="zhiXingKeShiData"
-                code="execDept"
-                name="execDeptName"
-                :remote-method="metZhiXingKeShi"/>
+              style="width: 120px"
+              v-model="props.data"
+              :data="zhiXingKeShiData"
+              code="execDept"
+              name="execDeptName"
+              :remote-method="metZhiXingKeShi"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="急诊:">
             <el-switch
-                v-model="props.data.jzFlag"
-                :active-value="1"
-                :inactive-value="0"
-                active-color="#13ce66"
-                active-text="急诊"
-                inactive-color="#ff4949"
-                inactive-text="普通"/>
+              v-model="props.data.jzFlag"
+              :active-value="1"
+              :inactive-value="0"
+              active-color="#13ce66"
+              active-text="急诊"
+              inactive-color="#ff4949"
+              inactive-text="普通"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="自费:">
             <el-switch
-                v-model="props.data.ybSelfFlag"
-                :active-value="1"
-                :inactive-value="0"
-                active-color="#13ce66"
-                active-text="自费"
-                inactive-color="#ff4949"
-                inactive-text="医保"
+              v-model="props.data.ybSelfFlag"
+              :active-value="1"
+              :inactive-value="0"
+              active-color="#13ce66"
+              active-text="自费"
+              inactive-color="#ff4949"
+              inactive-text="医保"
             >
             </el-switch>
           </el-form-item>
@@ -64,20 +67,33 @@
         <el-col v-if="jianCha" :span="12">
           <el-form-item class="bi_tian" label="临床诊断:" prop="diagCode">
             <xc-select-v3
-                v-model="props.data"
-                :data="props.diagnosis"
-                :remote-method="searchDiagnostics"
-                code="diagCode"
-                name="diagText"/>
+              v-model="props.data"
+              :data="props.diagnosis"
+              :remote-method="searchDiagnostics"
+              code="diagCode"
+              name="diagText"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="24">
           <el-form-item v-if="!jianCha" class="bi_tian" label="标本:">
-            <el-select v-model="props.data.inspectStuff"
-                       :remote-method="specimenSearch" clearable filterable
-                       remote @change="bianBenMing">
-              <el-option v-for="item in biaoBenShuJu" :key="item.code" :label="item.name" :value="item.code">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
+            <el-select
+              v-model="props.data.inspectStuff"
+              :remote-method="specimenSearch"
+              clearable
+              filterable
+              remote
+              @change="bianBenMing"
+            >
+              <el-option
+                v-for="item in biaoBenShuJu"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              >
+                <span style="color: #8492a6; font-size: 12px">{{
+                  item.code
+                }}</span>
                 <el-divider direction="vertical"></el-divider>
                 <span>{{ item.name }}</span>
               </el-option>
@@ -85,24 +101,39 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item :label="jianCha ? '病史摘要:' : '申请说明'" class="bi_tian">
-            <el-input v-model="props.data.reqComment" :rows="6" maxlength="125" show-word-limit
-                      type="textarea"></el-input>
+          <el-form-item
+            :label="jianCha ? '病史摘要:' : '申请说明'"
+            class="bi_tian"
+          >
+            <el-input
+              v-model="props.data.reqComment"
+              :rows="6"
+              maxlength="125"
+              show-word-limit
+              type="textarea"
+            ></el-input>
           </el-form-item>
         </el-col>
-        <!--        <el-col v-if="jianCha" :span="12">-->
-        <!--          <el-button @click="daKaiShuoMingMuBan">说明模板</el-button>-->
-        <!--        </el-col>-->
         <el-col v-if="jianCha" :span="24">
           <el-form-item class="bi_tian" label="体征信息:">
-            <el-input v-model="props.data.reqTzComment" :rows="6" maxlength="125" show-word-limit
-                      type="textarea"></el-input>
+            <el-input
+              v-model="props.data.reqTzComment"
+              :rows="6"
+              maxlength="125"
+              show-word-limit
+              type="textarea"
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col v-if="jianCha" :span="24">
           <el-form-item class="bi_tian" label="相关辅检结果:">
-            <el-input v-model="props.data.reqOtherResult" :rows="6" maxlength="125" show-word-limit
-                      type="textarea"></el-input>
+            <el-input
+              v-model="props.data.reqOtherResult"
+              :rows="6"
+              maxlength="125"
+              show-word-limit
+              type="textarea"
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
@@ -110,11 +141,11 @@
   </div>
 </template>
 
-<script setup name='InspectionRequisition'>
+<script setup name="InspectionRequisition">
 // 编辑检验检查
 import XcSelectV3 from "@/components/xiao-chan/select-v3/XcSelectV3";
-import {ref} from "vue";
-import {huoQuZhiXinKeShi} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import { ref } from "vue";
+import { huoQuZhiXinKeShi } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 
 const props = defineProps({
   jianCha: {
@@ -127,28 +158,22 @@ const props = defineProps({
   // 临床诊断搜索
   searchDiagnostics: {
     type: Function,
-    default: (val) => {
-    }
+    default: val => {},
   },
   // 标本搜索
   specimenSearch: {
     type: Function,
-    default: (val) => {
-    }
+    default: val => {},
   },
-})
-
+});
 
 /* 获取执行科室 */
-const zhiXingKeShiData = ref([])
-const metZhiXingKeShi = (val) => {
-  huoQuZhiXinKeShi(val).then((res) => {
-    zhiXingKeShiData.value = res
-  })
-}
-
+const zhiXingKeShiData = ref([]);
+const metZhiXingKeShi = val => {
+  huoQuZhiXinKeShi(val).then(res => {
+    zhiXingKeShiData.value = res;
+  });
+};
 </script>
 
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>