<template>
  <div>
    <Card dis-hover class="homepage" v-show="activeElement.page" >
        <!-- @click='' -->
        <p slot="title">
            <Icon type="md-fastforward" />
            控制面板
        </p>
        <page :active-element="activeElement" style=" height:760px;"/>
    </Card>
    <div>
      <ul class="tab tab-block panel-tab" v-show="!activeElement.page" style="margin-top:16px">
        <li :class="{active: activeTab === 1}" class="tab-item" @click="activeTab = 1">
          <a>基础</a>
        </li>
        <li :class="{active: activeTab === 2}" class="tab-item" @click="activeTab = 2">
          <a>数据</a>
        </li>
        <li :class="{active: activeTab === 3}" class="tab-item" @click="activeTab = 3">
          <a>高级</a>
        </li>
      </ul>
      <appearance :active-element="activeElement" :tab="activeTab" />
      <datasetting :active-element="activeElement" :tab="activeTab" @refactiveElement="refactiveElement"/>
      <senior :active-element="activeElement" :tab="activeTab" />
      <!-- <event :active-element="activeElement" :tab="activeTab" />
      <animation :active-element="activeElement" :tab="activeTab" />-->
    </div>
  </div>
</template>

<script>
import page from "./page.vue";
import style from "./style.vue";
import datasetting from "./datasetting.vue";
import senior from "./senior.vue";
import vpd from "../../mixins/vpd";

export default {
  components: {
    page: page,
    appearance: style,
    senior: senior,
    datasetting: datasetting
  },
  mixins: [vpd],

  data() {
    return {
      activeTab: 1
    };
  },
  computed: {
    // 选中元素对象
    activeElement() {
      return this.$vpd.state.activeElement;
    }
  },
  methods: {
    refactiveElement(data) {
      this.$vpd.state.activeElement = data
      //  console.log(this.$vpd.state.activeElement,data,88888888)
    }
  }
};
</script>

<style lang="scss">
@import "../../_variables.scss";
.panel-tab {
  padding: 0;
}
.panel-wrap {
  height: calc(100% - 50px);
  padding: 15px 20px;
  position: relative;
  // overflow-y: auto;
  .btn-action {
    background-color: none;
    border: none;
    border-radius: 50%;
  }
  .btn-action:hover {
    background-color: #f5f5f5;
  }
}
.panel-row {
  display: flex;
  font-size: 13px;
  line-height: 36px;
}
.panel-row .svg-icon {
  font-size: 16px;
  color: $gray-color;
}
.panel-label {
  display: inline-block;
  width: 150px;
  height: 36px;
  padding-left: 6px;
  color: #999;
}
.panel-value {
  width: 100%;
  display: flex;
  align-items: center;
}
.panel-slider-wrap {
  flex-grow: 1;
  padding: 6px 5px;
  opacity: 0;
  transition: opacity 0.3s;
}
.panel-row:hover .panel-slider-wrap {
  opacity: 1;
}
.panel-cell {
  flex-grow: 1;
}
.panel-wrap input:checked ~ .svg-icon svg {
  stroke: #333;
}
.panel-select {
  width: 100%;
  height: 32px;
  border: 1px solid #ccc;
}
.panel-wrap hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #f5f5f5;
}
.panel-wrap select,
.panel-wrap input[type="text"] {
  width: 100%;
}
.panel-preview {
  width: 50px;
  height: 32px;
  background: no-repeat center/100%;
  cursor: pointer;
}
.homepage {
    align-items: center;
    border:none;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 0.15rem 0;
}
</style>
