<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" clearable :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 {editSetting} from './property';
import commomHoverModal from '../../common/commomHoverModal'

export default {
    // props: {
    //     text: {
    //         type: String,
    //         default: 'Button Text'
    //     },
    //     type: String,
    //     styles: Object
    // },
    components:{
        commomHoverModal
    },
    data () {
        return {
            property:{
                label : '单行输入框'
            },
            extend:{
                placeholder:""
            },
            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;
    .inputStyle{
      /*width:50%;*/
    }
    .formDiv-left {
      display:inline-block;
      width: 35%;
      height:40px;
      text-align:right;
      font-size:15px;
      float: left;
      margin: 0 10px;
    }
    .formDiv-right {
      width: 60%;
      position: relative;
      display:inline-block;
      float: right;
      .c-position {
        padding-left: 5px;
        position: absolute;
        right: 0;
        bottom: 12px;
        line-height: initial;
      }
      .ivu-col-span-20 {
        display: block;
        width: 50%;
      }
      .ivu-col-span-4 {
        display: block;
        width: 50%;
      }
    }
  }


</style>
