瀏覽代碼

no message

xiaochan 2 年之前
父節點
當前提交
feae97c3d9
共有 1 個文件被更改,包括 23 次插入27 次删除
  1. 23 27
      src/components/zhu-yuan-yi-sheng/he-li-yong-yao/YaoPingXiangQing.vue

+ 23 - 27
src/components/zhu-yuan-yi-sheng/he-li-yong-yao/YaoPingXiangQing.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-dialog v-model="dialog" title="药品说明书" @close="emit('close')">
-    <el-container>
-      <iframe v-if="showIframe" :height="windowSize.h / 1.4"
-              :src="src"
-              :width="windowSize.w / 1.2">
-      </iframe>
-    </el-container>
-  </el-dialog>
+    <el-dialog v-model="dialog" title="药品说明书" @close="emit('close')">
+        <div :style="{height: getWindowSize.h / 1.4 + 'px',width : '100%'}">
+            <iframe v-if="showIframe"
+                    style="width: 100%;height: 100%"
+                    :src="src">
+            </iframe>
+        </div>
+    </el-dialog>
 </template>
 
 <script name="YaoPingXiangQing" setup>
@@ -17,36 +17,32 @@
  * @author xc
  * @date 2022-03-29 15:36
  */
-import store from '@/store'
+import {getWindowSize} from "@/utils/window-size";
 
 const props = defineProps({
-  code: {
-    type: String,
-  },
-  url: {
-    type: String,
-  }
+    code: {
+        type: String,
+    },
+    url: {
+        type: String,
+    }
 })
 const emit = defineEmits(['close'])
 
-const windowSize = computed(() => {
-  return store.state.app.windowSize
-})
-
 let dialog = $ref(true)
 let src = $ref('')
 
 let showIframe = $ref(false)
 
 onMounted(() => {
-  nextTick(() => {
-    if (props.url) {
-      src = props.url
-    } else {
-      src = "http://172.16.32.121:9097/web/sms/hpms_medi_show.aspx?his_code=" + props.code
-    }
-    showIframe = true
-  })
+    nextTick(() => {
+        if (props.url) {
+            src = props.url
+        } else {
+            src = "http://172.16.32.121:9097/web/sms/hpms_medi_show.aspx?his_code=" + props.code
+        }
+        showIframe = true
+    })
 })
 
 </script>