StandardDialog.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div v-if="visible" v-dialogResizeStandard="'can-resize3'" class="standard-dialog can-resize3">
  3. <div class="standard-head">
  4. <span>评分标准</span>
  5. <div class="head-btn-box flex justify-center items-center" @click="closeDialog">
  6. <el-icon><close /></el-icon>
  7. </div>
  8. </div>
  9. <div class="standard-body">
  10. <div id="my-iframe-mask"></div>
  11. <iframe v-if="iframeSrc" style="width: 100%; height: 100%; prevent-events: pointer" :src="iframeSrc"></iframe>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup lang="ts" name="StandardDialog">
  16. import useVModel from '@/hooks/useVModel'
  17. import { ref, computed } from 'vue'
  18. import { Close } from '@element-plus/icons-vue'
  19. import { ElIcon } from 'element-plus'
  20. import useFetch from '@/hooks/useFetch'
  21. const props = defineProps<{
  22. modelValue: boolean
  23. resizeKey?: string
  24. }>()
  25. const visible = useVModel(props)
  26. const closeDialog = () => {
  27. visible.value = false
  28. }
  29. const { fetch: fetchStandard, result: standardRes } = useFetch('getMarkingStandard')
  30. fetchStandard()
  31. const iframeSrc = computed(() => {
  32. return standardRes.value?.url
  33. ? standardRes.value?.url + '#view=FitH&scrollbar=0&toolbar=0&statusbar=0&messages=0&navpanes=0'
  34. : ''
  35. })
  36. </script>
  37. //
  38. <style scoped lang="scss">
  39. .standard-dialog {
  40. display: flex;
  41. flex-direction: column;
  42. position: fixed;
  43. z-index: 500;
  44. border-radius: 6px;
  45. box-shadow: 0px 12px 32px 4px rgba(0, 0, 0, 0.04), 0px 8px 20px rgba(0, 0, 0, 0.08);
  46. .standard-head {
  47. background-color: #f8f8f8;
  48. border-radius: 6px 6px 0 0;
  49. color: #333;
  50. font-size: 14px;
  51. height: 44px;
  52. line-height: 44px;
  53. padding: 0 10px;
  54. position: relative;
  55. .head-btn-box {
  56. position: absolute;
  57. right: 0;
  58. top: 0;
  59. width: 44px;
  60. height: 44px;
  61. z-index: 1;
  62. cursor: pointer;
  63. &:hover {
  64. :deep(i) {
  65. color: $color--primary;
  66. }
  67. }
  68. }
  69. }
  70. .standard-body {
  71. flex: 1;
  72. padding: 2px;
  73. position: relative;
  74. #my-iframe-mask {
  75. position: absolute;
  76. left: 0;
  77. right: 0;
  78. bottom: 0;
  79. top: 0;
  80. z-index: 10;
  81. display: none;
  82. }
  83. }
  84. }
  85. </style>