index.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  1. <template>
  2. <div class="alarmList-container">
  3. <!-- 弹窗内容 -->
  4. <div class="dialog_box" :key="timer">
  5. <div class="search-box">
  6. <div class="search-item">
  7. <span class="search-label">时间:</span>
  8. <el-date-picker
  9. class="search-date"
  10. v-model="query.time"
  11. type="datetimerange"
  12. range-separator="-"
  13. start-placeholder="开始日期"
  14. end-placeholder="结束日期"
  15. :default-time="['00:00:00', '23:59:59']"
  16. size="mini"
  17. :picker-options="pickerOptions"
  18. >
  19. </el-date-picker>
  20. </div>
  21. <div class="search-item">
  22. <span class="search-label">报警位号:</span>
  23. <el-input size="mini" v-model="query.tag" />
  24. </div>
  25. <div class="search-item">
  26. <span class="search-label">报警内容:</span>
  27. <el-input size="mini" v-model="query.key" />
  28. </div>
  29. <div class="search-item">
  30. <span class="search-label">所属场站:</span>
  31. <!-- <el-select
  32. size="mini"
  33. v-model="query.departmentId"
  34. clearable
  35. @change="searchData()"
  36. >
  37. <el-option
  38. v-for="item in departmentOptions"
  39. :key="item.id"
  40. :value="item.id"
  41. :label="item.departmentName"
  42. ></el-option>
  43. </el-select> -->
  44. <el-cascader
  45. v-model="query.departmentId"
  46. :options="departmentOptions"
  47. :props="{ checkStrictly: true }"
  48. clearable
  49. size="mini"
  50. placeholder="请选择部门"
  51. style="width: 200px"
  52. @change="searchData()"
  53. />
  54. </div>
  55. <div class="search-item">
  56. <span class="search-label">报警分类:</span>
  57. <el-select
  58. size="mini"
  59. v-model="query.category"
  60. clearable
  61. @change="searchData()"
  62. >
  63. <el-option
  64. v-for="item in categoryOptions"
  65. :key="item.dictKey"
  66. :value="item.dictKey"
  67. :label="item.dictValue"
  68. ></el-option>
  69. </el-select>
  70. </div>
  71. <div class="search-item">
  72. <span class="search-label"> 报警级别:</span>
  73. <el-select
  74. size="mini"
  75. v-model="query.level"
  76. clearable
  77. @change="searchData"
  78. >
  79. <el-option :value="'024001'" label="一级报警"></el-option>
  80. <el-option :value="'024002'" label="二级报警"></el-option>
  81. <el-option :value="'024003'" label="三级报警"></el-option>
  82. </el-select>
  83. </div>
  84. </div>
  85. <div class="search-box">
  86. <div class="search-item">
  87. <span class="search-label">确认状态:</span>
  88. <el-select
  89. size="mini"
  90. v-model="query.confirmStatus"
  91. clearable
  92. @change="searchData"
  93. >
  94. <el-option :value="'1'" label="已确认"></el-option>
  95. <el-option :value="'0'" label="未确认"></el-option>
  96. </el-select>
  97. </div>
  98. <div class="search-item">
  99. <span class="search-label"> 处理状态:</span>
  100. <el-select
  101. size="mini"
  102. v-model="query.dealStatus"
  103. clearable
  104. @change="searchData"
  105. >
  106. <el-option :value="'1'" label="已处理"></el-option>
  107. <el-option :value="'0'" label="未处理"></el-option>
  108. </el-select>
  109. </div>
  110. <div class="search-item">
  111. <span class="search-label">恢复状态:</span>
  112. <el-select
  113. size="mini"
  114. v-model="query.recoveryStatus"
  115. clearable
  116. @change="searchData"
  117. >
  118. <el-option :value="'1'" label="已恢复"></el-option>
  119. <el-option :value="'0'" label="未恢复"></el-option>
  120. </el-select>
  121. </div>
  122. <div class="search-btn" @click="searchData">
  123. <img
  124. :src="require('@/assets/imgs/dialog/icon_close.png')"
  125. alt="查询"
  126. />
  127. </div>
  128. <div class="search-btn" @click="handleReset">
  129. <img
  130. :src="require('@/assets/imgs/dialog/icon_reset.png')"
  131. alt="重置"
  132. />
  133. </div>
  134. <div class="search-btn2" @click="exportData">
  135. <el-button size="mini" type="success">导出</el-button>
  136. </div>
  137. <div class="search-btn2">
  138. <el-button size="mini" type="success" @click="handleConfirmMulti"
  139. >批量确认</el-button
  140. >
  141. </div>
  142. <div class="search-btn2">
  143. <el-button size="mini" type="success" @click="handleDealMulti"
  144. >批量处理</el-button
  145. >
  146. </div>
  147. </div>
  148. <!-- 内容 -->
  149. <div class="list-box">
  150. <div
  151. class="table-box"
  152. :style="{
  153. width: detailShow ? '1400px' : '100%',
  154. transition: 'all 0.8s',
  155. }"
  156. >
  157. <base-table-list :tableConfig="tableConfig" />
  158. </div>
  159. <div
  160. class="detail-box"
  161. :style="{
  162. width: detailShow ? '400px' : '0',
  163. visibility: detailShow ? 'visible' : 'hidden',
  164. transition: 'width 0.8s',
  165. }"
  166. >
  167. <img
  168. class="split-line"
  169. :src="require('@/assets/imgs/btn_take back@2x.png')"
  170. @click="hideDetail"
  171. />
  172. <div class="detail-content-box">
  173. <div class="detail-title">
  174. <img :src="require('@/assets/imgs/img_round@2x.png')" />
  175. <div class="title-text">报警记录详细信息</div>
  176. </div>
  177. <div class="detail-content">
  178. <div class="detail-item">
  179. <span class="detail-label">报警位号:</span>
  180. <span class="detail-text">{{
  181. curAlarmDetail.alarmTagName
  182. }}</span>
  183. </div>
  184. <div class="detail-item">
  185. <span class="detail-label">报警内容:</span>
  186. <span class="detail-text">{{ curAlarmDetail.content }}</span>
  187. </div>
  188. <div class="detail-item">
  189. <span class="detail-label">报警等级:</span>
  190. <span class="detail-text">{{ curAlarmDetail.levelStr }}</span>
  191. </div>
  192. <div class="detail-item">
  193. <span class="detail-label">报警类型:</span>
  194. <span class="detail-text">{{
  195. curAlarmDetail.categoryStr
  196. }}</span>
  197. </div>
  198. <div class="detail-item">
  199. <span class="detail-label">报警时间:</span>
  200. <span class="detail-text">{{ curAlarmDetail.eventTime }}</span>
  201. </div>
  202. <div class="detail-item">
  203. <span class="detail-label">确认状态:</span>
  204. <span class="detail-text">{{
  205. curAlarmDetail.confirmStatusStr
  206. }}</span>
  207. </div>
  208. <div class="detail-item">
  209. <span class="detail-label">确认时间:</span>
  210. <span class="detail-text">{{
  211. curAlarmDetail.confirmTime
  212. }}</span>
  213. </div>
  214. <div class="detail-item">
  215. <span class="detail-label">确认人:</span>
  216. <span class="detail-text">{{
  217. curAlarmDetail.confirmPersonName
  218. }}</span>
  219. </div>
  220. <div class="detail-item">
  221. <span class="detail-label">处理状态:</span>
  222. <span class="detail-text">{{
  223. curAlarmDetail.dealStatusStr
  224. }}</span>
  225. </div>
  226. <div class="detail-item">
  227. <span class="detail-label">处理时间:</span>
  228. <span class="detail-text">{{ curAlarmDetail.dealTime }}</span>
  229. </div>
  230. <div class="detail-item">
  231. <span class="detail-label">处理人:</span>
  232. <span class="detail-text">{{
  233. curAlarmDetail.dealPersonName
  234. }}</span>
  235. </div>
  236. <div class="detail-item">
  237. <span class="detail-label">恢复状态:</span>
  238. <span class="detail-text">{{
  239. curAlarmDetail.recoveryStatusStr
  240. }}</span>
  241. </div>
  242. <div class="detail-item">
  243. <span class="detail-label">恢复时间:</span>
  244. <span class="detail-text">{{
  245. curAlarmDetail.recoveryTime
  246. }}</span>
  247. </div>
  248. <div class="detail-item">
  249. <span class="detail-label">处理方式:</span>
  250. <span class="detail-text">
  251. <el-radio-group v-model="curAlarmDetail.dataType">
  252. <el-radio :label="0" style="color: #fff !important"
  253. >正常</el-radio
  254. >
  255. <el-radio :label="1" style="color: #fff !important"
  256. >误报</el-radio
  257. >
  258. <el-radio :label="2" style="color: #fff !important"
  259. >测试</el-radio
  260. >
  261. <el-radio :label="3" style="color: #fff !important"
  262. >抑制</el-radio
  263. >
  264. </el-radio-group>
  265. </span>
  266. </div>
  267. <div class="detail-item">
  268. <span class="detail-label">处理意见:</span>
  269. <el-input
  270. ref="dealContent"
  271. type="textarea"
  272. :rows="3"
  273. size="mini"
  274. v-model="curAlarmDetail.dealContent"
  275. placeholder="请填写处理意见"
  276. :disabled="curAlarmDetail.dealStatus === '1'"
  277. />
  278. </div>
  279. <div class="detail-item" v-if="curAlarmDetail.imageUrl">
  280. <span class="detail-label">报警图片:</span>
  281. <div class="image-box">
  282. <el-image
  283. fit="contain"
  284. :src="`${BASE_URL}${curAlarmDetail.imageUrl.replace(
  285. '\/\/',
  286. '/'
  287. )}`"
  288. :preview-src-list="[
  289. `${BASE_URL}${curAlarmDetail.imageUrl.replace(
  290. '\/\/',
  291. '/'
  292. )}`,
  293. ]"
  294. />
  295. </div>
  296. </div>
  297. </div>
  298. <div class="btn-box">
  299. <el-button
  300. class="btn-handle"
  301. size="mini"
  302. @click="handleConfirm"
  303. v-show="curAlarmDetail.confirmStatus == '0'"
  304. >
  305. 确认
  306. </el-button>
  307. <el-button
  308. class="btn-handle"
  309. size="mini"
  310. @click="handleDeal"
  311. v-show="curAlarmDetail.dealStatus == '0'"
  312. >
  313. 处理
  314. </el-button>
  315. <el-button class="btn-cancel" size="mini" @click="handleClose"
  316. >取消</el-button
  317. >
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <div class="page-box">
  323. <base-pagination
  324. :pageInfo="pageConfig"
  325. @pageChange="getAlarmDataList"
  326. ></base-pagination>
  327. </div>
  328. </div>
  329. <deal-multi-dialog
  330. :dialogConfig="dealMultiDialogConfig"
  331. ></deal-multi-dialog>
  332. <confirm-multi-dialog
  333. :dialogConfig="confirmMultiDialogConfig"
  334. ></confirm-multi-dialog>
  335. </div>
  336. </template>
  337. <script>
  338. import {
  339. getAlarmDataList,
  340. getAlarmCount,
  341. getAlarmType,
  342. dealAlarm,
  343. confirmAlarm,
  344. getDepartmentByPid,
  345. download,
  346. exportData,
  347. } from "@/API/alarm";
  348. import { getDictDetailByType } from "@/API/dict";
  349. import { downloadFile } from "@/utils/index";
  350. import Dayjs from "dayjs";
  351. import BaseTableList from "@/views/components/base/BaseTableList.vue";
  352. import BasePagination from "@/views/components/base/BasePagination.vue";
  353. import DealMultiDialog from "@/views/alarm/alarmList/components/DealMultiDialog.vue";
  354. import ConfirmMultiDialog from "@/views/alarm/alarmList/components/ConfirmMultiDialog.vue";
  355. import { calendarShortcuts } from "@/utils/shortcuts";
  356. import { add } from "lodash-es";
  357. export default {
  358. name: "AlarmList",
  359. components: {
  360. BaseTableList,
  361. BasePagination,
  362. DealMultiDialog,
  363. ConfirmMultiDialog,
  364. },
  365. data() {
  366. return {
  367. timer: new Date().getTime(),
  368. query: {
  369. time: [
  370. Dayjs(new Date()).subtract(1, "month").format("YYYY-MM-DD HH:mm:ss"),
  371. Dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
  372. ],
  373. category: "",
  374. level: "",
  375. dealStatus: "",
  376. confirmStatus: "",
  377. type: "",
  378. key: "",
  379. tag: "",
  380. recoveryStatus: "",
  381. departmentId: "",
  382. },
  383. pageConfig: {
  384. pageNo: 1,
  385. pageSize: 20,
  386. pageTotal: 0,
  387. },
  388. tableConfig: {
  389. needIndex: true,
  390. height: 760,
  391. // rowHeight: 42,
  392. // rowSpacing: 12,
  393. header: [
  394. { title: "报警时间", prop: "eventTime", width: "" },
  395. { title: "报警位号", prop: "alarmTagName", width: "" },
  396. { title: "报警分类", prop: "categoryStr", width: "" },
  397. { title: "报警级别", prop: "levelStr", width: "" },
  398. { title: "报警内容", prop: "content", width: "40%" },
  399. { title: "确认状态", prop: "confirmStatusStr", width: "" },
  400. { title: "处理状态", prop: "dealStatusStr", width: "" },
  401. { title: "恢复状态", prop: "recoveryStatusStr", width: "" },
  402. ],
  403. tableData: [],
  404. rowClick: (row) => {
  405. this.showDetail(row);
  406. },
  407. },
  408. categoryOptions: [],
  409. alarmTypeOptions: [],
  410. departmentOptions: [],
  411. pickerOptions: {
  412. shortcuts: calendarShortcuts,
  413. },
  414. detailShow: false,
  415. curAlarmDetail: {},
  416. dealMultiDialogConfig: {},
  417. confirmMultiDialogConfig: {},
  418. };
  419. },
  420. watch: {
  421. $route(to, from) {
  422. // console.log(from, "前from,后to", to);
  423. console.log(this.$route);
  424. if (this.$route.query) {
  425. if (this.$route.query.dateRange == "24H") {
  426. this.query.time = [
  427. Dayjs(new Date()).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
  428. Dayjs(new Date()).format("YYYY-MM-DD 23:59:59"),
  429. ];
  430. }
  431. if (!!this.$route.query.date) {
  432. console.log(
  433. Dayjs(
  434. this.$route.query.date
  435. .replace("年", "-")
  436. .replace("月", "-")
  437. .replace("日", "")
  438. )
  439. );
  440. this.query.time = [
  441. Dayjs(
  442. this.$route.query.date
  443. .replace("年", "-")
  444. .replace("月", "-")
  445. .replace("日", "")
  446. ).format("YYYY-MM-DD HH:mm:ss"),
  447. Dayjs(
  448. this.$route.query.date
  449. .replace("年", "-")
  450. .replace("月", "-")
  451. .replace("日", "")
  452. )
  453. .add(1, "day")
  454. .subtract(1, "second")
  455. .format("YYYY-MM-DD HH:mm:ss"),
  456. ];
  457. }
  458. if (!!this.$route.query.confirmStatus) {
  459. this.query.confirmStatus = this.$route.query.confirmStatus;
  460. }
  461. if (!!this.$route.query.dealStatus) {
  462. this.query.dealStatus = this.$route.query.dealStatus;
  463. }
  464. if (!!this.$route.query.level) {
  465. this.query.level = this.$route.query.level;
  466. }
  467. if (!!this.$route.query.recoveryStatus) {
  468. this.query.recoveryStatus = this.$route.query.recoveryStatus;
  469. }
  470. if (!!this.$route.query.category) {
  471. this.query.category = this.$route.query.category;
  472. } else {
  473. this.query.category = "";
  474. }
  475. if (!!this.$route.query.departmentId) {
  476. if (typeof this.$route.query.departmentId === "string") {
  477. this.query.departmentId = new Array(this.$route.query.departmentId);
  478. }
  479. }
  480. }
  481. this.getAlarmCategory();
  482. this.getAlarmDataList();
  483. this.getDepartmentByPid();
  484. },
  485. },
  486. mounted() {
  487. console.log(this.$route);
  488. if (this.$route.query.dateRange == "24H") {
  489. this.query.time = [
  490. Dayjs(new Date()).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
  491. Dayjs(new Date()).format("YYYY-MM-DD 23:59:59"),
  492. ];
  493. }
  494. if (!!this.$route.query.date) {
  495. console.log(
  496. Dayjs(
  497. this.$route.query.date
  498. .replace("年", "-")
  499. .replace("月", "-")
  500. .replace("日", "")
  501. )
  502. );
  503. this.query.time = [
  504. Dayjs(
  505. this.$route.query.date
  506. .replace("年", "-")
  507. .replace("月", "-")
  508. .replace("日", "")
  509. ).format("YYYY-MM-DD HH:mm:ss"),
  510. Dayjs(
  511. this.$route.query.date
  512. .replace("年", "-")
  513. .replace("月", "-")
  514. .replace("日", "")
  515. )
  516. .add(1, "day")
  517. .subtract(1, "second")
  518. .format("YYYY-MM-DD HH:mm:ss"),
  519. ];
  520. }
  521. if (!!this.$route.query.confirmStatus) {
  522. this.query.confirmStatus = this.$route.query.confirmStatus;
  523. }
  524. if (!!this.$route.query.dealStatus) {
  525. this.query.dealStatus = this.$route.query.dealStatus;
  526. }
  527. if (!!this.$route.query.level) {
  528. this.query.level = this.$route.query.level;
  529. }
  530. if (!!this.$route.query.recoveryStatus) {
  531. this.query.recoveryStatus = this.$route.query.recoveryStatus;
  532. }
  533. if (!!this.$route.query.category) {
  534. this.query.category = this.$route.query.category;
  535. }
  536. if (!!this.$route.query.departmentId) {
  537. if (typeof this.$route.query.departmentId === "string") {
  538. this.query.departmentId = new Array(this.$route.query.departmentId);
  539. }
  540. }
  541. // if (!!this.$route.query.station) {
  542. // this.query.key = this.$route.query.station;
  543. // }
  544. this.getAlarmCategory();
  545. this.getAlarmDataList();
  546. this.getDepartmentByPid();
  547. },
  548. methods: {
  549. searchData() {
  550. this.pageConfig.pageNo = 1;
  551. this.getAlarmDataList();
  552. },
  553. exportData() {
  554. const params = {
  555. pageSize: 0,
  556. pageIndex: 0,
  557. dealStatus: this.query.dealStatus,
  558. confirmStatus: this.query.confirmStatus,
  559. recoveryStatus: this.query.recoveryStatus,
  560. category: this.query.category,
  561. level: this.query.level,
  562. type: this.query.type,
  563. startTime: Dayjs(this.query.time[0]).format(),
  564. endTime: Dayjs(this.query.time[1]).format(),
  565. key: this.query.key,
  566. tag: this.query.tag,
  567. departmentId:
  568. this.query.departmentId.length > 0
  569. ? this.query.departmentId[this.query.departmentId.length - 1]
  570. : "",
  571. };
  572. exportData(params)
  573. .then((res) => {
  574. if (res.code === 20000) {
  575. download({ filePath: res.data, prefix: true })
  576. .then((result) => {
  577. downloadFile(result.data);
  578. //crud.exportLoading = false;
  579. })
  580. .catch((error) => {
  581. console.error(error);
  582. //crud.exportLoading = false;
  583. });
  584. //window.location.href = 'file/downloadFile?filePath=' + res.data + '&delete=1'
  585. } else {
  586. this.$message.error(res.msg);
  587. }
  588. })
  589. .catch((error) => {
  590. console.error(error);
  591. //crud.exportLoading = false;
  592. });
  593. },
  594. async getAlarmDataList() {
  595. try {
  596. const params = {
  597. pageSize: this.pageConfig.pageSize,
  598. pageIndex: this.pageConfig.pageNo,
  599. dealStatus: this.query.dealStatus,
  600. confirmStatus: this.query.confirmStatus,
  601. recoveryStatus: this.query.recoveryStatus,
  602. category: this.query.category,
  603. level: this.query.level,
  604. type: this.query.type,
  605. startTime: Dayjs(this.query.time[0]).format(),
  606. endTime: Dayjs(this.query.time[1]).format(),
  607. key: this.query.key,
  608. tag: this.query.tag,
  609. departmentId:
  610. this.query.departmentId.length > 0
  611. ? this.query.departmentId[this.query.departmentId.length - 1]
  612. : "",
  613. };
  614. const res = await getAlarmDataList(params);
  615. let alarmData = res.data.content;
  616. // alarmData.push({
  617. // eventTime: "2022-12-22 10:12:13",
  618. // category: "1",
  619. // content: "test",
  620. // dealStatus: "1",
  621. // imageUrl: "",
  622. // });
  623. this.tableConfig.tableData = alarmData;
  624. this.pageConfig.pageTotal = res.data.total || alarmData.length;
  625. // console.log(alarmData);
  626. } catch (err) {}
  627. },
  628. async getAlarmCount() {
  629. try {
  630. const res = await getAlarmCount();
  631. const { content } = res.data;
  632. this.categoryOptions = content;
  633. } catch (err) {
  634. console.log(err);
  635. }
  636. },
  637. async getAlarmCategory() {
  638. try {
  639. const param = { dictType: "100" };
  640. const res = await getDictDetailByType(param);
  641. const { content } = res.data;
  642. this.categoryOptions = content;
  643. } catch (err) {
  644. console.log(err);
  645. }
  646. },
  647. async getAlarmType(category) {
  648. this.query.type = "";
  649. this.alarmTypeOptions = [];
  650. if (!category) return;
  651. try {
  652. const res = await getAlarmType({ category });
  653. const { content } = res.data;
  654. this.alarmTypeOptions = content;
  655. } catch (err) {
  656. console.log(err);
  657. }
  658. },
  659. async getDepartmentByPid() {
  660. try {
  661. const p = { id: "0" };
  662. const res = await getDepartmentByPid(p);
  663. let { content } = res.data;
  664. content.forEach((element) => {
  665. element.value = element.id;
  666. element.label = element.departmentName;
  667. if (element.children) {
  668. element.children.forEach((element2) => {
  669. element2.value = element2.id;
  670. element2.label = element2.departmentName;
  671. });
  672. }
  673. });
  674. this.departmentOptions = content;
  675. } catch (err) {
  676. console.log(err);
  677. }
  678. },
  679. async dealAlarm() {
  680. const params = {
  681. id: this.curAlarmDetail.id,
  682. dealContent: this.curAlarmDetail.dealContent,
  683. dataType: this.curAlarmDetail.dataType,
  684. };
  685. try {
  686. const res = await dealAlarm(params);
  687. if (res.code == 20000) {
  688. this.hideDetail();
  689. this.getAlarmDataList();
  690. this.$message({
  691. message: "处理完成",
  692. type: "success",
  693. });
  694. }
  695. } catch (err) {
  696. console.log(err);
  697. }
  698. },
  699. async confirmAlarm() {
  700. const params = {
  701. id: this.curAlarmDetail.id,
  702. dealContent: this.curAlarmDetail.dealContent,
  703. };
  704. try {
  705. const res = await confirmAlarm(params);
  706. if (res.code == 20000) {
  707. this.hideDetail();
  708. this.getAlarmDataList();
  709. this.$message({
  710. message: "确认完成",
  711. type: "success",
  712. });
  713. }
  714. } catch (err) {
  715. console.log(err);
  716. }
  717. },
  718. handleReset() {
  719. this.query = {
  720. time: [
  721. Dayjs(new Date()).subtract(1, "month").format("YYYY-MM-DD HH:mm:ss"),
  722. Dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
  723. ],
  724. category: "",
  725. dealStatus: "",
  726. type: "",
  727. };
  728. this.searchData();
  729. },
  730. showDetail(row) {
  731. console.log(row);
  732. this.detailShow = true;
  733. this.curAlarmDetail = row;
  734. },
  735. hideDetail() {
  736. this.detailShow = false;
  737. this.curAlarmDetail = {};
  738. },
  739. handleDeal() {
  740. console.log(this.curAlarmDetail);
  741. this.dealAlarm();
  742. },
  743. handleConfirm() {
  744. console.log(this.curAlarmDetail);
  745. this.confirmAlarm();
  746. },
  747. handleClose() {
  748. this.hideDetail();
  749. },
  750. handleDealMulti() {
  751. // this.$confirm("确认退出该系统?", "提示", {
  752. // confirmButtonText: "确定",
  753. // cancelButtonText: "取消",
  754. // type: "warning",
  755. // }).then(async () => {
  756. // await logout();
  757. // localStorage.clear();
  758. // //this.$router.push("/login");
  759. // window.location.reload();
  760. // });
  761. let ids = this.tableConfig.tableData.map((obj, index) => {
  762. return obj.id;
  763. });
  764. let dialogConfig = {
  765. dialogId: "dealMultiDialog",
  766. show: true, //是否显示
  767. title: "批量处理",
  768. width: 500, //px宽度
  769. height: 320, //px高度
  770. center: true, //是否居中定位
  771. zIndex: 10,
  772. data: { ids },
  773. };
  774. this.dealMultiDialogConfig = dialogConfig;
  775. },
  776. handleConfirmMulti() {
  777. // this.$confirm("确认退出该系统?", "提示", {
  778. // confirmButtonText: "确定",
  779. // cancelButtonText: "取消",
  780. // type: "warning",
  781. // }).then(async () => {
  782. // await logout();
  783. // localStorage.clear();
  784. // //this.$router.push("/login");
  785. // window.location.reload();
  786. // });
  787. let ids = this.tableConfig.tableData.map((obj, index) => {
  788. return obj.id;
  789. });
  790. let dialogConfig = {
  791. dialogId: "confirmMultiDialog",
  792. show: true, //是否显示
  793. title: "批量确认",
  794. width: 500, //px宽度
  795. height: 320, //px高度
  796. center: true, //是否居中定位
  797. zIndex: 10,
  798. data: { ids },
  799. };
  800. this.confirmMultiDialogConfig = dialogConfig;
  801. },
  802. },
  803. };
  804. </script>
  805. <style lang="less" scoped>
  806. .alarmList-container {
  807. width: 100%;
  808. height: 100%;
  809. padding: 100px 30px 0;
  810. pointer-events: auto;
  811. box-sizing: border-box;
  812. .dialog_box {
  813. width: 100%;
  814. height: 100%;
  815. box-sizing: border-box;
  816. .search-box {
  817. width: 100%;
  818. display: flex;
  819. padding: 3px /* 10/192 */ 0;
  820. color: #fff;
  821. .search-item {
  822. display: flex;
  823. .search-label {
  824. display: inline-block;
  825. width: 100px;
  826. font-size: 14px;
  827. line-height: 28px;
  828. text-align: right;
  829. word-break: keep-all;
  830. }
  831. .search-date.el-input__inner {
  832. width: 1.666667rem /* 320/192 */;
  833. height: 28px;
  834. border-radius: 0;
  835. margin-right: 0;
  836. }
  837. .el-input {
  838. ::v-deep .el-input__inner {
  839. height: 28px;
  840. border-radius: 0;
  841. color: #fff;
  842. }
  843. }
  844. .el-select {
  845. margin-right: 0.052083rem /* 10/192 */;
  846. ::v-deep .el-input__inner {
  847. width: 0.572917rem /* 110/192 */;
  848. height: 28px;
  849. border-radius: 0;
  850. color: #fff;
  851. // padding-right: 0.182292rem /* 35/192 */;
  852. }
  853. ::v-deep .el-input__icon {
  854. line-height: 28px;
  855. }
  856. }
  857. }
  858. .search-btn {
  859. box-sizing: border-box;
  860. width: 28px;
  861. height: 28px;
  862. line-height: 28px;
  863. text-align: center;
  864. justify-content: right;
  865. color: #fff;
  866. font-size: 0.072917rem /* 14/192 */;
  867. cursor: pointer;
  868. border: 1px solid #5bd6ff;
  869. border-radius: 0;
  870. &:hover {
  871. border-color: #ccc;
  872. }
  873. img {
  874. width: 0.083333rem /* 16/192 */;
  875. height: 0.083333rem /* 16/192 */;
  876. }
  877. &:last-child {
  878. margin-left: 10px;
  879. }
  880. }
  881. .search-btn2 {
  882. box-sizing: content-box;
  883. text-align: center;
  884. justify-content: right;
  885. color: #fff;
  886. font-size: 0.072917rem /* 14/192 */;
  887. cursor: pointer;
  888. border-radius: 0;
  889. margin-left: 10px;
  890. &:hover {
  891. border-color: #ccc;
  892. }
  893. img {
  894. width: 0.083333rem /* 16/192 */;
  895. height: 0.083333rem /* 16/192 */;
  896. }
  897. }
  898. }
  899. .list-box {
  900. width: 100%;
  901. height: 100%;
  902. padding: 0 20px;
  903. box-sizing: border-box;
  904. display: flex;
  905. .table-box {
  906. width: 100%;
  907. padding: 10px;
  908. height: calc(100% - 70px);
  909. overflow-y: auto;
  910. }
  911. .detail-box {
  912. width: 400px;
  913. display: flex;
  914. padding-top: 20px;
  915. .split-line {
  916. flex-shrink: 0;
  917. width: 0.135417rem /* 26/192 */;
  918. height: 3.270833rem /* 628/192 */;
  919. cursor: pointer;
  920. }
  921. .detail-content-box {
  922. padding-left: 20px;
  923. .detail-title {
  924. height: 36px;
  925. line-height: 36px;
  926. display: flex;
  927. align-items: center;
  928. img {
  929. width: 30px;
  930. height: 30px;
  931. margin-top: 10px;
  932. }
  933. .title-text {
  934. width: 314px;
  935. margin-left: 6px;
  936. font-size: 15px;
  937. color: #cccccc;
  938. letter-spacing: 0.91px;
  939. text-shadow: 0 0 8px rgba(140, 224, 255, 0.54);
  940. font-weight: 600;
  941. border-bottom: 1px solid #6ddfff;
  942. }
  943. }
  944. .detail-content {
  945. padding-top: 10px;
  946. .detail-item {
  947. display: flex;
  948. margin: 10px 0;
  949. .detail-label {
  950. flex-shrink: 0;
  951. font-size: 14px;
  952. color: #c8efff;
  953. line-height: 24px;
  954. font-weight: 400;
  955. }
  956. .detail-text {
  957. font-size: 14px;
  958. color: #ffffff;
  959. line-height: 24px;
  960. font-weight: 400;
  961. }
  962. .image-box {
  963. display: inline-block;
  964. max-width: 0.833333rem /* 160/192 */;
  965. height: 0.46875rem /* 90/192 */;
  966. .el-image {
  967. height: 100%;
  968. }
  969. }
  970. }
  971. }
  972. .btn-box {
  973. width: 100%;
  974. height: 0.15625rem /* 30/192 */;
  975. text-align: center;
  976. margin-top: 20px;
  977. // position: absolute;
  978. // bottom: 0.15625rem /* 30/192 */;
  979. // left: 50%;
  980. // transform: translate(-50%, 0);
  981. .el-button {
  982. width: 0.40625rem /* 78/192 */;
  983. height: 0.145833rem /* 28/192 */;
  984. box-sizing: border-box;
  985. margin-top: 0.015625rem /* 3/192 */;
  986. color: #fff;
  987. padding: 0;
  988. border-color: #5bd6ff;
  989. &:hover {
  990. border-color: #ccc;
  991. }
  992. }
  993. .btn-handle.el-button {
  994. background: rgba(0, 159, 221, 0.8);
  995. }
  996. .btn-cancel.el-button {
  997. background: rgba(7, 51, 121, 0.1);
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. .page-box {
  1004. position: absolute;
  1005. bottom: 60px;
  1006. left: 50%;
  1007. transform: translateX(-50%);
  1008. }
  1009. }
  1010. }
  1011. </style>