R 1 жил өмнө
parent
commit
54ad3e5cbd

+ 17 - 18
src/views/3dDemo/index.vue

@@ -46,7 +46,6 @@
         <button class="btn" @click="Suspend">暂 停</button>
         <button class="btn" @click="Begin">开 始</button>
         <button class="btn" @click="playBack" :disabled="!isShow">回 放</button>
-
         <input type="file" ref="fileInput" style="display: none" @change="importData" accept=".json" />
       </div>
       <div class="small" id="small" ref="small" v-show="isShow"></div>
@@ -143,7 +142,8 @@ export default {
         { value: 8, label: '8倍速' },
         { value: 16, label: '16倍速' },
         { value: 32, label: '32倍速' },
-        { value: 64, label: '64倍速' }
+        { value: 64, label: '64倍速' },
+        { value: 128, label: '128倍速' }
       ],
       // 暂停和开始
       isAnimation: false,
@@ -206,8 +206,8 @@ export default {
     this.initSmall()
     this.initOrbitControls()
     // this.createCube();
-    // this.createWave()
-    // this.waveModel()
+    this.createWave()
+    this.waveModel()
   },
   methods: {
     getFile() {
@@ -485,12 +485,11 @@ export default {
           // 调用生成轨迹函数
           this.makeCurve(modelInfo)
         }
-
         if (modelInfo.name === 'agent' || modelInfo.name === 'agent1') {
-          // this.agentSpeed.push(modelInfo.speed[modelInfo.pathIndex]);
-          // this.times.push(this.allTimes[modelInfo.pathIndex]);
+          // this.agentSpeed.push(modelInfo.speed[index]);
+          // this.times.push(this.allTimes[index]);
           this.times.push(...this.allTimes.slice(modelInfo.prevIndex, index))
-          // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,modelInfo.pathIndex));
+          // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,index));
 
           this.propsIndex = index
           // 展示生成事件文字
@@ -498,7 +497,7 @@ export default {
         }
         if (modelInfo.name.startsWith('agent')) {
           this.agentSpeed[modelInfo.name]?.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
-          // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,modelInfo.pathIndex));
+          // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,index));
           // 距离
           this.showDistance(this.allTimes[index], modelInfo.name)
           if (this.allDistance[modelInfo.name][index] <= 3) {
@@ -535,7 +534,7 @@ export default {
         }
         this.propsDirection[modelInfo.name]?.push(...modelInfo.direction.slice(modelInfo.prevIndex, index))
         if (modelInfo.name === 'target') {
-          // this.targetSpeed.push(modelInfo.speed[modelInfo.pathIndex]);
+          // this.targetSpeed.push(modelInfo.speed[index]);
           this.targetSpeed.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
           this.tweenTargetPosition = {
             x: modelInfo.route[index].x,
@@ -591,7 +590,7 @@ export default {
       if (intersects.length > 0) {
         let object = intersects[0].object
         if (object.userData.name?.startsWith('agent')) {
-          infoTag.innerHTML = `名称:${object.userData.name}
+          infoTag.innerHTML = `名称:${object.userData.name.substr(-1)}
           <br>时间:${object.userData.time}
           <br>距离:${object.userData.distance}km`
           infoTag.style.display = 'block'
@@ -647,11 +646,10 @@ export default {
       }
     },
     handelData(rawData1) {
-      let num = 1
-      if (!rawData1[0][1].agent) num = 50
       const rawData = rawData1.filter((item, index) => {
-        return index % num === 0 || item[1].events.length !== 0 || item[1].report
+        return index % 10 === 0 || item[1].events.length !== 0 || item[1].report
       })
+      console.log('rawData', rawData)
       const color = [0xc1232b, 0x5470c6, 0xfac858, 0xee6666]
       this.models = []
       this.allTimes = []
@@ -750,13 +748,13 @@ export default {
         target.coordinate.push([targetX - beginCoordinate[0], targetY - beginCoordinate[1]])
         maxData = Math.max(targetX, targetY, maxData)
       })
-      // console.log(maxData);
+      console.log('rawDatarawDatarawDatarawData', rawData)
       this.maxNum = Math.ceil(maxData)
       this.models = [].concat(...[Object.values(agents), target])
 
-      // console.log('this.reportInfo', this.reportInfo)
-      console.log('this.distance', this.distance)
-      console.log('this.allDistance', this.allDistance)
+      // console.log("this.models", this.models);
+      // console.log("this.distance",this.distance);
+      // console.log("this.allDistance",this.allDistance);
 
       this.models.forEach((modelInfo, index) => {
         // this.propsDirection.push(modelInfo.direction);
@@ -800,6 +798,7 @@ export default {
       if (filterData.length !== this.propsDistance[name].length) {
         this.propsDistance[name] = filterData
       }
+      //console.log('propsDistance', this.propsDistance)
       // if(this.distance[name].some(item => item[0] === parseFloat(time)) && !(this.propsDistance[name].some(item => item[0] === parseFloat(time)))){
       //   this.propsDistance[name].push(this.distance[name].find(item => item[0] === parseFloat(time)));
       //   console.log("this.propsDistance",this.propsDistance);

+ 0 - 1
src/views/3dDemo/lineChart.vue

@@ -47,7 +47,6 @@ export default {
         if (newVal) {
           this.startTimer() // 有新数据传入时启动定时器
         } else {
-          console.log(1111)
           this.stopTimer() // 没有数据时停止定时器
         }
       }

+ 2 - 6
src/views/3dDemo/lineChartFive.vue

@@ -22,8 +22,7 @@ export default {
       timer: null,
       series: [],
       dataKey: [],
-      color: null,
-      effectScatterData: []
+      color: null
     }
   },
   props: ['propsData', 'indexData', 'propsName', 'stop'],
@@ -39,15 +38,13 @@ export default {
       if (newV === oldV) {
         this.stopTimer() // 没有数据时停止定时器
       } else {
-        // console.log('this.dataKey', this.dataKey)
-
         this.index = this.indexData
         this.series = []
         this.dataKey?.forEach(([key, value]) => {
           this.series.push({
             name: key,
             type: 'line',
-            symbol: 'circle',
+            symbol: 'none',
             smooth: true,
             data: value.slice(0, newV),
             lineStyle: {
@@ -83,7 +80,6 @@ export default {
         if (newVal) {
           this.startTimer() // 有新数据传入时启动定时器
         } else {
-          console.log(1111)
           this.stopTimer() // 没有数据时停止定时器
         }
       }

+ 1 - 1
src/views/3dDemo/lineChartFour.vue

@@ -21,7 +21,7 @@ export default {
       // 定时器
       timer: null,
       series: [],
-      color: ['#c1232b', '#5470c6', '#fac858', '#ee6666', '#00ff00', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
+      color: ['#c1232b', '#5470c6', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
     }
   },
   props: ['direction', 'times', 'indexData', 'propsName', 'stop'],

+ 0 - 1
src/views/3dDemo/lineChartTwo.vue

@@ -43,7 +43,6 @@ export default {
         if (newVal) {
           this.startTimer() // 有新数据传入时启动定时器
         } else {
-          console.log(1111)
           this.stopTimer() // 没有数据时停止定时器
         }
       }