CameraSharedEdit.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <el-card v-if="props.modelValue" class="pop-card">
  3. <template #header>
  4. <div class="flex justify-between items-center pop-head">
  5. <span class="pop-head-name">添加相机</span>
  6. <div class="flex pop-head-tabs">
  7. <div
  8. v-for="item in sharedCaremaType"
  9. :key="item.value"
  10. class="flex justify-center items-center tab-item"
  11. :class="{ 'tab-item-active': item.value === addType }"
  12. @click="addType = item.value"
  13. >
  14. {{ item.label }}
  15. </div>
  16. </div>
  17. <el-icon :size="16" class="mr-3" @click="updateValue(false)"><Close /></el-icon>
  18. </div>
  19. </template>
  20. <div><SharedTable :addCameraType="addType" @update="updateUnAdd" /></div>
  21. </el-card>
  22. </template>
  23. <script setup lang="ts">
  24. import { ref } from 'vue';
  25. import { sharedCaremaType } from '../constant';
  26. import { Close } from '@element-plus/icons-vue';
  27. import SharedTable from './SharedTable.vue';
  28. const props = defineProps<{ modelValue: boolean }>();
  29. const emits = defineEmits(['update:modelValue', 'updateUnadd']);
  30. const addType = ref(sharedCaremaType[0].value);
  31. const updateValue = (value) => {
  32. addType.value = sharedCaremaType[0].value;
  33. emits('update:modelValue', value);
  34. };
  35. const updateUnAdd = () => {
  36. emits('updateUnadd');
  37. };
  38. </script>
  39. <style scoped lang="scss">
  40. .pop-card {
  41. position: relative;
  42. margin-left: 21px !important;
  43. }
  44. .pop-head {
  45. height: 56px;
  46. &-name {
  47. margin-left: 24px;
  48. font-size: 16px;
  49. font-weight: 500;
  50. color: #252525;
  51. }
  52. &-tabs {
  53. margin-top: 18px;
  54. :first-child {
  55. border-radius: 8px 0px 0px 0px;
  56. }
  57. :last-child {
  58. border-radius: 0px 8px 0px 0px;
  59. }
  60. }
  61. }
  62. .tab-item {
  63. width: 188px;
  64. height: 38px;
  65. background: #fafafa;
  66. border: 1px solid #d9d9d9;
  67. cursor: pointer;
  68. &-active {
  69. background: #e2eefe;
  70. border: 1px solid #1890ff;
  71. }
  72. }
  73. .pop-content {
  74. height: 566px;
  75. }
  76. :deep(.el-card__header) {
  77. padding: 0;
  78. }
  79. :deep(.el-card__body) {
  80. padding: 0;
  81. }
  82. </style>