diff --git a/.env.production b/.env.production index db3fc25..77301b6 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ -VITE_API_BASEURL = "https://pccv-api.production.mjmtech.com.tw" +VITE_API_BASEURL = "http://192.168.1.10:8010" VITE_FILE_API_BASEURL = ".." VITE_FORGE_BASEURL = "http://202.39.218.221:8080/file/netzero" \ No newline at end of file diff --git a/.env.staging b/.env.staging index 3a51cfe..db3fc25 100644 --- a/.env.staging +++ b/.env.staging @@ -1,3 +1,3 @@ -VITE_API_BASEURL = "http://220.132.206.5:8008" -VITE_FILE_API_BASEURL = "http://220.132.206.5:8085/file" -VITE_FORGE_BASEURL = "http://localhost:5173" \ No newline at end of file +VITE_API_BASEURL = "https://pccv-api.production.mjmtech.com.tw" +VITE_FILE_API_BASEURL = ".." +VITE_FORGE_BASEURL = "http://202.39.218.221:8080/file/netzero" \ No newline at end of file diff --git a/package.json b/package.json index f262e17..1a9a590 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vite", "build": "vite build", - "preview": "vite preview" + "preview": "vite preview", + "stage": "vite build --mode staging" }, "dependencies": { "@ant-design/icons-vue": "^7.0.1", diff --git a/public/arrow.png b/public/arrow.png new file mode 100644 index 0000000..61f30af Binary files /dev/null and b/public/arrow.png differ diff --git a/public/forge.zip b/public/forge.zip new file mode 100644 index 0000000..81bb0e3 Binary files /dev/null and b/public/forge.zip differ diff --git a/public/spot.svg b/public/spot.svg new file mode 100644 index 0000000..3d53f64 --- /dev/null +++ b/public/spot.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/apis/dashboard/api.js b/src/apis/dashboard/api.js index b7a5f6b..bf8fe03 100644 --- a/src/apis/dashboard/api.js +++ b/src/apis/dashboard/api.js @@ -1,5 +1,6 @@ export const GET_DASHBOARD_INIT_API = `/SituationRoom/Initialize`; export const GET_DASHBOARD_DEVICE_API = `/SituationRoom/GetDeviceList`; +export const GET_DASHBOARD_REALTIME_DATA_API = `SituationRoom/GetOptionRealTimeData`; export const GET_DASHBOARD_PRODUCT_COMPLETE_API = `/SituationRoom/GetProductionStatus`; export const GET_DASHBOARD_TEMP_API = `/SituationRoom/GetTempratureData`; export const GET_DASHBOARD_ROOM_TEMP_API = `/SituationRoom/GetFormulaRoomStatusData`; diff --git a/src/apis/dashboard/index.js b/src/apis/dashboard/index.js index 1f64f20..f520e96 100644 --- a/src/apis/dashboard/index.js +++ b/src/apis/dashboard/index.js @@ -1,6 +1,7 @@ import { GET_DASHBOARD_INIT_API, GET_DASHBOARD_DEVICE_API, + GET_DASHBOARD_REALTIME_DATA_API, GET_DASHBOARD_PRODUCT_COMPLETE_API, GET_DASHBOARD_TEMP_API, GET_DASHBOARD_ROOM_TEMP_API, @@ -34,6 +35,17 @@ export const getDashboardDevice = async ({ option }) => { }); }; +export const getDashboardOptionRealTimeData = async ({ option }) => { + const res = await instance.post( GET_DASHBOARD_REALTIME_DATA_API, { + option: parseInt(option), + }); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + export const getDashboardProductCompletion = async () => { const res = await instance.post(GET_DASHBOARD_PRODUCT_COMPLETE_API); diff --git a/src/apis/productSetting/api.js b/src/apis/productSetting/api.js index d19a40d..447190b 100644 --- a/src/apis/productSetting/api.js +++ b/src/apis/productSetting/api.js @@ -1,4 +1,4 @@ -export const POST_SETTING_POINT_API = `/SituationRoom/SetPointSetting`; +export const POST_CHANGE_GROUP_VALUE_API = `api/Weight/ChangeGroupValue`; -export const GET_SETTING_TYPE_API = `/SituationRoom/GetProducts`; +export const GET_CHECKWEIGHER_API = `/api/HistoryData/GetCheckWeigherNow`; export const POST_SETTING_TYPE_API = `/SituationRoom/SetProduct`; diff --git a/src/apis/productSetting/index.js b/src/apis/productSetting/index.js index 1ed4d46..5dc7270 100644 --- a/src/apis/productSetting/index.js +++ b/src/apis/productSetting/index.js @@ -1,21 +1,13 @@ import instance from "@/util/request"; import apihandler from "@/util/apihandler"; import { - POST_SETTING_POINT_API, - GET_SETTING_TYPE_API, + POST_CHANGE_GROUP_VALUE_API, + GET_CHECKWEIGHER_API, POST_SETTING_TYPE_API, } from "./api"; -export const postProductSettingPoint = async (type, devices) => { - const res = await instance.post(POST_SETTING_POINT_API, { - devices: devices.map(({ device_number }) => device_number), - values: [ - { - point: "Type", - value: type.value, - }, - ], - }); +export const postChangeGroupValue = async (data) => { + const res = await instance.post(POST_CHANGE_GROUP_VALUE_API,data); return apihandler(res.code, res.data, { msg: res.msg, @@ -24,8 +16,8 @@ export const postProductSettingPoint = async (type, devices) => { }); }; -export const getProductSettingType = async () => { - const res = await instance.post(GET_SETTING_TYPE_API); +export const getCheckWeigher = async () => { + const res = await instance.get(GET_CHECKWEIGHER_API); return apihandler(res.code, res.data, { msg: res.msg, diff --git a/src/components/forge/Forge.vue b/src/components/forge/Forge.vue index aae421f..45d5310 100644 --- a/src/components/forge/Forge.vue +++ b/src/components/forge/Forge.vue @@ -20,13 +20,7 @@ const { forgeLock } = inject("app_toggle"); const props = defineProps({ fullScreen: Boolean, initialData: Object, - cubeStyle: { - type: Object, - default: { - right: 25, - top: 2, - }, - }, + realTime: String, }); const heat_bar_isShow = ref(false); @@ -45,6 +39,7 @@ const { loadModel, updateInitialData, subComponents, + clearSprites } = useSystemStatusByBaja(updateHeatBarIsShow); watch( @@ -99,7 +94,8 @@ const initViewer = (container) => { const initForge = () => { initViewer(forgeDom.value).then((viewer) => { const localFilePath = - import.meta.env.MODE === "production" + import.meta.env.MODE === "production" || + import.meta.env.MODE === "staging" ? `${FILE_BASEURL}/upload/forge/0.svf` : "/forge/0.svf"; loadModel(viewer, localFilePath).then(() => { @@ -112,13 +108,13 @@ const initForge = () => { ); updateForgeViewer(viewer); - const tree = viewer.model.getData().instanceTree; - hideAllObjects(tree, visibleDbid.value); - visibleDbid.value.forEach((dbid) => { - if (dbid === 58) { - viewer.setThemingColor(dbid, new THREE.Vector4(1, 0, 0, 1)); - } - }); + // const tree = viewer.model.getData().instanceTree; + // hideAllObjects(tree, visibleDbid.value); + // visibleDbid.value.forEach((dbid) => { + // if (dbid === 58) { + // viewer.setThemingColor(dbid, new THREE.Vector4(1, 0, 0, 1)); + // } + // }); // 印出被點選物件的 dbid // viewer.addEventListener( // Autodesk.Viewing.SELECTION_CHANGED_EVENT, @@ -179,6 +175,7 @@ onUnmounted(() => { subComponents.value?.unsubscribeAll(); subComponents.value?.detach(); updateForgeViewer(null); + clearSprites(); NOP_VIEWER.tearDown(); }); @@ -199,11 +196,12 @@ onUnmounted(() => { ref="forgeDom" :class=" twMerge( - 'relative w-full h-full', + 'relative w-full h-full overflow-x-hidden', fullScreen ? 'min-h-screen ' : 'min-h-[600px]' ) " > +

更新時間 : {{ props.realTime }}

-20°C @@ -225,7 +223,7 @@ onUnmounted(() => { >
- + --> @@ -271,16 +269,16 @@ onUnmounted(() => { } .viewcubeWrapper { - right: v-bind("`${props.cubeStyle.right}%`") !important; - top: v-bind("`${props.cubeStyle.top}%`") !important; + right: 25% !important; + top: 0% !important; } .homeViewWrapper { - transform: scale(1.5) !important; + transform: scale(1.5) translateX(350%) translateY(0%) !important; } .heatbar { - right: v-bind("`${props.cubeStyle.right + 2}%`") !important; - top: 0% !important; + left: 27% !important; + top: 9% !important; } diff --git a/src/components/navbar/Navbar.vue b/src/components/navbar/Navbar.vue index e91a828..296b7ac 100644 --- a/src/components/navbar/Navbar.vue +++ b/src/components/navbar/Navbar.vue @@ -43,9 +43,9 @@ onMounted(() => { - +
logo百家珍 - +