<template>
  <div
    class="Main"
    :style="{
      backgroundColor: styleInfo.bac,
      boxShadow: `0px 0px 80px 80px ${styleInfo.bac}`,
    }"
  >
    <div class="xian" :style="{ border: `1px dashed ${styleInfo.borC}` }"></div>
    <div
      class="xian xian2"
      :style="{ border: `1px dashed ${styleInfo.borC}` }"
    ></div>
    <div
      class="xian xian3"
      :style="{ border: `1px dashed ${styleInfo.borC}` }"
    ></div>
    <div
      @click="clickFu(item)"
      class="qiu"
      v-for="item in data"
      :key="item.id"
      :style="{
        top: item.top + '%',
        left: item.left + '%',
        width: item.size + 'px',
        height: item.size + 'px',
        fontSize: item.font + 'px',
        opacity: item.opacity,
        backgroundColor: item.color ? item.color : styleInfo.qBac,
        color: styleInfo.qColor,
      }"
    >
      {{ item.name }}
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    data: {
      type: Array,
      default: () => [],
    },
    clickPath: {
      type: String,
      default: "",
    },
    styleInfo: {
      type: Object,
      default: () => ({}),
    },
    isThree: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    clickFu(item) {
      if (this.isThree) this.$emit("lookInfoFu", item);
      else this.$router.push(this.clickPath + item.id);
    },
  },
  created() {},
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
.Main {
  border-radius: 50%;
  position: absolute;
  width: 100vh;
  height: 100vh;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  .xian {
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border-radius: 50%;
  }
  .xian2 {
    width: 240px;
    height: 240px;
  }
  .xian3 {
    width: 320px;
    height: 320px;
  }
  .qiu {
    cursor: pointer;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    transition: all 0.3s;
    &:hover {
      transform: translate(-50%, -50%) scale(1.1);
    }
  }
}
</style>