<template>
  <div class="formDiv"  @mouseenter="show" @mouseleave="hide">
    <div class="formDiv-left">
      <Label > {{property.label}}</Label>
    </div>
    <div class="formDiv-right" >
      <div class="ivu-col ivu-col-span-20">
        <Input  class="inputStyle"  type="textarea" clearable  :rows="extend.rows" :placeholder=extend.placeholder />
      </div>
      <div class="c-position ivu-col ivu-col-span-4">
        <span >0/{{extend.maxLength}}</span>
      </div>
    </div>
    <commomHoverModal ref="commomHoverModal" ></commomHoverModal>

  </div>
</template>

<script>
    import commomHoverModal from '../../common/commomHoverModal'

    import {editSetting} from './property';
export default {
    // props: {
    //     text: {
    //         type: String,
    //         default: 'Button Text'
    //     },
    //     type: String,
    //     styles: Object
    // },
    components:{
        commomHoverModal
    },
    data () {
        return {
            property:{
                label : '多行输入框'
            },
            extend:{
                rows:4,
                placeholder:""
            },
            myRow:4,
            text: 'input',
            type: 'input',
            level: editSetting.level
        };
    },
    editSetting,
    name: editSetting.key,
    level: editSetting.level,
    methods:{
        show(){
            this.$refs.commomHoverModal.handleMouseEnter();
        },
        hide(){
            this.$refs.commomHoverModal.handleMouseLeave();
        }
    },
    mounted(){
        debugger;
        let currentInstance = this.$store.state.viewport.instances.get(this.$store.state.viewport.currentEditInstanceKey);
        if(currentInstance.data.validateArr.length>0){
            return "";
            //note 如果有值，将不会再进行操作，否则将会新增一个
        }
    }
};
</script>

<style lang="less" scoped>
  .formDiv{
    display:inline-block;
    /*line-height: 60px;*/
    text-align: left;
    .formDiv-left {
      display:inline-block;
      line-height: 60px;
      width: 35%;
      height:40px;
      text-align:right;
      font-size:15px;
      float: left;
      margin: 0 10px;
    }
    .formDiv-right {
      width: 60%;
      height: 100%;
      position: relative;
      display:inline-block;
      float: right;
      /*margin: 14px 0px 14px 33px;*/
      margin: 14px 0px ;

      .inputStyle{
        /*width:50%;*/
      }
      .c-position {
        padding-left: 5px;
        position: absolute;
        right: 0;
        bottom: 0;
        line-height: initial;
      }
      .ivu-col-span-20 {
        display: block;
        width: 50%;
      }
      .ivu-col-span-4 {
        display: block;
        width: 50%;
      }
    }
  }
</style>
