This commit is contained in:
wanling 2022-10-19 13:25:32 +08:00
commit 16e07b3df3
4 changed files with 317 additions and 164 deletions

View File

@ -29,7 +29,7 @@ namespace Backend.Controllers
try
{
var sqlString = @$"select building_guid as Value, full_name as Name from building a where a.deleted = 0 and a.status = 0 ORDER BY A.priority ASC, A.created_at DESC";
var sqlString = @$"select building_guid as Value, full_name as Name from building a where a.deleted = 0 and a.status = 0 ORDER BY a.priority ASC, a.created_at DESC";
KeyValue = await backendRepository.GetAllAsync<KeyValue>(sqlString);
apiResult.Code = "0000";

View File

@ -179,7 +179,7 @@ namespace Backend.Controllers
dk.device_close_flashing,
dk.device_error_flashing,
(SELECT
STRING_AGG( ISNULL(system_key, ' '), ',')
GROUP_CONCAT( IFNULL(system_key, ' '), ',')
FROM device_disaster dd
JOIN variable v ON v.deleted = 0 AND v.system_type = 'disaster' AND v.system_value = dd.device_system_value
WHERE dd.device_guid = d.device_guid
@ -805,7 +805,7 @@ namespace Backend.Controllers
try
{
var rawDatas = await backendRepository.GetAllAsync<DeviceImportCheckTempRawData>("device_import_ckeck_temp", "is_correct = 1 ORDER BY device_building_tag, device_system_tag, device_floor_tag, device_name_tag");
var rawDatas = await backendRepository.GetAllAsync<DeviceImportCheckTempRawData>("import_niagara_tag", null, null, "device_building_tag, device_system_tag, device_floor_tag, device_name_tag");
var rawDatas_Group_Building_tag = rawDatas.GroupBy(x => x.Device_building_tag).ToList();
List<DeviceImportCheckTempFilter> tempFilters = new List<DeviceImportCheckTempFilter>();
@ -875,33 +875,30 @@ namespace Backend.Controllers
di.device_building_tag,
di.device_system_tag,
di.device_floor_tag,
di.device_name_tag,
di.device_last_name_tag as device_name_tag,
di.device_serial_tag,
di.device_number,
di.device_system_category_layer3,
STRING_AGG( ISNULL(v.system_value, ' '), ',') AS Device_disasters,
STRING_AGG( ISNULL(v.system_key, ' '), ',') AS Device_disaster_type_text
0 as device_disaster,
di.niagara_tags as device_number
FROM
(SELECT
(
SELECT
*
FROM device_import_ckeck_temp di
WHERE device_building_tag = @Device_building_tag
FROM
import_niagara_tag intag
WHERE
device_building_tag = @Device_building_tag
AND device_system_tag = @Device_system_tag
AND device_floor_tag = @Device_floor_tag
AND device_name_tag = @Device_name_tag
AND is_correct = 1
AND device_number NOT IN (SELECT d.device_number FROM device d WHERE d.deleted = 0)
AND convert(intag.niagara_tags, nchar) NOT IN ( SELECT convert(d.device_number, nchar) FROM device d WHERE d.deleted = 0 )
) di
CROSS APPLY STRING_SPLIT(di.device_disaster, ',') dd
LEFT JOIN variable v ON v.system_type = 'disaster' AND v.system_value = dd.value
GROUP BY di.device_building_tag,
GROUP BY
di.device_building_tag,
di.device_system_tag,
di.device_floor_tag,
di.device_name_tag,
di.device_last_name_tag,
di.device_serial_tag,
di.device_number,
di.device_system_category_layer3";
di.niagara_tags";
var deviceImports = await backendRepository.GetAllAsync<DeviceImportCheckTemp>(sql, post);

View File

@ -131,6 +131,11 @@
<select class="form-control" id="build_menu_sub_modal">
</select>
</div>
<div class="col-12" id="build_menu_position_l_div">
<label class="mb-0 t-gray">左邊區塊</label>
<hr class="mt-1" />
<div class="form-group col-12">
<label class="form-label"><span class="text-danger">*</span>預設頁面</label>
<div class="row" id="build_menu_drawing_modal">
@ -149,7 +154,19 @@
<div class="col" id="drawing_1_div" style="display: none;">
<input type="radio" name="drawing" id="drawing_1" value="1">
<label for="drawing_1">
樓層平面圖
2D
</label>
</div>
<div class="col">
<input type="radio" name="drawing" id="drawing_3" value="3">
<label for="drawing_3">
3D
</label>
</div>
<div class="col">
<input type="radio" name="drawing" id="drawing_5" value="5">
<label for="drawing_5">
彈出URL
</label>
</div>
</div>
@ -164,6 +181,10 @@
<label class="form-label" for="build_menu_systemurl_modal"><span class="text-danger">*</span>系統圖URL</label>
<input type="text" id="build_menu_systemurl_modal" class="form-control" name="build_menu_systemurl_modal">
</div>
<div class="form-group col-12" id="build_menu_blankurl_modal_div" name="drawing_extend">
<label class="form-label" for="build_menu_blankurl_modal"><span class="text-danger">*</span>彈出URL</label>
<input type="text" id="build_menu_blankurl_modal" class="form-control" name="build_menu_blankurl_modal">
</div>
<div class="form-group col-12" id="build_menu_icon_click_onoff_modal_div" name="drawing_extend">
<label class="form-label">昇位圖 - 詳細資料設定</label>
@*<div class="row">
@ -222,12 +243,134 @@
<label class="form-label" for="build_menu_riser_diagram_url_modal">昇位圖 URL</label><br>
<input type="text" id="build_menu_riser_diagram_url_modal" class="form-control">
</div>
<div class="form-group col-6" id="build_menu_planimetric_floor_modal_div">
<label class="form-label" for="build_menu_planimetric_floor_modal"><span class="text-danger">*</span>平面圖預設樓層</label>
<select class="form-control" id="build_menu_planimetric_floor_modal">
</select>
</div>
</div>
<div class="col-12 mt-3" id="build_menu_position_r_div">
<label class="mb-0 t-gray">右邊區塊</label>
<hr class="mt-1" />
<div class="form-group col-12">
<label class="form-label"><span class="text-danger">*</span>預設頁面</label>
<div class="row" id="build_menu_drawing_modal_r">
<div class="col">
<input type="radio" name="drawing_r" id="drawing_4_r" value="4" checked>
<label for="drawing_4_r">
昇位圖
</label>
</div>
<div class="col">
<input type="radio" name="drawing_r" id="drawing_2_r" value="2">
<label for="drawing_2_r">
系統圖
</label>
</div>
<div class="col" id="drawing_1_div_r" style="display: none;">
<input type="radio" name="drawing_r" id="drawing_1_r" value="1">
<label for="drawing_1_r">
2D
</label>
</div>
<div class="col">
<input type="radio" name="drawing_r" id="drawing_3_r" value="3">
<label for="drawing_3_r">
3D
</label>
</div>
<div class="col">
<input type="radio" name="drawing_r" id="drawing_5_r" value="5">
<label for="drawing_5_r">
彈出URL
</label>
</div>
</div>
</div>
<div class="form-group col-12" id="" name="drawing_extend_r">
<div class="col-12 mb-2 custom-control custom-checkbox align-content-center">
<input type="checkbox" class="custom-control-input" name="planimetric_click_r" id="planimetric_click_r" value="1" />
<label class="custom-control-label" for="planimetric_click_r">是否顯示平面圖</label>
</div>
</div>
<div class="form-group col-12" id="build_menu_systemurl_modal_div_r" name="drawing_extend">
<label class="form-label" for="build_menu_systemurl_modal_r"><span class="text-danger">*</span>系統圖URL</label>
<input type="text" id="build_menu_systemurl_modal_r" class="form-control" name="build_menu_systemurl_modal_r">
</div>
<div class="form-group col-12" id="build_menu_blankurl_modal_div_r" name="drawing_extend_r">
<label class="form-label" for="build_menu_blankurl_modal_r"><span class="text-danger">*</span>彈出URL</label>
<input type="text" id="build_menu_blankurl_modal_r" class="form-control" name="build_menu_blankurl_modal_r">
</div>
<div class="form-group col-12" id="build_menu_icon_click_onoff_modal_div_r" name="drawing_extend_r">
<label class="form-label">昇位圖 - 詳細資料設定</label>
@*<div class="row">
<div class="col">
<input type="radio" name="icon_click_onoff" id="icon_click_on" value="1">
<label for="icon_click_on">
點擊開關
</label>
</div>
<div class="col">
<input type="radio" name="icon_click_onoff" id="icon_click_off" value="0" checked>
<label for="icon_click_off">
彈出視窗
</label>
</div>
</div>*@
<div class="row">
<div class="col" style="display:none">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="icon_click[]_r" id="icon_click_switch_r" value="2">
<label class="custom-control-label" for="icon_click_switch_r">點擊開關</label>
</div>
</div>
<div class="col">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="icon_click[]_r" id="icon_click_url_r" value="1">
<label class="custom-control-label" for="icon_click_url_r">顯示詳細資料</label>
</div>
</div>
</div>
</div>
<div class="form-group col-12" id="build_menu_icon_click_url_modal_div_r" name="drawing_extend_r">
<label class="form-label" for="build_menu_icon_click_url_modal_r">詳細資料 URL</label><br>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('device_building_tag')">+/[device_building_tag]</button>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('device_system_tag')">+/[device_system_tag]</button>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('device_floor_tag')">+/[device_floor_tag]</button>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('device_name_tag')">+/[device_name_tag]</button>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('device_serial_tag')">+/[device_serial_tag]</button>
<button type="button" class="btn btn-secondary waves-effect waves-themed mb-2" onclick="AddTagIntoClickUrl('tag_name')">+/[tag_name]</button>
<input type="text" id="build_menu_icon_click_url_modal_r" class="form-control">
</div>
<div class="form-group col-12" id="build_menu_icon_click_url_width_height_modal_div_r">
<label class="form-label">詳細資料 顯示視窗設定</label><br>
<div class="row">
<div class="col-6 form-group">
<label class="form-label" for="build_menu_icon_click_url_width_modal_r">寬(單位px)</label>
<input type="number" step="1" id="build_menu_icon_click_url_width_modal_r" class="form-control">
</div>
<div class="col-6 form-group">
<label class="form-label" for="build_menu_icon_click_url_height_modal_r">高(單位px)</label>
<input type="number" step="1" id="build_menu_icon_click_url_height_modal_r" class="form-control">
</div>
</div>
</div>
<div class="form-group col-12" id="build_menu_riser_diagram_url_modal_div_r" style="display: none">
<label class="form-label" for="build_menu_riser_diagram_url_modal_r">昇位圖 URL</label><br>
<input type="text" id="build_menu_riser_diagram_url_modal_r" class="form-control">
</div>
<div class="form-group col-6" id="build_menu_planimetric_floor_modal_div_r">
<label class="form-label" for="build_menu_planimetric_floor_modal_r"><span class="text-danger">*</span>平面圖預設樓層</label>
<select class="form-control" id="build_menu_planimetric_floor_modal_r">
</select>
</div>
</div>
</div>
</form>
</div>
@ -363,9 +506,9 @@
this.data = [];
} else {
$.each(this.data, function (k, rel) {
rel.sub_system_guid_name = "<font color='#7c91df'>" + rel.sub_system_guid_name +"</font>"
rel.sub_system_guid_name = "<font color='#7c91df'>" + rel.sub_system_guid_name + "</font>"
if (rel.drawing == 2) {
rel.drawing_name = rel.drawing_name + "<br>" + '<a href = "' + rel.system_url +'" target="_blank" >點擊連結</a >'
rel.drawing_name = rel.drawing_name + "<br>" + '<a href = "' + rel.system_url + '" target="_blank" >點擊連結</a >'
}
if (rel.drawing == 1) {
rel.drawing_name = rel.drawing_name + "<br>" + '[' + rel.floor_guid_name + ']'
@ -589,16 +732,17 @@
$.each($("input[name='icon_click[]']"), function (index, item) {
$(this).prop("checked", false);
});
$('#drawing_4').trigger('change');
changebuild_menu_drawing_modal();
GetSubList($('#build_menu_main_modal').val());
GetFloorInSubSystem();
$('#planimetric_click').attr("disabled", false);
$('#build-menu-modal').modal();
}
//#endregion
//#endregionplanimetric_click
//#region 修改選擇顯示頁面總類
$('#build_menu_drawing_modal').on("change", $("input[name='drawing']"), function () {
changebuild_menu_drawing_modal();
$('#build-menu-form').on("change", "input[name^=drawing]", function () {
changebuild_menu_drawing_modal(this);
});
//#endregion
$('#build_menu_icon_click_onoff_modal_div').on("click", "input[type=checkbox]", function () {
@ -730,39 +874,40 @@
}, 'json');
});
//#endregion
function changebuild_menu_drawing_modal() {
if ($('input[name="drawing"]:checked').val() == 2) {
$('#planimetric_click').attr("disabled", false);
$('#build_menu_icon_click_onoff_modal_div').hide();
$('#build_menu_icon_click_url_modal_div').hide();
$('#build_menu_systemurl_modal_div').show();
@*$('#build_menu_riser_diagram_url_modal_div').hide();*@
$('#build_menu_icon_click_url_width_height_modal_div').hide();
$('#build_menu_planimetric_floor_modal_div').hide();
} else if ($('input[name="drawing"]:checked').val() == 4) {
$('#planimetric_click').attr("disabled", false);
$('#build_menu_systemurl_modal_div').hide();
$('#build_menu_icon_click_onoff_modal_div').show();
if ($("#icon_click_url").prop('checked')) {
$('#build_menu_icon_click_url_modal_div').show();
$('#build_menu_icon_click_url_width_height_modal_div').show();
}
else {
$('#build_menu_icon_click_url_modal_div').hide();
$('#build_menu_icon_click_url_width_height_modal_div').hide();
}
@*$('#build_menu_riser_diagram_url_modal_div').show();*@
function changebuild_menu_drawing_modal(selector = "input[name^='drawing']:checked") {
$('#build_menu_planimetric_floor_modal_div').hide();
} else if ($('input[name="drawing"]:checked').val() == 1) {
$('#planimetric_click').prop("checked", true).attr("disabled", true);
$('#build_menu_systemurl_modal_div').hide();
$('#build_menu_icon_click_onoff_modal_div').hide();
$('#build_menu_icon_click_url_modal_div').hide();
@*$('#build_menu_riser_diagram_url_modal_div').hide();*@
$('#build_menu_icon_click_url_width_height_modal_div').hide();
$('#build_menu_planimetric_floor_modal_div').show();
$(selector).each(function (index, value) {
let drawingParent = $(value).parents("[id^=build_menu_position]")
$(drawingParent).find('[id^=build_menu_icon_click_onoff_modal_div]').hide();
$(drawingParent).find('[id^=build_menu_blankurl_modal_div]').hide();
$(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').hide();
$(drawingParent).find('[id^=build_menu_icon_click_url_width_height_modal_div]').hide();
$(drawingParent).find('[id^=build_menu_planimetric_floor_modal_div]').hide();
$(drawingParent).find('[id^=build_menu_systemurl_modal_div]').hide();
if ($(value).val() == 2) {
$(drawingParent).find('[id^=planimetric_click]').attr("disabled", false);
$(drawingParent).find('[id^=build_menu_systemurl_modal_div]').show();
} else if ($(value).val() == 4) {
$(drawingParent).find('[id^="planimetric_click"]').attr("disabled", false);
$(drawingParent).find('[id^=build_menu_icon_click_onoff_modal_div]').show();
if ($(drawingParent).find("[id^=icon_click_url]").prop('checked')) {
$(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').show();
$(drawingParent).find('[id^=build_menu_icon_click_url_width_height_modal_div]').show();
}
} else if ($(value).val() == 1) {
$(drawingParent).find('[id^=planimetric_click]').prop("checked", true).attr("disabled", true);
$(drawingParent).find('[id^=build_menu_planimetric_floor_modal_div]').show();
} else if ($(value).val() == 5) {
$(drawingParent).find('[id^=planimetric_click]').prop("checked", false);
$(drawingParent).find('[id^=build_menu_blankurl_modal_div]').show();
} else if ($(value).val() == 3) {
$(drawingParent).find('[id^=planimetric_click]').prop("checked", false).attr("disabled", true);
}
})
}
$('#buildMenu_table').on("click", "button.del-btn", function () {
var send_data = {
@ -969,19 +1114,21 @@
}
else {
if (rel.data.length == 0) {
$('#drawing_1_div').hide();
$('#build_menu_planimetric_floor_modal_div').hide();
$('[id^=drawing_1_div]').hide();
$('[id^=build_menu_planimetric_floor_modal_div]').hide();
}
else {
$('#build_menu_planimetric_floor_modal').empty();
$('#build_menu_planimetric_floor_modal,#build_menu_planimetric_floor_modal_r').empty();
$.each(rel.data, function (index, val) {
$('#build_menu_planimetric_floor_modal').append($("<option />").val(val.value).text(val.name));
$('#build_menu_planimetric_floor_modal_r').append($("<option />").val(val.value).text(val.name));
});
if (floor != null) {
$('#build_menu_planimetric_floor_modal').val(floor);
$('#build_menu_planimetric_floor_modal_r').val(floor);
}
$('#drawing_1_div').show();
$('#build_menu_planimetric_floor_modal_div').show();
$('[id^=drawing_1_div]').show();
$('[id^=build_menu_planimetric_floor_modal_div]').show();
changebuild_menu_drawing_modal();
}

View File

@ -3,6 +3,11 @@ for details on configuring this project to bundle and minify static web assets.
/* Sticky footer styles
-------------------------------------------------- */
:root {
--bims-gray:#c3c3c3;
}
html {
font-size: 16px;
}
@ -38,3 +43,7 @@ label.error {
.highcharts-credits {
display: none;
}
.t-gray {
color:var(--bims-gray) !important;
}