liuqiao 1 jaar geleden
bovenliggende
commit
d10bbb0520

+ 2 - 21
src/router/index.js

@@ -8,10 +8,6 @@ import result from '@/view/result.vue';
 const router = createRouter({
     history: createWebHashHistory(),
     routes: [
-        {
-            path: '/myHome',
-            component: () => import('@/components/myHome.vue') // 这是路由的籁加载,也可以其他方式
-        },
         {
             path: '/configurator',
             name:'模型库',
@@ -31,15 +27,7 @@ const router = createRouter({
         //         title: '首页'
         //     }
         // },
-        {
-          path: '/myHome',
-          name:'首页1',
-          component: () => import('@/view/myHome.vue'),
-          meta:{
-              keepAlive:false, // 需要缓存
-              title: '首页1'
-          }
-      },
+        
         {
           path: '/',
           name:'主页',
@@ -48,14 +36,7 @@ const router = createRouter({
               keepAlive:false, // 需要缓存
               title: '主页'
           },
-          children: [
-            // 这里可以定义子路由,它们将在Home组件的<RouterView>内渲染
-            {
-              path: '/myHome',
-              name:"myhome",
-              component: () => import('@/view/myHome.vue')
-            }
-          ]
+         
       },
 
 {

+ 37 - 0
src/style/style.css

@@ -1695,4 +1695,41 @@ background-color: #F9A466  !important;
 }
 .has-time .el-button>span{
 color: #666;
+}
+.htmlclass .xuandian{
+  position: absolute;
+  z-index: 11111;
+right: 30px;
+  top: 20%;
+  width: 400px;
+/* height: 300px; */
+padding: 20px;
+background: radial-gradient(closest-side, #0B338B , #1C253D);
+/* background: linear-gradient( 270deg, rgba(201,0,0,0) 0%, rgba(201,0,0,0.32) 0%, rgba(255,222,204,0) 38%, #DE2C2C 65%, rgba(201,0,0,0.55) 100%);
+border-radius: 0px 0px 0px 0px;
+border: 1px solid;
+border-image: linear-gradient(324deg, rgba(201, 0, 0, 1), rgba(255, 252, 252, 1)) 1 1; */
+/* background: linear-gradient( 270deg, rgba(201,0,0,0) 0%, rgba(201,0,0,0.32) 0%, rgba(255,222,204,0.76) 38%, #F45A5A 65%, rgba(201,0,0,0.55) 100%);
+border-radius: 0px 0px 0px 0px; */
+}
+.htmlclass_txte{
+  color: #fff;
+  font-size: 13px;
+  font-weight: bold;
+  text-align: left;
+  margin-top: 20px;
+}
+.telet{
+  color: #fff !important;
+  padding: 14px 0 0 20px;
+  font-size: 16px;
+  font-weight: bold;
+  text-align: left;
+
+}
+.htmlclass .tiaozhaun{
+  color: #fff !important;
+}
+a{
+  color: #fff  !important;
 }

+ 0 - 1
src/view/appmian.vue

@@ -45,7 +45,6 @@
     <div class="vtkmodel1" id="infomodel" v-show="modelshow"><InfoVtkmodel ref="vtkmodel" /></div>
      
       </el-main>
-   
       <div class=" bgk3" v-show="bgk2false">
       <div class="bgk2 bgk3">
           <div>

+ 34 - 55
src/view/index/first-left.vue

@@ -136,6 +136,7 @@
       </div>
     </el-aside> -->
   </div>
+  <htmldialog ref="htmldialogref" :isshow='isshow' @funidshow="funidshow"/>
 </template>
 <script setup>
 import { ref, onMounted, reactive, } from "vue";
@@ -154,6 +155,7 @@ import t1 from "@/assets/img/t1.png";
 import t2 from "@/assets/img/t2.png";
 import t3 from "@/assets/img/t3.png";
 import t4 from "@/assets/img/t4.png";
+import htmldialog from "./htmldialog.vue"
 let firstshow = ref(false);
 let activeNames = ref(["1",'2']);
 let tableHeight = ref(130);
@@ -161,6 +163,7 @@ let playshow=ref(true);
 let suspendshow=ref(false);
 let showfalse=ref(false);
 let c=ref("0");
+let htmldialogref=ref();
 let pa=ref("30s");
 const isstop = ref(false);
 let noneshow=ref(false);
@@ -186,6 +189,9 @@ let warnin2=ref(0);
 const min = ref(0);
 const max = ref(1);
 let selelist=ref();
+let jgSelectPointId=ref(0);
+let selobj=ref([]);
+let isshow=ref(false);
 const dynamicHeaders = ref([
 
 ]);
@@ -307,6 +313,7 @@ await request(params)
       vtkmodel.clearModeAddJg();
       reddate(new Date());
       vtkGridRead();
+      jgSelect1();
       firstshow.value=true;
       endtime.value= Number(res.totaltime)/Number(res.reportstep);
     }else if(res.state=='-1'){
@@ -500,27 +507,6 @@ const randomColor=()=>{
           console.log(color);
             return color;
         }
-
-// const randerColor=()=>{
-//       let arr = [];
-//      alarmTypeLine.forEach(item=>{
-//       random(arr)
-//       })
-//       console.log(arrr);
-//       return arr;
-//     }
-//     const random=(arr)=>{
-//       let color = 'rgb(' + [
-//         Math.round(Math.random() * 255),
-//         Math.round(Math.random() * 255),
-//         Math.round(Math.random() * 255)
-//       ].join(',') + ')';
-//       if(!arr.some(i=>i==color)){
-//         arr.push(color)
-//       }else{
-//        random(arr)
-//       }
-//     }
 // 批量数据
 const handleDelete=(event)=>{
  jcname.value=event.chname;
@@ -554,40 +540,6 @@ const handleDelete=(event)=>{
       showSymbol: false,
       smooth: true,
       data:arr,//res.rows[i].data
-        //  itemStyle:{
-        //    normal:{
-        //      color: {
-        //        type: 'linear',
-        //        x: 0,
-        //        y: 0,
-        //        x2: 0,
-        //        y2: 1,
-        //       //  colorStops: [
-        //       //  {
-        //       //    offset:1, color: randomColor() // 0% 处的颜色
-        //       //  },
-        //       // //  {
-        //       // //    offset:0.7, color: randomColor() // 100% 处的颜色
-        //       // //  },
-        //       // //  {
-        //       // //    offset:0.66, color: randomColor() // 100% 处的颜色
-        //       // //  },
-        //       // //  {
-        //       // //    offset:0.2, color: randomColor()// 100% 处的颜色
-        //       // //  },
-        //       //  {
-        //       //    offset:0, color: randomColor ()// 0% 处的颜色FF7A00
-        //       //  }, 
-              
-        //       // ],
-            
-        //        global: false // 缺省为 false
-        //      }
-        //    }
-        //  },
-        //  lineStyle: {
-        //             width: 3, // 设置线条宽度
-        //         },
           })
        }
         const max = Math.max(...series.value[0].data);
@@ -599,6 +551,33 @@ const handleDelete=(event)=>{
     });
 
 }
+const funidshow=(val)=>{
+  isshow.value=val;
+}
+// 获取点的数据
+function jgSelect1() {
+  timing2.value = setInterval(() => {
+    //定时器
+
+    if (jgSelectPointId.value != vtkmodel.selectJgPointId) {
+    // console.log("pointid",vtkmodel.selectJgPointId);//选择的点数据
+      //获取点对应的Scalar
+      isshow.value=true;
+       jgSelectPointId.value = vtkmodel.selectJgPointId;
+       
+      selobj.value = [];
+      for (const key of fcon.scalar.keys()) {
+        selobj.value.push({
+          name: key,
+          value: fcon.scalar.get(key)[vtkmodel.selectJgPointId],
+        });
+      }
+      console.log(selobj.value);
+     // msgval.value = selobj.value;
+     htmldialogref.value.getdatahtml(selobj.value);
+ }
+  }, 1000);
+}
 const linedata=()=>{
 
 }

+ 110 - 0
src/view/index/htmldialog.vue

@@ -0,0 +1,110 @@
+<template>
+    <!-- 加载html界面 -->
+<div v-show="htmldialogshow" class="htmlclass">
+    <el-dialog
+      width="300px"
+      v-model="htmldialogshow"
+      :modal="false"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      draggable
+      :fullscreen="false"
+      :modal-append-to-body="false"
+      modal-class="summary-dlg"
+      @close='closeDialog'
+      class="right log_class bgcolor tianjia asideg asidegbg leftbgimg"
+    >
+      <template #header="{ titleId, titleClass }">
+        <div class="my-header">
+          <h4  class="telet" :id="titleId" :class="titleClass">3D选点</h4>
+        </div>
+      </template>
+      <div class="htmlclass_content" v-for="(item, i) in msgval" :key="i">
+        <span class="htmlclass_txte" style="width: 150px; display: inline-block;">{{ item.name }}</span>
+         <span class="htmlclass_txte">{{ item.value }}</span>
+            <!-- <p class="htmlclass_txte">水位:{{ item.value }}</p> -->
+        </div>
+      <div class="dialog-footer footer_div l_btn">
+        <div class="footerbtn flex1">
+          <div class="borderimg">
+            <el-button ><a class="tiaozhaun"   href="../../../../static/index.html?camera=0&water='+water'" rel="external nofollow"  target="_blank">内部查看</a></el-button>
+          </div>
+        </div>
+        <div class="footerbtn flex1">
+          <div class="borderimg">
+            <el-button> <a class="tiaozhaun" href="../../../../static/index.html?camera=1&water=0.9" rel="external nofollow"  target="_blank">外部查看</a> </el-button>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- <div class="xuandian">
+        <h4>3D选点</h4>
+        <div class="htmlclass_content">
+            <p class="htmlclass_txte">水位:</p>
+        </div>
+        <div class="dialog-footer footer_div l_btn">
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button @click="htmldialogshow = false">内部查看</el-button>
+            </div>
+          </div>
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button @click="htmldialogshow=false"> 外部查看 </el-button>
+            </div>
+          </div>
+        </div>
+    </div> -->
+</div>
+    
+     </template>
+   <script setup>
+import { ref, onMounted, reactive, } from "vue";
+import {RouterView,RouterLink } from "vue-router"
+import { request, uploadFile } from "@/utils/request";
+import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
+import { vtkmodel } from "@/control/vtkModel.js";
+import { createFireControl } from "@/control/fireControl.js";
+let emit = defineEmits(['funidshow'])
+let buntext=ref("3D选点")
+let htmldialogshow=ref(false);
+let msgval=ref([]);
+let water=ref();
+const props = defineProps({
+  isshow: {
+        type: Boolean,
+        // required: true,
+
+    },
+});
+const getdatahtml=(val)=>{
+  water.value=Number(val[0].value)/4;
+  msgval.value=val;
+}
+const closeDialog=()=>{
+  htmldialogshow.value=false;
+  emit('funidshow',false);
+}
+onMounted(() => {
+
+  // arrowtimeStart();
+});
+watch(
+  () => [props.isshow],
+  (newVal, oldVal) => {
+    if(newVal[0]==true){
+      htmldialogshow.value=true;
+    }else{
+      htmldialogshow.value=false;
+    }
+
+
+  },
+  { deep: true }
+); //深度监视
+     defineExpose({getdatahtml});
+   </script>
+   <style  lang="scss" scoped>
+
+
+   </style>

BIN
static/Build/Build.data


File diff suppressed because it is too large
+ 9 - 0
static/Build/Build.framework.js


File diff suppressed because it is too large
+ 0 - 0
static/Build/Build.loader.js


BIN
static/Build/Build.wasm


+ 33 - 0
static/ServiceWorker.js

@@ -0,0 +1,33 @@
+const cacheName = "DefaultCompany-CollierySafety-0.1.0";
+const contentToCache = [
+    "Build/Build.loader.js",
+    "Build/Build.framework.js",
+    "Build/Build.data",
+    "Build/Build.wasm",
+    "TemplateData/style.css"
+
+];
+
+self.addEventListener('install', function (e) {
+    console.log('[Service Worker] Install');
+    
+    e.waitUntil((async function () {
+      const cache = await caches.open(cacheName);
+      console.log('[Service Worker] Caching all: app shell and content');
+      await cache.addAll(contentToCache);
+    })());
+});
+
+self.addEventListener('fetch', function (e) {
+    e.respondWith((async function () {
+      let response = await caches.match(e.request);
+      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
+      if (response) { return response; }
+
+      response = await fetch(e.request);
+      const cache = await caches.open(cacheName);
+      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
+      cache.put(e.request, response.clone());
+      return response;
+    })());
+});

BIN
static/TemplateData/favicon.ico


BIN
static/TemplateData/icons/unity-logo-dark.png


BIN
static/TemplateData/icons/unity-logo-light.png


BIN
static/TemplateData/progress-bar-empty-dark.png


BIN
static/TemplateData/progress-bar-empty-light.png


BIN
static/TemplateData/progress-bar-full-dark.png


BIN
static/TemplateData/progress-bar-full-light.png


+ 8 - 0
static/TemplateData/style.css

@@ -0,0 +1,8 @@
+body { padding: 0; margin: 0 }
+#unity-container { position: fixed; width: 100%; height: 100%; }
+#unity-canvas { width: 100%; height: 100%; background: #231F20 }
+#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 { margin-left: auto; margin-right: auto; width: 141px; height: 18px; margin-top: 10px; 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-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

BIN
static/TemplateData/unity-logo-dark.png


BIN
static/TemplateData/unity-logo-light.png


+ 103 - 0
static/index.html

@@ -0,0 +1,103 @@
+<!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 | CollierySafety</title>
+    <link rel="shortcut icon" href="TemplateData/favicon.ico">
+    <link rel="stylesheet" href="TemplateData/style.css">
+    <link rel="manifest" href="manifest.webmanifest">
+  </head>
+  <body>
+    <div id="unity-container">
+      <canvas id="unity-canvas" width=960 height=600 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>
+    <script>
+      window.addEventListener("load", function () {
+        if ("serviceWorker" in navigator) {
+          navigator.serviceWorker.register("ServiceWorker.js");
+        }
+      });
+
+      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 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",
+        frameworkUrl: buildUrl + "/Build.framework.js",
+        codeUrl: buildUrl + "/Build.wasm",
+        streamingAssetsUrl: "StreamingAssets",
+        companyName: "DefaultCompany",
+        productName: "CollierySafety",
+        productVersion: "0.1.0",
+        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);
+      }
+
+      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";
+        }).catch((message) => {
+          alert(message);
+        });
+      };
+      document.body.appendChild(script);
+    </script>
+  </body>
+</html>

+ 33 - 0
static/js/ServiceWorker.js

@@ -0,0 +1,33 @@
+const cacheName = "DefaultCompany-CollierySafety-0.1.0";
+const contentToCache = [
+    "Build/Build.loader.js",
+    "Build/Build.framework.js",
+    "Build/Build.data",
+    "Build/Build.wasm",
+    "TemplateData/style.css"
+
+];
+
+self.addEventListener('install', function (e) {
+    console.log('[Service Worker] Install');
+    
+    e.waitUntil((async function () {
+      const cache = await caches.open(cacheName);
+      console.log('[Service Worker] Caching all: app shell and content');
+      await cache.addAll(contentToCache);
+    })());
+});
+
+self.addEventListener('fetch', function (e) {
+    e.respondWith((async function () {
+      let response = await caches.match(e.request);
+      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
+      if (response) { return response; }
+
+      response = await fetch(e.request);
+      const cache = await caches.open(cacheName);
+      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
+      cache.put(e.request, response.clone());
+      return response;
+    })());
+});

+ 15 - 0
static/manifest.webmanifest

@@ -0,0 +1,15 @@
+{
+    "name": "CollierySafety",
+    "short_name": "CollierySafety",
+    "start_url": "index.html",
+    "display": "fullscreen",
+    "background_color": "#231F20",
+    "theme_color": "#000",
+    "description": "",
+    "icons": [{
+      "src": "TemplateData/icons/unity-logo-dark.png",
+      "sizes": "144x144",
+      "type": "image/png",
+      "purpose": "any maskable"
+    }]
+  }

Some files were not shown because too many files changed in this diff