代码提交

This commit is contained in:
luoshiwen 2025-06-04 11:25:09 +08:00
parent 54a967b8b9
commit bb61d5f03b
33 changed files with 650 additions and 469 deletions

BIN
dist.zip Normal file

Binary file not shown.

BIN
dist1.zip Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
172.16.1.106:5005
172.16.1.117:5005

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,123 +1,120 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | U3D_TobaccoWarehouseISMDTSystem</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
</head>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%;">
<canvas id="unity-canvas" style="width: 100%;height: 100%;" tabindex="-1"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | U3D_TobaccoWarehouseISMDTSystem</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
</head>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%;">
<canvas id="unity-canvas" style="width: 100%;height: 100%;" tabindex="-1"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-warning"> </div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">U3D_TobaccoWarehouseISMDTSystem</div>
</div>
</div>
<div id="unity-warning"> </div>
<!-- <div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">U3D_TobaccoWarehouseISMDTSystem</div>
</div> -->
</div>
<script>
<script>
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
function updateBannerVisibility() {
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
var unity
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
function updateBannerVisibility() {
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
}
var div = document.createElement('div');
div.innerHTML = msg;
warningBanner.appendChild(div);
if (type == 'error') div.style = 'background: red; padding: 10px;';
else {
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function() {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
}
updateBannerVisibility();
}
var div = document.createElement('div');
div.innerHTML = msg;
warningBanner.appendChild(div);
if (type == 'error') div.style = 'background: red; padding: 10px;';
else {
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function () {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
var buildUrl = "Build";
var loaderUrl = buildUrl + "/爆炸图.loader.js";
var config = {
dataUrl: buildUrl + "/爆炸图.data.unityweb",
frameworkUrl: buildUrl + "/爆炸图.framework.js.unityweb",
codeUrl: buildUrl + "/爆炸图.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "U3D_TobaccoWarehouseISMDTSystem",
productVersion: "0.1",
showBanner: unityShowBanner,
};
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
container.className = "unity-mobile";
canvas.className = "unity-mobile";
// To lower canvas resolution on mobile devices to gain some
// performance, uncomment the following line:
// config.devicePixelRatio = 1;
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
// canvas.style.width = "960px";
// canvas.style.height = "600px";
}
updateBannerVisibility();
}
var buildUrl = "Build";
var loaderUrl = buildUrl + "/爆炸图.loader.js";
var config = {
dataUrl: buildUrl + "/爆炸图.data.unityweb",
frameworkUrl: buildUrl + "/爆炸图.framework.js.unityweb",
codeUrl: buildUrl + "/爆炸图.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "U3D_TobaccoWarehouseISMDTSystem",
productVersion: "0.1",
showBanner: unityShowBanner,
};
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
container.className = "unity-mobile";
canvas.className = "unity-mobile";
// To lower canvas resolution on mobile devices to gain some
// performance, uncomment the following line:
// config.devicePixelRatio = 1;
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
canvas.style.width = "100%";
canvas.style.height = "100%";
}
// loadingBar.style.display = "block";
var unity
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
unity = unityInstance
// loadingBar.style.display = "none";
// fullscreenButton.onclick = () => {
// unityInstance.SetFullscreen(1);
// };
}).catch((message) => {
alert(message);
});
};
//切换小车
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
window.unity = unityInstance
loadingBar.style.display = "none";
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
//切换小车
function changeShuttlebus(data) {
unity.SendMessage('GameObject', 'Shuttlebus', data)
}
@ -159,9 +156,9 @@
function modelStatus(val) {
window.parent.modelStatus(val)
}
document.body.appendChild(script);
</script>
</body>
document.body.appendChild(script);
</html>
</script>
</body>
</html>

View File

@ -104,7 +104,7 @@
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
// progressBarFull.style.width = 100 * progress + "%";
// progressBarFull.style.width = 100 * progress + "%";
// window.parent.getProgress(progress);
}).then((unityInstance) => {
unity = unityInstance
@ -116,22 +116,48 @@
alert(message);
});
};
//切换模型
function changeModel(data){
unity.SendMessage('Controller','Displaymodel',data)
}
function open(){
unity.SendMessage('提升机','Unfold')
}
function close(){
unity.SendMessage('提升机','Restore')
}
function opencar(){
unity.SendMessage('AGV','Unfold')
}
function closecar(){
unity.SendMessage('AGV','Restore')
}
//切换小车
function changeShuttlebus(data) {
unity.SendMessage('GameObject', 'Shuttlebus', data)
}
//提升机1
function changeHoister(data) {
unity.SendMessage('GameObject', 'Hoister', data)
}
//提升机2
function changeHoister2(data) {
unity.SendMessage('GameObject', 'Hoister2', data)
}
//快换电池
function changeBattery(data) {
unity.SendMessage('GameObject', 'Battery', data)
}
// function open() {
// unity.SendMessage('GameObject', 'Unfold')
// }
// function close() {
// unity.SendMessage('提升机', 'Restore')
// }
//大模型爆炸
function opencar() {
unity.SendMessage('GameObject', 'Explode')
}
//大模型还原
function closecar() {
unity.SendMessage('GameObject', 'ResetPositions')
}
//小模型爆炸
function openSmall() {
unity.SendMessage('GameObject', 'Blowup')
}
//小模型还原
function closeSmall() {
unity.SendMessage('GameObject', 'Restore')
}
//接收状态
function modelStatus(val) {
window.parent.modelStatus(val)
}
document.body.appendChild(script);
</script>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" />
<mimeMap fileExtension=".unityweb" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>

View File

@ -1 +1 @@
172.16.1.106:5005
172.16.1.117:5005

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@ -16,218 +15,219 @@
overflow: hidden;
}
</style>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height:100%">
<canvas id="unity-canvas" style="width: 100%;height:100%" tabindex="-1"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-warning"></div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">U3D_TobaccoWarehouseISMDTSystem</div>
<div id="unity-container" class="unity-desktop" style="width: 100%;height:100%">
<canvas id="unity-canvas" style="width: 100%;height:100%" tabindex="-1"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-warning"></div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">U3D_TobaccoWarehouseISMDTSystem</div>
</div>
</div>
<button onclick="OpenHtmlMQTT()">Connect</button>
<button onclick="publishMessage()">Publish</button>
<button onclick="disconnectMQTT()">Disconnect</button>
<script src="./js/mqtt.min.js"></script>
<button onclick="OpenHtmlMQTT()">Connect</button>
<button onclick="publishMessage()">Publish</button>
<button onclick="disconnectMQTT()">Disconnect</button>
<script src="./js/mqtt.min.js"></script>
<script>
<script>
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
var warningBanner = document.querySelector("#unity-warning");
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
function updateBannerVisibility() {
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
}
var div = document.createElement('div');
div.innerHTML = msg;
warningBanner.appendChild(div);
if (type == 'error') div.style = 'background: red; padding: 10px;';
else {
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function () {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
}
updateBannerVisibility();
// Shows a temporary message banner/ribbon for a few seconds, or
// a permanent error message on top of the canvas if type=='error'.
// If type=='warning', a yellow highlight color is used.
// Modify or remove this function to customize the visually presented
// way that non-critical warnings and error messages are presented to the
// user.
function unityShowBanner(msg, type) {
function updateBannerVisibility() {
warningBanner.style.display = warningBanner.children.length ? 'block' : 'none';
}
var buildUrl = "Build";
var loaderUrl = buildUrl + "/webgl.loader.js";
var config = {
dataUrl: buildUrl + "/webgl.data.unityweb",
frameworkUrl: buildUrl + "/webgl.framework.js.unityweb",
codeUrl: buildUrl + "/webgl.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "U3D_TobaccoWarehouseISMDTSystem",
productVersion: "0.1",
showBanner: unityShowBanner,
};
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
container.className = "unity-mobile";
canvas.className = "unity-mobile";
// To lower canvas resolution on mobile devices to gain some
// performance, uncomment the following line:
// config.devicePixelRatio = 1;
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
// canvas.style.width = "960px";
// canvas.style.height = "600px";
var div = document.createElement('div');
div.innerHTML = msg;
warningBanner.appendChild(div);
if (type == 'error') div.style = 'background: red; padding: 10px;';
else {
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
setTimeout(function () {
warningBanner.removeChild(div);
updateBannerVisibility();
}, 5000);
}
updateBannerVisibility();
}
var buildUrl = "Build";
var loaderUrl = buildUrl + "/webgl.loader.js";
var config = {
dataUrl: buildUrl + "/webgl.data.unityweb",
frameworkUrl: buildUrl + "/webgl.framework.js.unityweb",
codeUrl: buildUrl + "/webgl.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "U3D_TobaccoWarehouseISMDTSystem",
productVersion: "0.1",
showBanner: unityShowBanner,
};
// By default, Unity keeps WebGL canvas render target size matched with
// the DOM size of the canvas element (scaled by window.devicePixelRatio)
// Set this to false if you want to decouple this synchronization from
// happening inside the engine, and you would instead like to size up
// the canvas DOM size and WebGL render target sizes yourself.
// config.matchWebGLToCanvasSize = false;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
container.className = "unity-mobile";
canvas.className = "unity-mobile";
// To lower canvas resolution on mobile devices to gain some
// performance, uncomment the following line:
// config.devicePixelRatio = 1;
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
let client;
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
function OpenHtmlMQTT() {
client = mqtt.connect('ws://10.155.161.49:8083/mqtt');
// canvas.style.width = "960px";
// canvas.style.height = "600px";
}
client.on('connect', () => {
console.log('连接...');
const devices = [
"cm1",//去加盖机
Array.from({ length: 7 }, (_, i) => `elv${i + 1}`),//提升机
Array.from({ length: 7 }, (_, i) => `convoyor510${i + 1}`),//输送机
Array.from({ length: 51 }, (_, i) => `convoyor52${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({ length: 30 }, (_, i) => `convoyor54${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({ length: 4 }, (_, i) => `dpm${i + 1}`),//拆码垛机
Array.from({ length: 2 }, (_, i) => `fxj${i + 1}`),////机械手臂
Array.from({ length: 8 }, (_, i) => `car${i + 1}`),//小车
"fe1",//落地时提升机
Array.from({ length: 2 }, (_, i) => `qcbd${i + 1}`)//快换电池装置
];
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
let client;
devices.forEach(device => {
console.log(device);
client.subscribe(device, {
onSuccess: () => {
console.log(`已订阅: ${device}`);
},
onFailure: (err) => {
console.error(`订阅失败: ${device}:`, err);
}
});
function OpenHtmlMQTT() {
client = mqtt.connect('ws://10.155.161.49:8083/mqtt');
client.on('connect', () => {
console.log('连接...');
const devices = [
"cm1",//去加盖机
Array.from({length: 7}, (_, i) => `elv${i + 1}`),//提升机
Array.from({length: 7}, (_, i) => `convoyor510${i + 1}`),//输送机
Array.from({length: 51}, (_, i) => `convoyor52${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({length: 30}, (_, i) => `convoyor54${String(i + 1).padStart(2, '0')}`),//输送机
Array.from({ length: 4 }, (_, i) => `dpm${i + 1}`),//拆码垛机
Array.from({ length: 2 }, (_, i) => `fxj${i + 1}`),////机械手臂
Array.from({length: 8}, (_, i) => `car${i + 1}`),//小车
"fe1",//落地时提升机
Array.from({length: 2}, (_, i) => `qcbd${i + 1}`)//快换电池装置
];
devices.forEach(device => {
console.log(device);
client.subscribe(device, {
onSuccess: () => {
console.log(`已订阅: ${device}`);
},
onFailure: (err) => {
console.error(`订阅失败: ${device}:`, err);
}
});
// client.subscribe('car1', (err) => {
// if (!err) {
// console.log('Subscribed to car1');
// }
// });
//
});
client.on('message', (topic, message) => {
const mes = JSON.stringify({ device: topic, message: message.toString() });
// client.subscribe('car1', (err) => {
// if (!err) {
// console.log('Subscribed to car1');
// }
// });
//
// console.log(mes);
});
unityInstance.SendMessage('APP', 'Message', mes)
client.on('message', (topic, message) => {
});
const mes = JSON.stringify({device: topic, message: message.toString()});
client.on('error', (err) => {
console.error('Connection error: ', err);
// console.log(mes);
unityInstance.SendMessage('APP', 'Message', mes)
});
client.on('error', (err) => {
console.error('Connection error: ', err);
});
}
function publishMessage() {
if (client) {
client.publish('car1', 'Hello');
}
}
function disconnectMQTT() {
if (client) {
client.end(() => {
console.log('关闭连接');
});
}
}
function publishMessage() {
if (client) {
client.publish('car1', 'Hello');
}
}
function disconnectMQTT() {
if (client) {
client.end(() => {
console.log('关闭连接');
});
}
}
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
loadingBar.style.display = "block";
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
// 为window添加unityInstance对象
window.unityInstance = unityInstance
// 为window添加unityInstance对象
window.unityInstance = unityInstance
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
function openCar(data) {
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
function openCar(data) {
// console.log(data);
unityInstance.SendMessage('Canvas', 'Popupwindow', data)
}
function unityBoxHandle(val) {
if (val) {
unityInstance.SendMessage('Canvas', 'Partialhiding', val)
} else {
console.log(val,'xxxxxxxxxxx');
unityInstance.SendMessage('Canvas', 'Boxshow')
}
}
document.body.appendChild(script);
function hideBox() {
unityInstance.SendMessage('Canvas', 'HiddenBox', '')
}
document.body.appendChild(script);
</script>
</script>
</body>
</html>
</html>

View File

@ -221,11 +221,14 @@
if (val) {
unityInstance.SendMessage('Canvas', 'Partialhiding', val)
} else {
console.log(val,'xxxxxxxxxxx');
console.log(val, 'xxxxxxxxxxx');
unityInstance.SendMessage('Canvas', 'Boxshow')
}
}
function hideBox() {
unityInstance.SendMessage('Canvas', 'HiddenBox', '')
}
document.body.appendChild(script);
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -11,6 +11,7 @@ import getPath from "@/utils/getPath";
import { fontSize } from "@/utils/common";
const props = defineProps({
dataMap: Object,
type:String,
});
const chartData = ref({});
watch(
@ -22,7 +23,7 @@ watch(
},
{ deep: true }
);
console.log(props.dataMap,'props.dataMap');
function initChart() {
let myChart = echarts.init(
document.getElementById("classProportion" + props.dataMap.id)
@ -80,14 +81,13 @@ function initChart() {
// },
{
type: "text",
name:'name',
z: 100,
left: "center",
top: "72%",
style: {
fill: "#fff",
textAlign: 'left',
text: `${props.dataMap.name.length>7 ? props.dataMap.name.slice(0,7) + '...' : props.dataMap.name}`,
text: `${props.dataMap.name.length>14 ? props.dataMap.name.slice(0,14) + '...' : props.dataMap.name}`,
fontSize: `0.8rem`,
width: 20,
whiteSpace: 'nowrap',
@ -111,11 +111,12 @@ function initChart() {
{
type: "text",
z: 100,
name:props.dataMap.weight,
left: "center",
top: "85%",
style: {
fill: "rgba(255, 206, 84, 1)",
text: `${props.dataMap.weight ? props.dataMap.weight : ""}`,
text: `${props.dataMap.weight.length>16 ? props.dataMap.weight.slice(0,16) + '...' : props.dataMap.weight}`,
fontSize: `1.1rem`,
},
},
@ -168,7 +169,7 @@ function initChart() {
polar: [
{
center: ["50%", "35%"], //
radius: ["74%", "67%"], //
radius: props.type?["54%", "50%"]:["50%", "46%"], //
},
],
@ -176,7 +177,7 @@ function initChart() {
{
type: "pie",
name: "内层细圆环",
radius: ["95%", "85%"],
radius: props.type?["67%", "60%"]:["67%", "60%"],
center: ["50%", "35%"],
startAngle: 90,
hoverAnimation: false,
@ -219,7 +220,7 @@ function initChart() {
{
type: "pie",
name: "内层细圆环",
radius: ["72%", "67%"],
radius: props.type?["54%", "50%"]:["50%", "46%"],
center: ["50%", "35%"],
startAngle: 90,
hoverAnimation: false,

View File

@ -7,7 +7,7 @@
{{ props.title === "维修统计" ? "维修统计" : props.title }}
</div>
<div class="el-select2">
<div class="el-select2" v-if="!props.hideSelect">
<el-select
v-model="params.facName"
placeholder="请选择"
@ -84,7 +84,7 @@
</el-table>
</div>
<!-- 故障分析 -->
<div class="box-content-table" v-else-if="props.title === '故障分析'">
<div class="box-content-table" v-else-if="props.title === '故障分析'||props.title === '维修统计'">
<el-table :data="tableList" style="width: 100%">
<el-table-column prop="errorDateTime" label="报错时间" align="center" />
<el-table-column prop="facCode" label="设备编码" align="center" />
@ -96,7 +96,7 @@
</el-table>
</div>
<!-- 维修统计 -->
<div class="box-content-table" v-else-if="props.title === '维修统计'">
<!-- <div class="box-content-table" v-else-if="props.title === '维修统计'">
<el-table :data="tableList" style="width: 100%">
<el-table-column prop="errorDateTime" label="故障时间" align="center" />
<el-table-column prop="facCode" label="设备编码" align="center" />
@ -111,7 +111,7 @@
</template>
</el-table-column>
</el-table>
</div>
</div> -->
<div style="float: right">
<el-pagination
@ -144,6 +144,7 @@ import {
const emit = defineEmits(["close"]);
const props = defineProps({
title: String,
hideSelect:Boolean
});
const tableList = ref([

View File

@ -61,7 +61,9 @@
<div class="box-content-box4">
<div class="title">
<span>维修统计</span>
<!-- <span class="more" @click="openDialog"></span> -->
<span class="more" @click="openDialog"></span>
<!-- <span class="more" @click="openDialog($event, 1)"></span> -->
</div>
<div class="maintenance">
<div class="maintenance-left">
@ -97,6 +99,7 @@
@close="receiveMsg"
v-if="maintenanceDialogShow"
:title="dialogTitle"
:hideSelect="hideSelect"
/>
</template>
<script setup>
@ -115,6 +118,8 @@ function close() {
emit("closeHealth", -1);
}
const maintenanceDialogShow = ref(false);
//
const hideSelect = ref(false)
const dialogTitle = ref("");
//
function receiveMsg(val) {
@ -128,16 +133,27 @@ function openDialog(event, val) {
} else {
dialogTitle.value = event.target.previousElementSibling.innerText;
maintenanceDialogShow.value = true;
hideSelect.value = true
}
// console.log(event.target.previousElementSibling.innerText);
}
// ecahrts
function drawHealthIndex(list) {
const color = [
"rgba(25, 174, 250, 0.7)",
"rgba(28, 238, 251, 0.7)",
"rgba(255, 206, 84, 0.7)",
"rgba(174, 211, 255, 0.7)",
// const color = [
// "rgba(25, 174, 250, 0.7)",
// "rgba(28, 238, 251, 0.7)",
// "rgba(255, 206, 84, 0.7)",
// "rgba(174, 211, 255, 0.7)",
// ];
var color = [
"rgba(23, 151, 217, 1)",
// "rgba(28, 238, 251, 1)",
"rgba(255, 215, 0,1)",
// "rgba(0, 245, 194, 1)",
"rgba(255, 255, 224,1)",
// "rgba(0, 245, 194, 1)",
"rgba(28, 238, 251, 1)",
"rgba(255, 192, 203,1)",
];
let result = []
let total = list.totalCount;
@ -287,28 +303,35 @@ function drawHealthIndex(list) {
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
data:result.map((el) => {
if (el.name === "往复式提升机") {
return {
value: el.value,
name: el.name,
itemStyle: {
normal: {
color: "rgba(28, 238, 251, 0.62)",
},
},
};
} else {
return {
value: el.value,
name:el.name,
itemStyle: {
normal: {
color: "rgba(4, 132, 189, 0.62)",
},
},
};
data:result.map((el,index) => {
return {
value:el.value,
name:el.name,
itemStyle:{
color:color[index]
}
}
// if (el.name === "") {
// return {
// value: el.value,
// name: el.name,
// itemStyle: {
// normal: {
// color: "rgba(28, 238, 251, 0.62)",
// },
// },
// };
// } else {
// return {
// value: el.value,
// name:el.name,
// itemStyle: {
// normal: {
// color: "rgba(4, 132, 189, 0.62)",
// },
// },
// };
// }
}),
},
],
@ -320,11 +343,12 @@ function drawHealthIndex(list) {
}
// echarts
function drawSpareParts(list) {
const color = [
"rgba(25, 174, 250, 0.7)",
"rgba(28, 238, 251, 0.7)",
"rgba(255, 206, 84, 0.7)",
"rgba(174, 211, 255, 0.7)",
var color = [
"rgba(255, 192, 203,1)",
"rgba(28, 238, 251, 1)",
"rgba(255, 255, 224,1)",
"rgba(255, 215, 0,1)",
"rgba(23, 151, 217, 1)",
];
let result = []
let total = list.totalCount;

View File

@ -128,11 +128,21 @@ const tableList = ref([
]);
//
function drawLeftChart(list) {
const color = [
"rgba(25, 174, 250, 0.7)",
"rgba(28, 238, 251, 0.7)",
"rgba(255, 206, 84, 0.7)",
"rgba(174, 211, 255, 0.7)",
// const color = [
// "rgba(25, 174, 250, 0.7)",
// "rgba(28, 238, 251, 0.7)",
// "rgba(255, 206, 84, 0.7)",
// "rgba(174, 211, 255, 0.7)",
// ];
var color = [
"rgba(23, 151, 217, 1)",
// "rgba(28, 238, 251, 1)",
"rgba(255, 215, 0,1)",
// "rgba(0, 245, 194, 1)",
"rgba(255, 255, 224,1)",
// "rgba(0, 245, 194, 1)",
"rgba(28, 238, 251, 1)",
"rgba(255, 192, 203,1)",
];
let result = [];
let total = list.totalCount;
@ -298,11 +308,18 @@ function drawLeftChart(list) {
}
//
function drawRightChart(list) {
const color = [
"rgba(25, 174, 250, 0.7)",
"rgba(28, 238, 251, 0.7)",
"rgba(255, 206, 84, 0.7)",
"rgba(174, 211, 255, 0.7)",
// const color = [
// "rgba(25, 174, 250, 0.7)",
// "rgba(28, 238, 251, 0.7)",
// "rgba(255, 206, 84, 0.7)",
// "rgba(174, 211, 255, 0.7)",
// ];
var color = [
"rgba(255, 192, 203,1)",
"rgba(28, 238, 251, 1)",
"rgba(255, 255, 224,1)",
"rgba(255, 215, 0,1)",
"rgba(23, 151, 217, 1)",
];
let result = [];
let total = list.totalCount;

View File

@ -10,7 +10,6 @@
<div class="box-content-left-title">
<span>文件列表</span>
<!-- 选择框 -->
<el-select
@clear="clearHandle"
@change="GetPageGuideDocsData(params1.code)"
@ -93,7 +92,13 @@ const params1 = {
pageIndex: 1,
pageSize: 10,
};
function addPdf(fileName){
if (fileName.endsWith('.pdf')) {
return fileName
}else{
return fileName + '.pdf'
}
}
//
async function download(item) {
const response = await downloadPdf(
@ -102,7 +107,7 @@ async function download(item) {
const url = window.URL.createObjectURL(new Blob([response]));
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", item.fileName);
link.setAttribute("download", addPdf(item.fileName));
document.body.appendChild(link);
link.click();
}

View File

@ -11,7 +11,7 @@
<div class="swiper">
<transition
:name="btnName"
v-for="(item, index) in Math.ceil(chartList.length / 8)"
v-for="(item, index) in Math.ceil(chartList.length / 6)"
:key="item.id"
>
<div
@ -20,11 +20,11 @@
>
<div
class="box-content-chart-item"
v-for="item in chartList.slice(index * 8, 8 * (index + 1))"
v-for="item in chartList.slice(index * 6, 6 * (index + 1))"
:key="item.id"
>
<div class="chart">
<pieChart :dataMap="item" />
<pieChart :dataMap="item" type="2" />
</div>
<div class="line"></div>
</div>
@ -36,12 +36,15 @@
</div>
<div class="box-content-inBound">
<div class="box-content-inBound-title">
<span> {{props.title==='入库信息'?'入库信息统计':'出库信息统计'}} </span>
<span>
{{ props.title === "入库信息" ? "入库信息统计" : "出库信息统计" }}
</span>
<div>
<ul v-if="storeList">
<li><span>单位</span><span>公斤</span></li>
<li>
<span>总量</span><span>{{ formatNumber(storeList.totalWeight) }}</span>
<span>总量</span
><span>{{ formatNumber(storeList.totalWeight) }}</span>
</li>
<li>
<span>品牌总量</span><span>{{ storeList.brandNum }}</span>
@ -223,7 +226,7 @@ function getChartList() {
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
weight: ele.weight + '公斤',
weight: ele.weight + "公斤",
msg: true,
};
});
@ -236,7 +239,8 @@ function getChartList() {
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
weight: ele.weight + '公斤',
// weight: ele.weight +'0000000000' + '',
weight: ele.weight + "公斤",
msg: true,
};
});
@ -278,14 +282,14 @@ function getAllBrandName(boolean) {
params.brandName = brandList.value[0];
getBrandChart();
//
getChartList()
getChartList();
});
} else {
getOutBrandNames(params).then((res) => {
brandList.value = res.result;
params.brandName = brandList.value[0];
getBrandChart();
getChartList()
getChartList();
});
}
}
@ -303,26 +307,26 @@ function getBrandChart(boolean) {
console.log(params.month.slice(0, -2));
// params.month = params.month.slice(-2)
}
if (props.title === "入库信息") {
getBrandTimeCount(params).then((res) => {
drawBarChart(res.result);
getChartList()
getStoreDetail()
getChartList();
getStoreDetail();
getBrandNames(params).then((res) => {
brandList.value = res.result;
params.brandName = brandList.value[0];
});
brandList.value = res.result;
params.brandName = brandList.value[0];
});
});
} else {
getOutBrandTimeCount(params).then((res) => {
drawBarChart(res.result);
getChartList()
getStoreDetail()
getChartList();
getStoreDetail();
getOutBrandNames(params).then((res) => {
brandList.value = res.result;
params.brandName = brandList.value[0];
});
brandList.value = res.result;
params.brandName = brandList.value[0];
});
});
}
}
@ -376,11 +380,27 @@ function drawBarChart(res) {
show: true,
formatter: function (data) {
// 1000
console.log(data,'xxxxxxxxxx');
if(params.month){
return params.year +'-'+ params.month +'-'+ data.name+ ' : ' + `<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` + '公斤'
}else{
return params.year +'-'+ data.name+ ' : ' + `<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` + '公斤'
console.log(data, "xxxxxxxxxx");
if (params.month) {
return (
params.year +
"-" +
params.month +
"-" +
data.name +
" : " +
`<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` +
"公斤"
);
} else {
return (
params.year +
"-" +
data.name +
" : " +
`<span style='color:rgba(28, 238, 251, 1)'>${data.value}</span>` +
"公斤"
);
}
},
},
@ -580,11 +600,12 @@ onMounted(() => {
// margin-left: vw(35);
// }
&-item {
margin-right: vw(40);
// width: 16.5%;
// margin-right: vw(40);
// width: vw(100);
// height: vh(170);
.chart {
width: vw(110);
width: vw(192);
height: vh(190);
}
}

View File

@ -3,7 +3,7 @@ import axios from 'axios';
// 创建axios实例
const service = axios.create({
baseURL: import.meta.env.VITE_APP_BASE_API, // api的base_url
timeout: 5000 // 请求超时时间
timeout: 60000 // 请求超时时间
});
// 请求拦截器
service.interceptors.request.use(

View File

@ -21,7 +21,10 @@
<div v-if="listIndex == index" style="display: flex; width: 100%">
<div
class="box-content-chart-item"
v-for="(item, index) in list.slice(index * 5, 5 * (index + 1))"
v-for="(item, index) in list.slice(
index * 5,
5 * (index + 1)
)"
:key="item.id"
>
<div class="chart">
@ -36,13 +39,27 @@
</div>
<div class="box-content-search">
<div>
<el-input
<!-- <el-input
v-model="tableParams.name"
@change="getTableList"
class="w-50 m-2"
placeholder="请输入搜索内容"
:prefix-icon="Search"
/>
/> -->
<el-select
@clear="clearHandle"
@change="tableParams.index=1;getTableList()"
clearable
v-model="tableParams.name"
placeholder="请选择品牌名"
>
<el-option
v-for="item in list"
:key="item.name"
:label="item.name"
:value="item.name"
/>
</el-select>
<!-- <el-select
style="margin-left:1rem"
v-model="tableParams.orderByLoc"
@ -81,21 +98,39 @@
</div>
</div>
<div class="box-content-table">
<el-table :data="tableList" @sort-change="sortHandle" style="width: 100%">
<el-table-column type="index" label="序号" :index="indexMethod" width="80" />
<el-table-column prop="palletNum" label="托盘号" />
<el-table-column prop="storeLoc" sortable="custom" label="当前存放位置" />
<el-table
:data="tableList"
@sort-change="sortHandle"
style="width: 100%"
>
<el-table-column
type="index"
label="序号"
:index="indexMethod"
width="80"
/>
<el-table-column prop="palletNum" label="托盘号" width="100"/>
<el-table-column
prop="storeLoc"
sortable="custom"
label="当前存放位置"
/>
<el-table-column
prop="itemDesc"
:show-overflow-tooltip="true"
label="物料描述"
width="160"
/>
<el-table-column prop="batchNum" :show-overflow-tooltip="true" label="批次" />
<el-table-column prop="status" label="状态" />
<el-table-column
prop="batchNum"
:show-overflow-tooltip="true"
label="批次"
/>
<el-table-column prop="status" label="状态" width="100" />
<el-table-column prop="inputTime" label="入库时间" />
<!-- <el-table-column prop="number" label="编号" /> -->
<el-table-column prop="upWeight" label="上箱重量" />
<el-table-column prop="downWeight" label="下箱重量" />
<el-table-column prop="upWeight" label="上箱重量" width="100" />
<el-table-column prop="downWeight" label="下箱重量" width="100"/>
</el-table>
<div style="float: right">
<el-pagination
@ -245,7 +280,6 @@ const tableParams = reactive({
function getTableList() {
getBrandTable(tableParams).then((res) => {
tableList.value = res.result.data;
tableTotal.value = res.result.totalNum;
});
}
@ -267,13 +301,12 @@ function getChartData() {
list.value = res.result.map((el, index) => {
return {
name: el.name,
kg: el.stockNum + '箱',
kg: el.stockNum + "箱",
value: el.weightPercent,
id: index,
weight: el.weight + '公斤',
weight: el.weight + "公斤",
};
});
console.log(list.value, "数据");
});
}
@ -283,7 +316,7 @@ onMounted(() => {
//
getBrandBox().then((res) => {
for (let key in res.result) {
console.log(res.result, key,'huowei');
console.log(res.result, key, "huowei");
if (key === "inventoryNum") {
areaNum.storeNum = res.result[key];
} else if (key === "fullBoxNum") {
@ -377,23 +410,23 @@ function sortHandle(event) {
position: relative;
height: vh(190);
&-item:nth-child(1) {
margin-left: vw(25);
// margin-left: vw(25);
}
&-item {
// width: vw(120);
display: flex;
height: vh(190);
.chart {
width: vw(110);
width: vw(180);
height: vh(190);
position: relative;
}
.line {
width: vw(89);
width: vw(70);
height: vh(12);
margin: 0 vw(28);
// margin: 0 vw(28);
position: relative;
top: 40%;
top: 35%;
background-image: url("@/assets/images/dialog/line.png");
background-size: 100% 100%;
}

View File

@ -227,9 +227,9 @@ onMounted(() => {
//
// console.log(props);
list1.value = props.mqttData
// getCarErrorIn12().then(res=>{
// list1.value = res.result
// })
getCarErrorIn12().then(res=>{
list1.value = res.result
})
// window.PubScribe(null, realInfo);
//
getOverTransmission().then((res) => {

View File

@ -85,12 +85,15 @@
<el-input
v-model="searchData"
class="w-50 m-2"
placeholder="请输入搜索内容"
placeholder="请输入箱号"
:suffix-icon="Search"
@change="searchCar"
/>
</div>
<div class="home-btn-reset" @click="resetUnity">刷新</div>
<div class="home-reset">
<div class="home-reset-data" @click="resetData">刷新数据</div>
<div class="home-reset-model" @click="resetModel">刷新场景</div>
</div>
</div>
<div class="home-right">
<!-- 失活二层箱子激活一层箱子 重新加载三维场景 -->
@ -102,10 +105,11 @@
>
{{ unityBtn }}
</div>
<!-- <div class="home-btn-unity" @click="hideenBox">隐藏箱子</div> -->
</div>
<!-- 库存消息 -->
<div class="home-title">
<span class="home-title-font"> 库存</span>
<span class="home-title-font"> 库存</span>
<span class="home-title-more" @click="openInventoryNews"> </span>
</div>
<div class="home-right-inventoryNews" id="inventoryNews"></div>
@ -250,21 +254,34 @@ import {
getLocInfo,
} from "@/api/home";
import { fontSize } from "@/utils/common";
const unityBoxShow = ref(false);
const unityBoxShow = ref(true);
//
function resetUnity() {
unityBoxShow.value = false;
function resetModel() {
document.querySelector("#iframeRef").src = "model/index.html";
}
function resetData() {
unityBoxShow.value = false;
getDeviceStatus(); //
getBrandData(); //
getInventory(); //
getOutboundWorkOrder(); //
getInboundWorkOrder(); //
getMessageReminder();
}
function hideenBox() {
document.querySelector("#iframeRef").contentWindow.hideBox();
}
const unityBtn = ref("隐藏二层箱子");
const unityNum = ref(0);
const isStoreClick = ref(false);
//
function unityBoxHandle(val) {
if (val) {
inventoryNewsShow.value = false;
unityBoxShow.value = true;
unityNum.value = 0;
unityBtn.value = "隐藏二层箱子";
isStoreClick.value = true;
document.querySelector("#iframeRef").contentWindow.unityBoxHandle(val);
} else {
unityNum.value++;
if (unityNum.value % 2 != 0) {
@ -272,10 +289,12 @@ function unityBoxHandle(val) {
} else {
unityBtn.value = "隐藏二层箱子";
}
if (isStoreClick.value) {
document.querySelector("#iframeRef").contentWindow.unityBoxHandle();
}else{
document.querySelector("#iframeRef").contentWindow.hideBox(val);
}
}
document
.querySelector("#iframeRef")
.contentWindow.unityBoxHandle(val);
}
const { proxy } = getCurrentInstance();
//
@ -874,8 +893,12 @@ function getDeviceStatus() {
});
}
const brandList = ref([]);
const brandTimer = ref(null);
//
function getBrandData() {
if (brandTimer.value) {
clearTimeout(brandTimer.value);
}
getInventoryInfo().then((res) => {
// darwBrandChart(res.result);
// for (let key in res.result[1]) {
@ -885,18 +908,21 @@ function getBrandData() {
// });
// }
brandList.value = res.result;
brandTimer.value = setTimeout(() => {
getBrandData();
}, 30000);
});
}
//
async function getMessageReminder() {
// await getCarErrorIn12().then((res) => {
// res.result.slice(0, 1).forEach((el) => {
// el.msg = "";
// el.reminderMsg = el.facName + el.facCode + " ";
// el.date = el.errorDateTime;
// messageReminder.value.push(el);
// });
// });
await getCarErrorIn12().then((res) => {
res.result.slice(0, 1).forEach((el) => {
el.msg = "维修提醒";
el.reminderMsg = el.facName + el.facCode + " 需要维修";
el.date = el.errorDateTime;
messageReminder.value.push(el);
});
});
await getOverTransmission().then((res) => {
res.result.forEach((el) => {
el.msg = "超时提醒";
@ -906,23 +932,42 @@ async function getMessageReminder() {
});
});
}
const inventoryTimer = ref(null);
//
function getInventory() {
if (inventoryTimer.value) {
clearTimeout(inventoryTimer.value);
}
getLocInfo().then((res) => {
drawInventoryNewsEcahrt(res.result);
inventoryTimer.value = setTimeout(() => {
getInventory;
}, 30000);
});
}
//
const outTimer = ref(null);
function getOutboundWorkOrder() {
if (outTimer.value) {
clearTimeout(outTimer.value);
}
getOutOrder().then((res) => {
outboundWorkOrder.value = res.result;
outboundWorkOrder.value.forEach((el) => {
el.pic = getPath.outDevice;
});
outTimer.value = setTimeout(() => {
getOutboundWorkOrder();
}, 30000);
});
}
//
const inTimer = ref(null);
function getInboundWorkOrder() {
if (inTimer.value) {
clearTimeout(inTimer.value);
}
getInOrder().then((res) => {
inboundWorkOrder.value = res.result;
inboundWorkOrder.value.forEach((el) => {
@ -930,6 +975,9 @@ function getInboundWorkOrder() {
el.inWeight = formatNumber(el.inWeight);
el.planWeight = formatNumber(el.planWeight);
});
inTimer.value = setTimeout(() => {
getInboundWorkOrder();
}, 30000);
});
}
function formatNumber(num) {
@ -963,25 +1011,35 @@ function realInfo(topic, message) {
});
messageReminder.value = list;
mqttList.value = msg;
getMessageReminder(); //
// getMessageReminder(); //
}
}
onMounted(() => {
getDeviceStatus(); //
getBrandData(); //
getInventory(); //
getOutboundWorkOrder(); //
getInboundWorkOrder(); //
window.PubScribe(null, realInfo);
getMessageReminder();
// window.PubScribe(null, realInfo);
// window.getMqttData = getMqtt;
});
</script>
<style scoped lang="scss">
//
.home-reset {
display: flex;
margin-top: vh(20);
div {
background-image: url("@/assets/images/home/unityBtn-D.png");
background-size: 100% 100%;
padding: vw(5) vh(8);
cursor: pointer;
}
div:nth-child(2) {
margin-left: vw(20);
}
}
.kg {
font-size: 0.875rem;
margin-left: 0.2rem;
@ -996,32 +1054,37 @@ onMounted(() => {
}
}
.home-btn {
position: absolute;
left: -38%;
top: 26%;
&-unity{
width: 6rem;
position: fixed;
right: vw(20);
top: vh(10);
display: flex;
&-unity {
// width: 6rem;
padding: vw(2) vw(8);
line-height: vh(32);
font-size: 1rem;
padding: 0.5rem;
background-image: url("@/assets/images/home/unityBtn-D.png");
background-size: 100% 100%;
text-align: center;
cursor: pointer;
}
> div:nth-child(2) {
margin-top: 1.5rem;
margin-left: vw(20);
}
}
.home-btn-reset {
width: 6rem;
font-size: 1rem;
padding: 0.5rem;
margin-top: 1rem;
background-image: url("@/assets/images/home/unityBtn-D.png");
background-size: 100% 100%;
text-align: center;
cursor: pointer;
}
width: 3rem;
height: 3rem;
font-size: 1rem;
background-image: url("@/assets/images/home/refresh.png");
background-size: 100% 100%;
text-align: center;
cursor: pointer;
position: absolute;
left: 105%;
bottom: 8.5%;
}
.home {
width: 100%;
height: 100%;

View File

@ -23,17 +23,17 @@ export default defineConfig({
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://172.16.1.106:5005/',
target: 'http://172.16.1.117:5005/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
},
'/api': {
target: 'http://172.16.1.106:5005/api',
target: 'http://172.16.1.117:5005/api',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
},
'/preview': {
target: 'http://172.16.1.106:5005/',
target: 'http://172.16.1.117:5005/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/preview/, '')
}