InfoBoundary.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <!-- 边界条件-->
  3. <div class="l_Dialog bou tablebk">
  4. <!--火灾左侧栏-->
  5. <div class="common-layout" style="margin: 0">
  6. <el-aside
  7. width="2.125rem"
  8. class="L_aside L_aside1 asideg asidegbg leftbgimg1"
  9. v-show="boun.collfire"
  10. >
  11. <div class="demo-collapse">
  12. <el-collapse v-model="coolactiveName1" accordion>
  13. <!-- <el-collapse-item name="1"> -->
  14. <!-- <template #title>
  15. <el-icon class="iconimg Frame2" fit="contain"></el-icon>
  16. 火灾<el-icon class="header-icon"> </el-icon>
  17. </template> -->
  18. <el-collapse-item name="1" class="imgneon">
  19. <template #title>
  20. <el-icon class="iconimg Frame3" fit="contain"></el-icon>
  21. 边界设置<el-icon class="header-icon"> </el-icon>
  22. </template>
  23. <div class="asides_content">
  24. <div class="jc_content tablecolor">
  25. <div class="jc_padding font12">
  26. <div class="xian btncolor tablefocus bmar">
  27. <el-table
  28. :data="ftableData"
  29. style="width: 100%"
  30. :max-height="tableHeight"
  31. :highlight-current-row="currentrow"
  32. :row-class-name="tableRowClassName"
  33. @row-click="handleDelete($event)"
  34. :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
  35. >
  36. <template v-slot:empty>
  37. <p>暂无数据</p>
  38. </template>
  39. <el-table-column prop="nname" label="节点选择" />
  40. <!-- <el-table-column prop="type" label="边界类型" /> -->
  41. <el-table-column
  42. label="边界类型"
  43. prop="type"
  44. align="center"
  45. >
  46. <template #default="scope">
  47. {{
  48. scope.row.type == "massflow"
  49. ? "流量边界"
  50. : scope.row.type == "Pressure"
  51. ? "压力边界"
  52. : "压力边界"
  53. }}
  54. </template>
  55. </el-table-column>
  56. <!-- <el-table-column width="50">
  57. // <template #default="scope">{{scope.row.type == massflow ? '流量边界' : scope.row.type == Pressure?'压力边界' }} </template>
  58. // </el-table-column> -->
  59. <!-- <el-table-column prop="flow" label="流量(m³/s)" /> -->
  60. <el-table-column prop="flow" label="流量">
  61. <!-- <template #default="{ row }">
  62. {{ row.flow }} <br> (m³/s)
  63. </template> -->
  64. <template v-slot:header>
  65. <div >
  66. <span >流量</span><br>
  67. <span >(m³/s)</span>
  68. </div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="pressure" label="压强" >
  72. <template v-slot:header >
  73. <div >
  74. <span>压强</span><br>
  75. <span >(pa)</span>
  76. </div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column prop="temperature" label="温度">
  80. <template v-slot:header>
  81. <span >温度</span><br>
  82. <span >(℃)</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="polcon1" label="二氧化碳">
  86. <template v-slot:header>
  87. <span >二氧化碳</span><br>
  88. <span >(%)</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="polcon2" label="二氧化硫">
  92. <template v-slot:header>
  93. <span >二氧化硫</span><br>
  94. <span >(ppm)</span>
  95. </template>
  96. </el-table-column>
  97. <!-- <el-table-column prop="pressure" label="压强(pa)" />
  98. <el-table-column prop="temperature" label="温度(℃)" />
  99. <el-table-column prop="polcon1" label="二氧化碳(%)" />
  100. <el-table-column prop="polcon2" label="二氧化硫(ppm)" /> -->
  101. </el-table>
  102. <div class="asdis_btn">
  103. <div class="flex_a" @click="bounadd();
  104. dialog.dialogVisible = true;
  105. ">
  106. <div
  107. class="btns"
  108. :class="{tabactive: isActive === 1}" @click="changeClass(1)"
  109. >
  110. <span class="spantext">添加</span>
  111. </div>
  112. </div>
  113. <div class="flex_a" @click="xiugai()">
  114. <div class="btns" :class="{tabactive: isActive === 2}" @click="changeClass(2)">
  115. <span class="spantext">修改</span>
  116. </div>
  117. </div>
  118. <div class="flex_a" @click="xiudelete();">
  119. <div class="btns" :class="{tabactive: isActive === 3}" @click="changeClass(3)">
  120. <span class="spantext">删除</span>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </el-collapse-item>
  129. </el-collapse>
  130. </div>
  131. </el-aside>
  132. </div>
  133. <!-- 突水 -->
  134. <div class="common-layout" style="margin: 0" >
  135. <el-aside
  136. width="1.6667rem"
  137. class="L_aside L_aside1 asideg asidegbg leftbgimg1"
  138. v-show="boun.collwater"
  139. >
  140. <div class="demo-collapse">
  141. <el-collapse v-model="coolactiveName1" accordion>
  142. <el-collapse-item name="2" class="imgneon">
  143. <template #title>
  144. <el-icon class="iconimg Frame3" fit="contain"></el-icon>
  145. 边界设置<el-icon class="header-icon"> </el-icon>
  146. </template>
  147. <div class="asides_content">
  148. <div class="jc_content tablecolor">
  149. <div class="jc_padding font12">
  150. <div class="xian btncolor tablefocus bmar">
  151. <el-table
  152. :data="ftableData"
  153. style="width: 100%"
  154. :max-height="tableHeight"
  155. :highlight-current-row="currentrow"
  156. :row-class-name="tableRowClassName"
  157. @row-click="handleDelete($event)"
  158. :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
  159. >
  160. <template v-slot:empty>
  161. <p>暂无数据</p>
  162. </template>
  163. <el-table-column prop="nname" label="节点选择" />
  164. <el-table-column prop="type" label="边界类型" />
  165. </el-table>
  166. </div>
  167. </div>
  168. <div class="asdis_btn padingcla">
  169. <div class="flex_a" @click="
  170. bounadd();
  171. dialog.dialogVisible = true;
  172. ">
  173. <div
  174. class="btns"
  175. :class="{tabactive: isActive === 1}" @click="changeClass(1)"
  176. >
  177. <span class="spantext">添加</span>
  178. </div>
  179. </div>
  180. <div class="flex_a" @click="xiugai()">
  181. <div class="btns" :class="{tabactive: isActive === 2}" @click="changeClass(2)">
  182. <span class="spantext">修改</span>
  183. </div>
  184. </div>
  185. <div class="flex_a" @click="xiudelete();">
  186. <div class="btns" :class="{tabactive: isActive === 3}" @click="changeClass(3)">
  187. <span class="spantext">删除</span>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </el-collapse-item>
  194. </el-collapse>
  195. </div>
  196. </el-aside>
  197. </div>
  198. <!-- 添加 -->
  199. <el-dialog
  200. v-model="dialog.dialogVisible"
  201. width="482"
  202. :modal="false"
  203. :close-on-click-modal="false"
  204. :append-to-body="true"
  205. draggable
  206. :fullscreen="false"
  207. :modal-append-to-body="false"
  208. modal-class="summary-dlg"
  209. class="dialog_class bgcolor foter_l"
  210. >
  211. <template #header="{ titleId, titleClass }">
  212. <div class="my-header">
  213. <el-image :src="icon" fit="contain"></el-image>
  214. <h4 :id="titleId" :class="titleClass">{{ buntext }}</h4>
  215. </div>
  216. </template>
  217. <div class="addye">
  218. <div class="fireclass" v-if="props.classradio == 'Fire' ||props.classradio == 'Gass'||props.classradio == 'Gass1'">
  219. <el-form class="demo-form-inline" :inline="true" :model="bformInline">
  220. <div class="l_padding input" style="padding: 20px 20px 20px 24px">
  221. <div class="demo-input-suffix firsttitle magintop">
  222. <el-form-item label="节点名称" :label-width="formLabelWidth6">
  223. <el-input
  224. v-model="bformInline.nname"
  225. class="w-50 m-2"
  226. placeholder="节点选择"
  227. disabled
  228. />
  229. </el-form-item>
  230. <div class="btn2">
  231. <el-button
  232. type="primary"
  233. @click="
  234. fireclick();
  235. sdialog.dialogVisiblenode = true;
  236. "
  237. >选择节点</el-button
  238. >
  239. </div>
  240. <div class="btn2" style="padding-left: 10px">
  241. <el-button type="primary" @click="Dclick()">3D节点选择</el-button>
  242. </div>
  243. </div>
  244. <el-form-item label="边界类型" :label-width="formLabelWidth6">
  245. <el-select v-model="bformInline.type" placeholder="请选择" >
  246. <el-option
  247. v-for="item in bformInline.options"
  248. :key="item.id"
  249. :label="item.label"
  250. :value="item.value"
  251. ></el-option>
  252. </el-select>
  253. </el-form-item>
  254. <el-form-item label="流量(m³/s)" :label-width="formLabelWidth6" v-if="bformInline.type=='massflow'">
  255. <el-input
  256. v-model="bformInline.flow"
  257. class="w-50 m-2"
  258. placeholder="请输入"
  259. oninput ="value=value.replace(/[^0-9.]/g,'')"
  260. />
  261. </el-form-item>
  262. <el-form-item label="压强(pa)" :label-width="formLabelWidth6" v-if="bformInline.type=='Pressure'">
  263. <el-input
  264. v-model="bformInline.pressure"
  265. class="w-50 m-2"
  266. placeholder="请输入"
  267. oninput ="value=value.replace(/[^0-9.]/g,'')"
  268. />
  269. </el-form-item>
  270. <el-form-item label="温度(℃)" :label-width="formLabelWidth6">
  271. <el-input
  272. v-model="bformInline.temperature"
  273. class="w-50 m-2"
  274. placeholder="请输入"
  275. oninput ="value=value.replace(/[^0-9.]/g,'')"
  276. />
  277. </el-form-item>
  278. <el-form-item label="二氧化碳(%)" :label-width="formLabelWidth6">
  279. <el-input
  280. v-model="bformInline.polcon1"
  281. class="w-50 m-2"
  282. placeholder="请输入"
  283. oninput ="value=value.replace(/[^0-9.]/g,'')"
  284. />
  285. </el-form-item>
  286. <el-form-item label="二氧化硫(ppm)" :label-width="formLabelWidth6">
  287. <el-input
  288. v-model="bformInline.polcon2"
  289. class="w-50 m-2"
  290. placeholder="请输入"
  291. oninput ="value=value.replace(/[^0-9.]/g,'')"
  292. />
  293. </el-form-item>
  294. </div>
  295. </el-form>
  296. </div>
  297. <div class="Waterclass" v-else>
  298. <el-form class="demo-form-inline" :inline="true" :model="bformInline">
  299. <div class="l_padding input" style="padding: 20px 20px 20px 24px">
  300. <div class="demo-input-suffix firsttitle magintop">
  301. <el-form-item label="节点名称" :label-width="formLabelWidth6">
  302. <el-input
  303. v-model="bformInline.nname"
  304. class="w-50 m-2"
  305. placeholder="节点名称"
  306. />
  307. </el-form-item>
  308. <div class="btn2">
  309. <el-button
  310. type="primary"
  311. @click="
  312. fireclick();
  313. sdialog.dialogVisiblenode = true;
  314. "
  315. >选择节点</el-button
  316. >
  317. </div>
  318. <div class="btn2" style="padding-left: 10px">
  319. <el-button type="primary" @click="Dclick()">3D节点选择</el-button>
  320. </div>
  321. </div>
  322. <el-form-item label="边界类型" :label-width="formLabelWidth6">
  323. <el-select v-model="bformInline.type" placeholder="请选择">
  324. <el-option
  325. v-for="item in bformInline.options2"
  326. :key="item.id"
  327. :label="item.label"
  328. :value="item.value"
  329. ></el-option>
  330. </el-select>
  331. </el-form-item>
  332. </div>
  333. </el-form>
  334. </div>
  335. <div class="dialog-footer footer_div l_btn">
  336. <div class="footerbtn flex1">
  337. <div class="borderimg">
  338. <el-button @click="dialog.dialogVisible = false">取消</el-button>
  339. </div>
  340. </div>
  341. <div class="footerbtn flex1">
  342. <div class="borderimg">
  343. <el-button
  344. @click="
  345. accidentboun();
  346. "
  347. >
  348. 确定
  349. </el-button>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. </el-dialog>
  355. <!-- 节点选择 -->
  356. <el-dialog
  357. v-model="sdialog.dialogVisiblenode"
  358. width="700"
  359. :z-index='3000'
  360. align-center
  361. :append-to-body="true"
  362. class="dialog_class bgcolor tianjia asideg asidegbg leftbgimg"
  363. >
  364. <template #header="{ titleId, titleClass }">
  365. <div class="my-header">
  366. <el-image :src="icon" fit="contain"></el-image>
  367. <h4 :id="titleId" :class="titleClass">选择节点</h4>
  368. </div>
  369. </template>
  370. <div class="demo-input-suffix firsttitle leftbgimg2">
  371. <div class="guand_1">
  372. <el-form-item label="节点选择" :label-width="formLabelWidth5">
  373. <el-input v-model="searchtaggd" class="w-50 m-2" placeholder="节点名称" />
  374. </el-form-item>
  375. <div class="asdis_btn">
  376. <div class="flex_a">
  377. <div class="btns" @click="searchgd"><span class="spantext">搜索</span></div>
  378. </div>
  379. </div>
  380. </div>
  381. <el-table
  382. :row-class-name="tableRowClassName"
  383. :max-height="tableHeight"
  384. ref="multipleTableRef"
  385. :data="tableData2"
  386. style="width: 100%"
  387. @select="projectsSelectionSelect"
  388. :header-cell-style="{ background: 'rgba(13, 22, 57, 0) ' }"
  389. >
  390. <template v-slot:empty>
  391. <p>暂无数据</p>
  392. </template>
  393. <el-table-column type="selection" width="55" />
  394. <el-table-column property="id" label="节点编号" />
  395. <el-table-column property="name" label="名称" />
  396. <!-- <el-table-column property="ntype" label="类型" /> -->
  397. <el-table-column property="x" label="x" />
  398. <el-table-column property="y" label="y" />
  399. <el-table-column property="z" label="z" />
  400. </el-table>
  401. <div class="demo-pagination-block" style="margin-top: 20px">
  402. <el-config-provider :locale="zhCn">
  403. <el-pagination
  404. v-model:current-page="currentPage4"
  405. v-model:page-size="pageSize4"
  406. small
  407. background
  408. layout="prev, total,pager, next, jumpe,"
  409. :total="parseInt(total)"
  410. class="mt-4"
  411. @current-change="handleCurrentChange"
  412. />
  413. </el-config-provider>
  414. </div>
  415. <div class="dialog-footer footer_div l_btn">
  416. <div class="footerbtn flex1">
  417. <div class="borderimg">
  418. <el-button @click="sdialog.dialogVisiblenode = false;searchtaggd=''">取消</el-button>
  419. </div>
  420. </div>
  421. <div class="footerbtn flex1">
  422. <div class="borderimg">
  423. <el-button @click="selectfun()"> 确定 </el-button>
  424. </div>
  425. </div>
  426. </div>
  427. </div>
  428. </el-dialog>
  429. <!-- 删除 -->
  430. <el-dialog
  431. v-model="sdialog.dialogsgdelect"
  432. width="400"
  433. class="dialog_class bgcolor tianjia"
  434. >
  435. <template #header="{ titleId, titleClass }">
  436. <div class="my-header">
  437. <el-image :src="icon" fit="contain"></el-image>
  438. <h4 :id="titleId" :class="titleClass">删除框</h4>
  439. </div>
  440. </template>
  441. <h4 class="delecttitle">
  442. 是否确认删除 <span class="spanclad">{{ zqname }}</span>
  443. </h4>
  444. <div class="dialog-footer footer_div l_btn">
  445. <div class="footerbtn flex1">
  446. <div class="borderimg">
  447. <el-button @click="sdialog.dialogsgdelect = false;">取消</el-button>
  448. </div>
  449. </div>
  450. <div class="footerbtn flex1">
  451. <div class="borderimg">
  452. <el-button
  453. @click="
  454. fundeledata();
  455. sdialog.dialogsgdelect = false;
  456. "
  457. >
  458. 确定
  459. </el-button>
  460. </div>
  461. </div>
  462. </div>
  463. </el-dialog>
  464. </div>
  465. <selfdialogs ref="dialogtrue" @Dtext="Dtext"></selfdialogs>
  466. </template>
  467. <script setup>
  468. import { computed, ref, onMounted, reactive } from "vue";
  469. import { request, uploadFile } from "@/utils/request";
  470. import icon from "@/assets/img/icon.png";
  471. import closeimg from "@/assets/img/colse.png";
  472. import { ElMessage, ElButton, ElDialog,ElConfigProvider } from "element-plus";
  473. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  474. import { Calendar, Search } from "@element-plus/icons-vue";
  475. import selfdialogs from "./SetNode.vue";
  476. import { vtkmodel } from "@/control/vtkModel.js";
  477. import emitter from "@/utils/emitter";
  478. let isActive=ref(0)
  479. const changeClass= (i)=> {
  480. console.log(i);
  481. isActive.value = i;
  482. }
  483. // let showmassflow=ref(false);
  484. // let showpressure=ref(true);
  485. let tishi=ref('');
  486. let currentrow=ref();
  487. const changeModel = () => {
  488. vtkmodel.clearJgAddMode();
  489. vtkmodel.renderWindow.render();
  490. };
  491. let dialogtrue = ref();
  492. // 3D弹屏
  493. const Dclick = () => {
  494. dialogtrue.value.dialoglog = true;
  495. vtkmodel.clearJgAddMode() ;
  496. vtkmodel.selectNodes();
  497. dialogtrue.value.jgSelect();
  498. console.log(dialogtrue.value.dialoglog);
  499. };
  500. // 3D数据显示
  501. const Dtext=(val)=>{
  502. console.log(val);
  503. nid.value = val.id;
  504. bformInline.value.nname = val.name;
  505. }
  506. const props = defineProps({
  507. classradio: String,
  508. });
  509. let sdialog = ref({
  510. dialogVisiblenode: false,
  511. dialogsgdelect: false,
  512. });
  513. let buntext = ref("");
  514. const strResultFormatlist = reactive(
  515. { id: 0, name: "灾情演化", value: ".vtk" },
  516. { id: 1, name: "演化过程", value: ".mesh" }
  517. );
  518. let xiugaiobj = ref({});
  519. let zqname = ref("");
  520. let tableHeight = ref(400);
  521. const multipleTableRef = ref();
  522. const multipleSelection = ref([]);
  523. const formLabelWidth5 = ref(77);
  524. const formLabelWidth6 = ref(120);
  525. let tableData2 = ref([]);
  526. let searchtaggd = ref("");
  527. let total = ref(1);
  528. const currentPage4 = ref(1);
  529. const pageSize4 = ref(5);
  530. let nid = ref();
  531. let bid = ref();
  532. let aid = ref();
  533. let bformInline = ref({
  534. nname: "",
  535. type: "Pressure",
  536. flow: "",
  537. pressure: "",
  538. temperature: "",
  539. polcon1: "",
  540. polcon2: "",
  541. user: "11",
  542. nodesel: "1",
  543. nodesselect: [
  544. {
  545. value: "1",
  546. label: "1",
  547. },
  548. {
  549. value: "2",
  550. label: "2",
  551. },
  552. ],
  553. region: "massflow",
  554. options: [
  555. {
  556. value: "massflow",
  557. label: "流量边界",
  558. },
  559. {
  560. value: "Pressure",
  561. label: " 压力边界",
  562. },
  563. ],
  564. region: "边界出口",
  565. options2: [
  566. {
  567. value: "边界出口",
  568. },
  569. ],
  570. });
  571. let coolactiveName1 = ref(["1", "2"]);
  572. const ftableData = ref([]);
  573. const value = ref("");
  574. const dialog = ref({
  575. dialogVisible: false,
  576. });
  577. const boun = ref({
  578. collfire: false,
  579. collwater: false,
  580. collGass:false,
  581. });
  582. const initisshow=()=>{
  583. dialogtrue.value.dialoglog=false;
  584. sdialog.value.dialogVisiblenode=false;
  585. sdialog.value.dialogsgdelect=false;
  586. boun.value.collfire=false;
  587. boun.value.collwater=false;
  588. boun.value.collGass=false;
  589. dialog.value.dialogVisible =false;
  590. }
  591. // emitter.on('handleSelect',(data)=>{
  592. // initisshow();
  593. // });
  594. // onUnmounted(() =>{
  595. // emitter.off('handleSelect')
  596. // })
  597. // 节点选择
  598. const fireclick = () => {
  599. pipelinedata("");
  600. };
  601. // 节点搜索
  602. function searchgd() {
  603. pipelinedata(searchtaggd.value);
  604. }
  605. // 节点分页查询
  606. const handleCurrentChange = (val) => {
  607. pipelinedata(searchtaggd.value);
  608. };
  609. //节点数据查询
  610. const pipelinedata = (searchtag) => {
  611. const params = {
  612. transCode: "D00000",
  613. count: pageSize4.value,
  614. page: currentPage4.value,
  615. searchtag: searchtag,
  616. };
  617. request(params)
  618. .then((res) => {
  619. tableData2.value = res.rows;
  620. total.value = res.total;
  621. })
  622. .catch((err) => {
  623. ElMessage.error(err.returnMsg);
  624. });
  625. };
  626. const selectfun = () => {
  627. sdialog.value.dialogVisiblenode = false;
  628. bformInline.value.nname = "";
  629. searchtaggd.value='';
  630. currentPage4.value = 1;
  631. console.log();
  632. if (multipleSelection.value.length != 0) {
  633. nid.value = multipleSelection.value[0].id;
  634. bformInline.value.nname = multipleSelection.value[0].name;
  635. } else {
  636. bformInline.value.nname = "";
  637. }
  638. };
  639. const projectsSelectionSelect = (selection, row) => {
  640. if (selection.length > 1) {
  641. multipleTableRef.value.clearSelection();
  642. multipleTableRef.value.toggleRowSelection(row, true);
  643. let arrp=[];
  644. arrp.push(selection[1])
  645. multipleSelection.value = arrp;
  646. return;
  647. }
  648. if (selection.length == 1) {
  649. multipleSelection.value = selection;
  650. } else if (selection.length == 0) {
  651. }
  652. // console.log(row)
  653. };
  654. //边界添加前清空
  655. const bounadd = () => {
  656. currentrow.value=false;
  657. bid.value = "";
  658. bformInline.value.nname = "";
  659. (bformInline.value.type = "Pressure"), (bformInline.value.flow = "0");
  660. bformInline.value.pressure = "100000";
  661. bformInline.value.temperature = "25";
  662. bformInline.value.polcon1 = "0";
  663. bformInline.value.polcon2 = "0";
  664. buntext.value = "添加";
  665. tishi.value= buntext.value;
  666. xiugaiobj.value={};
  667. if (props.classradio == "Fire" ||props.classradio == "Gass") {
  668. bformInline.value.type = "Pressure";
  669. } else if (props.classradio == "Water") {
  670. bformInline.value.type = "边界出口";
  671. } else {
  672. }
  673. };
  674. const xiudelete = () => {
  675. if (JSON.stringify(xiugaiobj.value) == "{}") {
  676. ElMessage.error("你还没有选中删除的项目");
  677. } else {
  678. sdialog.value.dialogsgdelect = true
  679. }
  680. }
  681. //修改
  682. const xiugai = () => {
  683. buntext.value = "修改";
  684. tishi.value= buntext.value;
  685. if (JSON.stringify(xiugaiobj.value) == "{}") {
  686. ElMessage.error("你还没有选中修改的项目");
  687. } else {
  688. if (props.classradio == "Fire") {
  689. bformInline.value.type = "Pressure";
  690. } else if (props.classradio == "Water") {
  691. bformInline.value.type = "边界出口";
  692. } else {
  693. }
  694. console.log(xiugaiobj.value);
  695. bid.value = xiugaiobj.value.bid;
  696. nid.value = xiugaiobj.value.nid;
  697. aid.value = xiugaiobj.value.aid;
  698. dialog.value.dialogVisible = true;
  699. bformInline.value.nname = xiugaiobj.value.nname;
  700. bformInline.value.type = xiugaiobj.value.type;
  701. bformInline.value.flow = xiugaiobj.value.flow;
  702. bformInline.value.pressure = xiugaiobj.value.pressure;
  703. bformInline.value.temperature = xiugaiobj.value.temperature;
  704. bformInline.value.polcon1 = xiugaiobj.value.polcon1;
  705. bformInline.value.polcon2 = xiugaiobj.value.polcon2;
  706. }
  707. };
  708. //边界的添加
  709. const accidentboun = () => {
  710. const params = {
  711. transCode: "D10008",
  712. bid: bid.value,
  713. nid: nid.value,
  714. nname: bformInline.value.nname,
  715. type: bformInline.value.type,
  716. aid: aid.value,
  717. flow: bformInline.value.flow,
  718. pressure: bformInline.value.pressure,
  719. temperature: bformInline.value.temperature,
  720. polcon1: bformInline.value.polcon1,
  721. polcon2: bformInline.value.polcon2,
  722. };
  723. request(params)
  724. .then((res) => {
  725. ElMessage({
  726. message: tishi.value+"边界设置成功",
  727. type: "success",
  728. });
  729. dialog.value.dialogVisible=false;
  730. addboundary(aid.value);
  731. })
  732. .catch((err) => {
  733. const regex = /字段\d*/g;
  734. let Msg=err.returnMsg.replace(regex, '');
  735. ElMessage.error(Msg)
  736. });
  737. };
  738. // 边界数据的查询
  739. const addboundary = (valaid) => {
  740. aid.value = valaid;
  741. const params = {
  742. transCode: "D10007",
  743. aid: aid.value,
  744. };
  745. request(params)
  746. .then((res) => {
  747. ftableData.value = res.rows;
  748. xiugaiobj.value={};
  749. })
  750. .catch((err) => {
  751. ElMessage.error(err.returnMsg);
  752. });
  753. };
  754. const handleDelete = (val) => {
  755. console.log(val);
  756. currentrow.value=true;
  757. xiugaiobj.value = val;
  758. bid.value = val.bid;
  759. zqname.value = val.nname;
  760. };
  761. const fundeledata = () => {
  762. const params = {
  763. transCode: "D10009",
  764. bid: bid.value,
  765. };
  766. console.log(params);
  767. request(params)
  768. .then((res) => {
  769. ElMessage({
  770. message: "边界删除成功",
  771. type: "success",
  772. });
  773. addboundary(aid.value);
  774. })
  775. .catch((err) => {
  776. ElMessage.error(err.returnMsg);
  777. });
  778. };
  779. // 表格变色
  780. const tableRowClassName = ({ row, rowIndex }) => {
  781. if (rowIndex % 2 != 0) {
  782. return "evenRow";
  783. }
  784. return "oddRow";
  785. };
  786. // 弹出框
  787. const accident4 = (key) => {
  788. if (key == "1"||key == "2"||key == "3"||key == "5") {
  789. console.log(key);
  790. if (props.classradio == "Fire"||props.classradio =='Gass'||props.classradio =='Gass1') {
  791. boun.value.collfire = true;
  792. boun.value.collwater = false;
  793. boun.value.collGass = false;
  794. } else if (props.classradio == "Water") {
  795. boun.value.collwater = true;
  796. boun.value.collfire = false;
  797. boun.value.collGass = false;
  798. } else if(props.classradio =='Gass'){
  799. // boun.value.collwater = false;
  800. // boun.value.collfire = true;
  801. // boun.value.collGass = false;
  802. }else{
  803. }
  804. } else {
  805. boun.value.collfire = false;
  806. boun.value.collwater = false;
  807. boun.value.collGass = false;
  808. }
  809. };
  810. onMounted(() => {});
  811. defineExpose({ boun, accident4, addboundary, changeModel,initisshow });
  812. </script>