[後台] 修改樓層顯示圖檔問題, 修改切換棟別問題, 關閉點位新增,
This commit is contained in:
parent
a620eae1a8
commit
17b9f2485b
@ -468,7 +468,7 @@ namespace Backend.Controllers
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(buildFloor.InitMapName))
|
if (!string.IsNullOrEmpty(buildFloor.InitMapName))
|
||||||
{
|
{
|
||||||
buildFloor.MapUrl = "/upload/floor_map/" + buildFloor.Floor_guid + ".svg";
|
buildFloor.MapUrl = baseURL + "upload/floor_map/" + buildFloor.Floor_map_name + ".svg";
|
||||||
}
|
}
|
||||||
|
|
||||||
apiResult.Code = "0000";
|
apiResult.Code = "0000";
|
||||||
|
@ -531,24 +531,33 @@ namespace Backend.Controllers
|
|||||||
|
|
||||||
if (device_Item.id == 0)
|
if (device_Item.id == 0)
|
||||||
{
|
{
|
||||||
|
var building = await backendRepository.GetAllAsync<string>("select building_tag from building where deleted = 0;");
|
||||||
|
var parentPath = await backendRepository.GetOneAsync<string>("select system_value from variable where deleted = 0 and system_type = 'obixStatus'");
|
||||||
|
List<Dictionary<string, object>> device_iteDic = new List<Dictionary<string, object>>();
|
||||||
//新增
|
//新增
|
||||||
Dictionary<string, object> Device_itemDic = new Dictionary<string, object>()
|
foreach (var b in building)
|
||||||
{
|
{
|
||||||
{ "@device_system_tag", main_tag},
|
Dictionary<string, object> Device_itemDic = new Dictionary<string, object>()
|
||||||
{ "@device_name_tag", sub_tag},
|
{
|
||||||
{ "@full_name", device_Item.full_name},
|
{ "@device_system_tag", main_tag},
|
||||||
{ "@points", device_Item.points},
|
{ "@device_name_tag", sub_tag},
|
||||||
{ "@unit", device_Item.unit},
|
{ "@full_name", device_Item.full_name},
|
||||||
{ "@is_show", device_Item.is_show},
|
{ "@points", device_Item.points},
|
||||||
{ "@is_show_riserDiagram", device_Item.is_show_riserDiagram},
|
{ "@unit", device_Item.unit},
|
||||||
{ "@is_controll", device_Item.is_controll},
|
{ "@device_building_tag", b},
|
||||||
{ "@is_bool", device_Item.is_bool},
|
{ "@parent_path", parentPath},
|
||||||
{ "@is_show_history", device_Item.is_show_history},
|
{ "@is_link", 1},
|
||||||
{ "@created_by", myUserInfo.Userinfo_guid},
|
{ "@is_show", device_Item.is_show},
|
||||||
};
|
{ "@is_show_riserDiagram", device_Item.is_show_riserDiagram},
|
||||||
await backendRepository.AddOneByCustomTable(Device_itemDic, "device_item");
|
{ "@is_controll", device_Item.is_controll},
|
||||||
|
{ "@is_bool", device_Item.is_bool},
|
||||||
|
{ "@is_show_history", device_Item.is_show_history},
|
||||||
|
{ "@created_by", myUserInfo.Userinfo_guid},
|
||||||
|
};
|
||||||
|
device_iteDic.Add(Device_itemDic);
|
||||||
|
}
|
||||||
|
|
||||||
|
await backendRepository.AddMutiByCustomTable(device_iteDic, "device_item");
|
||||||
apiResult.Code = "0000";
|
apiResult.Code = "0000";
|
||||||
apiResult.Msg = "新增成功";
|
apiResult.Msg = "新增成功";
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,9 @@
|
|||||||
//樓層設定上方選單
|
//樓層設定上方選單
|
||||||
$("#BuildList").empty();
|
$("#BuildList").empty();
|
||||||
$.each(data, function (key, value) {
|
$.each(data, function (key, value) {
|
||||||
|
if (value.building_tag.includes("$3"))
|
||||||
|
value.building_tag = value.building_tag.replace("$3", "");
|
||||||
|
|
||||||
$("#BuildList").append(`<button type="button" class="btn btn-outline-success waves-effect waves-themed ml-2 mb-2 btn-station" id="${value.building_tag}" onclick="clickBuilding('${value.building_tag}')">${value.full_name}</button>`);
|
$("#BuildList").append(`<button type="button" class="btn btn-outline-success waves-effect waves-themed ml-2 mb-2 btn-station" id="${value.building_tag}" onclick="clickBuilding('${value.building_tag}')">${value.full_name}</button>`);
|
||||||
@*if (key == 0) {
|
@*if (key == 0) {
|
||||||
selected_build_guid_top_name = value.full_name;
|
selected_build_guid_top_name = value.full_name;
|
||||||
@ -454,7 +457,7 @@
|
|||||||
var file = input3Dfile;
|
var file = input3Dfile;
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
formData.append('fileToUpload', file);
|
formData.append('fileToUpload', file);
|
||||||
formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
|
formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/api/forge/oss/objects',
|
url: '/api/forge/oss/objects',
|
||||||
@ -530,7 +533,10 @@
|
|||||||
var url = "/BuildInfo/EditBuildInfo";
|
var url = "/BuildInfo/EditBuildInfo";
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
|
|
||||||
formData.append("building_tag", selected_build_guid);
|
if ($.isNumeric(selected_build_guid[0]))
|
||||||
|
formData.append("building_tag", "$3" + selected_build_guid);
|
||||||
|
else
|
||||||
|
formData.append("building_tag", selected_build_guid);
|
||||||
formData.append("Full_name", $('#build_name_modal').val());
|
formData.append("Full_name", $('#build_name_modal').val());
|
||||||
formData.append("Ip_address", $('#ip_address_modal').val());
|
formData.append("Ip_address", $('#ip_address_modal').val());
|
||||||
formData.append("Ip_port", $('#ip_port_modal').val());
|
formData.append("Ip_port", $('#ip_port_modal').val());
|
||||||
@ -682,7 +688,10 @@
|
|||||||
"url": "/BuildInfo/BuildFloorList",
|
"url": "/BuildInfo/BuildFloorList",
|
||||||
"type": "POST",
|
"type": "POST",
|
||||||
"data": function (d) {
|
"data": function (d) {
|
||||||
d.build_tag = selected_build_guid_top;
|
if ($.isNumeric(selected_build_guid_top[0]))
|
||||||
|
d.build_tag = selected_build_guid_top = "$3" + selected_build_guid_top;
|
||||||
|
else
|
||||||
|
d.build_tag = selected_build_guid_top;
|
||||||
},
|
},
|
||||||
"dataSrc": function (rel) {
|
"dataSrc": function (rel) {
|
||||||
if (rel.code == "9999") {
|
if (rel.code == "9999") {
|
||||||
@ -762,11 +771,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$('#floor-modal').modal();
|
||||||
|
|
||||||
$("#BuildName").html(selected_build_guid_top_name);
|
$("#BuildName").html(selected_build_guid_top_name);
|
||||||
$("#floor_name_modal").val(rel.data.full_name);
|
$("#floor_name_modal").val(rel.data.full_name);
|
||||||
@*$("#map_file_preview_modal").attr("data-original", rel.data.mapUrl);*@
|
if (rel.data.mapUrl)
|
||||||
|
loadURLToInputFiled(rel.data.mapUrl, rel.data.initMapName + ".svg");
|
||||||
$('#floor-modal').modal();
|
else
|
||||||
|
$('#floor_map_file_modal')[0].value = "";
|
||||||
}
|
}
|
||||||
}, 'json');
|
}, 'json');
|
||||||
});
|
});
|
||||||
@ -962,7 +974,7 @@
|
|||||||
function translateObject(urn) {
|
function translateObject(urn) {
|
||||||
$("#forgeViewer").empty();
|
$("#forgeViewer").empty();
|
||||||
//if (node == null) node = $('#appBuckets').jstree(true).get_selected(true)[0];
|
//if (node == null) node = $('#appBuckets').jstree(true).get_selected(true)[0];
|
||||||
var bucketKey = "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim";//forge上傳平台-資料夾
|
var bucketKey = "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim";//forge上傳平台-資料夾
|
||||||
var objectKey = urn;
|
var objectKey = urn;
|
||||||
|
|
||||||
jQuery.post({
|
jQuery.post({
|
||||||
@ -977,6 +989,26 @@
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
function loadURLToInputFiled(url, filesName){
|
||||||
|
getImgURL(url, (imgBlob)=>{
|
||||||
|
// Load img blob to input
|
||||||
|
// WIP: UTF8 character error
|
||||||
|
let fileName = filesName
|
||||||
|
let file = new File([imgBlob], fileName,{type:"image/svg+xml", lastModified:new Date().getTime()}, 'utf-8');
|
||||||
|
let container = new DataTransfer();
|
||||||
|
container.items.add(file);
|
||||||
|
$('#floor_map_file_modal')[0].files = container.files;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// xmlHTTP return blob respond
|
||||||
|
function getImgURL(url, callback){
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onload = function() {
|
||||||
|
callback(xhr.response);
|
||||||
|
};
|
||||||
|
xhr.open('GET', url);
|
||||||
|
xhr.responseType = 'blob';
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
@ -594,13 +594,13 @@
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 新增設備項目
|
//#region 新增設備項目
|
||||||
function Adddevice_item() {
|
//function Adddevice_item() {
|
||||||
//SubDeviceItemValidate.resetForm();
|
// //SubDeviceItemValidate.resetForm();
|
||||||
selected_system_device_item_guid = "";
|
// selected_system_device_item_guid = "";
|
||||||
$("#device-sub-modal .modal-title").html("設備項目 - 新增");
|
// $("#device-sub-modal .modal-title").html("設備項目 - 新增");
|
||||||
$("#device-item-sub-form").trigger("reset");
|
// $("#device-item-sub-form").trigger("reset");
|
||||||
$("#device-sub-modal").modal();
|
// $("#device-sub-modal").modal();
|
||||||
}
|
//}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
$('#system_sub_table').on("click", "tbody>tr", function () {
|
$('#system_sub_table').on("click", "tbody>tr", function () {
|
||||||
|
@ -32,11 +32,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="card border mb-g w-100 mb-5" id="submenucard">
|
<div class="card border mb-g w-100 mb-5" id="submenucard">
|
||||||
<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap justify-content-end">
|
@*<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap justify-content-end">
|
||||||
<div class="text-right ">
|
<div class="text-right ">
|
||||||
<a href="javascript:;" class="btn btn-success waves-effect waves-themed" id="adddevice_item-btn" onclick="Adddevice_item()"><span class="fal fa-plus mr-1"></span>新增</a>
|
<a href="javascript:;" class="btn btn-success waves-effect waves-themed" id="adddevice_item-btn" onclick="Adddevice_item()"><span class="fal fa-plus mr-1"></span>新增</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>*@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="w-100">
|
<div class="w-100">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
@ -142,12 +142,12 @@ namespace BackendWorkerService
|
|||||||
);
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 定時取得氣象API
|
//#region 定時取得氣象API
|
||||||
services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
|
//services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
|
||||||
services.AddSingleton(
|
//services.AddSingleton(
|
||||||
new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
|
//new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
|
||||||
);
|
//);
|
||||||
#endregion
|
//#endregion
|
||||||
|
|
||||||
}).ConfigureLogging((hostContext, logFactory) => {
|
}).ConfigureLogging((hostContext, logFactory) => {
|
||||||
IConfiguration configuration = hostContext.Configuration;
|
IConfiguration configuration = hostContext.Configuration;
|
||||||
|
Loading…
Reference in New Issue
Block a user