<template>
  <div class="formDiv"  @mouseenter="show" @mouseleave="hide">
    <div class="formDiv-left">
      <Label > {{property.label}}</Label>
    </div>
    <div class="formDiv-right">
      <div class="ivu-upload" >
        <div class="ivu-upload ivu-upload-drag" >
          <div style="line-height: 20px;min-width: 400px;border: 0px;">
            <!-- <img class="defaultPic" src="../../../images/u882.svg" alt=""
                  style="padding-top: 30px;width: 24px;">
             <img class="mouseHoverPic" src="../../../images/u882_mouseOver.svg" alt=""
                  style="padding-top: 30px;width: 24px;">-->
            <Button type="primary" style="display: inline-block;border-radius: 3px;">本地上传</Button>
            <p style="margin-top: 10px;display: inline-block;">说明:每个附件限制大小50M,最多上传10个附件。</p></div>
        </div>
      </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
    // },
    data () {
        return {
            property:{
                label : '附件'
            },
            extend:{
                placeholder:""
            },
            text: 'input',
            type: 'input',
            level: editSetting.level
        };
    },
    components:{
        commomHoverModal
    },
    methods:{
        show(){
            this.$refs.commomHoverModal.handleMouseEnter();
        },
        hide(){
            this.$refs.commomHoverModal.handleMouseLeave();
        }
    },
    editSetting,
    name: editSetting.key,
    level: editSetting.level,
    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 scoped>
  .ivu-upload{
    text-align: left;
    border: 0px;
  }
  .formDiv{
    display:inline-block;
    line-height: 60px;
    text-align: left;
  }
  .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;
    margin: 11.5px 0px;
  }
</style>
