修改优化意见_11_12

This commit is contained in:
lixiaobang 2024-11-12 11:06:11 +08:00
parent 4a10ebd599
commit 9dd813ee1f
30 changed files with 800 additions and 628 deletions

BIN
dist.rar

Binary file not shown.

BIN
dist.zip

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
172.16.1.104:5005
172.16.1.106:5005

View File

@ -1,24 +1,16 @@
body { overflow: hidden;
height: 100%;
width: 100%; }
body { padding: 0; margin: 0 }
#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { width: 100%; height: 100% }
#unity-canvas { background: url('bg1.jpg') no-repeat; }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas { background: #231F20 }
.unity-mobile #unity-canvas { width: 100%; height: 100% }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none ;background: url('bg1.jpg') no-repeat;display: none; }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center ;display: none; }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center;display: none; }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center;display: none; }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
/* #unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center } */
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px ;display: none}
#unity-fullscreen-button { float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center ;display: none}
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
#blackleng{
width: 100%; height: 100%; background: url('bg1.jpg') no-repeat;
}
#black{
width: 100%; height: 100%; background: url('bg1.jpg') no-repeat;
}

View File

@ -1,139 +1,167 @@
<!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>
</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 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>
<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>
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 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 buildUrl = "Build";
var loaderUrl = buildUrl + "/Hoister.loader.js";
var config = {
dataUrl: buildUrl + "/Hoister.data.unityweb",
frameworkUrl: buildUrl + "/Hoister.framework.js.unityweb",
codeUrl: buildUrl + "/Hoister.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%";
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();
}
// loadingBar.style.display = "block";
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,
};
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
// progressBarFull.style.width = 100 * progress + "%";
// window.parent.getProgress(progress);
}).then((unityInstance) => {
unity = unityInstance
// loadingBar.style.display = "none";
// fullscreenButton.onclick = () => {
// unityInstance.SetFullscreen(1);
// };
}).catch((message) => {
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')
}
document.body.appendChild(script);
// 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;
</script>
</body>
</html>
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);
});
};
//切换小车
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>
</body>
</html>

139
public/Hoister/index1.html Normal file
View File

@ -0,0 +1,139 @@
<!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>
</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>
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 buildUrl = "Build";
var loaderUrl = buildUrl + "/Hoister.loader.js";
var config = {
dataUrl: buildUrl + "/Hoister.data.unityweb",
frameworkUrl: buildUrl + "/Hoister.framework.js.unityweb",
codeUrl: buildUrl + "/Hoister.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 script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
// progressBarFull.style.width = 100 * progress + "%";
// window.parent.getProgress(progress);
}).then((unityInstance) => {
unity = unityInstance
// loadingBar.style.display = "none";
// fullscreenButton.onclick = () => {
// unityInstance.SetFullscreen(1);
// };
}).catch((message) => {
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')
}
document.body.appendChild(script);
</script>
</body>
</html>

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,97 +1,89 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<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>
<style>
</head>
<style>
body,html{
width: 100%;
height: 100%;
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">
</style>
<body>
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%;">
<canvas id="unity-canvas" tabindex="-1" style="width: 100%;height: 100%;"></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 id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-warning"></div>
<div id="unity-footer">
</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>
<script>
<button onclick="OpenHtmlMQTT()">Connect</button>
<button onclick="publishMessage()">Publish</button>
<button onclick="disconnectMQTT()">Disconnect</button>
<script src="./js/mqtt.min.js"></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");
<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) {
// 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';
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);
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",
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;
// 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)) {
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');
@ -106,112 +98,32 @@
// config.devicePixelRatio = 1;
} else {
} else {
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
// canvas.style.width = "960px";
// canvas.style.height = "600px";
}
// canvas.style.width = "1920px";
// canvas.style.height = "1080px";
}
loadingBar.style.display = "block";
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
let client;
function OpenHtmlMQTT() {
client = mqtt.connect('ws://172.16.1.106:8083/mqtt');
client.on('connect', () => {
console.log('连接...');
const devices = [
Array.from({length: 10}, (_, i) => `car${i + 1}`),//小车
"cm1",//去加盖机
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: 7}, (_, i) => `elv${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()});
// 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('关闭连接');
});
}
}
//----------------------------------------------------------------------------------MQTT-----------------------------------------------------------------------------
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
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
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
document.body.appendChild(script);
</script>
</body>
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -27,19 +27,18 @@ function initChart() {
let myChart = echarts.init(
document.getElementById("classProportion" + props.dataMap.id)
);
// let fontSize = (window.innerHeight * 27) / 1080;
// let fontSize1 = (window.innerHeight * 14) / 1080;
var data = {
value: [props.dataMap.value],
// nAmount: 1566557.14,
nAmount: [props.dataMap.kg],
};
var color = ["rgb(50,100,162)", "rgb(50,100,162)", "rgb(50,100,162)"];
let option = {
title: {
// text: data.value[0] + "%",
text: `{a|${data.value[0]}}{b|%}`,
text: `{a|${data.nAmount[0]}}{b|}`,
textStyle: {
color: "#FFFFFF",
confine: true,
@ -116,7 +115,7 @@ function initChart() {
top: "85%",
style: {
fill: "rgba(255, 206, 84, 1)",
text: `${props.dataMap.kg ? props.dataMap.kg : ""}`,
text: `${props.dataMap.weight ? props.dataMap.weight : ""}`,
fontSize: `1.1rem`,
},
},
@ -139,7 +138,7 @@ function initChart() {
// %
// let unit = "";
return `<div style="width:80%;height:100%;background: rgba(38,67,108,0.85);">
数量${props.dataMap.kg}
数量${props.dataMap.weight}
</div>`;
},
// formatter: function (params) {

View File

@ -4,8 +4,9 @@
<div class="box">
<div class="box-header">
<div class="box-title">
{{ props.title === '维修统计'?"维修统计":props.title }}
{{ props.title === "维修统计" ? "维修统计" : props.title }}
</div>
<div class="el-select1">
<el-select
v-model="params.facName"
@ -15,17 +16,14 @@
getTableList();
"
clearable
@clear="clearAll"
>
<el-option
v-for="item in allName"
:key="item"
:label="item"
:value="item"
/>
<el-option v-for="item in allName" :key="item" :label="item" :value="item" />
</el-select>
</div>
<div class="el-select2">
<el-select v-if="props.title === '维修统计'"
<el-select
v-if="props.title === '维修统计'"
v-model="isMaintain"
placeholder="请选择"
@change="
@ -37,6 +35,40 @@
<el-option label="已维修" :value="true" />
<el-option label="未维修" :value="false" />
</el-select>
<el-select
v-else-if="props.title === '备件更换统计'"
v-model="params.facCode"
placeholder="请选择"
@change="
params.pageIndex = 1;
getTableList();
"
clearable
>
<el-option
v-for="item in deviceIdList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
<el-select
v-else-if="props.title === '故障分析'"
v-model="params.facCode"
placeholder="请选择"
@change="
params.pageIndex = 1;
getTableList();
"
clearable
>
<el-option
v-for="item in deviceIdList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</div>
<div class="box-btn" @click="close"></div>
@ -45,67 +77,32 @@
<div class="box-content">
<div class="box-content-table" v-if="props.title === '备件更换统计'">
<el-table :data="tableList" style="width: 100%">
<el-table-column
prop="maintainTime"
label="维修时间"
align="center"
/>
<el-table-column prop="maintainTime" label="维修时间" align="center" />
<el-table-column prop="facCode" label="设备编码" align="center" />
<el-table-column
prop="elementCode"
label="零件编码"
align="center"
/>
<el-table-column
prop="elementName"
label="零件名称"
align="center"
/>
<el-table-column prop="elementCode" label="零件编码" align="center" />
<el-table-column prop="elementName" label="零件名称" align="center" />
</el-table>
</div>
<!-- 故障分析 -->
<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="errorDateTime" label="报错时间" align="center" />
<el-table-column prop="facCode" label="设备编码" align="center" />
<el-table-column prop="errorName" label="故障名称" align="center" />
<el-table-column prop="maintainer" label="维修人" align="center" />
<el-table-column
prop="maintainDateTime"
label="维修时间"
align="center"
/>
<!-- <el-table-column prop="maintainer" label="维修人" align="center" /> -->
<el-table-column prop="maintainDateTime" label="恢复时间" align="center" />
<el-table-column prop="reason" label="报错原因" align="center" />
<el-table-column prop="remark" label="备注" align="center" />
</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="errorDateTime" label="故障时间" align="center" />
<el-table-column prop="facCode" label="设备编码" align="center" />
<el-table-column prop="facName" label="设备名称" align="center" />
<el-table-column
prop="maintainDateTime"
label="维修时间"
align="center"
/>
<el-table-column
prop="errorName"
label="错误内容"
align="center"
/>
<el-table-column prop="maintainDateTime" label="维修时间" align="center" />
<el-table-column prop="errorName" label="错误内容" align="center" />
<el-table-column prop="status" label="状态" align="center">
<template #default="{ row }">
<div :style="row.isMaintain ? 'color:rgba(28, 238, 251, 1)' : ''">
@ -140,7 +137,9 @@ import {
getPageSparePart,
getPageFaultAnalysisInfo,
allDeviceNames,
allDevicId,
} from "@/api/equipmentManagement/index";
// import { pa } from "element-plus/es/locale";
const emit = defineEmits(["close"]);
const props = defineProps({
title: String,
@ -162,21 +161,25 @@ const params = reactive({
pageIndex: 1,
pageSize: 10,
facName: "",
facCode: "",
});
const isMaintain = ref(null);
const total = ref(0);
const deviceIdList = ref([]);
function getTableList() {
//
if (props.title === "备件更换统计") {
getPageSparePart(params).then((res) => {
tableList.value = res.result.data;
total.value = res.result.totalNum;
});
getEquipCode();
// getPageSparePart(params).then((res) => {
// tableList.value = res.result.data;
// total.value = res.result.totalNum;
// });
} else if (props.title === "故障分析") {
getPageFaultAnalysisInfo(params).then((res) => {
tableList.value = res.result.data;
total.value = res.result.totalNum;
});
getEquipCode();
// getPageFaultAnalysisInfo(params).then((res) => {
// tableList.value = res.result.data;
// total.value = res.result.totalNum;
// });
} else if (props.title === "维修统计") {
params.isMaintain = isMaintain.value;
getPageMaintainInfo(params).then((res) => {
@ -193,7 +196,41 @@ function getAllDeviceNames() {
allName.value = res.result;
});
}
//
function getEquipCode() {
let dataMap = {
name: params.facName,
};
allDevicId(dataMap)
.then((res) => {
deviceIdList.value = res.result
.map((item) => item.models) // models
.flat() //
.map((models) => models.split(",")) // "SFTR-003,SFTR-002"
.flat();
console.log(deviceIdList.value, "deviceIdList.value");
if (props.title === "备件更换统计") {
getPageSparePart(params).then((res) => {
tableList.value = res.result.data;
total.value = res.result.totalNum;
});
} else if (props.title === "故障分析") {
getPageFaultAnalysisInfo(params).then((res) => {
tableList.value = res.result.data;
total.value = res.result.totalNum;
});
}
})
.catch((err) => {
console.log(err);
});
}
//
function clearAll() {
params.facName = "";
params.facCode = "";
}
onMounted(() => {
getAllDeviceNames();
getTableList();
@ -309,28 +346,27 @@ onMounted(() => {
position: absolute;
left: vw(20);
}
.el-select1{
.el-select1 {
position: absolute;
right: vw(104);
top: vh(7);
width: vw(212);
height: vh(36);
:deep(.el-input){
:deep(.el-input) {
border: none;
}
}
.el-select2{
.el-select2 {
position: absolute;
right: vw(340);
top: vh(7);
width: vw(212);
height: vh(36);
:deep(.el-input){
:deep(.el-input) {
border: none;
}
}
:deep(.el-select) {
width: vw(212);
height: vh(36);
border: 1px solid;
@ -340,19 +376,17 @@ onMounted(() => {
rgba(25.000000409781933, 174.00000482797623, 250.00000029802322, 0.5)
)
1 1;
box-sizing: border-box;
box-sizing: border-box;
}
:deep(.el-select .el-input){
:deep(.el-select .el-input) {
width: vw(212);
height: vh(36);
line-height: vh(36);
}
:deep(.el-input .el-input__inner){
line-height: vh(36) !important;
height: vh(36) !important;
}
:deep(.el-input .el-input__inner) {
line-height: vh(36) !important;
height: vh(36) !important;
}
:deep(.el-select:hover:not(.el-select--disabled) .el-input__wrapper),
:deep(.el-select .el-input.is-focus .el-input__wrapper) {
box-shadow: none !important;
@ -365,4 +399,4 @@ onMounted(() => {
border-color: #dcdfe6 !important;
box-shadow: none !important;
}
</style>
</style>

View File

@ -61,7 +61,7 @@
<div class="box-content-box4">
<div class="title">
<span>维修统计</span>
<span class="more" @click="openDialog"></span>
<!-- <span class="more" @click="openDialog"></span> -->
</div>
<div class="maintenance">
<div class="maintenance-left">

View File

@ -12,7 +12,7 @@
<li
v-for="(item, index) in deviceList"
:key="index"
@click="toggleHandle(index,item)"
@click="toggleHandle(index, item)"
:class="liIndex === index ? 'device-select' : ''"
>
{{ item }}
@ -20,24 +20,26 @@
</ul>
</div>
<div class="box-content-middle">
<div class="unity">
<iframe src="Hoister/index.html" frameborder="0" id="unityModule"></iframe>
</div>
<div class="unity">
<iframe
src="Hoister/index.html"
scrolling="no"
frameborder="0"
id="unityModule"
></iframe>
</div>
</div>
<div class="box-content-msg">
<div class="box-content-top">
<div @click="openmodel" :class="openShow === true ? 'btn1' : 'btn11'"></div>
<div @click="closemodel" :class="closeShow === true ? 'btn22' : 'btn2'"></div>
<div @click="openmodel" :class="openShow === true ? 'btn1' : 'btn11'"></div>
<div @click="closemodel" :class="closeShow === true ? 'btn22' : 'btn2'"></div>
</div>
<div class="box-content-bottom">
<div class="name">
<span>
设备名称:
</span>
<span>
{{ changeName }}
</span>
<span> 设备名称: </span>
<span>
{{ changeName }}
</span>
</div>
</div>
</div>
@ -46,50 +48,67 @@
</div>
</template>
<script setup>
import { ref } from "vue";
import { ref, onMounted } from "vue";
// const deviceList = ref(["穿", "TW4", "TW3", ""]);
const deviceList = ref(["穿梭车", "提升机"])
const deviceList = ref(["穿梭车", "提升机", "落地式提升机", "快换电池"]);
const liIndex = ref(0);
const openShow= ref(false);
const closeShow= ref(false);
const emit = defineEmits(['closeExplosion'])
const openShow = ref(false);
const closeShow = ref(false);
const emit = defineEmits(["closeExplosion"]);
const changeName = ref("穿梭车");
function toggleHandle(index,item) {
openShow.value = false
closeShow.value = false
changeName.value = item
const Blowups = ref(false);
function toggleHandle(index, item) {
Blowups.value = false
openShow.value = false;
closeShow.value = false;
changeName.value = item;
liIndex.value = index;
if(item==="穿梭车"){
document.getElementById("unityModule").contentWindow.changeModel('小车');
}else{
document.getElementById("unityModule").contentWindow.changeModel('提升机');
if (item === "穿梭车") {
document.getElementById("unityModule").contentWindow.changeShuttlebus();
} else if (item === "提升机") {
document.getElementById("unityModule").contentWindow.changeHoister();
} else if (item === "落地式提升机") {
document.getElementById("unityModule").contentWindow.changeHoister2();
} else if (item === "快换电池") {
document.getElementById("unityModule").contentWindow.changeBattery();
}
}
function close(){
emit('closeExplosion',-1)
function close() {
emit("closeExplosion", -1);
}
function openmodel(){
openShow.value = true
closeShow.value = false
if(changeName.value==="穿梭车"){
document.getElementById("unityModule").contentWindow.opencar();
}else if(changeName.value==="提升机"){
document.getElementById("unityModule").contentWindow.open();
}
function openmodel() {
openShow.value = true;
closeShow.value = false;
// if(changeName.value==="穿"){
if (Blowups.value == false) {
document.getElementById("unityModule").contentWindow.opencar();
}else{
document.getElementById("unityModule").contentWindow.openSmall();
}
// }else if(changeName.value===""){
// document.getElementById("unityModule").contentWindow.open();
// }
}
function closemodel(){
openShow.value = false
closeShow.value = true
if(changeName.value==="穿梭车"){
document.getElementById("unityModule").contentWindow.closecar();
}else if(changeName.value==="提升机"){
document.getElementById("unityModule").contentWindow.close();
}
function closemodel() {
openShow.value = false;
closeShow.value = true;
// if(changeName.value==="穿"){
if (Blowups.value == false) {
document.getElementById("unityModule").contentWindow.closecar();
}else{
document.getElementById("unityModule").contentWindow.closeSmall();
}
// }else if(changeName.value===""){
// document.getElementById("unityModule").contentWindow.close();
// }
}
function modelStatus(params) {
Blowups.value = params
}
onMounted(() => {
window.parent.modelStatus = modelStatus;
});
</script>
<style scoped lang="scss">
.box {
@ -142,69 +161,72 @@ function closemodel(){
}
}
}
&-middle{
width: vw(660);
margin-left: vw(-100);
// border: 1px solid greenyellow;
.unity {
width: 115%;
height: 94%;
// position: fixed;
iframe {
width: 100%;
height: 100%;
}
}
&-middle {
width: vw(660);
margin-left: vw(-100);
// border: 1px solid greenyellow;
.unity {
width: 115%;
height: 94%;
// position: fixed;
iframe {
width: 100%;
height: 100%;
}
}
}
&-msg{
width: vw(340);
&-msg {
width: vw(340);
}
&-top{
display: flex;
justify-content: space-between;
margin-bottom: vh(16);
.btn1,.btn2,.btn11,.btn22{
width: vw(160);
height: vh(44);
background-size: 100% 100%;
cursor: pointer;
}
.btn1{
background-image: url('@/assets/images/dialog/explosion-btn1-select.png');
}
.btn11{
background-image: url('@/assets/images/dialog/explosion-btn11-select.png');
}
.btn2{
background-image: url('@/assets/images/dialog/explosion-btn2-default.png');
}
.btn22{
background-image: url('@/assets/images/dialog/explosion-btn22-default.png');
}
}
&-bottom{
width: vw(340);
height: vh(556);
background-image: url('@/assets/images/dialog/explosion-msg.png');
&-top {
display: flex;
justify-content: space-between;
margin-bottom: vh(16);
.btn1,
.btn2,
.btn11,
.btn22 {
width: vw(160);
height: vh(44);
background-size: 100% 100%;
cursor: pointer;
}
.btn1 {
background-image: url("@/assets/images/dialog/explosion-btn1-select.png");
}
.btn11 {
background-image: url("@/assets/images/dialog/explosion-btn11-select.png");
}
.btn2 {
background-image: url("@/assets/images/dialog/explosion-btn2-default.png");
}
.btn22 {
background-image: url("@/assets/images/dialog/explosion-btn22-default.png");
}
}
&-bottom {
width: vw(340);
height: vh(556);
background-image: url("@/assets/images/dialog/explosion-msg.png");
background-size: 100% 100%;
padding: vh(66) vw(16) 0 vw(16);
box-sizing: border-box;
.name {
width: 100%;
height: vh(44);
line-height: vh(44);
padding-left: vw(28);
background-size: 100% 100%;
padding:vh(66) vw(16) 0 vw(16);
box-sizing: border-box;
.name{
width: 100%;
height: vh(44);
line-height: vh(44);
padding-left: vw(28);
background-size: 100% 100%;
box-sizing: border-box;
background-image: url('@/assets/images/dialog/explosion-name-bg.png');
span:nth-child(1){
color:rgba(174, 211, 255, 1);
}
background-image: url("@/assets/images/dialog/explosion-name-bg.png");
span:nth-child(1) {
color: rgba(174, 211, 255, 1);
}
}
}
}
}
.device-select {
background-image: url("@/assets/images/dialog/device-select.png") !important;
}
</style>
</style>

View File

@ -231,7 +231,7 @@ function drawChart1(data) {
name: el.name,
type: "bar",
barMaxWidth: 15,
stack: "Total1",
// stack: "Total1",
label: {
show: false,
},

View File

@ -41,7 +41,7 @@
<ul v-if="storeList">
<li><span>单位</span><span>公斤</span></li>
<li>
<span>总量</span><span>{{ storeList.totalWeight }}</span>
<span>总量</span><span>{{ formatNumber(storeList.totalWeight) }}</span>
</li>
<li>
<span>品牌总量</span><span>{{ storeList.brandNum }}</span>
@ -216,25 +216,27 @@ const chartList = ref([
//
function getChartList() {
if (props.title === "入库信息") {
getBrandPercent().then((res) => {
getBrandPercent(params).then((res) => {
chartList.value = res.result.columnDatas.map((ele, index) => {
return {
id: index++,
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
weight: ele.weight + '公斤',
msg: true,
};
});
});
} else {
getOutBrandPercent().then((res) => {
getOutBrandPercent(params).then((res) => {
chartList.value = res.result.columnDatas.map((ele, index) => {
return {
id: index++,
kg: ele.number + "箱",
name: ele.name,
value: (ele.percentage * 100).toFixed(2),
weight: ele.weight + '公斤',
msg: true,
};
});
@ -246,11 +248,11 @@ const storeList = ref(null);
//
function getStoreDetail() {
if (props.title === "入库信息") {
getRepoDetails().then((res) => {
getRepoDetails(params).then((res) => {
storeList.value = res.result;
});
} else {
getOutRepoDetails().then((res) => {
getOutRepoDetails(params).then((res) => {
storeList.value = res.result;
});
}
@ -275,12 +277,15 @@ function getAllBrandName(boolean) {
brandList.value = res.result;
params.brandName = brandList.value[0];
getBrandChart();
//
getChartList()
});
} else {
getOutBrandNames(params).then((res) => {
brandList.value = res.result;
params.brandName = brandList.value[0];
getBrandChart();
getChartList()
});
}
}
@ -301,10 +306,14 @@ function getBrandChart(boolean) {
if (props.title === "入库信息") {
getBrandTimeCount(params).then((res) => {
drawBarChart(res.result);
getChartList()
getStoreDetail()
});
} else {
getOutBrandTimeCount(params).then((res) => {
drawBarChart(res.result);
getChartList()
getStoreDetail()
});
}
}
@ -453,8 +462,22 @@ function drawBarChart(res) {
myChart.resize();
});
}
//
function formatNumber(num) {
if (typeof num === "number" && !isNaN(num)) {
//
if (Number.isInteger(num)) {
return num; //
} else {
return Number.parseFloat(num).toFixed(2); //
}
} else {
throw new Error("Invalid input"); //
}
}
onMounted(() => {
getChartList();
// getChartList();
getStoreDetail();
//
getAllBrandName(true);

View File

@ -7,28 +7,30 @@ import zhCn from 'element-plus/es/locale/lang/zh-cn'
import router from "./router/router.js"
// // 动态调整根字体大小的函数
const updateRootFontSize = () => {
const baseSize = 1.5; // 基准字体大小
// const minFontSize = 12; // 最小字体大小
// const maxFontSize = 25; // 最大字体大小
const designHeight = 1080; // 设计稿的宽度基准
const clientHeight = document.documentElement.clientHeight; // 当前窗口的宽度
const scale = clientHeight / designHeight; // 计算当前窗口宽度与设计稿宽度的比例
let newSize = baseSize * scale * 12;
console.log(newSize,'newSize');
// 限制字体大小在最小和最大范围内
// if (newSize < minFontSize) {
// newSize = minFontSize;
// } else if (newSize > maxFontSize) {
// newSize = maxFontSize;
// }
// 设置根元素的字体大小
document.documentElement.style.fontSize = `${newSize}px`;
};
// 监听窗口大小变化,并动态调整字体大小
window.addEventListener('resize', updateRootFontSize);
const baseSize = 1.5; // 基准字体大小
// const minFontSize = 12; // 最小字体大小
// const maxFontSize = 25; // 最大字体大小
const designHeight = 1080; // 设计稿的宽度基准
const clientHeight = document.documentElement.clientHeight; // 当前窗口的宽度
const scale = clientHeight / designHeight; // 计算当前窗口宽度与设计稿宽度的比例
let newSize = baseSize * scale * 12;
console.log(newSize, 'newSize');
// 限制字体大小在最小和最大范围内
// if (newSize < minFontSize) {
// newSize = minFontSize;
// } else if (newSize > maxFontSize) {
// newSize = maxFontSize;
// }
// 设置根元素的字体大小
document.documentElement.style.fontSize = `${newSize}px`;
};
// 监听窗口大小变化,并动态调整字体大小
window.addEventListener('resize', updateRootFontSize);
// 初始化时立即设置一次字体大小
updateRootFontSize();
createApp(App).use(ElementPlus,{locale:zhCn}).use(router).mount('#app')
// 初始化时立即设置一次字体大小
updateRootFontSize();
const app = createApp(App)
app.use(ElementPlus, { locale: zhCn }).use(router).mount('#app')

View File

@ -18,13 +18,10 @@
v-for="(item, index) in Math.ceil(list.length / 5)"
:key="item.id"
>
<div v-if="listIndex == index" style="display: flex;width: 100%;">
<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">
@ -85,17 +82,17 @@
</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 type="index" label="序号" :index="indexMethod" width="80" />
<el-table-column prop="palletNum" label="托盘号" />
<el-table-column prop="storeLoc" sortable="custom" label="当前存放位置" />
<el-table-column prop="itemDesc" :show-overflow-tooltip="true" label="物料描述" />
<el-table-column
prop="itemDesc"
:show-overflow-tooltip="true"
label="物料描述"
/>
<el-table-column prop="batchNum" :show-overflow-tooltip="true" label="批次" />
<el-table-column prop="inputTime" label="入库时间"/>
<el-table-column prop="status" label="状态" />
<el-table-column prop="inputTime" label="入库时间" />
<!-- <el-table-column prop="number" label="编号" /> -->
<el-table-column prop="upWeight" label="上箱重量" />
<el-table-column prop="downWeight" label="下箱重量" />
@ -270,13 +267,14 @@ 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 + '公斤',
};
});
console.log(list.value);
console.log(list.value, "数据");
});
}
onMounted(() => {
@ -301,9 +299,9 @@ onMounted(() => {
getTableList();
});
function sortHandle(event){
tableParams.orderByLoc = event.order == 'ascending'
getTableList()
function sortHandle(event) {
tableParams.orderByLoc = event.order == "ascending";
getTableList();
}
</script>
<style scoped lang="scss">
@ -378,7 +376,7 @@ function sortHandle(event){
display: flex;
position: relative;
height: vh(190);
&-item:nth-child(1){
&-item:nth-child(1) {
margin-left: vw(25);
}
&-item {
@ -531,4 +529,4 @@ function sortHandle(event){
position: absolute;
left: vw(20);
}
</style>
</style>

View File

@ -53,7 +53,7 @@
</li>
<li>
<span class="name">计划量</span>
<span>{{ item.planWeight }}公斤</span>
<span>{{ formatNumber(item.planWeight) }}公斤</span>
</li>
<li>
@ -96,11 +96,11 @@
<div class="out-right">
<ul>
<li>
<span class="name">工单号</span>
<span>{{ item.orderNum }}</span>
<span class="name">品牌编码</span>
<span>{{ item.itemNum }}</span>
</li>
<li>
<span class="name">品牌</span>
<span class="name">品牌名称</span>
<span>{{ item.itemDesc }}</span>
</li>
<li>
@ -116,8 +116,14 @@
<span class="name">剩余箱数</span>
<span>{{ item.leftNum }}</span>
</li>
<li style="opacity:0"></li>
<li style="opacity:0"></li>
<li>
<span class="name">当前批次</span>
<span>{{ item.currentBatch }}</span>
</li>
<li>
<span class="name">下一批次</span>
<span>{{ item.preset1 }}</span>
</li>
</ul>
</div>
</div>
@ -235,6 +241,18 @@ function getOrderDetail(){
function getResult(item){
return item.planBoxQuantity - item.inNum
}
function formatNumber(num) {
if (typeof num === "number" && !isNaN(num)) {
//
if (Number.isInteger(num)) {
return num; //
} else {
return Number.parseFloat(num).toFixed(2); //
}
} else {
throw new Error("Invalid input"); //
}
}
onMounted(()=>{
getOrderDetail()
})

View File

@ -7,8 +7,8 @@
</div>
<div class="box-content">
<el-table :data="list" style="width: 100%">
<el-table-column prop="batchNum" label="批次号" width="180" />
<el-table-column prop="itemDesc" label="品牌" width="180" />
<el-table-column prop="batchNum" label="批次号" width="180" />
<el-table-column prop="inTime" label="入库时间" />
<el-table-column prop="weight" label="重量(kg)" />
<el-table-column prop="boxCount" label="箱数" />

View File

@ -3,7 +3,7 @@
<div class="header-date">
{{ nowDate }}
</div>
<div class="header-title">数字孪生三维可视化系统</div>
<div class="header-title">三维孪生信息系统</div>
<div class="header-weather"></div>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<Nav />
<div class="unity">
<!-- <iframe src="model/index.html" frameborder="0"></iframe> -->
<iframe src="model/index.html" frameborder="0"></iframe>
</div>
<div class="home">
<div class="home-left">
@ -11,11 +11,7 @@
<!-- <span class="home-title-more"> </span> -->
</div>
<div class="home-left-device">
<div
class="home-left-device-box"
v-for="(s, i) in deviceList"
:key="'d' + i"
>
<div class="home-left-device-box" v-for="(s, i) in deviceList" :key="'d' + i">
<img :src="s.deviceImg" alt="" />
<div>
<p>{{ s.deviceStatus }}</p>
@ -29,16 +25,16 @@
<span class="home-title-more" @click="brandShow = true"> </span>
</div>
<div class="home-left-brand" id="brand">
<div
v-for="(item, index) in brandList"
:key="'brand' + index"
class="item"
>
<div v-for="(item, index) in brandList" :key="'brand' + index" class="item">
<div class="home-left-brand-title">
<span>{{ item.name }}</span
><span class="pct"
>{{ item.stockNum }}<span class="kg"></span></span
>
>{{ item.stockNum
}}<span class="kg"
>
<span> &nbsp; {{ formatNumber(item.weight) }}<span class="kg">公斤</span></span>
</span>
</span>
</div>
<div class="home-left-brand-progress">
<div
@ -55,18 +51,13 @@
</div>
<div class="home-left-messageReminder">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in messageReminder"
:key="index"
>
<el-timeline-item v-for="(activity, index) in messageReminder" :key="index">
<p>{{ activity.msg }}</p>
<p class="home-left-messageReminder-data">
<span style="color: rgba(148, 219, 255, 1)">{{
activity.reminderMsg
}}</span>
<span style="color: rgba(192, 192, 192, 1)">{{
activity.date
}}</span>
<span style="color: rgba(192, 192, 192, 1)">{{ activity.date }}</span>
</p>
</el-timeline-item>
</el-timeline>
@ -212,7 +203,7 @@ import inventoryNews from "./components/homeDialog/inventoryNews"; //库存消
import inOutBound from "./components/homeDialog/inOutBound";
import { Search } from "@element-plus/icons-vue"; //
import * as echarts from "echarts";
import { ref, onMounted } from "vue";
import { ref, onMounted, proxyRefs, getCurrentInstance } from "vue";
import getPath from "@/utils/getPath";
import {
getEquipStatus,
@ -224,6 +215,8 @@ import {
getLocInfo,
} from "@/api/home";
import { fontSize } from "@/utils/common";
const { proxy } = getCurrentInstance();
//
const deviceList = ref([
{
@ -425,71 +418,79 @@ const searchData = ref();
// echarts
function drawInventoryNewsEcahrt(result) {
console.log(result, "库存消息");
// result. = 400
// result. = 300
let myChart = echarts.init(document.getElementById("inventoryNews"));
var scaleData = [
// {
// name: "",
// value: 1174,
// radius1: ["51%", "53%"],
// },
// {
// name: "",
// value: 1101,
// radius1: ["59%", "60%"],
// },
// {
// name: "",
// value: 68,
// radius1: ["67%", "68%"],
// },
{
name: "正在进行任务数",
value: result.taskDoingNum,
radius1: ["51%", "53%"],
},
{
name: "实箱",
value: result.fullBoxNum,
radius1: ["59%", "60%"],
},
{
name: "空箱",
value: result.emptyBoxNum,
radius1: ["67%", "68%"],
},
{
name: "库存总量",
value: result.inventoryNum,
radius1: ["67%", "68%"],
},
{
name: "批次数量",
value: result.batchNum,
radius1: ["67%", "68%"],
},
];
let index = 0;
for (let key in result) {
scaleData.push({
name: key,
value: result[key],
});
index++;
}
// for (let key in result) {
// scaleData.push({
// name: key,
// value: result[key],
// });
// index++;
// }
// let box = {
// name:'',
// value:,
// }
//
// scaleData.forEach((el,index) => {
// console.log(el);
// });
let box = {
name:'特殊箱子',
value:0,
}
for(let i = 0;i<scaleData.length;i++){
if(scaleData[i].name==='特殊空箱子'){
box.value = box.value + scaleData[i].value
scaleData.splice(i,1)
i--
}
if(scaleData[i].name==='特殊实箱子'){
box.value = box.value + scaleData[i].value
scaleData.splice(i,1)
i--
}
}
name: "特殊箱子",
value: 0,
};
// for (let i = 0; i < scaleData.length; i++) {
// if (scaleData[i].name === "") {
// box.value = box.value + scaleData[i].value;
// scaleData.splice(i, 1);
// i--;
// }
// if (scaleData[i].name === "") {
// box.value = box.value + scaleData[i].value;
// scaleData.splice(i, 1);
// i--;
// }
// }
// console.log(scaleData);
// box.radius1 = [43 + (scaleData.length-1) * 8 + "%" + "", 45 + (scaleData.length-1) * 8 + "%" + ""]
if(box.value != 0){
scaleData.push(box)
if (box.value != 0) {
scaleData.push(box);
}
scaleData.forEach((el,index)=>{
el.radius1 = [43 + index * 8 + "%" + "", 45 + index * 8 + "%" + ""]
})
scaleData.forEach((el, index) => {
el.radius1 = [43 + index * 8 + "%" + "", 45 + index * 8 + "%" + ""];
});
var placeHolderStyle = {
label: {
show: false,
@ -511,7 +512,6 @@ function drawInventoryNewsEcahrt(result) {
// "rgba(0, 245, 194, 1)",
"rgba(28, 238, 251, 1)",
"rgba(255, 192, 203,1)",
];
for (var i = 0; i < scaleData.length; i++) {
seriesObj.push({
@ -578,7 +578,7 @@ function drawInventoryNewsEcahrt(result) {
itemWidth: fontSize(0.1),
itemHeight: fontSize(0.1),
itemGap: fontSize(0.2),
data: scaleData.map((el,index) => {
data: scaleData.map((el, index) => {
return el.name;
}),
// itemStyle:{
@ -857,9 +857,23 @@ function getInboundWorkOrder() {
inboundWorkOrder.value = res.result;
inboundWorkOrder.value.forEach((el) => {
el.pic = getPath.inDevice;
el.inWeight = formatNumber(el.inWeight);
el.planWeight = formatNumber(el.planWeight);
});
});
}
function formatNumber(num) {
if (typeof num === "number" && !isNaN(num)) {
//
if (Number.isInteger(num)) {
return num; //
} else {
return Number.parseFloat(num).toFixed(2); //
}
} else {
throw new Error("Invalid input"); //
}
}
onMounted(() => {
getDeviceStatus(); //
@ -925,7 +939,7 @@ onMounted(() => {
position: relative;
z-index: 99;
width: vw(368);
width: vw(358);
}
&-left {
background-image: url("@/assets/images/home/左侧遮罩.png");
@ -1165,4 +1179,4 @@ onMounted(() => {
top: 2rem;
left: 6px;
}
</style>
</style>

View File

@ -94,7 +94,7 @@ function submitForm(elForm) {
localStorage.setItem("loginInfo", JSON.stringify({}));
}
login(ruleForm).then((res) => {
if (res.result) {
if (res.result == '登录成功') {
ElMessage({
message: "登录成功",
type: "success",