三维场景切换

This commit is contained in:
luoshiwen 2023-04-14 14:26:08 +08:00
parent cb7869b4dc
commit 17c8898a13
19 changed files with 205 additions and 189 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en-us"> <html lang="en-us">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@ -18,7 +17,6 @@
overflow: hidden; overflow: hidden;
} }
</style> </style>
<body> <body>
<div id="unity-container" style="width: 100%;height:100%" class="unity-desktop"> <div id="unity-container" style="width: 100%;height:100%" class="unity-desktop">
<canvas id="unity-canvas" style="width: 100%;height:100%"></canvas> <canvas id="unity-canvas" style="width: 100%;height:100%"></canvas>
@ -68,11 +66,11 @@
} }
var buildUrl = "Build"; var buildUrl = "Build";
var loaderUrl = buildUrl + "/WebglQidong.loader.js"; var loaderUrl = buildUrl + "/启东南苑路仓库.loader.js";
var config = { var config = {
dataUrl: buildUrl + "/WebglQidong.data.unityweb", dataUrl: buildUrl + "/启东南苑路仓库.data.unityweb",
frameworkUrl: buildUrl + "/WebglQidong.framework.js.unityweb", frameworkUrl: buildUrl + "/启东南苑路仓库.framework.js.unityweb",
codeUrl: buildUrl + "/WebglQidong.wasm.unityweb", codeUrl: buildUrl + "/启东南苑路仓库.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets", streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany", companyName: "DefaultCompany",
productName: "ElectricPowerStorage_Digital Twin", productName: "ElectricPowerStorage_Digital Twin",
@ -120,8 +118,8 @@
createUnityInstance(canvas, config, (progress) => { createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%"; progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => { }).then((unityInstance) => {
loadingBar.style.display = "none";
unityInstanceA = unityInstance unityInstanceA = unityInstance
loadingBar.style.display = "none";
fullscreenButton.onclick = () => { fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1); unityInstance.SetFullscreen(1);
}; };
@ -175,5 +173,4 @@
} }
</script> </script>
</body> </body>
</html> </html>

3
public/config.js Normal file
View File

@ -0,0 +1,3 @@
const config = {
VUE_APP_API_BASE_URL: 'http://20.47.106.51:30005/gwcpedge/',
}

View File

@ -5,7 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>启东南苑路数字孪生仓库</title> <title>启东南苑路仓库</title>
<script src="./config.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>

View File

@ -7,10 +7,10 @@
</div> </div>
<!-- 头部 --> <!-- 头部 -->
<header class="nav"> <header class="nav">
<div class="wether"> <!-- <div class="wether">
<img src="@/assets/images/cloudy.png" alt="" /> <img src="@/assets/images/cloudy.png" alt="" />
<span class="tianqi">多云</span> <span class="tianqi">多云</span>
</div> </div> -->
<el-select v-model="value" placeholder="请选择"> <el-select v-model="value" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" > <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" >
</el-option> </el-option>
@ -21,8 +21,8 @@
<ul> <ul>
<li v-for="(s, i) in liImgs" class="nav-li" :key="i" @click="handleBtn($event, i)"> <li v-for="(s, i) in liImgs" class="nav-li" :key="i" @click="handleBtn($event, i)">
<el-dropdown trigger="click" placement="bottom" v-if="i == 0" :hide-on-click="false" ref="drop1"> <el-dropdown trigger="click" placement="bottom" v-if="i == 0" :hide-on-click="false" ref="drop1" @visible-change="visibleChange1">
<span class="downPull"><img :src="i==index ? s.selectImg : s.img" alt="" /></span> <span class="downPull"><img :src="drop1 ? s.selectImg : s.img" alt="" /></span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<ul class="menuContent"> <ul class="menuContent">
<!-- <li v-for="(num, index) in 15" :key="index" @click="shelfHanlder($event)">LD1_B01-{{ num < 10 ? "0" + num <!-- <li v-for="(num, index) in 15" :key="index" @click="shelfHanlder($event)">LD1_B01-{{ num < 10 ? "0" + num
@ -40,8 +40,8 @@
</el-dropdown> </el-dropdown>
<el-dropdown trigger="click" placement="bottom" v-else-if="i == 2" :hide-on-click="true" <el-dropdown trigger="click" placement="bottom" v-else-if="i == 2" :hide-on-click="true"
> @visible-change="visibleChange2">
<span class="downPull"><img :src="i==index ? s.selectImg : s.img" alt="" /></span> <span class="downPull"><img :src="drop2 ? s.selectImg : s.img" alt="" /></span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<ul class="menuContent"> <ul class="menuContent">
<!-- <li @click="selectHomeN($event)">B01</li> <!-- <li @click="selectHomeN($event)">B01</li>
@ -64,11 +64,11 @@
</ul> </ul>
</header> </header>
<!-- 右侧边栏 --> <!-- 右侧边栏 -->
<aside class="right-aside"> <!-- <aside class="right-aside">
<span v-for="(s, i) in heatList" :class="`span${i}`" :key="i"> <span v-for="(s, i) in heatList" :class="`span${i}`" :key="i">
{{ s }} {{ s }}
</span> </span>
</aside> </aside> -->
<router-view /> <router-view />
</div> </div>
</template> </template>
@ -116,11 +116,15 @@ export default {
navLiState: false, navLiState: false,
loadShow:true, loadShow:true,
drop1:false,
drop2:false
}; };
}, },
created() { created() {
this.$nextTick(() => { this.$nextTick(() => {
// getVisualStorageList({ wareHouseCode: "HA1" }).then((res) => { // getVisualStorageList({ wareHouseCode: "FF1" }).then((res) => {
// console.log(res, "shuju"); // console.log(res, "shuju");
// }); // });
}); });
@ -133,9 +137,16 @@ export default {
// this.load() // this.load()
}, },
methods: { methods: {
//
visibleChange1(bool) {
this.drop1 = bool;
},
visibleChange2(bool) {
this.drop2 = bool;
},
// unity // unity
searchHouse(){ searchHouse(){
console.log(1111); // console.log(1111);
if (this.value == "仓位号") { if (this.value == "仓位号") {
this.$refs.dome.contentWindow.wareHouse(this.input3) this.$refs.dome.contentWindow.wareHouse(this.input3)
} else if (this.value == "物料编码") { } else if (this.value == "物料编码") {

View File

@ -1,59 +1,62 @@
// 测试请求是否能跨域 // 测试请求是否能跨域
// export const getWather = (params) => { // export const getWather = (params) => {
// return axios.get('api/Handler/Weather.ashx', { // return axios.get('Handler/Weather.ashx', {
// params // params
// }) // })
// }; // };
import axios from 'axios' import axios from 'axios'
// axios.defaults.baseURL = 'http://20.47.106.51:30005/gwcpedge/'
axios.defaults.baseURL = config.VUE_APP_API_BASE_URL
export const getVisualStorageList = (params) => { export const getVisualStorageList = (params) => {
return axios.get('api/visualStorage/getVisualStorageList', { return axios.get('visualStorage/getVisualStorageList', {
params params
}) })
} }
// 获取仓位得接口 // 获取仓位得接口
export const byPosition = (params) => { export const byPosition = (params) => {
return axios.get('api/visualStorage/getVisualStorageListByPosition', { return axios.get('visualStorage/getVisualStorageListByPosition', {
params params
}) })
} }
// 获取物料和批次 // 获取物料和批次
export const byBatchAndMateri = (params) => { export const byBatchAndMateri = (params) => {
return axios.get('api/visualStorage/getVisualStorageListByBatchAndMateriel', { return axios.get('visualStorage/getVisualStorageListByBatchAndMateriel', {
params params
}) })
} }
// 仓库使用率 // 仓库使用率
export const getWarehouseUsages = (params) => { export const getWarehouseUsages = (params) => {
return axios.get('api/visualStorage/getWarehouseUsages', { return axios.get('visualStorage/getWarehouseUsages', {
params params
}) })
} }
// 每月的周转率 // 每月的周转率
export const getTurnoverRate = (params) => { export const getTurnoverRate = (params) => {
return axios.get('api/visualStorage/getTurnoverRateList', { return axios.get('visualStorage/getTurnoverRateList', {
params params
}) })
} }
// 当月出入库金额 // 当月出入库金额
export const getChangeAmount = (params) => { export const getChangeAmount = (params) => {
return axios.get('api/visualStorage/getChangeAmount', { return axios.get('visualStorage/getChangeAmount', {
params params
}) })
} }
// 积压物质 // 积压物质
export const getBacklogMaterialInfo = (params) => { export const getBacklogMaterialInfo = (params) => {
return axios.get('api/visualStorage/getBacklogMaterialInfo', { return axios.get('visualStorage/getBacklogMaterialInfo', {
params params
}) })
} }
// 库龄结构 // 库龄结构
export const getInventoryAgeInfo = (params) => { export const getInventoryAgeInfo = (params) => {
return axios.get('api/visualStorage/getInventoryAgeInfo', { return axios.get('visualStorage/getInventoryAgeInfo', {
params params
}) })
} }
@ -61,14 +64,14 @@ export const getInventoryAgeInfo = (params) => {
// 库存构成 // 库存构成
export const getStore = (params) => { export const getStore = (params) => {
return axios.get('api/visualStorage/getInventoryConstitute', { return axios.get('visualStorage/getInventoryConstitute', {
params params
}) })
} }
// 库容预测 // 库容预测
export const getMaterialDataList = (params) => { export const getMaterialDataList = (params) => {
return axios.get('api/visualStorage/getMaterialDataList', { return axios.get('visualStorage/getMaterialDataList', {
params params
}) })
} }

View File

@ -64,22 +64,24 @@ export default {
}, },
created() { created() {
// 使 // 使
// getWarehouseUsages({wareHouseCode:'HA1'}).then(res=>{ getWarehouseUsages({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,'使'); console.log(res,'仓库使用率');
// this.storeData = res.data.data this.storeData = res.data.data
// this.drawStore(this.storeData) this.drawStore(this.storeData)
// // console.log(this.storeData,'......'); // console.log(this.storeData,'......');
// }) })
// getTurnoverRate({wareHouseCode:'HA1'}).then(res=>{ //
// console.log(res,''); getTurnoverRate({wareHouseCode:'FF1'}).then(res=>{
// this.drawTurnoverChart(res.data.data.rateList) console.log(res,'每月的周转率');
// }) this.drawTurnoverChart(res.data.data.rateList)
// getBacklogMaterialInfo({wareHouseCode:'HA1'}).then(res=>{ })
// console.log(res,'');
// this.drawOverStock(res.data.data)
// })
// },
// //
getBacklogMaterialInfo({wareHouseCode:'FF1'}).then(res=>{
console.log(res,'积压物资');
this.drawOverStock(res.data.data)
})
}, },
methods: { methods: {
// 使ecahrt // 使ecahrt
@ -161,7 +163,7 @@ export default {
icon: "circle", icon: "circle",
itemWidth: 4, itemWidth: 4,
itemHeight: 6, //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none' itemHeight: 6, //'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
left: '65%', left: '60%',
top: tops1[i], top: tops1[i],
// width:'1000', // width:'1000',
backgroundColor: colorList[i], backgroundColor: colorList[i],

View File

@ -78,14 +78,14 @@ export default {
created() { created() {
// //
// getStore({wareHouseCode:'HA1'}).then(res=>{ getStore({wareHouseCode:'FF1'}).then(res=>{
// // console.log(res,''); // console.log(res,'');
// if(res.data.code==200){ if(res.data.code==200){
// // console.log(res.data.data,'kulin'); // console.log(res.data.data,'kulin');
// this.ulList = res.data.data.infoList this.ulList = res.data.data.infoList
// // console.log(this.ulList); // console.log(this.ulList);
// } }
// }) })
}, },
computed: { computed: {

View File

@ -101,23 +101,23 @@ export default {
this.view = "OverView"; this.view = "OverView";
// },2000) // },2000)
// //
// byPosition({ wareHouseCode: "HA1", position: "B01-010102" }).then((res) => { byPosition({ wareHouseCode: "FF1", position: "B01-010102" }).then((res) => {
// console.log(res, ""); console.log(res, "仓位号");
// }); });
// // //
// byBatchAndMateri({ batch:"2021093009",wareHouseCode:'HA1' }).then((res) => { byBatchAndMateri({ batch:"2021093009",wareHouseCode:'FF1' }).then((res) => {
// console.log(res,''); console.log(res,'物料批次');
// }); });
// // 使 // // 使
// getWarehouseUsages({wareHouseCode:'HA1'}).then(res=>{ // getWarehouseUsages({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,'使'); // console.log(res,'使');
// }) // })
// //
// getTurnoverRate({wareHouseCode:'HA1'}).then(res=>{ // getTurnoverRate({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,''); // console.log(res,'');
// }) // })
// //
// getChangeAmount({wareHouseCode:'HA1'}).then(res=>{ // getChangeAmount({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,''); // console.log(res,'');
// }) // })
// //
@ -125,19 +125,19 @@ export default {
// //
// getInventoryAgeInfo({wareHouseCode:'HA1'}).then(res=>{ getInventoryAgeInfo({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,''); console.log(res,'库龄结构');
// }) })
// //
// getStore({wareHouseCode:'HA1'}).then(res=>{ getStore({wareHouseCode:'FF1'}).then(res=>{
// console.log(res,''); console.log(res,'库存结构');
// }) })
// //
// getMaterialDataList({method:'getYckc',LGUNM:"HA1",NY:"202304"}).then(res=>{ getMaterialDataList({method:'getYckc',LGUNM:"FF1",NY:"202304"}).then(res=>{
// console.log(res,''); console.log(res,'库容预测');
// }) })
}, },
created() {}, created() {},
computed: {}, computed: {},

View File

@ -4,7 +4,7 @@
// }) // })
module.exports = { module.exports = {
// 打包文件配置 // 打包文件配置
publicPath: "/", publicPath: "./",
assetsDir: "static", assetsDir: "static",
lintOnSave: false, lintOnSave: false,
devServer: { devServer: {