nitrogenHome2.vue 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436
  1. <template>
  2. <div>{{ Math.random() }}</div>
  3. <div id="nitrogen3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
  4. <div id="nitrogenCss3D" class="threejs-Object-CSS"
  5. style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px">
  6. <a-spin :spinning="loading" />
  7. <template>
  8. <div v-for="groupNum in 1" :key="groupNum" class="modal-monitor">
  9. <fourBorderBg :class="`kyj${groupNum}`" :id="`nitrogenMonitor${groupNum}`">
  10. <div class="title">{{ monitorData[groupNum - 1]['strname'] }} </div>
  11. <div class="monitor-item">
  12. <span class="monitor-title">检修:</span>
  13. <div class="monitor-val" v-if="!refresh">
  14. <span
  15. v-if="monitorData[groupNum - 1]['overhaul_run'] && monitorData[groupNum - 1]['overhaul_run'] == '0'"
  16. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  17. <span
  18. v-else-if="monitorData[groupNum - 1]['overhaul_run'] && monitorData[groupNum - 1]['overhaul_run'] == '1'"
  19. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  20. <span v-else
  21. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  22. </div>
  23. </div>
  24. <div class="monitor-item">
  25. <span class="monitor-title">运行:</span>
  26. <div class="monitor-val" v-if="!refresh">
  27. <span
  28. v-if="monitorData[groupNum - 1]['overhaul_run'] && monitorData[groupNum - 1]['overhaul_run'] == '1'"
  29. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  30. <span
  31. v-else-if="monitorData[groupNum - 1]['overhaul_run'] && monitorData[groupNum - 1]['overhaul_run'] == '0'"
  32. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  33. <span v-else
  34. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  35. </div>
  36. </div>
  37. <div class="monitor-item">
  38. <span class="monitor-title">主机进气蝶阀远控:</span>
  39. <div class="monitor-val" v-if="!refresh">
  40. <span
  41. v-if="monitorData[groupNum - 1]['m_bv_in_remote'] && monitorData[groupNum - 1]['m_bv_in_remote'] == '0'"
  42. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  43. <span
  44. v-else-if="monitorData[groupNum - 1]['m_bv_in_remote'] && monitorData[groupNum - 1]['m_bv_in_remote'] == '1'"
  45. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  46. <span v-else
  47. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  48. </div>
  49. </div>
  50. <div class="monitor-item">
  51. <span class="monitor-title">备机进气蝶阀远控:</span>
  52. <div class="monitor-val" v-if="!refresh">
  53. <span
  54. v-if="monitorData[groupNum - 1]['b_bv_in_remote'] && monitorData[groupNum - 1]['b_bv_in_remote'] == '0'"
  55. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  56. <span
  57. v-else-if="monitorData[groupNum - 1]['b_bv_in_remote'] && monitorData[groupNum - 1]['m_bv_in_remote'] == '1'"
  58. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  59. <span v-else="false"
  60. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  61. </div>
  62. </div>
  63. <div class="monitor-item">
  64. <span class="monitor-title">主机进气蝶阀开到位:</span>
  65. <div class="monitor-val" v-if="!refresh">
  66. <span
  67. v-if="monitorData[groupNum - 1]['m_bv_in_open'] && monitorData[groupNum - 1]['m_bv_in_open'] == '0'"
  68. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  69. <span
  70. v-else-if="monitorData[groupNum - 1]['m_bv_in_open'] && monitorData[groupNum - 1]['m_bv_in_open'] == '1'"
  71. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  72. <span v-else
  73. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  74. </div>
  75. </div>
  76. <div class="monitor-item">
  77. <span class="monitor-title">备机进气蝶阀开到位:</span>
  78. <div class="monitor-val" v-if="!refresh">
  79. <span
  80. v-if="monitorData[groupNum - 1]['b_bv_in_open'] && monitorData[groupNum - 1]['b_bv_in_open'] == '0'"
  81. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  82. <span
  83. v-else-if="monitorData[groupNum - 1]['b_bv_in_open'] && monitorData[groupNum - 1]['b_bv_in_open'] == '1'"
  84. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  85. <span v-else
  86. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  87. </div>
  88. </div>
  89. <div class="monitor-item">
  90. <span class="monitor-title">主机进气蝶阀关到位:</span>
  91. <div class="monitor-val" v-if="!refresh">
  92. <span
  93. v-if="monitorData[groupNum - 1]['m_bv_in_close'] && monitorData[groupNum - 1]['m_bv_in_close'] == '0'"
  94. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  95. <span
  96. v-else-if="monitorData[groupNum - 1]['m_bv_in_close'] && monitorData[groupNum - 1]['m_bv_in_close'] == '1'"
  97. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  98. <span v-else
  99. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  100. </div>
  101. </div>
  102. <div class="monitor-item">
  103. <span class="monitor-title">备机进气蝶阀关到位:</span>
  104. <div class="monitor-val" v-if="!refresh">
  105. <span
  106. v-if="monitorData[groupNum - 1]['b_bv_in_close'] && monitorData[groupNum - 1]['b_bv_in_close'] == '0'"
  107. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  108. <span
  109. v-else-if="monitorData[groupNum - 1]['b_bv_in_close'] && monitorData[groupNum - 1]['b_bv_in_close'] == '1'"
  110. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  111. <span v-else
  112. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  113. </div>
  114. </div>
  115. <div class="monitor-item">
  116. <span class="monitor-title">主机出气蝶阀远控:</span>
  117. <div class="monitor-val" v-if="!refresh">
  118. <span
  119. v-if="monitorData[groupNum - 1]['m_bv_out_remote'] && monitorData[groupNum - 1]['m_bv_out_remote'] == '0'"
  120. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  121. <span
  122. v-else-if="monitorData[groupNum - 1]['m_bv_out_remote'] && monitorData[groupNum - 1]['m_bv_out_remote'] == '1'"
  123. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  124. <span v-else
  125. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  126. </div>
  127. </div>
  128. <div class="monitor-item">
  129. <span class="monitor-title">备机出气蝶阀远控:</span>
  130. <div class="monitor-val" v-if="!refresh">
  131. <span
  132. v-if="monitorData[groupNum - 1]['b_bv_out_remote'] && monitorData[groupNum - 1]['b_bv_out_remote'] == '0'"
  133. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  134. <span
  135. v-else-if="monitorData[groupNum - 1]['b_bv_out_remote'] && monitorData[groupNum - 1]['b_bv_out_remote'] == '1'"
  136. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  137. <span v-else
  138. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  139. </div>
  140. </div>
  141. <div class="monitor-item">
  142. <span class="monitor-title">主机出气蝶阀开到位:</span>
  143. <div class="monitor-val" v-if="!refresh">
  144. <span
  145. v-if="monitorData[groupNum - 1]['m_bv_out_open'] && monitorData[groupNum - 1]['m_bv_out_open'] == '0'"
  146. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  147. <span
  148. v-else-if="monitorData[groupNum - 1]['m_bv_out_open'] && monitorData[groupNum - 1]['m_bv_out_open'] == '1'"
  149. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  150. <span v-else
  151. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  152. </div>
  153. </div>
  154. <div class="monitor-item">
  155. <span class="monitor-title">备机出气蝶阀开到位:</span>
  156. <div class="monitor-val" v-if="!refresh">
  157. <span
  158. v-if="monitorData[groupNum - 1]['b_bv_out_open'] && monitorData[groupNum - 1]['b_bv_out_open'] == '0'"
  159. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  160. <span
  161. v-else-if="monitorData[groupNum - 1]['b_bv_out_open'] && monitorData[groupNum - 1]['b_bv_out_open'] == '1'"
  162. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  163. <span v-else
  164. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  165. </div>
  166. </div>
  167. <div class="monitor-item">
  168. <span class="monitor-title">主机出气蝶阀关到位:</span>
  169. <div class="monitor-val" v-if="!refresh">
  170. <span
  171. v-if="monitorData[groupNum - 1]['m_bv_out_close'] && monitorData[groupNum - 1]['m_bv_out_close'] == '0'"
  172. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  173. <span
  174. v-else-if="monitorData[groupNum - 1]['m_bv_out_close'] && monitorData[groupNum - 1]['m_bv_out_close'] == '1'"
  175. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  176. <span v-else
  177. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  178. </div>
  179. </div>
  180. <div class="monitor-item">
  181. <span class="monitor-title">备机出气蝶阀关到位:</span>
  182. <div class="monitor-val" v-if="!refresh">
  183. <span
  184. v-if="monitorData[groupNum - 1]['b_bv_out_close'] && monitorData[groupNum - 1]['b_bv_out_close'] == '0'"
  185. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  186. <span
  187. v-else-if="monitorData[groupNum - 1]['b_bv_out_close'] && monitorData[groupNum - 1]['b_bv_out_close'] == '1'"
  188. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  189. <span v-else
  190. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  191. </div>
  192. </div>
  193. </fourBorderBg>
  194. </div>
  195. </template>
  196. </div>
  197. <div class="nitrogen-home">
  198. <div class="nitrogen-container">
  199. <div v-if="monitorNetStatus == 0" class="device-state">网络断开</div>
  200. <div class="top-box">
  201. <!-- 左边监测数据 -->
  202. <div class="lr-box left-box">
  203. <div class="item item-l" v-for="groupNum in monitorDataGroupNum" :key="groupNum">
  204. <ventBox1>
  205. <template #title>
  206. <div>{{ monitorData[groupNum - 1]['strname'] }}</div>
  207. </template>
  208. <template #container>
  209. <div class="monitor-box">
  210. <div class="parameter-title group-parameter-title">
  211. <SvgIcon class="icon" size="38" name="device-group-paramer" /><span>蝶阀参数</span>
  212. </div>
  213. <div class="state-item" v-for="(data, index) in groupParameterData" :key="index">
  214. <div class="item-col">
  215. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  216. <span class="state-val">{{
  217. (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[0]])
  218. >= 0
  219. ? monitorData[groupNum - 1][Object.keys(data)[0]] ?
  220. parseFloat(monitorData[groupNum -
  221. 1][Object.keys(data)[0]]).toFixed(2) : '-'
  222. : '-'
  223. }}</span>
  224. </div>
  225. <div class="item-col" v-if="Object.keys(data)[1]">
  226. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  227. <span class="state-val">{{
  228. (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[1]])
  229. >= 0
  230. ? monitorData[groupNum - 1][Object.keys(data)[1]] ?
  231. parseFloat(monitorData[groupNum -
  232. 1][Object.keys(data)[1]]).toFixed(2) : '-'
  233. : '-'
  234. }}</span>
  235. </div>
  236. </div>
  237. </div>
  238. <div class="monitor-box monitor-box1 ">
  239. <div class="parameter-title device-parameter-title">
  240. <SvgIcon class="icon" size="32" name="device-paramer" /><span>蝶阀故障数据</span>
  241. </div>
  242. <div class="state-box">
  243. <div class="state-item" v-for="(data, index) in deviceParameterData" :key="index">
  244. <div class="item-col">
  245. <span class="state-title1">{{ Object.values(data)[0] }} :</span>
  246. <span class="state-val1">
  247. <!-- {{
  248. (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[0]]) >= 0
  249. ? monitorData[groupNum - 1][Object.keys(data)[0]]
  250. : '-'
  251. }} -->
  252. <span v-if="monitorData[groupNum - 1][Object.keys(data)[0]] == '1'"
  253. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  254. <span v-else-if="monitorData[groupNum - 1][Object.keys(data)[0]] == '0'"
  255. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  256. <span v-else
  257. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  258. </span>
  259. </div>
  260. <div class="item-col" v-if="Object.keys(data)[1]">
  261. <span class="state-title1">{{ Object.values(data)[1] }} :</span>
  262. <span class="state-val1">
  263. <span v-if="monitorData[groupNum - 1][Object.keys(data)[1]] == '1'"
  264. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: red;"></span>
  265. <span v-else-if="monitorData[groupNum - 1][Object.keys(data)[1]] == '0'"
  266. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: greenyellow;"></span>
  267. <span v-else
  268. style="display: inline-block; width: 10px;height: 10px;border-radius: 50%;background-color: #ccc;"></span>
  269. </span>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </template>
  275. </ventBox1>
  276. </div>
  277. <!-- <div class="item item-l">
  278. <ventBox1 class="vent-margin-t-10">
  279. <template #title>
  280. <div>下风测详情</div>
  281. </template>
  282. <template #container>
  283. <div class="monitor-box">
  284. <div class="state-item" v-for="(data, index) in downWindData" :key="index">
  285. <div class="item-col">
  286. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  287. <span class="state-val">{{
  288. (monitorData.length > 0 && monitorData[0][Object.keys(data)[0]]) >= 0
  289. ? monitorData[0][Object.keys(data)[0]] ?
  290. parseFloat(monitorData[0][Object.keys(data)[0]]).toFixed(2) : '-'
  291. : '-'
  292. }}</span>
  293. </div>
  294. <div class="item-col" v-if="Object.keys(data)[1]">
  295. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  296. <span class="state-val">{{
  297. (monitorData.length > 0 && monitorData[0][Object.keys(data)[1]]) >= 0
  298. ? monitorData[0][Object.keys(data)[1]] ?
  299. parseFloat(monitorData[0][Object.keys(data)[1]]).toFixed(2) : '-'
  300. : '-'
  301. }}</span>
  302. </div>
  303. </div>
  304. </div>
  305. </template>
  306. </ventBox1>
  307. </div> -->
  308. </div>
  309. <!-- 右边控制状态 -->
  310. <div class="lr-box right-box">
  311. <ventBox1>
  312. <template #title>
  313. <div>远程控制</div>
  314. </template>
  315. <template #container>
  316. <div class="control-group">
  317. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  318. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  319. <div class="control-item-state">
  320. <!-- <a-button v-if="index == 0" size="small" type="text" style="color: #fff;"
  321. @click="handlerDevice(airCompressorState[groupNum - 1], false)">主机启动</a-button>
  322. <a-button v-else size="small" type="text" style="color: #fff;"
  323. @click="handlerDevice(airCompressorState[groupNum - 1], false)">备机启动</a-button> -->
  324. <a-radio v-if="index == 0"
  325. v-model:checked="airCompressorState[groupNum - 1]['m_start']"
  326. @change="handlerDevice(airCompressorState[groupNum - 1], '主机启动')">主机启动</a-radio>
  327. <a-radio v-else v-model:checked="airCompressorState[groupNum - 1]['m_start']"
  328. @change="handlerDevice(airCompressorState[groupNum - 1], '主机启动')">主机启动</a-radio>
  329. </div>
  330. <div class="control-item-state">
  331. <a-radio v-if="index == 0"
  332. v-model:checked="airCompressorState[groupNum - 1]['b_start']"
  333. @change="handlerDevice(airCompressorState[groupNum - 1], '备机启动')">备机启动</a-radio>
  334. <a-radio v-else v-model:checked="airCompressorState[groupNum - 1]['b_start']"
  335. @change="handlerDevice(airCompressorState[groupNum - 1], '备机启动')">备机启动</a-radio>
  336. </div>
  337. </div>
  338. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  339. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  340. <div class="control-item-state">
  341. <!-- <a-button v-if="index == 0" size="small" type="text" style="color: #fff;"
  342. @click="handlerDevice(airCompressorState[groupNum - 1], true)">主机停止</a-button>
  343. <a-button v-else size="small" type="text" style="color: #fff;"
  344. @click="handlerDevice(airCompressorState[groupNum - 1], true)">备机停止</a-button> -->
  345. <a-radio v-if="index == 0"
  346. v-model:checked="airCompressorState[groupNum - 1]['m_stop']"
  347. @change="handlerDevice(airCompressorState[groupNum - 1], '主机停止')">主机停止</a-radio>
  348. <a-radio v-else v-model:checked="airCompressorState[groupNum - 1]['m_stop']"
  349. @change="handlerDevice(airCompressorState[groupNum - 1], '主机停止')">主机停止</a-radio>
  350. </div>
  351. <div class="control-item-state">
  352. <a-radio v-if="index == 0"
  353. v-model:checked="airCompressorState[groupNum - 1]['b_stop']"
  354. @change="handlerDevice(airCompressorState[groupNum - 1], '备机停止')">备机停止</a-radio>
  355. <a-radio v-else v-model:checked="airCompressorState[groupNum - 1]['b_stop']"
  356. @change="handlerDevice(airCompressorState[groupNum - 1], '备机停止')">备机停止</a-radio>
  357. </div>
  358. </div>
  359. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  360. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  361. <div class="control-item-state">
  362. <a-radio v-if="index == 0"
  363. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_opening']"
  364. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀开')">主机进气蝶阀开</a-radio>
  365. <a-radio v-else
  366. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_opening']"
  367. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀开')">主机进气蝶阀开</a-radio>
  368. </div>
  369. <div class="control-item-state">
  370. <a-radio v-if="index == 0"
  371. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_opening']"
  372. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀开')">备机进气蝶阀开</a-radio>
  373. <a-radio v-else
  374. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_opening']"
  375. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀开')">备机进气蝶阀开</a-radio>
  376. </div>
  377. </div>
  378. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  379. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  380. <div class="control-item-state">
  381. <a-radio v-if="index == 0"
  382. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_closing']"
  383. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀关')">主机进气蝶阀关</a-radio>
  384. <a-radio v-else
  385. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_closing']"
  386. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀关')">主机进气蝶阀关</a-radio>
  387. </div>
  388. <div class="control-item-state">
  389. <a-radio v-if="index == 0"
  390. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_closing']"
  391. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀关')">备机进气蝶阀关</a-radio>
  392. <a-radio v-else
  393. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_closing']"
  394. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀关')">备机进气蝶阀关</a-radio>
  395. </div>
  396. </div>
  397. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  398. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  399. <div class="control-item-state">
  400. <a-radio v-if="index == 0"
  401. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_stopping']"
  402. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀停')">主机进气蝶阀停</a-radio>
  403. <a-radio v-else
  404. v-model:checked="airCompressorState[groupNum - 1]['m_bv_in_stopping']"
  405. @change="handlerDevice(airCompressorState[groupNum - 1], '主机进气蝶阀停')">主机进气蝶阀停</a-radio>
  406. </div>
  407. <div class="control-item-state">
  408. <a-radio v-if="index == 0"
  409. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_stopping']"
  410. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀停')">备机进气蝶阀停</a-radio>
  411. <a-radio v-else
  412. v-model:checked="airCompressorState[groupNum - 1]['b_bv_in_stopping']"
  413. @change="handlerDevice(airCompressorState[groupNum - 1], '备机进气蝶阀停')">备机进气蝶阀停</a-radio>
  414. </div>
  415. </div>
  416. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  417. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  418. <div class="control-item-state">
  419. <a-radio v-if="index == 0"
  420. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_opening']"
  421. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀开')">主机出气蝶阀开</a-radio>
  422. <a-radio v-else
  423. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_opening']"
  424. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀开')">主机出气蝶阀开</a-radio>
  425. </div>
  426. <div class="control-item-state">
  427. <a-radio v-if="index == 0"
  428. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_opening']"
  429. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀开')">备机出气蝶阀开</a-radio>
  430. <a-radio v-else
  431. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_opening']"
  432. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀开')">备机出气蝶阀开</a-radio>
  433. </div>
  434. </div>
  435. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  436. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  437. <div class="control-item-state">
  438. <a-radio v-if="index == 0"
  439. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_closing']"
  440. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀关')">主机出气蝶阀关</a-radio>
  441. <a-radio v-else
  442. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_closing']"
  443. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀关')">主机出气蝶阀关</a-radio>
  444. </div>
  445. <div class="control-item-state">
  446. <a-radio v-if="index == 0"
  447. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_closing']"
  448. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀关')">备机出气蝶阀关</a-radio>
  449. <a-radio v-else
  450. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_closing']"
  451. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀关')">备机出气蝶阀关</a-radio>
  452. </div>
  453. </div>
  454. <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
  455. <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
  456. <div class="control-item-state">
  457. <a-radio v-if="index == 0"
  458. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_stopping']"
  459. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀停')">主机出气蝶阀停</a-radio>
  460. <a-radio v-else
  461. v-model:checked="airCompressorState[groupNum - 1]['m_bv_out_stopping']"
  462. @change="handlerDevice(airCompressorState[groupNum - 1], '主机出气蝶阀停')">主机出气蝶阀停</a-radio>
  463. </div>
  464. <div class="control-item-state">
  465. <a-radio v-if="index == 0"
  466. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_stopping']"
  467. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀停')">备机出气蝶阀停</a-radio>
  468. <a-radio v-else
  469. v-model:checked="airCompressorState[groupNum - 1]['b_bv_out_stopping']"
  470. @change="handlerDevice(airCompressorState[groupNum - 1], '备机出气蝶阀停')">备机出气蝶阀停</a-radio>
  471. </div>
  472. </div>
  473. </div>
  474. </template>
  475. </ventBox1>
  476. <ventBox1 class="vent-margin-t-10">
  477. <template #title>
  478. <div>设备实时监测曲线</div>
  479. </template>
  480. <template #container>
  481. <BarAndLine v-if="chartsColumns.length > 0" xAxisPropType="readTime" :dataSource="echartData"
  482. height="340px" :chartsColumns="chartsColumns" chartsType="listMonitor"
  483. :option="echatsOption" />
  484. <!-- :option="zhudanOption" -->
  485. </template>
  486. </ventBox1>
  487. </div>
  488. </div>
  489. </div>
  490. </div>
  491. <HandleModal :modal-is-show="modalIsShow" :modal-title="modalTitle" :modal-type="modalType" @handle-ok="handleOK"
  492. @handle-cancel="handleCancel" />
  493. </template>
  494. <script lang="ts" setup name="nitrogenHome">
  495. import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick, inject, computed } from 'vue';
  496. import ventBox1 from '/@/components/vent/ventBox1.vue';
  497. import fourBorderBg from '../../../comment/components/fourBorderBg.vue';
  498. import { mountedThree, destroy, setModelType, addText } from '../nitrogen.threejs';
  499. import { getDevice } from '../nitrogen.api';
  500. import { SvgIcon } from '/@/components/Icon';
  501. import BarAndLine from '/@/components/chart/BarAndLine.vue';
  502. import HandleModal from './modal.vue';
  503. import { deviceControlApi } from '/@/api/vent/index';
  504. import { message } from 'ant-design-vue';
  505. import lodash from 'lodash';
  506. const globalConfig = inject('globalConfig');
  507. const props = defineProps({
  508. deviceId: {
  509. type: String,
  510. require: true,
  511. },
  512. modalType: {
  513. type: String,
  514. require: true,
  515. },
  516. });
  517. let checked = ref(false)
  518. const refresh = ref(false)
  519. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  520. const modalType = ref(''); // 模态框内容显示类型,设备操作类型
  521. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  522. const loading = ref(true);
  523. let kzParam = reactive<any>({
  524. data: {},
  525. isFw: '',
  526. });
  527. // const kyjs = ['1号空压机', '1号空压机', '1号空压机', '1号空压机'];
  528. const flvURL1 = () => {
  529. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  530. return '';
  531. };
  532. const colors = ['#FDB146', '#EE6666', '#9BCB75', '#03C2EC', '#DA3914', '#9C83D9']
  533. const echatsOption = {
  534. grid: {
  535. top: '35%',
  536. left: '2px',
  537. right: '10px',
  538. bottom: '3%',
  539. containLabel: true
  540. },
  541. toolbox: {
  542. feature: {}
  543. }
  544. }
  545. const monitorDataGroupNum = ref(0);
  546. const monitorNetStatus = ref(0)
  547. let airCompressorState = reactive<any[]>([]);
  548. const groupParameterData = [
  549. {
  550. flow: '流量(m³/h)',
  551. total_flow: '总流量(m³)',
  552. },
  553. {
  554. single_flow: '单次流量(m³/h)',
  555. oxygen_concentration: '氧浓度(%)',
  556. },
  557. {
  558. bv_1_open: '蝶阀1开度',
  559. bv_2_open: '蝶阀2开度',
  560. },
  561. {
  562. bv_3_open: '蝶阀3开度',
  563. bv_4_open: '蝶阀4开度',
  564. },
  565. ];
  566. const deviceParameterData = [
  567. {
  568. bv_1_load_short: '蝶阀1负载短路',
  569. bv_2_load_short: '蝶阀2负载短路',
  570. },
  571. {
  572. bv_3_load_short: '蝶阀3负载短路',
  573. bv_4_load_short: '蝶阀4负载短路',
  574. },
  575. {
  576. bv_1_low_voltage: '蝶阀1电压过低',
  577. bv_2_low_voltage: '蝶阀2电压过低',
  578. },
  579. {
  580. bv_3_low_voltage: '蝶阀3电压过低',
  581. bv_4_low_voltage: '蝶阀4电压过低',
  582. },
  583. {
  584. bv_1_high_voltage: '蝶阀1电压过高',
  585. bv_2_high_voltage: '蝶阀2电压过高',
  586. },
  587. {
  588. bv_3_high_voltage: '蝶阀3电压过高',
  589. bv_4_high_voltage: '蝶阀4电压过高',
  590. },
  591. {
  592. bv_1_motor_leakage: '蝶阀1电机漏电',
  593. bv_2_motor_leakage: '蝶阀2电机漏电',
  594. },
  595. {
  596. bv_3_motor_leakage: '蝶阀3电机漏电',
  597. bv_4_motor_leakage: '蝶阀4电机漏电',
  598. },
  599. {
  600. bv_1_supply_phase: '蝶阀1电源缺相',
  601. bv_2_supply_phase: '蝶阀2电源缺相',
  602. },
  603. {
  604. bv_3_supply_phase: '蝶阀3电源缺相',
  605. bv_4_supply_phase: '蝶阀4电源缺相',
  606. },
  607. {
  608. bv_1_closing_overtorque: '蝶阀1关向过力矩故障',
  609. bv_2_closing_overtorque: '蝶阀2关向过力矩故障',
  610. },
  611. {
  612. bv_3_closing_overtorque: '蝶阀3关向过力矩故障',
  613. bv_4_closing_overtorque: '蝶阀4关向过力矩故障',
  614. },
  615. {
  616. bv_1_opening_overtorque: '蝶阀1开向过力矩故障',
  617. bv_2_opening_overtorque: '蝶阀2开向过力矩故障',
  618. },
  619. {
  620. bv_3_opening_overtorque: '蝶阀3开向过力矩故障',
  621. bv_4_opening_overtorque: '蝶阀4开向过力矩故障',
  622. },
  623. {
  624. bv_1_closing_overcurrent: '蝶阀1关向过电流故障',
  625. bv_2_closing_overcurrent: '蝶阀2关向过电流故障',
  626. },
  627. {
  628. bv_3_closing_overcurrent: '蝶阀3关向过电流故障',
  629. bv_4_closing_overcurrent: '蝶阀4关向过电流故障',
  630. },
  631. {
  632. bv_1_opening_overcurrent: '蝶阀1开向过电流故障',
  633. bv_2_opening_overcurrent: '蝶阀2开向过电流故障',
  634. },
  635. {
  636. bv_3_opening_overcurrent: '蝶阀3开向过电流故障',
  637. bv_4_opening_overcurrent: '蝶阀4开向过电流故障',
  638. },
  639. {
  640. bv_1_closing_timeout: '蝶阀1关向超时',
  641. bv_2_closing_timeout: '蝶阀2关向超时',
  642. },
  643. {
  644. bv_3_closing_timeout: '蝶阀3关向超时',
  645. bv_4_closing_timeout: '蝶阀4关向超时',
  646. },
  647. {
  648. bv_1_opening_timeout: '蝶阀1开向超时',
  649. bv_2_opening_timeout: '蝶阀2开向超时',
  650. },
  651. {
  652. bv_3_opening_timeout: '蝶阀3开向超时',
  653. bv_4_opening_timeout: '蝶阀4开向超时',
  654. },
  655. {
  656. bv_1_valve_position: '蝶阀1阀位故障',
  657. bv_2_valve_position: '蝶阀2阀位故障',
  658. },
  659. {
  660. bv_3_valve_position: '蝶阀3阀位故障',
  661. bv_4_valve_position: '蝶阀4阀位故障',
  662. },
  663. {
  664. bv_1_thermal_overload: '蝶阀1热过载',
  665. bv_2_thermal_overload: '蝶阀2热过载',
  666. },
  667. {
  668. bv_3_thermal_overload: '蝶阀3热过载',
  669. bv_4_thermal_overload: '蝶阀4热过载',
  670. },
  671. ];
  672. const downWindData = [
  673. {
  674. o2Val: '下风侧氧气(%)',
  675. temperature: '下风测温度(℃)',
  676. },
  677. {
  678. fumes: '下风测烟雾(­%)',
  679. },
  680. ];
  681. const propTypeArr = ref([])
  682. const chartsColumns = ref([])
  683. watch(monitorDataGroupNum, () => {
  684. const arr = <any[]>[]
  685. const item = {
  686. legend: '单次流量',
  687. seriesName: '(m³/h)',
  688. ymax: 5,
  689. yname: 'm³/h',
  690. linetype: 'line',
  691. yaxispos: 'left',
  692. color: '#FDB146',
  693. sort: 1,
  694. xRotate: 0,
  695. dataIndex: 'single_flow',
  696. }
  697. const propTypeList = []
  698. for (let i = 1; i <= monitorDataGroupNum.value; i++) {
  699. const lineType = lodash.cloneDeep(item)
  700. lineType.legend = `制氮机${i}单次流量`;
  701. lineType.dataIndex = `single_flow${i}`
  702. lineType.color = colors[i - 1]
  703. arr.push(lineType)
  704. }
  705. chartsColumns.value = arr
  706. })
  707. const monitorData = ref(
  708. new Array(3).fill({
  709. // strName: '空压机',
  710. // cumulativeFlow: '-',
  711. // centerTemperature: '-',
  712. // outletTemperature: '-',
  713. // Ia: '-',
  714. // Ib: '-',
  715. // Ic: '-',
  716. // Vab: '-',
  717. // Vac: '-',
  718. // Vbc: '-',
  719. // compressGroupName: '',
  720. // compressExhaustPressF1: '-',
  721. // compressSeparatePressF1: '-',
  722. // compressHostTempF1: '-',
  723. // compressCrewTempF1: '-',
  724. // compressRunTimeF1: '-',
  725. // controlModel: 'LOC'
  726. })
  727. );
  728. //图表数据
  729. let echartData = ref<any>([]);
  730. // https获取监测数据
  731. let timer: null | NodeJS.Timeout = null;
  732. async function getMonitor(flag?) {
  733. if (Object.prototype.toString.call(timer) === '[object Null]') {
  734. timer = await setTimeout(
  735. async () => {
  736. if (props.deviceId) {
  737. await getDataSource(props.deviceId);
  738. }
  739. if (timer) {
  740. timer = null;
  741. }
  742. await getMonitor();
  743. },
  744. flag ? 0 : 3000
  745. );
  746. }
  747. }
  748. async function getDataSource(systemID) {
  749. const res = await getDevice({ devicetype: 'sys', systemID, type: 'all' });
  750. if (res) {
  751. const result = res;
  752. if (!result || result.msgTxt.length < 1) return;
  753. result.msgTxt.forEach((item) => {
  754. if (item.type && item.type.startsWith('nitrogen')) {
  755. airCompressorState.length = 0;
  756. let netStatus = 0
  757. monitorData.value = item['datalist'].filter((data) => {
  758. const readData = data.readData;
  759. if (data['netStatus'] == 1) {
  760. netStatus = 1
  761. }
  762. airCompressorState.push({
  763. id: data.deviceID,
  764. deviceType: data.deviceType,
  765. m_start: readData.m_start == '1' ? true : false,
  766. b_start: readData.b_start == '1' ? true : false,
  767. m_stop: readData.m_stop == '1' ? true : false,
  768. b_stop: readData.b_stop == '1' ? true : false,
  769. m_bv_in_opening: readData.m_bv_in_opening == '1' ? true : false,
  770. b_bv_in_opening: readData.b_bv_in_opening == '1' ? true : false,
  771. m_bv_in_closing: readData.m_bv_in_closing == '1' ? true : false,
  772. b_bv_in_closing: readData.b_bv_in_closing == '1' ? true : false,
  773. m_bv_in_stopping: readData.m_bv_in_stopping == '1' ? true : false,
  774. b_bv_in_stopping: readData.b_bv_in_stopping == '1' ? true : false,
  775. m_bv_out_opening: readData.m_bv_out_opening == '1' ? true : false,
  776. b_bv_out_opening: readData.b_bv_out_opening == '1' ? true : false,
  777. m_bv_out_closing: readData.m_bv_out_closing == '1' ? true : false,
  778. b_bv_out_closing: readData.b_bv_out_closing == '1' ? true : false,
  779. m_bv_out_stopping: readData.m_bv_out_stopping == '1' ? true : false,
  780. b_bv_out_stopping: readData.b_bv_out_stopping == '1' ? true : false
  781. });
  782. return Object.assign(data, readData);
  783. });
  784. monitorNetStatus.value = netStatus
  785. console.log(monitorData, 'monitorData.value---===')
  786. const airCompressor = { readTime: monitorData.value[0]['readTime'].substring(11) }
  787. const dataArr = lodash.cloneDeep(echartData.value)
  788. //图表数据
  789. if (dataArr.length <= 5) {
  790. monitorData.value.forEach((el, index) => {
  791. airCompressor[`single_flow${index + 1}`] = el['single_flow'] || 0
  792. });
  793. dataArr.push(airCompressor)
  794. } else {
  795. dataArr.shift()
  796. dataArr.push(airCompressor)
  797. }
  798. echartData.value = dataArr
  799. }
  800. });
  801. monitorDataGroupNum.value = monitorData.value.length;
  802. refresh.value = true
  803. nextTick(() => {
  804. refresh.value = false
  805. })
  806. }
  807. }
  808. function handlerDevice(data, bol) {
  809. console.log(data, 'data===---000')
  810. console.log(bol, 'bol----====0000')
  811. kzParam.data = data;
  812. kzParam.isFw = bol
  813. switch (bol) {
  814. case '主机启动':
  815. modalTitle.value = '主机启动';
  816. modalType.value = '1';
  817. modalIsShow.value = true;
  818. break;
  819. case '备机启动':
  820. modalTitle.value = '备机启动';
  821. modalType.value = '1';
  822. modalIsShow.value = true;
  823. break;
  824. case '主机停止':
  825. modalTitle.value = '主机停止';
  826. modalType.value = '1';
  827. modalIsShow.value = true;
  828. break;
  829. case '备机停止':
  830. modalTitle.value = '备机停止';
  831. modalType.value = '1';
  832. modalIsShow.value = true;
  833. break;
  834. }
  835. // if (bol) {
  836. // modalTitle.value = '一键复位';
  837. // modalType.value = '1';
  838. // modalIsShow.value = true;
  839. // kzParam.data.HMIReset = !data.HMIReset
  840. // } else {
  841. // modalTitle.value = '一键启停';
  842. // modalType.value = '2';
  843. // modalIsShow.value = true;
  844. // kzParam.data.HMIStartStop = !data.HMIStartStop;
  845. // }
  846. }
  847. function handleOK(passWord, handlerState) {
  848. console.log(kzParam, 'kz----------');
  849. // if (passWord !== '123456') {
  850. // message.warning('密码不正确,请重新输入');
  851. // return;
  852. // }
  853. let data = {};
  854. switch (kzParam.isFw) {
  855. case '主机启动':
  856. data = {
  857. deviceid: kzParam.data.id,
  858. devicetype: kzParam.data.deviceType,
  859. password: passWord,
  860. HMIReset: kzParam.data.HMIReset,
  861. };
  862. break;
  863. case '备机启动':
  864. data = {
  865. deviceid: kzParam.data.id,
  866. devicetype: kzParam.data.deviceType,
  867. password: passWord,
  868. HMIReset: kzParam.data.HMIReset,
  869. };
  870. break;
  871. case '主机停止':
  872. data = {
  873. deviceid: kzParam.data.id,
  874. devicetype: kzParam.data.deviceType,
  875. password: passWord,
  876. HMIReset: kzParam.data.HMIReset,
  877. };
  878. break;
  879. case '备机停止':
  880. data = {
  881. deviceid: kzParam.data.id,
  882. devicetype: kzParam.data.deviceType,
  883. password: passWord,
  884. HMIReset: kzParam.data.HMIReset,
  885. };
  886. break;
  887. }
  888. // if (kzParam.isFw) {
  889. // data = {
  890. // deviceid: kzParam.data.id,
  891. // devicetype: kzParam.data.deviceType,
  892. // password: passWord,
  893. // HMIReset: kzParam.data.HMIReset,
  894. // };
  895. // } else {
  896. // data = {
  897. // deviceid: kzParam.data.id,
  898. // password: passWord,
  899. // devicetype: kzParam.data.deviceType,
  900. // HMIStartStop: kzParam.data.HMIStartStop,
  901. // };
  902. // }
  903. deviceControlApi(data).then((res) => {
  904. // 模拟时开启
  905. if (res.success) {
  906. modalIsShow.value = false;
  907. getDataSource(props.deviceId);
  908. if (globalConfig.History_Type == 'remote') {
  909. message.success('指令已下发至生产管控平台成功!')
  910. } else {
  911. message.success('指令已下发成功!')
  912. }
  913. }
  914. });
  915. }
  916. function handleCancel() {
  917. modalIsShow.value = false;
  918. modalTitle.value = '';
  919. modalType.value = '';
  920. }
  921. watch([monitorDataGroupNum, loading], ([newMonitorDataGroupNum, newLoading]) => {
  922. nextTick(() => {
  923. if (newMonitorDataGroupNum && !newLoading) {
  924. setModelType(props.modalType, newMonitorDataGroupNum);
  925. }
  926. });
  927. });
  928. onMounted(async () => {
  929. await getMonitor(true);
  930. await mountedThree().then(() => {
  931. loading.value = false;
  932. });
  933. });
  934. onUnmounted(() => {
  935. destroy();
  936. if (timer) {
  937. clearTimeout(timer);
  938. timer = undefined;
  939. }
  940. });
  941. </script>
  942. <style lang="less" scoped>
  943. @ventSpace: zxm;
  944. .nitrogen-box {
  945. width: 100%;
  946. height: 100%;
  947. display: flex;
  948. justify-content: center;
  949. }
  950. #nitrogenCss3D {
  951. .modal-monitor {
  952. width: 200px;
  953. position: absolute;
  954. left: 0px;
  955. top: 0px;
  956. }
  957. &:deep(.win) {
  958. margin: 0 !important;
  959. background: #00000044;
  960. }
  961. }
  962. .nitrogen-home {
  963. width: 100%;
  964. height: 100%;
  965. position: fixed;
  966. z-index: 9999;
  967. display: flex;
  968. flex-direction: column;
  969. justify-content: center;
  970. align-items: center;
  971. pointer-events: none;
  972. top: 20px;
  973. .nitrogen-container {
  974. width: 100%;
  975. height: calc(100% - 100px);
  976. display: flex;
  977. justify-content: space-between;
  978. margin-bottom: 100px;
  979. .top-box {
  980. margin-top: 40px; //lxh
  981. width: 100%;
  982. padding: 10px;
  983. overflow: hidden;
  984. display: flex;
  985. justify-content: space-between;
  986. .lr-box {
  987. height: fit-content;
  988. display: flex;
  989. flex-direction: column;
  990. position: relative;
  991. overflow: hidden;
  992. z-index: 9999;
  993. pointer-events: auto;
  994. }
  995. .item {
  996. width: 335px;
  997. height: auto;
  998. position: relative;
  999. border-radius: 5px;
  1000. margin-top: 10px;
  1001. margin-bottom: 0px;
  1002. pointer-events: auto;
  1003. color: #fff;
  1004. overflow: hidden;
  1005. &:first-child {
  1006. margin-top: 0px;
  1007. }
  1008. .base-title {
  1009. color: #fff;
  1010. margin-bottom: 8px;
  1011. padding-left: 10px;
  1012. position: relative;
  1013. font-size: 16px;
  1014. &::after {
  1015. content: '';
  1016. position: absolute;
  1017. display: block;
  1018. width: 4px;
  1019. height: 12px;
  1020. top: 7px;
  1021. left: 0px;
  1022. background: #45d3fd;
  1023. border-radius: 4px;
  1024. }
  1025. }
  1026. .state-item {
  1027. display: flex;
  1028. flex-direction: row;
  1029. padding: 5px;
  1030. .item-col {
  1031. width: calc(50% - 5px);
  1032. display: flex;
  1033. justify-content: center;
  1034. align-items: center;
  1035. padding-right: 4px;
  1036. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
  1037. &:first-child {
  1038. margin-right: 10px;
  1039. }
  1040. .state-title {
  1041. color: #ffffffcc;
  1042. flex: 9;
  1043. font-size: 14px;
  1044. }
  1045. .state-val {
  1046. flex: 1;
  1047. color: #00eefffe;
  1048. margin-right: 5px;
  1049. text-align: right;
  1050. font-size: 14px;
  1051. }
  1052. .state-title1 {
  1053. color: #ffffffcc;
  1054. flex: 5;
  1055. font-size: 14px;
  1056. }
  1057. .state-val1 {
  1058. display: flex;
  1059. flex: 1;
  1060. justify-content: center;
  1061. align-items: center;
  1062. }
  1063. }
  1064. }
  1065. .signal-box {
  1066. margin: 5px 0;
  1067. display: flex;
  1068. align-items: center;
  1069. .signal-title {
  1070. color: #7af5ff;
  1071. margin: 0 5px;
  1072. }
  1073. &:last-child {
  1074. margin-right: 0px;
  1075. }
  1076. }
  1077. .list-item {
  1078. padding: 0 10px;
  1079. display: flex;
  1080. justify-content: space-between;
  1081. align-items: center;
  1082. .item-data-key {
  1083. color: #ffffff99;
  1084. }
  1085. }
  1086. .item-data-box {
  1087. color: #fff;
  1088. .state-icon {
  1089. display: inline-block;
  1090. width: 12px;
  1091. height: 12px;
  1092. border-radius: 12px;
  1093. }
  1094. .open {
  1095. border: 5px solid #133a56;
  1096. background: #4ecb73;
  1097. }
  1098. .close {
  1099. border: 5px solid #192961;
  1100. background: #6d7898;
  1101. }
  1102. }
  1103. }
  1104. .item-l {
  1105. width: 100%;
  1106. .monitor-box {
  1107. width: 100%;
  1108. .parameter-title {
  1109. position: relative;
  1110. width: 100%;
  1111. height: 14px;
  1112. margin-top: 10px;
  1113. .icon,
  1114. span {
  1115. position: absolute;
  1116. top: -10px;
  1117. }
  1118. }
  1119. .group-parameter-title {
  1120. background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  1121. .icon {
  1122. left: -12px;
  1123. top: -17px;
  1124. }
  1125. span {
  1126. left: 18px;
  1127. }
  1128. .item-col {
  1129. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10);
  1130. }
  1131. }
  1132. .device-parameter-title {
  1133. background-image: linear-gradient(to right, #3df6ff40, #3df6ff00);
  1134. .icon {
  1135. left: -10px;
  1136. top: -14px;
  1137. }
  1138. span {
  1139. left: 18px;
  1140. }
  1141. .item-col {
  1142. background-image: linear-gradient(to right, #3df6ff10, #3df6ff00);
  1143. }
  1144. }
  1145. }
  1146. .monitor-box1 {
  1147. height: 126px;
  1148. }
  1149. .state-box {
  1150. height: calc(100% - 24px);
  1151. overflow-y: auto;
  1152. }
  1153. }
  1154. .right-box {
  1155. width: 330px;
  1156. margin-top: 50px;
  1157. .control-group {
  1158. display: flex;
  1159. // justify-content: space-around;
  1160. flex-wrap: wrap;
  1161. height: 262px;
  1162. overflow-y: auto;
  1163. overflow-x: hidden;
  1164. .control-item {
  1165. width: 50%; //lxh
  1166. display: flex;
  1167. flex-direction: column;
  1168. justify-content: center;
  1169. align-items: center;
  1170. padding: 0 4px;
  1171. .control-item-title {
  1172. color: #a6dce9;
  1173. position: relative;
  1174. top: 5px;
  1175. }
  1176. .control-item-state {
  1177. // width: 94px;
  1178. width: 162px;
  1179. // height: 47px;
  1180. height: 36px;
  1181. background: url('/@/assets/images/vent/control-switch-bg.png');
  1182. background-size: 100% 100%;
  1183. display: flex;
  1184. justify-content: center;
  1185. align-items: center;
  1186. color: #fff;
  1187. }
  1188. .button-box {
  1189. position: relative;
  1190. padding: 5px;
  1191. border: 1px transparent solid;
  1192. background-clip: border-box;
  1193. border-radius: 5px;
  1194. margin-left: 8px;
  1195. }
  1196. .a-button {
  1197. pointer-events: auto;
  1198. }
  1199. &::v-deep .a-button--mini {
  1200. padding: 6px 10px;
  1201. }
  1202. &::v-deep .a-button--mini.is-round {
  1203. padding: 6px 10px;
  1204. }
  1205. }
  1206. }
  1207. }
  1208. .left-box {
  1209. width: 365px;
  1210. margin-top: 80px;
  1211. }
  1212. }
  1213. &:deep(.win) {
  1214. width: 100%;
  1215. margin: 0 !important;
  1216. }
  1217. }
  1218. }
  1219. &:deep(.main) {
  1220. .title {
  1221. height: 34px;
  1222. text-align: center;
  1223. font-weight: 600;
  1224. color: #7af5ff;
  1225. // background-image: url('../../../assets/img/yfj/light.png');
  1226. background-repeat: no-repeat;
  1227. background-position-x: center;
  1228. background-position-y: 100%;
  1229. background-size: 80%;
  1230. font-size: 16px;
  1231. }
  1232. .monitor-item {
  1233. width: 200px;
  1234. // width: auto;
  1235. display: flex;
  1236. flex-direction: row;
  1237. justify-content: space-between;
  1238. margin-bottom: 3px;
  1239. .monitor-title {
  1240. display: flex;
  1241. flex: 2;
  1242. justify-content: center;
  1243. align-items: center;
  1244. color: #7af5ff;
  1245. font-weight: 400;
  1246. font-size: 14px;
  1247. }
  1248. .monitor-val {
  1249. color: #ffb700;
  1250. display: flex;
  1251. // width: auto;
  1252. flex: 1;
  1253. justify-content: center;
  1254. align-items: center;
  1255. .val {
  1256. width: 100%;
  1257. text-align: center;
  1258. font-size: 14px;
  1259. }
  1260. // .unit {
  1261. // color: #ffffffbb;
  1262. // font-size: 14px;
  1263. // }
  1264. }
  1265. }
  1266. .signal-item {
  1267. display: flex;
  1268. justify-content: space-between;
  1269. // margin-bottom: 5px;
  1270. .signal-round {
  1271. display: inline-block;
  1272. width: 8px;
  1273. height: 8px;
  1274. border-radius: 50%;
  1275. margin: 0 10px;
  1276. position: relative;
  1277. &::after {
  1278. display: block;
  1279. content: '';
  1280. position: absolute;
  1281. width: 12px;
  1282. height: 12px;
  1283. top: -2px;
  1284. left: -2px;
  1285. border-radius: 50%;
  1286. }
  1287. }
  1288. .signal-round-gry {
  1289. background-color: #858585;
  1290. &::after {
  1291. background-color: #85858544;
  1292. box-shadow: 0 0 1px 1px #85858599;
  1293. }
  1294. }
  1295. .signal-round-run {
  1296. background-color: #67fc00;
  1297. &::after {
  1298. background-color: #67fc0044;
  1299. box-shadow: 0 0 1px 1px #c6ff77;
  1300. }
  1301. }
  1302. .signal-round-warning {
  1303. background-color: #e9170b;
  1304. &::after {
  1305. background-color: #e9170b44;
  1306. box-shadow: 0 0 1px 1px #e9170b;
  1307. }
  1308. }
  1309. }
  1310. }
  1311. :deep(.zxm-radio-wrapper) {
  1312. color: #fff !important;
  1313. }
  1314. </style>