var tmpl=`
<div style="width:100%">
      <slot name="top"></slot>
      <gsb-form  ref="dform" @onforminit="onforminit" @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:{
     onforminit(fm,ctls){
        this.$emit("onforminit",fm,ctls);
     },
     onselchange(prop,formModel,target,ctls){
        this.$emit("onselchange",prop,formModel,this.$refs.dform.$refs[target],ctls);
     },
     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"
}`
