|
@@ -1,94 +1,42 @@
|
|
|
<template>
|
|
|
- <iframe ref="iframeRef" :src="scr" :style="{width: props.width,height:props.height }"/>
|
|
|
+ <div ref="divRef" style="height: 100%; width: 100%"/>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name='XcPrint'>
|
|
|
-import {PrintEmr} from "@/components/xiao-chan/print/xc-print";
|
|
|
+<script setup lang="ts">
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
+import {
|
|
|
+ useEmrInit,
|
|
|
+ UseEmrInitReturn
|
|
|
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init-v2";
|
|
|
|
|
|
-const props = defineProps({
|
|
|
- width: {
|
|
|
- type: String
|
|
|
- },
|
|
|
- height: {
|
|
|
- type: String
|
|
|
- },
|
|
|
- categoryId: {
|
|
|
- type: String
|
|
|
- },
|
|
|
- categoryCode: {
|
|
|
- type: String
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-let scr = $ref(`/emr/runtime/?documentId=null&categoryCode=${props.categoryCode}&categoryId=${props.categoryId}&patientId=null#/`)
|
|
|
+const props = defineProps<{
|
|
|
+ modelValue: any,
|
|
|
+ documentData: any
|
|
|
+}>()
|
|
|
|
|
|
-const iframeRef = ref()
|
|
|
-let emr = null
|
|
|
+const divRef = ref<HTMLDivElement>()
|
|
|
|
|
|
-let shuJu = {
|
|
|
- "mattersNeedingAttention": "1.adshioiou \n 2.asdgbhjkg\n",
|
|
|
- "title": "超声检查申请单彩超",
|
|
|
- "reqNo": 4958090,
|
|
|
- "inpatientNo": "0409327",
|
|
|
- "admissTimes": 1,
|
|
|
- "bedNo": "-10",
|
|
|
- "groupName": "甲状旁腺彩超",
|
|
|
- "actOrderNo": 15894685,
|
|
|
- "orderCode": "10257",
|
|
|
- "orderName": "甲状旁腺彩超",
|
|
|
- "pageNo": "4958090",
|
|
|
- "reqComment": "暗杀收到",
|
|
|
- "reqDoctor": "02896",
|
|
|
- "reqDoctorName": "肖蟾",
|
|
|
- "reqDept": "8000007",
|
|
|
- "reqDeptName": "七病室",
|
|
|
- "reqWard": "8000007",
|
|
|
- "execDept": "2020300",
|
|
|
- "execDeptName": null,
|
|
|
- "reqDate": "2022-12-01 15:52:44",
|
|
|
- "inspectPart": null,
|
|
|
- "inspectStuff": null,
|
|
|
- "inspectStuffName": null,
|
|
|
- "sampleStatus": null,
|
|
|
- "printFlag": null,
|
|
|
- "receiveFlag": "1",
|
|
|
- "reqType": "3",
|
|
|
- "resultComment": null,
|
|
|
- "sysDate": "2022-12-01 15:52:44",
|
|
|
- "startTime": "2022-12-01 13:46:45",
|
|
|
- "diagText": "热性中性粒细胞皮肤病\\[斯威特\\]",
|
|
|
- "diagCode": "L98.200",
|
|
|
- "orderType": "02",
|
|
|
- "reportNo": null,
|
|
|
- "jzFlag": null,
|
|
|
- "reqStudyid": null,
|
|
|
- "reqTzComment": "发生的",
|
|
|
- "reqOtherResult": "发生的",
|
|
|
- "receiveJc": null,
|
|
|
- "sex": 1,
|
|
|
- "homeStreet": "湖南省株洲市荷塘区仙庾镇霞山村黄",
|
|
|
- "homeTel": "13973115487 ",
|
|
|
- "responceTypeName": "普通住院",
|
|
|
- "ybSelfFlag": null,
|
|
|
- "receiveFlagName": "申请医技",
|
|
|
- "pbarCode": null,
|
|
|
- "pname": "贺喜安",
|
|
|
- "page": "77岁"
|
|
|
-}
|
|
|
+let edit: UseEmrInitReturn = null
|
|
|
|
|
|
-const fillData = (data) => {
|
|
|
+const handleSetDocument = () => {
|
|
|
+ edit.editor.setDocument(props.documentData)
|
|
|
+ edit.editor.setEditorMode('readonly')
|
|
|
+ edit.editor.setValues(props.modelValue, true, true)
|
|
|
|
|
|
+ edit.editor.getComponents().forEach((comp) => {
|
|
|
+ if (comp.view.type === 'smarttext') {
|
|
|
+ comp.view.setBorderStyle('solid')
|
|
|
+ comp.view.setBorderColor('white')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-onMounted(async () => {
|
|
|
- await nextTick()
|
|
|
- iframeRef.value.parentElement.emr = new PrintEmr((val) => {
|
|
|
- emr = val
|
|
|
- fillData(shuJu)
|
|
|
+onMounted(() => {
|
|
|
+ useEmrInit(divRef.value, {appContext: () => props.modelValue}).then((res) => {
|
|
|
+ edit = res;
|
|
|
+ handleSetDocument()
|
|
|
})
|
|
|
- console.log(scr)
|
|
|
})
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|