[前台][系統監控] 點擊 device 卡片 data-number 適應 building_tag 開頭為數字轉換
This commit is contained in:
		
							parent
							
								
									7e07ac738b
								
							
						
					
					
						commit
						93c03ae844
					
				@ -54,7 +54,6 @@
 | 
			
		||||
 | 
			
		||||
  $(function () {
 | 
			
		||||
    $(loadEle).Loading("start");
 | 
			
		||||
    debugger
 | 
			
		||||
    getBuildMenu((arr, data) => {
 | 
			
		||||
      buildMenuData = data;
 | 
			
		||||
      if (arr.indexOf(4) != -1) {
 | 
			
		||||
@ -576,7 +575,7 @@
 | 
			
		||||
                devObj.device_image
 | 
			
		||||
                }" class="profile-image rounded-circle" onerror="defDev(this)" alt="...">
 | 
			
		||||
                                                    </span>
 | 
			
		||||
                                                    <a name="devItemName" data-number="${devObj.device_number
 | 
			
		||||
                                                    <a name="devItemName" data-number="${deviceNumber(devObj.device_number)
 | 
			
		||||
                }" href="javascript:;">${devObj.full_name
 | 
			
		||||
                }</a>
 | 
			
		||||
                                                </div>
 | 
			
		||||
 | 
			
		||||
@ -1276,7 +1276,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
			
		||||
              setSysTagForPageAct(this);
 | 
			
		||||
              $("#sysMonTopBtn").YTTab("set");
 | 
			
		||||
              $(`#subSysBtn${pageAct.sysSubTag}`).YTTab("set");
 | 
			
		||||
              debugger
 | 
			
		||||
 | 
			
		||||
              if (pageAct.isShowBuildingInMenu) {
 | 
			
		||||
                let building_tag = $(this).data("building-tag");
 | 
			
		||||
                $(`#buildTab${building_tag}`).YTTab("set");
 | 
			
		||||
@ -1570,7 +1570,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
			
		||||
                : "";
 | 
			
		||||
 | 
			
		||||
            let option = {
 | 
			
		||||
              html: `<div class="card m-1 border device-wrap" data-number="${devNum}" data-position="left">
 | 
			
		||||
              html: `<div class="card m-1 border device-wrap" data-number="${deviceNumber(devNum)}" data-position="left">
 | 
			
		||||
                                          <div class="card-header p-3">
 | 
			
		||||
 | 
			
		||||
                                              <div class="position-absolute mr-5" style="word-break: break-all;">
 | 
			
		||||
@ -1701,10 +1701,12 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
			
		||||
        function devItemNameEvent() {
 | 
			
		||||
          onEvent("click", "[name=devItemName]", function () {
 | 
			
		||||
            let devNum = $(this).data("number");
 | 
			
		||||
            let devObj = $(`[name=devItem][data-number=${devNum}]`).data(
 | 
			
		||||
            let devObj = $(`[name=devItem][data-number=${deviceNumber(devNum)}]`).data(
 | 
			
		||||
              "devobj"
 | 
			
		||||
            );
 | 
			
		||||
            moveViewToDevice(devObj.forge_dbid);
 | 
			
		||||
			if(devObj){
 | 
			
		||||
				moveViewToDevice(devObj.forge_dbid);
 | 
			
		||||
			}
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,9 @@ function getAllLeafComponents(viewer, callback) {
 | 
			
		||||
  var cbCount = 0;
 | 
			
		||||
  var tree;
 | 
			
		||||
  var jsData = [];
 | 
			
		||||
 | 
			
		||||
  if(typeof viewer == 'undefined'){
 | 
			
		||||
	return;
 | 
			
		||||
  }
 | 
			
		||||
  function getLeafComponentsRec(current, parent) {
 | 
			
		||||
    cbCount++;
 | 
			
		||||
    if (tree.getChildCount(current) != 0) {
 | 
			
		||||
@ -833,6 +835,9 @@ async function changeColorForHotspot(dbId, type = null, OnOff = false) {
 | 
			
		||||
 | 
			
		||||
// 更換 icon
 | 
			
		||||
async function changeScaleForHotspot(dbId, type = true) {
 | 
			
		||||
  if(typeof viewer == 'undefined'){
 | 
			
		||||
	  return;
 | 
			
		||||
  }
 | 
			
		||||
  const dataVizExtn = await viewer.loadExtension("Autodesk.DataVisualization");
 | 
			
		||||
  let spriteErrIcon = baseForgeApiUrl + "/file/img/forge/sensor_circle.svg";
 | 
			
		||||
  if (location.href.indexOf("localhost:5966") != -1) {
 | 
			
		||||
@ -848,6 +853,9 @@ async function changeScaleForHotspot(dbId, type = true) {
 | 
			
		||||
 | 
			
		||||
// 熱點 更換大小
 | 
			
		||||
async function changeScaleForHotspot(dbId, type = true) {
 | 
			
		||||
	if(typeof viewer == 'undefined'){
 | 
			
		||||
	  return;
 | 
			
		||||
  }
 | 
			
		||||
  const dataVizExtn = await viewer.loadExtension("Autodesk.DataVisualization");
 | 
			
		||||
  let scale = 1;
 | 
			
		||||
  if (type) {
 | 
			
		||||
@ -1266,17 +1274,26 @@ function getHopspotPoint(data) {
 | 
			
		||||
 | 
			
		||||
//呼叫載入熱圖
 | 
			
		||||
async function toLoadHeatmap(roomArr) {
 | 
			
		||||
	if(typeof viewer == 'undefined'){
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
  const model = viewer.model;
 | 
			
		||||
  loadHeatmaps(model, roomArr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setShadowShow(type = false) {
 | 
			
		||||
	if(typeof viewer == 'undefined'){
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
  viewer.setGroundShadow(type);
 | 
			
		||||
  viewer.impl.sceneUpdated(true);
 | 
			
		||||
}
 | 
			
		||||
//============================= end ===================================
 | 
			
		||||
 | 
			
		||||
function moveViewToDevice(letter) {
 | 
			
		||||
	if(typeof viewer == 'undefined'){
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
  if (letter != "") {
 | 
			
		||||
    viewer.clearSelection();
 | 
			
		||||
    viewer.select(letter);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user