ModeInfo.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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="statusT == 0"></div>
  14. </div>
  15. <div>降温
  16. <div class="img2" v-if="statusT == 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">辐照强度:{{irradiation}}W/㎡</div>
  31. <div>吹风</div>
  32. </div>
  33. <div class="item">
  34. <div id="demo1">时间 0min</div>
  35. <div>辐照强度设定:{{ targetF }}W/㎡</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="statusH === 0"></div>
  47. </div>
  48. <div>除湿
  49. <div class="img2" v-if="statusH === 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: function(){
  81. return [] // 使用工厂函数返回默认值
  82. }
  83. }
  84. },
  85. data () {
  86. return {
  87. // 获取数据(总)
  88. dataList: [],
  89. // 温度
  90. template: '',
  91. // 温度输出
  92. outputT: '',
  93. // 升温/降温(0升温,1降温,3啥也不是)
  94. statusT: 1,
  95. // 目标温度
  96. targetT: '',
  97. // 斜率设定(温度)
  98. slopeT: '',
  99. // 起始温度
  100. startT: '',
  101. // 辐照强度
  102. irradiation: '0',
  103. // 吹风
  104. // 时间
  105. // 辐照强度设定
  106. targetF: '0',
  107. // 辐射强度起始
  108. startF: '',
  109. // 湿度
  110. humidity: '',
  111. // 湿度输出
  112. outputH: '',
  113. // 加湿/除湿(0加湿,1除湿,3啥也不是)
  114. statusH: 1,
  115. // 目标湿度
  116. targetH: '',
  117. // 起始湿度
  118. startH: '',
  119. }
  120. },
  121. watch: {
  122. data: {
  123. handler(newValue, oldValue){
  124. // console.log(77,newValue, oldValue)
  125. this.dataList = newValue
  126. this.getList()
  127. },
  128. immediate: true,
  129. deep: true
  130. }
  131. },
  132. created () {
  133. },
  134. mounted () {
  135. },
  136. methods: {
  137. getList(){
  138. // console.log(this.dataList)
  139. for (var i = 0; i < this.dataList.length; i++) {
  140. // console.log(i,this.dataList[i].Name)
  141. // 温度
  142. if (this.dataList[i].Name == '当前温度值') {
  143. this.template = this.dataList[i].Value
  144. }
  145. if (this.dataList[i].Name == '温度输出率') {
  146. this.outputT = (this.dataList[i].Value * 100).toFixed(0)
  147. // if (this.outputT >0 && this.outputT <100) {
  148. // this.statusT = 0
  149. // }
  150. // if (this.outputT >-100 && this.outputT <0) {
  151. // this.statusT = 1
  152. // }else{
  153. // this.statusT = 3
  154. // }
  155. }
  156. if (this.dataList[i].Name == '升温') {
  157. if (this.dataList[i].Value == 1) {
  158. this.statusT = 0
  159. }else{
  160. this.statusT = 1
  161. }
  162. }
  163. if (this.dataList[i].Name == '温度设定值') {
  164. this.targetT = this.dataList[i].Value
  165. }
  166. if (this.dataList[i].Name == '定值温度斜率值') {
  167. this.slopeT = this.dataList[i].Value
  168. }
  169. if (this.dataList[i].Name == '起始温度值') {
  170. this.startT = this.dataList[i].Value
  171. }
  172. // 辐照
  173. // 湿度
  174. if (this.dataList[i].Name == '当前湿度值') {
  175. this.humidity = this.dataList[i].Value
  176. }
  177. if (this.dataList[i].Name == '湿度输出率') {
  178. this.outputH = (this.dataList[i].Value * 100).toFixed(0)
  179. // if (this.outputH >0 && this.outputH <100) {
  180. // this.statusH = 0
  181. // }
  182. // if (this.outputH >-100 && this.outputH <0) {
  183. // this.statusH = 1
  184. // }else{
  185. // this.statusH = 3
  186. // }
  187. }
  188. if (this.dataList[i].Name == '加湿') {
  189. if (this.dataList[i].Value == 1) {
  190. this.statusH = 0
  191. }else{
  192. this.statusH = 1
  193. }
  194. }
  195. if (this.dataList[i].Name == '湿度设定值') {
  196. this.targetH = this.dataList[i].Value
  197. }
  198. if (this.dataList[i].Name == '起始湿度值') {
  199. this.startH = this.dataList[i].Value
  200. }
  201. }
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped>
  207. @import '~@/assets/less/uStyle.less';
  208. </style>
  209. <style lang="less" scoped>
  210. .mode-info-module{
  211. width: 100%;
  212. height: 100%;
  213. }
  214. .box {
  215. // border: 1px solid rgb(255, 255, 255);
  216. display: flex;
  217. /* row (默认值) : 主轴为水平万向,起点在左端。*/
  218. flex-direction: row;
  219. }
  220. .box>div{
  221. width: 50%;
  222. height: 89%;
  223. margin: 3%;
  224. // border: 1px solid rgb(255, 255, 255);
  225. // background-color: yellowgreen;
  226. // border: 1px solid red;
  227. }
  228. .itemHead{
  229. width: 100%;
  230. height: 10%;
  231. // border: 1px solid rgb(255, 255, 255);
  232. margin-bottom: 2.5%;
  233. background-color: #094F8D;
  234. color: #0CB8FE;
  235. padding-left: 3%;
  236. border-radius: 2px;
  237. display: flex;
  238. align-items: center;
  239. font-size: 14px;
  240. }
  241. .item{
  242. width: 100%;
  243. height: 10%;
  244. // border: 1px solid rgb(255, 255, 255);
  245. margin-bottom: 2.5%;
  246. background-color: #072A54;
  247. color: #FEFFFE;
  248. padding-left: 3%;
  249. border-radius: 2px;
  250. display: flex;
  251. flex-direction: row;
  252. }
  253. .item>div{
  254. width: 50%;
  255. height: 100%;
  256. font-size: 10px;
  257. // border: 1px solid rgb(255, 255, 255);
  258. display: flex;
  259. align-items: center;
  260. }
  261. .item>div#demo1{
  262. width: 46%;
  263. height: 100%;
  264. font-size: 10px;
  265. // border: 1px solid rgb(255, 255, 255);
  266. display: flex;
  267. align-items: center;
  268. }
  269. .item>div{
  270. width: 52%;
  271. height: 100%;
  272. font-size: 10px;
  273. // border: 1px solid rgb(255, 255, 255);
  274. display: flex;
  275. align-items: center;
  276. }
  277. .img{
  278. width: 50%;
  279. height: 80%;
  280. margin-left: 10%;
  281. background: url(~@/assets/visualization/taiyang.png) no-repeat;
  282. background-size: contain;
  283. }
  284. .img2{
  285. width: 50%;
  286. height: 80%;
  287. margin-left: 10%;
  288. // border: 1px solid rgb(255, 255, 255);
  289. background: url(~@/assets/visualization/lvtaiyang.png) no-repeat;
  290. background-size: contain;
  291. }
  292. </style>