PileHoleDetail.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="screen-dialog">
  3. <div class="dialog-header">
  4. {{ $t('screen.pileHoleIndex') }}
  5. <i class="el-icon-close" @click="closeDialog" style="margin-left: auto;cursor: pointer"/>
  6. </div>
  7. <div class="dialog-content">
  8. <el-descriptions :column="2" :colon="false">
  9. <el-descriptions-item :label="$t('screen.pileNumber')">
  10. {{
  11. realtimeIndex.holeNum
  12. }}
  13. </el-descriptions-item>
  14. <el-descriptions-item :label="$t('screen.consStatus')">
  15. <dict-tag size="small" :options="dict.type.pile_hole_status" :value="realtimeIndex.consStatus"/>
  16. </el-descriptions-item>
  17. <el-descriptions-item :label="$t('screen.machineNum')">
  18. {{
  19. realtimeIndex.pileMachineInfo && realtimeIndex.pileMachineInfo.machineNum
  20. }}
  21. </el-descriptions-item>
  22. <el-descriptions-item :label="`${$t('screen.finalVerticalDeviation')} (%)`">
  23. {{ realtimeIndex.verticalDeviation }}
  24. </el-descriptions-item>
  25. <el-descriptions-item :label="`${$t('screen.desDepth')} (m)`">40</el-descriptions-item>
  26. <el-descriptions-item :label="`${$t('screen.actualDepth')} (m)`">
  27. {{
  28. realtimeIndex.depth
  29. }}
  30. </el-descriptions-item>
  31. <el-descriptions-item :label="`${$t('screen.pullValue')} (m)`">
  32. {{
  33. realtimeIndex.sprayVolume
  34. }}
  35. </el-descriptions-item>
  36. <el-descriptions-item :label="$t('screen.pressure')">
  37. {{
  38. realtimeIndex.sprayPressure
  39. }}
  40. </el-descriptions-item>
  41. <el-descriptions-item :label="`${$t('screen.pushValue')} (m)`">
  42. {{
  43. realtimeIndex.sendSprayVolume
  44. }}
  45. </el-descriptions-item>
  46. <el-descriptions-item :colon="false">
  47. </el-descriptions-item>
  48. <el-descriptions-item :label="$t('screen.consStartTime')">
  49. {{
  50. realtimeIndex.indexStartTime || '--'
  51. }}
  52. </el-descriptions-item>
  53. <el-descriptions-item :label="$t('screen.consEndTime')">
  54. {{
  55. realtimeIndex.indexEndTime || '--'
  56. }}
  57. </el-descriptions-item>
  58. </el-descriptions>
  59. <div class="machine-realtime-container">
  60. <div class="realtime-title">
  61. {{ $t('screen.indexLine') }}
  62. </div>
  63. <div class="realtime-chart">
  64. <line-chart-block v-if="loaded" :optCfg="lineOpt"/>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. import LineChartBlock from "@/components/charts/LineChartBlock.vue";
  72. import {listPileHoleHisIndex, pileHoleRealtimeIndex} from "@/api/cons/pileHoleInfo";
  73. export default {
  74. components: {LineChartBlock},
  75. props: {
  76. propData: {
  77. type: Object,
  78. default: () => {
  79. return {};
  80. },
  81. },
  82. close: {
  83. type: Function,
  84. default: () => {
  85. }
  86. },
  87. },
  88. dicts: ['pile_hole_status'],
  89. data() {
  90. return {
  91. loaded: false,
  92. realtimeIndex: {},
  93. timer: null,
  94. lineOpt: {
  95. tooltip: {
  96. trigger: 'axis',
  97. axisPointer: {
  98. type: 'cross',
  99. animation: false,
  100. label: {
  101. backgroundColor: '#505765'
  102. }
  103. }
  104. },
  105. legend: {
  106. data: ['Current', 'Rainfall'],
  107. left: '0',
  108. textStyle: {
  109. color: '#fefefe'
  110. }
  111. },
  112. xAxis: [
  113. {
  114. type: 'category',
  115. boundaryGap: false,
  116. axisLine: {onZero: false},
  117. axisLabel: {
  118. color: '#fefefe'
  119. },
  120. data: [].map(function (str) {
  121. return str.replace(' ', '\n');
  122. })
  123. }
  124. ],
  125. yAxis: [
  126. {
  127. name: 'Current(A)',
  128. type: 'value',
  129. splitLine: false,
  130. nameTextStyle: {
  131. color: '#fefefe'
  132. },
  133. axisLabel: {
  134. color: '#fefefe'
  135. }
  136. },
  137. {
  138. name: 'Pressure(kPa)',
  139. type: 'value',
  140. splitLine: false,
  141. nameTextStyle: {
  142. color: '#fefefe'
  143. },
  144. axisLabel: {
  145. color: '#fefefe'
  146. }
  147. }
  148. ],
  149. series: []
  150. }
  151. };
  152. },
  153. created() {
  154. this.showDialog(this.propData)
  155. this.timer = setInterval(() => {
  156. this.loaded = false
  157. this.showDialog(this.propData)
  158. }, 1000 * 30)
  159. },
  160. beforeDestroy() {
  161. this.timer && clearInterval(this.timer)
  162. },
  163. methods: {
  164. showDialog(pileHolleInfo) {
  165. pileHoleRealtimeIndex(pileHolleInfo.id).then(response => {
  166. this.realtimeIndex = response.data
  167. })
  168. listPileHoleHisIndex({
  169. id: pileHolleInfo.id,
  170. }).then(response => {
  171. if (response.data && response.data.length > 0) {
  172. const {data} = response
  173. const current = {
  174. name: 'Current',
  175. type: 'line',
  176. smooth: true,
  177. emphasis: {
  178. focus: 'series'
  179. },
  180. data: []
  181. }
  182. const prassure = {
  183. name: 'Injection pressure',
  184. type: 'line',
  185. smooth: true,
  186. yAxisIndex: 1,
  187. emphasis: {
  188. focus: 'series'
  189. },
  190. data: []
  191. }
  192. const dateTime = []
  193. data.forEach(item => {
  194. const {current: elecCurrent, sprayPressure, recordTime} = item
  195. current.data.push(elecCurrent)
  196. prassure.data.push(sprayPressure)
  197. dateTime.push(recordTime)
  198. })
  199. this.lineOpt.xAxis[0].data = dateTime.map(function (str) {
  200. return str.replace(' ', '\n');
  201. })
  202. this.lineOpt.series = [current, prassure]
  203. this.loaded = true
  204. }
  205. })
  206. },
  207. closeDialog() {
  208. this.loaded = false
  209. this.close()
  210. },
  211. },
  212. };
  213. </script>
  214. <style lang="scss" src="./index.scss" scoped/>
  215. <style lang="scss">
  216. .maptalks-close {
  217. display: none;
  218. }
  219. </style>