[Frontend]歷史資料月選擇及語系修改 | 告警系統棟別隱藏 $3
This commit is contained in:
		
							parent
							
								
									22396c5736
								
							
						
					
					
						commit
						cb9f14d136
					
				@ -1049,7 +1049,10 @@
 | 
				
			|||||||
		let columns = [
 | 
							let columns = [
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				title: "棟別-樓層",
 | 
									title: "棟別-樓層",
 | 
				
			||||||
				data: "buildingFloorName_zh",
 | 
											data: "buildingFloorName_zh",
 | 
				
			||||||
 | 
					      render: (data) => {
 | 
				
			||||||
 | 
					        return data.replace("$3", "");
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				title: "異常ID",
 | 
									title: "異常ID",
 | 
				
			||||||
 | 
				
			|||||||
@ -119,13 +119,30 @@
 | 
				
			|||||||
  pageAct.hisBuiName = "";
 | 
					  pageAct.hisBuiName = "";
 | 
				
			||||||
  hisFirst = true;
 | 
					  hisFirst = true;
 | 
				
			||||||
  $(function () {
 | 
					  $(function () {
 | 
				
			||||||
    flatpickr(".selectDate", {});
 | 
					    flatpickr(".selectDate", {
 | 
				
			||||||
    flatpickr(".selectMonth", { dateFormat: "Y-m", });
 | 
					      locale: "zh_tw",
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    flatpickr(".selectMonth", {
 | 
				
			||||||
 | 
					      dateFormat: "Y-m",
 | 
				
			||||||
 | 
					      locale: "zh_tw",
 | 
				
			||||||
 | 
					      onMonthChange: (selectedDates, dateStr, instance) => {
 | 
				
			||||||
 | 
					        const curMon = new Date(
 | 
				
			||||||
 | 
					          `${instance.currentYear}-${instance.currentMonth + 1}`
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        instance.setDate(curMon);
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      onYearChange: (selectedDates, dateStr, instance) => {
 | 
				
			||||||
 | 
					        const curMon = new Date(
 | 
				
			||||||
 | 
					          `${instance.currentYear}-${instance.currentMonth + 1}`
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        instance.setDate(curMon);
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
    let html = "";
 | 
					    let html = "";
 | 
				
			||||||
    for (let building of pageAct.buildList) {
 | 
					    for (let building of pageAct.buildList) {
 | 
				
			||||||
      html += `<label class="btn btn-secondary">
 | 
					      html += `<label class="btn btn-secondary">
 | 
				
			||||||
                            <input type="radio" name="buildingRadio" id="radio-${building.getway}" value="${building.building_tag}" onChange="SelectBuild(this,'${building.building_tag}')"> ${building.full_name}
 | 
					                              <input type="radio" name="buildingRadio" id="radio-${building.getway}" value="${building.building_tag}" onChange="SelectBuild(this,'${building.building_tag}')"> ${building.full_name}
 | 
				
			||||||
                        </label>`;
 | 
					                          </label>`;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    $("#his_building").find(".item").empty();
 | 
					    $("#his_building").find(".item").empty();
 | 
				
			||||||
    $("#his_building").find(".item").append(html);
 | 
					    $("#his_building").find(".item").append(html);
 | 
				
			||||||
@ -262,12 +279,12 @@
 | 
				
			|||||||
      $.each(res.data.history_Main_Systems, function (index, val) {
 | 
					      $.each(res.data.history_Main_Systems, function (index, val) {
 | 
				
			||||||
        if (pageAct.mainStatus) {
 | 
					        if (pageAct.mainStatus) {
 | 
				
			||||||
          strHtml += `<li>
 | 
					          strHtml += `<li>
 | 
				
			||||||
                                    <a href="#" data-filter-tags="${val.full_name.toLowerCase()}" data-maintag="${val.main_system_tag
 | 
					                                      <a href="#" data-filter-tags="${val.full_name.toLowerCase()}" data-maintag="${val.main_system_tag
 | 
				
			||||||
            }">
 | 
					            }">
 | 
				
			||||||
                                        <span class="nav-link-text">${val.full_name
 | 
					                                          <span class="nav-link-text">${val.full_name
 | 
				
			||||||
            }</span>
 | 
					            }</span>
 | 
				
			||||||
                                        </a>
 | 
					                                          </a>
 | 
				
			||||||
                                        <ul style="${index == 0 ? `display:block;` : ``
 | 
					                                          <ul style="${index == 0 ? `display:block;` : ``
 | 
				
			||||||
            }">`;
 | 
					            }">`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          i1 = val.history_Sub_systems != null && i1 == null ? index : null;
 | 
					          i1 = val.history_Sub_systems != null && i1 == null ? index : null;
 | 
				
			||||||
@ -277,13 +294,13 @@
 | 
				
			|||||||
          i2 = val2.device != null && i2 == null ? index2 : null;
 | 
					          i2 = val2.device != null && i2 == null ? index2 : null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          strHtml += `<li>
 | 
					          strHtml += `<li>
 | 
				
			||||||
                                    <a href="#" data-filter-tags="${val2.full_name.toLowerCase()}"  data-subtag="${val2.sub_system_tag
 | 
					                                      <a href="#" data-filter-tags="${val2.full_name.toLowerCase()}"  data-subtag="${val2.sub_system_tag
 | 
				
			||||||
            }">
 | 
					            }">
 | 
				
			||||||
                                        <span class="nav-link-text">
 | 
					                                          <span class="nav-link-text">
 | 
				
			||||||
                                            ${val2.full_name}
 | 
					                                              ${val2.full_name}
 | 
				
			||||||
                                        </span>
 | 
					                                          </span>
 | 
				
			||||||
                                    </a>
 | 
					                                      </a>
 | 
				
			||||||
                                    <ul style="${(i1 != null ? index == i1 : first) &&
 | 
					                                      <ul style="${(i1 != null ? index == i1 : first) &&
 | 
				
			||||||
              index2 == i2
 | 
					              index2 == i2
 | 
				
			||||||
              ? `display:block;`
 | 
					              ? `display:block;`
 | 
				
			||||||
              : ``
 | 
					              : ``
 | 
				
			||||||
@ -294,15 +311,15 @@
 | 
				
			|||||||
              val3.device_number = val3.device_number.replace("$3", "");
 | 
					              val3.device_number = val3.device_number.replace("$3", "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            strHtml += `<li data-tabname="hisListItem">
 | 
					            strHtml += `<li data-tabname="hisListItem">
 | 
				
			||||||
                                        <a href="#" onClick="setValue('${val3.device_number
 | 
					                                          <a href="#" onClick="setValue('${val3.device_number
 | 
				
			||||||
              }', '${val3.full_name
 | 
					              }', '${val3.full_name
 | 
				
			||||||
              }', null)" data-filter-tags="${val3.full_name.toLowerCase()} ${val3.device_serial_tag.toLowerCase()}" data-devnum="${val3.device_number
 | 
					              }', null)" data-filter-tags="${val3.full_name.toLowerCase()} ${val3.device_serial_tag.toLowerCase()}" data-devnum="${val3.device_number
 | 
				
			||||||
              }">
 | 
					              }">
 | 
				
			||||||
                                            <span class="nav-link-text">
 | 
					                                              <span class="nav-link-text">
 | 
				
			||||||
                                                ${val3.full_name}
 | 
					                                                  ${val3.full_name}
 | 
				
			||||||
                                            </span>
 | 
					                                              </span>
 | 
				
			||||||
                                        </a>
 | 
					                                          </a>
 | 
				
			||||||
                                    </li>`;
 | 
					                                      </li>`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (pageAct.mainStatus) {
 | 
					            if (pageAct.mainStatus) {
 | 
				
			||||||
              if (index == i1 && index2 == i2 && first) {
 | 
					              if (index == i1 && index2 == i2 && first) {
 | 
				
			||||||
@ -450,7 +467,7 @@
 | 
				
			|||||||
      new Date(new Date().setDate(new Date().getDate() + 1)),
 | 
					      new Date(new Date().setDate(new Date().getDate() + 1)),
 | 
				
			||||||
      "date"
 | 
					      "date"
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					    $(".flatpickr-innerContainer").show();
 | 
				
			||||||
    if (type == "day" || type == "today" || type == "ytd") {
 | 
					    if (type == "day" || type == "today" || type == "ytd") {
 | 
				
			||||||
      let date = type == "ytd" ? ytd : now;
 | 
					      let date = type == "ytd" ? ytd : now;
 | 
				
			||||||
      $("#his_startdate").css("display", "block");
 | 
					      $("#his_startdate").css("display", "block");
 | 
				
			||||||
@ -495,6 +512,7 @@
 | 
				
			|||||||
      $("#his_enddate").css("display", "none");
 | 
					      $("#his_enddate").css("display", "none");
 | 
				
			||||||
      $("#getmonth").css("display", "block");
 | 
					      $("#getmonth").css("display", "block");
 | 
				
			||||||
      $("#getmonth").val(now.substr(0, 7));
 | 
					      $("#getmonth").val(now.substr(0, 7));
 | 
				
			||||||
 | 
					      $(".flatpickr-innerContainer").hide();
 | 
				
			||||||
    } else if (type == "ytd") {
 | 
					    } else if (type == "ytd") {
 | 
				
			||||||
      $("#his_startdate").css("display", "block");
 | 
					      $("#his_startdate").css("display", "block");
 | 
				
			||||||
      $("#his_enddate").css("display", "none");
 | 
					      $("#his_enddate").css("display", "none");
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4663
									
								
								Frontend/index.html
									
									
									
									
									
								
							
							
						
						
									
										4663
									
								
								Frontend/index.html
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user