diff --git a/public/config.json b/public/config.json new file mode 100644 index 0000000..65d0c7c --- /dev/null +++ b/public/config.json @@ -0,0 +1,44 @@ +{ + "heatmap": { + "temp": { + "range": [0, 50], + "color": ["#0023F5", "#FF1C05"], + "unit": "°C" + }, + "humi": { + "range": [15, 95], + "color": ["#ADD8E6", "#00008B"], + "unit": "%" + }, + "CO2": { + "range": [0, 5000], + "color": ["#FFDAB9", "#FF8C00"], + "unit": "ppm" + }, + "CO": { + "range": [0, 1000], + "color": ["#FFFFE0", "#FFD700"], + "unit": "ppm" + }, + "CH2O": { + "range": [0, 100], + "color": ["#90EE90", "#006400"], + "unit": "ppb" + }, + "PM1": { + "range": [0, 20], + "color": ["#E6E6FA", "#800080"], + "unit": "µg/m³" + }, + "PM2.5": { + "range": [0, 55], + "color": ["#FFB6C1", "#FF0000"], + "unit": "µg/m³" + }, + "PM10": { + "range": [0, 150], + "color": ["#FFDDC1", "#FF1493"], + "unit": "µg/m³" + } + } +} diff --git a/src/components/forge/ForgeForSystem.vue b/src/components/forge/ForgeForSystem.vue index 3e111b8..9181cd2 100644 --- a/src/components/forge/ForgeForSystem.vue +++ b/src/components/forge/ForgeForSystem.vue @@ -16,6 +16,7 @@ import useSystemStatusByBaja from "@/hooks/baja/useSystemStatusByBaja"; import ForgeInfoModal from "../../views/system/components/SystemInfoModal.vue"; import useAlarmStore from "@/stores/useAlarmStore"; import useForgeSprite from "@/hooks/forge/useForgeSprite"; +import useHeatmapBarStore from "@/stores/useHeatmapBarStore"; const props = defineProps({ initialData: Object, @@ -27,13 +28,9 @@ const props = defineProps({ }, }, }); +const store = useHeatmapBarStore(); -const heat_bar_isShow = ref(false); -const updateHeatBarIsShow = (isShow) => { - heat_bar_isShow.value = isShow; -}; - -const { updateDataVisualization, createSprites, hideAllObjects, forgeClickListener, clear } = useForgeSprite() +const { updateDataVisualization, createSprites, showSubSystemObjects, forgeClickListener, clear } = useForgeSprite() const forgeDom = ref(null); @@ -92,9 +89,10 @@ const loadModel = (viewer, filePath) => { }); }; -// const loadModel = (viewer, urn) => { +// const loadModel = (viewer) => { // return new Promise(function (resolve, reject) { // async function onDocumentLoadSuccess(doc) { +// console.log("模型加載完成"); // viewer.setGroundShadow(false); // viewer.impl.renderer().setClearAlpha(0); //clear alpha channel // viewer.impl.glrenderer().setClearColor(0xffffff, 0); //set transparent background, color code does not matter @@ -163,7 +161,7 @@ const initForge = async () => { viewer.isLoadDone() ); - hideAllObjects(); + showSubSystemObjects(); createSprites(); forgeClickListener(); }) @@ -201,22 +199,18 @@ onUnmounted(() => {