[後台] 修改樓層顯示圖檔問題, 修改切換棟別問題, 關閉點位新增,
This commit is contained in:
parent
a620eae1a8
commit
17b9f2485b
@ -468,7 +468,7 @@ namespace Backend.Controllers
|
||||
|
||||
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";
|
||||
|
@ -531,24 +531,33 @@ namespace Backend.Controllers
|
||||
|
||||
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},
|
||||
{ "@device_name_tag", sub_tag},
|
||||
{ "@full_name", device_Item.full_name},
|
||||
{ "@points", device_Item.points},
|
||||
{ "@unit", device_Item.unit},
|
||||
{ "@is_show", device_Item.is_show},
|
||||
{ "@is_show_riserDiagram", device_Item.is_show_riserDiagram},
|
||||
{ "@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},
|
||||
};
|
||||
await backendRepository.AddOneByCustomTable(Device_itemDic, "device_item");
|
||||
Dictionary<string, object> Device_itemDic = new Dictionary<string, object>()
|
||||
{
|
||||
{ "@device_system_tag", main_tag},
|
||||
{ "@device_name_tag", sub_tag},
|
||||
{ "@full_name", device_Item.full_name},
|
||||
{ "@points", device_Item.points},
|
||||
{ "@unit", device_Item.unit},
|
||||
{ "@device_building_tag", b},
|
||||
{ "@parent_path", parentPath},
|
||||
{ "@is_link", 1},
|
||||
{ "@is_show", device_Item.is_show},
|
||||
{ "@is_show_riserDiagram", device_Item.is_show_riserDiagram},
|
||||
{ "@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.Msg = "新增成功";
|
||||
}
|
||||
|
@ -108,6 +108,9 @@
|
||||
//樓層設定上方選單
|
||||
$("#BuildList").empty();
|
||||
$.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>`);
|
||||
@*if (key == 0) {
|
||||
selected_build_guid_top_name = value.full_name;
|
||||
@ -454,7 +457,7 @@
|
||||
var file = input3Dfile;
|
||||
var formData = new FormData();
|
||||
formData.append('fileToUpload', file);
|
||||
formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
|
||||
formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
|
||||
|
||||
$.ajax({
|
||||
url: '/api/forge/oss/objects',
|
||||
@ -530,7 +533,10 @@
|
||||
var url = "/BuildInfo/EditBuildInfo";
|
||||
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("Ip_address", $('#ip_address_modal').val());
|
||||
formData.append("Ip_port", $('#ip_port_modal').val());
|
||||
@ -682,7 +688,10 @@
|
||||
"url": "/BuildInfo/BuildFloorList",
|
||||
"type": "POST",
|
||||
"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) {
|
||||
if (rel.code == "9999") {
|
||||
@ -762,11 +771,14 @@
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$('#floor-modal').modal();
|
||||
|
||||
$("#BuildName").html(selected_build_guid_top_name);
|
||||
$("#floor_name_modal").val(rel.data.full_name);
|
||||
@*$("#map_file_preview_modal").attr("data-original", rel.data.mapUrl);*@
|
||||
|
||||
$('#floor-modal').modal();
|
||||
if (rel.data.mapUrl)
|
||||
loadURLToInputFiled(rel.data.mapUrl, rel.data.initMapName + ".svg");
|
||||
else
|
||||
$('#floor_map_file_modal')[0].value = "";
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
@ -962,7 +974,7 @@
|
||||
function translateObject(urn) {
|
||||
$("#forgeViewer").empty();
|
||||
//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;
|
||||
|
||||
jQuery.post({
|
||||
@ -977,6 +989,26 @@
|
||||
}
|
||||
//#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>
|
||||
}
|
@ -594,13 +594,13 @@
|
||||
//#endregion
|
||||
|
||||
//#region 新增設備項目
|
||||
function Adddevice_item() {
|
||||
//SubDeviceItemValidate.resetForm();
|
||||
selected_system_device_item_guid = "";
|
||||
$("#device-sub-modal .modal-title").html("設備項目 - 新增");
|
||||
$("#device-item-sub-form").trigger("reset");
|
||||
$("#device-sub-modal").modal();
|
||||
}
|
||||
//function Adddevice_item() {
|
||||
// //SubDeviceItemValidate.resetForm();
|
||||
// selected_system_device_item_guid = "";
|
||||
// $("#device-sub-modal .modal-title").html("設備項目 - 新增");
|
||||
// $("#device-item-sub-form").trigger("reset");
|
||||
// $("#device-sub-modal").modal();
|
||||
//}
|
||||
//#endregion
|
||||
|
||||
$('#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-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 ">
|
||||
<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 class="card-body">
|
||||
<div class="w-100">
|
||||
<div class="col-12">
|
||||
|
@ -142,12 +142,12 @@ namespace BackendWorkerService
|
||||
);
|
||||
#endregion
|
||||
|
||||
#region 定時取得氣象API
|
||||
services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
|
||||
services.AddSingleton(
|
||||
new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
|
||||
);
|
||||
#endregion
|
||||
//#region 定時取得氣象API
|
||||
//services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
|
||||
//services.AddSingleton(
|
||||
//new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
|
||||
//);
|
||||
//#endregion
|
||||
|
||||
}).ConfigureLogging((hostContext, logFactory) => {
|
||||
IConfiguration configuration = hostContext.Configuration;
|
||||
|
Loading…
Reference in New Issue
Block a user