將 含有/的deviceNumber 判斷buildingtag是否有數字開頭,補上$3
This commit is contained in:
		
							parent
							
								
									5c3f2b62f8
								
							
						
					
					
						commit
						500c2badfe
					
				| @ -499,6 +499,7 @@ | ||||
|   function setLightSchBlcok(obj) { | ||||
|     let devNum = $(obj).parents(".device-wrap").data("number"); | ||||
|     let devPath = devNum.replaceAll("_", "/"); | ||||
|     devPath = deviceNumberOnProcess(devPath); | ||||
|     let iframe = `<iframe src="/ord?station:%7Cslot:/${devPath}/Sch|view:?fullScreen=true" style="min-height:100px;width:100%;height:100%"></iframe>`; | ||||
|     $("#lightSchBlock").html(iframe); | ||||
|   } | ||||
| @ -564,7 +565,7 @@ | ||||
|             $.each(floObj.device_list, (index2, devObj) => { | ||||
|               allDevList.push(devObj); | ||||
|               let devItem = getRiserPoiObj(); | ||||
|               strHtml += `<div class="card m-1 border device-wrap" data-number="${devObj.device_number | ||||
|               strHtml += `<div class="card m-1 border device-wrap" data-number="${deviceNumber(devObj.device_number) | ||||
|                 }" data-position="${position}"> | ||||
|                                         <div class="card-body p-2"> | ||||
|                                             <div class="d-flex mb-2"> | ||||
| @ -695,6 +696,7 @@ | ||||
|   // Card 即時狀態 | ||||
|   function drawStateTabBlo(devNum) { | ||||
|     let devPath = devNum.replaceAll("_", "/"); | ||||
|     devPath = deviceNumberOnProcess(devPath); | ||||
|     let position = | ||||
|       $(`.card.device-wrap[data-number=${deviceNumber(devNum)}]`).data("position") || "left"; | ||||
|     let width = buildMenuData[position + "_icon_click_url_width"] | ||||
|  | ||||
| @ -1276,3 +1276,14 @@ function deviceNumber(devNum){ | ||||
|   return devNum; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| function deviceNumberOnProcess(devNum){ | ||||
|   if(devNum.includes("/")){ | ||||
|     tags = devNum.split("/"); | ||||
|     buildingTag = tags[1]; | ||||
|     buildingTag = buildingTagOnProcess(buildingTag); | ||||
|     devNum = tags[0] + "/" + buildingTag + "/" + tags.slice(2,tags.length).join("/") | ||||
|   } | ||||
|   return devNum; | ||||
| 
 | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user