xiaochan 1 年之前
父节点
当前提交
c207d4ad43

+ 11 - 0
src/components/cy/dialog/CyDialogTest.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
+</script>
+
+<template>
+  <CyDialog :emit="() => {}" title="我的"/>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 90 - 0
src/components/cy/dialog/src/CyDialog.vue

@@ -0,0 +1,90 @@
+<script setup lang="ts">
+import './cy-dialog.scss'
+import {UseCyDialog} from "./useCyDialog";
+import {onMounted} from "vue";
+import {useZIndex, ElButton} from "element-plus";
+import {ref} from 'vue'
+
+export declare type Props = {
+  title?: string,
+  emit: () => void,
+  fullScreen?: boolean
+}
+
+const props = withDefaults(
+    defineProps<Props>(),
+    {
+      fullScreen: false
+    }
+)
+
+const {
+  ns,
+  headerRef,
+  footerRef,
+  containerRef,
+  bodyHeightStyle,
+  boxRef,
+  bodyRef,
+  observerHeight
+} = UseCyDialog(props)
+
+const zIndex = ref(useZIndex().nextZIndex())
+
+onMounted(() => {
+
+})
+</script>
+
+<template>
+  <div
+      ref="containerRef"
+      :style="{ zIndex  }"
+      :class="[
+      ns.b('container'),
+  ]">
+    <div
+        ref="boxRef"
+        :class="[
+            ns.e('box'),
+            ns.is('fullScreen' , fullScreen)
+        ]"
+    >
+      <header
+          ref="headerRef"
+          :class="[
+            ns.e('header'),
+          ]"
+      >
+        <span>
+           {{ title }}
+        </span>
+      </header>
+      <div
+          ref="bodyRef"
+          :style="bodyHeightStyle"
+          :class="[
+            ns.e('body'),
+          ]"
+      >
+        <slot
+            :width="observerHeight.bodySize.width"
+            :height="observerHeight.bodySize.height"
+        />
+      </div>
+      <footer
+          ref="footerRef"
+          :class="[
+            ns.e('footer'),
+          ]"
+      >
+        <el-button @click="" type="danger" size="default">取消</el-button>
+        <el-button style="margin-right: 15px" @click="" size="default" type="primary">确认</el-button>
+      </footer>
+    </div>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 47 - 0
src/components/cy/dialog/src/cy-dialog.scss

@@ -0,0 +1,47 @@
+.cy-combo-grid-container {
+  position: fixed;
+  width: 100vw;
+  height: 100vw;
+  top: 0;
+  left: 0;
+  background-color: rgba(0, 0, 0, .5);
+  display: flex;
+  justify-content: center;
+
+  .cy-combo-grid__box {
+    width: 600px;
+    height: 400px;
+    background: white;
+    margin-top: 10%;
+    border-radius: 10px;
+  }
+
+  .is-fullScreen {
+    width: 100vw;
+    height: 100vw;
+    margin-top: 0;
+  }
+
+  .cy-combo-grid__header {
+    line-height: 40px;
+    text-align: center;
+    padding: 10px;
+    user-select: none;
+    cursor: all-scroll;
+
+    span {
+      line-height: 24px;
+      font-size: 18px;
+      color: #303133;
+    }
+  }
+
+  .cy-combo-grid__footer {
+    text-align: right;
+    padding: 10px;
+    line-height: 30px;
+  }
+}
+
+
+

+ 67 - 0
src/components/cy/dialog/src/useCyDialog.ts

@@ -0,0 +1,67 @@
+import {ref} from 'vue'
+import {useCyNamespace} from "@/utils/xiaochan-element-plus";
+import {Props} from './CyDialog.vue'
+import {useResizeObserver} from "@vueuse/core";
+import {useDraggable} from "element-plus";
+
+export function UseCyDialog(props: Props) {
+    const ns = useCyNamespace('combo-grid')
+    const headerRef = ref()
+    const footerRef = ref()
+    const containerRef = ref()
+    const boxRef = ref()
+    const bodyRef = ref()
+
+    const observerHeight = ref({
+        headerHeight: 0,
+        footerHeight: 0,
+        boxHeight: 0,
+        bodySize: {
+            height: 0,
+            width: 0
+        }
+    })
+
+    const bodyHeightStyle = computed(() => {
+        return {
+            height: observerHeight.value.boxHeight - observerHeight.value.headerHeight - observerHeight.value.footerHeight + 'px'
+        }
+    })
+
+    useResizeObserver(headerRef, (entries) => {
+        observerHeight.value.headerHeight = entries[0].target.offsetHeight
+    })
+
+    useResizeObserver(boxRef, (entries) => {
+        observerHeight.value.boxHeight = entries[0].target.offsetHeight
+    })
+
+    useResizeObserver(footerRef, (entries) => {
+        observerHeight.value.footerHeight = entries[0].target.offsetHeight
+    })
+
+    useResizeObserver(bodyRef, (entries) => {
+        observerHeight.value.bodySize = {
+            height: entries[0].target.offsetHeight,
+            width: entries[0].target.offsetWidth,
+        }
+    })
+
+    const draggable = computed(() => {
+        return true;
+    })
+
+    useDraggable(boxRef, headerRef, draggable)
+
+
+    return {
+        ns,
+        headerRef,
+        footerRef,
+        bodyHeightStyle,
+        containerRef,
+        boxRef,
+        bodyRef,
+        observerHeight
+    }
+}

+ 8 - 2
src/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue

@@ -60,7 +60,13 @@
         <div>
           小科室:{{ props.huanZheXinXi.zkWardName }}
         </div>
-        <div>
+        <div
+            style="
+            max-width: 160px;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            overflow: hidden;"
+            :title="props.huanZheXinXi.crmName">
           慢病:{{ props.huanZheXinXi.crmName }}
         </div>
         <div class="right_border">
@@ -109,7 +115,7 @@
   </div>
 </template>
 
-<script setup name="HuanZheXinXi">
+<script setup>
 import {isDev, needRule} from "@/utils/public";
 import {clickOnThePatient} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {stringNotBlank} from "@/utils/blank-utils";

+ 4 - 0
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrInspect.vue

@@ -9,6 +9,9 @@
             住院次数:
             <el-input-number v-model="admissTimes" :min="1" :max="props.times"/>
             <el-button @click="query">查询</el-button>
+            <el-button type="primary" @click="openPatientImage(patNo)">
+              影像
+            </el-button>
           </div>
           <vxe-table :data="sideData"
                      :height="height"
@@ -72,6 +75,7 @@ import {
   copyAsDataSource,
   emrMitt
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
+import {openPatientImage} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 
 const props = defineProps({
   patNo: String,

+ 6 - 1
src/utils/xiaochan-element-plus.ts

@@ -1,4 +1,5 @@
-import {ElMessage} from "element-plus";
+import {ElMessage, useNamespace} from "element-plus";
+import {ref} from 'vue'
 
 function message(msg: string, type: string, isHtml: boolean) {
     return ElMessage({
@@ -30,3 +31,7 @@ export const xcMessage = {
     }
 }
 
+export function useCyNamespace(name: string) {
+    return useNamespace(name, ref('cy'))
+}
+