index.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590
  1. <template>
  2. <div
  3. v-show="activeBtn == 'fanLocal-ssjc'"
  4. class="bg"
  5. style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden"
  6. >
  7. <a-spin :spinning="loading" />
  8. <div id="fanLocal3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  9. <div id="fanLocal3DCSS" class="threejs-Object-CSS" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
  10. <div style="z-index: -1; position: relative" v-if="hasPermission('show:sensorMonitor')">
  11. <div class="elementTag" id="inputBox1">
  12. <div class="elementContent" v-if="selectData.windSpeed1 || selectData.gas3 || selectData.windSpeed_merge || selectData.windQuantity1">
  13. <p v-if="selectData.windSpeed1 || selectData.windSpeed_merge"
  14. >风筒入口风速:<span class="value">{{
  15. selectData.windSpeed1 ? selectData.windSpeed1 : selectData.windSpeed_merge ? selectData.windSpeed_merge : '-'
  16. }}</span>
  17. <span class="unit"> m/s</span>
  18. </p>
  19. <p v-if="selectData.windInputSpeed1 || selectData.windInputSpeed_merge"
  20. >风筒入口风速:<span class="value">{{
  21. selectData.windInputSpeed1 ? selectData.windInputSpeed1 : selectData.windInputSpeed_merge ? selectData.windInputSpeed_merge : '-'
  22. }}</span>
  23. <span class="unit"> m/s</span>
  24. </p>
  25. <p v-if="selectData.windQuantity1 || selectData.inletAirVolume_merge"
  26. >风筒入口风量:<span class="value">{{
  27. selectData.windQuantity1 ? selectData.windQuantity1 : selectData.inletAirVolume_merge ? selectData.inletAirVolume_merge : '-'
  28. }}</span>
  29. <span class="unit"> m³/min</span>
  30. </p>
  31. <p v-if="selectData.gas3"
  32. >风筒入口瓦斯浓度: <span class="value">{{ selectData.gas3 ? selectData.gas3 : '-' }}</span>
  33. <span class="unit"> %</span>
  34. </p>
  35. </div>
  36. </div>
  37. <div class="elementTag" id="outBox">
  38. <div
  39. class="elementContent elementContent-r"
  40. v-if="
  41. selectData.windQuantity2 ||
  42. selectData.gas1 ||
  43. (selectData.windOutSpeed1 && selectData.windOutSpeed_merge) ||
  44. selectData.ductOutletAirVolume_merge
  45. "
  46. >
  47. <p v-if="selectData.windQuantity2 || selectData.m3 || selectData.ductOutletAirVolume_merge || selectData.windOutSpeed_merge">
  48. 迎头供风量:<span class="value">{{
  49. selectData.windQuantity2
  50. ? selectData.windQuantity2
  51. : selectData.m3
  52. ? selectData.m3
  53. : selectData.ductOutletAirVolume_merge
  54. ? selectData.ductOutletAirVolume_merge
  55. : '-'
  56. }}</span>
  57. <span class="unit"> m³/min</span>
  58. </p>
  59. <p v-if="selectData.gas1"
  60. >迎头瓦斯浓度:<span class="value">{{ selectData.gas1 ? selectData.gas1 : '-' }}</span>
  61. <span class="unit"> %</span>
  62. </p>
  63. <p v-if="selectData.windOutSpeed1 || selectData.windOutSpeed_merge"
  64. >风筒出口风速<span class="value">{{
  65. selectData.windOutSpeed1 ? selectData.windOutSpeed1 : selectData.windOutSpeed_merge ? selectData.windOutSpeed_merge : '-'
  66. }}</span>
  67. <span class="unit"> %</span>
  68. </p>
  69. </div>
  70. </div>
  71. <div class="elementTag" id="returnBox">
  72. <div class="elementContent elementContent-r" v-if="selectData.gas2">
  73. <p v-if="selectData.gas2"
  74. >回风流瓦斯浓度:<span class="value">{{ selectData.gas2 ? selectData.gas2 : '-' }}</span>
  75. <span class="unit"> %</span>
  76. </p>
  77. </div>
  78. </div>
  79. <div class="elementTag" id="gateBox">
  80. <div class="elementContent">
  81. <p>风门状态:关</p>
  82. <p>风门过风面积:{{ selectData.gas1 ? selectData.gas1 : '-' }}</p>
  83. </div>
  84. </div>
  85. <div class="elementTag" id="windownBox">
  86. <div class="elementContent" v-if="modalType == 'fc'">
  87. <p style="pointer-events: auto"
  88. ><a class="action-link" @click="goDetailDevice('window_fWindowM3')">风窗详情</a>
  89. <ArrowRightOutlined :style="{ color: '#157DC8' }" />
  90. </p>
  91. <p v-if="selectData.windSpeed"
  92. >风窗风流风速:<span class="value">{{ selectData.windSpeed ? selectData.windSpeed : '-' }}</span> <span class="unit"> m/s</span></p
  93. >
  94. <p v-if="selectData.fWindowM3"
  95. >风窗过风量:<span class="value">{{ selectData.fWindowM3 ? selectData.fWindowM3 : '-' }}</span> <span class="unit"> m³/min</span></p
  96. >
  97. <p v-if="selectData.OpenDegree"
  98. >风窗开度值:<span class="value">{{ selectData.OpenDegree ? selectData.OpenDegree : '-' }}</span> <span class="unit"> %</span></p
  99. >
  100. <p v-if="selectData.OpenDegree"
  101. >风窗过风面积:<span class="value">{{ selectData.frontArea ? selectData.frontArea : '-' }}</span> <span class="unit"> ㎡</span></p
  102. >
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="scene-box">
  109. <div class="top-box" v-if="!loading && activeBtn == 'fanLocal-ssjc'">
  110. <div class="top-center row">
  111. <!-- <div class="vent-flex-row" id="fanLocalSelectDom" v-if="!globalConfig?.simulatedPassword && getDictItemsByCode('fanlocaltype')">
  112. <span style="color: #00f5fe; margin-left: 5px">风机类型:</span>
  113. <JDictSelectTag
  114. style="width: 180px"
  115. v-model:value="devicekide"
  116. dictCode="fanlocaltype"
  117. :showChooseOption="false"
  118. :getPopupContainer="getPopupContainer"
  119. @change="changeDeviceKind"
  120. />
  121. </div> -->
  122. <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
  123. <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
  124. <div
  125. v-if="!(selectData.fanFrequencyType == 'fandp' && item.permission.startsWith('btn:frequency')) && hasPermission(item.permission)"
  126. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  127. @click="showModal(item)"
  128. >{{ item.value }}
  129. </div>
  130. </template>
  131. </div>
  132. <div class="top-right row">
  133. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  134. <div
  135. v-if="
  136. !(selectData.fanFrequencyType == 'fandp' && (item.permission === 'fanLocal:gasAlarmSet' || item.permission === 'fanLocal:kkjc')) &&
  137. hasPermission(item.permission)
  138. "
  139. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  140. @click="showModal(item)"
  141. >{{ item.value }}</div
  142. >
  143. </template>
  144. </div>
  145. </div>
  146. <div class="title-text">
  147. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  148. </div>
  149. <div class="data-show-box" v-if="!loading && activeBtn == 'fanLocal-ssjc'">
  150. <div class="data-item" v-if="leftColumns.length > 0">
  151. <div class="item-header">设备监测</div>
  152. <div class="item-container">
  153. <div class="tab">
  154. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
  155. >1#风机</div
  156. >
  157. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
  158. >2#风机</div
  159. >
  160. </div>
  161. <div class="container-group">
  162. <div class="warning-group">
  163. <template v-if="selectData.deviceType">
  164. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  165. <div class="item-icon">
  166. <CaretRightOutlined class="icon-style" />
  167. </div>
  168. <div class="item-name">{{ data.title }}</div>
  169. <div v-if="data.dataIndex.startsWith('Fan')">
  170. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  171. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  172. }}</div>
  173. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  174. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  175. }}</div>
  176. </div>
  177. <div v-else>
  178. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  179. </div>
  180. </div>
  181. </template>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <div>
  187. <div class="data-item" v-if="rightColumns.length > 0">
  188. <div class="item-header">环境监测/设备报警</div>
  189. <div class="item-container">
  190. <div class="tab">
  191. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
  192. >1#风机</div
  193. >
  194. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
  195. >2#风机</div
  196. >
  197. </div>
  198. <div class="container-group container-group-l">
  199. <div class="warning-group" style="max-height: 50%; overflow-y: auto">
  200. <template v-if="deviceType">
  201. <div v-for="(state, index) in rightColumns" :key="index">
  202. <template v-if="!state.dataIndex.endsWith('_w')">
  203. <div class="container-item">
  204. <div class="item-icon">
  205. <CaretRightOutlined class="icon-style" />
  206. </div>
  207. <div class="item-name">{{ state.title }}</div>
  208. <div v-if="state.dataIndex.startsWith('Fan')">
  209. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  210. selectData[state.dataIndex.replace('Fan', 'Fan1')] ? selectData[state.dataIndex.replace('Fan', 'Fan1')] : '-'
  211. }}</div>
  212. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  213. selectData[state.dataIndex.replace('Fan', 'Fan2')] ? selectData[state.dataIndex.replace('Fan', 'Fan2')] : '-'
  214. }}</div>
  215. </div>
  216. <div v-else>
  217. <div class="item-value">{{ selectData[state.dataIndex] ? selectData[state.dataIndex] : '-' }} </div>
  218. </div>
  219. </div>
  220. </template>
  221. </div>
  222. </template>
  223. </div>
  224. <div class="warning-group" style="max-height: 50%; overflow-y: auto">
  225. <div class="warning-header">
  226. <div class="header-item">
  227. <div class="header-title">报警数量</div>
  228. <div class="header-value">{{ selectData['warnLogNotOkCount'] }} </div>
  229. </div>
  230. </div>
  231. <template v-if="deviceType">
  232. <div v-for="(state, index) in leftColumns" :key="index">
  233. <template v-if="state.dataIndex.endsWith('_w')">
  234. <div class="warning-item">
  235. <div class="item-name"> <div class="icon"></div> {{ state.title }} </div>
  236. <div v-if="state.dataIndex.startsWith('Fan')">
  237. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  238. <div
  239. class="signal-round"
  240. :class="{
  241. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0',
  242. 'signal-round-warning':
  243. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined &&
  244. selectData[state.dataIndex.replace('Fan', 'Fan1')] == '1',
  245. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  246. }"
  247. ></div>
  248. <div class="vent-margin-l-8">{{
  249. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  250. ? '无状态'
  251. : selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0'
  252. ? '正常'
  253. : '异常'
  254. }}</div>
  255. </div>
  256. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  257. <div
  258. class="signal-round"
  259. :class="{
  260. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0',
  261. 'signal-round-warning':
  262. selectData[state.dataIndex.replace('Fan', 'Fan2')] != undefined &&
  263. selectData[state.dataIndex.replace('Fan', 'Fan2')] == '1',
  264. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined,
  265. }"
  266. ></div>
  267. <div class="vent-margin-l-8">{{
  268. selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined
  269. ? '无状态'
  270. : selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0'
  271. ? '正常'
  272. : '异常'
  273. }}</div>
  274. </div>
  275. </div>
  276. <div v-else>
  277. <div class="signal-item">
  278. <div
  279. class="signal-round vent-margin-l-8"
  280. :class="{
  281. 'signal-round-run': selectData[state.dataIndex] == '0',
  282. 'signal-round-warning': selectData[state.dataIndex] !== undefined && selectData[state.dataIndex] == '1',
  283. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  284. }"
  285. ></div>
  286. <div class="vent-margin-l-8">{{
  287. selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] == '0' ? '正常' : '异常'
  288. }}</div>
  289. </div>
  290. </div>
  291. </div>
  292. </template>
  293. </div>
  294. </template>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. <div
  303. v-if="renderPlayer"
  304. v-show="activeBtn == 'fanLocal-ssjc'"
  305. ref="playerRef"
  306. :class="{ 'to-right': rightColumns.length < 1 || leftColumns.length < 1, 'to-no-right': rightColumns.length > 0 && leftColumns.length > 0 }"
  307. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  308. >
  309. </div>
  310. <a-modal v-model:visible="modalIsShow" :title="modalTitle" :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }">
  311. <template #footer>
  312. <div v-if="controlType != 'startFan'">
  313. <a-button key="back" @click="cancel">返回</a-button>
  314. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
  315. </div>
  316. </template>
  317. <div class="modal-container">
  318. <div class="vent-flex-row">
  319. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  320. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  321. </div>
  322. <div class="" v-if="controlType == 'startSmoke'">
  323. <!-- 互斥控制 -->
  324. <div class="startSmoke-select">
  325. <div class="label">1#风机</div>
  326. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  327. <a-radio value="open">开启</a-radio>
  328. <a-radio value="stop">停止</a-radio>
  329. </a-radio-group>
  330. </div>
  331. <div class="startSmoke-select">
  332. <div class="label">2#风机</div>
  333. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  334. <a-radio value="open">开启</a-radio>
  335. <a-radio value="stop">停止</a-radio>
  336. </a-radio-group>
  337. </div>
  338. </div>
  339. <div class="" v-if="controlType == 'startFan'">
  340. <!-- 不互斥控制 -->
  341. <div class="startSmoke-select">
  342. <div class="label">1#风机:</div>
  343. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Open')">开启</div>
  344. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Stop')">停止</div>
  345. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
  346. </div>
  347. <div class="startSmoke-select">
  348. <div class="label">2#风机:</div>
  349. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
  350. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
  351. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
  352. </div>
  353. </div>
  354. <!-- 调频 -->
  355. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  356. <div class="label">1#机运行频率(Hz):</div>
  357. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  358. </div>
  359. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  360. <div class="label">2#机运行频率(Hz):</div>
  361. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  362. </div>
  363. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  364. <div class="label">风机运行频率(Hz):</div>
  365. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  366. </div>
  367. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  368. <div class="label">漏风率(%):</div>
  369. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  370. </div>
  371. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  372. <div class="label">风筒直径(m):</div>
  373. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  374. </div>
  375. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  376. <div class="label">风筒长度(m):</div>
  377. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  378. </div>
  379. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  380. <div class="label">风电闭锁限值(m³/min):</div>
  381. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  382. </div>
  383. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  384. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  385. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  386. </div>
  387. <div v-if="controlType == 'gasAlarmSet'">
  388. <div class="vent-flex-row input-box">
  389. <div class="label">设置瓦斯超限浓度:</div>
  390. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  391. </div>
  392. </div>
  393. <div v-if="controlType == 'gasAlarm'">
  394. <div class="vent-flex-row input-box">
  395. <div class="label">传感器名称:</div>
  396. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  397. </div>
  398. <div class="vent-flex-row input-box">
  399. <div class="label">传感器值:</div>
  400. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  401. </div>
  402. </div>
  403. <div v-if="controlType == 'airVolumeAlarm'">
  404. <div class="vent-flex-row input-box">
  405. <div class="label">风量上限(m³/min):</div>
  406. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  407. </div>
  408. <div class="vent-flex-row input-box">
  409. <div class="label">风量下限(m³/min):</div>
  410. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  411. </div>
  412. </div>
  413. <div class="vent-flex-row input-box" v-if="controlType == 'zhlk'">
  414. <div class="label">目标风量(m³/min):</div>
  415. <a-input-number size="small" v-model:value="targetVolume" />
  416. </div>
  417. <div v-if="controlType == 'gasOverSet'">
  418. <div class="vent-flex-row input-box">
  419. <div class="label">设置瓦斯超限浓度:</div>
  420. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  421. </div>
  422. </div>
  423. <!-- 启动或停止 -->
  424. <div class="" v-if="controlType == 'startSmoke'"> </div>
  425. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  426. <div class="label">操作密码:</div>
  427. <a-input size="small" type="password" v-model:value="passWord" />
  428. </div>
  429. </div>
  430. </a-modal>
  431. <fanlocalHistory v-if="activeBtn == 'fanLocal-history'" :selectData="selectData" :devicekide="devicekide" :deviceId="deviceId" />
  432. <fanlocalWarnHistory v-if="activeBtn == 'fanLocal-warn'" :devicekide="devicekide" :deviceId="deviceId" />
  433. <fanlocalOperateHistory v-if="activeBtn == 'fanLocal-operate'" :devicekide="devicekide" :deviceId="deviceId" />
  434. <fanlocalEchartLine v-if="activeBtn == 'fanLocal-wind'" :historyList="historyList" :chartsColumns="chartsColumns" :deviceId="deviceId" />
  435. <BottomMenu :nav-list="navList" @change="changeActive" />
  436. </template>
  437. <script setup lang="ts">
  438. import { ExclamationCircleFilled, ArrowRightOutlined } from '@ant-design/icons-vue';
  439. import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref, onBeforeUnmount } from 'vue';
  440. import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
  441. import fanlocalHistory from './components/fanlocal-history.vue';
  442. import fanlocalWarnHistory from './components/fanlocal-warn-history.vue';
  443. import fanlocalOperateHistory from './components/fanlocal-operate-history.vue';
  444. import fanlocalEchartLine from './components/fanlocal-echart-line.vue';
  445. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
  446. import lodash from 'lodash';
  447. import { getTableList, list, autoAdjust } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  448. import { chartsColumns1, navList } from './fanLocal.data';
  449. import { deviceControlApi } from '/@/api/vent/index';
  450. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  451. import { useRouter } from 'vue-router';
  452. import type { BasicColumn } from '/@/components/Table/src/types/table';
  453. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  454. import { getPopupContainer } from '/@/utils';
  455. import { getDictItemsByCode } from '/@/utils/dict';
  456. import { message } from 'ant-design-vue';
  457. import { useCamera } from '/@/hooks/system/useCamera';
  458. import { CaretRightOutlined } from '@ant-design/icons-vue';
  459. import { usePermission } from '/@/hooks/web/usePermission';
  460. import { useGlobSetting } from '/@/hooks/setting';
  461. import { useMessage } from '/@/hooks/web/useMessage';
  462. const globalConfig = inject('globalConfig');
  463. const { hasPermission } = usePermission();
  464. const { currentRoute } = useRouter();
  465. const router = useRouter();
  466. const { createConfirm } = useMessage();
  467. const globSetting = useGlobSetting();
  468. const modalTypeArr = reactive({
  469. leftBtnArr: [
  470. {
  471. key: 'startSmoke',
  472. value: '启停风机',
  473. permission: 'btn:openclose',
  474. },
  475. {
  476. key: 'startFan',
  477. value: '启停风机',
  478. permission: 'btn:openclose1',
  479. },
  480. {
  481. key: 'changeSmoke', // 主备两个点位
  482. value: '一键倒机',
  483. permission: 'btn:change',
  484. },
  485. {
  486. key: 'changeFan', // 主备一个点位
  487. value: '一键倒机',
  488. permission: 'btn:CtrlFanChange',
  489. },
  490. {
  491. key: 'fan1ToFan2',
  492. value: '1#倒2#',
  493. permission: 'btn:ctrlFan1ToFan2',
  494. },
  495. {
  496. key: 'fan2ToFan1',
  497. value: '2#倒1#',
  498. permission: 'btn:ctrlFan2ToFan1',
  499. },
  500. {
  501. key: 'Fan1Frequency',
  502. value: '1#调频',
  503. permission: 'btn:frequency',
  504. },
  505. {
  506. key: 'Fan2Frequency',
  507. value: '2#调频',
  508. permission: 'btn:frequency',
  509. },
  510. {
  511. key: 'FanFrequency',
  512. value: '风机调频',
  513. permission: 'btn:frequencyMerge',
  514. },
  515. {
  516. key: 'windPower',
  517. value: '风电闭锁',
  518. permission: 'fanLocal:fdbs',
  519. },
  520. {
  521. key: 'gasPower',
  522. value: '瓦斯电闭锁',
  523. permission: 'fanLocal:wsdbs',
  524. },
  525. {
  526. key: 'needAir',
  527. value: '需风量',
  528. permission: 'fanLocal:control',
  529. },
  530. ],
  531. rightBtnArr: [
  532. {
  533. key: 'gasAlarmSet',
  534. value: '瓦斯限值设定',
  535. permission: 'fanLocal:gasAlarmSet',
  536. },
  537. {
  538. key: 'gasOverSet', //
  539. value: '瓦斯限值设定',
  540. permission: 'fanLocal:gasOverSet',
  541. },
  542. {
  543. key: 'kkjc',
  544. value: '工况辅助决策',
  545. permission: 'fanLocal:kkjc',
  546. },
  547. {
  548. key: 'zhlk',
  549. value: '自主联控',
  550. permission: 'fanLocal:zhlk',
  551. },
  552. {
  553. key: 'diameter',
  554. value: '风筒直径',
  555. permission: 'fanLocal:control',
  556. },
  557. {
  558. key: 'diameter',
  559. value: '风筒直径',
  560. permission: 'fanLocal:control',
  561. },
  562. {
  563. key: 'len',
  564. value: '风筒长度',
  565. permission: 'fanLocal:control',
  566. },
  567. // {
  568. // key: 'frequency',
  569. // value: '调频',
  570. // permission: 'fanLocal:control',
  571. // },
  572. {
  573. key: 'windPowerLimit',
  574. value: '风电闭锁限值',
  575. permission: 'fanLocal:control',
  576. },
  577. {
  578. key: 'gasPowerLimit',
  579. value: '瓦斯电闭锁限值',
  580. permission: 'fanLocal:control',
  581. },
  582. {
  583. key: 'airVolumeAlarm',
  584. value: '风量报警',
  585. permission: 'fanLocal:control',
  586. min: 0,
  587. max: 100,
  588. },
  589. {
  590. key: 'disAirAlarm',
  591. value: '漏风率报警',
  592. permission: 'fanLocal:control',
  593. },
  594. // {
  595. // key: 'gasAlarm',
  596. // value: '瓦斯报警',
  597. // permission: 'fanLocal:control',
  598. // },
  599. ],
  600. });
  601. const sensorList = ref<any[]>([
  602. {
  603. value: '1',
  604. label: 'T1',
  605. },
  606. {
  607. value: '2',
  608. label: 'T2',
  609. },
  610. {
  611. value: '3',
  612. label: 'T3',
  613. },
  614. ]);
  615. const scroll = reactive({
  616. y: 180,
  617. });
  618. const deviceTypeDicts = getDictItemsByCode('fanlocaltype');
  619. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  620. const playerRef = ref();
  621. const renderPlayer = ref(true);
  622. const modalSensor = ref(null);
  623. const loading = ref(false);
  624. const player1 = ref();
  625. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  626. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  627. const fan1FrequencyVal = ref(40); //主机频率
  628. const fan2FrequencyVal = ref(40); //备机频率
  629. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  630. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  631. const fanControl = ref('');
  632. const targetVolume = ref(600);
  633. const historyList = ref([]);
  634. const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
  635. const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : chartsColumns1;
  636. const passWord = ref('');
  637. // 默认初始是第一行
  638. const selectRowIndex = ref(0);
  639. const dataMonitorRowIndex = ref(0);
  640. // 默认数据右边监测的是主机
  641. const warningMonitorRowIndex = ref(0);
  642. const xAxisDataGas = ref([]);
  643. // 设备数据
  644. const controlType = ref('');
  645. const modalType = ref('');
  646. // 监测数据
  647. const initData = {
  648. deviceID: '',
  649. deviceType: '',
  650. strname: '',
  651. dataDh: '-', //压差
  652. dataDtestq: '-', //测试风量
  653. sourcePressure: '-', //气源压力
  654. dataDequivalarea: '-',
  655. netStatus: '0', //通信状态
  656. warnLevel_str: '',
  657. stationname: '',
  658. fanFrequencyType: '',
  659. };
  660. const frequencyVal = ref(0);
  661. const dataSource = ref([]);
  662. // const historySource = ref([]);
  663. // 关联设备信息
  664. const linkDeviceInfo = ref({});
  665. // 监测数据
  666. let selectData = reactive(lodash.cloneDeep(initData));
  667. const rightColumns = ref<BasicColumn[]>([]);
  668. const leftColumns = ref<BasicColumn[]>([]);
  669. const devicekide = ref('');
  670. const deviceType = ref(selectData.deviceType);
  671. const deviceId = ref('');
  672. const headElHeight = ref(0);
  673. let btnClick = ref(true); // 判断按钮是否可点
  674. //报表导出
  675. // let editID = ref<any>('');
  676. // let fileType = ref('');
  677. // https获取监测数据
  678. let timer: null | NodeJS.Timeout | undefined = null;
  679. const { getCamera, removeCamera } = useCamera();
  680. watch(deviceType, (type) => {
  681. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  682. if (rightColumns.value && rightColumns.value.length < 1) {
  683. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  684. }
  685. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  686. if (leftColumns.value && leftColumns.value.length < 1) {
  687. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  688. }
  689. });
  690. const flvURL1 = () => {
  691. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  692. return '';
  693. };
  694. const activeBtn = ref('fanLocal-ssjc');
  695. async function changeActive(activeValue) {
  696. activeBtn.value = activeValue;
  697. if (activeBtn.value !== 'fanLocal-ssjc') {
  698. timer = undefined;
  699. clearTimeout(timer);
  700. } else {
  701. timer = null;
  702. await getMonitor(true);
  703. }
  704. }
  705. const selectDevice = (key, val) => {
  706. if (key === 'dataMonitorRowIndex') {
  707. dataMonitorRowIndex.value = val;
  708. } else {
  709. warningMonitorRowIndex.value = val;
  710. }
  711. };
  712. function goDetailDevice(linkDeviceCode) {
  713. let linkDeviceId = '';
  714. if (linkDeviceCode.startsWith('window')) {
  715. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  716. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  717. }
  718. }
  719. //
  720. async function getDataSource() {
  721. if (devicekide.value) {
  722. const res = await list({ devicetype: devicekide.value, ids: deviceId.value, pagetype: 'normal' });
  723. // const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  724. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  725. const dataArr = res.msgTxt[0].datalist || [];
  726. dataSource.value = [];
  727. selectRowIndex.value = dataArr.findIndex((item) => item.deviceID === deviceId.value);
  728. if (selectRowIndex.value > -1) {
  729. if (!deviceType.value) deviceType.value = dataArr[selectRowIndex.value]['deviceType'];
  730. let data = dataArr[selectRowIndex.value];
  731. const readData = data.readData;
  732. data = Object.assign(data, readData);
  733. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  734. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  735. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  736. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  737. data['windQuantity2'] =
  738. data['windQuantity2'] ||
  739. data['m3'] ||
  740. data['ductOutletAirVolume_merge'] ||
  741. data['windOutSpeed_merge'] ||
  742. data['windOutSpeed1'] ||
  743. data['windOutSpeed2'] ||
  744. data['windOutSpeed_merge'];
  745. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  746. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  747. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  748. // }
  749. Object.assign(selectData, data);
  750. if (selectRowIndex.value > -1) {
  751. let echartsData = dataArr[selectRowIndex.value]['history'] || [];
  752. echartsData = echartsData.filter((item) => {
  753. item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
  754. item['windQuantity2'] =
  755. item['windQuantity2'] ||
  756. item['m3'] ||
  757. item['ductOutletAirVolume_merge'] ||
  758. item['windOutSpeed_merge'] ||
  759. item['windOutSpeed1'] ||
  760. item['windOutSpeed2'] ||
  761. item['windOutSpeed_merge'];
  762. return true;
  763. });
  764. historyList.value = echartsData;
  765. }
  766. }
  767. } else {
  768. return (dataSource.value = []);
  769. }
  770. } else {
  771. dataSource.value = [];
  772. }
  773. }
  774. async function getMonitor(flag?) {
  775. if (Object.prototype.toString.call(timer) === '[object Null]') {
  776. timer = await setTimeout(
  777. async () => {
  778. // debugger;
  779. // for (const key in selectData) {
  780. // selectData[key] = '';
  781. // }
  782. await getDataSource();
  783. // if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  784. // deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  785. // if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  786. // Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  787. // }
  788. // }
  789. playSmoke(selectData);
  790. addText(selectData);
  791. // historySource.value = selectData.history;
  792. if (timer) {
  793. timer = null;
  794. }
  795. getMonitor();
  796. },
  797. flag ? 0 : 1000
  798. );
  799. }
  800. }
  801. // 获取设备基本信息列表
  802. const deviceBaseList = ref([]);
  803. function getDeviceBaseList() {
  804. getTableList({ pageSize: 1000 }).then((res) => {
  805. deviceBaseList.value = res.records;
  806. });
  807. }
  808. // 打开并设置modal的标题
  809. function showModal(obj) {
  810. if (!btnClick.value) return;
  811. if (obj.key == 'kkjc') {
  812. gasWarningVal.value = 0.6;
  813. // 工况辅助决策
  814. openAssistance(true, {});
  815. return;
  816. }
  817. controlType.value = obj.key;
  818. modalTitle.value = obj.value;
  819. passWord.value = '';
  820. modalIsShow.value = true;
  821. }
  822. function changeMotor(e) {
  823. const target = e.target;
  824. if (target.name === 'localWind1') {
  825. if (target.value === 'open') {
  826. mainWindIsShow2.value = 'stop';
  827. }
  828. } else if (target.name === 'localWind2') {
  829. if (target.value === 'open') {
  830. mainWindIsShow1.value = 'stop';
  831. }
  832. }
  833. }
  834. function handleOk(control?) {
  835. if (passWord.value == '') {
  836. message.warning('请输入密码!');
  837. return;
  838. }
  839. createConfirm({
  840. iconType: 'warning',
  841. title: '控制',
  842. content: '您确定要控制吗?',
  843. onOk: () => handerFn(),
  844. });
  845. const handerFn = () => {
  846. const handType = controlType.value;
  847. const data = {
  848. deviceid: selectData.deviceID,
  849. devicetype: selectData.deviceType,
  850. paramcode: '',
  851. password: passWord.value || globalConfig?.simulatedPassword,
  852. value: null,
  853. };
  854. if (handType === 'startSmoke') {
  855. // 启动风机
  856. // 以下是互斥
  857. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  858. // playSmoke(handType, 'top', frequency, 'open');
  859. data.paramcode = 'CtrlFan1Start';
  860. deviceControlApi(data)
  861. .then((res) => {
  862. if (res.success) {
  863. if (globalConfig.History_Type == 'remote') {
  864. message.success('指令已下发至生产管控平台成功!');
  865. } else {
  866. message.success('指令已下发成功!');
  867. }
  868. modalTitle.value = '';
  869. modalIsShow.value = false;
  870. } else {
  871. message.error(res.message);
  872. }
  873. })
  874. .catch((err) => {
  875. // modalIsShow.value = true;
  876. });
  877. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  878. // playSmoke(handType, 'down', frequency, 'open');
  879. data.paramcode = 'CtrlFan2Start';
  880. deviceControlApi(data)
  881. .then(() => {
  882. if (res.success) {
  883. if (globalConfig.History_Type == 'remote') {
  884. message.success('指令已下发至生产管控平台成功!');
  885. } else {
  886. message.success('指令已下发成功!');
  887. }
  888. modalTitle.value = '';
  889. modalIsShow.value = false;
  890. } else {
  891. message.error(res.message);
  892. }
  893. })
  894. .catch((err) => {});
  895. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  896. // playSmoke(handType, '', frequency, 'stop');
  897. }
  898. } else if (handType === 'startFan') {
  899. if (control === 'Fan1Open') {
  900. data.paramcode = 'CtrlFan1Start';
  901. } else if (control === 'Fan2Open') {
  902. data.paramcode = 'CtrlFan2Start';
  903. } else if (control === 'Fan1Stop') {
  904. data.paramcode = 'CtrlFan1Stop';
  905. } else if (control === 'Fan2Stop') {
  906. data.paramcode = 'CtrlFan2Stop';
  907. } else if (control === 'Fan1Reset') {
  908. data.paramcode = 'CtrlFan1Reset';
  909. } else if (control === 'Fan2Reset') {
  910. data.paramcode = 'CtrlFan2Reset';
  911. }
  912. deviceControlApi(data)
  913. .then((res) => {
  914. if (res.success) {
  915. if (globalConfig.History_Type == 'remote') {
  916. message.success('指令已下发至生产管控平台成功!');
  917. } else {
  918. message.success('指令已下发成功!');
  919. }
  920. modalTitle.value = '';
  921. modalIsShow.value = false;
  922. } else {
  923. message.error(res.message);
  924. }
  925. })
  926. .catch((err) => {
  927. btnClick.value = true;
  928. });
  929. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  930. // 调频
  931. if (handType === 'Fan1Frequency') {
  932. data.paramcode = 'Fan1FreqHz';
  933. data.value = fan1FrequencyVal.value;
  934. } else if (handType === 'Fan2Frequency') {
  935. data.paramcode = 'Fan2FreqHz';
  936. data.value = fan2FrequencyVal.value;
  937. } else if (handType === 'FanFrequency') {
  938. data.paramcode = 'FreqHz_merge';
  939. data.value = fan1FrequencyVal.value;
  940. }
  941. deviceControlApi(data)
  942. .then((res) => {
  943. if (res.success) {
  944. if (globalConfig.History_Type == 'remote') {
  945. message.success('指令已下发至生产管控平台成功!');
  946. } else {
  947. message.success('指令已下发成功!');
  948. }
  949. modalTitle.value = '';
  950. modalIsShow.value = false;
  951. } else {
  952. message.error(res.message);
  953. }
  954. })
  955. .catch((err) => {});
  956. } else if (handType === 'changeSmoke') {
  957. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  958. data.paramcode = 'CtrlFan1Start';
  959. deviceControlApi(data)
  960. .then((res) => {
  961. if (res.success) {
  962. if (globalConfig.History_Type == 'remote') {
  963. message.success('指令已下发至生产管控平台成功!');
  964. } else {
  965. message.success('指令已下发成功!');
  966. }
  967. modalTitle.value = '';
  968. modalIsShow.value = false;
  969. } else {
  970. message.error(res.message);
  971. }
  972. mainWindIsShow1.value = 'stop';
  973. mainWindIsShow2.value = 'open';
  974. })
  975. .catch((err) => {});
  976. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  977. data.paramcode = 'CtrlFan2Start';
  978. deviceControlApi(data)
  979. .then((res) => {
  980. if (res.success) {
  981. if (globalConfig.History_Type == 'remote') {
  982. message.success('指令已下发至生产管控平台成功!');
  983. } else {
  984. message.success('指令已下发成功!');
  985. }
  986. modalTitle.value = '';
  987. modalIsShow.value = false;
  988. } else {
  989. message.error(res.message);
  990. }
  991. mainWindIsShow1.value = 'open';
  992. mainWindIsShow2.value = 'stop';
  993. })
  994. .catch((err) => {});
  995. }
  996. // // 一键倒机
  997. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  998. // // playSmoke('startSmoke', 'down', frequency, 'open');
  999. // data.paramcode = 'CtrlFan2Start';
  1000. // deviceControlApi(data).then((res) => {
  1001. // console.log('设备操作结果', res);
  1002. // modalTitle.value = '';
  1003. // modalIsShow.value = false;
  1004. // }).catch((err) => {
  1005. // });
  1006. // mainWindIsShow1.value = 'stop';
  1007. // mainWindIsShow2.value = 'open';
  1008. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1009. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1010. // data.paramcode = 'CtrlFan1Start';
  1011. // deviceControlApi(data).then((res) => {
  1012. // console.log('设备操作结果', res);
  1013. // modalTitle.value = '';
  1014. // modalIsShow.value = false;
  1015. // }).catch((err) => {
  1016. // });
  1017. // mainWindIsShow1.value = 'open';
  1018. // mainWindIsShow2.value = 'stop';
  1019. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1020. // // playSmoke(handType, '', frequency, 'stop');
  1021. // }
  1022. } else if (handType === 'changeFan') {
  1023. data.paramcode = 'CtrlFanStart';
  1024. deviceControlApi(data)
  1025. .then((res) => {
  1026. if (res.success) {
  1027. if (globalConfig.History_Type == 'remote') {
  1028. message.success('指令已下发至生产管控平台成功!');
  1029. } else {
  1030. message.success('指令已下发成功!');
  1031. }
  1032. } else {
  1033. message.error(res.message);
  1034. }
  1035. modalTitle.value = '';
  1036. modalIsShow.value = false;
  1037. })
  1038. .catch((err) => {});
  1039. } else if (handType === 'fan1ToFan2') {
  1040. data.paramcode = 'CtrlFan1ToFan2';
  1041. deviceControlApi(data).then((res) => {
  1042. if (res.success) {
  1043. if (globalConfig.History_Type == 'remote') {
  1044. message.success('指令已下发至生产管控平台成功!');
  1045. } else {
  1046. message.success('指令已下发成功!');
  1047. }
  1048. modalTitle.value = '';
  1049. modalIsShow.value = false;
  1050. } else {
  1051. message.error(res.message);
  1052. }
  1053. });
  1054. } else if (handType === 'fan2ToFan1') {
  1055. data.paramcode = 'CtrlFan2ToFan1';
  1056. deviceControlApi(data).then((res) => {
  1057. if (res.success) {
  1058. if (globalConfig.History_Type == 'remote') {
  1059. message.success('指令已下发至生产管控平台成功!');
  1060. } else {
  1061. message.success('指令已下发成功!');
  1062. }
  1063. modalTitle.value = '';
  1064. modalIsShow.value = false;
  1065. } else {
  1066. message.error(res.message);
  1067. }
  1068. });
  1069. } else if (handType === 'gasAlarmSet') {
  1070. if (passWord.value != '123456') {
  1071. message.error('密码错误,请重新输入!');
  1072. return;
  1073. }
  1074. if (gasWarningVal.value) {
  1075. modalTitle.value = '';
  1076. modalIsShow.value = false;
  1077. setTimeout(() => {
  1078. passWord.value = '';
  1079. modalIsShow.value = true;
  1080. controlType.value = 'toGkjc';
  1081. modalTitle.value = '工况决策辅助';
  1082. }, 500);
  1083. } else {
  1084. message.error('请核对瓦斯超限浓度值!');
  1085. }
  1086. } else if (handType === 'toGkjc') {
  1087. if (passWord.value != '123456') {
  1088. message.error('密码错误,请重新输入!');
  1089. return;
  1090. }
  1091. //进行工况决策
  1092. if (selectData.Fan1StartStatus == '1') {
  1093. openAssistance(true, {
  1094. // m3: selectData.m3 || 675.87,
  1095. m3: 675.87,
  1096. frequency: 30,
  1097. // m3: 525.87, //5.0测试数据
  1098. // frequency: 35,
  1099. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1100. gasWarningVal: gasWarningVal.value,
  1101. isCompute: false,
  1102. });
  1103. } else if (selectData.Fan2StartStatus == '1') {
  1104. openAssistance(true, {
  1105. // m3: selectData.m3 || 675.87,
  1106. m3: 675.87,
  1107. frequency: 30,
  1108. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1109. gasWarningVal: gasWarningVal.value,
  1110. isCompute: false,
  1111. });
  1112. } else {
  1113. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1114. openAssistance(true);
  1115. }
  1116. modalTitle.value = '';
  1117. modalIsShow.value = false;
  1118. } else if (handType === 'zhlk' || handType === 'gasOverSet') {
  1119. if (targetVolume.value) {
  1120. const params =
  1121. handType === 'zhlk'
  1122. ? { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume.value }
  1123. : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
  1124. autoAdjust(params).then(() => {
  1125. if (res.success) {
  1126. if (globalConfig.History_Type == 'remote') {
  1127. message.success('指令已下发至生产管控平台成功!');
  1128. } else {
  1129. message.success('指令已下发成功!');
  1130. }
  1131. modalTitle.value = '';
  1132. modalIsShow.value = false;
  1133. } else {
  1134. message.error(res.message);
  1135. }
  1136. });
  1137. }
  1138. }
  1139. };
  1140. }
  1141. function cancel() {
  1142. modalTitle.value = '';
  1143. modalIsShow.value = false;
  1144. gasWarningVal.value = 0;
  1145. }
  1146. function handleChangeSensor(value: string) {
  1147. console.log(value);
  1148. }
  1149. function addPlayVideo() {
  1150. if (player1.value && player1.value.play) {
  1151. if (!player1.value.paused()) player1.value.play();
  1152. document.body.removeEventListener('mousedown', addPlayVideo);
  1153. }
  1154. }
  1155. onBeforeMount(() => {
  1156. getDeviceBaseList();
  1157. });
  1158. onMounted(async () => {
  1159. const { query } = unref(currentRoute);
  1160. if (query['deviceType']) {
  1161. devicekide.value = query['deviceType'] as string;
  1162. deviceId.value = query['id'] as string;
  1163. }
  1164. mountedThree(player1.value).then(async () => {
  1165. await getMonitor(true);
  1166. nextTick(async () => {
  1167. setModelType('fc');
  1168. addCssText();
  1169. });
  1170. });
  1171. await getCamera(deviceId.value, playerRef, renderPlayer);
  1172. document.body.addEventListener('mousedown', addPlayVideo, false);
  1173. });
  1174. onBeforeUnmount(() => {
  1175. removeCamera(playerRef);
  1176. });
  1177. onUnmounted(() => {
  1178. destroy();
  1179. if (timer) {
  1180. clearTimeout(timer);
  1181. timer = undefined;
  1182. }
  1183. });
  1184. </script>
  1185. <style scoped lang="less">
  1186. @import '/@/design/theme.less';
  1187. @import '/@/design/vent/modal.less';
  1188. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1189. height: 100%;
  1190. }
  1191. :deep(.zxm-tabs-content) {
  1192. height: 100%;
  1193. }
  1194. @{theme-deepblue} {
  1195. .scene-box {
  1196. --image-lr-top-bg: url('/@/assets/images/themify/deepblue/vent/lr-top-bg.png');
  1197. --image-lr-tab-bg: url('/@/assets/images/themify/deepblue/vent/lr-tab-bg.png');
  1198. --image-l-tab-active: url('/@/assets/images/themify/deepblue/vent/l-tab-active.png');
  1199. --image-r-tab-active: url('/@/assets/images/themify/deepblue/vent/r-tab-active.png');
  1200. --image-plane-bottom: url('/@/assets/images/themify/deepblue/vent/plane-bottom.png');
  1201. --image-plane-icon-bg: url('/@/assets/images/themify/deepblue/vent/plane-icon-bg.png');
  1202. --container-group-bg: linear-gradient(to right, #ffffff22, #53576305);
  1203. }
  1204. }
  1205. .scene-box {
  1206. --image-lr-top-bg: url('/@/assets/images/vent/lr-top-bg.png');
  1207. --image-lr-tab-bg: url('/@/assets/images/vent/lr-tab-bg.png');
  1208. --image-l-tab-active: url('/@/assets/images/vent/l-tab-active.png');
  1209. --image-r-tab-active: url('/@/assets/images/vent/r-tab-active.png');
  1210. --image-plane-bottom: url('/@/assets/images/vent/plane-bottom.png');
  1211. --image-plane-icon-bg: url('/@/assets/images/vent/plane-icon-bg.png');
  1212. --container-group-bg: linear-gradient(to right, #00deff22, #2081ff05);
  1213. .title-text {
  1214. height: 32px;
  1215. }
  1216. }
  1217. .data-show-box {
  1218. position: relative;
  1219. display: flex;
  1220. flex-direction: row;
  1221. justify-content: space-between;
  1222. padding: 10px 5px;
  1223. color: var(--vent-font-color);
  1224. z-index: 999;
  1225. top: 60px;
  1226. .data-item {
  1227. pointer-events: auto;
  1228. .item-header {
  1229. width: 374px;
  1230. background: var(--image-lr-top-bg) no-repeat;
  1231. background-size: auto;
  1232. height: 32px;
  1233. text-align: center;
  1234. line-height: 34px;
  1235. font-size: 15px;
  1236. font-weight: 600;
  1237. color: #fafafa;
  1238. }
  1239. .item-container {
  1240. width: 346px;
  1241. margin: 0 14px;
  1242. padding: 10px;
  1243. background: #00377c33;
  1244. backdrop-filter: blur(2px);
  1245. .tab {
  1246. width: 323px;
  1247. background: var(--image-lr-tab-bg) no-repeat;
  1248. display: flex;
  1249. .tab-item {
  1250. flex: 1;
  1251. text-align: center;
  1252. padding-top: 2px;
  1253. color: #ffffff99;
  1254. cursor: pointer;
  1255. }
  1256. .tab-item-active-l {
  1257. color: var(--vent-font-action-link);
  1258. background-image: var(--image-l-tab-active);
  1259. background-repeat: no-repeat;
  1260. background-size: auto;
  1261. background-position: 6px 3px;
  1262. }
  1263. .tab-item-active-r {
  1264. color: var(--vent-font-action-link);
  1265. background-image: var(--image-r-tab-active);
  1266. background-repeat: no-repeat;
  1267. background-position: 0 3px;
  1268. }
  1269. }
  1270. .container-group {
  1271. width: 314px;
  1272. margin: 0px 4px;
  1273. padding: 10px 0;
  1274. min-height: 432px;
  1275. background: var(--container-group-bg);
  1276. max-height: 440px;
  1277. overflow-y: auto;
  1278. }
  1279. .container-item {
  1280. width: 100%;
  1281. height: 60px;
  1282. display: flex;
  1283. padding: 10px 0 0 20px;
  1284. margin-bottom: 5px;
  1285. position: relative;
  1286. background: var(--image-plane-bottom) no-repeat;
  1287. background-size: auto;
  1288. background-position: bottom;
  1289. &::before {
  1290. content: '';
  1291. display: block;
  1292. width: 100%;
  1293. height: 5px;
  1294. position: absolute;
  1295. top: 62px;
  1296. left: 0;
  1297. background-color: #73f4ff66;
  1298. backdrop-filter: blur(5px);
  1299. }
  1300. .item-icon {
  1301. width: 54px;
  1302. height: 45px;
  1303. background: var(--image-plane-icon-bg) no-repeat;
  1304. background-size: cover;
  1305. .icon-style {
  1306. font-size: 18px;
  1307. margin: 10px 0 0 20px;
  1308. color: #ffc800;
  1309. }
  1310. }
  1311. .item-name {
  1312. width: 180px;
  1313. line-height: 60px;
  1314. }
  1315. .item-value {
  1316. position: relative;
  1317. height: 26px;
  1318. line-height: 24px;
  1319. margin: 15px 0;
  1320. text-align: center;
  1321. width: 80px;
  1322. border: 1px solid var(--vent-base-border);
  1323. border-radius: 13px;
  1324. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1325. &::before {
  1326. width: 6px;
  1327. height: 6px;
  1328. content: '';
  1329. position: absolute;
  1330. left: -3px;
  1331. top: 8px;
  1332. background: #ffa500;
  1333. border-radius: 3px;
  1334. }
  1335. }
  1336. }
  1337. .warning-header {
  1338. display: flex;
  1339. font-size: 14px;
  1340. .header-item {
  1341. flex: 1;
  1342. display: flex;
  1343. justify-content: center;
  1344. align-items: center;
  1345. .header-title {
  1346. color: var(--vent-font-color);
  1347. margin-top: 10px;
  1348. }
  1349. .header-value {
  1350. // width: 133px;
  1351. height: 36px;
  1352. font-weight: 600;
  1353. font-family: 'douyuFont';
  1354. font-size: 16px;
  1355. color: #ffa500;
  1356. display: flex;
  1357. justify-content: center;
  1358. align-items: center;
  1359. margin-top: 15px;
  1360. margin-left: 8px;
  1361. }
  1362. }
  1363. }
  1364. .warning-group {
  1365. padding: 0 10px;
  1366. position: relative;
  1367. .warning-item {
  1368. display: flex;
  1369. flex-direction: row;
  1370. justify-content: space-between;
  1371. align-items: center;
  1372. height: 38px;
  1373. .item-name {
  1374. display: flex;
  1375. align-items: center;
  1376. // padding-left: 5px;
  1377. .icon {
  1378. width: 6px;
  1379. height: 6px;
  1380. display: inline-block;
  1381. background-color: var(--vent-base-light-bg);
  1382. border-radius: 3px;
  1383. position: relative;
  1384. margin-right: 8px;
  1385. &::before {
  1386. content: '';
  1387. width: 10px;
  1388. height: 10px;
  1389. display: block;
  1390. border: 1px solid #34edff99;
  1391. border-radius: 5px;
  1392. position: absolute;
  1393. top: -2px;
  1394. left: -2px;
  1395. }
  1396. }
  1397. &::before {
  1398. content: '';
  1399. display: block;
  1400. width: 1px;
  1401. height: 38px;
  1402. position: absolute;
  1403. left: 12px;
  1404. background-color: var(--vent-base-light-bg);
  1405. }
  1406. }
  1407. }
  1408. }
  1409. .warning-group-r {
  1410. &::before {
  1411. content: '';
  1412. display: block;
  1413. width: 1px;
  1414. height: 100%;
  1415. position: absolute;
  1416. left: 12px;
  1417. background-color: var(--vent-base-light-bg);
  1418. }
  1419. }
  1420. }
  1421. }
  1422. }
  1423. .input-box {
  1424. display: flex;
  1425. align-items: center;
  1426. .input-title {
  1427. color: #73e8fe;
  1428. width: auto;
  1429. }
  1430. margin-right: 10px;
  1431. }
  1432. .label {
  1433. max-width: 220px;
  1434. }
  1435. #fanLocalSelectDom {
  1436. :deep(.@{ventSpace}-select-dropdown) {
  1437. left: 0px !important;
  1438. top: 35px !important;
  1439. }
  1440. }
  1441. .@{ventSpace}-input {
  1442. width: 150px;
  1443. }
  1444. :deep(#LivePlayerBox) {
  1445. display: flex;
  1446. flex-direction: row;
  1447. justify-content: flex-end;
  1448. padding-right: 380px;
  1449. pointer-events: none;
  1450. .video-parent {
  1451. height: 208px;
  1452. pointer-events: auto !important;
  1453. }
  1454. }
  1455. .to-right {
  1456. :deep(#LivePlayerBox) {
  1457. padding-right: 0px;
  1458. }
  1459. }
  1460. :deep(.button-box) {
  1461. position: relative;
  1462. padding: 5px;
  1463. // border: 1px transparent solid;
  1464. border-radius: 5px;
  1465. margin-left: 8px;
  1466. margin-right: 8px;
  1467. width: auto;
  1468. // height: 40px;
  1469. // border: 1px solid #65dbea;
  1470. height: 35px !important;
  1471. display: flex;
  1472. align-items: center;
  1473. justify-content: center;
  1474. color: var(--vent-font-color);
  1475. padding: 0 15px 5px 15px;
  1476. cursor: pointer;
  1477. &:hover {
  1478. background: var(--vent-device-manager-control-btn-hover);
  1479. }
  1480. &::before {
  1481. width: calc(100% - 6px);
  1482. height: 27px;
  1483. content: '';
  1484. position: absolute;
  1485. top: 3px;
  1486. right: 0;
  1487. left: 3px;
  1488. bottom: 0;
  1489. z-index: -1;
  1490. border-radius: inherit;
  1491. /*important*/
  1492. background: var(--vent-device-manager-control-btn);
  1493. }
  1494. &::after {
  1495. width: calc(100% + 32px);
  1496. height: 10px;
  1497. content: '';
  1498. position: absolute;
  1499. top: 28px;
  1500. right: 0;
  1501. left: -16px;
  1502. bottom: 0;
  1503. z-index: -1;
  1504. border-radius: inherit;
  1505. /*important*/
  1506. background-position: center;
  1507. background-size: 100%;
  1508. z-index: 999;
  1509. }
  1510. }
  1511. </style>