CameraSharePopover.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div class="overlay" v-if="props.modelValue"></div>
  3. <el-card v-if="props.modelValue" class="pop-card">
  4. <template #header>
  5. <div class="flex justify-between items-center pop-head">
  6. <span class="pop-head-name">共享相机</span>
  7. <el-icon :size="16" class="mr-3" @click="updateValue(false)"><Close /></el-icon>
  8. </div>
  9. </template>
  10. <div class="pop-content">
  11. <ShareCameraDetail :form-data="props.shareData" />
  12. </div>
  13. </el-card>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import { cameraAddType } from '@/types/camera/constant';
  18. import { Close } from '@element-plus/icons-vue';
  19. import ShareCameraDetail from './ShareCameraDetail.vue';
  20. import { CameraDetailServer } from '@/types/camera/type';
  21. const props = defineProps<{ modelValue: boolean; shareData?: CameraDetailServer | null }>();
  22. const emits = defineEmits(['update:modelValue']);
  23. const addType = ref(cameraAddType[0].value);
  24. const updateValue = (value) => {
  25. addType.value = cameraAddType[0].value;
  26. emits('update:modelValue', value);
  27. };
  28. </script>
  29. <style scoped lang="scss">
  30. .overlay {
  31. position: fixed;
  32. top: 0;
  33. left: 0;
  34. width: 100vw;
  35. height: 100vh;
  36. background-color: rgba(0, 0, 0, 0.5);
  37. z-index: 999;
  38. }
  39. .pop-card {
  40. position: fixed;
  41. top: 50%;
  42. left: 50%;
  43. transform: translate(-50%, -50%);
  44. z-index: 1000;
  45. }
  46. .pop-head {
  47. height: 56px;
  48. &-name {
  49. margin-left: 24px;
  50. font-size: 16px;
  51. font-weight: 500;
  52. color: #252525;
  53. }
  54. &-tabs {
  55. margin-top: 18px;
  56. :first-child {
  57. border-radius: 8px 0px 0px 0px;
  58. }
  59. :last-child {
  60. border-radius: 0px 8px 0px 0px;
  61. }
  62. }
  63. }
  64. .tab-item {
  65. width: 188px;
  66. height: 38px;
  67. background: #fafafa;
  68. border: 1px solid #d9d9d9;
  69. cursor: pointer;
  70. &-active {
  71. background: #e2eefe;
  72. border: 1px solid #1890ff;
  73. }
  74. }
  75. .pop-content {
  76. height: 480px;
  77. display: flex;
  78. justify-content: center;
  79. padding: 35px;
  80. overflow: auto;
  81. }
  82. :deep(.el-card__header) {
  83. padding: 0;
  84. }
  85. :deep(.el-card__body) {
  86. padding: 0;
  87. }
  88. </style>