<template>
  <div>
    <hr />
    
    <div class="panel-row">
        <vpd-icon name="target" />
        <div class="panel-label">表头数据</div>
        <div class="panel-value" >
            <Input v-model="header" @on-change="headerChange(header)"/>
        </div>
    </div>
    <div class="panel-row">
        <vpd-icon name="target" />
        <div class="panel-label">表数据</div>
        <div class="panel-value">
            <Input v-model="data" @on-change="dataChange(data)" />
        </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">表行数</div>
      <div class="panel-value">
          <Input v-model="activeElement.option.rowNum" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">表头背景色</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.headerBGC" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">奇数行背景色</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.oddRowBGC" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">偶数行背景色</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.evenRowBGC	" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">轮播时间间隔(ms)</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.waitTime" />
      </div>
    </div>

    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">表头高度</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.headerHeight" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">列宽度</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.columnWidth" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">列对齐方式</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.align" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">显示行号</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.index" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">行号表头</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.indexHeader" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">轮播方式</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.carousel" />
      </div>
    </div>
  </div>
  
</template>

<script>
export default {
  name: "DataVScrollboardStyle",
  props: ["activeElement"],
  data() {
    return {
      data:JSON.stringify(this.activeElement.option.data),
      header:JSON.stringify(this.activeElement.option.header)
    };
  },
  methods: {
    dataChange(newCode) {
      this.activeElement.option.data = JSON.parse(newCode);
      this.$parent.$vpd.commit("updateWidgets", this.activeElement);
    },
    headerChange(newCode) {
      this.activeElement.option.header = JSON.parse(newCode);
      this.$parent.$vpd.commit("updateWidgets", this.activeElement);
    }
  },
  created () {
      // console.log(this.data,typeof(this.data),8888)
      // console.log(this.colors,typeof(this.colors),8888)
  }
};
</script>
