EquipmentInfo.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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 style="width: 35%; padding-left: 2%" class="scroll-text">
  83. <div>
  84. <div class="number">{{ time1 }}</div>
  85. <div class="number">{{ time2 }}</div>
  86. </div>
  87. </div>
  88. <div style="width: 65%;" class="scroll-text">
  89. <div>
  90. <div class="number">{{ inform1 }}</div>
  91. <div class="number">{{ inform2 }}</div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </template>
  99. <script>
  100. import commonTitle from '../components/commonTitle.vue'
  101. export default {
  102. components: { commonTitle },
  103. name: '',
  104. props: {
  105. data: {
  106. type: Array,
  107. default: function(){
  108. return [] // 使用工厂函数返回默认值
  109. }
  110. },
  111. alarmData: {
  112. type: Object,
  113. default: function(){
  114. return {} // 使用工厂函数返回默认值
  115. }
  116. }
  117. },
  118. data () {
  119. return {
  120. // 获取数据(总)
  121. dataList: [],
  122. // 温度
  123. template: '',
  124. // 温度输出
  125. outputT: '',
  126. // 升温/降温(0升温,1降温,3啥也不是)
  127. statusT: 3,
  128. // 目标温度
  129. targetT: '',
  130. // 斜率设定(温度)
  131. slopeT: '',
  132. // 起始温度
  133. startT: '',
  134. // 辐照强度
  135. irradiation: '0',
  136. // 吹风
  137. // 时间
  138. // 辐照强度设定
  139. targetF: '0',
  140. // 辐射强度起始
  141. startF: '',
  142. // 湿度
  143. humidity: '',
  144. // 湿度输出
  145. outputH: '',
  146. // 加湿/除湿(0加湿,1除湿,3啥也不是)
  147. statusH: 3,
  148. // 目标湿度
  149. targetH: '',
  150. // 起始湿度
  151. startH: '',
  152. // 运行方式设定
  153. runStatus: '',
  154. // 报警信息
  155. alarmTime: '',
  156. information: '',
  157. time1: '',
  158. time2: '',
  159. inform1: '',
  160. inform2: '',
  161. inform: ['Data 1', 'Data 2', 'Data 3', 'Data 4', 'Data 5', 'Data 6', 'Data 7', 'Data 8', 'Data 9'],
  162. time: ['time 1', 'time 2', 'time 3', 'time 4', 'time 5', 'time 6', 'time 7', 'time 8', 'time 9'],
  163. counter: 0
  164. }
  165. },
  166. watch: {
  167. data: {
  168. handler(newValue, oldValue){
  169. // console.log(77,newValue, oldValue)
  170. this.dataList = newValue
  171. this.getList()
  172. },
  173. immediate: true,
  174. deep: true
  175. },
  176. alarmData: {
  177. handler(newValue, oldValue){
  178. console.log(777777,newValue, oldValue)
  179. var hasAlarm = newValue
  180. var options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' };
  181. this.information = hasAlarm ? newValue.tagname : '暂无数据'
  182. this.alarmTime = hasAlarm ? new Date(newValue.logtime.time).toLocaleDateString('zh-CN', options) : ''
  183. },
  184. immediate: true,
  185. deep: true
  186. }
  187. },
  188. created () {
  189. this.showData()
  190. },
  191. mounted () {
  192. },
  193. methods: {
  194. getList(){
  195. // console.log(this.dataList)
  196. for (var i = 0; i < this.dataList.length; i++) {
  197. // console.log(i,this.dataList[i].Name)
  198. // 温度
  199. if (this.dataList[i].Name == '当前温度值') {
  200. this.template = this.dataList[i].Value
  201. }
  202. if (this.dataList[i].Name == '温度设定值') {
  203. this.targetT = this.dataList[i].Value
  204. }
  205. // 辐照
  206. // 湿度
  207. if (this.dataList[i].Name == '当前湿度值') {
  208. this.humidity = this.dataList[i].Value
  209. }
  210. if (this.dataList[i].Name == '湿度设定值') {
  211. this.targetH = this.dataList[i].Value
  212. }
  213. // 运行方式
  214. if (this.dataList[i].Name == '运行方式设定') {
  215. this.runStatus = this.dataList[i].Value
  216. }
  217. }
  218. },
  219. showData() {
  220. // 如果还有数据未显示
  221. if (this.counter < this.inform.length) {
  222. // 显示当前计数器指向的数据
  223. // console.log(this.inform[this.counter]);
  224. // console.log(this.time[this.counter]);
  225. this.time1 =this.time[this.counter]
  226. this.inform1 =this.inform[this.counter]
  227. // 如果还有一条数据可以显示
  228. if (this.counter + 1 < this.inform.length) {
  229. // console.log(this.inform[this.counter + 1]);
  230. // console.log(this.time[this.counter + 1]);
  231. this.time2 =this.time[this.counter + 1]
  232. this.inform2 =this.inform[this.counter + 1]
  233. }
  234. if (this.counter + 1 == this.inform.length) {
  235. this.time2 = ''
  236. this.inform2 = ''
  237. this.counter = -2;
  238. }
  239. // 更新计数器
  240. this.counter += 2;
  241. // 设置下一次调用的定时器
  242. setTimeout(this.showData, 3000);
  243. }
  244. if (this.counter == this.inform.length) {
  245. this.counter = 0;
  246. }
  247. }
  248. },
  249. // 销毁定时器
  250. beforeDestroy(){
  251. clearTimeout(this.showData)
  252. }
  253. }
  254. </script>
  255. <style scoped>
  256. @import '~@/assets/less/uStyle.less';
  257. </style>
  258. <style lang="less" scoped>
  259. .equipment-info-module{
  260. width: 100%;
  261. height: 100%;
  262. }
  263. .box {
  264. width: 100%;
  265. height: calc(100% - 26px);
  266. border-width: 8px 0 0 6px;
  267. // border: 1px solid rgb(255, 255, 255);
  268. // display: flex;
  269. // /* row (默认值) : 主轴为水平万向,起点在左端。*/
  270. // flex-direction: row;
  271. }
  272. // .box>div#demo1{
  273. // width: 50%;
  274. // height: 94%;
  275. // margin: 2%;
  276. // color: #eeeeee;
  277. // font-size: 15px;
  278. // // border: 1px solid rgb(255, 255, 255);
  279. // }
  280. // .box>div{
  281. // width: 70%;
  282. // height: 94%;
  283. // margin-top: 2%;
  284. // color: #eeeeee;
  285. // font-size: 15px;
  286. // // border: 1px solid rgb(255, 255, 255);
  287. // }
  288. // .box>div>div{
  289. // padding: 5%;
  290. // }
  291. .box>div{
  292. width: 100%;
  293. color: #eeeeee;
  294. // border: 1px solid rgb(255, 255, 255);
  295. }
  296. .le{
  297. height: 100%;
  298. width: 31%;
  299. // border: 1px solid rgb(255, 255, 255);
  300. background: linear-gradient(#207ab7, #207ab7) left top,
  301. linear-gradient(#207ab7, #207ab7) left top ,
  302. linear-gradient(#207ab7, #207ab7) right top,
  303. linear-gradient(#207ab7, #207ab7) right top,
  304. linear-gradient(#207ab7, #207ab7) left bottom,
  305. linear-gradient(#207ab7, #207ab7) left bottom,
  306. linear-gradient(#207ab7, #207ab7) right bottom,
  307. linear-gradient(#207ab7, #207ab7) right bottom;
  308. background-repeat: no-repeat;
  309. background-size: 0.05vw 1vw, 1vw 0.05vw;
  310. padding: 5px 2px;
  311. }
  312. .le>div{
  313. width: 100%;
  314. padding: 0 3% 0 3%;
  315. // border: 1px solid rgb(255, 255, 255);
  316. color: #eeeeee;
  317. align-items: center;
  318. }
  319. .bo{
  320. height: 95%;
  321. width: 95.5%;
  322. // border: 1px solid rgb(255, 255, 255);
  323. margin: 0 0.1% 0.5% 2.4%;
  324. background: linear-gradient(#207ab7, #207ab7) left top,
  325. linear-gradient(#207ab7, #207ab7) left top ,
  326. linear-gradient(#207ab7, #207ab7) right top,
  327. linear-gradient(#207ab7, #207ab7) right top,
  328. linear-gradient(#207ab7, #207ab7) left bottom,
  329. linear-gradient(#207ab7, #207ab7) left bottom,
  330. linear-gradient(#207ab7, #207ab7) right bottom,
  331. linear-gradient(#207ab7, #207ab7) right bottom;
  332. background-repeat: no-repeat;
  333. background-size: 0.05vw 1vw, 1vw 0.05vw;
  334. display: flex;
  335. align-items: center;
  336. flex-direction: row;
  337. }
  338. .bo>div{
  339. height: 100%;
  340. color: #eeeeee;
  341. font-size: 16px;
  342. // padding-top: 0.2%;
  343. // border: 1px solid rgb(255, 255, 255);
  344. display: flex;
  345. align-items: center;
  346. }
  347. .scroll-text {
  348. overflow: hidden;
  349. white-space: nowrap;
  350. }
  351. .number {
  352. display: block;
  353. animation: scrollNumber 3s infinite steps(1);
  354. }
  355. // @keyframes scrollNumber {
  356. // 0% {
  357. // transform: translateX(20%);
  358. // }
  359. // 100% {
  360. // transform: translateX(-20%);
  361. // }
  362. // }
  363. </style>