替换三维模型
This commit is contained in:
parent
1921755332
commit
ecaac9831f
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1,127 +1,133 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en-us">
|
<html lang="en-us">
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Unity WebGL Player | CD</title>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
<title>Unity WebGL Player | CD</title>
|
||||||
<link rel="stylesheet" href="TemplateData/style.css">
|
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
||||||
</head>
|
<link rel="stylesheet" href="TemplateData/style.css">
|
||||||
<style>body,html{
|
</head>
|
||||||
|
<style>
|
||||||
|
body,
|
||||||
|
html {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}</style>
|
}
|
||||||
<body>
|
</style>
|
||||||
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%">
|
|
||||||
<canvas id="unity-canvas" style="width: 100%;height: 100%"></canvas>
|
<body>
|
||||||
<div id="unity-loading-bar">
|
<div id="unity-container" class="unity-desktop" style="width: 100%;height: 100%">
|
||||||
<div id="unity-logo"></div>
|
<canvas id="unity-canvas" style="width: 100%;height: 100%"></canvas>
|
||||||
<div id="unity-progress-bar-empty">
|
<div id="unity-loading-bar">
|
||||||
<div id="unity-progress-bar-full"></div>
|
<div id="unity-logo"></div>
|
||||||
</div>
|
<div id="unity-progress-bar-empty">
|
||||||
</div>
|
<div id="unity-progress-bar-full"></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">CD</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<div id="unity-warning"> </div>
|
||||||
var container = document.querySelector("#unity-container");
|
<div id="unity-footer">
|
||||||
var canvas = document.querySelector("#unity-canvas");
|
<div id="unity-webgl-logo"></div>
|
||||||
var loadingBar = document.querySelector("#unity-loading-bar");
|
<div id="unity-fullscreen-button"></div>
|
||||||
var progressBarFull = document.querySelector("#unity-progress-bar-full");
|
<div id="unity-build-title">CD</div>
|
||||||
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
|
</div>
|
||||||
var warningBanner = document.querySelector("#unity-warning");
|
</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");
|
||||||
|
|
||||||
// Shows a temporary message banner/ribbon for a few seconds, or
|
// Shows a temporary message banner/ribbon for a few seconds, or
|
||||||
// a permanent error message on top of the canvas if type=='error'.
|
// a permanent error message on top of the canvas if type=='error'.
|
||||||
// If type=='warning', a yellow highlight color is used.
|
// If type=='warning', a yellow highlight color is used.
|
||||||
// Modify or remove this function to customize the visually presented
|
// Modify or remove this function to customize the visually presented
|
||||||
// way that non-critical warnings and error messages are presented to the
|
// way that non-critical warnings and error messages are presented to the
|
||||||
// user.
|
// user.
|
||||||
function unityShowBanner(msg, type) {
|
function unityShowBanner(msg, type) {
|
||||||
function updateBannerVisibility() {
|
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);
|
|
||||||
}
|
|
||||||
updateBannerVisibility();
|
|
||||||
}
|
}
|
||||||
|
var div = document.createElement('div');
|
||||||
var buildUrl = "Build";
|
div.innerHTML = msg;
|
||||||
var loaderUrl = buildUrl + "/build.loader.js";
|
warningBanner.appendChild(div);
|
||||||
var config = {
|
if (type == 'error') div.style = 'background: red; padding: 10px;';
|
||||||
dataUrl: buildUrl + "/build.data.unityweb",
|
else {
|
||||||
frameworkUrl: buildUrl + "/build.framework.js.unityweb",
|
if (type == 'warning') div.style = 'background: yellow; padding: 10px;';
|
||||||
codeUrl: buildUrl + "/build.wasm.unityweb",
|
setTimeout(function () {
|
||||||
streamingAssetsUrl: "StreamingAssets",
|
warningBanner.removeChild(div);
|
||||||
companyName: "DefaultCompany",
|
updateBannerVisibility();
|
||||||
productName: "CD",
|
}, 5000);
|
||||||
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;
|
|
||||||
|
|
||||||
unityShowBanner('WebGL builds are not supported on mobile devices.');
|
|
||||||
} 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();
|
||||||
|
}
|
||||||
|
|
||||||
loadingBar.style.display = "block";
|
var buildUrl = "Build";
|
||||||
var unityInstanceA
|
var loaderUrl = buildUrl + "/build.loader.js";
|
||||||
var script = document.createElement("script");
|
var config = {
|
||||||
script.src = loaderUrl;
|
dataUrl: buildUrl + "/build.data.gz",
|
||||||
script.onload = () => {
|
frameworkUrl: buildUrl + "/build.framework.js.gz",
|
||||||
createUnityInstance(canvas, config, (progress) => {
|
codeUrl: buildUrl + "/build.wasm.gz",
|
||||||
progressBarFull.style.width = 100 * progress + "%";
|
streamingAssetsUrl: "StreamingAssets",
|
||||||
}).then((unityInstance) => {
|
companyName: "DefaultCompany",
|
||||||
unityInstanceA = unityInstance
|
productName: "CD",
|
||||||
loadingBar.style.display = "none";
|
productVersion: "0.1",
|
||||||
fullscreenButton.onclick = () => {
|
showBanner: unityShowBanner,
|
||||||
unityInstance.SetFullscreen(1);
|
};
|
||||||
};
|
|
||||||
}).catch((message) => {
|
// By default Unity keeps WebGL canvas render target size matched with
|
||||||
alert(message);
|
// 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
|
||||||
document.body.appendChild(script);
|
// the canvas DOM size and WebGL render target sizes yourself.
|
||||||
// unity交互
|
// config.matchWebGLToCanvasSize = false;
|
||||||
function unity3D(val){
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
unityShowBanner('WebGL builds are not supported on mobile devices.');
|
||||||
|
} else {
|
||||||
|
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
|
||||||
|
|
||||||
|
// canvas.style.width = "1920px";
|
||||||
|
// canvas.style.height = "1080px";
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingBar.style.display = "block";
|
||||||
|
|
||||||
|
var script = document.createElement("script");
|
||||||
|
var unityInstanceA
|
||||||
|
script.src = loaderUrl;
|
||||||
|
script.onload = () => {
|
||||||
|
createUnityInstance(canvas, config, (progress) => {
|
||||||
|
progressBarFull.style.width = 100 * progress + "%";
|
||||||
|
}).then((unityInstance) => {
|
||||||
|
unityInstanceA = unityInstance
|
||||||
|
loadingBar.style.display = "none";
|
||||||
|
fullscreenButton.onclick = () => {
|
||||||
|
unityInstance.SetFullscreen(1);
|
||||||
|
};
|
||||||
|
}).catch((message) => {
|
||||||
|
alert(message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
document.body.appendChild(script);
|
||||||
|
// unity交互
|
||||||
|
function unity3D(val){
|
||||||
// OpenWebPanel()
|
// OpenWebPanel()
|
||||||
unityInstanceA.SendMessage("App", "SetState", val + '')
|
unityInstanceA.SendMessage("App", "SetState", val + '')
|
||||||
}
|
}
|
||||||
|
|
@ -139,6 +145,7 @@
|
||||||
function closeStrategy(){
|
function closeStrategy(){
|
||||||
unityInstanceA.SendMessage("空调tip", "HideUnityPanel",'')
|
unityInstanceA.SendMessage("空调tip", "HideUnityPanel",'')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
<!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 | CD</title>
|
||||||
|
<link rel="shortcut icon" href="TemplateData/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="TemplateData/style.css">
|
||||||
|
</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%"></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">CD</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");
|
||||||
|
|
||||||
|
// 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 + "/build.loader.js";
|
||||||
|
var config = {
|
||||||
|
dataUrl: buildUrl + "/build.data.unityweb",
|
||||||
|
frameworkUrl: buildUrl + "/build.framework.js.unityweb",
|
||||||
|
codeUrl: buildUrl + "/build.wasm.unityweb",
|
||||||
|
streamingAssetsUrl: "StreamingAssets",
|
||||||
|
companyName: "DefaultCompany",
|
||||||
|
productName: "CD",
|
||||||
|
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;
|
||||||
|
|
||||||
|
unityShowBanner('WebGL builds are not supported on mobile devices.');
|
||||||
|
} else {
|
||||||
|
// Desktop style: Render the game canvas in a window that can be maximized to fullscreen:
|
||||||
|
|
||||||
|
// canvas.style.width = "960px";
|
||||||
|
// canvas.style.height = "600px";
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingBar.style.display = "block";
|
||||||
|
var unityInstanceA
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.src = loaderUrl;
|
||||||
|
script.onload = () => {
|
||||||
|
createUnityInstance(canvas, config, (progress) => {
|
||||||
|
progressBarFull.style.width = 100 * progress + "%";
|
||||||
|
}).then((unityInstance) => {
|
||||||
|
unityInstanceA = unityInstance
|
||||||
|
loadingBar.style.display = "none";
|
||||||
|
fullscreenButton.onclick = () => {
|
||||||
|
unityInstance.SetFullscreen(1);
|
||||||
|
};
|
||||||
|
}).catch((message) => {
|
||||||
|
alert(message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
document.body.appendChild(script);
|
||||||
|
// unity交互
|
||||||
|
function unity3D(val){
|
||||||
|
// OpenWebPanel()
|
||||||
|
unityInstanceA.SendMessage("App", "SetState", val + '')
|
||||||
|
}
|
||||||
|
// 打开web弹窗
|
||||||
|
function OnButtonClick(val){
|
||||||
|
console.log(val)
|
||||||
|
let name = "控制箱名称"
|
||||||
|
window.parent.openBox(name)
|
||||||
|
}
|
||||||
|
// 关闭照明
|
||||||
|
function closeLight(){
|
||||||
|
unityInstanceA.SendMessage("照明tip", "HideUnityPanel",'')
|
||||||
|
}
|
||||||
|
// 关闭策略
|
||||||
|
function closeStrategy(){
|
||||||
|
unityInstanceA.SendMessage("空调tip", "HideUnityPanel",'')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -47,4 +47,12 @@ export function getPolicyEditing(params){
|
||||||
method:'get',
|
method:'get',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// 获取开机设备
|
||||||
|
export function getStrategyCompilation(params){
|
||||||
|
return http({
|
||||||
|
url:'/api/GetStrategyCompilation',
|
||||||
|
method:'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -52,12 +52,12 @@ p,ul,li{
|
||||||
|
|
||||||
&-right-box {
|
&-right-box {
|
||||||
padding-right: 2.375rem;
|
padding-right: 2.375rem;
|
||||||
//animation: slide-out 2s ease-in-out;
|
animation: slide-out 2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-left-box {
|
&-left-box {
|
||||||
padding-left: 2.375rem;
|
padding-left: 2.375rem;
|
||||||
//animation: slide-out 2s ease-in-out;
|
animation: slide-out 2s ease-in-out;
|
||||||
//transform: translateX(-100%);
|
//transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import {getStrategyCompilation} from '@/api/air-conditioning';
|
||||||
|
import {ref,onMounted} from 'vue'
|
||||||
const checkAll = ref(false)
|
const checkAll = ref(false)
|
||||||
const isIndeterminate = ref(true)
|
const isIndeterminate = ref(false)
|
||||||
// 父组件传值
|
// 父组件传值
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dialogName:{
|
dialogName:{
|
||||||
|
|
@ -9,31 +10,47 @@ const props = defineProps({
|
||||||
default:''
|
default:''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
onMounted(()=>{
|
||||||
|
|
||||||
|
getStrategyCompilation({name:props.dialogName}).then(res=>{
|
||||||
|
checkedSystem.value = res.data[0].UnitName.filter(el=>{return el !== ''})
|
||||||
|
systems.value = res.data[0].PlantName
|
||||||
|
// 全选框是否选中
|
||||||
|
checkAll.value = checkedSystem.value.length === systems.value.length
|
||||||
|
// 半选框是否选中
|
||||||
|
isIndeterminate.value = checkedSystem.value.length > 0 && checkedSystem.value.length < systems.value.length
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
const emit = defineEmits(['update'])
|
const emit = defineEmits(['update'])
|
||||||
const closeDialog = () =>{
|
const closeDialog = () =>{
|
||||||
|
emit('sendDevice',checkedSystem.value)
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
emit('update',false)
|
emit('update',false)
|
||||||
|
|
||||||
}
|
}
|
||||||
// 选中设备
|
// 选中设备
|
||||||
const checkedSystem = ref(['2号机窗'])
|
const checkedSystem = ref(['2号机窗'])
|
||||||
const systems = ['1号机窗', '2号机窗', '3号机窗', '4号机窗']
|
const systems = ref(['1号机窗', '2号机窗', '3号机窗', '4号机窗'])
|
||||||
|
|
||||||
|
//
|
||||||
const handleCheckAllChange = (val) => {
|
const handleCheckAllChange = (val) => {
|
||||||
checkedSystem.value = val ? systems : []
|
checkedSystem.value = val ? systems.value : []
|
||||||
isIndeterminate.value = false
|
isIndeterminate.value = false
|
||||||
}
|
}
|
||||||
const handleCheckedCitiesChange = (value) => {
|
// 多选框勾选事件
|
||||||
|
const handleCheckedCitiesChange = (value) => {
|
||||||
const checkedCount = value.length
|
const checkedCount = value.length
|
||||||
checkAll.value = checkedCount === systems.length
|
checkAll.value = checkedCount === systems.value.length
|
||||||
isIndeterminate.value = checkedCount > 0 && checkedCount < systems.length
|
isIndeterminate.value = (checkedCount > 0 && checkedCount < systems.value.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭设备的按钮
|
// 关闭设备的按钮
|
||||||
const toggleClose = (index) =>{
|
const toggleClose = (index) =>{
|
||||||
checkedSystem.value.splice(index,1)
|
checkedSystem.value.splice(index,1)
|
||||||
const checkedCount = checkedSystem.value.length
|
const checkedCount = checkedSystem.value.length
|
||||||
checkAll.value = checkedCount === systems.length
|
checkAll.value = checkedCount === systems.value.length
|
||||||
isIndeterminate.value = checkedCount > 0 && checkedCount < systems.length
|
isIndeterminate.value = checkedCount > 0 && checkedCount < systems.value.length
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -81,6 +98,12 @@ const toggleClose = (index) =>{
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
:deep(.el-checkbox-group){
|
||||||
|
overflow-y:scroll;
|
||||||
|
}
|
||||||
|
:deep(.el-checkbox-group::-webkit-scrollbar){
|
||||||
|
display:none
|
||||||
|
}
|
||||||
.dialog-box{
|
.dialog-box{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 90%;
|
height: 90%;
|
||||||
|
|
@ -107,11 +130,15 @@ const toggleClose = (index) =>{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 2%;
|
margin-bottom: 2%;
|
||||||
}
|
}
|
||||||
|
.system::-webkit-scrollbar{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
.system{
|
.system{
|
||||||
|
overflow-y:scroll;
|
||||||
height: 80%;
|
height: 80%;
|
||||||
.select-system{
|
.select-system{
|
||||||
margin-bottom: 2%;
|
margin-bottom: 2%;
|
||||||
width: 60%;
|
width: 70%;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
padding-right: .5rem;
|
padding-right: .5rem;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
@ -124,6 +151,7 @@ const toggleClose = (index) =>{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.close{
|
.close{
|
||||||
width: 8%;
|
width: 8%;
|
||||||
|
margin-left:.54rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 40%;
|
height: 40%;
|
||||||
background-image: url("@/assets/images/air-conditioning/close-btn.png");
|
background-image: url("@/assets/images/air-conditioning/close-btn.png");
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
import {ref, reactive,onMounted} from "vue";
|
import {ref, reactive,onMounted} from "vue";
|
||||||
import getPath from "@/utils/getPath.js";
|
import getPath from "@/utils/getPath.js";
|
||||||
import dialogBox from './components/dialogBox.vue'
|
import dialogBox from './components/dialogBox.vue'
|
||||||
|
|
@ -161,12 +162,31 @@ const dialogName = ref('')
|
||||||
const openDialog = (name) =>{
|
const openDialog = (name) =>{
|
||||||
emit("closeAir","")
|
emit("closeAir","")
|
||||||
dialogBoxShow.value = true
|
dialogBoxShow.value = true
|
||||||
|
|
||||||
dialogName.value = name
|
dialogName.value = name
|
||||||
}
|
}
|
||||||
const closeDialog = (val) =>{
|
const closeDialog = (val) =>{
|
||||||
|
let params = {
|
||||||
|
name:dialogName.value,
|
||||||
|
value:deviceList.value===""?null: deviceList.value
|
||||||
|
}
|
||||||
|
console.log(deviceList.value,'参数',params);
|
||||||
|
getPolicyEditing(params).then(res=>{
|
||||||
|
if(res.code===200){
|
||||||
|
ElMessage({
|
||||||
|
message: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
dialogBoxShow.value = val
|
dialogBoxShow.value = val
|
||||||
}
|
}
|
||||||
|
const deviceList = ref('')
|
||||||
|
// 获取设备数组
|
||||||
|
const getDevice = (data) =>{
|
||||||
|
console.log(data);
|
||||||
|
// 获取设备
|
||||||
|
deviceList.value = data.join(',')
|
||||||
|
}
|
||||||
//维护提醒
|
//维护提醒
|
||||||
const controlBtn = ref('on')
|
const controlBtn = ref('on')
|
||||||
const toggleControl = (event) => {
|
const toggleControl = (event) => {
|
||||||
|
|
@ -250,7 +270,7 @@ onMounted(()=>{
|
||||||
<template>
|
<template>
|
||||||
<div class="page m100">
|
<div class="page m100">
|
||||||
<!-- 弹窗-->
|
<!-- 弹窗-->
|
||||||
<dialogBox v-show="dialogBoxShow" @update="closeDialog" :dialogName="dialogName"/>
|
<dialogBox v-if="dialogBoxShow" @update="closeDialog" :dialogName="dialogName" @sendDevice="getDevice"/>
|
||||||
<div class="page-left-box">
|
<div class="page-left-box">
|
||||||
<!-- 概况-->
|
<!-- 概况-->
|
||||||
<div class="title">
|
<div class="title">
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
'/dev-api': {
|
'/dev-api': {
|
||||||
target: 'http://172.16.1.156:8021/',
|
target: 'http://172.16.1.125:8021/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue