From d74b495736f0c04522ec54274b70fed0ded2878d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 27 Jun 2023 11:30:06 +0800
Subject: [PATCH] 任务新增导出

---
 public/map/core/framework.js |  192 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 192 insertions(+), 0 deletions(-)

diff --git a/public/map/core/framework.js b/public/map/core/framework.js
new file mode 100644
index 0000000..a418823
--- /dev/null
+++ b/public/map/core/framework.js
@@ -0,0 +1,192 @@
+define(["base/AppEvent",
+        "manager/configmanager",
+        "manager/widgetsmanager",
+        "manager/mapmanager",
+        "manager/querymanager",
+        "manager/routemanager",
+        "dojo/dom",
+        "base/ConfigData",
+        "dojo/_base/declare",
+        "dojo/on",
+        "dojo/_base/lang",
+        "dojo/dom-style",
+        "dojo/dom-class",
+        "dojo/dom-attr",
+        "dojo/dom-construct",
+        "controls/loader/Loader",
+        "dojo/query",
+        "dojo/window"
+    ],
+    function (AppEvent,
+              configmanager,
+              widgetsmanager,
+              mapmanager,
+              querymanager,
+              routemanager,
+              dom,
+              ConfigData,
+              declare,
+              on,
+              lang,
+              domStyle,
+              domClass,
+              domAttr,
+              domConstruct,
+              Loader,
+              query,
+              win) {
+        return declare("Framework", null, {
+            _configmanager: null,
+            _widgetmanager: null,
+            _mapmanager: null,
+            _querymanager: null,
+            _showsider: true,
+            _loader: null,
+            /**
+             * 头部的高度
+             */
+            headerHeight: 0,
+            /**
+             * 侧边栏的宽度
+             */
+            siderWidth: 0,
+            popupWindow: null,
+
+            constructor: function () {
+                var thisObj = this;
+                _configmanager = new configmanager();
+                _widgetmanager = new widgetsmanager();
+                _mapmanager = new mapmanager();
+                _querymanager = new querymanager();
+                _routemanager = new routemanager();
+                _widgetmanager.MapManager = _mapmanager;
+                var fun = lang.hitch(this, this.onConfigLoaded);
+                AppEvent.addAppEventListener(AppEvent.CONFIG_LOADED, fun);
+                AppEvent.dispatchAppEvent(AppEvent.APPLICATION_LOAD, {}); //派发应用加载事件
+                AppEvent.addAppEventListener(AppEvent.BASE_MAP_LAYER_LOADED, this.onMapLoaded);
+                AppEvent.addAppEventListener(AppEvent.BASE_MAP_LAYER_LOADED_ERROR, this.onMapLoadedError);
+                AppEvent.addAppEventListener(AppEvent.SHOW_LOAD, lang.hitch(this, this.onShowLoad));
+                AppEvent.addAppEventListener(AppEvent.HIDE_LOAD, lang.hitch(this, function (evt) {
+                    this._loader.hide();
+                }));
+                AppEvent.addAppEventListener(AppEvent.APPLICATION_FULLSCREEN, lang.hitch(this, this.onFullScreen));
+                _configmanager.loadconfig("config.json");
+                this._loader = new Loader();
+                //注册窗体变化事件
+                window.onload = lang.hitch(thisObj, function () {
+                    this.resize();
+                });
+                window.onresize = lang.hitch(thisObj, function () {
+                    this.resize();
+                });
+            },
+            onShowLoad: function (data) {
+                this._loader.show(data.text);
+            },
+            onConfigLoaded: function () {
+            },
+            _onClickShowPlatform: function () {
+                require(["controls/popupwindow/PopupWindow"], function (PopupWindow) {
+                    if (!this.popupWindow) {
+                        this.popupWindow = new PopupWindow;
+                    }
+                    this.popupWindow.show({
+                        "title": "关于平台",
+                        "width": "749",
+                        "height": "654",
+                        "parent": this.body
+                    });
+                    this.popupWindow.setContent('<iframe style="border:none;width:100%;height:100%;" src="../main/aboutplatform.html"></div>');
+                });
+
+            },
+            _onClickShowAboutus: function () {
+                require(["controls/popupwindow/PopupWindow"], function (PopupWindow) {
+                    if (!this.popupWindow) {
+                        this.popupWindow = new PopupWindow;
+                    }
+                    this.popupWindow.show({
+                        "title": "关于我们",
+                        "width": "749",
+                        "height": "654",
+                        "parent": this.body
+                    });
+                    this.popupWindow.setContent('<iframe style="border:none;width:100%;height:100%;" src="../main/about.html"></div>');
+                });
+            },
+            _onClickShowDisclaimer: function () {
+                require(["controls/popupwindow/PopupWindow"], function (PopupWindow) {
+                    if (!this.popupWindow) {
+                        this.popupWindow = new PopupWindow;
+                    }
+                    this.popupWindow.show({
+                        "title": "免责声明",
+                        "width": "749",
+                        "height": "654",
+                        "parent": this.body
+                    });
+                    this.popupWindow.setContent('<iframe style="border:none;width:100%;height:100%;" src="../main/disclaimer.html"></div>');
+                });
+            },
+            createPopupWindow: function () {
+                require(["controls/popupwindow/PopupWindow"], function (PopupWindow) {
+
+                });
+            },
+            _onClickMobileMap: function () {
+                AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET, "MobileMapWidget");
+            },
+            _onClickShixianZhitong: function () {
+                AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET, "CityExpressWidget");
+            },
+            _onClickZonghe: function () {
+                AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET, "ThematicWidget");
+            },
+            onSiderContainerShow: function () {
+                this.resize();
+            },
+            onSiderContainerHide: function () {
+                this.resize();
+            },
+            onGetLogUser: function (data) {
+                //需要确认权限
+                if (window.parent.LoginManager != undefined && window.parent.LoginManager != null) {
+                    this._loader.show("正在获取用户信息...");
+                    window.parent.LoginManager.checkLogInfo(dojo.hitch(this, function (userInfo) {
+                        this._loader.hide();
+                        if (data.callback) {
+                            data.callback(userInfo);
+                        }
+                    }));
+                } else {
+                    if (data.callback) {
+                        data.callback({
+                            status: false,
+                            errmsg: "请联系系统管理员,缺少认证模块!"
+                        });
+                    }
+                }
+            },
+            onMapLoaded: function () {
+                /*setTimeout(function() {
+                    var bgDom = dom.byId("loadbg");
+                    domConstruct.destroy(bgDom);
+                }, 1000);*/
+                //domStyle.set(dom.byId("siderbutton"), "display", "block");
+            },
+            onMapLoadedError: function (errMsg) {
+                /*setTimeout(function() {
+                    var bgDom = dom.byId("loadbg");
+                    domConstruct.destroy(bgDom);
+                }, 1000);*/
+                //console.log("加载底图有误"errMsg);
+            },
+            resize: function () {
+                AppEvent.dispatchAppEvent(AppEvent.APPLICATION_RESIZE, {});
+            },
+            onFullScreen: function (data) {
+            	
+                this.resize();
+            }
+        });
+    });
\ No newline at end of file

--
Gitblit v1.9.3