widget.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <div class="page-panel">
  3. <div class="left-panel">
  4. <mini-map layerControl projectList partsCheck>
  5. <template slot="topBar">
  6. <div @click="viewCurve()">监测查看</div>
  7. <thematic-map></thematic-map>
  8. </template>
  9. </mini-map>
  10. <transition name="el-zoom-in-bottom">
  11. <moniter-see ref="moniterSee" v-show="moniterVisible" @close="moniterClose()"></moniter-see>
  12. </transition>
  13. </div>
  14. <div class="right-panel">
  15. <div class="head-title">评估结果</div>
  16. <div class="chart-panel">
  17. <div class="chart-box" style="padding:0 20px 0 10px;">
  18. <div style="width:100%;height:100%;background-color:#f9f9f9;overflow:hidden;padding:10px">
  19. <p style="margin:10px 0;color:#2d74e7;margin-top:50px">污水直排:</p>
  20. <p style="margin:10px 0;color:#3f3f3f">雨水管网共布设{{allCount}}个监测点位,其中{{wsCount}}个监测点位发现污水直排隐患</p>
  21. </div>
  22. </div>
  23. <div class="chart-box" style="padding-left:20px" ref="chart1"></div>
  24. </div>
  25. <div class="middle-box">
  26. <div class="head-title">
  27. <span>监测点</span>
  28. <span style="float: right;">
  29. <el-checkbox v-model="form.checked">发现污水直排监测点(2)</el-checkbox>
  30. <el-checkbox v-model="form.checked">其他相关监测点(5)</el-checkbox>
  31. </span>
  32. </div>
  33. <el-table :data="tableData1" style="width: 100%" stripe :header-cell-style="{ background: 'rgba(45, 116, 231,0.2)',
  34. color: '#333333', height: '40px', textAlign: 'center' }" height="200px">
  35. <template slot="empty">
  36. <img src="@/assets/icon/null.png" alt="暂无数据" style="width:100px" />
  37. </template>
  38. <el-table-column label="序号" align="center">
  39. <template slot-scope="scope">{{scope.$index+1}}</template>
  40. </el-table-column>
  41. <el-table-column prop="name1" label="监测类型" align="center"></el-table-column>
  42. <el-table-column prop="name2" label="监测点" align="center"></el-table-column>
  43. <el-table-column prop="name3" label="上游监测点" align="center"></el-table-column>
  44. <el-table-column prop="name4" label="关联检查井" align="center"></el-table-column>
  45. <el-table-column prop="name5" label="发现管网破损" align="center"></el-table-column>
  46. <el-table-column prop="name6" label="发现雨污混接" align="center"></el-table-column>
  47. <el-table-column prop="name7" label="关联管网" align="center">
  48. <template slot-scope="{row}">
  49. <el-button type="text" style="padding:0">{{row.name7}}</el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. </div>
  54. <div class="bottom-box">
  55. <div class="head-title line">监测点告警情况</div>
  56. <el-form ref="form" :model="form" :inline="true" label-width="auto" size="small" style="margin:10px 0">
  57. <el-form-item label="监测点" label-width="60px" style="margin:0">
  58. <el-select v-model="form.site" placeholder="请选择">
  59. <el-option v-for="(item,index) in []" :key="index" :label="item" :value="item"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="指标" label-width="40px" style="margin:0">
  63. <el-select v-model="form.site" placeholder="请选择">
  64. <el-option v-for="(item,index) in []" :key="index" :label="item" :value="item"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="日期范围" style="margin:0">
  68. <el-date-picker v-model="form.value1" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" style="width:280px">
  69. </el-date-picker>
  70. </el-form-item>
  71. <el-form-item label-width="20px" style="margin:0">
  72. <el-button type="primary">查询</el-button>
  73. </el-form-item>
  74. </el-form>
  75. <el-table :data="tableData3" style="width: 100%" :header-cell-style="{ background: 'rgba(45, 116, 231,0.2)',
  76. color: '#333333', height: '40px', textAlign: 'center' }" height="calc(100% - 51px)">
  77. <template slot="empty">
  78. <img src="@/assets/icon/null.png" alt="暂无数据" style="width:100px;" />
  79. </template>
  80. <el-table-column label="序号" align="center">
  81. <template slot-scope="scope">{{scope.$index+1}}</template>
  82. </el-table-column>
  83. <el-table-column prop="monitorDate" label="监测日期" align="center"></el-table-column>
  84. <el-table-column prop="siteName" label="监测点" align="center"></el-table-column>
  85. <el-table-column prop="dailyRainfall" label="日降雨量" align="center"></el-table-column>
  86. <el-table-column prop="warningCause" label="告警原因" align="center"></el-table-column>
  87. <el-table-column label="监测曲线" align="center">
  88. <template slot-scope="{row}">
  89. <el-button type="text" style="padding:0" @click="viewCurve(row)">查看</el-button>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <div class="pagination" style="padding-top:10px">
  94. <el-pagination :current-page="pagination.current" :page-sizes="[100, 200, 300, 400]" :page-size="pagination.size" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total">
  95. </el-pagination>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import miniMap from '@/views/widgets/miniMap/index.vue'
  103. import moniterSee from '@/views/spectrum/reform/monitorSee/index.vue'
  104. import thematicMap from '@/views/widgets/thematicMap/index.vue'
  105. import * as echarts from 'echarts'
  106. import { getReportCondision, getHiddenDangerCount, getWarningPage } from '@/views/spectrum/reform/api/api'
  107. export default {
  108. components: {
  109. miniMap,
  110. moniterSee,
  111. thematicMap
  112. },
  113. data() {
  114. return {
  115. form: {},
  116. tableData: [],
  117. tableData1: [],
  118. tableData2: [],
  119. tableData3: [],
  120. activeName: 'first',
  121. moniterVisible: false,
  122. allCount: 0,
  123. wsCount: 0,
  124. pagination: { current: 1, size: 100, total: 0 }
  125. }
  126. },
  127. mounted() {
  128. // for (let index = 0; index < 10; index++) {
  129. // this.tableData1.push({
  130. // name1: '管网水质检测仪',
  131. // name2: '青羊区6号',
  132. // name3: '青年之南',
  133. // name4: '污水W01',
  134. // name5: '2022-6-18',
  135. // name6: '2022-6-19',
  136. // name7: '10个 1593km'
  137. // })
  138. // this.tableData2.push({
  139. // address1: '立即处理',
  140. // address2: '雨水',
  141. // address3: '主干管网',
  142. // address4: '2563km',
  143. // address5: '5563km',
  144. // address6: '63km'
  145. // })
  146. // this.tableData3.push({
  147. // address1: '2022-3-12',
  148. // address2: '青羊区6号',
  149. // address3: '0.418mm',
  150. // address4: '警告原因内容'
  151. // })
  152. // }
  153. this.getHiddenDangerCount()
  154. this.getWarningPage()
  155. this.loadChart()
  156. },
  157. methods: {
  158. /**
  159. * 按管网评估情况统计
  160. */
  161. loadChart() {
  162. let chartDom = this.$refs.chart1
  163. let myChart = echarts.init(chartDom)
  164. getReportCondision().then((res) => {
  165. let result = res.result
  166. let option = {
  167. tooltip: {
  168. trigger: 'item'
  169. },
  170. color: ['#15d0ea', '#f6b638'],
  171. series: [
  172. {
  173. name: '管网评估情况',
  174. type: 'pie',
  175. radius: '80%',
  176. data: result,
  177. label: {
  178. formatter: '{b}\n{d}%',
  179. fontSize: 14,
  180. fontWeight: 500
  181. },
  182. emphasis: {
  183. itemStyle: {
  184. shadowBlur: 10,
  185. shadowOffsetX: 0,
  186. shadowColor: 'rgba(0, 0, 0, 0.5)'
  187. }
  188. }
  189. }
  190. ]
  191. }
  192. myChart.clear()
  193. option && myChart.setOption(option)
  194. })
  195. },
  196. /**
  197. * 隐患统计信息
  198. */
  199. getHiddenDangerCount() {
  200. getHiddenDangerCount({ hiddenDangerType: 3 }).then((res) => {
  201. this.allCount = res.result.allCount
  202. this.wsCount = res.result.wsCount
  203. })
  204. },
  205. /**
  206. *监测点告警情况分页查询
  207. */
  208. getWarningPage() {
  209. let params = JSON.parse(JSON.stringify(this.pagination))
  210. getWarningPage(params).then((res) => {
  211. if (res.code == 1) {
  212. console.log('res', res)
  213. this.tableData3 = res.result.records
  214. this.pagination.total = res.result.total
  215. }
  216. })
  217. },
  218. viewCurve(row = null) {
  219. this.moniterVisible = true
  220. if (row) {
  221. this.$refs.moniterSee.open()
  222. }
  223. },
  224. moniterClose() {
  225. this.moniterVisible = false
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. @import './style.scss';
  232. </style>