ComprehensiveQuery.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <div class="content-main">
  3. <div class="content-body-wrap">
  4. <div class="content-body">
  5. <div class="content-main-manage">
  6. <div class="search-list">
  7. <div class="search-left">
  8. <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
  9. <FormItem label="" prop="applicationId">
  10. <Select v-model="tableParams.applicationId" placeholder="来源应用" @on-change="selectApp">
  11. <Option v-for="item in appData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
  12. </Select>
  13. </FormItem>
  14. <FormItem label="" prop="equipmentTypeId">
  15. <Select v-model="tableParams.equipmentTypeId" placeholder="设备类型">
  16. <Option v-for="item in equipTypeData" :value="item.equipmentTypeId" :key="item.equipmentTypeId">{{ item.equipmentName }}</Option>
  17. </Select>
  18. </FormItem>
  19. <FormItem label="" prop="lineId">
  20. <Select v-model="tableParams.lineId" placeholder="线路" @on-select="selectLine">
  21. <Option v-for="item in lineTypeData" :value="String(item.id)" :key="item.id">{{ item.lineName }}</Option>
  22. </Select>
  23. </FormItem>
  24. <FormItem label="" prop="stationId">
  25. <Select v-model="tableParams.stationId" placeholder="站点">
  26. <Option v-for="item in stationTypeData" :value="String(item.id)" :key="item.id">{{ item.stationName }}</Option>
  27. </Select>
  28. </FormItem>
  29. <FormItem label="" prop="alertRankId">
  30. <Select v-model="tableParams.alertRankId" placeholder="告警等级" ref="selectRank">
  31. <Option v-for="item in alarmLevelData" :value="item.id" :key="item.id">{{ item.name }}</Option>
  32. </Select>
  33. </FormItem>
  34. <FormItem label="" prop="processingStatus">
  35. <Select v-model="tableParams.processingStatus" placeholder="处理状态">
  36. <Option v-for="item in alarmStatus" :value="item.id" :key="item.id">{{ item.value }}</Option>
  37. </Select>
  38. </FormItem>
  39. <FormItem label="" prop="operationUserId">
  40. <Select v-model="tableParams.operationUserId" placeholder="处理人">
  41. <Option v-for="item in operateData" :value="item.value" :key="item.value">{{ item.name }}</Option>
  42. </Select>
  43. </FormItem>
  44. <FormItem label="">
  45. <DatePicker type="datetimerange" format="yyyy-MM-dd HH:mm:ss" :value="dateRange" placeholder="告警时间范围" class="common-date-picker date-picker-main" :clearable="false" :editable="false" @on-change="changePicker"></DatePicker>
  46. </FormItem>
  47. <FormItem label="">
  48. <DatePicker type="datetimerange" :value="dateOperateRange" format="yyyy-MM-dd HH:mm:ss" :clearable="false" :editable="false" class="common-date-picker date-picker-main" placeholder="操作时间范围" @on-change="changeOperatePicker"></DatePicker>
  49. </FormItem>
  50. <FormItem label="" prop="keywords">
  51. <Input placeholder="输入关键字查询" clearable search v-model="tableParams.keywords" />
  52. </FormItem>
  53. <FormItem label="" >
  54. <Button type="primary" class="common-btn-search" @click="searchClick">
  55. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
  56. </Button>
  57. <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
  58. <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
  59. </Button>
  60. </FormItem>
  61. </Form>
  62. </div>
  63. </div>
  64. <!-- <div class="btn-container">
  65. <span class="btn-container-download" style="opacity: 1">
  66. <i class="iconfont icon-xiazai" style="cursor:pointer;color:#0185EA;fontSize:20px;marginRight:6px"></i>下载列表筛选结果
  67. </span>
  68. <div>
  69. </div>
  70. </div> -->
  71. <div class="manage-main-center">
  72. <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading" @on-selection-change="selectChange">
  73. <template slot="loading">
  74. <Loading-animation></Loading-animation>
  75. </template>
  76. <template slot-scope="{ row }" slot="alertRankColor">
  77. <i class="iconfont icon-gaojing1" style="vertical-align: middle" :style="'color:' + row.alertRankColor" v-show="row.alertRankColor"></i>
  78. </template>
  79. </Table>
  80. </div>
  81. <div class="common-page">
  82. <div class="common-page-total">
  83. 共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
  84. </div>
  85. <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <script>
  93. export default {
  94. name: "ComprehensiveQuery",
  95. data() {
  96. return {
  97. alarmParams: {
  98. keywords: '',
  99. enabled: '',
  100. beginDate: '',
  101. endDate: '',
  102. pageNum: 1,
  103. pageSize: 10
  104. },
  105. applicationParams: {
  106. level: '',
  107. lineId: '',
  108. stationId: '',
  109. equipmentCheck: '',
  110. instrumentCheck: '',
  111. pageNum: 1,
  112. pageSize: 9999
  113. },
  114. appParams: {
  115. applicationId: '',
  116. equipmentTypeId: '',
  117. keywords: '',
  118. pageNum: 1,
  119. pageSize: 9999
  120. },
  121. loading: true,
  122. dateRange: [],
  123. dateOperateRange: [],
  124. tableParams: {
  125. processingStatus: '',
  126. operationUserId: '',
  127. keywords: '',
  128. applicationId:'',
  129. equipmentTypeId: '',
  130. lineId: '',
  131. stationId: '',
  132. alertRankId: '',
  133. beginAlertTime: '',
  134. endAlertTime: '',
  135. beginUpdateTime: '',
  136. endUpdateTime: '',
  137. alertRankEnabled: '',
  138. pageNum: 1,
  139. pageSize: 10
  140. },
  141. tableData: [],
  142. tableTotal: 0,
  143. tablePage: 0,
  144. rowObj: {},
  145. lineTypeData: [],
  146. stationTypeData: [],
  147. alarmLevelData: [],
  148. equipTypeData: [],
  149. appData: [],
  150. alarmStatus: [],
  151. operateData: [],
  152. columns: [
  153. {
  154. title: '告警等级',
  155. key: 'alertRankName',
  156. align: 'center',
  157. ellipsis: true,
  158. tooltip: true
  159. },
  160. {
  161. title: '警示颜色',
  162. slot: 'alertRankColor',
  163. align: 'center',
  164. width: 90,
  165. },
  166. {
  167. title: '告警时间',
  168. key: 'alertTime',
  169. align: 'center',
  170. ellipsis: true,
  171. tooltip: true
  172. },
  173. {
  174. title: '线路',
  175. key: 'lineName',
  176. align: 'center',
  177. ellipsis: true,
  178. tooltip: true
  179. },
  180. {
  181. title: '站点',
  182. key: 'stationName',
  183. align: 'center',
  184. ellipsis: true,
  185. tooltip: true
  186. },
  187. {
  188. title: '来源应用',
  189. key: 'appName',
  190. align: 'center',
  191. ellipsis: true,
  192. tooltip: true
  193. },
  194. {
  195. title: '设备类型',
  196. key: 'equipmentTypeName',
  197. align: 'center',
  198. ellipsis: true,
  199. tooltip: true
  200. },
  201. {
  202. title: '设备名称',
  203. key: 'equipmentName',
  204. align: 'center',
  205. ellipsis: true,
  206. tooltip: true
  207. },
  208. {
  209. title: '告警内容',
  210. key: 'alertContent',
  211. align: 'center',
  212. ellipsis: true,
  213. tooltip: true
  214. },
  215. {
  216. title: '处理状态',
  217. key: 'processingStatusDesc',
  218. align: 'center',
  219. width: 114,
  220. render:(h,params)=>{
  221. let color = params.row.processingStatusDesc == '已清除' ? '#E92E2E' : '#ffffff'
  222. return h('span', {style:{color: color}},params.row.processingStatusDesc)
  223. }
  224. },
  225. {
  226. title: '操作时间',
  227. key: 'updateTime',
  228. align: 'center',
  229. ellipsis: true,
  230. tooltip: true
  231. },
  232. {
  233. title: '操作人',
  234. key: 'operationUserName',
  235. align: 'center',
  236. ellipsis: true,
  237. tooltip: true
  238. },
  239. ],
  240. };
  241. },
  242. created () {
  243. if (this.$route.params.alertRankId) {
  244. this.tableParams.alertRankId = this.$route.params.alertRankId
  245. } else {
  246. this.tableParams.alertRankId = ''
  247. }
  248. },
  249. mounted() {
  250. this.getType()
  251. this.getTableData()
  252. },
  253. // // 离开当前路由之前的钩子函数
  254. // beforeRouteLeave(to, form, next) {
  255. // next()
  256. // },
  257. methods: {
  258. changePicker (date) {
  259. this.tableParams.beginAlertTime = date[0]
  260. this.tableParams.endAlertTime = date[1]
  261. },
  262. changeOperatePicker (date) {
  263. this.tableParams.beginUpdateTime = date[0]
  264. this.tableParams.endUpdateTime = date[1]
  265. },
  266. rowClassName(row, index) {
  267. if (index % 2 == 0) {
  268. return "ivu-table-stripe-even";
  269. } else {
  270. return "ivu-table-stripe-odd";
  271. }
  272. },
  273. // 分页
  274. changePage (val) {
  275. this.tableParams.pageNum = val
  276. this.getTableData()
  277. },
  278. //跳转
  279. sizeChange (val) {
  280. this.tableParams.pageSize = val
  281. this.getTableData()
  282. },
  283. getType () {
  284. //获取所属线路
  285. this.$get('metroapi/lineStation/queryLine', {lineName:''}).then(res=>{
  286. if (res.httpCode == 1 ){
  287. this.lineTypeData = res.data
  288. this.lineTypeData.unshift({ id: '-1', lineName: '线路' })
  289. this.getStationData ('-1')
  290. } else {
  291. this.lineTypeData = []
  292. }
  293. })
  294. // 获取归属应用
  295. this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
  296. if (res.httpCode == 1 ){
  297. this.appData = res.data.data
  298. this.appData.unshift({ id: '-1', appName: '来源应用' })
  299. } else {
  300. this.appData = []
  301. }
  302. })
  303. // 告警等级
  304. this.$get('metroapi/alert/rank/list', this.alarmParams).then(res=>{
  305. if (res.httpCode == 1 ){
  306. this.alarmLevelData = res.data.data
  307. this.alarmLevelData.unshift({ id: '-1', name: '告警等级' })
  308. this.alarmLevelData.push({ id: 0, name: '无等级' })
  309. } else {
  310. this.alarmLevelData = []
  311. }
  312. })
  313. // 告警状态
  314. this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
  315. if (res.httpCode == 1 ){
  316. this.alarmStatus = res.data
  317. this.alarmStatus.unshift({ id: '-1', value: '处理状态' })
  318. } else {
  319. this.alarmStatus = []
  320. }
  321. })
  322. // 获取处理人数据
  323. this.$get('metroapi/alert/processing/operationUser').then(res=>{
  324. if (res.httpCode == 1 ){
  325. this.operateData = res.data.data
  326. this.operateData.unshift({ value: '-1', name: '处理人' })
  327. } else {
  328. this.operateData = []
  329. }
  330. })
  331. },
  332. selectLine (val) {
  333. // 获取站点类型
  334. this.tableParams.stationId = ''
  335. this.tableParams.lineId = val.value
  336. if (this.tableParams.lineId) {
  337. this.getStationData(val.value)
  338. }
  339. },
  340. // 获取所属站点
  341. getStationData (lineId) {
  342. if(lineId == -1) {
  343. this.stationTypeData = [{ id: '-1', stationName: '站点' }]
  344. } else {
  345. this.$get('metroapi/lineStation/queryStationByLineId', {lineId:lineId}).then(res=>{
  346. if (res.httpCode == 1 ){
  347. this.stationTypeData = res.data
  348. this.stationTypeData.unshift({ id: '-1', stationName: '站点' })
  349. }
  350. })
  351. }
  352. },
  353. selectChange (selection) {
  354. this.idArr = selection.map(item => item.id)
  355. },
  356. // 获取表格数据
  357. getTableData (type) {
  358. let params = {}
  359. params = JSON.parse(JSON.stringify(this.tableParams))
  360. if (type == 'reset') { // 页面跳转重置数据 params 不会随this.tableParams里属性值变化而变化,所以采用此种方法
  361. params.alertRankId = ''
  362. }
  363. params.lineId = params.lineId == '-1' ? '':params.lineId
  364. params.stationId = params.stationId == '-1' ? '':params.stationId
  365. params.alertRankId = params.alertRankId == '-1' ? '':params.alertRankId
  366. params.applicationId = params.applicationId == '-1' ? '':params.applicationId
  367. params.equipmentTypeId = params.equipmentTypeId == '-1' ? '':params.equipmentTypeId
  368. params.processingStatus = params.processingStatus == '-1' ? '':params.processingStatus
  369. params.operationUserId = params.operationUserId == '-1' ? '':params.operationUserId
  370. this.loading = true
  371. this.$get('metroapi/alert/processing/details', params).then(res=>{
  372. this.loading = false
  373. if (res.httpCode == 1 ){
  374. this.tableData = res.data.data
  375. this.tableTotal = res.data.count
  376. if (res.data.data.length==0) {
  377. this.tablePage = 0
  378. } else {
  379. this.tablePage = res.data.count<= 10 ? 1: Math.ceil(res.data.count/this.tableParams.pageSize)
  380. }
  381. if (res.data.data.length==0 && this.tableParams.pageNum>1) {
  382. this.tableParams.pageNum--
  383. return this.getTableData()
  384. }
  385. } else {
  386. this.tableData = []
  387. this.tableTotal = 0
  388. }
  389. })
  390. },
  391. selectApp (val) {
  392. this.appParams.applicationId = val
  393. this.tableParams.equipmentTypeId = ''
  394. if (val) {
  395. this.getAddEquipType( this.appParams)
  396. }
  397. },
  398. // 获取设备类型
  399. getAddEquipType (params) {
  400. if (params.applicationId == '-1') {
  401. this.equipTypeData = [{ equipmentTypeId: '-1', equipmentName: '设备类型' }]
  402. } else {
  403. this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
  404. if (res.httpCode == 1 ){
  405. this.equipTypeData = res.data.data
  406. this.equipTypeData.unshift({ equipmentTypeId: '-1', equipmentName: '设备类型' })
  407. } else {
  408. this.equipTypeData = []
  409. }
  410. })
  411. }
  412. },
  413. searchClick () {
  414. this.tableParams.pageNum = 1
  415. this.getTableData()
  416. // this.$router.push({ path: '/MainPage/ApplicationManage', query: {deptName: "2"}})
  417. },
  418. resetClick (name) {
  419. this.dateRange = []
  420. this.tableParams.beginAlertTime = ''
  421. this.tableParams.endAlertTime = ''
  422. this.dateOperateRange = []
  423. this.tableParams.beginUpdateTime = ''
  424. this.tableParams.endUpdateTime = ''
  425. this.tableParams.alertRankId = undefined
  426. this.$refs.selectRank.reset() // 默认值,清空select值
  427. this.stationTypeData = [{ id: '-1', stationName: '站点' }]
  428. this.equipTypeData = [{ equipmentTypeId: '-1', equipmentName: '设备类型' }]
  429. this.$refs[name].resetFields()
  430. this.tableParams.pageNum = 1
  431. this.getTableData('reset')
  432. },
  433. }
  434. };
  435. </script>
  436. <style scoped lang="stylus">
  437. .content-main {
  438. width: 100%;
  439. height: calc(100% - 50px);
  440. overflow: hidden;
  441. }
  442. .content-body-wrap {
  443. width: 100%;
  444. height: 100%;
  445. background: #06214D;
  446. }
  447. .content-body {
  448. width: 100%;
  449. height: 100%;
  450. background: #06214D;
  451. padding: 10px;
  452. }
  453. .right-main {
  454. height: 100%;
  455. padding: 10px 0 0;
  456. }
  457. .content-main-manage {
  458. position: relative;
  459. height: 100%;
  460. }
  461. .search-list {
  462. display: flex;
  463. padding: 10px 0;
  464. }
  465. .search-left {
  466. display: flex;
  467. align-items: center;
  468. .ivu-select {
  469. width: 164px;
  470. padding-right: 10px;
  471. height: 32px;
  472. }
  473. .ivu-select-single .ivu-select-selection {
  474. height: 100%;
  475. }
  476. >>> .ivu-input {
  477. width: 160px;
  478. height: 32px;
  479. }
  480. >>> .common-date-picker .ivu-input {
  481. width: 332px;
  482. }
  483. >>> .ivu-input-prefix, >>> .ivu-input-suffix {
  484. height: 32px;
  485. line-height: 32px;
  486. }
  487. >>> .ivu-input-icon {
  488. height: 32px;
  489. line-height: 32px;
  490. }
  491. >>> .date-picker-main .ivu-date-picker-header {
  492. border-bottom: 0.0052083333rem solid #204384;
  493. }
  494. }
  495. .btn-container {
  496. display: flex;
  497. justify-content: space-between;
  498. padding-bottom: 10px;
  499. color: #0185EA;
  500. font-size: 14px;
  501. .btn-container-download {
  502. cursor: pointer;
  503. }
  504. .common-corrections {
  505. background: #053B4A;
  506. border: 1px solid #0098C2;
  507. color: #FFFFFF;
  508. margin-right: 5px;
  509. }
  510. .common-eliminate {
  511. background: #4C2215;
  512. border: 1px solid #8E1919;
  513. color: #FFFFFF;
  514. margin-right: 5px;
  515. }
  516. .common-confirm {
  517. background: #0C3423;
  518. border: 1px solid #08AF68;
  519. color: #FFFFFF;
  520. margin-right: 5px;
  521. }
  522. .common-forward {
  523. background: #413A09;
  524. border: 1px solid #A69311;
  525. color: #FFFFFF;
  526. }
  527. }
  528. .common-form {
  529. display: flex;
  530. flex-wrap: wrap;
  531. }
  532. >>> .common-form-list .ivu-form-item {
  533. margin-bottom: 10px;
  534. }
  535. .manage-main-center {
  536. width: 100%;
  537. height: calc(100% - 150px);
  538. }
  539. .common-table {
  540. max-height: 100%;
  541. }
  542. // >>> .common-table .ivu-table th {
  543. // height: 50px;
  544. // }
  545. // >>> .common-table .ivu-table td {
  546. // height: 50px;
  547. // }
  548. // >>> .common-table .ivu-spin-fix {
  549. // top: 50px;
  550. // }
  551. >>> .common-table .ivu-table th {
  552. height: 54px;
  553. }
  554. >>> .common-table .ivu-table td {
  555. height: 54px;
  556. }
  557. >>> .common-table .ivu-spin-fix {
  558. top: 54px;
  559. }
  560. >>> .app-table .ivu-spin-fix {
  561. height: calc(100vh - 375px);
  562. }
  563. >>> .ivu-table-tip {
  564. background: url('../../../assets/images/noData.png') no-repeat center;
  565. }
  566. >>> .app-table .ivu-table-tip {
  567. height: calc(100vh - 375px);
  568. }
  569. >>> .common-table .ivu-table-tip table {
  570. display: none;
  571. }
  572. >>> .modal-table {
  573. overflow: auto !important;
  574. }
  575. >>> .modal-table .ivu-spin-fix {
  576. height: 200px;
  577. }
  578. >>> .modal-table .ivu-table-tip {
  579. height: 200px;
  580. }
  581. .common-page {
  582. margin-top: 15px;
  583. display: flex;
  584. align-items: center;
  585. justify-content: flex-end;
  586. position: absolute;
  587. bottom: 0;
  588. right: 0;
  589. }
  590. .common-page-total {
  591. color: #fff;
  592. padding-right: 10px;
  593. font-size: 14px;
  594. span {
  595. color #409EFF;
  596. }
  597. }
  598. /deep/ .ivu-input::-webkit-input-placeholder{
  599. color: #718EBD;
  600. }
  601. /deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 19+ */
  602. color: #718EBD;
  603. }
  604. /deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
  605. color: #718EBD;
  606. }
  607. /deep/ .ivu-input::-ms-input-placeholder{ /* Internet Explorer 10-11 */
  608. color: #718EBD;
  609. }
  610. </style>