Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

lighter 1 year ago
parent
commit
7025864706

+ 3 - 5
src/components/cy/dialog/src/CyDialog.vue

@@ -6,8 +6,7 @@ import {
 } from 'element-plus'
 import {
   CyDialogProps,
-  IsCyDialog,
-  UseCyDialog
+  useCyDialog,
 } from "@/components/cy/dialog/src/useCyDialog";
 import './cy-dialog.scss'
 
@@ -15,15 +14,14 @@ const COMPONENT_NAME = 'CyDialog'
 
 export default defineComponent({
   name: COMPONENT_NAME,
-  componentName: COMPONENT_NAME,
   components: {
     ElButton,
     ElFocusTrap
   },
   props: {...CyDialogProps},
   emits: ['closed'],
-  setup(props: IsCyDialog, {emit, expose}) {
-    const API = UseCyDialog(props, emit)
+  setup(props, {emit, expose}) {
+    const API = useCyDialog(props, emit)
     const zIndex = ref(useZIndex().nextZIndex())
 
     expose({

+ 1 - 2
src/components/cy/dialog/src/useCyDialog.ts

@@ -50,14 +50,13 @@ export const CyDialogProps = {
 
 export type IsCyDialog = ExtractPropTypes<typeof CyDialogProps>
 
-export function UseCyDialog(props: IsCyDialog, emit: any) {
+export function useCyDialog(props: IsCyDialog, emit: any) {
     const ns = useCyNamespace('dialog')
     const headerRef = ref()
     const footerRef = ref()
     const containerRef = ref()
     const boxRef = ref()
     const bodyRef = ref()
-    const ctx = getCurrentInstance()
 
     const state = reactive({
         bodySize: {

+ 4 - 2
src/components/loading-progress/LoadingProgress.vue

@@ -6,7 +6,6 @@ import sleep from "@/utils/sleep";
 const props = defineProps<{ loadingName: string, describes: string[] }>()
 
 const percentage = ref(0)
-const progressRef = ref(null)
 const isShow = ref(false)
 const describe = ref('')
 
@@ -101,7 +100,10 @@ defineExpose({
     <div class="loading_progress" ref="divRef" v-show="isShow">
       <div class="progress_main" style="width: 100%">
         <div class="result">
-          <el-progress type="dashboard" :percentage="parseInt(percentage)" :color="colors" ref="progressRef">
+          <el-progress
+              type="dashboard"
+              :percentage="parseInt(percentage)"
+              :color="colors">
             <template #default="{ percentage }">
               <span class="percentage-value">{{ percentage }}%</span>
               <span class="percentage-label">{{ props.loadingName }}</span>

+ 19 - 17
src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrChatBox.vue

@@ -69,35 +69,37 @@
   </el-dialog>
 </template>
 
-<script setup name='EmrChatBox'>
+<script setup lang="ts">
 import {getWindowSize} from "@/utils/window-size";
 import {getChatHistoryBySid, sendAMessage} from "@/api/zhu-yuan-yi-sheng/emr-socket";
 import {stringIsBlank} from "@/utils/blank-utils";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import {useUserStore} from "@/pinia/user-store";
+import {ElScrollbar} from "element-plus";
+import {useCompRef} from "@/utils/useCompRef";
+import {defineComponent} from "vue";
 
-let userData = useUserStore().userInfo
+const userData = useUserStore().userInfo
+
+defineComponent({
+  name: "EmrChatBox",
+})
 
 const chatHistory = ref([])
-const props = defineProps({
-  userList: {
-    type: Array
-  },
-  sid: {
-    type: String
-  },
+const props = defineProps<{
+  userList: any[],
+  sid: string | null,
   currentEditorUser: {
-    type: Object,
-    default: null
-  }
-})
+    name: string
+  } | null
+}>()
 
 const emits = defineEmits(['closed'])
 
 const dialog = ref(true)
 const messageStr = ref('')
-const scrollbarRef = ref('')
-const innerRef = ref('')
+const scrollbarRef = useCompRef(ElScrollbar)
+const innerRef = ref<HTMLDivElement | null>(null)
 
 const clickSend = async () => {
   if (stringIsBlank(messageStr.value)) {
@@ -121,9 +123,9 @@ const modifyTheCurrentMedicalRecord = async () => {
 }
 
 const queryJump = async () => {
-  chatHistory.value = await getChatHistoryBySid(props.sid)
+  chatHistory.value = await getChatHistoryBySid(props.sid) as any[]
   await nextTick()
-  scrollbarRef.value.setScrollTop(innerRef.value.scrollHeight)
+  scrollbarRef.value!.setScrollTop(innerRef.value!.scrollHeight)
 }
 
 const whetherInPerson = (code) => {

+ 2 - 1
src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSocket.vue

@@ -7,7 +7,7 @@
     </div>
   </div>
 
-  <emr-chat-box
+  <EmrChatBox
       v-if="dialog"
       ref="dialogRef"
       :current-editor-user="props.currentEditorUser"
@@ -109,6 +109,7 @@ const onmessageFunc = {
   },
   "closeSoctek": (val) => {
     if (isDev) {
+      window.location.reload()
       return
     }
     if (navigator.userAgent.indexOf("Firefox") !== -1 || navigator.userAgent.indexOf("Chrome") !== -1) {

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

@@ -191,14 +191,10 @@
               <div style="position: relative;height: 100%">
                 <emr-popup ref="popupRef"
                            @fill-data="popupFunc.fillData"/>
-                <emr-web-socket :pat-info="patientInfo"
-                                :current-editor-user="currentEditorUser"
-                                ref="emrSocket"/>
+
                 <div class="编辑器挂载点"
                      ref="editRef"
-                     style="height: 100%"
-                >
-                </div>
+                     style="height: 100%"/>
               </div>
             </div>
 
@@ -221,13 +217,14 @@
           </div>
         </div>
       </div>
-
-
       <EmrRightComp/>
-
     </div>
   </div>
 
+  <emr-web-socket :pat-info="patientInfo"
+                  :current-editor-user="currentEditorUser"
+                  ref="emrSocket"/>
+
   <EmrRefreshDialog/>
   <EmrSaveRules ref="emrSaveRulesRef"/>
   <xc-dialog-v2
@@ -322,7 +319,6 @@ import {
   emrRootContextKey, PageStore, useEmrStore
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/useEmrStore";
 import HuanZheXinXi from "@/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue";
-import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
 import useEmrScript from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/useEmrScript";
 import {useUserStore} from "@/pinia/user-store";
 import {CyMessageBox} from "@/components/cy/message-box";
@@ -523,6 +519,8 @@ const emrEvent = {
         deptDirector: extractFields('主任医生编码'),
       })
     }
+    editor!.setCursor('DOCUMENT_END');
+    editor!.scrollToCursor();
     fragmentsCannotBeInserted = false
   },
   "areaFocus": (evt, view) => {
@@ -888,11 +886,13 @@ const clickDelete = () => {
   if (createId !== userInfo.code) {
     BizException(ExceptionEnum.LOGICAL_ERROR, "创建人不是您,无法删除。");
   }
-  ElMessageBox.alert('是否要删除该模板。', '提示', {
-    type: 'warning'
+  CyMessageBox.confirm({
+    message: '是否要删除该模板,\n删除的模板可以在回收站中找回,出院患者需要召回才能删除。',
+    title: '提示',
+    type: 'delete'
   }).then(async () => {
     // 电子病历删除
-    let res = await deletePatientEmrByDocumentId(getId()) as any[]
+    const res = await deletePatientEmrByDocumentId(getId()) as any[]
     if (res.length > 0) {
       for (let i = 0; i < res.length; i++) {
         let item = res[i]
@@ -902,9 +902,9 @@ const clickDelete = () => {
       }
     }
     isEditorChange.value = false
-    emrSidebarRef.value.queryData()
+    emrSidebarRef.value!.queryData()
     emptyEditor()
-  });
+  })
 }
 
 /**
@@ -930,14 +930,15 @@ const checkEmrChange = (cb) => {
     isEditorChange.value = false
   }
   if (isEditorChange.value) {
-    ElMessageBox.confirm("您改变了数据是否要保存,不保存可能会丢失数据。", '提示', {
-      type: "warning",
+    CyMessageBox.confirm({
+      message: '您改变了数据是否要保存,不保存可能会丢失数据。',
+      title: '提示',
+      type: 'warning',
       cancelButtonText: '放弃修改',
       confirmButtonText: '保存病历',
-      distinguishCancelAndClose: true,
     }).then(() => {
       clickSaveData()
-    }).catch((action) => {
+    }).catch(({action}) => {
       if (action === 'cancel') {
         isEditorChange.value = false
         cb()
@@ -1016,7 +1017,7 @@ const clickSnippet = async ({content, styles, code}) => {
   }
   // 移动到文档结尾 不然他会插入到片段里面
   editor!.setCursor('DOCUMENT_END');
-  editor!.scrollToCursor()
+  editor!.scrollToCursor();
   const insertContent = {
     // 内容
     value: content,
@@ -1031,8 +1032,7 @@ const clickSnippet = async ({content, styles, code}) => {
   if (isReadonly) {
     lastView.setAttribute('readonly', true);
   }
-  editor!.setCursor('DOCUMENT_END');
-  editor!.scrollToCursor();
+
 }
 
 /**

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

@@ -19,8 +19,8 @@
       </el-button-group>
       <!--    解锁病历质控        -->
       <emr-quality-control-relieve/>
-      <el-button @click="patientListDrawer = !patientListDrawer"
-      >
+      <el-button
+          @click="patientListDrawer = !patientListDrawer">
         患者列表
       </el-button>
       出院天数:{{ patientInfo.dischargeDays }}

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

@@ -3,7 +3,6 @@
             :confirm-click="confirmClick"
             ref="dialogRef"
             body-height="max-conent">
-
     <el-form label-width="80px" label-position="top">
       <el-form-item label="工号:">
         <SystemStaffSelect
@@ -37,7 +36,7 @@ const password = ref('')
 const dialogRef = useCompRef(CyDialog)
 
 function signUser() {
-  dialogRef.value.closed(ClosingMethod.CONFIRM, props.usersign)
+  dialogRef.value!.closed(ClosingMethod.CONFIRM, props.usersign)
 }
 
 function confirmClick(next) {