EquipmentInfo.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div class="equipment-info-module">
  3. <common-title title="设备基本运行情况"></common-title>
  4. <div class="visualization-common-border box">
  5. <!-- <a-row>
  6. <a-col :span="12">
  7. 湿度实值
  8. </a-col>
  9. <a-col :span="12">
  10. 30%R.H
  11. </a-col>
  12. <a-col :span="12">
  13. 温度实值
  14. </a-col>
  15. <a-col :span="12">
  16. 20℃
  17. </a-col>
  18. <a-col :span="12">
  19. 辐射强度实值
  20. </a-col>
  21. <a-col :span="12">
  22. 20W/㎡
  23. </a-col>
  24. </a-row> -->
  25. <!-- <div id="demo1">
  26. <div>湿度实值</div>
  27. <div>温度实值</div>
  28. <div>辐射强度实值</div>
  29. </div>
  30. <div>
  31. <div>30%R.H</div>
  32. <div>20℃</div>
  33. <div>20W/㎡</div>
  34. </div> -->
  35. <!-- <div style="height: 32%;display: flex; justify-content: center; align-items: center; font-size: 39px;">程序运行</div> -->
  36. <div style="height: 32%;display: flex; justify-content: center; align-items: center; font-size: 26px;">{{runStatus == 1 ? '程序运行': '定值运行'}}</div>
  37. <div style="height: 36%; display: flex; flex-direction: row;">
  38. <!-- 左 -->
  39. <div class="le" style="margin: 0 0.1% 0 2.4%;">
  40. <div style="height: 15%; display: flex; justify-content: space-between;">
  41. <span style="font-size: 12px;">温度</span>
  42. <span style="font-size: 11px;">设定{{targetT}}℃</span>
  43. </div>
  44. <div style="height: 70%; display: flex; justify-content: center; align-items: center;">
  45. <span style="font-size: 35px;">{{template}}</span>
  46. </div>
  47. <div style="height: 15%; display: flex; justify-content: end; align-items: center;">
  48. <span style="font-size: 12px;">℃</span>
  49. </div>
  50. </div>
  51. <!-- 中 -->
  52. <div class="le" style="margin: 0 0.1% 0 1%;">
  53. <div style="height: 15%; display: flex; justify-content: space-between;">
  54. <span style="font-size: 12px;">湿度</span>
  55. <span style="font-size: 11px;">设定{{targetH}}%R.H</span>
  56. </div>
  57. <div style="height: 70%; display: flex; justify-content: center; align-items: center;">
  58. <span style="font-size: 35px;">{{humidity}}</span>
  59. </div>
  60. <div style="height: 15%; display: flex; justify-content: end; align-items: center;">
  61. <span style="font-size: 12px;">%R.H</span>
  62. </div>
  63. </div>
  64. <!-- 右 -->
  65. <div class="le" style="margin: 0 0.1% 0 1%;">
  66. <div style="height: 15%; display: flex; justify-content: space-between;">
  67. <span style="font-size: 12px;">辐射强度</span>
  68. <span style="font-size: 11px;">设定{{targetF}}W/㎡</span>
  69. </div>
  70. <div style="height: 70%; display: flex; justify-content: center; align-items: center;">
  71. <span style="font-size: 35px;">{{irradiation}}</span>
  72. </div>
  73. <div style="height: 15%; display: flex; justify-content: end; align-items: center;">
  74. <span style="font-size: 12px;">W/㎡</span>
  75. </div>
  76. </div>
  77. </div>
  78. <div style="height: 22%; margin-top: 2%;">
  79. <div class="bo">
  80. <div style="width: 35%; padding-left: 2%">{{alarmTime}}</div>
  81. <div style="width: 65%;">{{ information }}</div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import commonTitle from '../components/commonTitle.vue'
  89. export default {
  90. components: { commonTitle },
  91. name: '',
  92. props: {
  93. data: {
  94. type: Array,
  95. default: function(){
  96. return [] // 使用工厂函数返回默认值
  97. }
  98. },
  99. alarmData: {
  100. type: Array,
  101. default: function(){
  102. return [] // 使用工厂函数返回默认值
  103. }
  104. }
  105. },
  106. data () {
  107. return {
  108. // 获取数据(总)
  109. dataList: [],
  110. // 温度
  111. template: '',
  112. // 温度输出
  113. outputT: '',
  114. // 升温/降温(0升温,1降温,3啥也不是)
  115. statusT: 3,
  116. // 目标温度
  117. targetT: '',
  118. // 斜率设定(温度)
  119. slopeT: '',
  120. // 起始温度
  121. startT: '',
  122. // 辐照强度
  123. irradiation: '0',
  124. // 吹风
  125. // 时间
  126. // 辐照强度设定
  127. targetF: '0',
  128. // 辐射强度起始
  129. startF: '',
  130. // 湿度
  131. humidity: '',
  132. // 湿度输出
  133. outputH: '',
  134. // 加湿/除湿(0加湿,1除湿,3啥也不是)
  135. statusH: 3,
  136. // 目标湿度
  137. targetH: '',
  138. // 起始湿度
  139. startH: '',
  140. // 运行方式设定
  141. runStatus: '',
  142. // 报警信息
  143. alarmTime: '',
  144. information: ''
  145. }
  146. },
  147. watch: {
  148. data: {
  149. handler(newValue, oldValue){
  150. // console.log(77,newValue, oldValue)
  151. this.dataList = newValue
  152. this.getList()
  153. },
  154. immediate: true,
  155. deep: true
  156. },
  157. alarmData: {
  158. handler(newValue, oldValue){
  159. console.log(newValue, oldValue)
  160. var hasAlarm = newValue
  161. var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' };
  162. this.information = hasAlarm ? newValue.tagname : '暂无数据'
  163. this.alarmTime = hasAlarm ? new Date(newValue.logtime.time).toLocaleDateString('zh-CN', options) : ''
  164. },
  165. immediate: true,
  166. deep: true
  167. }
  168. },
  169. created () {
  170. },
  171. mounted () {
  172. },
  173. methods: {
  174. getList(){
  175. // console.log(this.dataList)
  176. for (var i = 0; i < this.dataList.length; i++) {
  177. // console.log(i,this.dataList[i].Name)
  178. // 温度
  179. if (this.dataList[i].Name == '当前温度值') {
  180. this.template = this.dataList[i].Value
  181. }
  182. if (this.dataList[i].Name == '温度设定值') {
  183. this.targetT = this.dataList[i].Value
  184. }
  185. // 辐照
  186. // 湿度
  187. if (this.dataList[i].Name == '当前湿度值') {
  188. this.humidity = this.dataList[i].Value
  189. }
  190. if (this.dataList[i].Name == '湿度设定值') {
  191. this.targetH = this.dataList[i].Value
  192. }
  193. // 运行方式
  194. if (this.dataList[i].Name == '运行方式设定') {
  195. this.runStatus = this.dataList[i].Value
  196. }
  197. }
  198. }
  199. }
  200. }
  201. </script>
  202. <style scoped>
  203. @import '~@/assets/less/uStyle.less';
  204. </style>
  205. <style lang="less" scoped>
  206. .equipment-info-module{
  207. width: 100%;
  208. height: 100%;
  209. }
  210. .box {
  211. width: 100%;
  212. height: calc(100% - 26px);
  213. border-width: 8px 0 0 6px;
  214. // border: 1px solid rgb(255, 255, 255);
  215. // display: flex;
  216. // /* row (默认值) : 主轴为水平万向,起点在左端。*/
  217. // flex-direction: row;
  218. }
  219. // .box>div#demo1{
  220. // width: 50%;
  221. // height: 94%;
  222. // margin: 2%;
  223. // color: #eeeeee;
  224. // font-size: 15px;
  225. // // border: 1px solid rgb(255, 255, 255);
  226. // }
  227. // .box>div{
  228. // width: 70%;
  229. // height: 94%;
  230. // margin-top: 2%;
  231. // color: #eeeeee;
  232. // font-size: 15px;
  233. // // border: 1px solid rgb(255, 255, 255);
  234. // }
  235. // .box>div>div{
  236. // padding: 5%;
  237. // }
  238. .box>div{
  239. width: 100%;
  240. color: #eeeeee;
  241. // border: 1px solid rgb(255, 255, 255);
  242. }
  243. .le{
  244. height: 100%;
  245. width: 31%;
  246. // border: 1px solid rgb(255, 255, 255);
  247. background: linear-gradient(#207ab7, #207ab7) left top,
  248. linear-gradient(#207ab7, #207ab7) left top ,
  249. linear-gradient(#207ab7, #207ab7) right top,
  250. linear-gradient(#207ab7, #207ab7) right top,
  251. linear-gradient(#207ab7, #207ab7) left bottom,
  252. linear-gradient(#207ab7, #207ab7) left bottom,
  253. linear-gradient(#207ab7, #207ab7) right bottom,
  254. linear-gradient(#207ab7, #207ab7) right bottom;
  255. background-repeat: no-repeat;
  256. background-size: 0.05vw 1vw, 1vw 0.05vw;
  257. padding: 5px 2px;
  258. }
  259. .le>div{
  260. width: 100%;
  261. padding: 0 3% 0 3%;
  262. // border: 1px solid rgb(255, 255, 255);
  263. color: #eeeeee;
  264. align-items: center;
  265. }
  266. .bo{
  267. height: 95%;
  268. width: 95.5%;
  269. // border: 1px solid rgb(255, 255, 255);
  270. margin: 0 0.1% 0.5% 2.4%;
  271. background: linear-gradient(#207ab7, #207ab7) left top,
  272. linear-gradient(#207ab7, #207ab7) left top ,
  273. linear-gradient(#207ab7, #207ab7) right top,
  274. linear-gradient(#207ab7, #207ab7) right top,
  275. linear-gradient(#207ab7, #207ab7) left bottom,
  276. linear-gradient(#207ab7, #207ab7) left bottom,
  277. linear-gradient(#207ab7, #207ab7) right bottom,
  278. linear-gradient(#207ab7, #207ab7) right bottom;
  279. background-repeat: no-repeat;
  280. background-size: 0.05vw 1vw, 1vw 0.05vw;
  281. display: flex;
  282. flex-direction: row;
  283. }
  284. .bo>div{
  285. height: 100%;
  286. color: #eeeeee;
  287. font-size: 16px;
  288. // border: 1px solid rgb(255, 255, 255);
  289. display: flex;
  290. align-items: center;
  291. }
  292. </style>