index.vue 57 KB

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