var tmpl=`
<div style="width:100%">
      <slot name="top"></slot>
      <gsb-form  ref="dform" @onselchange="onselchange" :metaData="metaData" :refvalidatemethod="refvalidatemethod">
          <gsb-button-group slot="topbtnarea"  isForm="true" @select="onselect" ikey="cancel" :btns="toolbar"></gsb-button-group>
      </gsb-form>
      <slot></slot>
</div>
`
module.exports=
`{
   template:'${tmpl}',
   props:['metaData',"headTitle","toolbar","refvalidatemethod","isreadonly"],
   data:function(){
     return {
        readonly:this.isreadonly?this.isreadonly:false,
     };
   },
   mounted:function(){
      if(this.readonly){
        this.$refs.dform.setReadOnly();
      }else{
        this.$refs.dform.setCanEdit();
      }
   },
   created:function(){
     console.log("created....................");
   },
   methods:{
     onselchange(prop,formModel,target){
        this.$emit("onselchange",prop,formModel,this.$refs.dform.$refs[target]);
     },
     validate(cbk){
       this.$refs.dform.validate(function(valid){
         return cbk(valid);
       });
     },
     onselect:function(k){
       this.$emit('dlgFormClick',k,this.$refs.dform.formModel);
     },
     setInitData:function(obj){
       this.$refs.dform.setInitData(obj);
     },
     getFormModel(){
       return this.$refs.dform.getFormModel();
     },
   },
   vname:"gsb-detailform"
}`
