Explorar o código

爆炸三角形-提交

lxh hai 10 meses
pai
achega
b03165735e

+ 1 - 1
src/components/Modal/src/BasicModal.vue

@@ -210,7 +210,7 @@
 
       // 取消事件
       async function handleCancel(e: Event) {
-        debugger;
+        // debugger;
         e?.stopPropagation();
         // 过滤自定义关闭按钮的空白区域
         if ((e.target as HTMLElement)?.classList?.contains(prefixCls + '-close--custom')) return;

+ 2 - 2
src/components/chart/BarAndLine.vue

@@ -93,14 +93,14 @@
       });
 
       function initChartsOption() {
-        debugger;
+        // debugger;
         optionUtil = new EchartsUtil(merge(option, props.option));
         optionUtil.initChartOption(props.chartsType, chartsColumns);
       }
       initChartsOption();
 
       function initCharts(isRefresh = false) {
-        debugger;
+        // debugger;
         //轴数据
         if (option.series && option.series.length === chartsColumns.length) {
           let xAxisData = props.dataSource.map((item) => item[props.xAxisPropType]);

+ 1 - 1
src/utils/echartsUtil.ts

@@ -59,7 +59,7 @@ export default class echartsUtil {
     grid = this.getGrid(yAxis, type);
     // timeline = this.getTimeline(xdata, ydata);
     tooltip = this.getTooltip();
-    debugger;
+    // debugger;
     xAxis = merge(this.getXAxis(xdata, series, type), [{ ...this.option.xAxis }]);
 
     dataZoom = this.getDataZoom(type);

+ 1 - 1
src/utils/threejs/util.ts

@@ -29,7 +29,7 @@ export const setModalCenter = (group, modal?) => {
   group.position.x = group.position.x - center.x;
   group.position.y = group.position.y - center.y;
   group.position.z = group.position.z - center.z;
-  debugger;
+  // debugger;
 };
 
 // 获取一个canvas 图文纹理

+ 1 - 1
src/views/sys/iframe/index.vue

@@ -21,7 +21,7 @@
   const appStore = useAppStore();
   const loading = ref(true);
   const topRef = ref(50);
-  debugger;
+  // debugger;
   const heightRef = ref(window.innerHeight / appStore.getHeightScale);
 
   const frameRef = ref<HTMLFrameElement>();

+ 1 - 1
src/views/vent/deviceManager/equipManager/component/normalBtnTable.vue

@@ -170,7 +170,7 @@
    * 新增下级
    */
   function handleAdds(data) {
-    debugger;
+    // debugger;
     console.log(data, '添加下级');
     dictId.value = data.subDictId || data.dictId;
     for (let key in record) {

+ 1 - 1
src/views/vent/home/billboard/billboard.data.ts

@@ -1,6 +1,6 @@
 import DustStatus from './components/DustStatus.vue';
 import FileOverview from './components/FileOverview.vue';
-import FireStatus from './components/FireStatus.vue';
+// import FireStatus from './components/FireStatus.vue';
 import VentilationStatus from './components/VentilationStatus.vue';
 import GasStatus from './components/GasStatus.vue';
 import leftImg from '/@/assets/images/files/homes/file.svg';

+ 1 - 1
src/views/vent/home/billboard/components/DustStatus.vue

@@ -5,7 +5,7 @@
 </template>
 <script lang="ts" setup>
   import CommonTable from './CommonTable.vue';
-  import CommonTitle from './CommonTitle.vue';
+  // import CommonTitle from './CommonTitle.vue';
   import { BASIC_COLUMN } from '../billboard.data';
   import { ref } from 'vue';
   // import mapComponent from './3Dmap/index.vue';

+ 1 - 1
src/views/vent/home/billboard/components/VentilationStatus.vue

@@ -17,7 +17,7 @@
   import { VENTILATION_STATUS_HEADER_CONFIG } from '../billboard.data';
   import MiniBoard from './MiniBoard.vue';
   import { ref } from 'vue';
-  import CommonTitle from './CommonTitle.vue';
+  // import CommonTitle from './CommonTitle.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
   const data = ref({

+ 2 - 2
src/views/vent/home/billboard/index.vue

@@ -24,8 +24,8 @@
 </template>
 <script lang="ts" setup>
   import { computed, onMounted, ref } from 'vue';
-  import BaseCard from './components/BaseCard.vue';
-  import ArrowButton from './components/ArrowButton.vue';
+  // import BaseCard from './components/BaseCard.vue';
+  // import ArrowButton from './components/ArrowButton.vue';
   import { BILLBOARDS, COMPONENTS_MAP } from './billboard.data';
   import { useRoute } from 'vue-router';
   // import mapComponent from './components/3Dmap/index.vue';

+ 1 - 1
src/views/vent/monitorManager/comment/DeviceEcharts.vue

@@ -336,7 +336,7 @@
 
       onMounted(async () => {
         const res = await props.deviceListApi();
-        debugger;
+        // debugger;
         if (res['msgTxt'] && res['msgTxt'][0] && res['msgTxt'][0]['datalist']) {
           options.value = res['msgTxt'][0]['datalist'];
           deviceId.value = options.value[0]['deviceID'];

+ 1 - 1
src/views/vent/monitorManager/compressor/nitrogen.data.ts

@@ -225,7 +225,7 @@ export function getMonitorComponent() {
       return nitrogenHome;
     case 'sdmtjtyjlmk': //yjl
     case 'sdmtjtbltmk': // 补连塔
-      debugger;
+      // debugger;
       nitrogenHome = defineAsyncComponent(() => import('./components/nitrogenHome_blt.vue'));
       return nitrogenHome;
     case 'sdmtjtcctmk': // 寸草塔

+ 111 - 17
src/views/vent/monitorManager/deviceMonitor/components/device/modal/blastDelta.vue

@@ -8,7 +8,7 @@
             </div>
             <div class="coord-labelY">
                 <div :style="{ width: '20px', height: `${lengY}px`, color: '#fff' }" v-for="(ite, ind) in 10"
-                    :key="ind">{{ maxY - Math.floor(maxY / 10) * ind }}</div>
+                    :key="ind">{{ ind == 0 ? maxY : '' }}</div>
             </div>
             <div class="coord-lineX">
                 <div :style="{ height: '5px', width: `${lengY}px`, 'border-right': '1px solid #0079ff', }"
@@ -16,7 +16,7 @@
             </div>
             <div class="coord-labelX">
                 <div :style="{ height: '20px', width: `${lengY}px`, color: '#fff' }" v-for="(ite, ind) in 10"
-                    :key="ind">{{ Math.floor(maxX / 10) + Math.floor(maxX / 10) * ind }}</div>
+                    :key="ind">{{ ind == 9 ? maxX : '' }}</div>
             </div>
             <div class="line-AB" :style="{ width: 'calc(100% - 15px)', height: 'calc(100% - 10px)' }">
                 <canvas id="myCanvas" width="250" height="245"></canvas>
@@ -47,6 +47,9 @@ let lengY = ref(0)
 //与x,y轴相交最大值坐标
 let maxY = ref(0)
 let maxX = ref(0)
+let maxY1 = ref(0)
+let maxX1 = ref(0)
+
 //A点坐标
 let coordinateA = reactive({
     x: 0,
@@ -89,8 +92,8 @@ function getAreas() {
     }
 
 }
-//根据A,B,E,G等点坐标绘制
-function getLIne() {
+//根据A,B,E,G等点坐标绘制爆炸三角
+function getBlast() {
     maxY.value = getCoordABY(0)
     maxX.value = getCoordABX(0)
     // 获取canvas元素
@@ -212,7 +215,7 @@ function getLIne() {
     // 在点附近添加文字
     ctx.font = "12px Arial";
     ctx.fillStyle = "#fff";
-    ctx.fillText("A", 20, 10); // 文字位置略微偏上,以便于文字与点对齐
+    ctx.fillText("A", coordinateA.x * scalcX + 10, canvas.height - (coordinateA.y * scalcY)); // 文字位置略微偏上,以便于文字与点对齐
 
     //标记点B
     ctx.beginPath();
@@ -222,7 +225,7 @@ function getLIne() {
     // 在点附近添加文字
     ctx.font = "12px Arial";
     ctx.fillStyle = "#fff";
-    ctx.fillText("B", 50, 40); // 文字位置略微偏上,以便于文字与点对齐
+    ctx.fillText("B", coordinateB.x * scalcX + 10, canvas.height - (coordinateB.y * scalcY)); // 文字位置略微偏上,以便于文字与点对齐
 
     //标记点E
     ctx.beginPath();
@@ -232,7 +235,7 @@ function getLIne() {
     // 在点附近添加文字
     ctx.font = "12px Arial";
     ctx.fillStyle = "#fff";
-    ctx.fillText("E", 20, 140); // 文字位置略微偏上,以便于文字与点对齐
+    ctx.fillText("E", coordinateE.x * scalcX + 5, canvas.height - (coordinateE.y * scalcY) + 10); // 文字位置略微偏上,以便于文字与点对齐
 
     //标记点G
     ctx.beginPath();
@@ -242,7 +245,7 @@ function getLIne() {
     // 在点附近添加文字
     ctx.font = "12px Arial";
     ctx.fillStyle = "#fff";
-    ctx.fillText("G", 0, 120); // 文字位置略微偏上,以便于文字与点对齐
+    ctx.fillText("G", coordinateG.x * scalcX + 5, canvas.height - (coordinateG.y * scalcY)); // 文字位置略微偏上,以便于文字与点对齐
     //标记点F
     ctx.beginPath();
     ctx.arc(coordinateF.x * scalcX, canvas.height - (coordinateF.y * scalcY), 1, 0, 2 * Math.PI);
@@ -251,19 +254,105 @@ function getLIne() {
     // 在点附近添加文字
     ctx.font = "12px Arial";
     ctx.fillStyle = "#fff";
-    ctx.fillText("F", 30, 240); // 文字位置略微偏上,以便于文字与点对齐
+    ctx.fillText("F", coordinateF.x * scalcX + 10, canvas.height - (coordinateF.y * scalcY) - 10); // 文字位置略微偏上,以便于文字与点对齐
+    //标记点
+    ctx.beginPath();
+    ctx.arc(maxX1.value * scalcX, canvas.height - (maxY1.value * scalcY), 5, 0, 2 * Math.PI);
+    ctx.fillStyle = "blue";
+    ctx.fill();
+    // 在点附近添加文字
+    ctx.font = "12px Arial";
+    ctx.fillStyle = "#fff";
+    ctx.fillText("", maxX1.value * scalcX + 10, canvas.height - (maxY1.value * scalcY) - 10); // 文字位置略微偏上,以便于文字与点对齐
+}
+//绘制不爆炸三角形
+function getUnblast() {
+    maxY.value = 21
+    maxX.value = 100
+    // 获取canvas元素
+    let canvas = document.getElementById('myCanvas');
+    let ctx = canvas.getContext('2d');
+    let scalcY = canvas.height / maxY.value
+    let scalcX = canvas.width / maxX.value
+
+    //绘制AB点线条
+    ctx.beginPath();
+    ctx.moveTo(0, canvas.height - (maxY.value * scalcY)); // 开始绘制的点
+    ctx.lineTo(maxX.value * scalcX, canvas.height); // 结束绘制的点
+    ctx.strokeStyle = '#000';
+    ctx.stroke(); // 进行绘制
+
+    ctx.clearRect(0, 0, canvas.width, canvas.height);
+    let pointData = [
+        {
+            arr: [
+                { x: 0, y: canvas.height },//原点
+                { x: 0, y: canvas.height - (maxY.value * scalcY) },//A
+                { x: maxX.value * scalcX, y: canvas.height },//B
+            ],
+            color: 'rgb(127, 254, 2, .9)',
+        },
+    ]
+
+    pointData.forEach((item, index) => {
+        ctx.beginPath();
+        ctx.moveTo(item.arr[0].x, item.arr[0].y);
+        item.arr.forEach((items, ind) => {
+            if (ind != 0) {
+                ctx.lineTo(item.arr[ind].x, item.arr[ind].y)
+            }
+        });
+        ctx.closePath();
+        ctx.fillStyle = item.color;
+        ctx.fill();
+        ctx.strokeStyle = "transparent";
+        ctx.lineWidth = 1;
+        ctx.stroke();
+    });
+
+    // 标记点A
+    ctx.beginPath();
+    ctx.arc(0, canvas.height - (maxY.value * scalcY), 1, 0, 2 * Math.PI);
+    ctx.fillStyle = "#eee";
+    ctx.fill();
+    // 在点附近添加文字
+    ctx.font = "12px Arial";
+    ctx.fillStyle = "#fff";
+    ctx.fillText("A", 10, canvas.height - (maxY.value * scalcY) + 10); // 文字位置略微偏上,以便于文字与点对齐
+    // 标记点B
+    ctx.beginPath();
+    ctx.arc(maxX.value * scalcX, canvas.height, 1, 0, 2 * Math.PI);
+    ctx.fillStyle = "#eee";
+    ctx.fill();
+    // 在点附近添加文字
+    ctx.font = "12px Arial";
+    ctx.fillStyle = "#fff";
+    ctx.fillText("B", maxX.value * scalcX - 10, canvas.height - 10); // 文字位置略微偏上,以便于文字与点对齐
+    //标记点
+    ctx.beginPath();
+    ctx.arc(maxX1.value * scalcX, canvas.height - (maxY1.value * scalcY), 5, 0, 2 * Math.PI);
+    ctx.fillStyle = "blue";
+    ctx.fill();
+    // 在点附近添加文字
+    ctx.font = "12px Arial";
+    ctx.fillStyle = "#fff";
+    ctx.fillText("", maxX1.value * scalcX + 10, canvas.height - (maxY1.value * scalcY) - 10); // 文字位置略微偏上,以便于文字与点对齐
 }
 //根据横坐标获取直线AB纵坐标
 function getCoordABY(params) {
-    return Math.ceil(((coordinateB.y - coordinateA.y) * params - coordinateA.x * coordinateB.y + coordinateB.x * coordinateA.y) / (coordinateB.x - coordinateA.x))
+    return Math.ceil(((parseFloat(coordinateB.y) - parseFloat(coordinateA.y)) * params - parseFloat(coordinateA.x) * parseFloat(coordinateB.y) + parseFloat(coordinateB.x) * parseFloat(coordinateA.y)) / (parseFloat(coordinateB.x) - parseFloat(coordinateA.x)))
 }
 //根据纵坐标获取直线AB横坐标
 function getCoordABX(params1) {
-    return Math.ceil(((coordinateB.x - coordinateA.x) * params1 + coordinateA.x * coordinateB.y - coordinateB.x * coordinateA.y) / (coordinateB.y - coordinateA.y))
+    return Math.ceil(((parseFloat(coordinateB.x) - parseFloat(coordinateA.x)) * params1 + parseFloat(coordinateA.x) * parseFloat(coordinateB.y) - parseFloat(coordinateB.x) * parseFloat(coordinateA.y)) / (parseFloat(coordinateB.y) - parseFloat(coordinateA.y)))
 }
 
 watch(() => props.posMonitor, (newV, oldV) => {
-    let btTriBlasts = JSON.parse(newV.btTriBlast)
+    maxY1.value = parseFloat(newV.coval) + parseFloat(newV.gasval) + parseFloat(newV.ch2val) + parseFloat(newV.chval)
+    maxX1.value = parseFloat(newV.o2val)
+   
+    // let btTriBlasts = JSON.parse(newV.btTriBlast)
+    let btTriBlasts ={"G_y":0.0,"G_x":0,"F_y":0,"A_x":0.0,"B_x":0.0,"A_y":20.98,"B_y":20.98,"E_y":0.0,"F_x":0.0,"E_x":0.0}
     coordinateA.x = btTriBlasts.A_x
     coordinateA.y = btTriBlasts.A_y
     coordinateB.x = btTriBlasts.B_x
@@ -274,8 +363,11 @@ watch(() => props.posMonitor, (newV, oldV) => {
     coordinateF.y = btTriBlasts.F_y
     coordinateG.x = btTriBlasts.G_x
     coordinateG.y = btTriBlasts.G_y
-    getLIne()
-
+    if (!((coordinateA.y - coordinateB.y) / (coordinateA.x - coordinateB.x)) || (coordinateA.y - coordinateB.y) / (coordinateA.x - coordinateB.x) == 1) {
+        getUnblast()
+    } else {
+        getBlast()
+    }
 }, { deep: true })
 
 onMounted(() => {
@@ -290,11 +382,12 @@ onMounted(() => {
     position: relative;
     width: 100%;
     height: 100%;
-    .blast-title{
+
+    .blast-title {
         position: absolute;
         left: 50%;
         top: 24px;
-        transform: translate(-50%,0);
+        transform: translate(-50%, 0);
         font-size: 12px;
         color: #fff;
     }
@@ -384,7 +477,8 @@ onMounted(() => {
             right: 0;
             top: 20px;
             height: 80px;
-            .item-name{
+
+            .item-name {
                 height: 20px;
                 line-height: 20px;
                 font-size: 10px;

+ 4 - 3
src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue

@@ -93,10 +93,11 @@
         <div class="right-bottom">
           <span class="base-title">设备监测曲线</span>
           <div class="echarts-box">
-            <BarAndLine class="echarts-line" xAxisPropType="time" :dataSource="historyList" height="100%" width="65%"
-              :chartsColumns="chartsColumns" :option="echatsOption" chartsType="listMonitor" />
+            <BarAndLine  class="echarts-line" xAxisPropType="time" :dataSource="historyList" height="100%"
+              width="65%" :chartsColumns="chartsColumns" :option="echatsOption" chartsType="listMonitor" />
+
             <!-- 爆炸三角形 -->
-            <div style="width:35%;height:100%">
+            <div style="width:35%;height:100%; margin: 0px auto">
               <blastDelta :posMonitor="posMonitor"></blastDelta>
             </div>
           </div>

+ 1 - 1
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -954,7 +954,7 @@
       password: passWord.value || globalConfig?.simulatedPassword,
       value: null,
     };
-    debugger;
+    // debugger;
     if (handType === 'startSmoke') {
       // 启动风机
       // 以下是互斥

+ 1 - 1
src/views/vent/monitorManager/groutMonitor/components/groutHomelt.vue

@@ -145,7 +145,7 @@
   }
 
   async function getDataSource(systemID) {
-    debugger;
+    // debugger;
     const res = await list({ devicetype: 'pulping_auto', systemID, pagetype: 'normal' });
     const result = res.deviceInfo;
     for (const key in result) {

+ 1 - 1
src/views/vent/monitorManager/mainFanMonitor/index.vue

@@ -639,7 +639,7 @@
   };
   // 切换检测数据
   const getSelectRow = async (id) => {
-    debugger;
+    // debugger;
     if (!id) return;
     loading.value = true;
     const baseDataIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID === id);

+ 1 - 1
src/views/vent/monitorManager/nitrogen/nitrogen.threejs.ts

@@ -117,7 +117,7 @@ export const setModelType = (modalTypeName) => {
 };
 
 export const mountedThree = (monitorDataGroupArr) => {
-  debugger;
+  // debugger;
   return new Promise(async (resolve) => {
     model = new UseThree('#compressor3D');
     model.setEnvMap('test1');

+ 1 - 1
src/views/vent/monitorManager/workFaceMonitor/workFace.threejs.base.ts

@@ -349,7 +349,7 @@ class WorkFace {
   }
 
   setModalType(modalType) {
-    debugger;
+    // debugger;
     const workFace2 = this.group.getObjectByName('workFace2-1');
     const workFace1 = this.group.getObjectByName('workFace1-1');
     // const workFace3 = this.group.getObjectByName('workFace2-2');