index.vue 58 KB

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