[後台]修改 Forge 帳號 | [前台]樓層燈號顯示

This commit is contained in:
Celeste 2023-05-15 16:26:36 +08:00
parent ce792c2a5c
commit 0117bc8016
6 changed files with 16 additions and 23 deletions

View File

@ -15,8 +15,8 @@
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation",
"FORGE_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth", "FORGE_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth",
"FORGE_CLIENT_ID": "VeGoOgZcAVCBkiThYvLRSVrCTH6TTwyh", "FORGE_CLIENT_ID": "zO4ZGuyALhjrL5o81vA39Pkdgr82WAmq",
"FORGE_CLIENT_SECRET": "Rl1KHJIAI8GSAfhK" "FORGE_CLIENT_SECRET": "Bz5KyXqP6UqgGhxm"
} }
}, },
"Backend": { "Backend": {

View File

@ -278,7 +278,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', "vegoogzcavcbkithyvlrsvrcth6ttwyh-202302_ibms");//forge上傳平台-資料夾 formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
$.ajax({ $.ajax({
url: '/api/forge/oss/objects', url: '/api/forge/oss/objects',
@ -454,7 +454,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', "vegoogzcavcbkithyvlrsvrcth6ttwyh-202302_ibms");//forge上傳平台-資料夾 formData.append('bucketKey', "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim");//forge上傳平台-資料夾
$.ajax({ $.ajax({
url: '/api/forge/oss/objects', url: '/api/forge/oss/objects',
@ -962,7 +962,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 = "vegoogzcavcbkithyvlrsvrcth6ttwyh-202302_ibms";//forge上傳平台-資料夾 var bucketKey = "zo4zguyalhjrl5o81va39pkdgr82wamq-202305_bim";//forge上傳平台-資料夾
var objectKey = urn; var objectKey = urn;
jQuery.post({ jQuery.post({

View File

@ -43,16 +43,14 @@
var zoomToggle = 1.3; var zoomToggle = 1.3;
$(function () { $(function () {
$(loadEle).Loading("start"); $(loadEle).Loading("start");
$("#topLight").html(setTopLight());
setLightColor();
initChart(); initChart();
getFloData(); getFloData();
drawHeatBar(); drawHeatBar();
getHotspotPoint(() => { getHotspotPoint(() => {
show3DModel(pageAct.urn); show3DModel(pageAct.urn);
}); });
if (tempSubTag.includes(pageAct.sysSubTag)) {
$("#topLight").html(setTopLight());
setLightColor();
}
}); });
onEvent("click", "#resChartZoom", function () { onEvent("click", "#resChartZoom", function () {
@ -358,7 +356,6 @@
currentData.length > 0 currentData.length > 0
) { ) {
resetData(); resetData();
subDevice();
} }
var ordPath = { var ordPath = {
@ -414,6 +411,7 @@
}); });
onEvent("autodesk:complete:sprite", "#forgeViewer", function (e, obj) { onEvent("autodesk:complete:sprite", "#forgeViewer", function (e, obj) {
console.log("Current", obj.myDataList);
let option = floChart.getOption(); let option = floChart.getOption();
option.series.forEach(function (series) { option.series.forEach(function (series) {
@ -448,6 +446,8 @@
}); });
}); });
floChart.setOption(option); floChart.setOption(option);
subDevice();
}); });
//floChart.on('selectchanged', function (params) { //floChart.on('selectchanged', function (params) {
@ -565,11 +565,9 @@
? parseInt(data.value) ? parseInt(data.value)
: 0; : 0;
} }
if (data.point_name == "ONOFF" && pageAct.sysSubTag === "L1") { if (data.point_name == "ONOFF" && pageAct.sysSubTag === "L1") {
const lightOn = data.value.includes("true"); const lightOn = data.value.includes("true");
setLightOpenOrClose(lightOn, matchDevice.device_guid); setLightOpenOrClose(lightOn, matchDevice.device_guid);
// console.log("Forge 渲染",data.point_name,lightOn)
if (lightOn && matchDevice.spriteDbid) { if (lightOn && matchDevice.spriteDbid) {
// setLightValues(matchDevice.device_guid, 200, 0xe1cf18); // setLightValues(matchDevice.device_guid, 200, 0xe1cf18);
// changeColorForHotspot(matchDevice.spriteDbid, null, lightOn); // changeColorForHotspot(matchDevice.spriteDbid, null, lightOn);
@ -585,9 +583,6 @@
); );
heatMap?.changeTemp(matchDevice.device_number, 40); heatMap?.changeTemp(matchDevice.device_number, 40);
} else if (matchDevice.spriteDbid) { } else if (matchDevice.spriteDbid) {
// console.log(lightOn, matchDevice);
// setLightValues(matchDevice.device_guid, 0, 0xffffff);
// changeColorForHotspot(matchDevice.spriteDbid, null, lightOn);
if ( if (
!lightOffHotColorArr.some( !lightOffHotColorArr.some(
({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid ({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid
@ -601,7 +596,6 @@
heatMap?.changeTemp(matchDevice.device_number, 0); heatMap?.changeTemp(matchDevice.device_number, 0);
} }
} }
if ( if (
data.point_name == norDevPoiName && data.point_name == norDevPoiName &&
data.value == matchDevice.device_normal_point_value data.value == matchDevice.device_normal_point_value
@ -647,7 +641,6 @@
(device) => device.spriteDbid !== matchDevice.spriteDbid (device) => device.spriteDbid !== matchDevice.spriteDbid
); );
} }
setForgeHotSpotColor(matchDevice);
if ( if (
option.series[0].data.length === option.series[0].data.length ===
lightOnHotColorArr.length + lightOffHotColorArr.length lightOnHotColorArr.length + lightOffHotColorArr.length
@ -685,7 +678,6 @@
null, null,
false false
); );
$(loadEle).Loading("close"); $(loadEle).Loading("close");
} else if ( } else if (
deviceScatterCloseArr.length + deviceScatterCloseArr.length +
@ -726,6 +718,7 @@
}); });
floChart.setOption(option); floChart.setOption(option);
setForgeHotSpotColor(matchDevice);
$(loadEle).Loading("close"); $(loadEle).Loading("close");
} }
}); });

View File

@ -49,8 +49,8 @@ namespace FrontendWebApi.ApiControllers
TwoLeggedApi oauth = new TwoLeggedApi(); TwoLeggedApi oauth = new TwoLeggedApi();
string grantType = "client_credentials"; string grantType = "client_credentials";
dynamic bearer = await oauth.AuthenticateAsync( dynamic bearer = await oauth.AuthenticateAsync(
"VeGoOgZcAVCBkiThYvLRSVrCTH6TTwyh", "zO4ZGuyALhjrL5o81vA39Pkdgr82WAmq",
"Rl1KHJIAI8GSAfhK", "Bz5KyXqP6UqgGhxm",
grantType, grantType,
scopes); scopes);
return bearer; return bearer;

View File

@ -13,7 +13,7 @@ namespace FrontendWebApi.ApiControllers
{ {
private IWebHostEnvironment _env; private IWebHostEnvironment _env;
public OSSController(IWebHostEnvironment env) { _env = env; } public OSSController(IWebHostEnvironment env) { _env = env; }
string id = "VeGoOgZcAVCBkiThYvLRSVrCTH6TTwyh"; string id = "zO4ZGuyALhjrL5o81vA39Pkdgr82WAmq";
public string ClientId { get { return id.ToLower(); } } public string ClientId { get { return id.ToLower(); } }
/// <summary> /// <summary>

View File

@ -15,8 +15,8 @@
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation",
"FORGE_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth", "FORGE_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth",
"FORGE_CLIENT_ID": "VeGoOgZcAVCBkiThYvLRSVrCTH6TTwyh", "FORGE_CLIENT_ID": "zO4ZGuyALhjrL5o81vA39Pkdgr82WAmq",
"FORGE_CLIENT_SECRET": "Rl1KHJIAI8GSAfhK", "FORGE_CLIENT_SECRET": "Bz5KyXqP6UqgGhxm",
"ASPNETCORE_URLS": "http://localhost:5500" "ASPNETCORE_URLS": "http://localhost:5500"
}, },
"applicationUrl": "https://localhost:5001;http://localhost:5000" "applicationUrl": "https://localhost:5001;http://localhost:5000"