Newer
Older
HuangJiPC / src / pages / views / WatershedOneMap / components / W_oneMapTuLi.vue
@zhangdeliang zhangdeliang on 21 Jun 7 KB update
<template>
  <div id="basicTuLi">
    <div id="eventBox">
      <div class="eventList">
        <img src="@/assets/Imgs/LiuYuYiZhangTu/shijian.png" class="eventImg" />
        <div class="eventFonts">
          <p class="eventFontsP1">17</p>
          <p
            class="eventFontsP2"
            :class="[sysTheme ? 'dark_eventFontsP2' : '']"
          >
            事件
          </p>
        </div>
      </div>
      <div class="eventList eventList2">
        <img src="@/assets/Imgs/LiuYuYiZhangTu/yujiung.png" class="eventImg" />
        <div class="eventFonts">
          <p class="eventFontsP1">14</p>
          <p
            class="eventFontsP2"
            :class="[sysTheme ? 'dark_eventFontsP2' : '']"
          >
            预警
          </p>
        </div>
      </div>
    </div>
    <!-- <div id="QieHuan" @click="onTheme">切换主题</div> -->
    <!-- <div id="TuLiBox">
      <n-space vertical>
        <div class="TuliBox" v-for="(item, index) in TuLiData" :key="index">
          <n-popover
            trigger="hover"
            :style="{
              width: 'auto',
              height: 'auto',
              maxWidth: '850px',
              borderRadius: '5px',
            }"
            :placement="item.position"
            class="rightPopover"
          >
            <template #trigger>
              <n-checkbox
                v-model:checked="item.isChecked"
                @update:checked="CheckChange(item)"
              >
                <span class="rightPopoverSpan"
                  >{{ item.name }}({{ item.length }})</span
                >
              </n-checkbox>
            </template>
            <div class="DuoXuanKuang">
              <n-space>
                <span
                  v-for="(item2, index2) in item.data"
                  :key="index2"
                  @click="BtnLick(item2)"
                  class="DouXuanBtn"
                  :class="{ DouXuanBtnCheck: chechId == item2.ZhaId }"
                >
                  {{ item2.ZhaName }}
                </span>
              </n-space>
            </div>
          </n-popover>
        </div>
      </n-space>
    </div> -->
  </div>
</template>
<script>
import { ref, reactive, toRefs, onMounted, computed } from "vue";
import { useStore } from "vuex";
import bus from "@/utils/util";
export default {
  name: "basicTuLi",
  setup() {
    let store = useStore();
    let TuLiData = reactive([
      {
        name: "污水厂",
        length: "05",
        id: "1",
        isChecked: true,
        position: "right-start",
        data: [
          {
            ZhaName: "黄孝河强化处理设施",
            ZhaId: "1-1",
          },
          {
            ZhaName: "铁路桥地下净水厂",
            ZhaId: "1-2",
          },
          {
            ZhaName: "机场河强化处理设施",
            ZhaId: "1-3",
          },
          {
            ZhaName: "汉西污水厂",
            ZhaId: "1-4",
          },
          {
            ZhaName: "三金潭污水厂",
            ZhaId: "1-5",
          },
        ],
      },
      {
        name: "污水泵站",
        length: "09",
        id: "2",
        isChecked: true,
        position: "right",
        data: [
          {
            ZhaName: "张公堤泵站",
            ZhaId: "2-1",
          },
          {
            ZhaName: "王家墩泵站",
            ZhaId: "2-2",
          },
          {
            ZhaName: "古田二路泵站",
            ZhaId: "2-3",
          },
          {
            ZhaName: "常青路泵站",
            ZhaId: "2-4",
          },
          {
            ZhaName: "石桥泵站",
            ZhaId: "2-5",
          },
          {
            ZhaName: "塔子湖泵站",
            ZhaId: "2-6",
          },
          {
            ZhaName: "建设渠泵站",
            ZhaId: "2-7",
          },
          {
            ZhaName: "北4泵站",
            ZhaId: "2-8",
          },
          {
            ZhaName: "铁路桥泵站",
            ZhaId: "2-9",
          },
        ],
      },
      {
        name: "雨水泵站",
        length: "04",
        id: "3",
        isChecked: true,
        position: "right",
        data: [
          {
            ZhaName: "后湖泵站三期",
            ZhaId: "3-1",
          },
          {
            ZhaName: "后湖泵站二期",
            ZhaId: "3-2",
          },
          {
            ZhaName: "常青泵站二期",
            ZhaId: "3-3",
          },
          {
            ZhaName: "天津路泵站",
            ZhaId: "3-4",
          },
        ],
      },
      {
        name: "调蓄池",
        length: "03",
        id: "4",
        isChecked: true,
        position: "right",
        data: [
          {
            ZhaName: "黄孝河CSO调蓄池",
            ZhaId: "4-1",
          },
          {
            ZhaName: "机场河CSO调蓄池",
            ZhaId: "4-2",
          },
          {
            ZhaName: "常青公园CSO调蓄池",
            ZhaId: "4-3",
          },
        ],
      },
    ]);
    let chechId = ref(null);
    let sysTheme = ref("");
    sysTheme = computed(() => {
      return store.getters.sysTheme;
    });
    function BtnLick(item2) {
      chechId.value = item2.ZhaId;
      console.log(item2);
      bus.emit("siteClick", item2);
    }
    function CheckChange(item) {
      console.log(item.isChecked);
      bus.emit("groupClick", item);
    }
    onMounted(() => {});
    return { TuLiData, BtnLick, chechId, CheckChange, sysTheme };
  },
  computed: {},
  methods: {
    //切换主题
    onTheme() {
      this.$store.commit("system/TOGGLE_THEME");
    },
  },
};
</script>
<style lang="less" scoped>
#basicTuLi {
  position: absolute;
  left: 220px;
  top: 0px;
  width: auto;
  height: auto;

  #TuLiBox {
    position: absolute;
    top: 80px;

    .TuliBox {
      width: 110px;
      height: 40px;
      line-height: 40px;
    }

    .DuoXuanKuang {
      width: 100%;
      height: 100%;
      display: inline-block;
      overflow: auto;
    }
  }

  #eventBox {
    width: 400px;
    height: 80px;
    position: absolute;
    top: 0;
    left: 0;

    .eventList {
      width: 160px;
      height: 80px;
      display: inline-block;

      .eventImg {
        width: 80px;
        height: 80px;
        float: left;
      }
      .eventFonts {
        width: 80px;
        height: 80px;
        float: left;

        .eventFontsP1 {
          font-size: 30px;
          font-family: PangMenZhengDao;
          font-weight: bold;
          font-style: italic;
          color: #0cb5ca;
          width: 80px;
          height: 40px;
        }
        .eventFontsP2 {
          font-size: 20px;
          font-family: Alibaba PuHuiTi;
          font-weight: bold;
          color: #13dfd8;
          width: 80px;
          height: 40px;
        }
        .dark_eventFontsP2 {
          color: #dafffe;
        }
      }
    }

    .eventList2 {
      margin-left: 80px;
    }
  }

  #QieHuan {
    width: 80px;
    position: absolute;
    top: 80px;
    cursor: pointer;
    border: 1px solid;
    text-align: center;
  }
}
.rightPopoverSpan {
  display: inline-block;
  width: 90px;
}
.DouXuanBtn {
  background: rgba(12, 92, 95, 0.6);
  height: 36px;
  float: left;
  line-height: 36px;
  padding: 0 15px;
  border-radius: 7px;
  cursor: pointer;
  box-sizing: border-box;
  color: #49879b;
}
// .DouXuanBtn:hover {
//   background: rgba(189, 218, 230, 1);
// }
.DouXuanBtnCheck {
  background: #0c5c5f;
  color: #dcf8ff;
  box-shadow: 0px 0px 10px inset #9accd9;
}
.DuoXuanKuang {
  width: 100%;
  height: 100%;
  //   overflow: auto;
}
</style>