<template>
  <el-container class="home">
    <!-- 顶部导航栏 -->
    <el-header class="header">
      <Select
        width="200"
        radius
        @change="testClick"
        :selectdata="dataSelect3"
        :placeholder="'请选择'"
      />
      <Button radius type="primary" size="large" :text="'新建拓扑图'">primary</Button>
    </el-header>
    <!-- body部分 -->
    <el-container class="bodys">
      <!-- 左侧树状导航栏部分 -->
      <el-aside class="aside" width="200px">
        <leftAsideTree></leftAsideTree>
      </el-aside>
      <!-- 展示部分 -->
      <el-main class="main">
        <div class="main-head">
          <el-button-group>
            <el-button size="small">已发布</el-button>
            <el-button size="small">未发布</el-button>
          </el-button-group>
          <div class="head-right">
            <el-input size="medium" placeholder="请输入内容" v-model="input2"></el-input>
            <Dropdown class="Dropdown" v-model="selVal" :data="dataSelect">
              <span class="drop-text">{{selText}}</span>
            </Dropdown>
          </div>
        </div>
        <div class="main-body">
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
          <topoImageCard></topoImageCard>
        </div>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import { Select, Button, Dropdown } from "meri-design";
import leftAsideTree from "@/components/homeView/leftAsideTree.vue";
import topoImageCard from "@/components/homeView/topoImageCard.vue";
export default {
  name: "home",
  data() {
    return {
      dataSelect3: [
        { id: "test1", name: "选择项", sub: "hello111" },
        { id: "test2", name: "单平米", sub: "hola111" },
        {
          id: "test3",
          name: "下级分项",
          sub: "bonjour",
          divider: true,
        },
        { id: "test4", name: "滑动平均滑动平均", sub: "hi" },
      ],
      selVal: "totalEnergy",
      selText: "总量",
      dataSelect: [
        { id: "totalEnergy", name: "总量" },
        { id: "singleParty", name: "单平米" },
        { id: "lowerLevel", name: "下级分项" },
        { id: "average", name: "滑动平均", disabled: true },
      ],
      input2: "",
    };
  },
  methods: {
    testClick(data) {
      console.log(data);
    },
  },
  components: { Select, Button, leftAsideTree, Dropdown, topoImageCard },
};
</script>
<style lang="less" scoped>
.home {
  width: 100%;
  height: 100%;
  .header {
    width: 100%;
    height: 60px;
    background: #f7f9fa;
    padding: 0 16px 0 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .bodys {
    width: 100%;
    height: 100%;
    .main {
      width: 100%;
      height: 100%;
      background: #fff;
      padding: 10px 20px;
      box-sizing: border-box;
      .main-head {
        width: 100%;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .head-right {
          display: flex;
          align-items: center;
          .Dropdown {
            min-width: 100px;
            margin-left: 20px;
            .drop-text {
              font-size: 14px;
              color: #1f2329;
              line-height: 16px;
            }
          }
        }
      }
      .main-body {
        display: flex;
        flex-wrap: wrap;
      }
    }
  }
}
</style>
