index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <template>
  2. <div class="dashboard-container">
  3. <div class="dashboard-text">
  4. <div style="background: #fff">
  5. <div style="height: 74px; display: flex; align-items: center">
  6. <el-select
  7. style="width: 220px; margin-left: 20px; margin-right: 20px"
  8. v-model="railwayCode"
  9. placeholder="请选择报警线路"
  10. clearable
  11. >
  12. <el-option
  13. v-for="(item, index) in routeList"
  14. :key="index"
  15. :label="item.railwayName"
  16. :value="item.railwayCode"
  17. >
  18. </el-option>
  19. </el-select>
  20. <el-select
  21. v-model="lineDir"
  22. placeholder="请选择行别"
  23. style="width: 220px; margin-right: 20px"
  24. clearable
  25. >
  26. <el-option
  27. v-for="(item, index) in lineType"
  28. :key="index"
  29. :label="item.dictLabel"
  30. :value="item.dictValue"
  31. >
  32. </el-option>
  33. </el-select>
  34. <el-select
  35. v-model="isLock"
  36. placeholder="请选择解除状态"
  37. style="width: 220px; margin-right: 20px"
  38. clearable
  39. >
  40. <el-option
  41. v-for="(item, index) in zhangtai"
  42. :key="index"
  43. :label="item.label"
  44. :value="item.value"
  45. :clearable="true"
  46. >
  47. </el-option>
  48. </el-select>
  49. <div
  50. v-if="searchShow == true"
  51. style="display: flex"
  52. justify="end"
  53. type="flex"
  54. >
  55. <div class="sp-button-submit" type="primary" @click="msgAlarmList">
  56. 查询
  57. </div>
  58. <div class="sp-button-reset" @click="resetForm()">重置</div>
  59. <!-- <div class="sp-button-submit" @click="uploadOut">导出</div> -->
  60. <el-button
  61. v-if="searchShow == false"
  62. @click="searchShow = true"
  63. type="text"
  64. style="color: #2766dd"
  65. icon="el-icon-arrow-up"
  66. >收起</el-button
  67. >
  68. <el-button
  69. v-if="searchShow == true"
  70. @click="searchShow = false"
  71. type="text"
  72. icon="el-icon-arrow-down"
  73. style="color: #2766dd"
  74. >展开</el-button
  75. >
  76. </div>
  77. </div>
  78. <div
  79. v-if="searchShow == false"
  80. style="
  81. display: flex;
  82. align-items: center;
  83. margin-bottom: 17px;
  84. height: 40px;
  85. "
  86. >
  87. <el-date-picker
  88. style="width: 460px; margin-right: 20px; margin-left: 20px"
  89. v-model="value1"
  90. end-placeholder="结束日期"
  91. range-separator="至"
  92. start-placeholder="开始日期"
  93. clearable
  94. value-format="yyyy-MM-dd"
  95. type="daterange"
  96. :clearable="true"
  97. >
  98. </el-date-picker>
  99. <!-- <el-input
  100. v-model="alarmMileBD"
  101. placeholder="请输入里程位置"
  102. suffix-icon="el-icon-search"
  103. style="width: 100%"
  104. clearable
  105. >
  106. </el-input> -->
  107. <el-select
  108. v-if="searchShow == false"
  109. v-model="alarmType"
  110. placeholder="请选择报警类型"
  111. style="width: 220px; margin-right: 20px"
  112. clearable
  113. >
  114. <el-option
  115. v-for="(item, index) in damageList"
  116. :key="index"
  117. :label="item.dictLabel"
  118. :value="item.dictValue"
  119. >
  120. </el-option>
  121. </el-select>
  122. </div>
  123. <div v-if="searchShow == false">
  124. <div
  125. style="
  126. display: flex;
  127. align-items: center;
  128. padding-bottom: 17px;
  129. margin-left: 20px;
  130. "
  131. >
  132. <!-- <el-input
  133. v-model="beginMile"
  134. placeholder="请输入起始里程"
  135. @input="changeValue1"
  136. style="width: 220px; margin-left: 20px"
  137. clearable
  138. >
  139. <template slot="append">km</template></el-input
  140. > -->
  141. <!-- <el-select
  142. v-model="beginMile"
  143. placeholder="请选择起始里程"
  144. style="width: 250px"
  145. clearable
  146. >
  147. <el-option
  148. v-for="(item, index) in mileageList"
  149. :key="index"
  150. :clearable="true"
  151. :label="item.dictLabel"
  152. :value="item.dictValue"
  153. ></el-option>
  154. </el-select> -->
  155. <!-- <div
  156. style="
  157. width: 10px;
  158. height: 1px;
  159. background-color: #888;
  160. margin: 0 5px;
  161. "
  162. ></div> -->
  163. <!-- <el-input
  164. v-model="endMile"
  165. placeholder="请输入结束里程"
  166. @input="changeValue2"
  167. style="width: 220px; margin-right: 20px"
  168. clearable
  169. >
  170. <template slot="append">km</template></el-input
  171. > -->
  172. <el-input
  173. v-model="alarmMileBD"
  174. placeholder="请输入里程位置"
  175. clearable
  176. oninput="value=value.replace(/[^\d.]/g, '')"
  177. style="width: 220px; margin-right: 20px"
  178. >
  179. <template slot="append">km</template></el-input
  180. >
  181. <el-select
  182. v-model="monitorSystemName"
  183. placeholder="请选择监测系统名称"
  184. style="width: 220px; margin-right: 20px"
  185. filterable
  186. >
  187. <el-option
  188. v-for="item in monitorNameData"
  189. :key="item.monitorSystemName"
  190. :label="item.monitorSystemName"
  191. :value="item.clientId"
  192. />
  193. </el-select>
  194. <div
  195. v-if="searchShow == false"
  196. style="display: flex; align-items: center"
  197. >
  198. <div class="sp-button-submit searth_left" @click="msgAlarmList">
  199. 查询
  200. </div>
  201. <div class="sp-button-reset" @click="resetForm()">重置</div>
  202. <el-button
  203. v-if="searchShow == false"
  204. @click="searchShow = true"
  205. type="text"
  206. style="color: #2766dd"
  207. icon="el-icon-arrow-up"
  208. >收起</el-button
  209. >
  210. <el-button
  211. v-if="searchShow == true"
  212. @click="searchShow = false"
  213. type="text"
  214. icon="el-icon-arrow-down"
  215. style="color: #2766dd"
  216. >展开</el-button
  217. >
  218. </div>
  219. </div>
  220. <!-- <el-col :span="6"></el-col> -->
  221. </div>
  222. </div>
  223. </div>
  224. <el-card class="cardHeadr" style="margin-top: 15px; padding-top: 0">
  225. <!-- <div style="font-size: 18px">
  226. 告警:<span style="font-size: 24px; color: red"> {{ total }}</span>
  227. </div> -->
  228. <div style="height: 64px; display: flex; align-items: center">
  229. <div class="export" @click="uploadOut">
  230. <span class="icon font_family">&#xe605;</span>
  231. 导出
  232. </div>
  233. </div>
  234. <el-table :data="tableData" style="width: 100%">
  235. <el-table-column
  236. label="报警时间"
  237. prop="alarmTime"
  238. width="180"
  239. fixed
  240. ></el-table-column>
  241. <!-- <el-table-column
  242. align="center"
  243. label="报警线路"
  244. prop="railwayName"
  245. fixed
  246. ></el-table-column> -->
  247. <el-table-column
  248. label="来源"
  249. prop="sourceName"
  250. width="140"
  251. fixed
  252. ></el-table-column>
  253. <el-table-column align="center" label="报警类型" prop="alarmTypeName" fixed>
  254. <!-- <template slot-scope="scope">
  255. <div>
  256. {{
  257. scope.row.alarmType == 1
  258. ? "泥石流"
  259. : scope.row.alarmType == 2
  260. ? "异物侵线"
  261. : "异物侵入"
  262. }}
  263. </div>
  264. </template> -->
  265. </el-table-column>
  266. <!-- <el-table-column
  267. align="center"
  268. label="报警病害属性"
  269. prop="alarmAttr"
  270. show-overflow-tooltip="true"
  271. ></el-table-column> -->
  272. <el-table-column label="行别" align="center" prop="lineDir">
  273. <template slot-scope="scope">
  274. <div style="text-align: center">
  275. {{
  276. scope.row.lineDir === 1
  277. ? "上行"
  278. : scope.row.lineDir === 2
  279. ? "下行"
  280. : "-"
  281. }}
  282. </div>
  283. </template>
  284. </el-table-column>
  285. <el-table-column
  286. label="里程位置(km)"
  287. align="center"
  288. prop="alarmMiles"
  289. ></el-table-column>
  290. <!-- <el-table-column label="起里里程(km)" prop="beginMile"></el-table-column>
  291. <el-table-column label="结束里程(km)" prop="endMile"></el-table-column> -->
  292. <!-- <el-table-column label="报警次数" align="center" prop="alarmCount">
  293. <template slot-scope="scope">
  294. <div style="color: red">{{ scope.row.alarmCount }}</div>
  295. </template>
  296. </el-table-column> -->
  297. <!-- <el-table-column label="解除状态" align="center">
  298. <template slot-scope="scope">
  299. <div>
  300. {{
  301. scope.row.isLock === 1
  302. ? "已解除"
  303. : scope.row.isLock === 2
  304. ? "未解除"
  305. : "-"
  306. }}
  307. </div>
  308. </template>
  309. </el-table-column> -->
  310. <el-table-column
  311. label="报警内容"
  312. show-overflow-tooltip="true"
  313. align="center"
  314. prop="content"
  315. >
  316. <template slot-scope="scope">
  317. <div
  318. style="
  319. max-width: 10em;
  320. overflow: hidden;
  321. white-space: nowrap;
  322. text-overflow: ellipsis;
  323. "
  324. >
  325. {{ scope.row.content }}
  326. </div>
  327. </template>
  328. </el-table-column>
  329. <el-table-column
  330. label="推送车次"
  331. align="center"
  332. prop="trainNumName"
  333. >
  334. <template slot-scope="scope">
  335. <el-button
  336. v-if='scope.row.trainNumName'
  337. type="text"
  338. style="text-align: center; color: #2766dd"
  339. @click="detailsBtn(scope.row)"
  340. >{{ scope.row.trainNumName }}{{ '...' }}</el-button
  341. >
  342. </template>
  343. </el-table-column>
  344. <el-table-column label="解除状态" align="center" prop="isRelease">
  345. <template slot-scope="scope">
  346. {{
  347. scope.row.isRelease === 1
  348. ? "已解除"
  349. : scope.row.isRelease === 2
  350. ? "未解除"
  351. : "-"
  352. }}
  353. </template>
  354. </el-table-column>
  355. <el-table-column
  356. label="解除说明"
  357. align="center"
  358. prop="releaseContent"
  359. ></el-table-column>
  360. <el-table-column
  361. label="解除时间"
  362. align="center"
  363. prop="releasedTime"
  364. ></el-table-column>
  365. <el-table-column label="操作" align="center" width="280" prop="text13">
  366. <template slot-scope="scope">
  367. <div>
  368. <!-- <el-button
  369. style="color: #2766dd"
  370. v-if="scope.row.isLock == 2"
  371. type="text"
  372. @click="release(scope.row.id)"
  373. >解除</el-button
  374. > -->
  375. <el-button
  376. type="text"
  377. style="text-align: center; color: #2766dd"
  378. @click="
  379. seeDetail(scope.row.id, scope.row.railwayCode, scope.row)
  380. "
  381. >查看详情</el-button
  382. >
  383. <!-- <el-button
  384. type="text"
  385. style="text-align: center; color: #2766dd"
  386. @click="detailsBtn(scope.row)"
  387. >推送详情</el-button
  388. > -->
  389. </div>
  390. </template>
  391. </el-table-column>
  392. </el-table>
  393. <el-row justify="end" style="margin-top: 10px" type="flex">
  394. <el-pagination
  395. :page-size="100"
  396. :page-sizes="[10, 15, 20]"
  397. :total="total"
  398. layout="total, sizes, prev, pager, next, jumper"
  399. @size-change="handleSizeChange"
  400. @current-change="handleCurrentChange"
  401. >
  402. </el-pagination>
  403. </el-row>
  404. </el-card>
  405. <detailsDialog :detailsData="detailsData" v-if="detailsData.dialogVisible"></detailsDialog>
  406. <warningDispose
  407. v-if="warningDisposeModal.show"
  408. :id="warningDisposeModal.id"
  409. @close="warningDisposeModal.show = false"
  410. @success="releaseSuccess"
  411. ></warningDispose>
  412. </div>
  413. </template>
  414. <script>
  415. import { mapGetters } from "vuex";
  416. import warningDispose from "@/components/warning/warningDispose.vue";
  417. import detailsDialog from './components/detailsDialog.vue'
  418. import {
  419. baseRailwayManagement,
  420. dataType,
  421. msgAlarmList,
  422. getCameraDataUpLoadOut,
  423. releaseAlarm,
  424. alarmMessageList
  425. } from "@/api/alarmList";
  426. import { monitorNameList } from "@/api/monitor";
  427. export default {
  428. name: "cart",
  429. components: { warningDispose,detailsDialog },
  430. computed: {
  431. ...mapGetters(["name"]),
  432. },
  433. data() {
  434. return {
  435. detailsData:{
  436. dialogVisible:false,
  437. alarmId:''
  438. },
  439. warningModal: {
  440. show: true,
  441. },
  442. isShow: false,
  443. searchShow: true,
  444. pageNum: 1,
  445. pageSize: 10,
  446. total: 0,
  447. value1: "",
  448. value: "",
  449. input: "",
  450. zhangtai: [
  451. {
  452. value: "1",
  453. label: "已解除",
  454. },
  455. {
  456. value: "2",
  457. label: "未解除",
  458. },
  459. ],
  460. monitorNameData: [],
  461. tableData: [],
  462. routeList: [],
  463. lineType: [],
  464. damageList: [],
  465. mileageList: [],
  466. railwayCode: "",
  467. lineDir: "",
  468. alarmType: "",
  469. alarmMileBD: "",
  470. monitorSystemName: "",
  471. beginMile: "",
  472. endMile: "",
  473. beginAlarmTime: "",
  474. endAlarmTime: "",
  475. isLock: "",
  476. warningDisposeModal: {
  477. show: false,
  478. id: "",
  479. },
  480. };
  481. },
  482. created() {
  483. if(this.$route.params.pageNum) {
  484. this.isLock = this.$route.params.isLock + ''
  485. this.monitorSystemName = this.$route.params.source
  486. }
  487. this.getMonitoreName();
  488. this.msgAlarmList();
  489. this.baseRailwayManagement();
  490. this.dataType("sys_line_dir");
  491. this.dataType("sys_alarm_type");
  492. this.dataType("sys_mileage");
  493. if(this.$route.query.zhangtai){
  494. this.isLock = "2";
  495. this.msgAlarmList();
  496. }
  497. },
  498. methods: {
  499. detailsBtn(row) {
  500. this.detailsData.alarmId = row.alarmId
  501. this.detailsData.dialogVisible = true
  502. },
  503. getMonitoreName() {
  504. let params = {};
  505. monitorNameList(params).then((response) => {
  506. this.monitorNameData = response.data;
  507. });
  508. },
  509. imagePreview(images) {
  510. this.$hevueImgPreview({
  511. multiple: true, // 开启多图预览模式
  512. nowImgIndex: 0, // 多图预览,默认展示第二张图片
  513. imgList: images, // 需要预览的多图数组
  514. });
  515. },
  516. seeDetail(val, val1, row) {
  517. sessionStorage.row = JSON.stringify(row);
  518. this.$router.push({
  519. path: "/alarmDetail",
  520. query: {
  521. id: val,
  522. cameraCode: val1,
  523. alarmId: row.alarmId,
  524. },
  525. });
  526. },
  527. // uploadOut: function () {
  528. // getCameraDataUpLoadOut({}).then((res) => {
  529. // this.resolveBlob(res);
  530. // });
  531. // },
  532. uploadOut: function () {
  533. getCameraDataUpLoadOut({}).then((res) => {
  534. this.resolveBlob(res);
  535. });
  536. },
  537. resolveBlob(res) {
  538. const link = document.createElement("a");
  539. link.style.dispaly = "none";
  540. let binaryData = [];
  541. binaryData.push(res);
  542. link.href = window.URL.createObjectURL(new Blob(binaryData));
  543. // link.href = URL.createObjectURL(res);
  544. link.setAttribute("download", "报警信息列表.xlsx");
  545. document.body.appendChild(link);
  546. link.click();
  547. document.body.removeChild(link);
  548. },
  549. resetForm() {
  550. (this.railwayCode = ""),
  551. (this.lineDir = ""),
  552. (this.alarmType = ""),
  553. (this.alarmMileBD = "");
  554. this.monitorSystemName = "";
  555. (this.beginMile = ""),
  556. (this.endMile = ""),
  557. (this.beginAlarmTime = ""),
  558. (this.endAlarmTime = "");
  559. this.value1 = "";
  560. this.isLock = "";
  561. this.msgAlarmList();
  562. },
  563. getImgUrl(img) {
  564. return "http://124.71.171.71:18801/picbucket" + img;
  565. },
  566. release(val) {
  567. if (val) {
  568. this.warningDisposeModal.id = val;
  569. this.warningDisposeModal.show = true;
  570. }
  571. },
  572. releaseSuccess() {
  573. this.warningDisposeModal.id = "";
  574. this.warningDisposeModal.show = false;
  575. this.msgAlarmList();
  576. },
  577. dataType(val) {
  578. dataType(val).then((res) => {
  579. console.log(res);
  580. if (val === "sys_line_dir") {
  581. this.lineType = [];
  582. this.lineType = res.data;
  583. this.$set(this.lineType);
  584. } else if ("sys_alarm_type" === val) {
  585. this.damageList = [];
  586. this.damageList = res.data;
  587. this.$set(this.damageList);
  588. } else if ("sys_mileage" === val) {
  589. this.mileageList = [];
  590. this.mileageList = res.data;
  591. this.$set(this.mileageList);
  592. }
  593. });
  594. },
  595. baseRailwayManagement() {
  596. baseRailwayManagement().then((res) => {
  597. console.log(res);
  598. this.routeList = [];
  599. this.routeList = res.data;
  600. this.$set(this.routeList);
  601. });
  602. },
  603. handleSizeChange(val) {
  604. console.log(`每页 ${val} 条`);
  605. this.pageSize = val;
  606. this.msgAlarmList();
  607. },
  608. handleCurrentChange(val) {
  609. console.log(`当前页: ${val}`);
  610. this.pageNum = val;
  611. this.msgAlarmList();
  612. },
  613. changeValue(value) {
  614. this.alarmMileBD = /^[0-9]*$/.test(parseInt(value))
  615. ? String(parseInt(value)).replace(".", "")
  616. : "";
  617. },
  618. changeValue1(value) {
  619. this.beginMile = /^[0-9]*$/.test(parseInt(value))
  620. ? String(parseInt(value)).replace(".", "")
  621. : "";
  622. },
  623. changeValue2(value) {
  624. this.endMile = /^[0-9]*$/.test(parseInt(value))
  625. ? String(parseInt(value)).replace(".", "")
  626. : "";
  627. },
  628. msgAlarmList() {
  629. // if (this.alarmMileBD && !/^(\d+.\d{1,3}|\d+)$/.test(this.alarmMileBD)) {
  630. // return this.$message({
  631. // type: "error",
  632. // message: "请输入正确的里程",
  633. // });
  634. // }
  635. // if (this.beginMile && !/^(\d+.\d{1,3}|\d+)$/.test(this.beginMile)) {
  636. // return this.$message({
  637. // type: "error",
  638. // message: "请输入正确的起始里程",
  639. // });
  640. // }
  641. // if (this.endMile && !/^(\d+.\d{1,3}|\d+)$/.test(this.endMile)) {
  642. // return this.$message({
  643. // type: "error",
  644. // message: "请输入正确的结束里程",
  645. // });
  646. // }
  647. let beginAlarmTime = undefined;
  648. let endAlarmTime = undefined;
  649. if (this.value1) {
  650. beginAlarmTime = this.value1[0];
  651. endAlarmTime = this.value1[1];
  652. }
  653. msgAlarmList({
  654. pageNum: this.pageNum,
  655. pageSize: this.pageSize,
  656. alarmType: this.alarmType,
  657. railwayCode: this.railwayCode,
  658. beginMile: this.beginMile,
  659. endMile: this.endMile,
  660. lineDir: this.lineDir,
  661. isRelease: this.isLock,
  662. alarmMileBD: this.alarmMileBD,
  663. beginAlarmTime: beginAlarmTime,
  664. endAlarmTime: endAlarmTime,
  665. source: this.monitorSystemName,
  666. }).then((res) => {
  667. console.log(res);
  668. if (res.code == 200) {
  669. this.tableData = [];
  670. this.tableData = res.data.records;
  671. this.$set(this.tableData);
  672. this.total = res.data.total;
  673. } else {
  674. this.$message({
  675. message: res.mag,
  676. type: "error",
  677. });
  678. }
  679. });
  680. },
  681. },
  682. };
  683. </script>
  684. <style lang="scss" scoped>
  685. ::v-deep .searth_left {
  686. margin: 0;
  687. }
  688. ::v-deep .el-card__body {
  689. padding: 0 20px 20px 20px;
  690. }
  691. .dashboard {
  692. &-container {
  693. margin: 30px 30px 30px;
  694. }
  695. &-text {
  696. font-size: 30px;
  697. line-height: 46px;
  698. }
  699. }
  700. .el-image-viewer__close {
  701. color: blue;
  702. }
  703. </style>
  704. <style lang="scss" scoped>
  705. .dashboard {
  706. &-container {
  707. margin: 30px;
  708. }
  709. &-text {
  710. font-size: 30px;
  711. line-height: 46px;
  712. }
  713. }
  714. .el-card.is-always-shadow,
  715. .el-card.is-hover-shadow:focus {
  716. box-shadow: none;
  717. }
  718. .el-card {
  719. border: 1px solid#FFFF;
  720. background-color: #fff;
  721. color: #303133;
  722. -webkit-transition: 0.3s;
  723. transition: 0.3s;
  724. }
  725. ::v-deep .el-date-editor .el-range__icon {
  726. top: 0;
  727. }
  728. .export {
  729. // margin: 23px 6px;
  730. cursor: pointer;
  731. text-align: center;
  732. width: 98px;
  733. height: 34px;
  734. border-radius: 2px;
  735. border: 1px solid #abc7fd;
  736. line-height: 34px;
  737. font-weight: 400;
  738. font-size: 14px;
  739. color: #2250c8;
  740. background-color: #e7eeff;
  741. }
  742. .export:hover {
  743. color: #fff;
  744. border: 1px solid #2250c8;
  745. background-color: #2250c8;
  746. }
  747. .export:active {
  748. background-color: #194da4;
  749. border: 1px solid #194da4;
  750. }
  751. </style>