<template>
  <!--  灾情源设置collapseaside-->
  <div class="l_Dialog bbb tablebk ">
    <!--火灾左侧栏-->
    <div class="common-layout" style="margin: 0" v-show="sour.collfire">
      <el-aside width="2.125rem" class="L_aside L_aside1 asideg asidegbg leftbgimg1">
        <div class="demo-collapse">
          <el-collapse v-model="coolactiveName1" accordion @change="handleChangecollapse ">
            <el-collapse-item name="1" class="imgneon">
              <template #title>
                <el-icon class="iconimg Frame3" fit="contain"></el-icon>
                火灾灾害源设置
              </template>
              <div class="asides_content">
                <div class="jc_content tablecolor">
                  <div class="jc_padding">
                    <div class="xian btncolor tablefocus">
                      <el-table
                        :data="tableDatay"
                        @row-click="handleDelete($event)"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0)' }"
                      :highlight-current-row="currentrow" 
                        style="width: 100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                      >
                      <template  v-slot:empty>
                        <p>暂无数据</p>
                      </template>
                        <el-table-column prop="pname" width="80" label="选择巷道" />
                        <!-- <el-table-column prop="site" label="相对位置" /> -->
                        <el-table-column property="siteremark" label="位置"/>
                        <!-- <el-table-column label="操作" >
                          <template #default="scope">
                            <el-button
                              size="small"
                              type="success"
                              @click="handledetection(scope.$index, scope.row)"
                              >查看</el-button
                            >
                          </template>
                        </el-table-column> -->
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            newtable($event,'firesoure');
                            sdialog.dianadddialog = true;
                          "
                        >
                          <div class="btns" ><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="xiugaitable('firesoure')">
                          <div class="btns"><span class="spantext">修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="
                            shanchu('1');
                          "
                        >
                          <div class="btns"><span class="spantext">删除</span></div>
                        </div>
                      </div>
                    </div>
                    <!--火灾灾害源表  -->
                    <div
                      class="xian tablefocus zaiyuanbiao"
                      style="margin-top: 20px"
                      v-show="sdialog.isDisasterfire"
                    >
                      <div class="header_l header_z  headerimg">
                        <el-image :src="icon" fit="contain"></el-image>
                        <h4 class="tianjia">灾害源表</h4>
                        <div class="closeimg" @click="sdialog.isDisasterfire = false">
                          <el-image :src="closeimg" fit="contain"></el-image>
                        </div>
                      </div>
                      <el-table
                        :data="tableDatafir"
                        style="width: 100%"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        :max-height="tableHeight"
                        @row-click="handleDelete2($event)"
                        :highlight-current-row="currentrow1" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="timeline" label="时间(/s)"  />
                        <el-table-column prop="val1" label="温度(℃)" />
                        <el-table-column prop="val2" label="二氧化碳(%)"  />
                        <el-table-column prop="val3" label="二氧化硫(ppm)"  />
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            firinit();
                            sdialog.adddialog = true;
                            currentrow1=false;
                          "
                        >
                          <div class="btns"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="zaiyuxiugai()">
                          <div class="btns"><span class="spantext"> 修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="
                            shanchu('2');
                            //sdialog.dialogsgdelect = true;
                          "
                        >
                          <div class="btns"><span class="spantext">删除</span></div>
                        </div>
                        <div class="flex_a">
                          <div class="btns" @click="sdialog.isDisasterfire = false">
                            <span class="spantext">确定</span>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-collapse-item>
          </el-collapse>
        <Fengmen ref='Fengmenref'></Fengmen>
        </div>
      </el-aside>
    </div>
    <!-- 突水 -->
    <div class="common-layout collapseaside" style="margin: 0" v-show="sour.collwater">
      <el-aside width="1.6667rem" class="L_aside L_aside1 asideg asidegbg leftbgimg1">
        <div class="demo-collapse">
          <!-- 突水 sour.collwater-->
          <el-collapse v-model="coolactiveName1" accordion>
            <el-collapse-item name="1" class="imgneon">
              <template #title>
                <el-icon class="iconimg Frame3" fit="contain"></el-icon>
                突水灾害源设置
              </template>
              <div class="asides_content">
                <div class="jc_content tablecolor">
                  <div class="jc_padding">
                    <div class="xian btncolor tablefocus">
                      <el-table
                        :data="tableDatawat"
                        style="width: 100%"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="handleDeletewotwr($event)"
                        :max-height="tableHeight"
                        :highlight-current-row="currentrow" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="pname" label="选择巷道"  />
                        <!-- <el-table-column prop="site" label="相对位置"  /> -->
                        <el-table-column prop="siteremark" label="位置"/>
                        <!-- <el-table-column label="操作" >
                          <template #default="scope">
                            <el-button
                              size="small"
                              type="success"
                              @click="handledetection2(scope.$index, scope.row)"
                              >查看</el-button
                            >
                          </template>
                        </el-table-column> -->
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            newtable($event,'watersoure');
                            sdialog.dianadddialog = true;
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 1}" @click="changeClass(1)"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="xiugaitable('watersoure')">
                          <div class="btns" :class="{tabactive: isActive === 2}" @click="changeClass(2)"><span class="spantext">修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="
                            shanchu('1');
                        
                          "
                        >
                          <div class="btns"  :class="{tabactive: isActive === 3}" @click="changeClass(3)"><span class="spantext">删除</span></div>
                        </div>
                        <!-- <div class="flex_a">
                          <div class="btns"><span class="spantext">确定</span></div>
                        </div> -->
                      </div>
                    </div>
                    <!-- 灾害源表 -->
                    <div
                      class="xian tablefocus"
                      style="margin-top: 20px"
                      v-show="sdialog.disDisasterwter"
                    >
                      <div class="header_l header_z headerimg">
                        <el-image :src="icon" fit="contain"></el-image>
                        <h4 class="tianjia">灾害源表</h4>
                        <div class="closeimg" @click="sdialog.disDisasterwter = false">
                          <el-image :src="closeimg" fit="contain"></el-image>
                        </div>
                      </div>
                      <el-table
                        :data="tableData4"
                        style="width: 100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="handleDelete3($event)"
                        :highlight-current-row="currentrow1" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="timeline" label="时间（/s）" />
                        <el-table-column prop="val1" label="突水量（m³/s）" />
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            firinit();
                            sdialog.adddwater = true;
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 4}" @click="changeClass(4)"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="zaiyuxiugai()">
                          <div class="btns" :class="{tabactive: isActive === 5}" @click="changeClass(5)"><span class="spantext"> 修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="
                            shanchu('2');
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 6}" @click="changeClass(6)"><span class="spantext">删除</span></div>
                        </div>
                        <div class="flex_a" @click="sdialog.disDisasterwter = false">
                          <div class="btns"><span class="spantext">确定</span></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-collapse-item>
            <!-- <el-collapse-item name="2">
              <div style="position: relative;">是的
              <info-boundary :classradio="classradio" /></div>
            </el-collapse-item> -->
          </el-collapse>
        <!-- 突水灾害源结束-->
        <!-- 水泵 -->
        <el-collapse v-model="coolactiveName1"  style="margin-top: 10px;">
            <el-collapse-item name="2" class="imgneon">
              <template #title>
                <el-icon class="iconimg Frame3" fit="contain"></el-icon>
                水泵
              </template>
              <div class="asides_content">
                <div class="jc_content tablecolor">
                  <div class="jc_padding">
                    <div class="xian btncolor tablefocus">
                      <el-table
                        :data="tableDatpump"
                        style="width: 100%"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="pumpxz($event)"
                        :max-height="tableHeight"
                        :highlight-current-row="currentrow" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="pumpname" label="水泵名称"  />
                        <el-table-column prop="pname" label="选择巷道"  />
                        <!-- <el-table-column prop="site" label="相对位置"  /> -->
                        <el-table-column prop="siteremark" 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 prop="site" label="性能曲线数据量"  /> -->
                        <!-- <el-table-column label="操作" >
                          <template #default="scope">
                            <el-button
                              size="small"
                              type="success"
                              @click="lookpump(scope.$index, scope.row)"
                              >查看</el-button
                            >
                          </template>
                        </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,'pump'); sdialog.addpump = true; "
                        >
                          <div class="btns" :class="{tabactive: isActive === 7}" @click="changeClass(7)"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="pumpxiugai('pump')">
                          <div class="btns" :class="{tabactive: isActive === 8}" @click="changeClass(8)"><span class="spantext">修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="pumpdel()"
                        >
                          <div class="btns"  :class="{tabactive: isActive === 9}" @click="changeClass(9)"><span class="spantext">删除</span></div>
                        </div>
                        <!-- <div class="flex_a">
                          <div class="btns"><span class="spantext">确定</span></div>
                        </div> -->
                      </div>
                    </div>
                    <!-- 性能曲线 表 -->
                    <div
                      class="xian tablefocus"
                      style="margin-top: 20px"
                      v-show="sdialog.linetable"
                    >
                      <div class="header_l header_z headerimg">
                        <el-image :src="icon" fit="contain"></el-image>
                        <h4 class="tianjia">性能曲线</h4>
                        <div class="closeimg" @click="sdialog.linetable = false">
                          <el-image :src="closeimg" fit="contain"></el-image>
                        </div>
                      </div>
                      <el-table
                        :data="tableline"
                        style="width: 100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="xnlinehande($event)"
                        :highlight-current-row="currentrow1" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="hight">
                          <template v-slot:header>
                            <span >水位高度</span><br>
                            <span>(m)</span>
                          </template>
                        </el-table-column>
                        <el-table-column prop="flow" >
                          <template v-slot:header>
                            <span >流量</span><br>
                            <span> (m³/s)</span>
                          </template>
                        </el-table-column>
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="clineadd(); sdialog.addline= true;
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 4}" @click="changeClass(4)"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="xiugailine()">
                          <div class="btns" :class="{tabactive: isActive === 5}" @click="changeClass(5)"><span class="spantext"> 修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="delline()
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 6}" @click="changeClass(6)"><span class="spantext">删除</span></div>
                        </div>
                        <div class="flex_a" @click="sdialog.linetable = false">
                          <div class="btns"><span class="spantext">确定</span></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-collapse-item>
            <!-- <el-collapse-item name="2">
              <div style="position: relative;">是的
              <info-boundary :classradio="classradio" /></div>
            </el-collapse-item> -->
          </el-collapse>
        <!-- 水泵结束 -->
        </div>
      </el-aside>
    </div>
    <!-- 瓦斯爆炸 -->
     <div class="common-layout " style="margin: 0;margin-top: 10px;" v-show="sour.Gass">
      <el-aside     width="2.125rem" class="L_aside L_aside1 asideg asidegbg leftbgimg1">
        <div class="demo-collapse">
          <el-collapse v-model="coolactiveName1" accordion>
            <el-collapse-item name="1" class="imgneon">
              <template #title>
                <el-icon class="iconimg Frame3" fit="contain"></el-icon>
                瓦斯<el-icon class="header-icon"> </el-icon>
              </template>
              <div class="asides_content">
                <div class="jc_content tablecolor">
                  <div class="jc_padding">
                    <div class="xian btncolor tablefocus">
                      <el-table
                        :data="tableDataws"
                        style="width: 100%"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="handlews($event)"
                        max-height="350px"
                        :highlight-current-row="currentrow" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                      <el-table-column type="index" label="序号" width="80"/>
                      
                        <el-table-column prop="gfname" label="网格文件"  min-width="100"/>
                        <el-table-column prop="bfname" label="边界文件"  min-width="100"/>
                        <el-table-column prop="pname" label="选择巷道" min-width="150"/>
                        <!-- <el-table-column label="操作" > -->
                          <!-- <template #default="scope">
                            <el-button
                              size="small"
                              type="success"
                              @click="handlook(scope.$index, scope.row)"
                              >查看</el-button
                            >
                          </template> -->
                        <!-- </el-table-column> -->
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            wanewadd();
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 4}" @click="changeClass(4)"><span class="spantext">添加</span></div>
                        </div>
                      
                        <div
                          class="flex_a"
                          @click="wsdelete()
                        
                          "
                        >
                          <div class="btns" :class="{tabactive: isActive === 6}" @click="changeClass(6)"><span class="spantext">删除</span></div>
                        </div>
                      
                      </div>
                    </div>
                 
               <!-- 瓦斯爆炸区域 -->
               <div 
                      class="xian tablefocus wstable"
                     v-show="Gassdialog.blast"
                    >
                      <div class="header_l header_z">
                        <el-image :src="icon" fit="contain"></el-image>
                        <h4 class="tianjia">瓦斯爆炸区域</h4>
                        <div class="closeimg" @click="Gassdialog.blast = false">
                          <el-image :src="closeimg" fit="contain"></el-image>
                        </div>
                      </div>
                      <el-table
                        :data="gtableData"
                        style="width:100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="handleblastxg($event)"
                        :highlight-current-row="currentrow1" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="pname" label="巷道" />
                        <!-- <el-table-column prop="ssite" label="开始位置" />
                        <el-table-column prop="esite" label="结束位置" /> -->
                        <el-table-column prop="siteremark" label="位置"/>
                      </el-table>
                      <div class="asdis_btn">
                        <!-- <div class="btnpading"> -->
                        <div
                          class="flex_as"
                          @click="
                            wsaddblast();
                          "
                        >
                          <div class="btns"><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_as" @click="wsxiugai2()">
                          <div class="btns"><span class="spantext"> 修改</span></div>
                        </div>
                        <div
                          class="flex_as"
                          @click="
                           wsblastdelete();
                          "
                        >
                          <div class="btns"><span class="spantext">删除</span></div>
                        </div>
                        <div class="flex_as" @click="sdialog.disDisasterwter = false">
                          <div class="btns"><span class="spantext" @click="Gassdialog.blast = false" >确定</span></div>
                        </div>
                      <!-- </div> -->
                      </div>
                    </div>
                  <!-- 积聚区 -->
               <div 
                      class="xian tablefocus wstable"
                      v-show="Gassdialog.gather"
                    >
                      <div class="header_l header_z">
                        <el-image :src="icon" fit="contain"></el-image>
                        <h4 class="tianjia">积聚区</h4>
                        <div class="closeimg" @click="Gassdialog.gather= false">
                          <el-image :src="closeimg" fit="contain"></el-image>
                        </div>
                      </div>
                      <el-table
                        :data="gjtableData"
                        style="width: 100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
                        @row-click="handlegather($event)"
                        :highlight-current-row="currentrow2" 
                      >
                      <template v-slot:empty>
                        <p>暂无数据</p>
                        </template>
                        <el-table-column prop="name" label="区域名" />
                       
                        <el-table-column
                          label="类型"
                          prop="type"
                          align="center"
                          width="80px"
                        >
                          <template #default="scope">
                            <span  v-if="scope.row.type === '0'">空白区</span>
                            <span   v-else-if="scope.row.type === '1'">积聚区</span>
                            <span  v-else>点火区</span>
                          </template>
                        </el-table-column>
                        <el-table-column prop="gasdensity">
                          <template v-slot:header>
                            <span >瓦斯浓度</span><br>
                            <span >(ppm)</span>
                          </template>
                          </el-table-column>
                      </el-table>
                      <div class="asdis_btn">
                        <!-- <div class="btnpading"> -->
                        <!-- <div
                          class="flex_as"
                          @click="
                            firinit();
                            sdialog.adddwater = true;
                          "
                        >
                          <div class="btns"><span class="spantext">添加</span></div>
                        </div> -->
                        <div class="flex_as" @click="gatheruxiugai()">
                          <div class="btns"><span class="spantext"> 修改</span></div>
                        </div>
                        <!-- <div
                          class="flex_as"
                          @click="
                            shanchu('2');
                          "
                        >
                          <div class="btns"><span class="spantext">删除</span></div>
                        </div> -->
                        <div class="flex_as" @click="Gassdialog.gather= false">
                          <div class="btns"><span class="spantext">确定</span></div>
                        </div>
                      <!-- </div> -->
                      </div>
                    </div>
                  </div>

                  <!-- <div style="height: 200px"></div> -->
                </div>
              </div>
            </el-collapse-item>
          </el-collapse>
        </div>
      </el-aside>
    </div>
    <!-- 快速瓦斯爆炸 -->
    <div class="common-layout" style="margin: 0" v-show="sour.collGass1">
      <el-aside width="2.125rem" class="L_aside L_aside1 asideg asidegbg leftbgimg1">
        <div class="demo-collapse">
          <el-collapse v-model="coolactiveName1" accordion @change="handleChangecollapse ">
            <el-collapse-item name="1" class="imgneon">
              <template #title>
                <el-icon class="iconimg Frame3" fit="contain"></el-icon>
                一维瓦斯灾源
              </template>
              <div class="asides_content">
                <div class="jc_content tablecolor">
                  <div class="jc_padding">
                    <div class="xian btncolor tablefocus">
                      <el-table
                        :data="yiweitable"
                        @row-click="yiweihandle($event)"
                        :header-cell-style="{ background: 'rgba(13, 22, 57, 0)' }"
                      :highlight-current-row="currentrow" 
                        style="width: 100%"
                        :max-height="tableHeight"
                        :row-class-name="tableRowClassName"
                      >
                      <template  v-slot:empty>
                        <p>暂无数据</p>
                      </template>
                        <el-table-column prop="pname" label="选择巷道" />
                        <!-- <el-table-column prop="ssite" label="开始位置" />
                        <el-table-column prop="esite" label="结束位置" /> -->
                        <el-table-column prop="siteremark" label="位置"/>
                        <el-table-column prop="gasdensity" label="瓦斯爆炸区浓度"  />
                      </el-table>
                      <div class="asdis_btn">
                        <div
                          class="flex_a"
                          @click="
                            yiweiadd($event);
                            sdialog.yiweidialog = true;
                          "
                        >
                          <div class="btns" ><span class="spantext">添加</span></div>
                        </div>
                        <div class="flex_a" @click="yiweixiugai()">
                          <div class="btns"><span class="spantext">修改</span></div>
                        </div>
                        <div
                          class="flex_a"
                          @click="yiweidelete()
                          "
                        >
                          <div class="btns"><span class="spantext">删除</span></div>
                        </div>
                      </div>
                    </div>
                  
                  </div>
                </div>
              </div>
            </el-collapse-item>
          </el-collapse>
        <!-- <Fengmen ref='Fengmenref' :aid='aid'></Fengmen> -->
        </div>
      </el-aside>
    </div>
    <!--  一维添加 -->
    <el-dialog
      v-model="sdialog.yiweidialog"
      width="500"
      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
      @close='closeDialog'
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{ zhtext }}</h4>
        </div>
      </template>
      <div class="demo-input-suffix firsttitle magintop">
        <el-form-item label="巷道名称" :label-width="formLabelWidth6">
          <el-input
            v-model="selectstr"
            disabled
            class="w-50 m-2"
            placeholder="巷道名称"
          />
        </el-form-item>
        <div class="btn2">
          <el-button
            type="primary"
            @click="
              fireclick();
              sdialog.dialogVisiblenode = true;
            "
            >选择巷道</el-button
          >
        </div>
        <div class="btn2" style="padding-left: 10px">
          <el-button type="primary" @click="Dclick('ws')">3D巷道选择</el-button>
        </div>
      </div>
      <div class="input">
        <el-form-item label="开始位置" :label-width="formLabelWidth6">
          <el-input-number
            v-model="yiweiobj.ssite"
            :min="0"
            :max="1"
            :precision="2"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="开始位置"
            @change="ywgess"
          />
        </el-form-item>
      </div>
      <div class="input">
        <el-form-item label="结束位置" :label-width="formLabelWidth6">
          <el-input-number
            v-model="yiweiobj.esite"
            :min="0"
            :max="1"
            :precision="2"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="结束位置"
            @change="ywgess2"
          />
        </el-form-item>
      </div>
      <el-form-item label="位置" :label-width="formLabelWidth6">
        <el-input
          v-model="yiweiobj.siteremark"
          class="w-50 m-2"
          placeholder="请输入位置说明"
        />
      </el-form-item>
      <div class="input">
        <el-form-item label="瓦斯爆炸区浓度" :label-width="formLabelWidth6">
          <el-input-number
          v-model="yiweiobj.gasdensity"
            :min="0"
            :max="1"
            :precision="2"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="浓度"
            @change="inputnuberChange"
          />
        </el-form-item>
      </div>
      <!-- <el-form-item label="瓦斯爆炸区浓度" :label-width="formLabelWidth6">
            <el-input v-model="yiweiobj.gasdensity"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2"  placeholder="请输入" />
        </el-form-item> -->
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="closeDialog(); sdialog.yiweidialog = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="yehandleEdit();
              
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!--  瓦斯的添加-->
    <el-dialog
      v-model="Gassdialog.wsaddshow"
      width="500"
      align-center
      :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="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{zhtext}}</h4>
        </div>
      </template>
      <div class="demo-input-suffix firsttitle magintop">
        <el-form-item label="巷道名称" :label-width="formLabelWidth5">
          <el-input
            v-model="selectstr"
            disabled
            class="w-50 m-2"
            placeholder="巷道名称"
          />
        </el-form-item>
        <div class="btn2">
          <el-button
            type="primary"
            @click="
              fireclick();
              sdialog.dialogVisiblenode = true;
            "
            >选择巷道</el-button
          >
        </div>
        <div class="btn2" style="padding-left: 10px">
          <el-button type="primary" @click="Dclick()">3D巷道选择</el-button>
        </div>
      </div>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="closeDialog(); Gassdialog.wsaddshow=false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
             @click="Gassadd();"
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 瓦斯爆炸区域的添加 -->
    <el-dialog
      v-model="Gassdialog.wsaddarea"
      width="400"
      align-center
      :modal="false"
      :close-on-click-modal="false"
      :append-to-body="true"
      draggable
      :fullscreen="false"
      :modal-append-to-body="false"
      modal-class="summary-dlg"
      class="dialog_class bgcolor tianjia"
      @close='closeDialog'
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{zhtext}} </h4>
        </div>
      </template>
         <!-- <div class=" btncolor tablefocus">
                
               
        </div> -->
        <div class="demo-input-suffix firsttitle magintop">
        <el-form-item label="巷道名称" :label-width="formLabelWidth5">
          <el-input
            v-model="selectstr"
            disabled
            class="w-50 m-2"
            placeholder="巷道名称"
          />
        </el-form-item>
        <div class="btn2">
          <el-button
            type="primary"
            @click="
              fireclick();
              sdialog.dialogVisiblenode = true;
            "
            >选择巷道</el-button
          >
        </div>
        <div class="btn2" style="padding-left: 10px">
          <el-button type="primary" @click="Dclick('ws')">3D巷道选择</el-button>
        </div>
      </div>
      <div class="input">
        <el-form-item label="开始位置" :label-width="formLabelWidth5">
          <el-input-number
            v-model="wasi.ssite"
            :min="0"
            :max="1"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="位置"
            @change="gessanum1"
         
          />
        </el-form-item>
        <el-form-item label="结束位置" :label-width="formLabelWidth5">
          <el-input-number
            v-model="wasi.esite"
            :min="0"
            :max="1"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="位置"
            @change="gessanum2"
          />
        </el-form-item>
      </div>
      <el-form-item label="位置" :label-width="formLabelWidth5">
        <el-input
          v-model="wasi.siteremark"
          class="w-50 m-2"
          placeholder="请输入位置说明"
        />
      </el-form-item>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="closeDialog();Gassdialog.wsaddarea= false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="
               wsbalastadd();
             
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 积聚的修改 -->
    <el-dialog
      v-model="Gassdialog.wsaddgather"
      width="400"
      align-center
      :modal="false"
      :close-on-click-modal="false"
      :append-to-body="true"
      draggable
      :fullscreen="false"
      :modal-append-to-body="false"
      modal-class="summary-dlg"
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{zhtext}} </h4>
        </div>
      </template>
      <el-form-item label="类型" :label-width="formLabelWidth6">
                <el-select v-model="wasi.type" placeholder="请选择">
                  <el-option
                    v-for="item in wasi.options"
                    :key="item.id"
                    :label="item.name"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
      <div class="input">
        <el-form-item label="瓦斯浓度(ppm)" :label-width="formLabelWidth6">
                <el-input
                  v-model="wasi.gasdensity"
                  class="w-50 m-2"
                  placeholder="请输入"
                  oninput ="value=value.replace(/[^0-9.]/g,'')" 
                />
              </el-form-item>
       
      </div>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="Gassdialog.wsaddgather= false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="
               wsgatheradd();
             
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 突水灾害点源数据的添加      draggable-->
    <el-dialog
      v-model="sdialog.dianadddialog"
      width="500"
      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
      @close='closeDialog'
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{ zhtext }}</h4>
        </div>
      </template>
      <div class="demo-input-suffix firsttitle magintop">
        <el-form-item label="巷道名称" :label-width="formLabelWidth5">
          <el-input
            v-model="selectstr"
            disabled
            class="w-50 m-2"
            placeholder="巷道名称"
          />
        </el-form-item>
        <div class="btn2">
          <el-button
            type="primary"
            @click="
              fireclick('ws');
              sdialog.dialogVisiblenode = true;
            "
            >选择巷道</el-button
          >
        </div>
        <div class="btn2" style="padding-left: 10px">
          <el-button type="primary" @click="Dclick()">3D巷道选择</el-button>
        </div>
      </div>
      <div class="input">
        <el-form-item label="相对位置" :label-width="formLabelWidth5">
          <el-input-number
            v-model="source.site"
            :min="0"
            :max="1"
            :precision="2"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="相对位置"
            @change="inputnuberChange2"
          />
        </el-form-item>
      </div>
      <el-form-item label="位置" :label-width="formLabelWidth5">
        <el-input
          v-model="source.siteremark"
          class="w-50 m-2"
          placeholder="请输入位置说明"
        />
      </el-form-item>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="closeDialog(); sdialog.dianadddialog = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              :disabled="isSubmitting"
              @click="
                handleEditfire();
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 水泵的加载 -->
    <el-dialog
      v-model="sdialog.loadpump"
      width="400"
      :modal = "false"
      :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="siteremark" 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
      v-model="sdialog.addpump"
      width="500"
      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
      @close='closeDialog'
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{ zhtext }}</h4>
        </div>
      </template>
      <el-form >
        <el-form-item label="编码" :label-width="formLabelWidth6">
            <el-input v-model="pumpobj.pumpcode"    maxlength="10"  @input="pumpobj.pumpcode = pumpobj.pumpcode.replace(/[\u4e00-\u9fa5\s]/g, '')"   class="w-50 m-2" placeholder="请输入" />
        </el-form-item>
      <el-form-item label="水泵名称" :label-width="formLabelWidth6">
            <el-input v-model="pumpobj.pumpname"    maxlength="18" oninput ="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')"  class="w-50 m-2" placeholder="请输入" />
        </el-form-item>
      <div class="demo-input-suffix firsttitle magintop">
        <el-form-item label="巷道名称" :label-width="formLabelWidth6">
          <el-input
            v-model="selectstr"
            disabled
            class="w-50 m-2"
            placeholder="巷道名称"
          />
        </el-form-item>
        <div class="btn2">
          <el-button
            type="primary"
            @click="
              fireclick();
              sdialog.dialogVisiblenode = true;
            "
            >选择巷道</el-button
          >
        </div>
        <div class="btn2" style="padding-left: 10px">
          <el-button type="primary" @click="Dclick()">3D巷道选择</el-button>
        </div>
      </div>
      <div class="input">
        <el-form-item label="相对位置" :label-width="formLabelWidth6">
          <el-input-number
            v-model="source.site"
            :min="0"
            :max="1"
            :precision="2"
            :step="0.1"
            controls-position="right"
            class="w-50 m-2"
            placeholder="相对位置"
            @change="inputnuberChange1"
          />
        </el-form-item>
      </div>
      <el-form-item label="位置" :label-width="formLabelWidth6">
        <el-input
          v-model="pumpobj.siteremark"
          class="w-50 m-2"
          placeholder="请输入位置说明"
        />
      </el-form-item>
      <div style="display: flex;" >
                  <span class="switchppm">开启状态</span>
                <el-switch 
                v-model="pumpobj.onoff"
                inline-prompt
                active-text="是"
                inactive-text="否"
                :active-value="1"
                :inactive-value="0"
                @change="handleSwitchChange"
              />
            </div>
      <el-form-item label="开启高度(m)" :label-width="formLabelWidth6">
            <el-input v-model="pumpobj.openhig"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2"  placeholder="请输入" />
        </el-form-item>
        <el-form-item label="关闭高度(m)" :label-width="formLabelWidth6">
            <el-input v-model="pumpobj.closehig"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2"  placeholder="请输入" />
        </el-form-item>
      </el-form>
        <!-- <el-form-item label="性能曲线数据量" :label-width="formLabelWidth6">
            <el-input v-model.number="pumpobj.timeline"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2" placeholder="请输入" />
        </el-form-item> -->
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="closeDialog(); sdialog.addpump = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              :disabled="isSubmitting"
              @click="addrequest();
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 选择巷道 -->
    <el-dialog
      v-model="sdialog.dialogVisiblenode"
      width="50%"
      :append-to-body="true"
      align-center 
      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">
        <div class="guand_1">
          <el-form-item label="巷道选择" :label-width="formLabelWidth5">
            <el-input
              v-model="searchtaggd"
              class="w-50 m-2"
              placeholder="巷道名称"
            />
          </el-form-item>
          <div class="asdis_btn">
            <div class="flex_a">
              <div class="btns" @click="searchgd"><span class="spantext">搜索</span></div>
            </div>
          </div>
        </div>
  
        <el-table
          :row-class-name="tableRowClassName"
          :max-height="tableHeight"
          ref="multipleTableRef"
          :data="tableData2"
          style="width: 100%"
          @select="projectsSelectionSelect"
          :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 property="id" label="编号" width="70" />
          <el-table-column property="name" label="名称" />
          <el-table-column property="sectionType" label="截面类型" width="120" />
          <el-table-column property="roughCoe" label="粗糙系数" />
          <!-- <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="demo-pagination-block" style="margin-top: 20px">
          <el-config-provider :locale="zhCn">
          <el-pagination
            v-model:current-page="currentPage4"
            v-model:page-size="pageSize4"
            small
            background
            layout="prev, total,pager, next, jumpe,"
            :total="parseInt(total)"
            class="mt-4"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </el-config-provider>
        </div>
        <div class="dialog-footer footer_div l_btn">
          <div class="footerbtn flex1">
            <div class="borderimg">
              <el-button @click="sdialog.dialogVisiblenode = false">取消</el-button>
            </div>
          </div>
          <div class="footerbtn flex1">
            <div class="borderimg">
              <el-button
                @click="
                  queding();
                  sdialog.dialogVisiblenode = false;
                "
              >
                确定
              </el-button>
            </div>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 灾害火灾源检测数据的添加-->
    <el-dialog
      v-model="sdialog.adddialog"
      width="400"
      align-center
      :modal="false"
      :append-to-body="true"
      :close-on-click-modal="false"
      draggable
      :fullscreen="false"
      :modal-append-to-body="false"
      modal-class="summary-dlg"
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{ zhtext }}</h4>
        </div>
      </template>
      <div>
        <el-form>
          <el-form-item label="时间(/s)"  :label-width="formLabelWidth6">
            <el-input
              v-model.Number="Disastersource.timeline"
              class="w-50 m-2"
              placeholder="请输入时间秒"
              maxlength="12"
              step="0.01"
              oninput ="value=value.replace(/[^0-9]/g,'')"
            />
          </el-form-item>
          <el-form-item label="温度(℃)" :label-width="formLabelWidth6">
            <el-input
              v-model.Number="Disastersource.val1"
              class="w-50 m-2"
              placeholder="请输入"
              maxlength="10"
              step="0.01"
              oninput ="value=value.replace(/[^0-9.]/g,'')"
            />
          </el-form-item>
          <el-form-item label="二氧化碳(%)" :label-width="formLabelWidth6">
            <el-input
              v-model="Disastersource.val2"
              class="w-50 m-2"
              placeholder="请输入"
              maxlength="10"
              step="0.01"
              oninput ="value=value.replace(/[^0-9.]/g,'')"
            />
          </el-form-item>
          <el-form-item label="二氧化硫(ppm)" :label-width="formLabelWidth6">
            <el-input
              v-model.Number="Disastersource.val3"
              class="w-50 m-2"
              placeholder="请输入"
              maxlength="10"
              oninput ="value=value.replace(/[^0-9.]/g,'')"
            />
          </el-form-item>
        </el-form>
      </div>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="sdialog.adddialog = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              :disabled="isSubmitting"
              @click="
                addjiancf();
                sdialog.adddialog = false;
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 灾害源突水检测数据的添加-->
    <el-dialog
      v-model="sdialog.adddwater"
      :append-to-body="true"
      width="400"
      align-center
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{ zhtext}}</h4>
        </div>
      </template>
      <div>
        <el-form class="demo-form-inline inputnuber">
          <el-form-item label="时间(/s)" :label-width="formLabelWidth6">
            <el-input
            :min="0"
              v-model.number="Disastersource.timeline"
              class="w-50 m-2"
              :maxlength="8"
              :precision="0"
              placeholder="请输入时间秒"
              oninput ="value=value.replace(/[^0-9]/g,'')" 
            />
          </el-form-item>
          <el-form-item label="突水量（m³/s）"   :label-width="formLabelWidth6">
            <el-input
              v-model.number="Disastersource.val1"
              class="w-50 m-2"
              placeholder="请输入"
              :min="0"
              :maxlength="8"  
              :precision="0"
              oninput ="value=value.replace(/[^0-9]/g,'')" 
             
              
            />
          </el-form-item>
        </el-form>
      </div>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="sdialog.adddwater = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              :disabled="isSubmitting"
              @click="
                addjiancf();
                sdialog.adddwater = false;
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!--性能曲线的添加  -->
    <el-dialog
      v-model="sdialog.addline"
      :append-to-body="true"
      width="400"
      align-center
      class="dialog_class bgcolor tianjia"

    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">{{  zhtext  }}</h4>
        </div>
      </template>
      <div>
        <el-form class="demo-form-inline inputnuber">
          <el-form-item label="水位高度(m)" :label-width="formLabelWidth6">
            <el-input v-model="pumpxc.hight"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2"  placeholder="请输入" />
        </el-form-item>
        <el-form-item label="流量(m³/s)" :label-width="formLabelWidth6">
            <el-input v-model="pumpxc.flow"  maxlength="10" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2"  placeholder="请输入" />
        </el-form-item>
        
        </el-form>
      </div>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="sdialog.addline = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              :disabled="isSubmitting"
              @click="xnadd();  "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 删除 -->
    <el-dialog
      v-model="sdialog.dialogsgdelect"
      :append-to-body="true"
      width="300"
      align-center
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">删除框</h4>
        </div>
      </template>
      <h4 class="delecttitle">
        是否确认删除 <span class="spanclad">{{ zqname }}</span>
      </h4>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="sdialog.dialogsgdelect = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="fundeledata();
                sdialog.dialogsgdelect = false;
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
     <!-- 水灾删除 -->
     <el-dialog
      v-model="sdialog.deletedata"
      :append-to-body="true"
      width="300"
      align-center
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">删除框</h4>
        </div>
      </template>
      <h4 class="delecttitle">
        是否确认删除 <span class="spanclad">{{ zqname }}</span>
      </h4>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="sdialog.deletedata = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="deletedata();
                sdialog.deletedata = false;
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 瓦斯的删除 -->
    <el-dialog
      v-model="Gassdialog.wsdelete"
      align-center
      :append-to-body="true"
      width="400"
      class="dialog_class bgcolor tianjia"
    >
      <template #header="{ titleId, titleClass }">
        <div class="my-header">
          <el-image :src="icon" fit="contain"></el-image>
          <h4 :id="titleId" :class="titleClass">删除框</h4>
        </div>
      </template>
      <h4 class="delecttitle">
        <!-- //{{ zqname }} -->
        是否确认删除 <span class="spanclad">{{zqname  }}</span>
      </h4>
      <div class="dialog-footer footer_div l_btn">
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button @click="Gassdialog.wsdelete = false">取消</el-button>
          </div>
        </div>
        <div class="footerbtn flex1">
          <div class="borderimg">
            <el-button
              @click="wsdeledata();
                Gassdialog.wsdelete = false;
              "
            >
              确定
            </el-button>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
  <selfdialogs ref="dialogtrue" :site="dsite"  @Dtext="Dtext" :ssite="ssite" :esite="esite"></selfdialogs>
  <!-- <filesload
      ref="filesload"
      :fileurls="fileurls"
      @fileLoadeState="fileLoadeState($event)"
    ></filesload> -->
</template>
<script setup>
import { computed, ref, onMounted, reactive, toRef } from "vue";
import { request, uploadFile } from "@/utils/request";
import icon from "@/assets/img/icon.png";
import icon1 from "@/assets/img/Group27.png";
import closeimg from "@/assets/img/colse.png";
import {
  ElMessage,
  ElButton,
  ElDialog,
  ElSelect,
  DROPDOWN_COLLECTION_INJECTION_KEY,
  ElConfigProvider
} from "element-plus";
import { message } from '@/utils/message';
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { Calendar, Search } from "@element-plus/icons-vue";
import Fengmen from "./Fengmen.vue";
import InfoBoundary from "./InfoBoundary.vue";
import { c } from "@kitware/vtk.js/macros2";
import { vtkmodel } from "@/control/vtkModel.js";;
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': '圆形',
//   'RECTANGLE': '矩形',
//   'SEMICIRCULAR': '半椭圆形',
//   'SEMIELLIPTICAL': '半圆形',
//   'EGG': '蛋形',
//   'GOTHIC': '哥特形',
//   'MODBASKETHANDLE': '更正蓝形',
//   'ARCH': '拱形',
//   'RECT_ROUND': '弧底矩形',
//   'BASKETHANDLE': '蓝形',
//   'HORSESHOE': '马蹄形',
//   'RECT_TRIANGULAR': '三角底矩形',
//   'VERT_ELLIPSE': '竖向椭圆',
//   'HORZI_ELLIPSE': '水平椭圆',
//   'CATENARY': '悬链式',
// };
let selectFlag = '';
const statusMap = {
  'halfarch_1': '1-1断面',
  'halfarch_2': '2-2断面',
  'halfarch_3': '3-3断面',
  'halfarch_4': '4-4断面',
  'halfarch_5': '5-5断面',
  'halfarch_6': '6-6断面',
  'halfarch_7': '7-7断面',
  'halfarch_8': '8-8断面',
  'section9': '9-9断面',
  'section10': '10-10断面',
  'halfarch_11': '11-11断面',
  'halfarch_12': '12-12断面',
  'halfarch_13': '13-13断面',
  'halfarch_14': '14-14断面',
  'halfarch_15': '15-15断面',
  'halfarch_16': '16-16断面',
  'halfarch_17': '17-17断面',
  'halfarch_18': '18-18断面',
  'halfarch_19': '19-19断面',
  'halfarch_20': '20-20断面',
};
let isActive=ref(0)
const  changeClass= (i)=>  {
 isActive.value = i;
}
let deltext=ref();
let valuesw=ref(false)
let dsite=ref();
let state=ref();
const changeModel= ()=>  {
  vtkmodel.clearJgAddMode();
  vtkmodel.renderWindow.render();
}
let yiweitable=ref();
let timing = ref(null);
let styX=ref({left: ""})
let vueupshow=ref(false);
const gfx=ref();
const inp=ref();
let tableDatpump=ref();
let Fengmenref=ref();
let gid=ref("");
let wsid=ref("");
let gfid=ref("");
let bfid=ref("");
let tableDataws=ref([]);
let currentrow = ref(false);
let currentrow1 = ref(false);
let currentrow2 = ref(false);
let tableline=ref();
let formLabelWidth2=ref(80);
let ssite=ref();
let esite=ref();
let wasi=ref({
  ssite:0.0,
  esite:0.0,
  gbid:Number,
  pid:Number,
  gdname:'',
  pid:Number,
  gid:Number,
  blastdata:{},
  gatherdata:{},
  options:[{ name:"空白区" ,value:'0'},{ name:"积聚区" ,value:'1'},{ name:"点火区" ,value:'2'}],
  type:'0',
  gasdensity:0,
  siteremark: '',
})
// 水泵参数
let  pumpobj=ref({
    pumpid:null,
    pumpname:'',
    openhig:'',
    closehig:'',
    onoff:'0',
    pumpcode:'',
    xzobj:{},
})
// 水泵性能 参数
let  pumpxc=ref({
  pumphfid:null,
    hight:null,
    flow:null,
    xnobj:{},
})
let tishi =ref("");
let gtableData=ref([]);
let gjtableData=ref([]);
const props = defineProps({
  classradio: {
    type: String,
  },
  // aid: {
  //   type: String,
  // },
});
let fileurls=ref([]);
let zaihai = ref({
  addEied: "",
});
let gfname=ref("");
let bfname=ref("");
let dialogtrue = ref();
let zhtext = ref("");
const Gassdialog=ref({
  wsaddflie:false,
  wsaddflie:false,
  wsaddarea:false,
  wsdelete:false,
  blast:false,
  gather:false,
  wsaddgather:false,
 
})
const sdialog = ref({
  adddialog: false,
  dialogsgdelect: false,
  dianadddialog: false,
  loadpump:false,
  addpump:false,
  dialogVisiblenode: false,
  isDisasterfire: false,
  isDisasterwter: false,
  adddwater: false,
  addline:false,
  linetable:false,
  deletedata:false,
  yiweidialog:false,
});
let selectstr = ref("");
const currentPage4 = ref(1);
const pageSize4 = ref(5);
const tableDatawat = ref([]);
const tableDatafir = ref([]);
const dialogVisible = ref(true);
const sour = ref({
  collfire: false,
  collwater: false,
  Gass:false,
  collGass1:false
});
// 一维参数 
let yiweiobj =ref({
  ssite:null,
  esite:null,
  gasdensity:null,
  gid:'',
  nreobj:{}
})
let jiancobj = ref({});
let firepid = ref("");
let svid = ref("");
let firesid = ref("");
let searchtaggd = ref("");
let total = ref(1);
let gdadd = ref("0");
let jcadd = ref();
let tableHeight = ref(200);
const multipleTableRef = ref();
const multipleSelection = ref([]);
const formLabelWidth5 = ref(77);
const formLabelWidth6 = ref(120);
let source = reactive({ pname: "", site: 0.1 ,siteremark:'',});
let Disastersource = ref({
  svid: 0,
  timeline:Number,
  val1:Number,
  val2: Number,
  val3:Number,
  val4:Number,
});
let tableobj = ref({});

const tableData2 = ref([]);
const tableData3 = ref([]);
let tabledata3ref  = ref();
let aid = ref();
let biaoid = ref();
let coolactiveName1 = ref(["1", "2"]);
let zqname = ref("");
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 != 0) {
    return "evenRow";
  }
  return "oddRow";
};
const tableData = ref([]);
const tableDatay = ref([]);
const tableData4 = ref([]);
const initisshow=()=>{
Gassdialog.value.wsaddflie=false;
Gassdialog.value.wsaddflie=false;
Gassdialog.value.wsaddarea=false;
Gassdialog.value.wsdelete=false;
Gassdialog.value.blast=false;
Gassdialog.value.gather=false;
Gassdialog.value.wsaddgather=false;
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;
sdialog.value.adddwater=  false;
sdialog.value.addline= false;
sdialog.value.linetable= false;
sdialog.value.deletedata= false;
sdialog.value.yiweidialog=false;
dialogtrue.value.dialoglog = false;
Gassdialog.value.wsaddshow=false;
Fengmenref.value.initisshow();
closeDialog();

}
// emitter.on('handleSelect',(data)=>{

//     initisshow();
// });

const accident3 = (key) => {
  console.log(key);
    //aid.value=id;
 // console.log('我是aid', id);
  if (key == "1"||key == "2"||key == "3"||key=='5') {
    console.log(props.classradio )
    if (props.classradio == "Fire") {
      sour.value.collfire = true;
      sour.value.collwater = false;
      sour.value.Gass = false;
      sour.value.collGass1=false
      Fengmenref.value.getquery(aid.value);
    } else if (props.classradio == "Water") {
     
      sour.value.collwater = true;
      sour.value.collfire = false;
      sour.value.Gass = false;
      sour.value.collGass1=false
    }else if(props.classradio == "Gass"){
      sour.value.collwater = false;
      sour.value.collfire = false;
      sour.value.Gass = true;
      sour.value.collGass1=false
    }else if(props.classradio == "Gass1"){
      sour.value.collwater = false;
      sour.value.collfire = false;
      sour.value.Gass = false;
      sour.value.collGass1=true;
      //yiweiget()
    }
  } else {
    sour.value.collwater = false;
    sour.value.collfire = false;
    sour.value.Gass = false;
    sour.value.collGass1=false;
  }
};
// 3D数据显示
const Dtext=(val)=>{
  console.log(val);
  selectstr.value=val.name;
  firepid.value=val.id;

  if(selectFlag === 'pump'){
    vtkmodel.addpipPump(firepid.value, source.site|| 0.0);
  }else if(selectFlag === 'watersoure' || selectFlag === 'firesoure'){
    vtkmodel.addpipsoure(firepid.value, source.site|| 0.0);
  }else {
    vtkmodel.addpipsite(firepid.value, source.site|| 0.0);
  }
  

}
// 3D弹屏
const Dclick = (val) => {
  let ws=val;
  console.log(ws);
  dialogtrue.value.dialoglog = true;
  vtkmodel.clearJgAddMode() ;
  vtkmodel.clearpipPump();
  vtkmodel.clearpipsoure();
  vtkmodel.selectNoting();

   vtkmodel.selectPipes();
   
   console.log(zhtext.value);
  //dialogtrue.value.jgSelect();
if(ws=='ws'){
  dialogtrue.value.jgSelect2();
}else{
  dialogtrue.value.jgSelect();
}
};
//灾情源查询列表
const handledisaster = (aidval) => {
  console.log(aidval+'可以打印吗');

    vtkmodel.delSoures();

  aid.value = aidval;
  const params = {
    transCode: "D00005",
    aid: aid.value,
  };
  request(params)
    .then((res) => {
      console.log('看看我打印没有')
      console.log(res);
      //vtkmodel.delSoures();
    
      if (props.classradio == "Fire") {
        tableDatay.value = res.rows;
      } else {
        tableDatawat.value = res.rows;
      }
      setTimeout(() => {
        
   
      res.rows.forEach((item,index)=>{
          vtkmodel.addSoures(item.pid,item.site)
      })
    }, 2000);
       tableobj.value={};
    })
    .catch((err) => {
      message.error(err.returnMsg);
      console.error(err);
    });
};

let isSubmitting = false;

// 灾情源添加
const fireadd = () => {
  if (isSubmitting) return;
  currentrow.value = false;
  tableobj.value={};
  if(firepid.value==null||firepid.value==""){
    message.error("巷道不能为空")
    //sdialog.value.dianadddialog = false;
  }else{
    isSubmitting = true; // 开始提交
    
  const params = {
    transCode: "D00004",
    pid: firepid.value,
    aid: aid.value,
    stype: props.classradio,
    site: source.site,
  };
  request(params)
    .then((res) => {
  
      message.success({
        message: "保存成功"
      });
      sdialog.value.dianadddialog = false;
      handledisaster(aid.value);
      fun3D();
    })
    .catch((err) => {
      message.error(err.returnMsg);
      console.error(err);
    })
    .finally(() => {
      isSubmitting = false; // 提交结束
    });
  }
};
//下拉跳转
const handleChangecollapse = (val) => {
  
  coolactiveName1.value=val;
  
}
// 加减input事件
const inputnuberChange = (number) => {
  dsite.value=number;
  dialogtrue.value.jgSelenum();
//   vtkmodel.addpipsite( wasi.value.pid, wasi.value.ssite);
//   vtkmodel.addpipsite2( wasi.value.pid, wasi.value.esite);

}

// 水泵的
const inputnuberChange1 = (number) => {
  dsite.value=number;
  dialogtrue.value.jgSelenum();

  vtkmodel.addpipPump(firepid.value,number)

}

// 灾原点的
const inputnuberChange2 = (number) => {
  dsite.value=number;
  dialogtrue.value.jgSelenum();

  vtkmodel.addpipsoure(firepid.value,number)

}



// 3D关闭弹窗
const fun3D = () => {
 state.value=sessionStorage.getItem("state");
  //console.log(state.value);
  if(state.value=='1'){
    vtkmodel.clearModeAddJg();
  }else{
    vtkmodel.selectNoting();
  }
  dialogtrue.value.timintclaer();
  vtkmodel.clearpipsite();//清除选择巷道的位置
}
const closeDialog=()=>{
  console.log(state.value);
state.value=sessionStorage.getItem("state");
  if(state.value=='1'){
    vtkmodel.clearModeAddJg();
  }else{
    vtkmodel.selectNoting();
  }//节点图形
  vtkmodel.clearpipsite();//清除选择巷道的位置
  vtkmodel.clearpipPump();
  vtkmodel.clearpipsoure();
  vtkmodel.selectNoting();
  dialogtrue.value.timintclaer();
}
//添加保存
const handleEditfire = () => {
  if (gdadd.value == "1") {
    fireadd();
  //  sdialog.value.dianadddialog = false;
  } else if (gdadd.value == "2") {
    if (props.classradio == "Fire") {
     // sdialog.value.dianadddialog = false;
    }
  } else if ((gdadd.value = "3")) {
    xiugaiapi();
    //   waaddshow.value=false;
  } else {
  }
};
//灾情源删除
const handleDelete = (val) => {
  zqname.value = val.pname;
 tableobj.value=val;
  currentrow.value=true;
  shanchu.value = val;
 sdialog.dialogsgdelect = true;
  firesid.value = val.sid;
  handledetection(val);
};
const handleDeletewotwr = (val) => {
  zqname.value = val.pname;
 tableobj.value=val;
  currentrow.value=true;
  shanchu.value = val;
 sdialog.dialogsgdelect = true;
  firesid.value = val.sid;
  handledetection2(val);
}
const shanchu = (val) => {

  biaoid.value = val;
  if(val=='1'){

  if (JSON.stringify(tableobj.value) == "{}") {
 message.error("你还没有选中删除的项目")
 } else {
    sdialog.value.dialogsgdelect = true;

    }
  }else {
    if (JSON.stringify(jiancobj.value) == "{}") {
      message.error("你还没有选中删除的项目")
 } else {
  sdialog.value.dialogsgdelect = true;
  //sdialog.value.dialogsgdelect = true;

    }
  //  sdialog.value.dialogsgdelect = true;
  }
};
const fundeledata = () => {
  if (biaoid.value == "1") {
    fundeledata2();
  } else{
    fundeledata3();
  }
};
// 
const fundeledata2 = () => {
  const params = {
    transCode: "D000011",
    sid: firesid.value,
  };
  console.log(params);
  request(params)
    .then((res) => {
      message.success({
        message: "删除成功"
      });
      if(props.classradio == "Fire"){
        sdialog.value.isDisasterfire=false;
      }else{
        sdialog.value.disDisasterwter=false;
      }
      handledisaster(aid.value);
    })
    .catch((err) => {
      message.error(err.returnMsg);
      console.error(err);
    });
};
// 巷道搜索
function searchgd() {
  pipelinedata(searchtaggd.value);
}
// 分页查询
function handleSizeChange(val) {}
const handleCurrentChange = (val) => {
  pipelinedata(searchtaggd.value);
};
//新建fire
const newtable = (e,val) => {
  if(val) {
    selectFlag = val
  }

  var e = e || window.Event;
  styX.value.left = e.clientX + "px";
  console.log(styX.value.left);
  currentrow.value=false;
  tableobj.value={};
  selectstr.value = "";
  firepid.value = "";
  source.site = 0;
  newtable.value = "1";
  gdadd.value = "1";

  zhtext.value = "添加";
  vtkmodel.clearJgAddMode();
  vtkmodel.renderWindow.render();
  // vtkmodel.selectPipes();
  // dialogtrue.value.jgSelect();
 // dialogtrue.value.initmsg();


};
//  修改
const xiugaitable = (val) => {
  if(val){
    selectFlag = val;
  }
  console.log("修改",tableobj.value);
  gdadd.value = "3";
  zhtext.value = "修改";
  if (JSON.stringify(tableobj.value) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {

    sdialog.value.dianadddialog = true;
    aid.value = tableobj.value.aid;
    firepid.value = tableobj.value.pid;

    source.site = tableobj.value.site;
    selectstr.value = tableobj.value.pname;
    source.siteremark = tableobj.value.siteremark;

    vtkmodel.clearJgAddMode() ;
    //选中指定管道
    vtkmodel.selectByPipeId(tableobj.value.pid);
    
    vtkmodel.addpipsoure( firepid.value,source.site || 0.0)
  }
};
// 修改接口
const xiugaiapi = () => {
  if(isSubmitting) return
  else{
    isSubmitting = true;
    const params = {
    transCode: "D000010",
    pid: firepid.value,
    site: source.site,
    sid: tableobj.value.sid,
    siteremark: source.siteremark,
  };
  request(params)
    .then((res) => {
      handledisaster(aid.value);
      message.success({
        message: "修改成功"
      });
      
      sdialog.value.dianadddialog = false;
      fun3D();
     
    })
    .catch((err) => {})
    .finally(() => {
      isSubmitting = false; // 提交结束
    });
  }
  
};

// 水泵加载
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) => {
      message.error(err.returnMsg);
      console.error(err);
    });
};

// 选择
const fireclick = () => { 
  searchtaggd.value='';
  pipelinedata("");
};
const queding = () => {
  selectfun();
};
const selectfun = () => {
  selectstr.value = "";
  currentPage4.value = 1;
  console.log("选择巷道数据",multipleSelection.value);
  if (multipleSelection.value.length != 0) {
    firepid.value = multipleSelection.value[0].id;
    selectstr.value = multipleSelection.value[0].name;
    
    vtkmodel.selectByPipeId( firepid.value);
    // console.log("selectFlag",selectFlag)
    if(selectFlag === 'pump'){
      vtkmodel.addpipPump(firepid.value,source.site || 0.0);
    }else if(selectFlag === 'watersoure' || selectFlag === 'firesoure'){
      vtkmodel.addpipsoure(firepid.value,source.site || 0.0);
    }else {
      vtkmodel.addpipsite(firepid.value,source.site || 0.0);
    }
    
  } else {
    // selectstr.value='';
  }
};
const projectsSelectionSelect = (selection, row) => {
  if (selection.length > 1) {
    multipleTableRef.value.clearSelection();
    multipleTableRef.value.toggleRowSelection(row, true);
    let arrp=[];
        arrp.push(selection[1])
        multipleSelection.value = arrp;
    return;
  }
  if (selection.length == 1) {
    multipleSelection.value = selection;
  } else if (selection.length == 0) {
  }

  // console.log(row)
};
//巷道数据查询
const pipelinedata = (searchtag) => {
  const params = {
    transCode: "D00001",
    count: pageSize4.value,
    page: currentPage4.value,
    searchtag: searchtag,
  };
  request(params)
    .then((res) => {
      tableData2.value = res.rows.map(item => {
                    return {
                        ...item,
                        sectionType: statusMap[item.sectionType] || '未知' // 如果状态不存在，默认设置为'未知'
                    };
                    });
         
      total.value = res.total;
    })
    .catch((err) => {});
};
//   灾源检测
const handledetection = ( row) => {
  sdialog.value.isDisasterfire = true;
  firesid.value = row.sid;
  getinquire();
};
//突水灾源检测
const handledetection2 = (row) => {
  sdialog.value.disDisasterwter = true;
  firesid.value = row.sid;
  getinquire();
};
//   灾源检测查询
const getinquire = () => {
  const params = {
    transCode: "D00007",
    sid: firesid.value,
  };
  request(params)
    .then((res) => {
      console.log(res.rows);
      if (props.classradio == "Fire") {
        tableDatafir.value = res.rows;
      } else {
        tableData4.value = res.rows;
      }
      jiancobj.value={};
    })
    .catch((err) => {});
};

// const Disasterclick=(index,row)=>{
//     addjiancf();

//   }
// 灾源火灾检测添加
const addjiancf = () => {
  if(isSubmitting) return
  if (zaihai.value.addEied == "a") {
    isSubmitting = true;
    const params = {
      transCode: "D00006",
      sid: firesid.value,
      timeline: Disastersource.value.timeline,
      val1: Disastersource.value.val1,
      val2: Disastersource.value.val2,
      val3: Disastersource.value.val3,
      val4: Disastersource.value.val4,
    };
    request(params)
      .then((res) => {
        message.success({
          message: '添加成功'
        });
        getinquire();
      })
      .catch((err) => {
        message.error(err.returnMsg);
        console.error(err);
      })
      .finally(() => {
      isSubmitting = false; // 提交结束
      });
  } else {
    zaiyuxiugaiapi();
  }
};
//灾情源添加清空
const firinit = () => {
  zaihai.value.addEied = "a";
  Disastersource.value.timeline = "";
  Disastersource.value.val1 = "";
  Disastersource.value.val2 = "";
  Disastersource.value.val3 = "";
  Disastersource.value.val4 = "";
  zhtext.value = "添加";
  currentrow1.value=false;
  jiancobj.value={};

};
//瓦斯爆炸查询
const Gassgetdata=(aidval)=>{
  aid.value=aidval;
  const params = {
    transCode: "D10020",
    aid:aid.value
  };

  request(params)
    .then((res) => {
  
      tableDataws.value=res.rows;
      tableobj.value={};

      emitter.emit("pipeName",res.rows[0]?.pname);
    })
    .catch((err) => {
      message.error(err.returnMsg);
      console.error(err);
    });
}
// 瓦斯爆炸的添加
const wanewadd=()=>{
  Gassdialog.value.wsaddshow= true;
  selectstr.value = "";
  firepid.value = "";
  zhtext.value = "添加";
 currentrow.value=false;
 tableobj.value={};
//  dialogtrue.value.jgSelect();
 vtkmodel.clearJgAddMode() ;
//  vtkmodel.selectPipes();



}
const Gassadd=()=>{
  console.log(firepid.value);
  if(firepid.value==null||firepid.value==''||firepid.value==undefined){
    message.error('巷道名称不能为空');
  }else{
  const params = {
    transCode: "D10021",
    gid:gid.value,
    pid:firepid.value,
    aid:aid.value
  };
console.log(params);
  request(params)
    .then((res) => {
      message.success({
        message:"瓦斯添加成功"
      });
      Gassdialog.value.wsaddflie= false;
      Gassdialog.value.wsaddshow=false
      Gassgetdata(aid.value);
      fun3D();
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
  }
}
// 瓦斯选中一行
const handlews=(row)=>{
  console.log(row);
  currentrow.value=true;
  tableobj.value=row;
  handlook(row);
}
// 瓦斯的修改
const wsxiugai= ()=>{
  if (JSON.stringify(tableobj.value) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
  zhtext.value = "修改";
  Gassdialog.value.wsaddshow= true;
  // selectstr.value = "";
  // firepid.value = "";
  }
}
// 瓦斯删除
const wsdelete=()=>{
  wsid.value='0'
  if (JSON.stringify(tableobj.value) == "{}") {
 message.error("你还没有选中删除的项目")
 } else {
      //zqname.value= tableobj.value.bfname+"-"+ tableobj.value.gfname;
      zqname.value= tableobj.value.pname;
      Gassdialog.value.wsdelete=true;
 }
}
const wsdeledata=()=>{
  console.log(wsid.value)
  console.log(1111)
  if(wsid.value=='0'){
     wsdelete2();


  }if(wsid.value=='1'){
    wsblastdelete1();
  }

}
// 瓦斯删除
const wsdelete2=()=>{
  const params = {
    transCode: "D10022",
    gid:tableobj.value.gid
  };

  request(params)
    .then((res) => {
      message.success({
        message: "瓦斯删除成功"
      });
      Gassdialog.value.wsdelete=false;
      Gassdialog.value.blast=false;
      Gassdialog.value.gather=false;
      Gassgetdata(aid.value);
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
}
//瓦斯的查看
const handlook=(data)=>{
  console.log(data);
  Gassdialog.value.blast =true;
  Gassdialog.value.gather =true;
  wasi.value.gid=data.gid;
  wsblastget();
  gatherget();

}
// // 瓦斯爆炸区域查询
const wsblastget=()=>{
  vtkmodel.delSoures();
  const params = {
    transCode: "D10023",
    gid: wasi.value.gid,

  };
  request(params)
    .then((res) => {
      gtableData.value=res.rows;
      wasi.value.blastdata={};
      if(res.rows!=[]){
       // vtkmodel.delSoures();
       console.log(res.rows);
      res.rows.forEach((item,index)=>{
        vtkmodel.addSoures(item.pid,item.ssite)
        vtkmodel.addSoures(item.pid,item.esite)
      })
    }
 
    
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
}
// 瓦斯爆炸区域的添加
const wsaddblast=()=>{
  zhtext.value='添加';
  wasi.value.ssite=0.0;
  wasi.value.esite=0.0;
  wasi.value.gbid=0;
  wasi.value.pid='';
  selectstr.value = "";
  firepid.value = "";
  Gassdialog.value.wsaddarea= true;
  currentrow1.value=false;
  wasi.value.blastdata={};
  vtkmodel.clearJgAddMode() ;
  // vtkmodel.selectPipes();
  // dialogtrue.value.jgSelect();
}
const wsbalastadd=()=>{
  wasi.value.pid=firepid.value;
  if( wasi.value.ssite<wasi.value.esite){
  const params = {
    transCode: "D10024",
    gid: wasi.value.gid,
    pid: wasi.value.pid,
    ssite:wasi.value.ssite,
    esite: wasi.value.esite,
    gbid:wasi.value.gbid,
    siteremark: wasi.value.siteremark || ""
  };
  request(params)
    .then((res) => {
      message.success({
        message: zhtext.value+"瓦斯爆炸区域"
      });
      Gassdialog.value.wsaddarea= false;
      wsblastget();
      fun3D();

    
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
       
  }else{
    message.error("结束位置大于开始位置");
  }
}
// 爆炸区域的修改

const wsxiugai2=()=>{
  if (JSON.stringify(wasi.value.blastdata) == "{}") {
    message.error("你还没有选中修改的项目");

}else{
  zhtext.value='修改';
  wasi.value.ssite=wasi.value.blastdata.ssite;
  wasi.value.esite=wasi.value.blastdata.esite;
  wasi.value.gbid=wasi.value.blastdata.gbid;
  wasi.value.pid=wasi.value.blastdata.pid;
  wasi.value.siteremark=wasi.value.blastdata.siteremark;
  selectstr.value =wasi.value.blastdata.pname;
  firepid.value =wasi.value.blastdata.pid;
  Gassdialog.value.wsaddarea= true;
  ssite.value= wasi.value.ssite;
  esite.value=wasi.value.esite;

  vtkmodel.clearJgAddMode() ;
  // vtkmodel.selectPipes();
  vtkmodel.selectByPipeId( wasi.value.pid);
  vtkmodel.addpipsite(wasi.value.pid, wasi.value.ssite);
  vtkmodel.addpipsite2(wasi.value.pid, wasi.value.esite);
  // dialogtrue.value.jgSelect();
}
}
const handleblastxg=(data)=>{
  wasi.value.blastdata=data;
  currentrow1.value=true;

}
// 爆炸区域删除
const wsblastdelete=()=>{
  if (JSON.stringify(wasi.value.blastdata) == "{}") {
    message.error("你还没有选中修改的项目");

}else{
  wsid.value='1';
  zqname.value= wasi.value.blastdata.pname;
 Gassdialog.value.wsdelete=true;
}
}
const wsblastdelete1=()=>{

  const params = {
    transCode: "D10025",
    gbid:wasi.value.blastdata.gbid,
  };
  request(params)
    .then((res) => {
      message.success({
        message:"删除瓦斯爆炸区域成功"
      });
      Gassdialog.value.wsaddarea= false;
      wsblastget();
    
    })
    .catch((err) => {
      message.error(err.returnMsg);
    })   
  }
  // 积聚
  const  gatherget = () => {
    const params = {
    transCode: "D10026",
    gid:wasi.value.gid,
  };
  request(params)
    .then((res) => {
      gjtableData.value=res.rows;
      wasi.value.gatherdata={};
    })
    .catch((err) => {
      message.error(err.returnMsg);
    })  
  }
  // 积聚的选中
  
  const  handlegather = (data) => {
    console.log(data);
    currentrow2.value=true;
   wasi.value.gatherdata=data;
  }
// 积聚的修改
const  gatheruxiugai = () => {
  zhtext.value = "修改";

  if (JSON.stringify(wasi.value.gatherdata) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
    Gassdialog.value.wsaddgather=true;
    wasi.value.gasdensity=wasi.value.gatherdata.gasdensity;
    wasi.value.type=wasi.value.gatherdata.type;
  }
}
// 
const wsgatheradd=()=>{
  const params = {
    transCode: "D10027",
    type:wasi.value.type,
    gasdensity:wasi.value.gasdensity,
    ggid:wasi.value.gatherdata.ggid,
  };
  request(params)
    .then((res) => {
      message.success({
        message:  zhtext.value+"积聚区成功",
      });
      Gassdialog.value.wsaddgather=false;
      gatherget()
    })
    .catch((err) => {
      message.error(err.returnMsg);
    })  
}
// 灾害源检测的修改
const zaiyuxiugai = () => {
  zaihai.value.addEied = "x";
  zhtext.value='修改';
  console.log( zhtext.value);
  if (JSON.stringify(jiancobj.value) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
    if (props.classradio == "Fire") {
      sdialog.value.adddialog = true;
    } else {
      sdialog.value.adddwater = true;
    }

    Disastersource.value.timeline = jiancobj.value.timeline;
    Disastersource.value.val1 = jiancobj.value.val1;
    Disastersource.value.val2 = jiancobj.value.val2;
    Disastersource.value.val3 = jiancobj.value.val3;
    Disastersource.value.val4 = jiancobj.value.val4;
  }
};
// 灾害源的检测表修改接口
const zaiyuxiugaiapi = () => {
  if (isSubmitting) return;
  isSubmitting = true;
  const params = {
    transCode: "D000012",
    svid: jiancobj.value.svid,
    timeline: Disastersource.value.timeline,
    val1: Disastersource.value.val1,
    val2: Disastersource.value.val2,
    val3: Disastersource.value.val3,
    val4: Disastersource.value.val4,
  };
  request(params)
    .then((res) => {
      message.success({
        message:"修改成功"
      });
      getinquire();
    })
    .catch((err) => {
      message.error(err.returnMsg);
    })
    .finally(() => {
      isSubmitting = false; // 提交结束
    });
};
// 灾源突水检测添加
//灾情检测删除
const handleDelete2 = (val) => {
  currentrow1.value=true;
  console.log(val);
  jiancobj.value = val;
  firesid.value = val.sid;
  zqname.value = "灾害源表的一条信息";
  svid.value = val.svid;
};
const handleDelete3 = (val) => {
  currentrow1.value=true;
  jiancobj.value = val;
  firesid.value = val.sid;
  zqname.value = "灾害表的一条信息";
  svid.value = val.svid;
};
const fundeledata3 = () => {
  const params = {
    transCode: "D000013",
    svid: svid.value,
  };
  request(params)
    .then((res) => {
      //console.log(res);
      message.success({
        message: "删除成功"
      });
      getinquire();
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
};
    const runstatezt=(res)=>{
      //  this.disabledok=res;
    }

     //load状态回调
     const fileLoadeState=(files)=> {
      console.log(files);
      files.forEach((file) => {
        this.loadObjs.forEach((obj) => {
          if (obj.type == 2) {
            if (obj.filename === file.name) {
              obj.percentage = file.percentage;
            }
          }
          if (obj.type == 1) {
            //  obj.message=file.message;
          }
        });
      });
    }
    const handleSwitchChange=(value)=> {
      pumpobj.value.onoff=value;
    }
// 水泵
const addpumdfun=(e,val)=>{
  if(val){
    selectFlag = val
  }

  var e = e || window.Event;
  styX.value.left = e.clientX + "px";
  currentrow.value=false;
  zhtext.value = "添加";
  tishi.value =zhtext.value;
  pumpobj.value.xzobj={};
  pumpobj.value.pumpid=null;
  pumpobj.value.pumpname='';
  pumpobj.value.pumpcode='';
  pumpobj.value.openhig=null;
  pumpobj.value.closehig=null;
  pumpobj.value.onoff=0;
  firepid.value=null;
  source.site=null;
  selectstr.value=null;
  vtkmodel.clearJgAddMode() ;
  // vtkmodel.selectPipes();
  // dialogtrue.value.jgSelect();
  vtkmodel.removepump();
}
//修改

const pumpxiugai=(val)=>{
  if(val){
    selectFlag = val
  }
  zhtext.value = "修改";
  tishi.value =zhtext.value;
  console.log("修改",pumpobj.value.xzobj);
  if (JSON.stringify( pumpobj.value.xzobj) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
     sdialog.value.addpump = true;

    pumpobj.value.pumpid=pumpobj.value.xzobj.pumpid;
    pumpobj.value.pumpname=pumpobj.value.xzobj.pumpname;
    pumpobj.value.openhig=pumpobj.value.xzobj.openhig;
    pumpobj.value.closehig=pumpobj.value.xzobj.closehig;
    pumpobj.value.pumpcode=pumpobj.value.xzobj.pumpcode;
    pumpobj.value.siteremark=pumpobj.value.xzobj.siteremark || "";
    firepid.value=pumpobj.value.xzobj.pid;
    aid.value=pumpobj.value.xzobj.aid;
    source.site=pumpobj.value.xzobj.site;
    source.siteremark = pumpobj.value.xzobj.siteremark || "";

    vtkmodel.clearJgAddMode() ;
    vtkmodel.delAll();
    vtkmodel.selectByPipeId(firepid.value);
    vtkmodel.addpipPump(firepid.value, source.site|| 0.0);
  }
}

// 水泵加载保存
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) => {
      message.success({
        message: "加载成功"
      });
      getrequest(aid.value);
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
}


//水泵的添加接口
const addrequest=()=>{
  if (isSubmitting) return;
  if(firepid.value==null||firepid.value==""){
    message.error("巷道不能为空")
  }else{
    isSubmitting = true;
  const params = {
    transCode: "D20002",
    pumpid:pumpobj.value.pumpid,
    pumpcode:pumpobj.value.pumpcode,
    pumpname:pumpobj.value.pumpname,
    openhig:parseFloat(pumpobj.value.openhig),
    closehig:parseFloat(pumpobj.value.closehig),
    pid: firepid.value,
    aid: aid.value,
    site: source.site,
   onoff:pumpobj.value.onoff,
   siteremark: pumpobj.value.siteremark || ""
  };
  request(params)
    .then((res) => {
      message.success({
        message: zhtext.value+"水泵成功"
      });
      sdialog.value.addpump = false;
      getrequest( aid.value);
      fun3D();
    })
    .catch((err) => {
      const regex = /字段\d*/g;
        let Msg=err.returnMsg.replace(regex, '');
         message.error(Msg)
    })
    .finally(() => {
      isSubmitting = false; // 提交结束
    });
  }
}
//水泵查询
const getrequest=(id)=>{
  aid.value=id;
  const params = {
    transCode: "D20001",
    aid: aid.value,
  };
  request(params)
    .then((res) => {
        vtkmodel.removepump();
        tableDatpump.value=res.rows;
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
  }
  // 列表选中
 
const  pumpxz=(val)=>{
  vtkmodel.delpump();
  currentrow.value=true;
  pumpobj.value.xzobj=val;
  firepid.value=val.pid;
  aid.value=val.aid;
  source.site=val.site;
  selectstr.value=val.pname;
  pumpobj.value.onoff=val.onoff;
  vtkmodel.addpump(val.pid,source.site);
  //vtkmodel.showpump();
  lookpump(val)
}
//查看
const lookpump=(row)=>{
  sdialog.value.linetable=true;
  pumpobj.value.pumpid=row.pumpid;
  xngetdata();
}
// 性能表格
const clineadd=()=>{
  currentrow1.value=false;
  zhtext.value = "添加";
  tishi.value =zhtext.value;
  pumpxc.value.hight=null;
  pumpxc.value.flow=null;
  pumpxc.value.pumphfid=null;


}
//性能表添加接口
const xnadd=()=>{
  if (isSubmitting) return;
  if(pumpxc.value.hight==''||pumpxc.value.hight==null){
    message.error("水位高度不能空")
  }else if(pumpxc.value.flow==''||pumpxc.value.flow==null){
    message.error("流量不能为空")
  }else{
    isSubmitting = true; 
  const params = {
    transCode: "D20005",
    pumphfid:pumpxc.value.pumphfid,
    pumpid:pumpobj.value.xzobj.pumpid,
    hight:parseFloat(pumpxc.value.hight),
    flow:parseFloat(pumpxc.value.flow)
  };
  request(params)
    .then((res) => {
      message.success({
        message:  tishi.value+"性能曲线"
      });
      xngetdata();
      sdialog.value.addline=false;
    })
    .catch((err) => {
      message.error(err.returnMsg);
    })
    .finally(() => {
      isSubmitting = false; // 提交结束
    });
  }
}
//性能表查询接口
const xngetdata=()=>{
  const params = {
    transCode: "D20004",
    pumpid:pumpobj.value.pumpid,
 
  };
  request(params)
    .then((res) => {
tableline.value=res.rows;
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
}
// 性能选中

const xnlinehande=(val)=>{
  console.log(val);
  pumpxc.value.xnobj=val;
  currentrow1.value=true;
  pumpxc.value.pumphfid=val.pumphfid;
  pumpobj.value.xzobj.pumpid=val.pumpid;
}
// 性能修改
const xiugailine=()=>{
  zhtext.value = "修改";
  tishi.value =zhtext.value;
  if (JSON.stringify( pumpxc.value.xnobj) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
     sdialog.value.addline= true;
     pumpxc.value.hight=pumpxc.value.xnobj.hight;
     pumpxc.value.flow=pumpxc.value.xnobj.flow;

  }
}
 //水泵删除

 const  getshuidel=()=>{
 const params = {
    transCode: "D20003",
    pumpid:pumpobj.value.xzobj.pumpid,
  };
  request(params)
    .then((res) => {
      message.success({
        message: "水泵删除成功",
      });
      sdialog.value.linetable=false;
      vtkmodel.delpump();
      getrequest( aid.value);
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
 }
 const pumpdel=()=>{
    if (JSON.stringify( pumpobj.value.xzobj) == "{}") {
    message.error("你还没有选中删除的项目");
  } else {
    sdialog.value.deletedata = true;
    deltext.value='水泵';
      zqname.value=pumpobj.value.xzobj.pumpname;

   
  }
  }

//性能删除
const deletedata=()=>{
if(deltext.value=='性能'){
  const params = {
    transCode: "D20006",
    pumphfid:pumpxc.value.pumphfid,
  };
  request(params)
    .then((res) => {
      message.success({
        message: "删除成功",
      });
      xngetdata();
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
}else if(deltext.value=='水泵'){
  getshuidel()
} else if(deltext.value=='一维瓦斯'){
  delyiwei();
}
else{

}

}
const delline=()=>{
 
  if (JSON.stringify(pumpxc.value.xnobj) == "{}") {
    message.error("你还没有选中删除的项目");
  } else {
    deltext.value='性能';
    zqname.value= '性能曲线信息';
    sdialog.value.deletedata = true;
  
  }
}
//一维查询

const yiweiget=(aidval)=>{
  aid.value=aidval;
  vtkmodel.delSoures();
  const params = {
    transCode:"D30001",
    aid: aid.value,
 
  };
  request(params)
    .then((res) => {
      console.log( res.row)

      if(res.row!=[]){
       // vtkmodel.delSoures();
       console.log( '一维瓦斯灾源查询：',res.row)
        res.row.forEach((item,index)=>{
        vtkmodel.addSoures(item.pid,item.ssite)
        vtkmodel.addSoures(item.pid,item.esite)
    
     
      })
      }
    
      yiweitable.value=res.row;
      emitter.emit("pipeName",res.row[0]?.pname);
    })
    .catch((err) => {
      message.error(err.returnMsg);
      console.error(err);
    });
}
// 添加清空

const yiweiadd=()=>{
  var e = e || window.Event;
  styX.value.left = e.clientX + "px";
  currentrow.value=false;
  zhtext.value = "添加";
  tishi.value =zhtext.value;
  yiweiobj.value.ssite=null;
  yiweiobj.value.esite=null;
  yiweiobj.value.gasdensity=null;
  firepid.value=null;
  selectstr.value=null;
  yiweiobj.value.nreobj={};
  yiweiobj.value.gid='';
  vtkmodel.clearJgAddMode() ;
  // vtkmodel.selectPipes();
  // dialogtrue.value.jgSelect();
}
// 修改
const yiweixiugai=()=>{
  zhtext.value = "修改";
  tishi.value =zhtext.value;
  if (JSON.stringify(yiweiobj.value.nreobj) == "{}") {
    message.error("你还没有选中修改的项目");
  } else {
    sdialog.value.yiweidialog=true;
    currentrow.value=true;
    yiweiobj.value.ssite=yiweiobj.value.nreobj.ssite;
  yiweiobj.value.esite=yiweiobj.value.nreobj.esite;
  yiweiobj.value.gasdensity=yiweiobj.value.nreobj.gasdensity;
  yiweiobj.value.siteremark=yiweiobj.value.nreobj.siteremark;
  selectstr.value=yiweiobj.value.nreobj.pname;
  firepid.value=yiweiobj.value.nreobj.pid;
  yiweiobj.value.gid=yiweiobj.value.nreobj.pid;
  vtkmodel.clearJgAddMode() ;
  vtkmodel.selectByPipeId(yiweiobj.value.nreobj.pid);
  ssite.value= yiweiobj.value.ssite;
  esite.value= yiweiobj.value.esite;

  vtkmodel.addpipsite( yiweiobj.value.nreobj.pid, yiweiobj.value.ssite);
  vtkmodel.addpipsite2(yiweiobj.value.nreobj.pid, yiweiobj.value.esite);
  // vtkmodel.selectPipes();
  // dialogtrue.value.jgSelect();

  }
}
const yiweihandle = (val) => {
  yiweiobj.value.nreobj=val;
  currentrow.value=true;
    // }
};
// 一维灾情源添加
const yehandleEdit=()=>{
  const params = {
    transCode:"D30002",
    pid: firepid.value,
    aid: aid.value,
    ssite:yiweiobj.value.ssite,
    esite:yiweiobj.value.esite,
    gasdensity:parseFloat(yiweiobj.value.gasdensity),
    siteremark: yiweiobj.value.siteremark || "",
  };
  request(params)
    .then((res) => {
      console.log(res);
      message.success(tishi.value+"一维灾情源成功");
      yiweiget(aid.value);
      sdialog.value.yiweidialog=false;
      dialogtrue.value.timintclaer();
    })
    .catch((err) => {
      console.error("错误：",err)
      message.error(err.returnMsg);
    });
}
// 删除
const yiweidelete=()=>{
deltext.value='一维瓦斯';
if (JSON.stringify(yiweiobj.value.nreobj) == "{}") {
    message.error("你还没有选中删除的项目");
  } else {
sdialog.value.deletedata = true;
zqname.value=yiweiobj.value.nreobj.pname;
  }
}
const  delyiwei=()=>{
console.log(yiweiobj.value.nreobj);
  if (JSON.stringify(yiweiobj.value.nreobj) == "{}") {
    message.error("你还没有选中删除的项目");
  } else {
  const params = {
    transCode: "D30003",
    gid:yiweiobj.value.nreobj.gid
  };
  request(params)
    .then((res) => {
      message.success({
        message: "删除成功"
      });
      yiweiget(aid.value)
    })
    .catch((err) => {
      message.error(err.returnMsg);
    });
  }
}
//瓦斯爆炸的
const gessanum1=(val)=>{
  wasi.value.ssite=val;
  ssite.value= wasi.value.ssite;
  esite.value=wasi.value.esite;
  console.log(vtkmodel.selectObj);
  vtkmodel.addpipsite(vtkmodel.selectObj.id, wasi.value.ssite);
  vtkmodel.addpipsite2(vtkmodel.selectObj.id, wasi.value.esite);


}
const gessanum2=(val)=>{
  wasi.value.esite=val;
  ssite.value= wasi.value.ssite;
  esite.value=wasi.value.esite;
  vtkmodel.addpipsite(vtkmodel.selectObj.id, wasi.value.ssite);
 vtkmodel.addpipsite2(vtkmodel.selectObj.id, wasi.value.esite);

}
// 一维瓦斯的位置变化
const ywgess=(val)=>{
  yiweiobj.value.ssite=val;
  ssite.value= yiweiobj.value.ssite;
  esite.value= yiweiobj.value.esite;
  vtkmodel.addpipsite(vtkmodel.selectObj.id, yiweiobj.value.ssite);
 vtkmodel.addpipsite2(vtkmodel.selectObj.id, yiweiobj.value.esite);


}
const ywgess2=(val)=>{
  yiweiobj.value.esite=val;
  ssite.value= yiweiobj.value.ssite;
  esite.value= yiweiobj.value.esite;
  vtkmodel.addpipsite(vtkmodel.selectObj.id, yiweiobj.value.ssite);
 vtkmodel.addpipsite2(vtkmodel.selectObj.id, yiweiobj.value.esite);

}
onMounted(() => {
  
});
defineExpose({ sour, accident3, handledisaster,changeModel,Gassgetdata,getrequest,yiweiget,initisshow});
</script>


