widget.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="page-panel">
  3. <div class="params-panel">
  4. <div class="head-title">显示设置</div>
  5. <el-form ref="form" :model="form" label-width="auto" size="small">
  6. <el-form-item label="管点选择">
  7. <el-select v-model="form.siteId" filterable placeholder="选择站点" style="width:158px">
  8. <el-option v-for="(item,index) in siteOption" :key="index" :label="item.siteName" :value="item.id"></el-option>
  9. </el-select>
  10. <el-button type="warning">图上选择</el-button>
  11. </el-form-item>
  12. <el-form-item label="追踪距离">
  13. <el-input-number v-model="form.num" controls-position="right" :min="1" :max="10000" style="width:158px"></el-input-number>
  14. <el-checkbox v-model="form.checked">不限距离</el-checkbox>
  15. </el-form-item>
  16. <el-form-item label="追踪方式">
  17. <el-checkbox v-model="form.checked">上游追踪</el-checkbox>
  18. <el-checkbox v-model="form.checked">下游追踪</el-checkbox>
  19. </el-form-item>
  20. <el-form-item label-width="0">
  21. <el-button type="primary" style="width:100%">分析</el-button>
  22. </el-form-item>
  23. </el-form>
  24. </div>
  25. <!-- 结果 -->
  26. <div class="result-box">
  27. <div class="head-title">分析结果概览</div>
  28. <div class="res-items">
  29. <div class="res-item">
  30. <span>连通管线</span>
  31. <span>100.89m</span>
  32. </div>
  33. <div class="res-item">
  34. <span>连通排水设施</span>
  35. <span>43个</span>
  36. </div>
  37. <div class="res-item">
  38. <span>连通监测设备</span>
  39. <span>9个</span>
  40. </div>
  41. </div>
  42. <div class="head-title">管线</div>
  43. <div class="chart-box" id="pipeChart">
  44. </div>
  45. <div class="head-title">排水设施</div>
  46. <div class="chart-box" id="facilityChart">
  47. </div>
  48. <div class="head-title">
  49. <span>监测设备</span>
  50. <span type="text" class="link-btn" @click="monitorView()">监测查看</span>
  51. </div>
  52. <el-table :data="tableData" style="width: 100%" :header-cell-style="{ background: 'rgba(45, 116, 231,0.2)',
  53. color: '#333333', height: '40px', textAlign: 'center' }" height="200px">
  54. <template slot="empty">
  55. <img src="@/assets/icon/null.png" alt="暂无数据" style="width:100px" />
  56. </template>
  57. <el-table-column label="序号" align="center">
  58. <template slot-scope="scope">{{scope.$index+1}}</template>
  59. </el-table-column>
  60. <el-table-column prop="name" label="监测点名称" align="center"></el-table-column>
  61. <el-table-column prop="address" label="设备类型" align="center"></el-table-column>
  62. </el-table>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import historyCurve from '@/views/spectrum/common/historyCurve/index'
  68. import * as echarts from 'echarts'
  69. export default {
  70. components: {
  71. historyCurve
  72. },
  73. data() {
  74. return {
  75. form: {
  76. num: 200
  77. }
  78. }
  79. },
  80. created() {},
  81. mounted() {
  82. this.loadPipeLineChart()
  83. this.loadFacilityChart()
  84. },
  85. destroyed() {},
  86. methods: {
  87. loadPipeLineChart() {
  88. let chartDom = document.getElementById('pipeChart')
  89. let myChart = echarts.init(chartDom)
  90. let option = {
  91. tooltip: {
  92. trigger: 'item'
  93. },
  94. legend: {
  95. orient: 'horizontal',
  96. left: 'center',
  97. itemWidth: 10,
  98. itemHeight: 10,
  99. icon: 'circle',
  100. bottom: 2,
  101. textStyle: {
  102. color: '#959595',
  103. fontSize: 11,
  104. fontWeight: '500'
  105. }
  106. },
  107. series: [
  108. {
  109. name: '管线',
  110. type: 'pie',
  111. radius: '55%',
  112. itemStyle: {
  113. borderColor: '#fff',
  114. normal: {
  115. color: function (colors) {
  116. var colorList = ['#4ecb73', '#3aa1ff', '#36cbcb', '#ebb563', '#e97a20', '#237cc0']
  117. return colorList[colors.dataIndex]
  118. },
  119. label: {
  120. show: true,
  121. formatter: '{b}:{d}%'
  122. }
  123. }
  124. },
  125. center: ['50%', '40%'],
  126. data: [
  127. { value: 1048, name: '雨水' },
  128. { value: 580, name: '污水' },
  129. { value: 735, name: '雨污合流' }
  130. ]
  131. }
  132. ]
  133. }
  134. option && myChart.setOption(option)
  135. },
  136. loadFacilityChart() {
  137. let chartDom = document.getElementById('facilityChart')
  138. let myChart = echarts.init(chartDom)
  139. let option = {
  140. tooltip: {
  141. trigger: 'axis',
  142. axisPointer: {
  143. type: 'shadow'
  144. }
  145. },
  146. grid: {
  147. top: '8%',
  148. left: '3%',
  149. right: '4%',
  150. bottom: '3%',
  151. containLabel: true
  152. },
  153. xAxis: [
  154. {
  155. type: 'category',
  156. data: ['阀门', '排放口', '污水厂入口', '污水厂出口', '泵站'],
  157. axisTick: {
  158. alignWithLabel: true
  159. }
  160. }
  161. ],
  162. yAxis: [
  163. {
  164. type: 'value'
  165. }
  166. ],
  167. series: [
  168. {
  169. name: '排水设施',
  170. type: 'bar',
  171. barWidth: '60%',
  172. data: [90, 160, 200, 334, 390, 330, 220],
  173. itemStyle: {
  174. color: '#3aa1ff'
  175. }
  176. }
  177. ]
  178. }
  179. option && myChart.setOption(option)
  180. },
  181. /**
  182. * 监测查看
  183. */
  184. monitorView() {
  185. const data = {
  186. pathId: '/spectrum/reform/monitorView',
  187. widgetid: 'FullPanel',
  188. label: '监测查看',
  189. param: {}
  190. }
  191. this.$store.dispatch('map/handelClose', data)
  192. this.$store.dispatch('map/changeMethod', data)
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss" scoped>
  198. @import './css.scss';
  199. </style>