icon-light.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="icon-light">
  3. <div class="icon-point" v-for="(item, index) in pointList" :key="index" :style="{ left: item.leftV, top: item.topV }">
  4. <img :src="item.imgSrc" alt="" />
  5. <span :style="{ color: item.textColor }">{{ item.label }}</span>
  6. </div>
  7. </div>
  8. </template>
  9. <script setup lang="ts">
  10. import { ref, reactive } from 'vue';
  11. import { getAssetURL } from '/@/utils/ui';
  12. // const modules = await import.meta.glob('/src/assets/images/company/home/*', { eager: true });
  13. const unselectBgPath = getAssetURL('company/home/unselect-bg.png');
  14. const selectBgPath = getAssetURL('company/home/select-bg.png');
  15. let pointList = ref<any[]>([
  16. { imgSrc: unselectBgPath, label: '柳塔矿', leftV: '327px', topV: '40px', textColor: '#fff' },
  17. { imgSrc: unselectBgPath, label: '寸草塔二矿', leftV: '291px', topV: '69px', textColor: '#fff' },
  18. { imgSrc: selectBgPath, label: '布尔台矿', leftV: '286px', topV: '97px', textColor: 'rgba(255, 231, 83,.9)' },
  19. { imgSrc: unselectBgPath, label: '乌兰木伦矿', leftV: '327px', topV: '115px', textColor: '#fff' },
  20. { imgSrc: selectBgPath, label: '寸草塔矿', leftV: '346px', topV: '132px', textColor: 'rgba(255, 231, 83,.9)' },
  21. { imgSrc: unselectBgPath, label: '石坎台矿', leftV: '373px', topV: '149px', textColor: '#fff' },
  22. { imgSrc: selectBgPath, label: '补连塔矿', leftV: '408px', topV: '184px', textColor: 'rgba(255, 231, 83,.9)' },
  23. { imgSrc: unselectBgPath, label: '哈拉沟矿', leftV: '445px', topV: '214px', textColor: '#fff' },
  24. { imgSrc: selectBgPath, label: '上湾矿', leftV: '439px', topV: '244px', textColor: 'rgba(255, 231, 83,.9)' },
  25. { imgSrc: unselectBgPath, label: '活鸡兔井', leftV: '398px', topV: '265px', textColor: '#fff' },
  26. { imgSrc: unselectBgPath, label: '大柳塔矿', leftV: '492px', topV: '260px', textColor: '#fff' },
  27. { imgSrc: selectBgPath, label: '锦界矿', leftV: '565px', topV: '413px', textColor: 'rgba(255, 231, 83,.9)' },
  28. { imgSrc: unselectBgPath, label: '榆家梁矿', leftV: '669px', topV: '308px', textColor: '#fff' },
  29. { imgSrc: selectBgPath, label: '宝德矿', leftV: '862px', topV: '340px', textColor: 'rgba(255, 231, 83,.9)' },
  30. ]);
  31. </script>
  32. <style lang="less" scoped>
  33. .icon-light {
  34. position: relative;
  35. width: 100%;
  36. height: 100%;
  37. .icon-point {
  38. display: flex;
  39. align-items: center;
  40. position: absolute;
  41. img {
  42. width: 35px;
  43. height: 35px;
  44. cursor: pointer;
  45. }
  46. span {
  47. font-size: 12px;
  48. padding: 0px 5px;
  49. background-color: rgba(12, 13, 13);
  50. }
  51. }
  52. }
  53. </style>