MenuCheck.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <div class="l_Dialog">
  3. <el-dialog v-model="sendialogVisible" width="470" align-center :modal="false" :close-on-click-modal="false"
  4. modal-class="summary-dlg" draggable class="dialog_class bgcolor zhucentent chuanjianc">
  5. <template #header="{ titleId, titleClass }">
  6. <div class="my-header xinxi_header">
  7. <el-image :src="icon" fit="contain"></el-image>
  8. <h4 :id="titleId" :class="titleClass">监测点信息</h4>
  9. </div>
  10. </template>
  11. <div class="classtab">
  12. <div class="asides_content">
  13. <div class="jc_content tablecolor jc_content">
  14. <div class="font12 my_content1">
  15. <div class="btncolor tablefocus bmar">
  16. <el-table :data="tableData" style="width:480px" :max-height="tableHeight"
  17. :highlight-current-row="currentrow" :row-class-name="tableRowClassName"
  18. @row-click="handleDelete($event)"
  19. :header-cell-style="{ 'background': 'rgba(13, 22, 57, 0.9) ' }">
  20. <el-table-column type="index" label="编号" />
  21. <el-table-column prop="chname" label="所在巷道" />
  22. <el-table-column prop="pname" label="所在巷道" />
  23. <el-table-column prop="site" label="位置" />
  24. </el-table>
  25. </div>
  26. </div>
  27. <div class="dialog-footer footer_div l_btn">
  28. <div class="footerbtn flex1">
  29. <div class="borderimg"><el-button @click="addsg();sdialog.dianadddialog=true">添加</el-button></div>
  30. </div>
  31. <div class="footerbtn flex1">
  32. <div class="borderimg"><el-button @click="shanchu()">
  33. 删除
  34. </el-button></div>
  35. </div>
  36. <div class="footerbtn flex1">
  37. <div class="borderimg"><el-button @click="amend()">
  38. 修改
  39. </el-button></div>
  40. </div>
  41. <div class="footerbtn flex1">
  42. <div class="borderimg"><el-button @click="sendialogVisible = false;currentrow=false">
  43. 确定
  44. </el-button></div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </el-dialog>
  51. <!-- 删除 -->
  52. <el-dialog v-model="dialogsgdelect" width="400" class="dialog_class bgcolor tianjia">
  53. <template #header="{ titleId, titleClass }">
  54. <div class="my-header ">
  55. <el-image :src="icon" fit="contain"></el-image>
  56. <h4 :id="titleId" :class="titleClass">删除框</h4>
  57. </div>
  58. </template>
  59. <h4 class="delecttitle"> 是否确认删除 <span class="spanclad">编号{{ zqname }}</span></h4>
  60. <div class="dialog-footer footer_div l_btn">
  61. <div class="footerbtn flex1">
  62. <div class="borderimg"><el-button @click="dialogsgdelect = false">取消</el-button></div>
  63. </div>
  64. <div class="footerbtn flex1">
  65. <div class="borderimg"><el-button @click="fundeledata(); dialogsgdelect = false">
  66. 确定
  67. </el-button></div>
  68. </div>
  69. </div>
  70. </el-dialog>
  71. <!-- 添加 -->
  72. <el-dialog v-model="sdialog.dianadddialog" width="500px" class="dialog_class bgcolor tianjia">
  73. <template #header="{titleId, titleClass }">
  74. <div class="my-header ">
  75. <el-image :src="icon" fit="contain" ></el-image>
  76. <h4 :id="titleId" :class="titleClass">{{add}}</h4>
  77. </div>
  78. </template>
  79. <el-form-item label="监测点名称:" :label-width="formLabelWidth5">
  80. <el-input v-model="source.chname"
  81. class="w-50 m-2"
  82. placeholder="请输入" />
  83. </el-form-item>
  84. <div class="demo-input-suffix firsttitle magintop guand_1">
  85. <el-form-item label="巷道名称" :label-width="formLabelWidth5">
  86. <el-input v-model="source.selectstr"
  87. class="w-50 m-2"
  88. placeholder="巷道名称" />
  89. </el-form-item>
  90. <div class="btn2">
  91. <el-button type="primary" @click="fireclick();sdialog.dialogVisiblenode=true">选择巷道</el-button></div>
  92. </div>
  93. <div class="input">
  94. <el-form-item label="位置" :label-width="formLabelWidth5">
  95. <el-input-number v-model="source.site" :min="0" :max="1"
  96. :precision="2" :step="0.1"
  97. controls-position="right"
  98. class="w-50 m-2"
  99. placeholder="位置"
  100. />
  101. </el-form-item>
  102. </div>
  103. <div class="dialog-footer footer_div l_btn">
  104. <div class="footerbtn flex1"><div class="borderimg"><el-button @click="sdialog.dianadddialog=false">取消</el-button></div></div>
  105. <div class="footerbtn flex1"><div class="borderimg"><el-button @click="addEditaip(); sdialog.dianadddialog=false">
  106. 确定
  107. </el-button></div></div>
  108. </div>
  109. </el-dialog>
  110. <!-- 选择管道 -->
  111. <el-dialog
  112. v-model="sdialog.dialogVisiblenode"
  113. width="600"
  114. class="dialog_class bgcolor tianjia asideg asidegbg leftbgimg"
  115. >
  116. <template #header="{titleId, titleClass }">
  117. <div class="my-header ">
  118. <el-image :src="icon" fit="contain" ></el-image>
  119. <h4 :id="titleId" :class="titleClass"> 选择巷道</h4>
  120. </div>
  121. </template>
  122. <div class="demo-input-suffix firsttitle leftbgimg2 my_content1">
  123. <div class="guand_1">
  124. <el-form-item label="节点选择" :label-width="formLabelWidth5">
  125. <el-input v-model="searchtaggd"
  126. class="w-50 m-2"
  127. placeholder="巷道"
  128. />
  129. </el-form-item>
  130. <div class="asdis_btn">
  131. <div class="flex_a"><div class="btns" @click="searchgd"><span class="spantext">搜索</span></div></div>
  132. </div>
  133. </div>
  134. <el-table
  135. :row-class-name="tableRowClassName"
  136. :max-height="tableHeight"
  137. ref="multipleTableRef"
  138. :data="tableData2"
  139. style="width: 100%"
  140. @select="projectsSelectionSelect"
  141. :header-cell-style="{'background':'rgba(13, 22, 57, 0.96) '}"
  142. >
  143. <el-table-column type="selection" width="55" />
  144. <el-table-column property="snId" label="开始节点"/>
  145. <el-table-column property="enId" label="结束节点"/>
  146. <el-table-column property="id" label="编号" width="70"/>
  147. <el-table-column property="name" label="名称" width="70"/>
  148. <el-table-column property="sectionType" label="截面类型" width="120"/>
  149. <el-table-column property="roughCoe" label="粗糙系数"/>
  150. <el-table-column property="sectionPara1" label="截面参数1" width="90"/>
  151. <el-table-column property="sectionPara2" label="截面参数2" width="90" />
  152. <el-table-column property="sectionPara3" label="截面参数3" width="90"/>
  153. <el-table-column property="sectionPara4" label="截面参数4" width="90"/>
  154. <el-table-column property="sectionPara5" label="截面参数5" width="90"/>
  155. </el-table>
  156. <div class="demo-pagination-block" style="margin-top: 20px;">
  157. <el-pagination
  158. v-model:current-page="currentPage4"
  159. v-model:page-size="pageSize4"
  160. small
  161. background
  162. layout="prev, total,pager, next, jumpe,"
  163. :total="parseInt(total)"
  164. class="mt-4"
  165. @current-change="handleCurrentChange"
  166. />
  167. </div>
  168. <div class="dialog-footer footer_div l_btn">
  169. <div class="footerbtn flex1"><div class="borderimg"><el-button @click="sdialog.dialogVisiblenode = false">取消</el-button></div></div>
  170. <div class="footerbtn flex1"><div class="borderimg"><el-button @click="queding();sdialog.dialogVisiblenode = false">
  171. 确定
  172. </el-button></div></div>
  173. </div>
  174. </div>
  175. </el-dialog>
  176. </div>
  177. </template>
  178. <script setup>
  179. import { computed, ref, onMounted, reactive, toRef } from "vue";
  180. import { request, uploadFile } from "@/utils/request";
  181. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  182. import icon from "@/assets/img/icon.png";
  183. import { timestampToTime } from '@/js/lindex.js'
  184. let sendialogVisible = ref(false);
  185. let currentrow=ref(true);
  186. let addVisible = ref(false);
  187. let dialogsgdelect = ref(false)
  188. let classradio1 = ref('Fire');
  189. const formLabelWidth6 = ref(100);
  190. const formLabelWidth5=ref(90);
  191. const multipleTableRef = ref()
  192. const multipleSelection = ref([])
  193. let add = ref("");
  194. let tableData2=ref([]);
  195. let sdialog=ref({
  196. dianadddialog:false,
  197. dialogVisiblenode:false,
  198. })
  199. let total = ref(1);
  200. let searchtaggd = ref("");
  201. const currentPage4 = ref(1);
  202. const pageSize4 = ref(5)
  203. let cid=ref("");
  204. let source=ref({
  205. selectstr:'',
  206. site:'',
  207. chname:''
  208. })
  209. let firepid=ref("")
  210. const resultactiveName = ref("first");
  211. let tableHeight = ref(570);
  212. let tableData = ref([]);
  213. let tableobj = ref({});
  214. let zqname = ref();
  215. let senobj = ref({
  216. pid: 0,
  217. seid: 0,
  218. site: 0,
  219. type: "温度传感器"
  220. })
  221. const tableRowClassName = ({ row, rowIndex }) => {
  222. if (rowIndex % 2 != 0) {
  223. return 'evenRow';
  224. }
  225. return 'oddRow';
  226. }
  227. // 选中一行
  228. const handleDelete = (val) => {
  229. currentrow.value=true;
  230. tableobj.value = val;
  231. cid.value=val.cid
  232. console.log( tableobj.value );
  233. }
  234. // 删除
  235. const shanchu = () => {
  236. if (JSON.stringify(tableobj.value) == '{}') {
  237. ElMessage.error("你还没有选中修改的项目")
  238. } else {
  239. zqname.value = tableobj.value.pname;
  240. dialogsgdelect.value = true;
  241. }
  242. }
  243. const fundeledata=()=>{
  244. const params = {
  245. transCode: 'D10006',
  246. cid: cid.value
  247. }
  248. request(params)
  249. .then((res) => {
  250. getsensor();
  251. })
  252. .catch((err) => {
  253. ElMessage.error(err.returnMsg)
  254. })
  255. }
  256. onMounted(() => {
  257. getsensor();
  258. });
  259. // 查询
  260. const getsensor = () => {
  261. const params = {
  262. transCode: 'D10004',
  263. }
  264. request(params)
  265. .then((res) => {
  266. tableData.value = res.rows;
  267. })
  268. .catch((err) => {
  269. ElMessage.error(err.returnMsg)
  270. })
  271. }
  272. //添加
  273. const addsg = () => {
  274. add.value = "添加";
  275. addVisible.value = true;
  276. currentrow.value=false;
  277. source.value.selectstr='';
  278. source.value.site='';
  279. firepid.value='';
  280. cid.value='';
  281. tableobj.value=[];
  282. }
  283. // 添加修改的接口
  284. const addEditaip=()=>{
  285. const params = {
  286. transCode: 'D10005',
  287. cid:cid.value,
  288. pid:firepid.value,
  289. site:source.value.site,
  290. chname:source.value.chname
  291. }
  292. request(params)
  293. .then((res) => {
  294. tableData.value = res.rows;
  295. getsensor();
  296. })
  297. .catch((err) => {
  298. ElMessage.error(err.returnMsg)
  299. })
  300. }
  301. //修改
  302. const amend = () => {
  303. add.value = "修改";
  304. if (JSON.stringify(tableobj.value) == '{}') {
  305. ElMessage.error("你还没有选中修改的项目")
  306. } else {
  307. sdialog.value.dianadddialog= true;
  308. cid.value = tableobj.value.cid;
  309. source.value.chname = tableobj.value.chname;
  310. source.value.site = tableobj.value.site;
  311. source.value.selectstr=tableobj.value.pname;
  312. firepid.value=tableobj.value.pid;
  313. }
  314. }
  315. // 选择巷道
  316. const fireclick = () => {
  317. pipelinedata('');
  318. }
  319. // 节点搜索
  320. function searchgd() {
  321. pipelinedata(searchtaggd.value);
  322. }
  323. // 节点分页查询
  324. const handleCurrentChange = (val) => {
  325. pipelinedata(searchtaggd.value)
  326. }
  327. //节点数据查询
  328. const pipelinedata = (searchtag) => {
  329. const params = {
  330. transCode: 'D00001',
  331. count: pageSize4.value,
  332. page: currentPage4.value,
  333. searchtag: searchtag,
  334. }
  335. request(params)
  336. .then((res) => {
  337. tableData2.value = res.rows;
  338. total.value = res.total;
  339. })
  340. .catch((err) => {
  341. ElMessage.error(err.returnMsg)
  342. })
  343. }
  344. //选中项
  345. const projectsSelectionSelect=(selection, row)=>{
  346. if(selection.length>1){
  347. multipleTableRef.value.clearSelection();
  348. multipleTableRef.value.toggleRowSelection(row,true);
  349. multipleSelection.value=selection[1];
  350. return;
  351. }
  352. if(selection.length==1){
  353. multipleSelection.value=selection;
  354. }else if(selection.length==0){
  355. }
  356. }
  357. const selectfun=()=>{
  358. source.value.selectstr='';
  359. currentPage4.value=1;
  360. console.log()
  361. if(multipleSelection.value.length!=0){
  362. firepid.value=multipleSelection.value[0].id;
  363. source.value.selectstr=multipleSelection.value[0].name;
  364. console.log(multipleSelection.value[0])
  365. }else{
  366. // selectstr.value='';
  367. }
  368. }
  369. // 确定
  370. const queding=()=>{
  371. selectfun();
  372. }
  373. defineExpose({ sendialogVisible, });
  374. </script>
  375. <style lang="scss" scoped>
  376. .jc_padding .el-table tr {
  377. height: 30px !important;
  378. background: rgba(104, 173, 255, 0.3);
  379. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  380. border-radius: 0px 0px 0px 0px;
  381. border: 1px solid;
  382. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  383. }
  384. .flex_a {
  385. flex: 1;
  386. padding: 0 19px;
  387. }
  388. .btns {
  389. width: 72px;
  390. height: 30px;
  391. background-image: url(../../assets/img/Rectangle399.png);
  392. background-repeat: no-repeat;
  393. line-height: 30px;
  394. overflow: hidden;
  395. margin: 10px 0;
  396. .spantext {
  397. font-weight: bold;
  398. font-size: 12px;
  399. color: #FFFFFF;
  400. text-align: left;
  401. font-style: normal;
  402. text-transform: none;
  403. }
  404. }
  405. .header_z {
  406. box-shadow: none !important;
  407. padding: 10px 20px !important;
  408. }
  409. .header_l {
  410. line-height: 10px;
  411. // height: 40px;
  412. text-align: left;
  413. padding: 0 20px;
  414. // border-bottom: 1px solid;
  415. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  416. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  417. border-radius: 0px 0px 0px 0px;
  418. .el-image {
  419. padding: 10px 10px 0 0;
  420. }
  421. h4 {
  422. font-weight: bold;
  423. font-size: 12px;
  424. color: #68ADFF;
  425. line-height: 14px;
  426. text-align: left;
  427. font-style: normal;
  428. text-transform: none;
  429. }
  430. }
  431. .jc_padding {
  432. padding: 18px 10px;
  433. }
  434. .line {
  435. border-bottom: 1px solid rgba(255, 255, 255, 0.20);
  436. box-sizing: border-box;
  437. }
  438. .L_aside {
  439. .iconimg {
  440. width: 37px;
  441. height: 36px;
  442. margin: 0 7px 0 24px;
  443. }
  444. }
  445. .ddd {
  446. margin-top: 20px;
  447. .ddd_div {
  448. padding: 20px 0;
  449. position: relative;
  450. }
  451. .class_btn {
  452. position: absolute;
  453. right: 0;
  454. top: 21px;
  455. }
  456. .header_l {
  457. line-height: 10px;
  458. // height: 40px;
  459. text-align: left;
  460. padding: 0 20px;
  461. // border-bottom: 1px solid;
  462. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  463. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  464. border-radius: 0px 0px 0px 0px;
  465. .el-image {
  466. padding: 10px 10px 0 0;
  467. }
  468. h4 {
  469. font-weight: bold;
  470. font-size: 12px;
  471. color: #68ADFF;
  472. line-height: 14px;
  473. text-align: left;
  474. font-style: normal;
  475. text-transform: none;
  476. }
  477. }
  478. }
  479. .el-dialog__title {
  480. display: inline-block;
  481. }
  482. .bgcolor {
  483. // width: 482px;
  484. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  485. border-radius: 0px 0px 0px 0px;
  486. border: 1px solid;
  487. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  488. }
  489. .dialog_class {
  490. .my-header {
  491. line-height: 10px;
  492. height: 40px;
  493. text-align: left;
  494. padding: 0 20px;
  495. border-bottom: 1px solid;
  496. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  497. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  498. border-radius: 0px 0px 0px 0px;
  499. .el-image {
  500. padding: 10px 10px 0 0;
  501. }
  502. h4 {
  503. font-weight: bold;
  504. font-size: 12px;
  505. color: #68ADFF;
  506. line-height: 14px;
  507. text-align: left;
  508. font-style: normal;
  509. text-transform: none;
  510. }
  511. }
  512. .my_content {
  513. width: 100%;
  514. height: 90px;
  515. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  516. border-radius: 0px 0px 0px 0px;
  517. position: relative;
  518. .radio-group {
  519. display: flex;
  520. justify-content: center;
  521. .el-radio {
  522. flex: 1;
  523. justify-content: center;
  524. font-weight: bold;
  525. font-size: 12px;
  526. color: #FFFFFF;
  527. line-height: 14px;
  528. }
  529. }
  530. }
  531. .el-dialog__footer {
  532. position: absolute;
  533. bottom: 17px;
  534. display: flex;
  535. .footerbtn {
  536. flex: 1;
  537. text-align: center;
  538. }
  539. }
  540. }
  541. .my_content1 {
  542. .el-table .cell {
  543. font-weight: 400;
  544. font-size: 12px;
  545. color: #FFFFFF !important;
  546. line-height: 14px;
  547. text-align: left;
  548. font-style: normal;
  549. text-transform: none;
  550. }
  551. }
  552. .l_btn .borderimg {
  553. width: 70px;
  554. height: 30px;
  555. font-size: 12px;
  556. background: rgba(104, 173, 255, 0.3);
  557. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  558. /* border: 1px solid rgba(31, 107, 255, 1); */
  559. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  560. font-weight: bold;
  561. border-radius: 4px;
  562. display: flex;
  563. display: inline-block;
  564. box-sizing: border-box;
  565. }
  566. .borderimg {
  567. width: 109px;
  568. height: 30px;
  569. background: rgba(104, 173, 255, 0.3);
  570. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  571. /* border: 1px solid rgba(31, 107, 255, 1); */
  572. -o-border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  573. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  574. border-radius: 4px;
  575. display: flex;
  576. display: inline-block;
  577. box-sizing: border-box
  578. }
  579. .el-table,
  580. .el-table thead th {
  581. background-color: rgba(13, 22, 57, 0.96) !important;
  582. }
  583. .L_aside {
  584. height: calc(100vh - 70px);
  585. position: absolute;
  586. top: 70px;
  587. overflow: hidden;
  588. }
  589. .el-form-item__label {
  590. color: #FFFFFF !important;
  591. }
  592. .jiancedian {
  593. width: 380px;
  594. position: absolute;
  595. right: 0;
  596. top: 70px;
  597. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  598. border-radius: 4px 4px 4px 4px;
  599. border: 1px solid;
  600. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  601. }
  602. </style>