<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>
</template>

<script name="YaoPingXiangQing" setup>
/**
 * <p>
 * 描述：
 * </p>
 * @author xc
 * @date 2022-03-29 15:36
 */
import store from '@/store'

const props = defineProps({
  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
  })
})

</script>

<style scoped>

</style>
