Browse Source

小优化

xiaochan 1 year ago
parent
commit
735a81af61

+ 5 - 14
src/api/zhu-yuan-yi-sheng/emr-audit.ts

@@ -36,16 +36,7 @@ export interface EmrAuditDetailTable {
     index: number
 }
 
-export function getAuditMessages(id, code, finalControl) {
-    return requestV2({
-        showLoading: false,
-        url: URL + '/getAuditMessages',
-        method: 'get',
-        params: {id, code, finalControl}
-    })
-}
-
-export function setAudit(data) {
+export function setAudit(data: any) {
     return requestV2({
         url: URL + '/setAudit',
         method: 'post',
@@ -53,7 +44,7 @@ export function setAudit(data) {
     })
 }
 
-export function rectifyMedicalRecords(id, state) {
+export function rectifyMedicalRecords(id: string, state: number) {
     return requestV2({
         url: URL + '/rectifyMedicalRecords',
         method: 'get',
@@ -61,7 +52,7 @@ export function rectifyMedicalRecords(id, state) {
     })
 }
 
-export function getHistoricalAudit(emrId, finalControl) {
+export function getHistoricalAudit(emrId: string, finalControl: number) {
     return requestV2({
         url: URL + '/getHistoricalAudit',
         method: 'get',
@@ -70,7 +61,7 @@ export function getHistoricalAudit(emrId, finalControl) {
 }
 
 
-export function updateFinalControl(patNo, times) {
+export function updateFinalControl(patNo: string, times: number) {
     return requestV2({
         url: URL + '/updateFinalControl',
         method: 'get',
@@ -78,7 +69,7 @@ export function updateFinalControl(patNo, times) {
     })
 }
 
-export function updateControlLevel(patNo, times, bazl) {
+export function updateControlLevel(patNo: string, times: number, bazl: string) {
     return requestV2({
         url: URL + '/updateControlLevel',
         method: 'get',

+ 1 - 0
src/components/query-components/convert-sql.ts

@@ -51,6 +51,7 @@ const convertSql = (sqlStr: string, data: any): string => {
             // 获取到 <if test="id != null and id != \'\'"> id = ${id} </if>
             // 被 if 包裹的元素
             if (dynamicJudgment(testReg, data, dataParam)) {
+                // @ts-ignore
                 let dataStr = item.match(/<if test="(.+?)">(.+?)<\/if>/)[2]
                 sqlStr = sqlStr.replace(item, dataStr)
             } else {

+ 12 - 0
src/types/global.d.ts

@@ -0,0 +1,12 @@
+import {XEUtilsMethods} from "xe-utils/ctor";
+
+
+declare module "xe-utils/ctor.d.ts" {
+    interface XEUtilsMethods extends XEUtilsMethods {
+        addUnit(value: string | number, defaultValue = 'px'): string
+
+        isStringNumber(value: string): boolean
+    }
+}
+
+

+ 1 - 1
src/utils/BizException.ts

@@ -9,7 +9,7 @@ export const ExceptionEnum = {
 
 };
 
-class ExceptionCode {
+interface ExceptionCode {
     code: number;
     name: string;
     turnOnHtml: boolean;

+ 7 - 9
src/utils/vxe-formatter.ts

@@ -10,16 +10,14 @@ function addVxeTableFormats() {
 
     VXETable.formats.add('formatSex', {
         cellFormatMethod({cellValue}) {
-            if (cellValue) {
-                if (cellValue == 1) {
-                    return '男'
-                }
-                if (cellValue == 2) {
-                    return '女'
-                }
-                return '其他'
+            switch (cellValue) {
+                case 1:
+                    return '男';
+                case 2:
+                    return "女";
+                default:
+                    return "其他";
             }
-            return ''
         }
     })
 }

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

@@ -125,8 +125,6 @@
       </div>
 
       <div class="layout_main layout_container">
-        <!--  电子病历中的样式条    -->
-        <EmrStyleBar ref="styleBarRef"/>
         <div class="emr_div-tabs">
           <template v-for="(value,key) in IframeTabs">
             <div class="tabs_item"
@@ -183,18 +181,21 @@
             加载脚本
           </div>
         </div>
+        <!--  电子病历中的样式条    -->
+        <EmrStyleBar ref="styleBarRef"/>
         <div class="layout_main">
-          <div style="display: flex;width: 100%;height: calc(100% - 10px)"
-          >
+          <div style="display: flex;width: 100%;height: calc(100% - 10px)">
             <div :style="emrMainWidth()"
                  v-show="showIframeIsList(IframeTabs.正在编辑 , IframeTabs.同时打开, IframeTabs.审核)">
-              <div style="position: relative;height: 100%">
-                <emr-popup ref="popupRef"
-                           @fill-data="popupFunc.fillData"/>
-
-                <div class="编辑器挂载点"
-                     ref="editRef"
-                     style="height: 100%"/>
+              <div class="layout_container layout-horizontal">
+                <EmrFunctionList/>
+                <div style="position: relative" class="layout_main">
+                  <emr-popup ref="popupRef"
+                             @fill-data="popupFunc.fillData"/>
+                  <div class="编辑器挂载点"
+                       ref="editRef"
+                       style="height: 98%"/>
+                </div>
               </div>
             </div>
 
@@ -322,6 +323,8 @@ import useEmrScript from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-m
 import {useUserStore} from "@/pinia/user-store";
 import {CyMessageBox} from "@/components/cy/message-box";
 import EmrAuditV2 from './components/emr-audit/index.vue'
+import EmrFunctionList
+  from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-function/EmrFunctionList.vue";
 
 const userInfo = useUserStore().userInfo
 const props = defineProps({
@@ -1693,6 +1696,8 @@ const emrMittInit = () => {
     setEditorModel('readonly')
   })
 
+  emrMitt.on('clickToSubmitTheMedicalRecord', clickToSubmitTheMedicalRecord)
+  emrMitt.on('clickDelete', clickDelete)
 }
 
 const initEdit = () => {

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

@@ -276,7 +276,7 @@ onMounted(async () => {
   emrMitt.on('closeProgress', () => {
     progressRef.value!.close()
   })
-  if (isDev) {
+  if (!isDev) {
     progressRef.value!.start()
   }
   await nextTick();

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

@@ -229,7 +229,7 @@ defineExpose({
 </script>
 
 <template>
-  <div style="height: 30px" @mousewheel="mousewheel($event)">
+  <div style="height: 30px;background: white" @mousewheel="mousewheel($event)">
     <el-scrollbar ref="tootScrollRef" @scroll="scroll">
       <div class="tool_emr">
         <el-select style="width: 150px;"
@@ -376,7 +376,7 @@ defineExpose({
 .tool_emr {
   width: max-content;
   height: 30px;
-  background-color: #f0f0f0;
+  background-color: white;
   display: flex;
   align-items: center;
 }

+ 9 - 10
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/index.vue

@@ -28,16 +28,15 @@ emrMitt.on('auditV2', (data) => {
 })
 
 
-if (isDev) {
-  emrMitt.emit("auditV2", {
-    patNo: '0429914',
-    times: 1,
-    emrId: 212689,
-    finalControl: 0,
-    emrCategoryCode: 'ruyuanjiluzhuanyong'
-  })
-}
-
+// if (isDev) {
+//   emrMitt.emit("auditV2", {
+//     patNo: '0429914',
+//     times: 1,
+//     emrId: 212689,
+//     finalControl: 0,
+//     emrCategoryCode: 'ruyuanjiluzhuanyong'
+//   })
+// }
 
 provide(emrAuditRootContextKey, {
   store: store

+ 10 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-function/EmrFunctionList.vue

@@ -5,7 +5,14 @@ import {
 } from "@element-plus/icons-vue";
 import {emrMitt} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
-const functionList: { iconfontName?: string, title: string, click: () => void, elicon?: any }[][] = [
+declare type FunctionList = {
+  iconfontName?: string | any,
+  title: string,
+  click: () => void,
+  elicon?: any
+}
+
+const functionList: FunctionList[][] = [
   [
     {
       iconfontName: 'baocun',
@@ -16,7 +23,7 @@ const functionList: { iconfontName?: string, title: string, click: () => void, e
     },
     {
       iconfontName: 'tijiao',
-      title: '标识病历为提交,提交不是保存,该功能只是在这个病历中',
+      title: '标识病历为提交,提交不是保存,该功能只是在病历的前面加上一个🔒的样式',
       click() {
         emrMitt.emit('clickToSubmitTheMedicalRecord')
       },
@@ -25,7 +32,7 @@ const functionList: { iconfontName?: string, title: string, click: () => void, e
       elicon: <Delete/>,
       title: '删除当前病历,可在回收站恢复,出院患者无法删除,需要把出院患者召回才行',
       click() {
-
+        emrMitt.emit('clickDelete')
       },
     }
   ],

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

@@ -406,6 +406,7 @@ export interface EmrMitt {
     dataSourcePadding: (data: any, forceReplacement: boolean) => void
     auditV2: (data: AuditV2) => void
     clickToSubmitTheMedicalRecord: () => void
+    clickDelete: () => void
 }
 
 //@ts-ignore
@@ -465,7 +466,7 @@ export enum IframeTabs {
 }
 
 
-export const showIframe = ref(isDev ? IframeTabs.审核 : IframeTabs.正在编辑)
+export const showIframe = ref(IframeTabs.正在编辑)
 
 export function showIframeIsList(...val: number[]) {
     return val.includes(showIframe.value)

+ 0 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/force-refresh-func.ts

@@ -1,9 +1,6 @@
 import {ref} from "vue";
 import requestV2 from "../../../../../utils/request-v2";
 
-// @ts-ignore
-const api: string = import.meta.env.VITE_EMR_SOCKET
-
 export interface SendEmrSocketParam {
     /**
      * 房间的id

+ 1 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/useEmrScript.ts

@@ -90,8 +90,7 @@ function useEmrScript(props: { getData: () => any, setMsg: (value: any[]) => voi
         if (XEUtils.isEmpty(emrScript.on)) {
             return null
         }
-        const data = props.getData();
-        const {editor, patientData} = data
+        const {editor, patientData} = props.getData()
         if (XEUtils.isObject(emrScript.on)) {
             if (emrScript.on[key]) {
                 return emrScript.on[key].script(editor, patientData, emrScript.on[key], XEUtils, props.setMsg, val, usePushMsg, moment)

+ 2 - 1
tsconfig.json

@@ -36,7 +36,8 @@
     "src/**/*.ts",
     "src/**/*.d.ts",
     "src/**/*.tsx",
-    "src/**/*.vue"
+    "src/**/*.vue",
+    "src/types/global.d.ts"
   ],
   "references": [
     {