domainCell.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div class="flex">
  3. <div class="item" v-for="item in list.slice(0, 4)" :key="item">{{item}};</div>
  4. <el-link type="info" @click="handleEdit" >查看详情</el-link>
  5. </div>
  6. <DomainForm ref="DomainFormRef" />
  7. </template>
  8. <script setup>
  9. import { ref, watch } from 'vue';
  10. const DomainForm = defineAsyncComponent(() => import('./domainForm.vue'));
  11. const props = defineProps(['domainList', 'rowData']);
  12. const list = ref([]);
  13. const DomainFormRef = ref();
  14. watch(
  15. () => props.domainList,
  16. (newVal) => {
  17. list.value = [];
  18. let temp = '';
  19. (newVal || []).forEach(item => {
  20. if (item.sourceType == '2') {
  21. temp = item.domain;
  22. } else {
  23. temp = item.groupName;
  24. }
  25. list.value.push(temp);
  26. });
  27. },
  28. { immediate: true }
  29. );
  30. // 修改域名弹窗
  31. const handleEdit = () => {
  32. DomainFormRef.value.openDialog(props.domainList);
  33. };
  34. </script>
  35. <style scoped>
  36. .flex {
  37. display: flex;
  38. flex-wrap: wrap;
  39. }
  40. .item {
  41. box-sizing: border-box;
  42. padding: 4px 0;
  43. text-align: left;
  44. margin-right: 20px;
  45. color: #666666;
  46. line-height: 18px;
  47. }
  48. </style>