ソースを参照

水泵、风机、风门加载

tangjunhao 6 ヶ月 前
コミット
d7e1960943
2 ファイル変更540 行追加1 行削除
  1. 349 1
      src/view/components/Fengmen.vue
  2. 191 0
      src/view/components/InfoDisaster.vue

+ 349 - 1
src/view/components/Fengmen.vue

@@ -52,6 +52,14 @@
                         </el-table-column>
                         </el-table>
                         <div class="asdis_btn">
+                          <div class="flex_a" >
+                            <div
+                              class="btns"
+                              @click="fjloadclick();sdialog.fjloaddialog = true;"
+                            >
+                              <span class="spantext">加载</span>
+                            </div>
+                          </div>
                           <div class="flex_a" >
                             <div
                               class="btns"
@@ -116,6 +124,13 @@
                         </el-table-column>
                         </el-table>
                         <div class="asdis_btn">
+                          <div class="flex_a" >
+                            <div
+                              class="btns"   @click="fmload();sdialog.fmloaddialog=true"
+                            >
+                              <span class="spantext">加载</span>
+                            </div>
+                          </div>
                           <div class="flex_a" >
                             <div
                               class="btns"   @click="fmadd();sdialog.fmdialog=true"
@@ -143,6 +158,88 @@
           </div>
         </el-aside>
       </div>
+      <!-- 风机的加载 -->
+      <el-dialog
+      v-model="sdialog.fjloaddialog"
+      width="400"
+      align-center
+      :modal="false"
+      :append-to-body="true"
+      :z-index='1000'
+      :close-on-click-modal="false"
+      :fullscreen="false"
+      :modal-append-to-body="false"
+      modal-class="summary-dlg"
+      class="dialog_class bgcolor tianjia"
+      draggable
+    >
+      <template #header="{ titleId, titleClass }">
+        <div class="my-header">
+          <el-image :src="icon" fit="contain"></el-image>
+          <h4 :id="titleId" :class="titleClass">加载</h4>
+        </div>
+      </template>
+      <div class="demo-input-suffix firsttitle leftbgimg2">
+        <el-table
+          :row-class-name="tableRowClassName"
+          :max-height="tableHeight"
+          ref="tabledatafjjzref"
+          type="selection"
+          :data="tableDatafjjz"
+          style="width: 100%"
+          
+          :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
+        >
+        <template v-slot:empty>
+                        <p>暂无数据</p>
+                        </template>
+          <el-table-column type="selection" width="55" />
+          <!-- <el-table-column property="snId" label="开始节点" />
+          <el-table-column property="enId" label="结束节点" /> -->
+          <el-table-column type="index" label="编号" width="70" />
+          <el-table-column property="fanname" label="风机名称" />
+          <el-table-column property="pname" label="巷道名称"  />
+          <el-table-column property="site" label="相对位置" />
+          <el-table-column prop="pa" >
+                            <template v-slot:header>
+                            <span >增压</span><br>
+                            <span >(kpa)</span>
+                          </template>
+                        </el-table-column>
+          <el-table-column prop="onoff" label="开启状态">
+                          <template #default="scope">
+                            {{
+                              scope.row.onoff == "0"
+                                ? "否"
+                                : scope.row.onoff == "1"
+                                ? "是"
+                                : "是"
+                            }}
+                          </template>
+          </el-table-column>
+        </el-table>
+
+        <div class="dialog-footer footer_div l_btn">
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button @click="sdialog.fjloaddialog = false">取消</el-button>
+            </div>
+          </div>
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button
+                @click="
+                  fjloadsave();
+                  sdialog.fjloaddialog = false;
+                "
+              >
+                确定
+              </el-button>
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
 <!-- 风机的添加 -->
 <el-dialog
       v-model="sdialog.fjdialog"
@@ -243,6 +340,83 @@
         </div>
       </div>
     </el-dialog>
+    <!-- 风门的加载 -->
+    <el-dialog
+      v-model="sdialog.fmloaddialog"
+      width="400"
+      align-center
+      :modal="false"
+      :append-to-body="true"
+      :z-index='1000'
+      :close-on-click-modal="false"
+      :fullscreen="false"
+      :modal-append-to-body="false"
+      modal-class="summary-dlg"
+      class="dialog_class bgcolor tianjia"
+      draggable
+    >
+      <template #header="{ titleId, titleClass }">
+        <div class="my-header">
+          <el-image :src="icon" fit="contain"></el-image>
+          <h4 :id="titleId" :class="titleClass">加载</h4>
+        </div>
+      </template>
+      <div class="demo-input-suffix firsttitle leftbgimg2">
+        <el-table
+          :row-class-name="tableRowClassName"
+          :max-height="tableHeight"
+          ref="tabledatafmjzref"
+          type="selection"
+          :data="tableDatafmjz"
+          style="width: 100%"
+          
+          :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
+        >
+        <template v-slot:empty>
+                        <p>暂无数据</p>
+                        </template>
+          <el-table-column type="selection" width="55" />
+          <!-- <el-table-column property="snId" label="开始节点" />
+          <el-table-column property="enId" label="结束节点" /> -->
+          <el-table-column type="index" label="编号" width="70" />
+          <el-table-column property="doorname" label="风门名称" />
+          <el-table-column property="pname" label="巷道名称"  />
+          <el-table-column property="site" label="相对位置" />
+          <el-table-column prop="dragcoe" label="阻力系数" />
+          <el-table-column prop="onoff" label="开启状态">
+                          <template #default="scope">
+                            {{
+                              scope.row.onoff == "0"
+                                ? "否"
+                                : scope.row.onoff == "1"
+                                ? "是"
+                                : "是"
+                            }}
+                          </template>
+          </el-table-column>
+        </el-table>
+
+        <div class="dialog-footer footer_div l_btn">
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button @click="sdialog.fmloaddialog = false">取消</el-button>
+            </div>
+          </div>
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button
+                @click="
+                  fmloadsave();
+                  sdialog.fmloaddialog = false;
+                "
+              >
+                确定
+              </el-button>
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
     <!-- 风门的添加 -->
 <el-dialog
       v-model="sdialog.fmdialog"
@@ -413,7 +587,9 @@
     dialogsgdelect:false,
     dialogVisiblenode:false,
     fjdialog:false,
+    fjloaddialog:false,
     fmdialog:false,
+    fmloaddialog:false
   })
   let delte=ref();
   let state=ref();
@@ -452,7 +628,11 @@ const props = defineProps({
   let zhtext=ref('');
   let tishi=ref('');
   let fjtableData=ref([]);
+  let tableDatafjjz=ref([]);
+  let tabledatafjjzref = ref();
   let fmtableData=ref([]);
+  let tableDatafmjz=ref([]);
+  let tabledatafmjzref = ref();
   const handlerow = (val) => {
     vtkmodel.delpump();
     currentrow.value=true; 
@@ -481,6 +661,7 @@ const initisshow=()=>{
   sdialog.value.dialogsgdelect=false;
   sdialog.value.dialogVisiblenode=false;
   sdialog.value.fjdialog=false;
+  sdialog.value.fjloaddialog=false;
   sdialog.value.fmdialog=false;
   dialogtrue.value.dialoglog = false;
   pipeline.value.dialogVisiblenode = false;
@@ -519,6 +700,90 @@ const pipelineapi = (row) => {
     pid.value = row.id;
     source.value.selectstr = row.name;
 }
+
+//风机加载
+const fjloadclick = () => {
+  console.log("目标:",fjtableData.value)
+
+  tableDatafjjz.value = [];
+
+  let temptable = [];
+  
+  fjtableData.value.forEach(row => {
+    if (row.fanbaseid !== 0) {
+      temptable.push(row);
+    }
+  });
+
+  const params = {
+    transCode: "D50007",
+    // aid: aid.value,
+  };
+  request(params)
+    .then((res) => {
+      // 使用 concat() 将新数据添加到现有数据后面
+      res.rows.forEach(newRow => {
+        const exists = temptable.some(existingRow => existingRow.fanbaseid === newRow.fanbaseid);
+        if (!exists) {
+          temptable.push(newRow);  // 只有在不存在时才追加
+        }
+      });
+      tableDatafjjz.value = temptable;
+
+      nextTick(() => {
+        fjtableData.value.forEach(row => {
+          if (row.fanbaseid !== 0) {  // 确保只选中符合条件的行
+            // 在 tableData3 中查找与 tableDatpump 中对应的行
+            const rowIndex = tableDatafjjz.value.findIndex(item => item.fanbaseid === row.fanbaseid);
+            if (rowIndex !== -1) {
+              // 找到对应的行后,选中该行
+              tabledatafjjzref.value.toggleRowSelection(tableDatafjjz.value[rowIndex], true);  // 选中该行
+              console.log("选中的行:", tableDatafjjz.value[rowIndex]);
+            }
+          }
+        });
+      });
+    })
+    .catch((err) => {
+      ElMessage.error(err.returnMsg);
+    });
+}
+
+//风机加载保存
+const fjloadsave = () => {
+  let values = [];
+  const selectedRows = tabledatafjjzref.value.getSelectionRows();
+  console.log( '选中行:',selectedRows);
+
+  if (selectedRows.length === 0) {
+    return; 
+  }
+
+  selectedRows.forEach(row => {
+    // 获取每一行的 fanbaseid
+    if (row.fanbaseid) {
+      values.push(row.fanbaseid);
+    }
+  });
+
+  const params = {
+    transCode: "D50014",
+    aid: aid.value,
+    fanbaseids:values.join(',')
+  };
+  request(params)
+    .then((res) => {
+      ElMessage({
+        message: "加载成功",
+        type: "success",
+      });
+      getrequest();
+    })
+    .catch((err) => {
+      ElMessage.error(err.returnMsg);
+    });
+}
+
 //风机的添加
 const fjclick=()=>{
     zhtext.value='添加';
@@ -699,7 +964,90 @@ const fmrequest=()=>{
       ElMessage.error(err.returnMsg);
     });
   }
-  //风门的add
+
+  //风门加载
+  const fmload = () => {
+    console.log("目标:",fmtableData.value)
+
+    tableDatafmjz.value = [];
+
+    let temptable = [];
+  
+    fmtableData.value.forEach(row => {
+      if (row.doorbaseid !== 0) {
+        temptable.push(row);
+      }
+    });
+
+    const params = {
+      transCode: "D50010",
+      // aid: aid.value,
+    };
+    request(params)
+      .then((res) => {
+        // 使用 concat() 将新数据添加到现有数据后面
+        res.rows.forEach(newRow => {
+        const exists = temptable.some(existingRow => existingRow.doorbaseid === newRow.doorbaseid);
+        if (!exists) {
+          temptable.push(newRow);  // 只有在不存在时才追加
+        }
+      });
+        tableDatafmjz.value = temptable;
+
+        nextTick(() => {
+          fmtableData.value.forEach(row => {
+          if (row.doorbaseid !== 0) {  // 确保只选中符合条件的行
+            // 在 tableData3 中查找与 tableDatpump 中对应的行
+            const rowIndex = tableDatafmjz.value.findIndex(item => item.doorbaseid === row.doorbaseid);
+            if (rowIndex !== -1) {
+              // 找到对应的行后,选中该行
+              tabledatafmjzref.value.toggleRowSelection(tableDatafmjz.value[rowIndex], true);  // 选中该行
+              console.log("选中的行:", tableDatafmjz.value[rowIndex]);
+            }
+          }
+        });
+      });
+      })
+      .catch((err) => {
+        ElMessage.error(err.returnMsg);
+      });
+  }
+
+  const fmloadsave = () => {
+  let values = [];
+  const selectedRows = tabledatafmjzref.value.getSelectionRows();
+  console.log( '选中行:',selectedRows);
+
+  if (selectedRows.length === 0) {
+    return; 
+  }
+
+  selectedRows.forEach(row => {
+    // 获取每一行的 doorbaseid
+    if (row.doorbaseid) {
+      values.push(row.doorbaseid);
+    }
+  });
+
+  const params = {
+    transCode: "D50015",
+    aid: aid.value,
+    doorbaseids:values.join(',')
+  };
+  request(params)
+    .then((res) => {
+      ElMessage({
+        message: "加载成功",
+        type: "success",
+      });
+      fmrequest();
+    })
+    .catch((err) => {
+      ElMessage.error(err.returnMsg);
+    });
+}
+
+  //风门的添加
   const  fmadd=()=>{
     zhtext.value='添加';
     currentrow.value=false;

+ 191 - 0
src/view/components/InfoDisaster.vue

@@ -325,6 +325,12 @@
                         </el-table-column> -->
                       </el-table>
                       <div class="asdis_btn">
+                        <div
+                          class="flex_a"
+                          @click="sdialog.loadpump = true;pumpload(); "
+                        >
+                          <div class="btns" :class="{tabactive: isActive === 10}" @click="changeClass(10)"><span class="spantext">加载</span></div>
+                        </div>
                         <div
                           class="flex_a"
                           @click=" addpumdfun($event); sdialog.addpump = true; "
@@ -1093,6 +1099,99 @@
           </div>
         </div>
       </div>
+    </el-dialog>
+    <!-- 水泵的加载 -->
+    <el-dialog
+      v-model="sdialog.loadpump"
+      width="400"
+      :append-to-body="true"
+      :z-index='1000'
+      align-center
+      :close-on-click-modal="false"
+      :fullscreen="false"
+      :modal-append-to-body="false"
+      draggable 
+      class="dialog_class bgcolor tianjia asideg asidegbg leftbgimg"
+    >
+      <template #header="{ titleId, titleClass }">
+        <div class="my-header">
+          <el-image :src="icon" fit="contain"></el-image>
+          <h4 :id="titleId" :class="titleClass">加载</h4>
+        </div>
+      </template>
+      <div class="demo-input-suffix firsttitle leftbgimg2">
+        <el-table
+          :row-class-name="tableRowClassName"
+          :max-height="tableHeight"
+          ref="tabledata3ref"
+          type="selection"
+          :data="tableData3"
+          style="width: 100%"
+          
+          :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
+        >
+        <template v-slot:empty>
+                        <p>暂无数据</p>
+                        </template>
+          <el-table-column type="selection" width="55" />
+          <!-- <el-table-column property="snId" label="开始节点" />
+          <el-table-column property="enId" label="结束节点" /> -->
+          <el-table-column type="index" label="编号" width="70" />
+          <el-table-column property="pumpname" label="水泵名称" />
+          <el-table-column property="pname" label="巷道名称"  />
+          <el-table-column property="site" label="位置" />
+          <el-table-column prop="onoff" label="开启状态">
+                          <template #default="scope">
+                            {{
+                              scope.row.onoff == "0"
+                                ? "否"
+                                : scope.row.onoff == "1"
+                                ? "是"
+                                : "是"
+                            }}
+                          </template>
+          </el-table-column>
+          <el-table-column prop="openhig"  >
+                          <template v-slot:header>
+                            <span >开起高度</span><br>
+                            <span >(m)</span>
+                          </template>
+          </el-table-column>
+          <el-table-column prop="closehig" >
+                          <template v-slot:header>
+                            <span >关闭高度</span><br>
+                            <span >(m)</span>
+                          </template>
+          </el-table-column>
+          <!-- <el-table-column property="sectionPara1" label="截面参数1" width="90" />
+          <el-table-column property="sectionPara2" label="截面参数2" width="90" />
+          <el-table-column property="sectionPara3" label="截面参数3" width="90" />
+          <el-table-column property="sectionPara4" label="截面参数4" width="90" />
+          <el-table-column property="sectionPara5" label="截面参数5" width="90" /> -->
+        </el-table>
+
+        <div class="dialog-footer footer_div l_btn">
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button @click="sdialog.loadpump = false">取消</el-button>
+            </div>
+          </div>
+          <div class="footerbtn flex1">
+            <div class="borderimg">
+              <el-button
+                @click="
+                  pumploadsave();
+                  sdialog.loadpump = false;
+                "
+              >
+                确定
+              </el-button>
+            </div>
+          </div>
+        </div>
+      </div>
+      
+      
     </el-dialog>
     <!-- 水泵的add -->
     <el-dialog
@@ -1622,6 +1721,7 @@ import selfdialogs from "./SetPipe.vue";
 import vueUploader from "./fileuploads.vue";
 import { NULL } from "sass";
 import emitter from "@/utils/emitter";
+import { ta } from "element-plus/es/locales.mjs";
 // import filesload from "./filesloads.vue";
 // const statusMap = {
 //   'CIRCULAR': '圆形',
@@ -1758,6 +1858,7 @@ const sdialog = ref({
   adddialog: false,
   dialogsgdelect: false,
   dianadddialog: false,
+  loadpump:false,
   addpump:false,
   dialogVisiblenode: false,
   isDisasterfire: false,
@@ -1813,6 +1914,8 @@ let Disastersource = ref({
 let tableobj = ref({});
 
 const tableData2 = ref([]);
+const tableData3 = ref([]);
+let tabledata3ref  = ref();
 let aid = ref();
 let biaoid = ref();
 let coolactiveName1 = ref(["1", "2"]);
@@ -1838,6 +1941,7 @@ sdialog.value.adddialog=false;
 sdialog.value.dialogsgdelect=  false;
 sdialog.value.dianadddialog=  false;
 sdialog.value.addpump= false;
+sdialog.value.loadpump= false;
 sdialog.value.dialogVisiblenode=false;
 sdialog.value.isDisasterfire=  false;
 sdialog.value.isDisasterwter=  false;
@@ -2183,6 +2287,57 @@ const xiugaiapi = () => {
     })
     .catch((err) => {});
 };
+
+// 水泵加载
+const pumpload = () => {
+  // aid.value=id;
+  console.log("目标:",tableDatpump.value)
+
+  tableData3.value = [];
+
+  let temptable = [];
+  
+  tableDatpump.value.forEach(row => {
+    if (row.pumpbaseid !== 0) {
+      temptable.push(row);
+    }
+  });
+
+  const params = {
+    transCode: "D50001",
+    // aid: aid.value,
+  };
+  request(params)
+    .then((res) => {
+      // 使用 concat() 将新数据添加到现有数据后面
+      res.rows.forEach(newRow => {
+        const exists = temptable.some(existingRow => existingRow.pumpbaseid === newRow.pumpbaseid);
+        if (!exists) {
+          temptable.push(newRow);  // 只有在不存在时才追加
+        }
+      });
+      tableData3.value = temptable;
+      console.log("水泵数据:",tableData3.value)
+
+      nextTick(() => {
+        tableDatpump.value.forEach(row => {
+          if (row.pumpbaseid !== 0) {  // 确保只选中符合条件的行
+            // 在 tableData3 中查找与 tableDatpump 中对应的行
+            const rowIndex = tableData3.value.findIndex(item => item.pumpbaseid === row.pumpbaseid);
+            if (rowIndex !== -1) {
+              // 找到对应的行后,选中该行
+              tabledata3ref.value.toggleRowSelection(tableData3.value[rowIndex], true);  // 选中该行
+              console.log("选中的行:", tableData3.value[rowIndex]);
+            }
+          }
+        });
+      });
+    })
+    .catch((err) => {
+      ElMessage.error(err.returnMsg);
+    });
+};
+
 // 选择
 const fireclick = () => {
   searchtaggd.value='';
@@ -2788,6 +2943,42 @@ const pumpxiugai=(val)=>{
   }
 }
 
+// 水泵加载保存
+const  pumploadsave = () => {
+  let values = [];
+  const selectedRows = tabledata3ref.value.getSelectionRows();
+  console.log( '选中行:',selectedRows);
+
+  if (selectedRows.length === 0) {
+    return; 
+  }
+
+  selectedRows.forEach(row => {
+    // 获取每一行的 pumpbaseid
+    if (row.pumpbaseid) {
+      values.push(row.pumpbaseid);
+    }
+  });
+
+  const params = {
+    transCode: "D50013",
+    aid: aid.value,
+    pumpbaseids:values.join(',')
+  };
+  request(params)
+    .then((res) => {
+      ElMessage({
+        message: "加载成功",
+        type: "success",
+      });
+      getrequest(aid.value);
+    })
+    .catch((err) => {
+      ElMessage.error(err.returnMsg);
+    });
+}
+
+
 //水泵的添加接口
 const addrequest=()=>{
   if(firepid.value==null||firepid.value==""){