Pārlūkot izejas kodu

电子病历填充值问题

xiaochan 2 gadi atpakaļ
vecāks
revīzija
6a3ccaf108

+ 3 - 2
src/utils/emr/edit.ts

@@ -257,9 +257,10 @@ export declare type EditType = {
 
     /**
      * 设置 setApplicatioinContext
-     * @param data
+     * @param data 数据
+     * @param filling 是否填充
      */
-    setApplicationContext: (data: any) => void
+    setApplicationContext: (data: any, filling: boolean) => void
 }
 
 export declare type Runtime = {

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

@@ -517,7 +517,6 @@ const emrEvent = {
       }
     }
 
-    console.log(stringIsBlank(createId) || createId === userInfoStore.value.code)
     if (stringIsBlank(createId) || createId === userInfoStore.value.code) {
       editor.setApplicationContext({
         endpoints: {
@@ -535,10 +534,9 @@ const emrEvent = {
             name: userInfoStore.value.name
           }
         },
-        data: patientInfo.value
-      })
+        data: patientData.value
+      }, true)
     }
-
   },
   'contentchange': (e, op) => {
     if (op.batch.type === 'persist') return
@@ -593,9 +591,11 @@ const emrEvent = {
       openTheTraceByUser(editorCode)
     }
   },
-  "areaBlur": () => {
-    // 区域失去焦点
-    // editor.setRevisionMode('off')
+  "beforeCopy": (evt, data) => {
+    return true
+  },
+  "beforePaste": (evt, data) => {
+    return true
   }
 }
 
@@ -1267,6 +1267,9 @@ const reQueryPatientInformation = () => {
   if (!emrConfig.value.editor) return;
   // 如果是只读模式就不触发这个
   if (readonlyPattern()) return;
+  // 如果病历是空的 且创建人不是自己不触发
+  if (stringIsBlank(createId) || createId !== userInfoStore.value.code) return;
+
   // 如果没有文档 id 就说明是新建的,extractData如果是空就不用调用,不然他会使用 getAppContext 里面的数据
   if (getId() && extractData.value) {
     editor.setValues(extractData.value, true, true)
@@ -1724,34 +1727,13 @@ const emrMittInit = () => {
 }
 
 const initEdit = () => {
-  const appContext = () => {
-    return {
-      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: {}
-    }
-  }
-
   async function timeConsuming(): Promise<void> {
     const end = moment(new Date())
     const start = formatDateToStr(loadingTime.value)
     xcMessage.success(`加载完成耗时${end.diff(start, 'seconds')}秒`)
   }
 
-  useEmrInit(editRef.value, {appContext, event: emrEvent}).then((res) => {
+  useEmrInit(editRef.value, {event: emrEvent}).then((res) => {
     timeConsuming();
     emrMitt.emit('closeProgress')
     editor = res.editor
@@ -1770,6 +1752,8 @@ const hisSaveEmrInit = () => {
   })
 }
 
+
+
 let hisSaveEmr: UseEmrInitReturn = {}
 
 onMounted(async () => {