Forráskód Böngészése

电子病历优化和其他页面优化

xiaochan 2 éve
szülő
commit
818feccd13

+ 48 - 1
src/api/jian-yan-jie-kou/jian-yan-jie-kou.ts

@@ -4,8 +4,10 @@ const URL = '/jianYanJieKou'
 
 export interface SidebarData {
     reportId: string;
+    // 检验名称
     examPurpose: string;
     trscDate: string;
+    reportType: string
 }
 
 export interface InspectionHeader {
@@ -23,6 +25,51 @@ export interface InspectionHeader {
     audt_time: string;
     test_usr_name: string;
     audt_usr_name: string;
+    ptnt_name: string
+}
+
+
+export interface Measurement {
+    critical_exec_info: string;
+    critical_low: string;
+    critical_exec_flag: number;
+    range: string;
+    itm_src_value: string;
+    item_src_flow_id: number;
+    itm_name: string;
+    calc_fomula: string;
+    range_str: string;
+    rslt_list_id: number;
+    itm_id: number;
+    critical_exec_time: string;
+    prnt_grup: number;
+    is_num: number;
+    map_pis_code: string;
+    rslt_name: string;
+    itm_unit: string;
+    mthd_name: string;
+    defl_rslt_id: number;
+    is_null: number;
+    range_low: string;
+    itm_str_src_value: string;
+    range_high: string;
+    calc_type: number;
+    calc_fomula_items: string;
+    res_type: number;
+    itm_ordr: number;
+    itm_str_value: string;
+    critical_alert: string;
+    critical_high: string;
+    itm_alert: string;
+    dec_bit: number;
+    rslt_id: number;
+    range_rslt_id: number;
+    other_flag_a: number;
+    itm_code: string;
+    itm_value: string;
+    other_flag_c: number;
+    other_flag_b: number;
+    anti_list?: any[]
 }
 
 export function getNormal(data: { patientNum: string, startDate: string, endDate: string }) {
@@ -34,7 +81,7 @@ export function getNormal(data: { patientNum: string, startDate: string, endDate
 }
 
 export function getDetail(reportId: string) {
-    return requestV2<{ order: InspectionHeader, items: any[] }>({
+    return requestV2<{ order: InspectionHeader, items: Measurement[] }>({
         url: URL + '/getDetail',
         method: 'get',
         params: {reportId}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 107
src/assets/http_mapv.baidu.com_build_mapv.js


+ 5 - 1
src/components/zhu-yuan-yi-sheng/YzTag.vue

@@ -70,7 +70,11 @@ let pathList = $ref([
         let te = JSON.stringify(query)
         window.open(window.location.origin + '/myEmrEditor/' + window.btoa(te) + '/refresh', '_blank');
       } else {
-        window.open(window.location.origin + '/myEmrEditor/refresh', '_blank');
+        ElMessageBox.alert('请先选择一个患者,出院患者可以在患者信息查询中看到。', '提示', {
+          type: 'error'
+        }).finally(() => {
+
+        })
       }
     }
   },

+ 0 - 1
src/components/zhu-yuan-yi-sheng/emr/HistoricalEmr.vue

@@ -43,7 +43,6 @@
 import XcDialogV2 from "../../../components/xiao-chan/dialog/XcDialogV2.vue";
 import {nextTick, onMounted, ref} from "vue";
 import {
-  EMRInteractive,
   emrMitt
 } from '@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init'
 import {getFormatDatetime} from '@/utils/date'

+ 1 - 2
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTest.vue

@@ -319,8 +319,7 @@ function getItemStr(val, strValue, value) {
 onMounted(async () => {
   dateRange.value = await currentAndAFewDaysAgo()
   await query()
-  // todo 检验接口没有返回危急值。
-  // let res = await getCriticalValueByPatInfo(patNo, times)
+
 })
 
 </script>

+ 119 - 0
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/BacterialCultureTable.vue

@@ -0,0 +1,119 @@
+<script setup lang="ts">
+import {useCompRef} from "@/utils/useCompRef";
+import {ElTable} from "element-plus";
+import {computed, ref} from "vue";
+
+const props = defineProps<{
+  height: number
+}>()
+
+const tableRef = useCompRef(ElTable)
+const data = ref<{
+  bacterias?: any[]
+  items?: []
+}>({})
+
+const selectedData = () => {
+  const temp = tableRef.value.getSelectionRows() as any[];
+  let data = ''
+  if (temp) {
+    temp.forEach((item, index) => {
+      const {itm_name, rslt_strs, bac_name_cn} = item
+      data += `${itm_name}:${rslt_strs}${bac_name_cn},` + getSubtableSelectData(index)
+    })
+  }
+  return data
+}
+
+const getSubtableSelectData = (index) => {
+  let data = ''
+  if (!withResults.value) return data
+  const t = table['table' + index]
+  const temp = t.getSelectionRows() as any[];
+  if (!temp) return data
+
+  temp.forEach(item => {
+    const {anti_name_cn, anti_abb, anti_mic, anti_str} = item
+    data += `${anti_name_cn}${anti_abb}${anti_mic}${anti_str},`
+  })
+
+  data = '结果:' + data
+  return data
+}
+
+const withResults = ref<boolean>(false)
+const title = ref('')
+
+const setData = (val) => {
+  table = {}
+  data.value = val
+  withResults.value = val.bacterias.length > 0
+  title.value = withResults.value ? '有培养结果,又有细菌鉴定结果' : '有培养结果,但无细菌鉴定结果'
+}
+
+const tempData = computed(() => {
+  return withResults.value ? data.value.bacterias : data.value.items
+})
+
+const rowClick = (row) => {
+  const temp = tableRef.value.getSelectionRows()
+  tableRef.value.toggleRowSelection(row, !temp.includes(row))
+}
+
+const subtableClick = (row, index) => {
+  const t = table['table' + index]
+  const temp = t.getSelectionRows()
+  t.toggleRowSelection(row, !temp.includes(row))
+}
+
+let table = {}
+const setTableRef = (el, index) => {
+  table['table' + index] = el
+}
+
+defineExpose({
+  selectedData,
+  setData
+})
+</script>
+
+<template>
+  <el-alert :title="title" show-icon type="info" effect="dark"/>
+  <el-table
+      :height="props.height - 40"
+      ref="tableRef"
+      row-key="itm_id"
+      @row-click="rowClick"
+      default-expand-all
+      :data="tempData">
+    <template v-if="withResults">
+      <el-table-column type="selection" width="35"></el-table-column>
+      <el-table-column type="expand">
+        <template #default="{row,$index}">
+          <el-table :data="row.anti_list"
+                    @row-click="(subtableRow) => subtableClick(subtableRow , $index)"
+                    :ref="(el) => setTableRef(el,$index)">
+            <el-table-column type="selection" width="35"></el-table-column>
+            <el-table-column label="抗菌药物" prop="anti_name_cn"/>
+            <el-table-column label="抗菌药物编码" prop="anti_abb"/>
+            <el-table-column label="MIC值" prop="anti_mic"/>
+            <el-table-column label="敏感性" prop="anti_str"/>
+          </el-table>
+        </template>
+      </el-table-column>
+      <el-table-column label="名称" prop="itm_name"></el-table-column>
+      <el-table-column label="结果" prop="bac_name_cn"></el-table-column>
+    </template>
+
+    <template v-else>
+      <el-table-column type="selection"></el-table-column>
+      <el-table-column label="名称" prop="itm_name"></el-table-column>
+      <el-table-column label="结果" prop="rslt_strs"></el-table-column>
+    </template>
+
+  </el-table>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 64 - 78
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2.vue → src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import {onMounted, ref} from "vue";
+import {nextTick, onMounted, ref} from "vue";
 import {
   getDetail,
   getNormal,
@@ -14,14 +14,17 @@ import {
   elDateRangeAddTime,
   currentAndAFewDaysAgo
 } from "@/utils/moment-utils";
+import ResultTable from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/ResultTable.vue";
+import BacterialCultureTable
+  from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/BacterialCultureTable.vue";
 
 const props = defineProps<{
   patNo: string,
+  dateRange?: string[]
 }>()
 
 const dateRange = ref<string[]>([])
 const sidebarData = ref<SidebarData[]>([])
-
 const inspectionHeader = ref<InspectionHeader>({
   aply_cntn: "",
   aply_date: "",
@@ -34,13 +37,13 @@ const inspectionHeader = ref<InspectionHeader>({
   ptnt_age_unit: "",
   ptnt_bed_no: "",
   ptnt_no: "",
+  ptnt_name: '',
   ptnt_sex: "",
   smpl_name: "",
   test_usr_name: ""
 })
 
 const describeRef = ref<HTMLDivElement>()
-const detailData = ref([])
 
 const query = () => {
   const {start, end} = elDateRangeAddTime(dateRange.value)
@@ -49,15 +52,14 @@ const query = () => {
     startDate: start,
     endDate: end
   }
-
   getNormal(data).then(res => {
     console.log('getNormal', res)
     sidebarData.value = res
   })
-
 }
 
 const sidebarRowClick = (row: SidebarData) => {
+  currentReportForm.value = row
   getDetail(row.reportId).then(res => {
     if (XEUtils.isEmpty(res)) {
       inspectionHeader.value = {
@@ -72,29 +74,32 @@ const sidebarRowClick = (row: SidebarData) => {
         ptnt_age_unit: "",
         ptnt_bed_no: "",
         ptnt_no: "",
+        ptnt_name: '',
         ptnt_sex: "",
         smpl_name: "",
         test_usr_name: ""
       }
-      detailData.value = []
       return
     }
+
     console.log(res)
     inspectionHeader.value = res.order
-    detailData.value = res.items
+
+    nextTick(() => {
+      resultRef.value.setData(res)
+    })
   })
 }
 
-
 function filterSex(val) {
   switch (val) {
-    case '0':
+    case 0:
       return '未填'
-    case '1':
+    case 1:
       return '男'
-    case '2':
+    case 2:
       return '女'
-    case '3':
+    case 3:
       return '未知'
   }
   return ''
@@ -114,24 +119,6 @@ function filterAgeUnit(val) {
   return ''
 }
 
-function getItemAlert(val, strValue, value) {
-  if (strValue !== '' || value === '') return ''
-  switch (val) {
-    case 'L':
-      return '<span style="color:#F56C6C;font-weight:bold">↓</span>'
-    case 'H':
-      return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
-  }
-  return '<span style="color:#67C23A;font-weight:bold">正常</span>'
-}
-
-const result = (row) => {
-  if (row.anti_list && row.anti_list.length > 0) {
-    return row.bac_name_cn
-  }
-  return `${row.itm_value} ${row.itm_str_value}`
-}
-
 const mainTableHeight = (val: number) => {
   if (describeRef.value?.clientHeight) {
     return val - describeRef.value.clientHeight;
@@ -139,8 +126,33 @@ const mainTableHeight = (val: number) => {
   return val;
 }
 
+const currentReportForm = ref<SidebarData>({
+  reportId: '',
+  examPurpose: '',
+  trscDate: '',
+  reportType: '',
+})
+
+const resultRef = ref<{
+  selectedData?: () => string
+  setData: (val: any) => void
+}>()
+
+let copyData = ''
+const appendCopy = () => {
+  copyData += (currentReportForm.value.examPurpose + ":" + resultRef.value.selectedData())
+}
+
+const copyClick = () => {
+  console.log(copyData.slice(0, -1) + "。")
+}
+
 onMounted(async () => {
-  dateRange.value = await currentAndAFewDaysAgo()
+  if (props.dateRange) {
+    dateRange.value = props.dateRange
+  } else {
+    dateRange.value = await currentAndAFewDaysAgo()
+  }
   query()
 })
 </script>
@@ -156,7 +168,11 @@ onMounted(async () => {
                             style="width: 180px"
                             type="daterange"/>
             <br/>
-            <el-button @click="query">查询</el-button>
+            <el-button-group>
+              <el-button @click="query">查询</el-button>
+              <el-button @click="appendCopy">追加复制</el-button>
+              <el-button @click="copyClick">确认复制</el-button>
+            </el-button-group>
           </div>
           <xc-table :local-data="sidebarData"
                     @row-click="sidebarRowClick"
@@ -167,13 +183,12 @@ onMounted(async () => {
             <el-table-column prop="trscDate" label="检验时间" width="75"></el-table-column>
           </xc-table>
         </div>
-
         <div style="flex: 1">
           <div class="describe" ref="describeRef">
             <div class="pat-info">
               <div>
                 <test-describe front="姓名"
-                               :text="inspectionHeader?.ordr_usr_name"/>
+                               :text="inspectionHeader?.ptnt_name"/>
               </div>
               <div>
                 <test-describe front="性别"
@@ -232,48 +247,14 @@ onMounted(async () => {
             </div>
           </div>
           <div>
-            <el-table :data="detailData"
-                      row-key="itm_id"
-                      :height="mainTableHeight(height)">
-              <el-table-column type="expand" width="20">
-                <template #default="{row,$index}">
-                  <el-table :data="row.anti_list "
-                            v-if="row.anti_list && row.anti_list.length > 0">
-                    <el-table-column label="选择" type="selection"/>
-                    <el-table-column label="抗菌药物" prop="anti_name_cn"/>
-                    <el-table-column label="MIC值" prop="anti_mic"/>
-                    <el-table-column label="敏感性" prop="anti_value"/>
-                  </el-table>
-                </template>
-              </el-table-column>
-              <el-table-column label="检验项目" prop="itm_name" width="450">
-                <template #default="{row}">
-                  {{ row.itm_name }}
-                  <span v-if="row.critical_exec_flag === 1" style="color: red">
-                    危
-                  </span>
-                </template>
-              </el-table-column>
-              <el-table-column label="结果">
-                <template #default="{row}">
-                  {{ result(row) }}
-                  <template v-if="!XEUtils.isEmpty(row.critical_exec_info)">
-                    <br>
-                    <span style="color: red">
-                        {{ row.critical_exec_info }}
-                    </span>
-                  </template>
-
-                </template>
-              </el-table-column>
-              <el-table-column label="单位" prop="itm_unit"/>
-              <el-table-column label="说明" prop="itm_alert">
-                <template #default="{row}">
-                  <span v-html="getItemAlert(row.itm_alert, row.itm_str_value, row.itm_value)"></span>
-                </template>
-              </el-table-column>
-              <el-table-column label="参考值" prop="range"/>
-            </el-table>
+            <el-alert title="外送项目需要检验科审核才能在这里看到。" type="warning" show-icon/>
+            <BacterialCultureTable v-if="currentReportForm.reportType === '细菌'"
+                                   ref="resultRef"
+                                   :height="mainTableHeight(height) - 40"/>
+            <ResultTable
+                :height="mainTableHeight(height) - 40"
+                ref="resultRef"
+                v-else/>
           </div>
         </div>
       </div>
@@ -282,16 +263,21 @@ onMounted(async () => {
 </template>
 
 <style scoped lang="scss">
+.test_table {
+  :deep(.critical_value) {
+    background: var(--el-color-danger-light-9) !important;
+  }
+}
+
 .test-aside {
   display: flex;
   height: 100%;
 
   .test_query_header {
-    height: 50px
+    height: 50px;
   }
 }
 
-
 .describe {
   width: 100%;
   margin-left: 20px;

+ 110 - 0
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/ResultTable.vue

@@ -0,0 +1,110 @@
+<script setup lang="ts">
+import {ElTable} from "element-plus";
+import {useCompRef} from "@/utils/useCompRef";
+import XEUtils from "xe-utils";
+import {Measurement} from "@/api/jian-yan-jie-kou/jian-yan-jie-kou";
+import {ref} from "vue";
+
+const props = defineProps<{
+  height: number
+}>()
+
+const mainTableRef = useCompRef(ElTable)
+const data = ref([])
+
+const rowClassName = ({row}) => {
+  if (row.critical_exec_flag === 1) {
+    return 'critical_value'
+  }
+  return ''
+}
+
+const testRowClick = (row) => {
+  let temp = mainTableRef.value.getSelectionRows()
+  mainTableRef.value.toggleRowSelection(row, !temp.includes(row))
+}
+
+const result = (row) => {
+  return `${row.itm_value}${row.itm_str_value}`
+}
+
+function getItemAlert(val, strValue, value) {
+  if (strValue !== '' || value === '') return ''
+  switch (val) {
+    case 'L':
+      return '<span style="color:#F56C6C;font-weight:bold">↓</span>'
+    case 'H':
+      return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
+  }
+  return '<span style="color:#67C23A;font-weight:bold">正常</span>'
+}
+
+function getItemStr(val, strValue, value) {
+  if (strValue !== '' || value === '') return ''
+  switch (val) {
+    case 'L':
+      return '↓'
+    case 'H':
+      return '↑'
+  }
+  return '正常'
+}
+
+const selectedData = () => {
+  const temp = mainTableRef.value.getSelectionRows() as Measurement[];
+  let data = ''
+  if (temp) {
+    XEUtils.arrayEach(temp, (item: Measurement) => {
+      data += `${item.itm_name}:${result(item)} ${item.itm_unit} ${getItemStr(item.itm_alert, item.itm_str_value, item.itm_value)},`
+    })
+  }
+  return data
+}
+
+const setData = (value) => {
+  data.value = value.items
+}
+
+defineExpose({
+  selectedData,
+  setData
+})
+</script>
+
+<template>
+  <el-table :data="data"
+            :height="height"
+            ref="mainTableRef"
+            class="test_table"
+            row-key="itm_id"
+            :row-class-name="rowClassName"
+            @row-click="testRowClick">
+    <el-table-column type="selection" width="35"/>
+    <el-table-column label="检验项目" prop="itm_name" width="450">
+      <template #default="{row}">
+        {{ row.itm_name }}
+        <span v-if="row.critical_exec_flag === 1"
+              style="color: red">危</span>
+      </template>
+    </el-table-column>
+    <el-table-column label="结果">
+      <template #default="{row}">
+        {{ result(row) }}
+        <div style="color: red">
+          {{ row.critical_exec_info }}
+        </div>
+      </template>
+    </el-table-column>
+    <el-table-column label="单位" prop="itm_unit"/>
+    <el-table-column label="说明" prop="itm_alert">
+      <template #default="{row}">
+        <span v-html="getItemAlert(row.itm_alert, row.itm_str_value, row.itm_value)"></span>
+      </template>
+    </el-table-column>
+    <el-table-column label="参考值" prop="range"/>
+  </el-table>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 0 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/Home.vue

@@ -24,7 +24,6 @@
 
   <!-- 电子病历质控 -->
   <emr-control-rule/>
-
 </template>
 
 <script name="Home" setup>

+ 181 - 174
src/views/hospitalization/zhu-yuan-yi-sheng/PatientInformationInquiry.vue

@@ -1,136 +1,136 @@
 <template>
-    <page-layer>
-        <template #headerBlock>
-
-            <el-form :inline="true" ref="formRef" :model="param">
-
-                <el-form-item label="住院号" prop="patNo">
-                    <el-input v-model="param.patNo" clearable
-                              style="width: 120px"
-                              @blur="param.patNo=$event.target.value.trim()"/>
-                </el-form-item>
-
-                <el-form-item label="姓名" prop="name">
-                    <el-input v-model="param.name" clearable
-                              style="width: 120px"
-                              @blur="param.name=$event.target.value.trim()"/>
-                </el-form-item>
-
-                <el-form-item label="入院时间" prop="admissionTime">
-                    <xc-date-picker style="width: 180px"
-                                    type="daterange"
-                                    clearable
-                                    v-model="param.admissionTime"/>
-                </el-form-item>
-
-                <el-form-item label="出院时间" prop="dischargeTime">
-                    <xc-date-picker style="width: 180px"
-                                    type="daterange"
-                                    clearable
-                                    v-model="param.dischargeTime"/>
-                </el-form-item>
-
-                <el-form-item label="科室" prop="dept">
-                    <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.dept"/>
-                </el-form-item>
-
-                <el-form-item label="病房" prop="ward">
-                    <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.ward"/>
-                </el-form-item>
-
-                <el-form-item label="诊断代码" prop="diagnosticCode">
-                    <el-select-v2 v-model="param.diagnosticCode"
-                                  remote
-                                  clearable
-                                  filterable
-                                  :remote-method="method"
-                                  :options="diagnosisData"/>
-                </el-form-item>
-
-                <el-form-item label="是否主诊" prop="isPrimaryDiagnosis">
-                    <el-checkbox v-model="param.isPrimaryDiagnosis"/>
-                </el-form-item>
-
-                <el-form-item label="出院" prop="leaveHospital">
-                    <el-checkbox v-model="param.leaveHospital"/>
-                </el-form-item>
-
-                <el-form-item label="管床医生" prop="empCode">
-                    <el-select-v2 v-model="param.empCode"
-                                  clearable
-                                  remote
-                                  style="width: 90px"
-                                  filterable
-                                  :remote-method="empMethod"
-                                  :options="empList"/>
-                </el-form-item>
-
-                <el-form-item label="出院科室" prop="disDept">
-                    <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.disDept"/>
-                </el-form-item>
-
-                <el-form-item label="审核">
-                    <el-select v-model="param.emrAudit"
-                               style="width: 80px">
-                        <el-option v-for="item in audit"
-                                   :value="item.code"
-                                   :label="item.name"/>
-                    </el-select>
-                </el-form-item>
-
-                <el-form-item>
-                    <el-button @click="queryClick" type="primary">查询</el-button>
-                    <el-button @click="reset" type="warning">重置</el-button>
-                </el-form-item>
-            </el-form>
-        </template>
-
-        <template #main="{height}">
-            <pat-infomation-dialog
-                    v-if="dialog"
-                    @closed="dialog = false"
-                    :admiss-date="rowData.admissDate"
-                    :pat-no="rowData.patNo"
-                    :times="rowData.admissTimes"
-                    :leave-hospital="param.leaveHospital ? 2 : 1"
-                    :dics="dics"/>
-            <xc-table :local-data="patInfoList"
-                      :final-height="getWindowSize.h / 1.15">
-                <el-table-column label="操作" fixed="left" width="60">
-                    <template #default="{row}">
-                        <el-button @click="details(row)" text type="primary" plain>详情</el-button>
-                        <el-button style="margin-left: 0" @click="openEmr(row)" text type="primary" plain>病历
-                        </el-button>
-                    </template>
-                </el-table-column>
-                <el-table-column label="住院号" prop="inpatientNo" width="60"/>
-                <el-table-column label="次数" prop="admissTimes" width="30"/>
-                <el-table-column label="床位" prop="bedNo" width="30"/>
-                <el-table-column label="审核" width="30">
-                    <template #default="{row}">
+  <page-layer>
+    <template #headerBlock>
+
+      <el-form :inline="true" ref="formRef" :model="param">
+
+        <el-form-item label="住院号" prop="patNo">
+          <el-input v-model="param.patNo" clearable
+                    style="width: 120px"
+                    @blur="param.patNo=$event.target.value.trim()"/>
+        </el-form-item>
+
+        <el-form-item label="姓名" prop="name">
+          <el-input v-model="param.name" clearable
+                    style="width: 120px"
+                    @blur="param.name=$event.target.value.trim()"/>
+        </el-form-item>
+
+        <el-form-item label="入院时间" prop="admissionTime">
+          <xc-date-picker style="width: 180px"
+                          type="daterange"
+                          clearable
+                          v-model="param.admissionTime"/>
+        </el-form-item>
+
+        <el-form-item label="出院时间" prop="dischargeTime">
+          <xc-date-picker style="width: 180px"
+                          type="daterange"
+                          clearable
+                          v-model="param.dischargeTime"/>
+        </el-form-item>
+
+        <el-form-item label="科室" prop="dept">
+          <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.dept"/>
+        </el-form-item>
+
+        <el-form-item label="病房" prop="ward">
+          <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.ward"/>
+        </el-form-item>
+
+        <el-form-item label="诊断代码" prop="diagnosticCode">
+          <el-select-v2 v-model="param.diagnosticCode"
+                        remote
+                        clearable
+                        filterable
+                        :remote-method="method"
+                        :options="diagnosisData"/>
+        </el-form-item>
+
+        <el-form-item label="是否主诊" prop="isPrimaryDiagnosis">
+          <el-checkbox v-model="param.isPrimaryDiagnosis"/>
+        </el-form-item>
+
+        <el-form-item label="出院" prop="leaveHospital">
+          <el-checkbox v-model="param.leaveHospital"/>
+        </el-form-item>
+
+        <el-form-item label="管床医生" prop="empCode">
+          <el-select-v2 v-model="param.empCode"
+                        clearable
+                        remote
+                        style="width: 90px"
+                        filterable
+                        :remote-method="empMethod"
+                        :options="empList"/>
+        </el-form-item>
+
+        <el-form-item label="出院科室" prop="disDept">
+          <select-v4 :data="deptWardList" style="width: 220px;" clearable v-model="param.disDept"/>
+        </el-form-item>
+
+        <el-form-item label="审核">
+          <el-select v-model="param.emrAudit"
+                     style="width: 80px">
+            <el-option v-for="item in audit"
+                       :value="item.code"
+                       :label="item.name"/>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button @click="queryClick" type="primary">查询</el-button>
+          <el-button @click="reset" type="warning">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </template>
+
+    <template #main="{height}">
+      <pat-infomation-dialog
+          v-if="dialog"
+          @closed="dialog = false"
+          :admiss-date="rowData.admissDate"
+          :pat-no="rowData.patNo"
+          :times="rowData.admissTimes"
+          :leave-hospital="param.leaveHospital ? 2 : 1"
+          :dics="dics"/>
+      <xc-table :local-data="patInfoList"
+                :final-height="getWindowSize.h / 1.15">
+        <el-table-column label="操作" fixed="left" width="60">
+          <template #default="{row}">
+            <el-button @click="details(row)" text type="primary" plain>详情</el-button>
+            <el-button style="margin-left: 0" @click="openEmr(row)" text type="primary" plain>病历
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="住院号" prop="inpatientNo" width="60"/>
+        <el-table-column label="次数" prop="admissTimes" width="30"/>
+        <el-table-column label="床位" prop="bedNo" width="30"/>
+        <el-table-column label="审核" width="30">
+          <template #default="{row}">
                         <span v-if="row.emrAudit > 0 ">
                         </span>
-                    </template>
-                </el-table-column>
-                <el-table-column label="姓名" prop="name">
-                    <template #default="{row}">
-                        {{ row.name + '(' + row.sexName + ')' }}
-                    </template>
-                </el-table-column>
-                <el-table-column label="入院时间" prop="admissDate" width="80"/>
-                <el-table-column label="出院时间" prop="disDate" width="80"/>
-                <el-table-column label="入院病区" prop="admissWardName"/>
-                <el-table-column label="小科室" prop="zkWardName"/>
-                <el-table-column label="年龄" prop="tempAge"/>
-                <el-table-column label="医保身份" prop="responceName"/>
-                <el-table-column label="总费用" prop="totalCharge"/>
-                <el-table-column label="余额" prop="balance"/>
-                <el-table-column label="入院诊断" prop="admissDiagStr"/>
-            </xc-table>
-
-        </template>
-    </page-layer>
+          </template>
+        </el-table-column>
+        <el-table-column label="姓名" prop="name">
+          <template #default="{row}">
+            {{ row.name + '(' + row.sexName + ')' }}
+          </template>
+        </el-table-column>
+        <el-table-column label="入院时间" prop="admissDate" width="80"/>
+        <el-table-column label="出院时间" prop="disDate" width="80"/>
+        <el-table-column label="入院病区" prop="admissWardName"/>
+        <el-table-column label="小科室" prop="zkWardName"/>
+        <el-table-column label="年龄" prop="tempAge"/>
+        <el-table-column label="医保身份" prop="responceName"/>
+        <el-table-column label="总费用" prop="totalCharge"/>
+        <el-table-column label="余额" prop="balance"/>
+        <el-table-column label="入院诊断" prop="admissDiagStr"/>
+      </xc-table>
+
+    </template>
+  </page-layer>
 </template>
 
 <script setup name='PatientInformationInquiry'>
@@ -145,24 +145,26 @@ import {operations} from "@/data";
 import {autopsies, haveOrNot, yesOrNo} from "@/views/hospitalization/case-front-sheet/common";
 import PatInfomationDialog from "@/components/pat-info-list/PatInfomationDialog.vue";
 import {
-    emrStateEnum,
-    getEmrUrl,
-    getInEmrUrl
+  emrStateEnum,
+  getEmrUrl,
+  getInEmrUrl
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
+import {subtractTime} from "@/utils/date";
+import {getServerDateApi} from "@/api/public-api";
 
 const param = ref({
-    patNo: '',
-    name: '',
-    leaveHospital: false,
-    admissionTime: [],
-    dischargeTime: [],
-    dept: '',
-    ward: '',
-    diagnosticCode: '',
-    isPrimaryDiagnosis: false,
-    empCode: '',
-    disDept: '',
-    emrAudit: 0,
+  patNo: '',
+  name: '',
+  leaveHospital: false,
+  admissionTime: [],
+  dischargeTime: [],
+  dept: '',
+  ward: '',
+  diagnosticCode: '',
+  isPrimaryDiagnosis: false,
+  empCode: '',
+  disDept: '',
+  emrAudit: 0,
 })
 
 const deptWardList = ref([])
@@ -177,58 +179,63 @@ const empList = ref([])
 
 
 const queryClick = () => {
-    getPatientInfo(param.value).then(res => {
-        patInfoList.value = res
-    })
+  getPatientInfo(param.value).then(res => {
+    patInfoList.value = res
+  })
 }
 const reset = () => {
-    formRef.value?.resetFields()
+  formRef.value?.resetFields()
 }
 
 const details = async (row) => {
-    rowData.value = row
-    dialog.value = true
+  rowData.value = row
+  dialog.value = true
 }
 
 const method = (val) => {
-    diagnosis(val).then((res) => {
-        diagnosisData.value = res
-    })
+  diagnosis(val).then((res) => {
+    diagnosisData.value = res
+  })
 }
 
 const empMethod = (val) => {
-    employeeList(val).then((res) => {
-        empList.value = res
-    })
+  employeeList(val).then((res) => {
+    empList.value = res
+  })
 }
 
-const openEmr = (data) => {
-    if (param.value.leaveHospital) {
-        window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院只读), '_blank')
+const openEmr = async (data) => {
+  if (param.value.leaveHospital) {
+    const dischargeDays = subtractTime(await getServerDateApi(), data.disDate)
+    if (dischargeDays <= 7) {
+      window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院编辑), '_blank')
     } else {
-        window.open(getEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.在院只读), '_blank')
+      window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.院只读), '_blank')
     }
+  } else {
+    window.open(getEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.在院只读), '_blank')
+  }
 }
 
 onMounted(async () => {
-    getHospWardAndDept().then(res => {
-        deptWardList.value = res
-    })
-
-    getAllDictionary().then(res => {
-        res.getOperations = operations;
-        res.getYesOrNo = yesOrNo;
-        res.getHaveOrNot = haveOrNot;
-        res.getAutopsies = autopsies;
-        dics.value = res
-    })
+  getHospWardAndDept().then(res => {
+    deptWardList.value = res
+  })
+
+  getAllDictionary().then(res => {
+    res.getOperations = operations;
+    res.getYesOrNo = yesOrNo;
+    res.getHaveOrNot = haveOrNot;
+    res.getAutopsies = autopsies;
+    dics.value = res
+  })
 })
 
 
 let audit = [
-    {code: 0, name: '全部'},
-    {code: 1, name: '已审'},
-    {code: 2, name: '未审'}
+  {code: 0, name: '全部'},
+  {code: 1, name: '已审'},
+  {code: 2, name: '未审'}
 ]
 
 </script>

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

@@ -487,8 +487,7 @@ const emrEvent = {
     await courseSegmentLocking()
     // 设置病程记录跳转
     setTheProgressAnchor()
-    // 删除指定的数据元
-    editMain.delElementByName('月经史')
+    maleDeleteDataElement()
     // 是否开启审阅模式
     reviewMode.value = 2
     isRevisionMode()
@@ -735,6 +734,15 @@ const emrSaveRulesRef = ref<{
   close: () => void
 }>()
 
+
+// 删除指定的数据元
+const maleDeleteDataElement = () => {
+  if (patientInfo.value.sex === 1) {
+    editMain.delElementByName('月经史')
+  }
+}
+
+
 // 点击保存病历
 const clickSaveData = async () => {
   if (isEmpty) return
@@ -753,7 +761,6 @@ const clickSaveData = async () => {
       return
     }
   }
-
   // 判断是否有必填项目
   try {
     emrSaveRulesRef.value.close()
@@ -1627,38 +1634,43 @@ const emrMittInit = () => {
 }
 
 const initEdit = () => {
-  const appContext = {
-    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,
+  const appContext = () => {
+    return {
+      endpoints: {
+        app: "/bdp/dataservice/api",
+        his: import.meta.env.VITE_BASE_URL,
+      },
+      input: {
+        user: userInfoStore.value.code,
         name: userInfoStore.value.name
-      }
-    },
-    data: patientData.value
+      },
+      login: {
+        token: userInfoStore.value.token,
+        user: {
+          id: userInfoStore.value.code,
+          name: userInfoStore.value.name
+        }
+      },
+      data: patientData.value
+    }
   }
-  // emrConfig.value.loading = true
-  useEmrInit(editRef.value, {appContext, event: emrEvent}).then((res) => {
-    emrMitt.emit('closeProgress')
+
+  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) => {
+    timeConsuming();
+    emrMitt.emit('closeProgress')
     editor = res.editor
     runtime = res.runtime
     editMain = res
-    emrConfig.value.loading = false
     popupFunc.setShortcutKey()
     rightClickOnRegistration()
     setEditor();
   })
-
 }
 
 const hisSaveEmrDivRef = ref()

+ 21 - 45
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/Home.vue

@@ -36,7 +36,7 @@
           <el-checkbox v-model="conciseMode"
                        @change="openOrCloseMode" label="简洁模式"/>
         </div>
-        出院天数:{{ dischargeDays }}
+        出院天数:{{ patientInfo.dischargeDays }}
         <span style="color: red">出院七天后就无法编辑患者病历</span>
       </div>
     </div>
@@ -49,7 +49,7 @@
               @isShow="patientInfoIsShow"/>
         </div>
       </div>
-      <div v-loading="emrConfig.loading">
+      <div>
         <emr-main
             ref="emrMainRef"
             :max-height="maxHeight"/>
@@ -62,7 +62,7 @@
                    ref="progressRef"/>
 </template>
 
-<script setup name='Home'>
+<script setup name='Home' lang="ts">
 import EmrMain from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue";
 import {getDisPatient, getPatientInfo} from "@/api/zhu-yuan-yi-sheng/emr-patient";
 import router from "@/router";
@@ -85,18 +85,17 @@ import {
 import EmrPatientList from "@/components/zhu-yuan-yi-sheng/emr/EmrPatientList.vue";
 import EmrLeaveHospitalPatient from "@/components/zhu-yuan-yi-sheng/emr/EmrLeaveHospitalPatient.vue";
 import EmrSelectPat from "@/components/zhu-yuan-yi-sheng/EmrSelectPat.vue";
-import {emrSocketUnlockApi, repeatedlyOpenTheSamePatient} from "@/api/zhu-yuan-yi-sheng/emr-socket";
-import {stringNotBlank} from "@/utils/blank-utils";
 import EmrQualityControlRelieve
   from "@/components/zhu-yuan-yi-sheng/emr/EmrQualityControlRelieve/EmrQualityControlRelieve.vue";
 import {getMyUnlockByPatNo} from "@/api/zhu-yuan-yi-sheng/emr-control-rule";
-import store from "@/store";
 import {ElMessageBox} from "element-plus";
 import {
   emrTutorialFunc,
   emrTutorialGetId
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-tutorial";
 import LoadingProgress from "@/components/loading-progress/LoadingProgress.vue";
+import {ref, onMounted, nextTick} from 'vue'
+import {$ref} from "vue/macros";
 
 const patInfoRef = ref(null)
 const patInfoRefOld = ref(null)
@@ -107,21 +106,15 @@ const headerRefOld = ref(null)
 const modHeaderRef = ref(null)
 const emrMainRef = ref(null)
 // 最大高度
-let maxHeight = $ref()
+const maxHeight = ref()
 // 是否显示页面
-let show = $ref(false)
-// 距离今天的出院天数
-let dischargeDays = $ref(0)
+const show = ref(false)
 // 患者列表 list
 let patientListDrawer = $ref(false)
 
-
-let dialog = $ref(true)
-
 const selected = ({inpatientNo, admissTimes}) => {
   query.value.patNo = inpatientNo
   query.value.times = admissTimes
-  query.value.maxTimes = admissTimes
   allPatientsInTheHospital()
 }
 
@@ -140,11 +133,18 @@ const disPatients = async () => {
 // 解析路由数据
 const routerFunc = async () => {
   emrMainRef.value?.closeWebSocket()
-  show = false
+  show.value = false
   if (!router.currentRoute.value.params.pat) {
     return
   }
-  resolveRoute(router.currentRoute.value.params.pat)
+  try {
+    resolveRoute(router.currentRoute.value.params.pat)
+  } catch {
+    ElMessageBox.alert('请先选择一个患者', '提示', {
+      type: 'error'
+    })
+    return
+  }
   console.log('查询数据 %o', query.value)
   let reqUnlock = await getMyUnlockByPatNo(query.value.patNo, query.value.times)
   console.log('申请数据 %o', reqUnlock)
@@ -159,7 +159,7 @@ const routerFunc = async () => {
     await getPatientInfo(query.value.patNo).then(res => {
       patientInfo.value.$inOutFlag = 1;
       patientInfo.value = res
-      show = true
+      show.value = true
     }).catch(() => {
       progressRef.value.close()
     });
@@ -192,7 +192,7 @@ const queryDisPatient = async () => {
   if (!emrConfig.value.editor) {
     emrConfig.value.editor = canIUnlockIt(unlockEnum.出院编辑)
   }
-  show = true;
+  show.value = true;
 }
 
 // 点击全院患者数据
@@ -210,8 +210,7 @@ const allPatientsInTheHospital = async () => {
 
 const queryAllPatients = async (flag) => {
   query.value.times = patientInfo.value.admissTimes
-  query.value.maxTimes = patientInfo.value.admissTimes
-  show = true
+  show.value = true
   emrConfig.value.editor = flag
 }
 
@@ -229,7 +228,7 @@ const listRowClick = async (val) => {
 }
 
 const patientInfoIsShow = (flag, height) => {
-  maxHeight = window.innerHeight - height - 24
+  maxHeight.value = window.innerHeight - height - 24
 }
 
 const 操作指南 = (val) => {
@@ -242,7 +241,6 @@ const 操作指南 = (val) => {
       window.open(`http://webhis.thyy.cn:8080/download/操作指南/住院医生教程/住院医生操作指南 ${fileName}.pdf`, '_blank')
     }
     localStorage.setItem("电子病历限制", "false")
-    dialog = false
   })
 }
 
@@ -273,24 +271,6 @@ channel.addEventListener('message', (event) => {
   }
 })
 
-const emrSocketUnlock = async () => {
-  let documentSid = ''
-  try {
-    let editor = emrMitt.emit('editor')
-    let id = editor.documentData._id
-    let userData = store.state.user.info
-    if (stringNotBlank(id)) {
-      documentSid = 'documentEmr_' + id + '_' + userData.code;
-    }
-  } catch {
-
-  }
-  await emrSocketUnlockApi('emr_' + query.value.patNo.trim() + '_' + query.value.times, documentSid)
-  show = false
-  location.reload()
-  await routerFunc()
-}
-
 const whetherKickedOut = () => {
   const data = localStorage.getItem("强制刷新")
   console.log('强制刷新的人', data)
@@ -307,7 +287,7 @@ const whetherKickedOut = () => {
 }
 
 const progressRef = ref()
-const describes = ['被删除的病历可在回收站恢复', '粘贴内容时,鼠标右键文本粘贴(ctrl + shift + v)', '如果写错了可以使用(ctrl + z / ctrl + y)']
+const describes = ['被删除的病历可在回收站恢复', '粘贴内容时,鼠标右键文本粘贴或使用(ctrl + shift + v)', '如果写错了尝试使用(ctrl + z / ctrl + y)']
 
 onMounted(async () => {
   whetherKickedOut()
@@ -318,10 +298,6 @@ onMounted(async () => {
   emrMitt.on('closeProgress', () => {
     progressRef.value.close()
   })
-  let temp = localStorage.getItem("电子病历限制");
-  if (temp !== null) {
-    dialog = false;
-  }
   loadingTime.value = new Date()
   progressRef.value.start()
   await nextTick();

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

@@ -1,7 +1,11 @@
 import {EditType, Runtime} from "./edit";
 
+type AppContext = any | (() => {
+    [key: string]: any
+})
+
 interface Options {
-    appContext?: any,
+    appContext?: AppContext,
     event?: {
         [key: string]: (...val: any[]) => void,
     },
@@ -13,6 +17,7 @@ export interface UseEmrInitReturn {
     iframe?: HTMLIFrameElement,
     delElementByName?: (name: string) => void;
     loadDocument?: (loadParams: LoadParams) => Promise<any>;
+    loadAndSetDocument?: (loadParams: LoadParams) => Promise<any>;
 }
 
 export interface LoadParams {
@@ -51,69 +56,79 @@ function delElementByName(name: string, editor: EditType) {
 
 export function useEmrInit(div: HTMLDivElement, options?: Options): Promise<UseEmrInitReturn> {
     return new Promise((resolve, reject) => {
-        if (div['emr']) {
-            throw new Error('该div已挂载请选择其他div')
-        }
-        const iframe: HTMLIFrameElement = document.createElement('iframe')
-        let editor: EditType, runtime: Runtime
+            if (div['emr']) {
+                throw new Error('该div已挂载请选择其他div')
+            }
+            const iframe: HTMLIFrameElement = document.createElement('iframe')
+            let editor: EditType, runtime: Runtime
 
-        iframe.style.width = '100%'
-        iframe.style.height = '100%'
-        iframe.src = '/emr/runtime/#/editor'
-        iframe.style.border = '0'
+            iframe.style.width = '100%'
+            iframe.style.height = '100%'
+            iframe.src = '/emr/runtime/#/editor'
+            iframe.style.border = '0'
 
-        function layout() {
-            try {
-                const pgv = editor.renderer.pageView
-                if (pgv.marginTopWithPaging == 0) {
-                    pgv.attachLayout()
-                }
-            } catch {
+            function loadDocument(loadParams: LoadParams) {
+                return new Promise((resolve, reject) => {
+                    runtime.loadDocument(
+                        (res) => {
+                            resolve(res)
+                        },
+                        (err) => {
+                            reject(err)
+                        },
+                        loadParams
+                    )
+                })
             }
-        }
 
-        function loadDocument(loadParams: LoadParams) {
-            return new Promise((resolve, reject) => {
-                runtime.loadDocument(
-                    (res) => {
-                        layout()
+            function loadAndSetDocument(loadParams: LoadParams) {
+                return new Promise((resolve, reject) => {
+                    loadDocument(loadParams).then((res) => {
+                        editor.setDocument(res, true)
                         resolve(res)
-                    },
-                    (err) => {
+                    }).catch((err) => {
                         reject(err)
-                    },
-                    loadParams
-                )
-            })
-        }
+                    })
+                })
+            }
 
-        div['emr'] = {
-            setEditor: (e: EditType, r: any): void => {
-                editor = e
-                runtime = r
+            div['emr'] = {
+                setEditor: (e: EditType, r: any): void => {
+                    editor = e
+                    runtime = r
 
-                if (options && options.event) {
-                    for (let key in options.event) {
-                        editor.on(key, options.event[key])
+                    div['myEmr'] = {
+                        editor: e,
+                        runtime: r
                     }
-                }
 
-                resolve({
-                    editor,
-                    runtime,
-                    iframe,
-                    delElementByName: (name: string) => delElementByName(name, editor),
-                    loadDocument
-                })
-            },
-            getAppContext: (): any => {
-                if (options && options.appContext) {
-                    return options.appContext
+                    if (options && options.event) {
+                        for (let key in options.event) {
+                            editor.on(key, options.event[key])
+                        }
+                    }
+
+                    resolve({
+                        editor,
+                        runtime,
+                        iframe,
+                        delElementByName: (name: string) => delElementByName(name, editor),
+                        loadDocument,
+                        loadAndSetDocument
+                    })
+                },
+                getAppContext: (): any => {
+                    if (options && options.appContext) {
+                        if (typeof options.appContext === 'function') {
+                            return options.appContext()
+                        }
+                        return options.appContext
+                    }
+                    return {}
                 }
-                return {}
             }
-        }
 
-        div.appendChild(iframe)
-    })
+            div.appendChild(iframe)
+        }
+    )
 }

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

@@ -1,8 +1,3 @@
-import store from '../../../../../store'
-import {
-    deletePatientEmrByDocumentId,
-    insertEmrData
-} from "../../../../../api/zhu-yuan-yi-sheng/emr-patient";
 import {xcMessage} from "../../../../../utils/xiaochan-element-plus";
 import EventBus from "../../../../../utils/mitt";
 import {ref} from 'vue'
@@ -12,99 +7,6 @@ import XEUtils from "xe-utils";
 import Patient from "../../../../../ts-type/patient";
 
 // 患者数据
-export function EMRInteractive(data, editorEvent) {
-
-    this.setEditor = (editor, runtime) => {
-        this.editor = editor;
-        this.runtime = runtime;
-        if (editorEvent !== null) {
-            for (let key in editorEvent) {
-                editor.on(key, function (...args) {
-                    editorEvent[key](...args)
-                })
-            }
-        }
-    };
-
-    this.getEditor = () => {
-        return this.editor
-    }
-
-    this.getRuntime = () => {
-        return this.runtime
-    }
-
-    this.deleteElement = (params) => {
-        this.editor.execute('execFn', {
-            value: {
-                fn: function () {
-                    let EMR = this.editor.getScriptRuntime().EMR
-                    let emrDoc = EMR.getDocument()
-                    let components = emrDoc.getComponentsByCode(params);
-                    components.forEach((component) => {
-                        let view = component.target;
-                        let viewDom = view.el;
-                        let viewParagraphDom = viewDom.parentElement;
-                        viewDom.remove();
-                        if (viewParagraphDom.textContent === "") {
-                            viewParagraphDom.remove()
-                        }
-                    })
-                }, persist: true, scope: this, params: params
-            }
-        })
-    }
-
-    this.getRoot = () => {
-        return this.editor.model.document.getRoot()
-    }
-
-    this.callMethod = (name, ...value) => {
-        return this.editor[name](...value)
-    }
-
-    // 这个不能删除是编辑器需要的东西
-    this.getAppContext = () => {
-        return {
-            endpoints: {
-                app: "/bdp/dataservice/api", his: import.meta.env.VITE_BASE_URL,
-            }, input: {
-                user: store.state.user.info.code, name: store.state.user.info.name
-            }, login: {
-                token: store.state.user.info.token,
-                user: {
-                    id: store.state.user.info.code,
-                    name: store.state.user.info.name,
-                }
-            }, data
-        }
-    };
-
-    this.saveDocument = (value, newDate) => {
-        let document = this.editor.getDocument();
-
-        document.properties.categoryCode = value.emrCategoryCode
-        document.properties.patientId = value.patNo + "_" + value.times;
-        document._id = value.emrDocumentId
-        value.documentData = document
-
-        if (document.properties.creator) {
-            document.properties.modifier = data['编辑者姓名'];
-            document.properties.modifierId = data['编辑者编码'];
-            document.properties.modifyTime = newDate
-        } else {
-            document.properties.creator = data['编辑者姓名'];
-            document.properties.creatorId = data['编辑者编码'];
-            document.properties.createTime = newDate
-        }
-        return insertEmrData(value)
-    };
-
-    this.deleteDocument = (documentId) => {
-        return deletePatientEmrByDocumentId(documentId)
-    };
-
-}
 
 export const query = ref({
     patNo: '',
@@ -129,7 +31,6 @@ export function resolveRoute(val) {
 export const emrConfig = ref({
     // 当前是否可以编辑,用来分辨出院只读,和在院患者的
     editor: true,
-    loading: false,
     loadDocument: false
 })
 
@@ -228,198 +129,200 @@ export function elementReplication(str, name) {
     xcMessage.success('复制成功')
 }
 
-export const fontSizes = [{
-    "code": "42pt", "name": "初号"
-}, {
-    "code": "36pt", "name": "小初"
-}, {
-    "code": "26pt", "name": "一号"
-}, {
-    "code": "24pt", "name": "小一"
-}, {
-    "code": "22pt", "name": "二号"
-}, {
-    "code": "18pt", "name": "小二"
-}, {
-    "code": "16pt", "name": "三号"
-}, {
-    "code": "15pt", "name": "小三"
-}, {
-    "code": "14pt", "name": "四号"
-}, {
-    "code": "12pt", "name": "小四"
-}, {
-    "code": "10.5pt", "name": "五号"
-}, {
-    "code": "9pt", "name": "小五"
-}, {
-    "code": "7.5pt", "name": "六号"
-}, {
-    "code": "6.5pt", "name": "小六"
-}, {
-    "code": "5.5pt", "name": "七号"
-}, {
-    "code": "5pt", "name": "八号"
-}, {
-    "code": "4pt", "name": "4"
-}, {
-    "code": "8pt", "name": "8"
-}, {
-    "code": "10pt", "name": "10"
-}, {
-    "code": "11pt", "name": "11"
-}, {
-    "code": "20pt", "name": "20"
-}, {
-    "code": "28pt", "name": "28"
-}, {
-    "code": "48pt", "name": "48"
-}, {
-    "code": "72pt", "name": "72"
-}]
-export const availableFonts = [{
-    "text": "微软雅黑", "font": "\"Microsoft YaHei\""
-}, {
-    "text": "宋体", "font": "SimSun"
-}, {
-    "text": "黑体", "font": "SimHei"
-}, {
-    "text": "仿宋", "font": "FangSong"
-}, {
-    "text": "楷体", "font": "KaiTi"
-}, {
-    "text": "新宋体", "font": "NSimSun"
-}, {
-    "text": "微软正黑体", "font": "\"Microsoft JhengHei\""
-}, {
-    "text": "Arial", "font": "Arial"
-}, {
-    "text": "Times New Roman", "font": "\"Times New Roman\""
-}, {
-    "text": "Calibri", "font": "Calibri"
-}, {
-    "text": "Comic Sans MS", "font": "\"Comic Sans MS\""
-}, {
-    "text": "Courier New", "font": "\"Courier New\""
-}, {
-    "text": "Georgia", "font": "Georgia"
-}, {
-    "text": "Impact", "font": "Impact"
-}, {
-    "text": "Trebuchet MS", "font": "\"Trebuchet MS\""
-}, {
-    "text": "Verdana", "font": "Verdana"
-}, {
-    "text": "Arial Black", "font": "\"Arial Black\""
-}, {
-    "text": "Arial Narrow", "font": "\"Arial Narrow\""
-}, {
-    "text": "Cambria", "font": "Cambria"
-}, {
-    "text": "Cambria Math", "font": "\"Cambria Math\""
-}, {
-    "text": "Candara", "font": "Candara"
-}, {
-    "text": "Consolas", "font": "Consolas"
-}, {
-    "text": "Constantia", "font": "Constantia"
-}, {
-    "text": "Corbel", "font": "Corbel"
-}, {
-    "text": "Ebrima", "font": "Ebrima"
-}, {
-    "text": "Franklin Gothic", "font": "\"Franklin Gothic\""
-}, {
-    "text": "Franklin Gothic Medium", "font": "\"Franklin Gothic Medium\""
-}, {
-    "text": "Gabriola", "font": "Gabriola"
-}, {
-    "text": "Gadugi", "font": "Gadugi"
-}, {
-    "text": "Lucida Console", "font": "\"Lucida Console\""
-}, {
-    "text": "Lucida Sans Unicode", "font": "\"Lucida Sans Unicode\""
-}, {
-    "text": "Malgun Gothic", "font": "\"Malgun Gothic\""
-}, {
-    "text": "Marlett", "font": "Marlett"
-}, {
-    "text": "Microsoft Himalaya", "font": "\"Microsoft Himalaya\""
-}, {
-    "text": "Microsoft JhengHei UI", "font": "\"Microsoft JhengHei UI\""
-}, {
-    "text": "Microsoft JhengHei UI Light", "font": "\"Microsoft JhengHei UI Light\""
-}, {
-    "text": "Microsoft New Tai Lue", "font": "\"Microsoft New Tai Lue\""
-}, {
-    "text": "Microsoft PhagsPa", "font": "\"Microsoft PhagsPa\""
-}, {
-    "text": "Microsoft Sans Serif", "font": "\"Microsoft Sans Serif\""
-}, {
-    "text": "Microsoft Tai Le", "font": "\"Microsoft Tai Le\""
-}, {
-    "text": "Microsoft YaHei UI", "font": "\"Microsoft YaHei UI\""
-}, {
-    "text": "Microsoft YaHei UI Light", "font": "\"Microsoft YaHei UI Light\""
-}, {
-    "text": "Microsoft Yi Baiti", "font": "\"Microsoft Yi Baiti\""
-}, {
-    "text": "MingLiU-ExtB", "font": "MingLiU-ExtB"
-}, {
-    "text": "MingLiU_HKSCS-ExtB", "font": "MingLiU_HKSCS-ExtB"
-}, {
-    "text": "Mongolian Baiti", "font": "\"Mongolian Baiti\""
-}, {
-    "text": "MS Gothic", "font": "\"MS Gothic\""
-}, {
-    "text": "MS PGothic", "font": "\"MS PGothic\""
-}, {
-    "text": "MS UI Gothic", "font": "\"MS UI Gothic\""
-}, {
-    "text": "MT Extra", "font": "\"MT Extra\""
-}, {
-    "text": "MV Boli", "font": "\"MV Boli\""
-}, {
-    "text": "Myanmar Text", "font": "\"Myanmar Text\""
-}, {
-    "text": "Nirmala UI", "font": "\"Nirmala UI\""
-}, {
-    "text": "Palatino Linotype", "font": "\"Palatino Linotype\""
-}, {
-    "text": "PMingLiU-ExtB", "font": "PMingLiU-ExtB"
-}, {
-    "text": "Segoe Print", "font": "\"Segoe Print\""
-}, {
-    "text": "Segoe Script", "font": "\"Segoe Script\""
-}, {
-    "text": "Segoe UI Symbol", "font": "\"Segoe UI Symbol\""
-}, {
-    "text": "Sylfaen", "font": "Sylfaen"
-}, {
-    "text": "Symbol", "font": "Symbol"
-}, {
-    "text": "Tahoma", "font": "Tahoma"
-}, {
-    "text": "Webdings", "font": "Webdings"
-}, {
-    "text": "Wingdings", "font": "Wingdings"
-}, {
-    "text": "Yu Gothic", "font": "\"Yu Gothic\""
-}, {
-    "text": "Yu Gothic Light", "font": "\"Yu Gothic Light\""
-}, {
-    "text": "Yu Gothic Medium", "font": "\"Yu Gothic Medium\""
-}, {
-    "text": "Yu Gothic UI", "font": "\"Yu Gothic UI\""
-}, {
-    "text": "Yu Gothic UI Light", "font": "\"Yu Gothic UI Light\""
-}, {
-    "text": "Yu Gothic UI Semibold", "font": "\"Yu Gothic UI Semibold\""
-}, {
-    "text": "Courier", "font": "Courier"
-}, {
-    "text": "Times", "font": "Times"
-}]
+export const fontSizes = [
+    {
+        "code": "42pt", "name": "初号"
+    }, {
+        "code": "36pt", "name": "小初"
+    }, {
+        "code": "26pt", "name": "一号"
+    }, {
+        "code": "24pt", "name": "小一"
+    }, {
+        "code": "22pt", "name": "二号"
+    }, {
+        "code": "18pt", "name": "小二"
+    }, {
+        "code": "16pt", "name": "三号"
+    }, {
+        "code": "15pt", "name": "小三"
+    }, {
+        "code": "14pt", "name": "四号"
+    }, {
+        "code": "12pt", "name": "小四"
+    }, {
+        "code": "10.5pt", "name": "五号"
+    }, {
+        "code": "9pt", "name": "小五"
+    }, {
+        "code": "7.5pt", "name": "六号"
+    }, {
+        "code": "6.5pt", "name": "小六"
+    }, {
+        "code": "5.5pt", "name": "七号"
+    }, {
+        "code": "5pt", "name": "八号"
+    }, {
+        "code": "4pt", "name": "4"
+    }, {
+        "code": "8pt", "name": "8"
+    }, {
+        "code": "10pt", "name": "10"
+    }, {
+        "code": "11pt", "name": "11"
+    }, {
+        "code": "20pt", "name": "20"
+    }, {
+        "code": "28pt", "name": "28"
+    }, {
+        "code": "48pt", "name": "48"
+    }, {
+        "code": "72pt", "name": "72"
+    }]
+export const availableFonts = [
+    {
+        "text": "微软雅黑", "font": "\"Microsoft YaHei\""
+    }, {
+        "text": "宋体", "font": "SimSun"
+    }, {
+        "text": "黑体", "font": "SimHei"
+    }, {
+        "text": "仿宋", "font": "FangSong"
+    }, {
+        "text": "楷体", "font": "KaiTi"
+    }, {
+        "text": "新宋体", "font": "NSimSun"
+    }, {
+        "text": "微软正黑体", "font": "\"Microsoft JhengHei\""
+    }, {
+        "text": "Arial", "font": "Arial"
+    }, {
+        "text": "Times New Roman", "font": "\"Times New Roman\""
+    }, {
+        "text": "Calibri", "font": "Calibri"
+    }, {
+        "text": "Comic Sans MS", "font": "\"Comic Sans MS\""
+    }, {
+        "text": "Courier New", "font": "\"Courier New\""
+    }, {
+        "text": "Georgia", "font": "Georgia"
+    }, {
+        "text": "Impact", "font": "Impact"
+    }, {
+        "text": "Trebuchet MS", "font": "\"Trebuchet MS\""
+    }, {
+        "text": "Verdana", "font": "Verdana"
+    }, {
+        "text": "Arial Black", "font": "\"Arial Black\""
+    }, {
+        "text": "Arial Narrow", "font": "\"Arial Narrow\""
+    }, {
+        "text": "Cambria", "font": "Cambria"
+    }, {
+        "text": "Cambria Math", "font": "\"Cambria Math\""
+    }, {
+        "text": "Candara", "font": "Candara"
+    }, {
+        "text": "Consolas", "font": "Consolas"
+    }, {
+        "text": "Constantia", "font": "Constantia"
+    }, {
+        "text": "Corbel", "font": "Corbel"
+    }, {
+        "text": "Ebrima", "font": "Ebrima"
+    }, {
+        "text": "Franklin Gothic", "font": "\"Franklin Gothic\""
+    }, {
+        "text": "Franklin Gothic Medium", "font": "\"Franklin Gothic Medium\""
+    }, {
+        "text": "Gabriola", "font": "Gabriola"
+    }, {
+        "text": "Gadugi", "font": "Gadugi"
+    }, {
+        "text": "Lucida Console", "font": "\"Lucida Console\""
+    }, {
+        "text": "Lucida Sans Unicode", "font": "\"Lucida Sans Unicode\""
+    }, {
+        "text": "Malgun Gothic", "font": "\"Malgun Gothic\""
+    }, {
+        "text": "Marlett", "font": "Marlett"
+    }, {
+        "text": "Microsoft Himalaya", "font": "\"Microsoft Himalaya\""
+    }, {
+        "text": "Microsoft JhengHei UI", "font": "\"Microsoft JhengHei UI\""
+    }, {
+        "text": "Microsoft JhengHei UI Light", "font": "\"Microsoft JhengHei UI Light\""
+    }, {
+        "text": "Microsoft New Tai Lue", "font": "\"Microsoft New Tai Lue\""
+    }, {
+        "text": "Microsoft PhagsPa", "font": "\"Microsoft PhagsPa\""
+    }, {
+        "text": "Microsoft Sans Serif", "font": "\"Microsoft Sans Serif\""
+    }, {
+        "text": "Microsoft Tai Le", "font": "\"Microsoft Tai Le\""
+    }, {
+        "text": "Microsoft YaHei UI", "font": "\"Microsoft YaHei UI\""
+    }, {
+        "text": "Microsoft YaHei UI Light", "font": "\"Microsoft YaHei UI Light\""
+    }, {
+        "text": "Microsoft Yi Baiti", "font": "\"Microsoft Yi Baiti\""
+    }, {
+        "text": "MingLiU-ExtB", "font": "MingLiU-ExtB"
+    }, {
+        "text": "MingLiU_HKSCS-ExtB", "font": "MingLiU_HKSCS-ExtB"
+    }, {
+        "text": "Mongolian Baiti", "font": "\"Mongolian Baiti\""
+    }, {
+        "text": "MS Gothic", "font": "\"MS Gothic\""
+    }, {
+        "text": "MS PGothic", "font": "\"MS PGothic\""
+    }, {
+        "text": "MS UI Gothic", "font": "\"MS UI Gothic\""
+    }, {
+        "text": "MT Extra", "font": "\"MT Extra\""
+    }, {
+        "text": "MV Boli", "font": "\"MV Boli\""
+    }, {
+        "text": "Myanmar Text", "font": "\"Myanmar Text\""
+    }, {
+        "text": "Nirmala UI", "font": "\"Nirmala UI\""
+    }, {
+        "text": "Palatino Linotype", "font": "\"Palatino Linotype\""
+    }, {
+        "text": "PMingLiU-ExtB", "font": "PMingLiU-ExtB"
+    }, {
+        "text": "Segoe Print", "font": "\"Segoe Print\""
+    }, {
+        "text": "Segoe Script", "font": "\"Segoe Script\""
+    }, {
+        "text": "Segoe UI Symbol", "font": "\"Segoe UI Symbol\""
+    }, {
+        "text": "Sylfaen", "font": "Sylfaen"
+    }, {
+        "text": "Symbol", "font": "Symbol"
+    }, {
+        "text": "Tahoma", "font": "Tahoma"
+    }, {
+        "text": "Webdings", "font": "Webdings"
+    }, {
+        "text": "Wingdings", "font": "Wingdings"
+    }, {
+        "text": "Yu Gothic", "font": "\"Yu Gothic\""
+    }, {
+        "text": "Yu Gothic Light", "font": "\"Yu Gothic Light\""
+    }, {
+        "text": "Yu Gothic Medium", "font": "\"Yu Gothic Medium\""
+    }, {
+        "text": "Yu Gothic UI", "font": "\"Yu Gothic UI\""
+    }, {
+        "text": "Yu Gothic UI Light", "font": "\"Yu Gothic UI Light\""
+    }, {
+        "text": "Yu Gothic UI Semibold", "font": "\"Yu Gothic UI Semibold\""
+    }, {
+        "text": "Courier", "font": "Courier"
+    }, {
+        "text": "Times", "font": "Times"
+    }]
 
 export interface EmrParam extends LoadParams {
     // 名称
@@ -507,28 +410,6 @@ export function canIUnlockIt(val) {
     return applicationData.value.unlockJson.includes(val)
 }
 
-/**
- * 患者信息填充完成后的操作
- */
-const patInfoFunc = []
-let isReady = false
-
-export function patInfoMounted(callback: () => void) {
-    if (isReady) {
-        callback()
-        return
-    }
-    patInfoFunc.push(callback)
-}
-
-export function patInfoCallback() {
-    isReady = true
-    XEUtils.remove(patInfoFunc, (item) => {
-        item()
-        return true
-    })
-}
-
 export interface EmrPatient extends Patient {
     // 1-在院 2-出院
     $inOutFlag?: number

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott