Ver código fonte

修改跳轉

manto07m 3 anos atrás
pai
commit
a807ea51f2
1 arquivos alterados com 59 adições e 37 exclusões
  1. 59 37
      index.php

+ 59 - 37
index.php

@@ -1,5 +1,5 @@
 <?php
-include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_right.php");
+include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
 ?>
 <!doctype html>
 <html class="fixed">
@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 	<meta name="author" content="JSOFT.net">
 
 	<script src="./assets/vendor/jquery/jquery.js"></script>
-<script src="/Common/script/js/user-image.js"></script>
+	<script src="/Common/script/js/user-image.js"></script>
 	<script src="./assets/vendor/jquery-hoverIntent/jquery.hoverIntent.js"></script>
 	<!-- Mobile Metas -->
 	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
@@ -55,11 +55,12 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 	<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/jstree.min.js"></script>
 	<script src="./script/js/jstreeAJAX.js"></script>
 	<script src="https://js.arcgis.com/4.21/"></script>
-	
+
 	<style>
-		html.no-overflowscrolling .nano > .nano-content {
+		html.no-overflowscrolling .nano>.nano-content {
 			overflow: auto;
 		}
+
 		.page-header>ul {
 			list-style: none;
 			padding: 0;
@@ -269,10 +270,9 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 			display: inline-block;
 		}
 
-		#filter-slide{
+		#filter-slide {
 			width: 100%;
 		}
-
 	</style>
 
 	<script>
@@ -290,8 +290,9 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 			}).done(function(data) {
 				token = data;
 				//data = JSON.parse(data);
-			}).error(function() {
-
+				
+			}).error(function(e) {
+				console.log(e);
 			});
 		}
 
@@ -364,9 +365,19 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 			Expand, GeoJsonLayer, PopupTemplate, Renderer, projection) => {
 			esriConfig.apiKey = token;
 			let activeWidget = null;
+			// esriConfig.request.corsEnabledServers.push("https://maps.nlsc.gov.tw:443");
+			// esriConfig.request.trustedServers.push("https://maps.nlsc.gov.tw:443");
+			// esriConfig.request.corsEnabledServers.push("https://maps.nlsc.gov.tw/S_Maps/wmts/1.0.0/");
+			// esriConfig.request.trustedServers.push("https://maps.nlsc.gov.tw/S_Maps/wmts/1.0.0/");
+			/*esriConfig.request.corsEnabledServers.push("http://127.0.0.1:8800");
+			esriConfig.request.trustedServers.push("http://127.0.0.1:8800");
+			urlUtils.addProxyRule({
+				urlPrefix: 'maps.nlsc.gov.tw',
+				proxyUrl: '',
+			});*/
 			const webscene = new WebScene({
 				portalItem: {
-					id: "dea6580d8d4547df9915a822fe7f2b9d"
+					id: "6b4e83dd94c4410db4bece82262b2573"
 
 				},
 				opacity: .75,
@@ -417,8 +428,18 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 				"top-left"
 			);
 
-
-
+			var layerList = new LayerList({
+				view: view
+			});
+			view.ui.add(
+				new Expand({
+					view: view,
+					content: layerList,
+					autoCollapse: true,
+					group: "top-left"
+				}),
+				"top-left"
+			);
 
 			view.ui.add(
 				new Expand({
@@ -572,6 +593,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 						tilt: 0,
 						heading: 0,
 					}).catch((error) => {
+						console.log("error");
 						console.error(error);
 					});
 				});
@@ -580,7 +602,8 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 			$('#treeAjaxHTML').on("select_node.jstree", function(e, data) {
 				if (data.node.text.includes("-")) {
 					project_id = data.node.text.split("-")[0];
-					featureLayer.definitionExpression = "計畫編號 = " + project_id;
+					featureLayer.definitionExpression = "計畫編號 = '" + project_id + "'";
+					console.log(featureLayer)
 					zoomToLayer(featureLayer);
 				}
 				/*else{
@@ -627,7 +650,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 			obj_list.forEach(element => {
 				if (target_value != -1) {
 					target_value.forEach(e => {
-						if(e.toString() == element[key_search].toString()) {
+						if (e.toString() == element[key_search].toString()) {
 							output_list.push(element[key_save]);
 						}
 					});
@@ -665,7 +688,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 		var userName = 'maabim';
 
 
-		jQuery(window).load(function() {			
+		jQuery(window).load(function() {
 			var url_href = window.location.href;
 			var url = new URL(url_href);
 			var type = url.searchParams.get("type");
@@ -708,7 +731,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 				<div id="userbox" class="userbox">
 					<a href="#" data-toggle="dropdown">
 						<figure class="profile-picture"> <img src="assets/images/!logged-user.jpg" alt="Joseph Doe" class="img-circle" data-lock-picture="assets/images/!logged-user.jpg" /> </figure>
-						<div class="profile-info" data-lock-name="John Doe" data-lock-email="johndoe@JSOFT.com"> <span class="name"><?php echo $_SESSION['name'] ?></span> <span class="role"><?php echo($groupName);?></span> </div> <i class="fa custom-caret"></i>
+						<div class="profile-info" data-lock-name="John Doe" data-lock-email="johndoe@JSOFT.com"> <span class="name"><?php echo $_SESSION['name'] ?></span> <span class="role"><?php echo ($groupName); ?></span> </div> <i class="fa custom-caret"></i>
 					</a>
 					<div class="dropdown-menu">
 						<ul class="list-unstyled">
@@ -768,7 +791,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 												<div class="overSelect"></div>
 											</div>
 											<div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
-												<label for="category-any"><input type="checkbox" id="category-any" value="any" checked/> 全選</label>
+												<label for="category-any"><input type="checkbox" id="category-any" value="any" checked /> 全選</label>
 												<!-- append option -->
 											</div>
 										</div>
@@ -784,7 +807,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 												<div class="overSelect"></div>
 											</div>
 											<div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
-												<label for="project-any"><input type="checkbox" id="project-any" value="any" checked/> 全選</label>
+												<label for="project-any"><input type="checkbox" id="project-any" value="any" checked /> 全選</label>
 												<!-- append option -->
 											</div>
 										</div>
@@ -800,7 +823,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 												<div class="overSelect"></div>
 											</div>
 											<div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
-												<label for="type-any"><input type="checkbox" id="type-any" value="any" checked/> 全選</label>
+												<label for="type-any"><input type="checkbox" id="type-any" value="any" checked /> 全選</label>
 												<!-- append option -->
 											</div>
 										</div>
@@ -816,7 +839,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 												<div class="overSelect"></div>
 											</div>
 											<div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
-												<label for="notes-any"><input type="checkbox" id="notes-any" value="any" checked/> 全選</label>
+												<label for="notes-any"><input type="checkbox" id="notes-any" value="any" checked /> 全選</label>
 												<!-- append option -->
 											</div>
 										</div>
@@ -829,12 +852,12 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 										</div>
 									</div>
 								</form>
-								
+
 							</div>
 							<footer class="panel-footer">
 								<div class="row">
 									<div class="col-md-12 text-right">
-										<div id="treeAjaxJSON" class="jstree jstree-4 jstree-default" role="tree"  style="display: none;">
+										<div id="treeAjaxJSON" class="jstree jstree-4 jstree-default" role="tree" style="display: none;">
 											<ul class="jstree-container-ul jstree-children">
 												<li class="jstree-initial-node jstree-loading jstree-leaf jstree-last">
 													<i class="jstree-icon jstree-ocl"></i>
@@ -995,40 +1018,39 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 		var right = <?php echo $right; ?>;
 		db_table["category"].forEach(element => {
 			option_id = "c" + element["category_id"] + "-l" + element["list_id"];
-			$("#category .checkboxes").append("<label class='category-button' for="+option_id+"><input type='checkbox' class='category-option' value="+element["category_name"]+" id="+option_id+" />"+element["category_name"]+"</label>");
-			
+			$("#category .checkboxes").append("<label class='category-button' for=" + option_id + "><input type='checkbox' class='category-option' value=" + element["category_name"] + " id=" + option_id + " />" + element["category_name"] + "</label>");
+
 			filter_option_id = "f-c" + element["category_id"]
 			list_id = element["list_id"];
-			$("#f-category").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" list_id="+list_id+" style='display:none;'>"+element["category_name"]+"</button>");
+			$("#f-category").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id=" + filter_option_id + " list_id=" + list_id + " style='display:none;'>" + element["category_name"] + "</button>");
 		});
 
 		db_table["project"].forEach(element => {
 			option_id = "p" + element["project_id"];
-			$("#project .checkboxes").append("<label class='project-button' for="+option_id+"><input type='checkbox' class='project-option' value="+element["project_id"]+" id="+option_id+" />["+element["project_id"]+"] "+element["project_name"]+"</label>");
-		
+			$("#project .checkboxes").append("<label class='project-button' for=" + option_id + "><input type='checkbox' class='project-option' value=" + element["project_id"] + " id=" + option_id + " />[" + element["project_id"] + "] " + element["project_name"] + "</label>");
+
 			filter_option_id = "f-" + option_id;
-			$("#f-project").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+element["project_name"]+"</button>");
+			$("#f-project").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id=" + filter_option_id + " style='display:none;'>" + element["project_name"] + "</button>");
 		});
 
 		db_table["type"].forEach(element => {
 			option_id = "t" + element["type_id"];
-			$("#type .checkboxes").append("<label class='type-button' for="+option_id+"><input type='checkbox' class='type-option' value="+element["type_name"]+" id="+option_id+" />"+element["type_name"]+"</label>");
-		
+			$("#type .checkboxes").append("<label class='type-button' for=" + option_id + "><input type='checkbox' class='type-option' value=" + element["type_name"] + " id=" + option_id + " />" + element["type_name"] + "</label>");
+
 			filter_option_id = "f-" + option_id;
-			$("#f-type").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+element["type_name"]+"</button>");
+			$("#f-type").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id=" + filter_option_id + " style='display:none;'>" + element["type_name"] + "</button>");
 		});
 
-		for(i=0;i<notes_button_list.length;i++) {
+		for (i = 0; i < notes_button_list.length; i++) {
 			option_id = "n" + i;
-			$("#notes .checkboxes").append("<label class='notes-button' for="+option_id+"><input type='checkbox' class='notes-option' value="+notes_button_list[i]+" id="+option_id+" />"+notes_button_list[i]+"</label>");
-		
+			$("#notes .checkboxes").append("<label class='notes-button' for=" + option_id + "><input type='checkbox' class='notes-option' value=" + notes_button_list[i] + " id=" + option_id + " />" + notes_button_list[i] + "</label>");
+
 			filter_option_id = "f-" + option_id;
-			$("#f-notes").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+notes_button_list[i]+"</button>");
+			$("#f-notes").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id=" + filter_option_id + " style='display:none;'>" + notes_button_list[i] + "</button>");
 		}
-		if(right < 2){
+		if (right < 2) {
 			$("#upload-btn").hide();
 		}
-		
 	</script>
 	<!-- Vendor -->
 	<script src="assets/vendor/magnific-popup/magnific-popup.js"></script>
@@ -1037,7 +1059,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
 	<script src='./script/js/search.js'></script>
 	<script src='./script/js/filter.js'></script>
 	<script src="assets/javascripts/ui-elements/examples.modals.js"></script>
-	
+
 </body>
 
 </html>