- 1 /**
- 2 * Created by lenovo on 2016/12/18.
- 3 */
- 4
- 5 define([
- 6"dojo/_base/declare",
- 7"dojo/text!/scada/app/widget/viewchoose/templates/viewchoose.html",
- 8"dijit/_WidgetBase",
- 9"dojo/dom",
- 10"dojo/on",
- 11"dijit/_TemplatedMixin",
- 12
- 13
- 14],function (declare, template, _WidgetBase, dom, on, _TemplatedMixin) {
- 15
- 16 return declare([_WidgetBase, _TemplatedMixin], {
- 17
- 18templateString: template,// 设置模板页
- 19baseClass: "viewchoose",// 基础样式名称
- 20
- 21 /**
- 22 * 控件销毁时的处理。
- 23 */
- 24uninitialize:function () {
- 25
- 26 },
- 27
- 28 /**
- 29 * 控件在渲染到页面上显示时的处理。
- 30 */
- 31startup:function () {
- 32
- 33 },
- 34
- 35 /**
- 36 * 控件加载到页面DOM上,浏览器渲染显示之前的处理。
- 37 */
- 38postCreate:function () {
- 39alert("1");
- 40 this._initRes();// 初始化资源
- 41 this._initEvent();// 初始化内部事件
- 42
- 43
- 44
- 45 },
- 46
- 47 /**
- 48 * 初始化本控件内部的事件处理。
- 49 *
- 50 * @private
- 51 */
- 52_initEvent:function () {
- 53 this.initEvent();
- 54 },
- 55
- 56
- 57 /**
- 58 * 初始化本控件内部的资源(样式、脚本、数据等)。
- 59 *
- 60 * @private
- 61 */
- 62_initRes:function () {
- 63 //加载样式
- 64dynamicLoad.resource([require.toUrl("/scada/app/widget/viewchoose/CSS/viewchoose.css")]);
- 65 },
- 66initEvent:function () {
- 67 this.own(
- 68on(this.mapTypeDom, "mouseover",function () {
- 69 // $('#dijit__TemplatedMixin_0').removeClass('viewchoose');
- 70$('.viewchoose').addClass('expand');
- 71 }),
- 72on(this.mapTypeDom, "mouseout",function () {
- 73$('.expand').removeClass('expand');
- 74 })
- 75 );
- 76 },
- 77
- 78 });
- 79});
来源: