zhongrj
2023-06-27 d74b495736f0c04522ec54274b70fed0ded2878d
public/map/core/BaseControl.js
New file
@@ -0,0 +1,73 @@
/**
 * control基类
 * @author Wenyb
 * @date 2015/10/30
 */
define([
  "dojo/_base/declare",
  "dijit/_WidgetBase",
  "dijit/_TemplatedMixin",
  "base/AppEvent",
  "dojo/domReady!"
], function (
  declare,
  _WidgetBase,
  _TemplatedMixin,
  AppEvent
  ){
   var Widget = declare([_WidgetBase,_TemplatedMixin
      ],
      {
         _config: null,
         _loaded:false,
         cssPathsIndex:{},
         label:"控件基类",
         id:"",
         /**
          * 挂接的父级control的Id
          */
         hockId:"",
         /**
          * 挂接的Map控件
          */
         map:null,
         constructor:function(options)
         {
            declare.safeMixin(this, options);
            if(this.cssPath&&!this.cssPathsIndex[this.cssPath])
            {
               dojo.create("link", {
                  href: require.toUrl(this.cssPath),
                  type: 'text/css',
                  rel: 'stylesheet'
               },
               document.getElementsByTagName('head')[0]);
               this.cssPathsIndex[this.cssPath]=true;
            }
            this._loaded=false;
         },
         startup:function()
         {
            this._loaded = true;
         },
         loaded:function()
         {
            return this._loaded;
         },
         /**
          * 显示控件
          * @return
          */
         show:function()
         {
         },
         /**
          * 隐藏控件
          * @return boolean
          */
         hide:function()
         {
         }
      });
   return Widget;
});