完成一半
This commit is contained in:
@@ -63,11 +63,22 @@ const loader = new OBJLoader();
|
|||||||
let hdrLoader = new RGBELoader();
|
let hdrLoader = new RGBELoader();
|
||||||
let backColorSet = three.sRGBEncoding;
|
let backColorSet = three.sRGBEncoding;
|
||||||
const modelStore = useModelSceneStore();
|
const modelStore = useModelSceneStore();
|
||||||
const params = defineProps(["isedit", "tunnelId", "tunnelLen", "tunnelName"]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
const params = defineProps(["isedit", "tunnelId", "tunnelLen", "tunnelName", "largeScreen"]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let isedit = ref(params.isedit)
|
let isedit = ref(params.isedit)
|
||||||
|
let fanData = reactive();
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => params.largeScreen,
|
||||||
|
(now) => {
|
||||||
|
params.largeScreen = now;
|
||||||
|
fanData = (toRaw(params.largeScreen.value)).frequencyChangerList;
|
||||||
|
console.log(fanData);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
// const form = ref({
|
// const form = ref({
|
||||||
// tunnelName: "",
|
// tunnelName: "",
|
||||||
// serialNumber: "",
|
// serialNumber: "",
|
||||||
@@ -144,6 +155,7 @@ async function handleMounted() {
|
|||||||
// console.log("init", params.tunnelId);
|
// console.log("init", params.tunnelId);
|
||||||
demo.previewtunnelModeInit(toRaw(modelList.value));
|
demo.previewtunnelModeInit(toRaw(modelList.value));
|
||||||
demo.SignsInf(params.tunnelName, String(params.tunnelLen.value))
|
demo.SignsInf(params.tunnelName, String(params.tunnelLen.value))
|
||||||
|
checkFanColor(fanData);
|
||||||
// watch(
|
// watch(
|
||||||
// () => params.tunnelId,
|
// () => params.tunnelId,
|
||||||
// (now) => {
|
// (now) => {
|
||||||
@@ -343,6 +355,9 @@ function previewEquInfProcess(equipmentList, targetP) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkFanColor(fanData) {
|
||||||
|
demo.scene.getObjectByName('1号变频器');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -512,7 +512,7 @@ export default class Demo {
|
|||||||
}
|
}
|
||||||
SignsInf(tunnelName, tunnelLength) {
|
SignsInf(tunnelName, tunnelLength) {
|
||||||
let Signs = this.scene.getObjectByName('streetSigns');
|
let Signs = this.scene.getObjectByName('streetSigns');
|
||||||
console.log(Signs);
|
// console.log(Signs);
|
||||||
const tag = new this.THREE.Mesh(
|
const tag = new this.THREE.Mesh(
|
||||||
new this.THREE.PlaneGeometry(100, 76),
|
new this.THREE.PlaneGeometry(100, 76),
|
||||||
new this.THREE.MeshBasicMaterial({ color: "white" })
|
new this.THREE.MeshBasicMaterial({ color: "white" })
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
||||||
|
|
||||||
<preview-scene id="tunnel-box" :isedit="false" :tunnelId="tunnelId" :key="tunnelId" :tunnelLen="tunnelLen"
|
<preview-scene id="tunnel-box" :isedit="false" :tunnelId="tunnelId" :key="tunnelId" :tunnelLen="tunnelLen"
|
||||||
:tunnelName="tunnelName"></preview-scene>
|
:tunnelName="tunnelName" :largeScreen="largeScreen"></preview-scene>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<el-drawer v-model="drawerLeft" direction="ltr" modal-class="modal-box" :modal="false" :show-close="false"
|
<el-drawer v-model="drawerLeft" direction="ltr" modal-class="modal-box" :modal="false" :show-close="false"
|
||||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
@@ -87,6 +87,7 @@ import { getLargeScreen, getLargeScreenInfo, getTunnelBySiteId } from "@/api/lar
|
|||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { getUserInfo } from "@/api/login";
|
import { getUserInfo } from "@/api/login";
|
||||||
import { initSceneData } from "@/api/tunnelScene";
|
import { initSceneData } from "@/api/tunnelScene";
|
||||||
|
import { computed } from "vue";
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const previewId = reactive(router.currentRoute.value.params.tunnelId)
|
const previewId = reactive(router.currentRoute.value.params.tunnelId)
|
||||||
@@ -190,9 +191,9 @@ const getOtherInfo = () => {
|
|||||||
currentSiteId.value = res.data.siteOption[0].value
|
currentSiteId.value = res.data.siteOption[0].value
|
||||||
currentSite.value = res.data.siteOption[0].label
|
currentSite.value = res.data.siteOption[0].label
|
||||||
localStorage.setItem('site', currentSite.value)
|
localStorage.setItem('site', currentSite.value)
|
||||||
if(res.data.tunnelOption.length === 0){
|
if (res.data.tunnelOption.length === 0) {
|
||||||
getTunnel(res.data.siteOption[0].value)
|
getTunnel(res.data.siteOption[0].value)
|
||||||
}else {
|
} else {
|
||||||
tunnelList.value = res.data.tunnelOption
|
tunnelList.value = res.data.tunnelOption
|
||||||
}
|
}
|
||||||
if (previewId) {
|
if (previewId) {
|
||||||
@@ -241,6 +242,7 @@ const getScreenInfo = (id) => {
|
|||||||
showBadLoading.value = 1
|
showBadLoading.value = 1
|
||||||
}
|
}
|
||||||
largeScreenData.value = res.data;
|
largeScreenData.value = res.data;
|
||||||
|
// console.log(largeScreenData.value);
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg)
|
ElMessage.warning(res.msg)
|
||||||
}
|
}
|
||||||
@@ -254,13 +256,14 @@ const getScreenInfo = (id) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
//根据站点id获取隧道信息
|
//根据站点id获取隧道信息
|
||||||
|
let largeScreen = computed(() => largeScreenData)
|
||||||
const getTunnel = (id) => {
|
const getTunnel = (id) => {
|
||||||
getTunnelBySiteId(id).then((res) => {
|
getTunnelBySiteId(id).then((res) => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
if(res.data.length === 0){
|
if (res.data.length === 0) {
|
||||||
ElMessage.warning('该站点下无隧道, 请新增隧道后再尝试!')
|
ElMessage.warning('该站点下无隧道, 请新增隧道后再尝试!')
|
||||||
tunnelList.value = []
|
tunnelList.value = []
|
||||||
}else {
|
} else {
|
||||||
getScreenInfo(res.data[0]?.value)
|
getScreenInfo(res.data[0]?.value)
|
||||||
tunnelName = res.data[0].label
|
tunnelName = res.data[0].label
|
||||||
tunnelList.value = res.data
|
tunnelList.value = res.data
|
||||||
|
|||||||
Reference in New Issue
Block a user