meeting-tpl-list.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div>
  3. <template v-for="(item, index) in list" :key="index">
  4. <div class="border-bottom pd-10 c-s-p item-hover" @click="clickItem(item)">
  5. <div v-if="+item.homeFlag" class="f-s-14 f-w-6 c-333 mb-10">门户页面</div>
  6. <div class="d-flex">
  7. <div class="w-140 h-180 bg-#ccc bg-img-item_view" :style="{ backgroundImage: 'url('+ item?.img +')' }"></div>
  8. <div class="flex1 ov-hd d-flex flex-cln j-sb">
  9. <div class="pd-10">
  10. <el-icon v-if="item?.events?.some(item => item.eventName)"><Sunny /></el-icon>
  11. </div>
  12. <div class="f-s-18 c-danger u-s-n c-s-p pd2-0-10" @click.stop="$emit('delete', item)">
  13. <el-icon><DeleteFilled /></el-icon>
  14. </div>
  15. </div>
  16. </div>
  17. <div @click.stop="changeLabel(item)" class="c-666 f-s-14 pd2-10-0 u-s-n c-s-p d-flex a-c">
  18. <span class="c-666 f-s-14 mr-6">{{ item?.label }}</span>
  19. <el-icon><EditPen /></el-icon>
  20. </div>
  21. </div>
  22. </template>
  23. <div class="pd-16 d-flex a-c j-c">
  24. <el-button @click.stop="addMeetingTpls" plain type="primary">
  25. <el-icon><Plus /></el-icon>
  26. 添加页面
  27. </el-button>
  28. </div>
  29. </div>
  30. </template>
  31. <script setup lang="ts">
  32. import { httpRequests } from '@/utils/httpRequests';
  33. const emit = defineEmits<{
  34. (e: 'selectItem', value: any): void,
  35. (e: 'addMeetingTpls'): void,
  36. (e: 'delete', value: any): void,
  37. (e: 'changeLabel', value: any): void
  38. }>();
  39. const props = defineProps<{
  40. meetid: string,
  41. list: any[]
  42. }>()
  43. const queryParams = ref<any>({
  44. pageNum: 1,
  45. pageSize: 10,
  46. });
  47. const addMeetingTpls = async () => {
  48. emit('addMeetingTpls');
  49. };
  50. const clickItem = (item: any) => {
  51. emit('selectItem', item);
  52. };
  53. // 更换页面名称
  54. const changeLabel = async (item: any) => {
  55. emit('changeLabel', item);
  56. };
  57. </script>
  58. <style scoped lang="scss">
  59. .item-hover:hover {
  60. background-color: #fff;
  61. }
  62. .bg-img-item_view {
  63. background-size: cover;
  64. background-position: center;
  65. }
  66. </style>