meeting-tpl-list.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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" :class="{ 'checked': selectTplId === item.id }" @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 p-rtv" :style="{ backgroundImage: 'url('+ item?.img +')' }">
  8. <img v-if="+item?.homeFlag" class="has_page_index_icon" src="@/assets/images/has_page_index_icon.png" />
  9. <img @click.stop="clickSetIndex(item)" v-else class="set_index_icon" src="@/assets/images/set_index_icon.png" />
  10. </div>
  11. <div class="flex1 ov-hd d-flex flex-cln j-sb">
  12. <div class="pd-10">
  13. <el-icon v-if="item?.events?.some(item => item.eventName)"><Sunny /></el-icon>
  14. </div>
  15. <div class="f-s-18 c-danger u-s-n c-s-p pd2-0-10" @click.stop="$emit('delete', item)">
  16. <el-icon><DeleteFilled /></el-icon>
  17. </div>
  18. </div>
  19. </div>
  20. <div @click.stop="changeLabel(item)" class="c-666 f-s-14 pd2-10-0 u-s-n c-s-p d-flex a-c c-666 f-s-14 btm-text">
  21. <span class="mr-6">{{ item?.label }}</span>
  22. <el-icon><EditPen /></el-icon>
  23. </div>
  24. </div>
  25. </template>
  26. <div class="pd-16 d-flex a-c j-c">
  27. <el-button @click.stop="addMeetingTpls" plain type="primary">
  28. <el-icon><Plus /></el-icon>
  29. 添加页面
  30. </el-button>
  31. </div>
  32. </div>
  33. </template>
  34. <script setup lang="ts">
  35. import { httpRequests } from '@/utils/httpRequests';
  36. const emit = defineEmits<{
  37. (e: 'selectItem', value: any): void,
  38. (e: 'addMeetingTpls'): void,
  39. (e: 'delete', value: any): void,
  40. (e: 'changeLabel', value: any): void,
  41. // 设置首页
  42. (e: 'setIndex', value: any): void,
  43. }>();
  44. const props = defineProps<{
  45. meetid: string,
  46. list: any[]
  47. }>()
  48. const queryParams = ref<any>({
  49. pageNum: 1,
  50. pageSize: 10,
  51. });
  52. const addMeetingTpls = async () => {
  53. emit('addMeetingTpls');
  54. };
  55. const selectTplId = ref<string>('');
  56. const clickItem = (item: any) => {
  57. selectTplId.value = item.id;
  58. emit('selectItem', item);
  59. };
  60. // 更换页面名称
  61. const changeLabel = async (item: any) => {
  62. emit('changeLabel', item);
  63. };
  64. const clickSetIndex = async (item: any) => {
  65. if (+item.homeFlag) {
  66. return;
  67. }
  68. emit('setIndex', item)
  69. };
  70. </script>
  71. <style scoped lang="scss">
  72. .item-hover:hover {
  73. background-color: #fff;
  74. }
  75. .bg-img-item_view {
  76. background-size: cover;
  77. background-position: center;
  78. border: 1px solid transparent;
  79. }
  80. .item-hover {
  81. cursor: pointer;
  82. &:hover {
  83. .bg-img-item_view {
  84. border-color: var(--el-color-primary);
  85. }
  86. .btm-text {
  87. color: var(--el-color-primary);
  88. }
  89. }
  90. &.checked {
  91. .bg-img-item_view {
  92. border-color: var(--el-color-primary);
  93. }
  94. .btm-text {
  95. font-weight: 600;
  96. color: var(--el-color-primary);
  97. }
  98. }
  99. }
  100. .has_page_index_icon {
  101. position: absolute;
  102. top: 0;
  103. left: 0;
  104. width: 40px;
  105. height: 40px;
  106. }
  107. .set_index_icon {
  108. position: absolute;
  109. bottom: 10px;
  110. right: 10px;
  111. }
  112. </style>