icon-light.vue 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div class="icon-light">
  3. <template v-for="(item, index) in pointList" :key="index">
  4. <div class="icon-point" @click="openModal(item.code, item.leftV, item.topV)" :style="{ left: item.leftV, top: item.topV }">
  5. <img :src="item.imgSrc" alt="" />
  6. <span :style="{ color: item.textColor }">{{ item.label }}</span>
  7. </div>
  8. </template>
  9. </div>
  10. </template>
  11. <script setup lang="ts">
  12. import { ref, defineEmits } from 'vue';
  13. import { getAssetURL } from '/@/utils/ui';
  14. const emit = defineEmits(['showDetail']);
  15. const unselectBgPath = getAssetURL('company/home/unselect-bg.png');
  16. const selectBgPath = getAssetURL('company/home/select-bg.png');
  17. let pointList = ref<any[]>([
  18. // { code: 'liuTa', imgSrc: unselectBgPath, label: 'lt', leftV: '327px', topV: '40px', textColor: '#fff' },
  19. // { code: 'cunCaoErTa', imgSrc: unselectBgPath, label: 'cce', leftV: '291px', topV: '69px', textColor: '#fff' },
  20. // { code: 'buErTaiTa', imgSrc: selectBgPath, label: 'bet', leftV: '286px', topV: '97px', textColor: 'rgba(255, 231, 83,.9)' },
  21. // { code: 'wuLunTa', imgSrc: unselectBgPath, label: 'wlml', leftV: '327px', topV: '115px', textColor: '#fff' },
  22. // { code: 'cunCaoTa', imgSrc: selectBgPath, label: 'cc', leftV: '346px', topV: '132px', textColor: 'rgba(255, 231, 83,.9)' },
  23. // { code: 'shiKanTa', imgSrc: unselectBgPath, label: 'skt', leftV: '373px', topV: '149px', textColor: '#fff' },
  24. // { code: 'buLieTa', imgSrc: selectBgPath, label: 'blt', leftV: '408px', topV: '184px', textColor: 'rgba(255, 231, 83,.9)' },
  25. // { code: 'haLaGouTa', imgSrc: unselectBgPath, label: 'hlg', leftV: '445px', topV: '214px', textColor: '#fff' },
  26. // { code: 'shangWanTa', imgSrc: selectBgPath, label: 'sw', leftV: '439px', topV: '244px', textColor: 'rgba(255, 231, 83,.9)' },
  27. // { code: 'huoJiTuTa', imgSrc: unselectBgPath, label: 'hjt', leftV: '398px', topV: '265px', textColor: '#fff' },
  28. // { code: 'daLiuTa', imgSrc: unselectBgPath, label: 'dlt', leftV: '492px', topV: '260px', textColor: '#fff' },
  29. // { code: 'jinJieTa', imgSrc: selectBgPath, label: 'jj', leftV: '565px', topV: '413px', textColor: 'rgba(255, 231, 83,.9)' },
  30. // { code: 'yuJiaTa', imgSrc: unselectBgPath, label: 'yjl', leftV: '669px', topV: '308px', textColor: '#fff' },
  31. // { code: 'baoDeTa', imgSrc: selectBgPath, label: 'bd', leftV: '862px', topV: '340px', textColor: 'rgba(255, 231, 83,.9)' },
  32. { code: 'liuTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '327px', topV: '40px', textColor: '#fff' },
  33. { code: 'cunCaoErTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '291px', topV: '69px', textColor: '#fff' },
  34. { code: 'buErTaiTa', imgSrc: selectBgPath, label: 'XXX', leftV: '286px', topV: '97px', textColor: 'rgba(255, 231, 83,.9)' },
  35. { code: 'wuLunTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '327px', topV: '115px', textColor: '#fff' },
  36. { code: 'cunCaoTa', imgSrc: selectBgPath, label: 'XXX', leftV: '346px', topV: '132px', textColor: 'rgba(255, 231, 83,.9)' },
  37. { code: 'shiKanTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '373px', topV: '149px', textColor: '#fff' },
  38. { code: 'buLieTa', imgSrc: selectBgPath, label: 'XXX', leftV: '408px', topV: '184px', textColor: 'rgba(255, 231, 83,.9)' },
  39. { code: 'haLaGouTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '445px', topV: '214px', textColor: '#fff' },
  40. { code: 'shangWanTa', imgSrc: selectBgPath, label: 'XXX', leftV: '439px', topV: '244px', textColor: 'rgba(255, 231, 83,.9)' },
  41. { code: 'huoJiTuTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '398px', topV: '265px', textColor: '#fff' },
  42. { code: 'daLiuTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '492px', topV: '260px', textColor: '#fff' },
  43. { code: 'jinJieTa', imgSrc: selectBgPath, label: 'XXX', leftV: '565px', topV: '413px', textColor: 'rgba(255, 231, 83,.9)' },
  44. { code: 'yuJiaTa', imgSrc: unselectBgPath, label: 'XXX', leftV: '669px', topV: '308px', textColor: '#fff' },
  45. { code: 'baoDeTa', imgSrc: selectBgPath, label: 'XXX', leftV: '862px', topV: '340px', textColor: 'rgba(255, 231, 83,.9)' },
  46. ]);
  47. function openModal(code, leftV, topV) {
  48. emit('showDetail', code, leftV, topV);
  49. }
  50. </script>
  51. <style lang="less" scoped>
  52. .icon-light {
  53. position: relative;
  54. width: 100%;
  55. height: 100%;
  56. .icon-point {
  57. display: flex;
  58. align-items: center;
  59. position: absolute;
  60. img {
  61. width: 35px;
  62. height: 35px;
  63. cursor: pointer;
  64. }
  65. span {
  66. font-size: 12px;
  67. padding: 0px 5px;
  68. background-color: rgba(12, 13, 13);
  69. }
  70. }
  71. }
  72. </style>