var tmpl=`
     <el-select style="width:100%"   :value="value" @change="onchange"  v-model="sels"    placeholder="请选择子系统">
           <el-option
            v-for="item in dataSouce"
            :key="item.subcode"
            :label="item.subtitle"
            :value="item.subcode">
           </el-option>
     </el-select>
`
module.exports=
`{
   template:'${tmpl}',
   model:{
    prop: 'value',
    event: 'change',
   },
   props:["value","refMethod","labelField","valueField"],
   data:function(){
     return {
       dataSouce:[],
       sels:this.value?this.value:[],
     };
   },
   mounted:function(){
        this.fetchData();
   },
   watch:{
     value:function(v){
        this.sels=v;
     },
   },
   created:function(){
        
   },
   computed:{
   },
   methods:{
     fetchData:function(){
       var self=this;
        this.$root.getReq("web/metaCtl/findSubSystems").then(d=>{
            if(d.status==0){
                self.dataSouce=d.data;
                self.$emit("initsubsystem",d.data);
            }
        });
     },
     onchange:function(curval){
        this.$emit("change",curval);
     },
    oninput:function(e){
      console.log(e);
      this.$emit("input",e);
    }
   },
   vname:"gsb-selectsubsystem"
}`
