From 650acd89dcfc13c9dd051dd2ab29845c748df9d3 Mon Sep 17 00:00:00 2001
From: jxdnsong <592566207@qq.com>
Date: Sat, 24 Oct 2020 09:14:16 +0800
Subject: [PATCH] 新增右键菜单部件,但测试发现sdk还有问题

---
 config.json                              |  169 +--------------------------------
 widgets/ContextMenu/nls/es/strings.js    |   13 ++
 widgets/ContextMenu/nls/strings.js       |    7 +
 widgets/ContextMenu/nls/zh-cn/strings.js |   13 ++
 widgets/ContextMenu/manifest.json        |   17 +++
 widgets/ContextMenu/Widget.js            |   58 +++++++++++
 widgets/ContextMenu/Widget.html          |    3 
 widgets/ContextMenu/css/style.css        |    0 
 8 files changed, 116 insertions(+), 164 deletions(-)

diff --git a/config.json b/config.json
index 6eec78c..379be78 100644
--- a/config.json
+++ b/config.json
@@ -13,10 +13,9 @@
     ],
     "version": "2.10"
   },
-  "modeUrl": "http://www.sw797.com:801/gzsw3D/v2/data/mx/",
   "cesiumToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2ODUxMWQxMC1lNzZjLTRhZjktYmZiMS1lNWFmYWJkZWIwOTEiLCJpZCI6MTQxNzMsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjQ5Njg5NzV9.ojKhhmjl8L0EtxsZC14LZgmXn5VVS0CRBCYuRK_DdIo",
   "authorizedCrossOriginDomains": [],
-  "title": "水文水生态综合信息管理平台",
+  "title": "虚拟地理环境三维平台",
   "subtitle": "",
   "keepAppState": true,
   "logo": "images/app-logo.png",
@@ -75,6 +74,10 @@
           "height": "auto",
           "relativeTo": "map"
         }
+      },
+      {
+        "name": "右键菜单",
+        "uri": "widgets/ContextMenu/Widget"
       }
     ],
     "groups": [],
@@ -94,154 +97,6 @@
       "right": 0,
       "bottom": 0
     },
-    "basemaps": [
-      {
-        "label": "行政区划",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/jctczt/MapServer",
-        "layers": "0",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "河流水系",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/jctczt/MapServer",
-        "layers": "1",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "铁路公路",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/jctczt/MapServer",
-        "layers": "2",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "高速公路",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/jctczt/MapServer",
-        "layers": "3",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      }
-    ],
-    "swzwLayers": [
-      {
-        "label": "水文站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/swzwzt/MapServer",
-        "layers": "0",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "水位站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/swzwzt/MapServer",
-        "layers": "1",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "雨量站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/swzwzt/MapServer",
-        "layers": "2",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "水质站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/swzwzt/MapServer",
-        "layers": "3",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "中小河流站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/swzwzt/MapServer",
-        "layers": "4",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "水库水位站",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/jctczt/MapServer",
-        "layers": "2",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      }
-    ],
-    "shLayers": [
-      {
-        "label": "山洪隐患点",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/shskzt/MapServer",
-        "layers": "0",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "大型水库",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/shskzt/MapServer",
-        "layers": "1",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "中型水库",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/shskzt/MapServer",
-        "layers": "2",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "小型水库",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/shskzt/MapServer",
-        "layers": "3",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      }
-    ],
-    "djyLayers": [
-      {
-        "label": "东江源区水系图",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/djysx/MapServer",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "水文监测基本站网",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/djyswjcjbzw/MapServer",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "专项分析研究实验站网",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/djyztfxsyzw/MapServer",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      },
-      {
-        "label": "遥测站点",
-        "url": "http://171.35.109.175:18080/arcgis/rest/services/GZSW/djyyczw/MapServer",
-        "type": "arcgis",
-        "icon": "images/basemaps/tiandituimage.png",
-        "show": false
-      }
-    ],
     "imageryProviderViewModels": [
       {
         "name": "天地图影像",
@@ -325,20 +180,6 @@
             "url": "http://www.sw797.com:801/gzsw3D/v2/data/wp/{z}/{x}/{y}.png"
           }
         ]
-      }
-    ],
-    "terrainProviderViewModels": [
-      {
-        "name": "无地形",
-        "tooltip": "WGS84标准球体",
-        "iconUrl": "images/basemaps/TerrainEllipsoid.png",
-        "url": ""
-      },
-      {
-        "name": "赣州地形",
-        "tooltip": "由 普适科技 提供的赣州地形",
-        "iconUrl": "images/basemaps/TerrainSTK.png",
-        "url": "http://www.sw797.com:801/gzsw3D/v2/data/gzdx"
       }
     ],
     "mapOptions": {
diff --git a/widgets/ContextMenu/Widget.html b/widgets/ContextMenu/Widget.html
new file mode 100644
index 0000000..60b661b
--- /dev/null
+++ b/widgets/ContextMenu/Widget.html
@@ -0,0 +1,3 @@
+<div>
+	
+</div>
\ No newline at end of file
diff --git a/widgets/ContextMenu/Widget.js b/widgets/ContextMenu/Widget.js
new file mode 100644
index 0000000..92fa4f4
--- /dev/null
+++ b/widgets/ContextMenu/Widget.js
@@ -0,0 +1,58 @@
+/*
+ * @Descripttion: 右键菜单部件
+ * @version: 
+ * @Author: song
+ * @Date: 2020-10-24 08:57:47
+ * @LastEditors: song
+ * @LastEditTime: 2020-10-24 09:11:19
+ */
+define([
+		'dojo/_base/declare',
+		'jimu/BaseWidget'
+	],
+	function (
+		declare,
+		BaseWidget
+	) {
+		return declare([BaseWidget], {
+			baseClass: 'jimu-widget-ContextMenu',
+			name: 'ContextMenu',
+			layers:{},
+			startup: function () {
+				this.inherited(arguments);
+				let contextMenu = window.dcViewer.contextMenu
+				contextMenu.enable = true
+				contextMenu.addMenuItem('测试', () => {}, this)
+
+			},
+
+			onOpen: function () {
+				//面板打开的时候触发 (when open this panel trigger)
+			},
+
+			onClose: function () {
+				//面板关闭的时候触发 (when this panel is closed trigger)
+			},
+
+			onMinimize: function () {
+				this.resize();
+			},
+
+			onMaximize: function () {
+				this.resize();
+			},
+
+			resize: function () {
+
+			},
+
+
+			destroy: function () {
+				//销毁的时候触发
+				//todo
+				//do something before this func
+				this.inherited(arguments);
+			}
+
+		});
+	});
\ No newline at end of file
diff --git a/widgets/ContextMenu/css/style.css b/widgets/ContextMenu/css/style.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/widgets/ContextMenu/css/style.css
diff --git a/widgets/ContextMenu/manifest.json b/widgets/ContextMenu/manifest.json
new file mode 100644
index 0000000..07452b2
--- /dev/null
+++ b/widgets/ContextMenu/manifest.json
@@ -0,0 +1,17 @@
+{
+  "name": "ContextMenu",
+  "2D": true,
+  "3D": true,
+  "platform": "HTML",
+  "version": "2.10",
+  "wabVersion": "2.10",
+  "author": "",
+  "description": "",
+  "copyright": "",
+  "license": "",
+  "properties": {
+    "hasConfig": false,
+    "inPanel": false,
+    "hasVersionManager": false
+  }
+}
\ No newline at end of file
diff --git a/widgets/ContextMenu/nls/es/strings.js b/widgets/ContextMenu/nls/es/strings.js
new file mode 100644
index 0000000..1e88f8a
--- /dev/null
+++ b/widgets/ContextMenu/nls/es/strings.js
@@ -0,0 +1,13 @@
+/*
+ * @Descripttion: 
+ * @version: 
+ * @Author: song
+ * @Date: 2020-10-24 08:57:47
+ * @LastEditors: song
+ * @LastEditTime: 2020-10-24 09:01:01
+ */
+define(
+   ({
+    _widgetLabel: "ContextMenu"
+  })
+);
\ No newline at end of file
diff --git a/widgets/ContextMenu/nls/strings.js b/widgets/ContextMenu/nls/strings.js
new file mode 100644
index 0000000..5d54f30
--- /dev/null
+++ b/widgets/ContextMenu/nls/strings.js
@@ -0,0 +1,7 @@
+define({
+  root: ({
+    _widgetLabel: "Basemap"
+  }),
+  "es": 1,
+  "zh-cn": 1
+});
\ No newline at end of file
diff --git a/widgets/ContextMenu/nls/zh-cn/strings.js b/widgets/ContextMenu/nls/zh-cn/strings.js
new file mode 100644
index 0000000..803a194
--- /dev/null
+++ b/widgets/ContextMenu/nls/zh-cn/strings.js
@@ -0,0 +1,13 @@
+/*
+ * @Descripttion: 
+ * @version: 
+ * @Author: song
+ * @Date: 2020-10-24 08:57:47
+ * @LastEditors: song
+ * @LastEditTime: 2020-10-24 09:00:53
+ */
+define(
+   ({
+    _widgetLabel: "右键菜单"
+  })
+);
\ No newline at end of file

--
Gitblit v1.9.3