<template>
  <DatePicker
    :type="val.dateType"
    :value="val.dateValue"
    :size="val.size"
    :multiple="val.isMulti"
    :transfer="val.transfer"
    :disabled="val.disabled"
    :readonly="val.readonly"
    :style="{
      position: 'absolute',
      width: val.width  + '%',
      height: val.height  + '%',
      left: val.left  + '%',
      top: val.top  + '%',
      zIndex: val.z,
      backgroundColor: val.bgColor,
      backgroundImage: 'url(' + val.backPic + ')',
      color: val.color
    }"
    ></DatePicker>
</template>

<script>
import stylec from "./style.vue";
const WIDGET_NAME = "braid-datepicker";

export default {
  name: WIDGET_NAME,
  icon: {
    type: "ios-calendar"
  },
  title: "日期选择框",
  panel: stylec,
  setting: {
    type: WIDGET_NAME,
    isContainer: false,
    isUpload: false,
    hasGuide: true,
    isChild: true,
    draggable: true,
    resizable: true,
    name: "日期选择框",
    width: 30,
    height: 20,
    left: 20,
    top: 0,
    offsetLeft: 50,
    offsetTop: 0,
    offsetWidth: 100,  // 父组件相对于page的百分比
    offsetHeight: 100, // 父组件相对于page的百分比
    z: 0,
    bgColor: "#fff",
    backPic: "",
    backPicUrl: "",
    color: "",
    text: "日期选择框",
    belong: "page",
    animationName: ""
  },
  props: ["h", "val", "playState", "w"],

  methods: {
    updateText(e, uuid) {
      let text = e.target.innerHTML;
      this.$vpd.commit("updateData", {
        uuid: uuid,
        key: "text",
        value: text
      });
    }
  },
  mounted() {
    console.log(this, 87766)
  }
};
</script>

<style>
/* .ivu-date-picker-rel,.ivu-date-picker-rel .ivu-input-wrapper {
  height: 100%;
} */
</style>
