ModeInfo.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="mode-info-module">
  3. <common-title title="系统模式信息"></common-title>
  4. <div class="visualization-common-border box">
  5. <div>
  6. <div class="itemHead">温度</div>
  7. <div class="item">
  8. <div id="demo1">温度:{{template}}</div>
  9. <div>输出:{{outputT}}</div>
  10. </div>
  11. <div class="item">
  12. <div id="demo1">升温
  13. <div class="img" v-if="startT == 0"></div>
  14. </div>
  15. <div>降温
  16. <div class="img2" v-if="startT == 1"></div>
  17. </div>
  18. </div>
  19. <div class="item">
  20. <!-- <div id="demo1">温度设定:(123)℃</div> -->
  21. <div id="demo1">目标温度:{{targetT}}℃</div>
  22. <div>斜率设定:{{slopeT}}℃/min</div>
  23. </div>
  24. <div class="item">
  25. <div id="demo1">起始温度:{{startT}}℃</div>
  26. <!-- <div>目标温度:(123)℃</div> -->
  27. </div>
  28. <div class="itemHead">辐照</div>
  29. <div class="item">
  30. <div id="demo1">辐照强度:0W/㎡</div>
  31. <div>吹风</div>
  32. </div>
  33. <div class="item">
  34. <div id="demo1">时间 0min</div>
  35. <div>辐照强度设定:0W/㎡</div>
  36. </div>
  37. </div>
  38. <div>
  39. <div class="itemHead">湿度</div>
  40. <div class="item">
  41. <div id="demo1">湿度:{{humidity}}%</div>
  42. <div>输出:{{outputH}}%</div>
  43. </div>
  44. <div class="item">
  45. <div id="demo1">加湿
  46. <div class="img" v-if="startH === 0"></div>
  47. </div>
  48. <div>除湿
  49. <div class="img2" v-if="startH === 1"></div>
  50. </div>
  51. </div>
  52. <div class="item">
  53. <!-- <div>湿度设定:(123)%/min</div> -->
  54. <div>目标湿度:{{targetH}}%R.H</div>
  55. </div>
  56. <div class="item">
  57. <div id="demo1">起始湿度:{{startH}}%R.H</div>
  58. <!-- <div>目标湿度:(123)%</div> -->
  59. </div>
  60. <div class="itemHead">淋雨</div>
  61. <div class="item">
  62. <div id="demo1">中雨</div>
  63. <div>暴雨</div>
  64. </div>
  65. <div class="item">
  66. <div id="demo1">时间 0min</div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import commonTitle from '../components/commonTitle.vue'
  74. export default {
  75. components: { commonTitle },
  76. name: '',
  77. props: {
  78. data: {
  79. type: Array,
  80. default: []
  81. }
  82. },
  83. data () {
  84. return {
  85. // 获取数据(总)
  86. dataList: [],
  87. // 温度
  88. template: '',
  89. // 温度输出
  90. outputT: '',
  91. // 升温/降温(0升温,1降温)
  92. statusT: '',
  93. // 目标温度
  94. targetT: '',
  95. // 斜率设定(温度)
  96. slopeT: '',
  97. // 起始温度
  98. startT: '',
  99. // 辐照强度
  100. // 吹风
  101. // 时间
  102. // 辐照强度设定
  103. // 湿度
  104. humidity: '',
  105. // 湿度输出
  106. outputH: '',
  107. // 加湿/除湿(0加湿,1除湿)
  108. statusH: '',
  109. // 目标湿度
  110. targetH: '',
  111. // 起始湿度
  112. startH: '',
  113. }
  114. },
  115. watch: {
  116. data: {
  117. handler(newValue, oldValue){
  118. console.log(77,newValue, oldValue)
  119. this.dataList = newValue
  120. this.getList()
  121. },
  122. immediate: true,
  123. deep: true
  124. }
  125. },
  126. created () {
  127. },
  128. mounted () {
  129. },
  130. methods: {
  131. getList(){
  132. // console.log(this.dataList)
  133. for (var i = 0; i < this.dataList.length; i++) {
  134. console.log(i,this.dataList[i].Name)
  135. // 温度
  136. if (this.dataList[i].Name == '当前温度值') {
  137. this.template = this.dataList[i].Value
  138. }
  139. if (this.dataList[i].Name == '温度输出率') {
  140. this.outputT = this.dataList[i].Value
  141. console.log(77777,this.outputT)
  142. if (this.outputT >0 && this.outputT <100) {
  143. this.statusT = 0
  144. }
  145. if (this.outputT >-100 && this.outputT <0) {
  146. this.statusT = 1
  147. }
  148. console.log(235,this.statusT)
  149. }
  150. if (this.dataList[i].Name == '温度设定值') {
  151. this.targetT = this.dataList[i].Value
  152. }
  153. if (this.dataList[i].Name == '斜率设定') {
  154. this.slopeT = this.dataList[i].Value
  155. }
  156. if (this.dataList[i].Name == '起始温度值') {
  157. this.startT = this.dataList[i].Value
  158. }
  159. // 辐照
  160. // 湿度
  161. if (this.dataList[i].Name == '当前湿度值') {
  162. this.humidity = this.dataList[i].Value
  163. }
  164. if (this.dataList[i].Name == '湿度输出率') {
  165. this.outputH = this.dataList[i].Value
  166. }
  167. if (this.dataList[i].Name == '湿度设定值') {
  168. this.targetH = this.dataList[i].Value
  169. }
  170. if (this.dataList[i].Name == '起始湿度值') {
  171. this.startH = this.dataList[i].Value
  172. }
  173. }
  174. }
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. @import '~@/assets/less/uStyle.less';
  180. </style>
  181. <style lang="less" scoped>
  182. .mode-info-module{
  183. width: 100%;
  184. height: 100%;
  185. }
  186. .box {
  187. // border: 1px solid rgb(255, 255, 255);
  188. display: flex;
  189. /* row (默认值) : 主轴为水平万向,起点在左端。*/
  190. flex-direction: row;
  191. }
  192. .box>div{
  193. width: 50%;
  194. height: 89%;
  195. margin: 3%;
  196. // border: 1px solid rgb(255, 255, 255);
  197. // background-color: yellowgreen;
  198. // border: 1px solid red;
  199. }
  200. .itemHead{
  201. width: 100%;
  202. height: 10%;
  203. // border: 1px solid rgb(255, 255, 255);
  204. margin-bottom: 2.5%;
  205. background-color: #094F8D;
  206. color: #0CB8FE;
  207. padding-left: 3%;
  208. border-radius: 2px;
  209. display: flex;
  210. align-items: center;
  211. }
  212. .item{
  213. width: 100%;
  214. height: 10%;
  215. // border: 1px solid rgb(255, 255, 255);
  216. margin-bottom: 2.5%;
  217. background-color: #072A54;
  218. color: #FEFFFE;
  219. padding-left: 3%;
  220. border-radius: 2px;
  221. display: flex;
  222. flex-direction: row;
  223. }
  224. .item>div{
  225. width: 50%;
  226. height: 100%;
  227. font-size: 10px;
  228. // border: 1px solid rgb(255, 255, 255);
  229. display: flex;
  230. align-items: center;
  231. }
  232. .item>div#demo1{
  233. width: 46%;
  234. height: 100%;
  235. font-size: 10px;
  236. // border: 1px solid rgb(255, 255, 255);
  237. display: flex;
  238. align-items: center;
  239. }
  240. .item>div{
  241. width: 52%;
  242. height: 100%;
  243. font-size: 10px;
  244. // border: 1px solid rgb(255, 255, 255);
  245. display: flex;
  246. align-items: center;
  247. }
  248. .img{
  249. width: 50%;
  250. height: 80%;
  251. margin-left: 10%;
  252. background: url(~@/assets/visualization/taiyang.png) no-repeat;
  253. background-size: contain;
  254. }
  255. .img2{
  256. width: 50%;
  257. height: 80%;
  258. margin-left: 10%;
  259. // border: 1px solid rgb(255, 255, 255);
  260. background: url(~@/assets/visualization/lvtaiyang.png) no-repeat;
  261. background-size: contain;
  262. }
  263. </style>