index.vue 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052
  1. <template>
  2. <component
  3. ref="modelRef"
  4. :loading="loading"
  5. :is="modelComponent"
  6. :selectData="selectData"
  7. :modalType="modalType"
  8. :fanDualArray="fanDualArray"
  9. @go-detail-device="goDetailDevice"
  10. />
  11. <div class="scene-box">
  12. <div class="top-box" v-if="!loading">
  13. <div class="top-center row">
  14. <div class="vent-flex-row" id="fanLocalSelectDom" v-if="!globalConfig?.simulatedPassword && getDictItemsByCode('fanlocaltype')">
  15. <span style="color: var(--vent-font-color); margin-left: 5px">风机类型:</span>
  16. <JDictSelectTag
  17. style="width: 180px"
  18. v-model:value="devicekide"
  19. dictCode="fanlocaltype"
  20. :showChooseOption="false"
  21. :getPopupContainer="getPopupContainer"
  22. @change="changeDeviceKind"
  23. />
  24. </div>
  25. <!-- fanlocal_systeml_zj 模拟局部风机,不显示操作按钮 -->
  26. <template v-for="(item, index) in modalTypeArr.leftBtnArr" :key="index">
  27. <template v-if="hasPermission(item.permission)">
  28. <div :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{ item.value }} </div>
  29. </template>
  30. </template>
  31. </div>
  32. <div class="top-right row">
  33. <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
  34. <div v-if="hasPermission(item.permission)" :class="{ 'button-box': btnClick, 'button-disable': !btnClick }" @click="showModal(item)">{{
  35. item.value
  36. }}</div>
  37. <!-- <div
  38. v-if="
  39. item.permission === 'fanLocal:gasAlarmSet' ||
  40. item.permission === 'fanLocal:kkjc' ||
  41. item.permission === 'fanLocal:supplyAir' ||
  42. item.permission === 'fanLocal:dischargeGas'
  43. "
  44. :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
  45. @click="showModal(item)"
  46. >{{ item.value }}</div
  47. > -->
  48. </template>
  49. </div>
  50. </div>
  51. <div class="title-text">
  52. {{ selectData.supplyAirAddr || selectData.strinstallpos || selectData.stationname }}
  53. </div>
  54. <div class="data-show-box" v-if="!loading">
  55. <div class="data-item" v-if="leftColumns.length > 0">
  56. <div class="item-header">环境监测与评价分析</div>
  57. <div class="item-container">
  58. <div class="tab">
  59. <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)">{{
  60. fanTitles[0]
  61. }}</div>
  62. <div
  63. v-if="selectData && ((selectData['install_kind'] && !selectData['install_kind'].endsWith('_1')) || !selectData['install_kind'])"
  64. class="tab-item"
  65. :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }"
  66. @click="selectDevice('warningMonitorRowIndex', 1)"
  67. >{{ fanTitles[1] }}</div
  68. >
  69. </div>
  70. <div class="container-group container-group-l">
  71. <div class="warning-group" :style="computedStyle">
  72. <template v-if="selectData.deviceType">
  73. <div class="container-item" v-for="(data, index) in leftColumns" :key="index">
  74. <div class="item-icon">
  75. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  76. <CaretRightOutlined class="icon-style" />
  77. </div>
  78. <div class="item-name">{{ data.title }}</div>
  79. <div v-if="data.dataIndex.startsWith('Fan')">
  80. <div class="item-value" v-if="warningMonitorRowIndex == 0">{{
  81. selectData[data.dataIndex.replace('Fan', 'Fan1')] ? selectData[data.dataIndex.replace('Fan', 'Fan1')] : '-'
  82. }}</div>
  83. <div class="item-value" v-if="warningMonitorRowIndex == 1">{{
  84. selectData[data.dataIndex.replace('Fan', 'Fan2')] ? selectData[data.dataIndex.replace('Fan', 'Fan2')] : '-'
  85. }}</div>
  86. </div>
  87. <div v-else>
  88. <div class="item-value">{{ selectData[data.dataIndex] ? selectData[data.dataIndex] : '-' }}</div>
  89. </div>
  90. </div>
  91. </template>
  92. </div>
  93. </div>
  94. <div class="container-group" v-if="hasPermission('fanLocal:pjfx')">
  95. <div class="warning-header">
  96. <div class="header-item">
  97. <div class="header-title">评价分析</div>
  98. </div>
  99. </div>
  100. <div class="warning-group" style="max-height: 200px; overflow-y: auto">
  101. <template v-if="selectData.deviceType && globSetting.sysOrgCode != 'sdtljtdhzmk' && globSetting.sysOrgCode != 'hnjtymhmk'">
  102. <div class="container-item" v-for="(data, index) in leftColumns1" :key="index">
  103. <div class="item-icon">
  104. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  105. <CaretRightOutlined class="icon-style" />
  106. </div>
  107. <div class="item-name">{{ data.title }}</div>
  108. <div :class="['item-value', { 'text-red-bold': data.value === '超限' }]">{{ data.value ? data.value : '-' }}</div>
  109. </div>
  110. </template>
  111. <template v-else-if="selectData.deviceType && (globSetting.sysOrgCode === 'sdtljtdhzmk' || globSetting.sysOrgCode == 'hnjtymhmk')">
  112. <div class="container-item" v-for="(data, index) in leftColumns2" :key="index">
  113. <div class="item-icon">
  114. <!-- <SvgIcon class="icon-style" size="18" name="temperature" /> -->
  115. <CaretRightOutlined class="icon-style" />
  116. </div>
  117. <div class="item-name">{{ data.title }}</div>
  118. <div :class="['item-value', { 'text-red-bold': data.value === '超限' }]">{{ data.value ? data.value : '-' }}</div>
  119. </div>
  120. </template>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div>
  126. <div class="data-item" v-if="rightColumns.length > 0">
  127. <div class="item-header">设备故障诊断与预警</div>
  128. <div class="item-container">
  129. <div class="tab">
  130. <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)">{{
  131. fanTitles[0]
  132. }}</div>
  133. <div
  134. v-if="selectData && ((selectData['install_kind'] && !selectData['install_kind'].endsWith('_1')) || !selectData['install_kind'])"
  135. class="tab-item"
  136. :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }"
  137. @click="selectDevice('dataMonitorRowIndex', 1)"
  138. >{{ fanTitles[1] }}</div
  139. >
  140. </div>
  141. <div class="container-group container-group-l">
  142. <div class="warning-group" style="max-height: 200px; overflow-y: auto">
  143. <template v-if="deviceType">
  144. <div v-for="(state, index) in rightColumns" :key="index">
  145. <template v-if="!state.dataIndex.endsWith('_w')">
  146. <div class="container-item">
  147. <div class="item-icon">
  148. <CaretRightOutlined class="icon-style" />
  149. </div>
  150. <div class="item-name">{{ state.title }}</div>
  151. <div v-if="state.dataIndex.startsWith('Fan')">
  152. <div class="item-value" v-if="dataMonitorRowIndex == 0">{{
  153. selectData[state.dataIndex.replace('Fan', 'Fan1')] ? selectData[state.dataIndex.replace('Fan', 'Fan1')] : '-'
  154. }}</div>
  155. <div class="item-value" v-if="dataMonitorRowIndex == 1">{{
  156. selectData[state.dataIndex.replace('Fan', 'Fan2')] ? selectData[state.dataIndex.replace('Fan', 'Fan2')] : '-'
  157. }}</div>
  158. </div>
  159. <div v-else>
  160. <div class="item-value">{{ selectData[state.dataIndex] ? selectData[state.dataIndex] : '-' }} </div>
  161. </div>
  162. </div>
  163. </template>
  164. </div>
  165. </template>
  166. </div>
  167. <div class="warning-group">
  168. <div class="warning-header">
  169. <div class="header-item">
  170. <div class="header-title">设备报警</div>
  171. <!-- <div class="header-value">{{ selectData['warnLogNotOkCount'] }} </div> -->
  172. </div>
  173. </div>
  174. <template v-if="deviceType">
  175. <div v-if="rightColumns.length > 1 && rightColumns.find((item) => item.dataIndex?.endsWith('_w'))">
  176. <div v-for="(state, index) in rightColumns" :key="index">
  177. <template v-if="state.dataIndex.endsWith('_w')">
  178. <div class="warning-item">
  179. <div class="item-name"> <div class="icon"></div> {{ state.title }} </div>
  180. <div v-if="state.dataIndex.startsWith('Fan')">
  181. <div class="signal-item" v-if="warningMonitorRowIndex == 0">
  182. <div
  183. class="signal-round"
  184. :class="{
  185. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0',
  186. 'signal-round-warning':
  187. selectData[state.dataIndex.replace('Fan', 'Fan1')] !== undefined &&
  188. selectData[state.dataIndex.replace('Fan', 'Fan1')] == '1',
  189. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined,
  190. }"
  191. ></div>
  192. <div class="vent-margin-l-8">{{
  193. selectData[state.dataIndex.replace('Fan', 'Fan1')] === undefined
  194. ? '无状态'
  195. : selectData[state.dataIndex.replace('Fan', 'Fan1')] == '0'
  196. ? '正常'
  197. : '异常'
  198. }}</div>
  199. </div>
  200. <div class="signal-item" v-if="warningMonitorRowIndex == 1">
  201. <div
  202. class="signal-round"
  203. :class="{
  204. 'signal-round-run': selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0',
  205. 'signal-round-warning':
  206. selectData[state.dataIndex.replace('Fan', 'Fan2')] != undefined &&
  207. selectData[state.dataIndex.replace('Fan', 'Fan2')] == '1',
  208. 'signal-round-gry': selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined,
  209. }"
  210. ></div>
  211. <div class="vent-margin-l-8">{{
  212. selectData[state.dataIndex.replace('Fan', 'Fan2')] == undefined
  213. ? '无状态'
  214. : selectData[state.dataIndex.replace('Fan', 'Fan2')] == '0'
  215. ? '正常'
  216. : '异常'
  217. }}</div>
  218. </div>
  219. </div>
  220. <div v-else>
  221. <div class="signal-item">
  222. <div
  223. class="signal-round vent-margin-l-8"
  224. :class="{
  225. 'signal-round-run': selectData[state.dataIndex] == '0',
  226. 'signal-round-warning': selectData[state.dataIndex] !== undefined && selectData[state.dataIndex] == '1',
  227. 'signal-round-gry': selectData[state.dataIndex] === undefined,
  228. }"
  229. ></div>
  230. <div class="vent-margin-l-8">{{
  231. selectData[state.dataIndex] === undefined ? '无状态' : selectData[state.dataIndex] == '0' ? '正常' : '异常'
  232. }}</div>
  233. </div>
  234. </div>
  235. </div>
  236. </template>
  237. </div>
  238. </div>
  239. <div v-else style="height: 200px; overflow-y: auto; text-align: center; color: #fff; line-height: 200px"> 暂无报警 </div>
  240. </template>
  241. </div>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 175, scroll, 0)">
  248. <dv-border-box8 :dur="5" class="dv_border_8" :style="`bottom: 20px; padding: 5px; height: ${scroll.y + 140}px`">
  249. <!-- <div class="enter-detail" @click="goDetail()">
  250. <send-outlined class=""/>风机运行详情
  251. </div> -->
  252. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
  253. <a-tab-pane key="1" tab="实时监测">
  254. <GroupMonitorTable
  255. v-if="activeKey === '1'"
  256. ref="MonitorDataTable"
  257. :dataSource="dataSource"
  258. :columnsType="`${selectData.deviceType}_monitor`"
  259. @selectRow="getSelectRow"
  260. :scroll="scroll"
  261. :is-action="true"
  262. >
  263. <template #action="{ record }">
  264. <a v-if="globalConfig?.showReport" class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
  265. <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
  266. </template>
  267. </GroupMonitorTable>
  268. </a-tab-pane>
  269. <a-tab-pane key="3" tab="历史数据">
  270. <div class="tab-item" v-if="activeKey === '3'">
  271. <template v-if="globalConfig.History_Type == 'remote'">
  272. <HistoryTable
  273. :columns-type="`${selectData.deviceType}`"
  274. :device-type="`${devicekide}`"
  275. designScope="fanlocal-history"
  276. :scroll="scroll"
  277. />
  278. </template>
  279. <template v-else>
  280. <HistoryTable class="w-100% h-100%" :device-code="`${devicekide}`" :scroll="scroll" dict-code="fanlocal_dict" />
  281. </template>
  282. </div>
  283. </a-tab-pane>
  284. <a-tab-pane key="7" v-if="false" tab="监测曲线图" force-render>
  285. <div class="tab-item" v-if="activeKey === '7'">
  286. <FanDeviceEcharts
  287. chartsColumnsType="fanlocal_chart"
  288. xAxisPropType="strname"
  289. :dataSource="dataSource"
  290. height="100%"
  291. width="100%"
  292. :fan1ChartsColumns="chartsColumnsFan1"
  293. :fan2ChartsColumns="chartsColumnsFan2"
  294. :device-list-api="list.bind(null, { devicetype: 'fanlocal', pagetype: 'normal' })"
  295. device-type="fanlocal"
  296. />
  297. </div>
  298. </a-tab-pane>
  299. <a-tab-pane key="4" tab="报警历史">
  300. <div class="tab-item" v-if="activeKey === '4'">
  301. <AlarmHistoryTable columns-type="alarm" :device-type="`${devicekide}`" designScope="alarm-history" :scroll="scroll" />
  302. </div>
  303. </a-tab-pane>
  304. <a-tab-pane key="5" tab="操作历史">
  305. <div class="tab-item" v-if="activeKey === '5'">
  306. <HandlerHistoryTable
  307. columns-type="operator_history"
  308. :device-type="`${devicekide}`"
  309. :device-list-api="baseList"
  310. designScope="alarm-history"
  311. :scroll="scroll"
  312. />
  313. </div>
  314. </a-tab-pane>
  315. <a-tab-pane key="6" tab="风机曲线" v-if="hasPermission('show:fanEcharts')">
  316. <div v-if="activeKey == '6'" class="tab-item" style="display: flex">
  317. <div style="width: calc(50% - 20px); height: 100%">
  318. <div style="color: var(--vent-font-color); width: 100%; text-align: center; margin: 5px 0px">{{ fanTitles[0] }}</div>
  319. <BarAndLine
  320. class="echarts-line"
  321. xAxisPropType="readTime"
  322. :dataSource="echartsDataList"
  323. height="90%"
  324. width="100%"
  325. :chartsColumns="chartsColumnsFan1"
  326. :option="echatsOption"
  327. chartsType="detail"
  328. />
  329. </div>
  330. <div style="width: calc(50% - 20px); height: 100%">
  331. <div style="color: var(--vent-font-color); width: 100%; text-align: center; margin: 5px 0px">备机</div>
  332. <BarAndLine
  333. class="echarts-line"
  334. xAxisPropType="readTime"
  335. :dataSource="echartsDataList"
  336. height="90%"
  337. width="100%"
  338. :chartsColumns="chartsColumnsFan2"
  339. :option="echatsOption"
  340. chartsType="detail"
  341. />
  342. </div>
  343. </div>
  344. </a-tab-pane>
  345. <a-tab-pane key="2" tab="风量实时曲线图" force-render v-if="hasPermission('echart:show')">
  346. <div class="tab-item" style="height: 100%; padding-top: 15px">
  347. <BarAndLine
  348. v-if="activeKey == '2'"
  349. class="echarts-line"
  350. xAxisPropType="time"
  351. :dataSource="historyList"
  352. height="100%"
  353. width="100%"
  354. :chartsColumns="chartsColumnsZDKZ"
  355. :option="echatsOption"
  356. />
  357. </div>
  358. </a-tab-pane>
  359. </a-tabs>
  360. <a-button
  361. v-if="hasPermission('btn:reportDown')"
  362. type="primary"
  363. size="small"
  364. preIcon="ant-design:download-outlined"
  365. style="position: absolute; right: 15px; top: 10px"
  366. @click="reportDown"
  367. >
  368. 报表导出
  369. </a-button>
  370. </dv-border-box8>
  371. </div>
  372. </div>
  373. <div
  374. v-show="showPlay"
  375. ref="playerRef"
  376. :class="{ 'to-right': rightColumns.length < 1 || leftColumns.length < 1, 'to-no-right': rightColumns.length > 0 && leftColumns.length > 0 }"
  377. style="z-index: 999; position: absolute; top: 100px; right: 15px; width: 100%; height: 100%; margin: auto; pointer-events: none"
  378. >
  379. </div>
  380. <a-modal v-model:visible="modalIsShow" :title="modalTitle" :maskStyle="{ backgroundColor: '#000000aa', backdropFilter: 'blur(3px)' }">
  381. <template #footer>
  382. <div v-if="controlType != 'startFan'">
  383. <a-button key="back" @click="cancel">返回</a-button>
  384. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
  385. </div>
  386. </template>
  387. <div class="modal-container">
  388. <div class="vent-flex-row">
  389. <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
  390. <div class="warning-text">您是否要进行{{ modalTitle }}操作?</div>
  391. </div>
  392. <div class="" v-if="controlType == 'startSmoke'">
  393. <!-- 互斥控制 -->
  394. <div class="startSmoke-select">
  395. <div class="label">主机:</div>
  396. <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="localWind1">
  397. <a-radio value="open">开启</a-radio>
  398. <a-radio value="stop">停止</a-radio>
  399. </a-radio-group>
  400. </div>
  401. <div
  402. v-if="selectData && ((selectData['install_kind'] && !selectData['install_kind'].endsWith('_1')) || !selectData['install_kind'])"
  403. class="startSmoke-select"
  404. >
  405. <div class="label">备机:</div>
  406. <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="localWind2">
  407. <a-radio value="open">开启</a-radio>
  408. <a-radio value="stop">停止</a-radio>
  409. </a-radio-group>
  410. </div>
  411. </div>
  412. <div class="" v-if="controlType == 'startFan'">
  413. <!-- 不互斥控制 -->
  414. <div class="startSmoke-select">
  415. <div class="label">主机:</div>
  416. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Open')">开启</div>
  417. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Stop')">停止</div>
  418. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
  419. </div>
  420. <div
  421. v-if="selectData && ((selectData['install_kind'] && !selectData['install_kind'].endsWith('_1')) || !selectData['install_kind'])"
  422. class="startSmoke-select"
  423. >
  424. <div class="label">备机:</div>
  425. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
  426. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
  427. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
  428. </div>
  429. </div>
  430. <!-- 远程就地 -->
  431. <div class="" v-if="controlType == 'remote'">
  432. <div class="startSmoke-select">
  433. <div class="label">主机:</div>
  434. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1remote')">远程/就地切换</div>
  435. </div>
  436. <div
  437. v-if="selectData && ((selectData['install_kind'] && !selectData['install_kind'].endsWith('_1')) || !selectData['install_kind'])"
  438. class="startSmoke-select"
  439. >
  440. <div class="label">备机:</div>
  441. <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2remote')">远程/就地切换</div>
  442. </div>
  443. </div>
  444. <!-- 调频 -->
  445. <div class="vent-flex-row input-box" v-if="controlType == 'Fan1Frequency'">
  446. <div class="label">主风机运行频率(Hz):</div>
  447. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  448. </div>
  449. <div class="vent-flex-row input-box" v-if="controlType == 'Fan2Frequency'">
  450. <div class="label">备风机运行频率(Hz):</div>
  451. <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="20" :max="50" :step="0.1" />
  452. </div>
  453. <div class="vent-flex-row input-box" v-if="controlType == 'FanFrequency'">
  454. <div class="label">风机运行频率(Hz):</div>
  455. <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="20" :max="50" :step="0.1" />
  456. </div>
  457. <div class="vent-flex-row input-box" v-if="controlType == 'disAirAlarm'">
  458. <div class="label">漏风率(%):</div>
  459. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  460. </div>
  461. <div class="vent-flex-row input-box" v-if="controlType == 'diameter'">
  462. <div class="label">风筒直径(m):</div>
  463. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  464. </div>
  465. <div class="vent-flex-row input-box" v-if="controlType == 'len'">
  466. <div class="label">风筒长度(m):</div>
  467. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  468. </div>
  469. <div class="vent-flex-row input-box" v-if="controlType == 'windPowerLimit'">
  470. <div class="label">风电闭锁限值(m³/min):</div>
  471. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  472. </div>
  473. <div class="vent-flex-row input-box" v-if="controlType == 'gasPowerLimit'">
  474. <div class="label">瓦斯电闭锁限值(m³/min):</div>
  475. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  476. </div>
  477. <div v-if="controlType == 'gasAlarmSet'">
  478. <div class="vent-flex-row input-box">
  479. <div class="label">设置瓦斯超限浓度:</div>
  480. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  481. </div>
  482. </div>
  483. <div v-if="controlType == 'gasAlarm'">
  484. <div class="vent-flex-row input-box">
  485. <div class="label">传感器名称:</div>
  486. <a-select placeholder="传感器" @change="handleChangeSensor" :options="sensorList" v-model:value="modalSensor" />
  487. </div>
  488. <div class="vent-flex-row input-box">
  489. <div class="label">传感器值:</div>
  490. <a-input-number size="small" v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
  491. </div>
  492. </div>
  493. <div v-if="controlType == 'airVolumeAlarm'">
  494. <div class="vent-flex-row input-box">
  495. <div class="label">风量上限(m³/min):</div>
  496. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].min" :min="0" :max="50" :step="0.1" />
  497. </div>
  498. <div class="vent-flex-row input-box">
  499. <div class="label">风量下限(m³/min):</div>
  500. <a-input-number size="small" v-model:value="modalTypeArr.rightBtnArr[3].max" :min="0" :max="50" :step="0.1" />
  501. </div>
  502. </div>
  503. <div class="vent-flex-row input-box" v-if="controlType == 'zhlk'">
  504. <div class="label">目标风量(m³/min):</div>
  505. <a-input-number size="small" v-model:value="targetVolume" />
  506. </div>
  507. <div v-if="controlType == 'gasOverSet'">
  508. <div class="vent-flex-row input-box">
  509. <div class="label">设置瓦斯超限浓度:</div>
  510. <a-input-number size="small" v-model:value="gasWarningVal" :min="0" :max="1" :step="0.01" />
  511. </div>
  512. </div>
  513. <div v-if="controlType == 'dischargeGas'">
  514. <div class="vent-flex-row input-box">
  515. <div class="label">设置瓦斯超限浓度:</div>
  516. <a-input-number size="small" v-model:value="gasWarningVal1" :min="0" :max="0.8" :step="0.01" />
  517. </div>
  518. </div>
  519. <div v-if="controlType == 'supplyAir'">
  520. <div class="vent-flex-row input-box">
  521. <div class="label">设置目标风量:</div>
  522. <a-input-number size="small" v-model:value="targetVolume1" :min="0" :max="100000" :step="100" />
  523. </div>
  524. </div>
  525. <!-- 启动或停止 -->
  526. <div class="" v-if="controlType == 'startSmoke'"> </div>
  527. <div v-if="!globalConfig?.simulatedPassword" class="vent-flex-row input-box">
  528. <div class="label">操作密码:</div>
  529. <a-input size="small" type="password" v-model:value="passWord" />
  530. </div>
  531. </div>
  532. </a-modal>
  533. <!-- 摄像头显示隐藏图标 -->
  534. <VideoCameraOutlined class="video-icon" :class="{ 'no-play': !showPlay }" @click="changePlay" />
  535. <ConditionAssistance @register="registerModalAssistance" :dataSource="historySource" />
  536. <SupplyAir @register="registerModal2" :data="currentDeviceData" :targetVolume="targetVolume1" :fanlocalId="selectData.deviceID" />
  537. <DischargeGas @register="registerModal3" :data="currentDeviceData" :gasMax="gasWarningVal1" :fanlocalId="selectData.deviceID" />
  538. <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
  539. <reportInfo @register="registerModal1" :editID="editID" :fileType="fileType" />
  540. </template>
  541. <script setup lang="ts">
  542. import { ExclamationCircleFilled, ArrowRightOutlined, VideoCameraOutlined } from '@ant-design/icons-vue';
  543. import {
  544. onBeforeMount,
  545. ref,
  546. watch,
  547. onMounted,
  548. nextTick,
  549. defineAsyncComponent,
  550. reactive,
  551. onUnmounted,
  552. inject,
  553. unref,
  554. computed,
  555. shallowReactive,
  556. shallowRef,
  557. } from 'vue';
  558. // import BarSingle from '../../../../components/chart/BarSingle.vue';
  559. import FanDeviceEcharts from '../comment/FanDeviceEcharts.vue';
  560. import BarAndLine from '../../../../components/chart/BarAndLine.vue';
  561. import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  562. import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  563. import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  564. import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
  565. import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.threejs';
  566. import lodash from 'lodash';
  567. import { getTableList, list, autoAdjust } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  568. import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  569. import { echatsOption, chartsColumnsZDKZ, getModelComponent } from './fanLocal.data';
  570. import { deviceControlApi } from '/@/api/vent/index';
  571. import { setDivHeight } from '/@/utils/event';
  572. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  573. import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
  574. import { useRouter } from 'vue-router';
  575. import { useModal } from '/@/components/Modal';
  576. import type { BasicColumn } from '/@/components/Table/src/types/table';
  577. import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
  578. import { getPopupContainer } from '/@/utils';
  579. import { getDictItemsByCode } from '/@/utils/dict';
  580. import { message } from 'ant-design-vue';
  581. import { useCamera } from '/@/hooks/system/useCamera';
  582. import { CaretRightOutlined } from '@ant-design/icons-vue';
  583. import ConditionAssistance from './components/conditionAssistance.vue';
  584. import DischargeGas from './components/dischargeGas.vue';
  585. import SupplyAir from './components/supplyAir.vue';
  586. import reportInfo from '../comment/components/reportInfo.vue';
  587. import { save, reportList } from '../../reportManager/reportManager.api';
  588. import { usePermission } from '/@/hooks/web/usePermission';
  589. import { useGlobSetting } from '/@/hooks/setting';
  590. import { useMessage } from '/@/hooks/web/useMessage';
  591. import { cloneDeep } from 'lodash-es';
  592. const globalConfig = inject('globalConfig');
  593. const HistoryTable =
  594. globalConfig.History_Type == 'remote'
  595. ? defineAsyncComponent(() => import('../comment/HistoryTable.vue'))
  596. : defineAsyncComponent(() => import('../../../vent/comment/history/HistoryTable.vue'));
  597. const { hasPermission } = usePermission();
  598. const [registerModal, { openModal, closeModal }] = useModal();
  599. const [registerModal1, { openModal: openModal1, closeModal: closeModal1 }] = useModal();
  600. const [registerModalAssistance, { openModal: openAssistance, closeModal: closeAssistance }] = useModal();
  601. const [registerModal2, { openModal: openModal2, closeModal: closeModal2 }] = useModal();
  602. const [registerModal3, { openModal: openModal3, closeModal: closeModal3 }] = useModal();
  603. const { currentRoute } = useRouter();
  604. const router = useRouter();
  605. const { createConfirm } = useMessage();
  606. const globSetting = useGlobSetting();
  607. const showPlay = ref(hasPermission('fanlocal:showCamera') ? true : false);
  608. const computedStyle = computed(() => {
  609. const hasMatchingPermission = hasPermission('fanLocal:pjfx');
  610. return hasMatchingPermission ? 'max-height: 200px' : '';
  611. });
  612. const fanTitles = globSetting.sysOrgCode === 'zmhjhzmy' ? ['1#风机', '2#风机'] : ['主机', '备机'];
  613. const modalTypeArr = reactive({
  614. leftBtnArr: [
  615. {
  616. key: 'startSmoke',
  617. value: '启停风机',
  618. permission: 'btn:openclose',
  619. },
  620. {
  621. key: 'startFan',
  622. value: '启停风机',
  623. permission: 'btn:openclose1',
  624. },
  625. {
  626. key: 'changeSmoke', // 主备两个点位
  627. value: '一键倒机',
  628. permission: 'btn:change',
  629. },
  630. {
  631. key: 'changeFan', // 主备一个点位
  632. value: '一键倒机',
  633. permission: 'btn:CtrlFanChange',
  634. },
  635. {
  636. key: 'fan1ToFan2',
  637. value: '主机倒备机',
  638. permission: 'btn:ctrlFan1ToFan2',
  639. },
  640. {
  641. key: 'fan2ToFan1',
  642. value: '备机倒主机',
  643. permission: 'btn:ctrlFan2ToFan1',
  644. },
  645. {
  646. key: 'Fan1Frequency',
  647. value: '主机调频',
  648. permission: 'btn:frequency',
  649. },
  650. {
  651. key: 'Fan2Frequency',
  652. value: '备机调频',
  653. permission: 'btn:frequency',
  654. },
  655. {
  656. key: 'FanFrequency',
  657. value: '风机调频',
  658. permission: 'btn:frequencyMerge',
  659. },
  660. {
  661. key: 'windPower',
  662. value: '风电闭锁',
  663. permission: 'fanLocal:fdbs',
  664. },
  665. {
  666. key: 'gasPower',
  667. value: '瓦斯电闭锁',
  668. permission: 'fanLocal:wsdbs',
  669. },
  670. {
  671. key: 'needAir',
  672. value: '需风量',
  673. permission: 'fanLocal:control',
  674. },
  675. ],
  676. rightBtnArr: [
  677. {
  678. key: 'gasAlarmSet',
  679. value: '瓦斯限值设定',
  680. permission: 'fanLocal:gasAlarmSet',
  681. },
  682. {
  683. key: 'gasOverSet', //
  684. value: '瓦斯限值设定',
  685. permission: 'fanLocal:gasOverSet',
  686. },
  687. {
  688. key: 'kkjc',
  689. value: '工况辅助决策',
  690. permission: 'fanLocal:kkjc',
  691. },
  692. {
  693. key: 'zhlk',
  694. value: '自主联控',
  695. permission: 'fanLocal:zhlk',
  696. },
  697. {
  698. key: 'remote',
  699. value: '就地/远程',
  700. permission: 'fanLocal:remote',
  701. },
  702. {
  703. key: 'diameter',
  704. value: '风筒直径',
  705. permission: 'fanLocal:diameter',
  706. },
  707. {
  708. key: 'diameter',
  709. value: '风筒直径',
  710. permission: 'fanLocal:diameter',
  711. },
  712. {
  713. key: 'len',
  714. value: '风筒长度',
  715. permission: 'fanLocal:len',
  716. },
  717. // {
  718. // key: 'frequency',
  719. // value: '调频',
  720. // permission: 'fanLocal:control',
  721. // },
  722. {
  723. key: 'windPowerLimit',
  724. value: '风电闭锁限值',
  725. permission: 'fanLocal:windPowerLimit',
  726. },
  727. {
  728. key: 'gasPowerLimit',
  729. value: '瓦斯电闭锁限值',
  730. permission: 'fanLocal:gasPowerLimit',
  731. },
  732. {
  733. key: 'airVolumeAlarm',
  734. value: '风量报警',
  735. permission: 'fanLocal:airVolumeAlarm',
  736. min: 0,
  737. max: 100,
  738. },
  739. {
  740. key: 'disAirAlarm',
  741. value: '漏风率报警',
  742. permission: 'fanLocal:disAirAlarm',
  743. },
  744. {
  745. key: 'dischargeGas',
  746. value: '智能排放瓦斯',
  747. permission: 'fanLocal:dischargeGas',
  748. },
  749. {
  750. key: 'supplyAir',
  751. value: '按需供风联动',
  752. permission: 'fanLocal:supplyAir',
  753. },
  754. ],
  755. });
  756. const sensorList = ref<any[]>([
  757. {
  758. value: '1',
  759. label: 'T1',
  760. },
  761. {
  762. value: '2',
  763. label: 'T2',
  764. },
  765. {
  766. value: '3',
  767. label: 'T3',
  768. },
  769. ]);
  770. const scroll = reactive({
  771. y: 180,
  772. });
  773. const deviceTypeDicts = getDictItemsByCode('fanlocaltype');
  774. const gasWarningVal = ref(0.6); // 瓦斯最大报警值
  775. const gasWarningVal1 = ref(0.8); // 瓦斯最大报警值
  776. const playerRef = ref();
  777. const MonitorDataTable = ref();
  778. const modalSensor = ref(null);
  779. const loading = ref(false);
  780. const activeKey = ref('1');
  781. const player1 = ref();
  782. const modalIsShow = ref<boolean>(false); // 是否显示模态框
  783. const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
  784. const fan1FrequencyVal = ref(40); //主机频率
  785. const fan2FrequencyVal = ref(40); //备机频率
  786. const mainWindIsShow1 = ref('open'); // 主机默认启动leftColumns
  787. const mainWindIsShow2 = ref('stop'); // 备机默认不启动
  788. const fanControl = ref('');
  789. const targetVolume = ref(600);
  790. const targetVolume1 = ref(600); //目标风量
  791. const historyList = ref([]);
  792. const passWord = ref('');
  793. // 默认初始是第一行
  794. const selectRowIndex = ref(-1);
  795. const dataMonitorRowIndex = ref(0);
  796. // 默认数据右边监测的是主机
  797. const warningMonitorRowIndex = ref(0);
  798. const xAxisDataGas = ref([]);
  799. // 设备数据
  800. const controlType = ref('');
  801. const modalType = ref('');
  802. const mainModelType = ref('fanLocal');
  803. // 监测数据
  804. const initData = {
  805. deviceID: '',
  806. deviceType: '',
  807. strname: '',
  808. dataDh: '-', //压差
  809. dataDtestq: '-', //测试风量
  810. sourcePressure: '-', //气源压力
  811. dataDequivalarea: '-',
  812. netStatus: '0', //通信状态
  813. warnLevel_str: '',
  814. stationname: '',
  815. fanFrequencyType: '',
  816. };
  817. const frequencyVal = ref(0);
  818. const dataSource = ref([]);
  819. const historySource = ref([]);
  820. // 关联设备信息
  821. const linkDeviceInfo = ref({});
  822. // 监测数据
  823. let selectData = shallowReactive(lodash.cloneDeep(initData));
  824. const currentDeviceData = ref({});
  825. const rightColumns = ref<BasicColumn[]>([]);
  826. const leftColumns = ref<BasicColumn[]>([]);
  827. const leftColumns1 = ref<any[]>([
  828. { title: '供风充足评价', value: '' },
  829. { title: '回风流超限评价', value: '' },
  830. { title: '风筒漏风率评价', value: '' },
  831. ]);
  832. const leftColumns2 = ref<any[]>([
  833. { title: '供风充足评价', value: '充足' },
  834. { title: '回风流超限评价', value: '正常' },
  835. { title: '风筒漏风率评价', value: '正常' },
  836. ]);
  837. const devicekide = ref(deviceTypeDicts && deviceTypeDicts.length > 0 ? deviceTypeDicts[0]['value'] : 'fanlocal');
  838. const deviceType = ref(selectData.deviceType);
  839. const headElHeight = ref(0);
  840. let btnClick = ref(true); // 判断按钮是否可点
  841. const modelRef = ref();
  842. /** 模型对应的组件,根据实际情况分为二维三维 */
  843. const modelComponent = shallowRef(getModelComponent(globalConfig.is2DModel));
  844. //报表导出
  845. let editID = ref<any>('');
  846. let fileType = ref('');
  847. const { getCamera, removeCamera } = useCamera();
  848. const echartsDataList = ref<any[]>([]);
  849. const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
  850. const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : [];
  851. let chartsColumnsFan1 = [],
  852. chartsColumnsFan2 = [];
  853. // 这里需要处理主备echartColumns
  854. if (chartsColumns.length > 0) {
  855. for (let i = 0; i < chartsColumns.length; i++) {
  856. let itemColumn = chartsColumns[i];
  857. let dataIndexFan1, dataIndexFan2;
  858. if (itemColumn['dataIndex']) {
  859. const dataIndex = itemColumn['dataIndex'] as string;
  860. dataIndexFan1 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan1') : dataIndex.replace('fan', 'fan1');
  861. dataIndexFan2 = dataIndex.startsWith('Fan') ? dataIndex.replace('Fan', 'Fan2') : dataIndex.replace('fan', 'fan2');
  862. chartsColumnsFan1.push({ ...itemColumn, dataIndex: dataIndexFan1, legend: fanTitles[0] + itemColumn['legend'] });
  863. chartsColumnsFan2.push({ ...itemColumn, dataIndex: dataIndexFan2, legend: fanTitles[1] + itemColumn['legend'] });
  864. }
  865. }
  866. }
  867. watch(deviceType, (type) => {
  868. rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as [];
  869. if (rightColumns.value && rightColumns.value.length < 1) {
  870. rightColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_right') as [];
  871. }
  872. leftColumns.value = getTableHeaderColumns(type + '_monitor_left') as [];
  873. if (leftColumns.value && leftColumns.value.length < 1) {
  874. leftColumns.value = getTableHeaderColumns(type.split('_')[0] + '_monitor_left') as [];
  875. }
  876. });
  877. const flvURL1 = () => {
  878. // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  879. return '';
  880. };
  881. const changeDeviceKind = (e) => {
  882. devicekide.value = e;
  883. loading.value = true;
  884. selectRowIndex.value = -1;
  885. nextTick(() => {
  886. selectData = lodash.cloneDeep(initData);
  887. loading.value = false;
  888. if (selectData.deviceID) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  889. const headEl = document.querySelector(`.zxm-table-thead`);
  890. if (headEl) {
  891. headElHeight.value = headEl.clientHeight;
  892. }
  893. });
  894. };
  895. const changePlay = () => {
  896. showPlay.value = !showPlay.value;
  897. };
  898. const tabChange = (activeKeyVal) => {
  899. activeKey.value = activeKeyVal;
  900. if (activeKeyVal == 1) {
  901. nextTick(() => {
  902. MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
  903. });
  904. }
  905. };
  906. const selectDevice = (key, val) => {
  907. if (key === 'dataMonitorRowIndex') {
  908. dataMonitorRowIndex.value = val;
  909. } else {
  910. warningMonitorRowIndex.value = val;
  911. }
  912. };
  913. //报表导出点击
  914. async function reportDown() {
  915. openModal1();
  916. let res = await save({ reportType: 'fanlocal' });
  917. console.log(res, 'res-----------');
  918. let list = await reportList({ id: res.id });
  919. console.log(list, 'list-----------');
  920. let index = list.records[0].fileName.indexOf('.');
  921. fileType.value = list.records[0].fileName.substring(index + 1);
  922. editID.value = list.records[0].id;
  923. openModal1();
  924. }
  925. //详情
  926. function goDetail() {
  927. openModal();
  928. }
  929. function goDetailDevice(link需风量DeviceCode) {
  930. let linkDeviceId = '';
  931. if (linkDeviceCode.startsWith('window')) {
  932. linkDeviceId = linkDeviceInfo.value[linkDeviceCode] ? linkDeviceInfo.value[linkDeviceCode]['id'] : '';
  933. router.push({ path: '/monitorChannel/monitor-window', query: { id: linkDeviceId } });
  934. }
  935. }
  936. //
  937. async function getDataSource() {
  938. if (devicekide.value) {
  939. const res = await list({ devicetype: devicekide.value, pagetype: 'normal' });
  940. // const res = await list({ devicetype: 'fanlocal', pagetype: 'normal' });
  941. if (res.msgTxt && res.msgTxt[0] && res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
  942. const dataArr = res.msgTxt[0].datalist || [];
  943. dataSource.value = [];
  944. dataArr.forEach((data) => {
  945. const readData = data.readData;
  946. data = Object.assign(data, readData);
  947. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '1.0') data['Fan1StartStatus'] = '1';
  948. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '1.0') data['Fan2StartStatus'] = '1';
  949. if (data['Fan1StartStatus'] && data['Fan1StartStatus'] === '0.0') data['Fan1StartStatus'] = '0';
  950. if (data['Fan2StartStatus'] && data['Fan2StartStatus'] === '0.0') data['Fan2StartStatus'] = '0';
  951. data['windQuantity2'] =
  952. data['windQuantity2'] ||
  953. data['m3'] ||
  954. data['ductOutletAirVolume_merge'] ||
  955. data['windOutSpeed_merge'] ||
  956. data['windOutSpeed1'] ||
  957. data['windOutSpeed2'] ||
  958. data['windOutSpeed_merge'];
  959. // if (globSetting.sysOrgCode === 'sdmtjtbetmk') {
  960. // if (data['m3']) data['ductOutletAirVolume_merge'] = data['m3'];
  961. // if (data['m3']) data['inletAirVolume_merge'] = (Number(data['m3']) * 1.08).toFixed(2);
  962. // }
  963. dataSource.value.push(data);
  964. const m3 = data.windSpeed_merge;
  965. const fsectarea = data.windSectionArea_merge;
  966. const needq = data.needq;
  967. const airVolume = m3 * fsectarea; // 计算风量
  968. // 更新供风充足评价
  969. leftColumns1.value[0].value = airVolume >= needq ? '正常' : '不充足';
  970. if (data.tunnelType === 'coalTunnel') {
  971. leftColumns1.value[1].value = m3 < 0.25 ? '超限' : '正常';
  972. } else if (data.tunnelType === 'rockTunnel' || data.tunnelType === 'coalRockTunnel') {
  973. leftColumns1.value[1].value = m3 < 0.15 ? '超限' : '正常';
  974. }
  975. // if (data.airLeakageRatePerHundredX !== '' && data.airLeakageRatePerHundred_merge !== '') {
  976. // leftColumns1.value[2].value = data.airLeakageRatePerHundred_merge <= data.airLeakageRatePerHundredX ? '正常' : '不满足';
  977. // } else {
  978. // leftColumns1.value[2].value = '-';
  979. // }
  980. // console.log(data.airLeakageRatePerHundredX, data.airLeakageRatePerHundred_merge, '漏风率数据');
  981. leftColumns1.value[2].value =
  982. data.airLeakageRatePerHundredX > 0 ? (data.airLeakageRatePerHundred_merge <= data.airLeakageRatePerHundredX ? '正常' : '不满足') : '-';
  983. });
  984. if (selectRowIndex.value > -1) {
  985. const data = dataArr[selectRowIndex.value];
  986. currentDeviceData.value = data;
  987. // 存放echarts数据
  988. if (data && data['readTime']) {
  989. const dataList = cloneDeep(echartsDataList.value);
  990. if (dataList.length == 0 || dataList[dataList.length - 1]['readTime'] !== data['readTime']) {
  991. if (dataList.length < 15) {
  992. dataList.push({ ...data });
  993. } else {
  994. dataList.shift();
  995. dataList.push({ ...data });
  996. }
  997. echartsDataList.value = dataList;
  998. }
  999. }
  1000. // 制动控制echarts数据获取
  1001. let echartsData = dataArr[selectRowIndex.value]['history'] || [];
  1002. echartsData = echartsData.filter((item) => {
  1003. item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
  1004. item['windQuantity2'] =
  1005. item['windQuantity2'] ||
  1006. item['m3'] ||
  1007. item['ductOutletAirVolume_merge'] ||
  1008. item['windOutSpeed_merge'] ||
  1009. item['windOutSpeed1'] ||
  1010. item['windOutSpeed2'] ||
  1011. item['windOutSpeed_merge'];
  1012. return true;
  1013. });
  1014. historyList.value = echartsData;
  1015. }
  1016. } else {
  1017. return (dataSource.value = []);
  1018. }
  1019. } else {
  1020. dataSource.value = [];
  1021. }
  1022. }
  1023. // https获取监测数据
  1024. let timer: null | NodeJS.Timeout = null;
  1025. async function getMonitor(flag?) {
  1026. if (Object.prototype.toString.call(timer) === '[object Null]') {
  1027. timer = await setTimeout(
  1028. async () => {
  1029. // debugger;
  1030. await getDataSource();
  1031. if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
  1032. // 初始打开页面
  1033. if (flag && currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  1034. MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id']);
  1035. } else {
  1036. MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID']);
  1037. }
  1038. }
  1039. for (const key in selectData) {
  1040. selectData[key] = '';
  1041. }
  1042. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1043. deviceType.value = dataSource.value[selectRowIndex.value]['deviceType'];
  1044. if (dataSource.value.length > 0 && dataSource.value[selectRowIndex.value]) {
  1045. Object.assign(selectData, dataSource.value[selectRowIndex.value]);
  1046. }
  1047. selectData['modalTyoe'] == selectData['install_kind'];
  1048. playSmoke(selectData);
  1049. modelRef.value?.animate?.(selectData);
  1050. addText(selectData, fanDualArray.value);
  1051. }
  1052. historySource.value = selectData.history;
  1053. if (timer) {
  1054. timer = null;
  1055. }
  1056. getMonitor();
  1057. },
  1058. flag ? 0 : 1000
  1059. );
  1060. }
  1061. }
  1062. // 获取设备基本信息列表
  1063. const deviceBaseList = ref([]);
  1064. function getDeviceBaseList() {
  1065. getTableList({ pageSize: 1000 }).then((res) => {
  1066. deviceBaseList.value = res.records;
  1067. });
  1068. }
  1069. // 切换检测数据
  1070. async function getSelectRow(id) {
  1071. if (!id || id == selectData['deviceID']) return;
  1072. // loading.value = true;
  1073. const selectIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID == id);
  1074. selectRowIndex.value = selectIndex;
  1075. nextTick(() => {
  1076. const headEl = document.querySelector(`.zxm-table-thead`);
  1077. if (headEl) {
  1078. headElHeight.value = headEl.clientHeight;
  1079. }
  1080. const data = dataSource.value[selectIndex];
  1081. if (data) {
  1082. if (selectData['linkInfo']) linkDeviceInfo.value = JSON.parse(selectData['linkInfo']);
  1083. if (linkDeviceInfo.value['window_fWindowM3']) {
  1084. modalType.value = 'fc';
  1085. }
  1086. // 主备互斥控制
  1087. if (data['Fan1StartStatus'] == '1') {
  1088. mainWindIsShow1.value = 'open';
  1089. mainWindIsShow2.value = 'stop';
  1090. selectDevice('warningMonitorRowIndex', 0);
  1091. selectDevice('dataMonitorRowIndex', 0);
  1092. } else if (data['Fan2StartStatus'] == '1') {
  1093. mainWindIsShow2.value = 'open';
  1094. mainWindIsShow1.value = 'stop';
  1095. selectDevice('warningMonitorRowIndex', 1);
  1096. selectDevice('dataMonitorRowIndex', 1);
  1097. }
  1098. const xAxisDataGasArr = [];
  1099. for (const key in selectData) {
  1100. if (key.startsWith('gas') && key.length < 5) {
  1101. xAxisDataGasArr.push({ key: 'T' + key.substring(3), valueKey: key });
  1102. }
  1103. }
  1104. xAxisDataGas.value = xAxisDataGasArr;
  1105. // 根据安装类别分辨是单巷还是双巷模型,以及那个风机应该高亮
  1106. if (data['install_kind']) {
  1107. const keymap = {
  1108. fanLocalTwo: ['fanLocalTwo', modalType.value],
  1109. single: ['fanLocal', modalType.value], //单巷(默认两风筒)
  1110. dual_inner: ['fanLocalDual', 'inner'],
  1111. dual_outer: ['fanLocalDual', 'outer'],
  1112. fanlocal_1: ['fanLocalSingle', modalType.value], //单巷单风筒
  1113. };
  1114. mainModelType.value = keymap[data['install_kind']][0];
  1115. modalType.value = keymap[data['install_kind']][1];
  1116. } else {
  1117. // 为了兼容没有添加 install_kind 的旧的单巷
  1118. mainModelType.value = 'fanLocal';
  1119. }
  1120. }
  1121. setModelType(mainModelType.value, modalType.value, fanDualArray.value);
  1122. });
  1123. await getCamera(id, playerRef.value);
  1124. return;
  1125. }
  1126. // 打开并设置modal的标题
  1127. function showModal(obj) {
  1128. if (!btnClick.value) return;
  1129. if (obj.key == 'kkjc') {
  1130. gasWarningVal.value = 0.6;
  1131. // 工况辅助决策
  1132. openAssistance(true, {});
  1133. return;
  1134. }
  1135. controlType.value = obj.key;
  1136. modalTitle.value = obj.value;
  1137. passWord.value = '';
  1138. modalIsShow.value = true;
  1139. }
  1140. function changeMotor(e) {
  1141. const target = e.target;
  1142. if (target.name === 'localWind1') {
  1143. if (target.value === 'open') {
  1144. mainWindIsShow2.value = 'stop';
  1145. }
  1146. } else if (target.name === 'localWind2') {
  1147. if (target.value === 'open') {
  1148. mainWindIsShow1.value = 'stop';
  1149. }
  1150. }
  1151. }
  1152. function handleOk(control?) {
  1153. if (passWord.value == '') {
  1154. message.warning('请输入密码!');
  1155. return;
  1156. }
  1157. createConfirm({
  1158. iconType: 'warning',
  1159. title: '控制',
  1160. content: '您确定要控制吗?',
  1161. onOk: () => handerFn(),
  1162. });
  1163. const handerFn = () => {
  1164. const handType = controlType.value;
  1165. const data = {
  1166. deviceid: selectData.deviceID,
  1167. devicetype: selectData.deviceType,
  1168. paramcode: '',
  1169. password: passWord.value || globalConfig?.simulatedPassword,
  1170. value: null,
  1171. };
  1172. if (handType === 'startSmoke') {
  1173. // 启动风机
  1174. // 以下是互斥
  1175. if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1176. // playSmoke(handType, 'top', frequency, 'open');
  1177. data.paramcode = 'CtrlFan1Start';
  1178. deviceControlApi(data)
  1179. .then((res) => {
  1180. if (res.success) {
  1181. if (globalConfig.History_Type == 'remote') {
  1182. message.success('指令已下发至生产管控平台成功!');
  1183. } else {
  1184. message.success('指令已下发成功!');
  1185. }
  1186. modalTitle.value = '';
  1187. modalIsShow.value = false;
  1188. } else {
  1189. message.error(res.message);
  1190. }
  1191. })
  1192. .catch((err) => {
  1193. // modalIsShow.value = true;
  1194. });
  1195. } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1196. // playSmoke(handType, 'down', frequency, 'open');
  1197. data.paramcode = 'CtrlFan2Start';
  1198. deviceControlApi(data)
  1199. .then(() => {
  1200. if (res.success) {
  1201. if (globalConfig.History_Type == 'remote') {
  1202. message.success('指令已下发至生产管控平台成功!');
  1203. } else {
  1204. message.success('指令已下发成功!');
  1205. }
  1206. modalTitle.value = '';
  1207. modalIsShow.value = false;
  1208. } else {
  1209. message.error(res.message);
  1210. }
  1211. })
  1212. .catch((err) => {});
  1213. } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1214. // playSmoke(handType, '', frequency, 'stop');
  1215. }
  1216. } else if (handType === 'startFan') {
  1217. if (control === 'Fan1Open') {
  1218. data.paramcode = 'CtrlFan1Start';
  1219. } else if (control === 'Fan2Open') {
  1220. data.paramcode = 'CtrlFan2Start';
  1221. } else if (control === 'Fan1Stop') {
  1222. data.paramcode = 'CtrlFan1Stop';
  1223. } else if (control === 'Fan2Stop') {
  1224. data.paramcode = 'CtrlFan2Stop';
  1225. } else if (control === 'Fan1Reset') {
  1226. data.paramcode = 'CtrlFan1Reset';
  1227. } else if (control === 'Fan2Reset') {
  1228. data.paramcode = 'CtrlFan2Reset';
  1229. }
  1230. deviceControlApi(data)
  1231. .then((res) => {
  1232. if (res.success) {
  1233. if (globalConfig.History_Type == 'remote') {
  1234. message.success('指令已下发至生产管控平台成功!');
  1235. } else {
  1236. message.success('指令已下发成功!');
  1237. }
  1238. modalTitle.value = '';
  1239. modalIsShow.value = false;
  1240. } else {
  1241. message.error(res.message);
  1242. }
  1243. })
  1244. .catch((err) => {
  1245. btnClick.value = true;
  1246. });
  1247. } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency' || handType === 'FanFrequency') {
  1248. // 调频
  1249. if (handType === 'Fan1Frequency') {
  1250. data.paramcode = 'Fan1FreqHz';
  1251. data.value = fan1FrequencyVal.value;
  1252. } else if (handType === 'Fan2Frequency') {
  1253. data.paramcode = 'Fan2FreqHz';
  1254. data.value = fan2FrequencyVal.value;
  1255. } else if (handType === 'FanFrequency') {
  1256. data.paramcode = 'FreqHz_merge';
  1257. data.value = fan1FrequencyVal.value;
  1258. }
  1259. deviceControlApi(data)
  1260. .then((res) => {
  1261. if (res.success) {
  1262. if (globalConfig.History_Type == 'remote') {
  1263. message.success('指令已下发至生产管控平台成功!');
  1264. } else {
  1265. message.success('指令已下发成功!');
  1266. }
  1267. modalTitle.value = '';
  1268. modalIsShow.value = false;
  1269. } else {
  1270. message.error(res.message);
  1271. }
  1272. })
  1273. .catch((err) => {});
  1274. } else if (handType === 'changeSmoke') {
  1275. if (selectData['Fan1StartStatus'] == '0' || !selectData['Fan1StartStatus']) {
  1276. data.paramcode = 'CtrlFan1Start';
  1277. deviceControlApi(data)
  1278. .then((res) => {
  1279. if (res.success) {
  1280. if (globalConfig.History_Type == 'remote') {
  1281. message.success('指令已下发至生产管控平台成功!');
  1282. } else {
  1283. message.success('指令已下发成功!');
  1284. }
  1285. modalTitle.value = '';
  1286. modalIsShow.value = false;
  1287. } else {
  1288. message.error(res.message);
  1289. }
  1290. mainWindIsShow1.value = 'stop';
  1291. mainWindIsShow2.value = 'open';
  1292. })
  1293. .catch((err) => {});
  1294. } else if (selectData['Fan2StartStatus'] == '0' || !selectData['Fan2StartStatus']) {
  1295. data.paramcode = 'CtrlFan2Start';
  1296. deviceControlApi(data)
  1297. .then((res) => {
  1298. if (res.success) {
  1299. if (globalConfig.History_Type == 'remote') {
  1300. message.success('指令已下发至生产管控平台成功!');
  1301. } else {
  1302. message.success('指令已下发成功!');
  1303. }
  1304. modalTitle.value = '';
  1305. modalIsShow.value = false;
  1306. } else {
  1307. message.error(res.message);
  1308. }
  1309. mainWindIsShow1.value = 'open';
  1310. mainWindIsShow2.value = 'stop';
  1311. })
  1312. .catch((err) => {});
  1313. }
  1314. // // 一键倒机
  1315. // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
  1316. // // playSmoke('startSmoke', 'down', frequency, 'open');
  1317. // data.paramcode = 'CtrlFan2Start';
  1318. // deviceControlApi(data).then((res) => {
  1319. // console.log('设备操作结果', res);
  1320. // modalTitle.value = '';
  1321. // modalIsShow.value = false;
  1322. // }).catch((err) => {
  1323. // });
  1324. // mainWindIsShow1.value = 'stop';
  1325. // mainWindIsShow2.value = 'open';
  1326. // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
  1327. // // playSmoke('startSmoke', 'top', frequency, 'open');
  1328. // data.paramcode = 'CtrlFan1Start';
  1329. // deviceControlApi(data).then((res) => {
  1330. // console.log('设备操作结果', res);
  1331. // modalTitle.value = '';
  1332. // modalIsShow.value = false;
  1333. // }).catch((err) => {
  1334. // });
  1335. // mainWindIsShow1.value = 'open';
  1336. // mainWindIsShow2.value = 'stop';
  1337. // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
  1338. // // playSmoke(handType, '', frequency, 'stop');
  1339. // }
  1340. } else if (handType === 'changeFan') {
  1341. data.paramcode = 'CtrlFanStart';
  1342. deviceControlApi(data)
  1343. .then((res) => {
  1344. if (res.success) {
  1345. if (globalConfig.History_Type == 'remote') {
  1346. message.success('指令已下发至生产管控平台成功!');
  1347. } else {
  1348. message.success('指令已下发成功!');
  1349. }
  1350. } else {
  1351. message.error(res.message);
  1352. }
  1353. modalTitle.value = '';
  1354. modalIsShow.value = false;
  1355. })
  1356. .catch((err) => {});
  1357. } else if (handType === 'fan1ToFan2') {
  1358. data.paramcode = 'CtrlFan1ToFan2';
  1359. deviceControlApi(data).then((res) => {
  1360. if (res.success) {
  1361. if (globalConfig.History_Type == 'remote') {
  1362. message.success('指令已下发至生产管控平台成功!');
  1363. } else {
  1364. message.success('指令已下发成功!');
  1365. }
  1366. modalTitle.value = '';
  1367. modalIsShow.value = false;
  1368. } else {
  1369. message.error(res.message);
  1370. }
  1371. });
  1372. } else if (handType === 'fan2ToFan1') {
  1373. data.paramcode = 'CtrlFan2ToFan1';
  1374. deviceControlApi(data).then((res) => {
  1375. if (res.success) {
  1376. if (globalConfig.History_Type == 'remote') {
  1377. message.success('指令已下发至生产管控平台成功!');
  1378. } else {
  1379. message.success('指令已下发成功!');
  1380. }
  1381. modalTitle.value = '';
  1382. modalIsShow.value = false;
  1383. } else {
  1384. message.error(res.message);
  1385. }
  1386. });
  1387. } else if (handType === 'gasAlarmSet') {
  1388. if (passWord.value != '123456') {
  1389. message.error('密码错误,请重新输入!');
  1390. return;
  1391. }
  1392. if (gasWarningVal.value) {
  1393. modalTitle.value = '';
  1394. modalIsShow.value = false;
  1395. setTimeout(() => {
  1396. passWord.value = '';
  1397. modalIsShow.value = true;
  1398. controlType.value = 'toGkjc';
  1399. modalTitle.value = '工况决策辅助';
  1400. }, 500);
  1401. } else {
  1402. message.error('请核对瓦斯超限浓度值!');
  1403. }
  1404. } else if (handType === 'toGkjc') {
  1405. if (passWord.value != '123456') {
  1406. message.error('密码错误,请重新输入!');
  1407. return;
  1408. }
  1409. //进行工况决策
  1410. if (selectData.Fan1StartStatus == '1') {
  1411. openAssistance(true, {
  1412. // m3: selectData.m3 || 675.87,
  1413. m3: 675.87,
  1414. frequency: 30,
  1415. // m3: 525.87, //5.0测试数据
  1416. // frequency: 35,
  1417. // frequency: selectData.Fan1fHz || selectData.Fan1FreqHz || selectData.Fan1Loop_Frequency,
  1418. gasWarningVal: gasWarningVal.value,
  1419. isCompute: false,
  1420. });
  1421. } else if (selectData.Fan2StartStatus == '1') {
  1422. openAssistance(true, {
  1423. // m3: selectData.m3 || 675.87,
  1424. m3: 675.87,
  1425. frequency: 30,
  1426. // frequency: selectData.Fan2fHz || selectData.Fan2FreqHz || selectData.Fan2Loop_Frequency,
  1427. gasWarningVal: gasWarningVal.value,
  1428. isCompute: false,
  1429. });
  1430. } else {
  1431. // openAssistance(true, { m3: 635.04, dataDh: 5748 });
  1432. openAssistance(true);
  1433. }
  1434. modalTitle.value = '';
  1435. modalIsShow.value = false;
  1436. } else if (handType === 'zhlk' || handType === 'gasOverSet') {
  1437. modalIsShow.value = false;
  1438. if (targetVolume.value) {
  1439. const params =
  1440. handType === 'zhlk'
  1441. ? { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume.value }
  1442. : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
  1443. autoAdjust(params)
  1444. .then(() => {
  1445. if (hasPermission('echart:show')) activeKey.value = '2';
  1446. if (globalConfig.History_Type == 'remote') {
  1447. message.success('指令已下发至生产管控平台成功!');
  1448. } else {
  1449. message.success('指令已下发成功!');
  1450. }
  1451. modalTitle.value = '';
  1452. })
  1453. .catch(() => {
  1454. message.error('指令下发失败');
  1455. });
  1456. }
  1457. } else if (handType === 'supplyAir') {
  1458. modalIsShow.value = false;
  1459. if (targetVolume1.value) {
  1460. const params = { auto: 1, fanlocalId: selectData.deviceID, xufengliang: targetVolume1.value };
  1461. autoAdjust(params)
  1462. .then(() => {
  1463. if (hasPermission('echart:show')) activeKey.value = '2';
  1464. if (globalConfig.History_Type == 'remote') {
  1465. message.success('指令已下发至生产管控平台成功!');
  1466. } else {
  1467. message.success('指令已下发成功!');
  1468. }
  1469. modalTitle.value = '';
  1470. })
  1471. .catch(() => {
  1472. message.error('指令下发失败');
  1473. });
  1474. }
  1475. openModal2(true, {});
  1476. } else if (handType === 'dischargeGas') {
  1477. modalIsShow.value = false;
  1478. if (gasWarningVal1.value) {
  1479. const params = { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal1.value };
  1480. autoAdjust(params)
  1481. .then(() => {
  1482. if (hasPermission('echart:show')) activeKey.value = '2';
  1483. if (globalConfig.History_Type == 'remote') {
  1484. message.success('指令已下发至生产管控平台成功!');
  1485. } else {
  1486. message.success('指令已下发成功!');
  1487. }
  1488. modalTitle.value = '';
  1489. })
  1490. .catch(() => {
  1491. message.error('指令下发失败');
  1492. });
  1493. }
  1494. openModal3(true, {});
  1495. } else if (handType === 'remote') {
  1496. if (control === 'Fan1remote') {
  1497. data.paramcode = 'Fan1autoRoManualControl';
  1498. data.value = true;
  1499. } else if (control === 'Fan2remote') {
  1500. data.paramcode = 'Fan2autoRoManualControl';
  1501. data.value = true;
  1502. }
  1503. deviceControlApi(data)
  1504. .then((res) => {
  1505. if (res.success) {
  1506. if (globalConfig.History_Type == 'remote') {
  1507. message.success('指令已下发至生产管控平台成功!');
  1508. } else {
  1509. message.success('指令已下发成功!');
  1510. }
  1511. modalTitle.value = '';
  1512. modalIsShow.value = false;
  1513. } else {
  1514. message.error(res.message);
  1515. }
  1516. })
  1517. .catch((err) => {
  1518. btnClick.value = true;
  1519. });
  1520. }
  1521. };
  1522. }
  1523. function cancel() {
  1524. modalTitle.value = '';
  1525. modalIsShow.value = false;
  1526. gasWarningVal.value = 0;
  1527. }
  1528. function handleChangeSensor(value: string) {
  1529. console.log(value);
  1530. }
  1531. function addPlayVideo() {
  1532. if (player1.value && player1.value.play) {
  1533. if (!player1.value.paused()) player1.value.play();
  1534. document.body.removeEventListener('mousedown', addPlayVideo);
  1535. }
  1536. }
  1537. function deviceEdit(e: Event, type: string, record) {
  1538. e.stopPropagation();
  1539. openModal(true, {
  1540. type,
  1541. deviceId: record['deviceID'],
  1542. });
  1543. }
  1544. /** 双巷风机数组,第一项是外侧风机,第二项是内侧风机 */
  1545. const fanDualArray = computed<Record<string, any>[]>(() => {
  1546. const inx = selectRowIndex.value;
  1547. const data: any = dataSource.value[inx];
  1548. // 一个外侧风机理论上对应一个内侧的风机
  1549. if (data && data.install_kind && data.install_kind === 'dual_outer') {
  1550. const dualInner = dataSource.value.find((e: any) => e.deviceId == data.associated_id) || {};
  1551. return [data, dualInner];
  1552. }
  1553. if (data && data.install_kind && data.install_kind === 'dual_inner') {
  1554. const dualOuter = dataSource.value.find((e: any) => e.deviceId == data.associated_id) || {};
  1555. return [dualOuter, data];
  1556. }
  1557. return [{}, {}];
  1558. });
  1559. onBeforeMount(() => {
  1560. getDeviceBaseList();
  1561. });
  1562. onMounted(() => {
  1563. const { query } = unref(currentRoute);
  1564. if (query['deviceType']) devicekide.value = query['deviceType'] as string;
  1565. if (globalConfig.is2DModel) {
  1566. getMonitor(true);
  1567. } else {
  1568. mountedThree('#fanLocal3D', ['#fanLocal3DCSS']).then(async () => {
  1569. await getMonitor(true);
  1570. nextTick(async () => {
  1571. // addCssText();
  1572. // setModelType(mainModelType.value, modalType.value);
  1573. });
  1574. });
  1575. }
  1576. document.body.addEventListener('mousedown', addPlayVideo, false);
  1577. });
  1578. onUnmounted(() => {
  1579. destroy();
  1580. removeCamera();
  1581. if (timer) {
  1582. clearTimeout(timer);
  1583. timer = undefined;
  1584. }
  1585. });
  1586. </script>
  1587. <style scoped lang="less">
  1588. @import '/@/design/theme.less';
  1589. @import '/@/design/vent/modal.less';
  1590. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1591. height: 100%;
  1592. }
  1593. :deep(.zxm-tabs-content) {
  1594. height: 100%;
  1595. }
  1596. @{theme-deepblue} {
  1597. .scene-box {
  1598. --image-lr-top-bg: url('/@/assets/images/themify/deepblue/vent/lr-top-bg.png');
  1599. --image-lr-tab-bg: url('/@/assets/images/themify/deepblue/vent/lr-tab-bg.png');
  1600. --image-l-tab-active: url('/@/assets/images/themify/deepblue/vent/l-tab-active.png');
  1601. --image-r-tab-active: url('/@/assets/images/themify/deepblue/vent/r-tab-active.png');
  1602. --image-plane-bottom: url('/@/assets/images/themify/deepblue/vent/plane-bottom.png');
  1603. --image-plane-icon-bg: url('/@/assets/images/themify/deepblue/vent/plane-icon-bg.png');
  1604. --container-group-bg: linear-gradient(to right, #ffffff22, #53576305);
  1605. }
  1606. }
  1607. .scene-box {
  1608. --image-lr-top-bg: url('/@/assets/images/vent/lr-top-bg.png');
  1609. --image-lr-tab-bg: url('/@/assets/images/vent/lr-tab-bg.png');
  1610. --image-l-tab-active: url('/@/assets/images/vent/l-tab-active.png');
  1611. --image-r-tab-active: url('/@/assets/images/vent/r-tab-active.png');
  1612. --image-plane-bottom: url('/@/assets/images/vent/plane-bottom.png');
  1613. --image-plane-icon-bg: url('/@/assets/images/vent/plane-icon-bg.png');
  1614. --container-group-bg: linear-gradient(to right, #00deff22, #2081ff05);
  1615. .title-text {
  1616. height: 32px;
  1617. }
  1618. .bottom-tabs-box {
  1619. height: 280px;
  1620. .tabs-box {
  1621. position: relative !important;
  1622. }
  1623. }
  1624. }
  1625. .data-show-box {
  1626. position: relative;
  1627. display: flex;
  1628. flex-direction: row;
  1629. justify-content: space-between;
  1630. padding: 10px 5px;
  1631. color: var(--vent-font-color);
  1632. z-index: 999;
  1633. top: 60px;
  1634. .data-item {
  1635. pointer-events: auto;
  1636. .item-header {
  1637. width: 374px;
  1638. background: var(--image-lr-top-bg) no-repeat;
  1639. background-size: auto;
  1640. height: 32px;
  1641. text-align: center;
  1642. line-height: 34px;
  1643. font-size: 15px;
  1644. font-weight: 600;
  1645. color: #fafafa;
  1646. }
  1647. .item-container {
  1648. width: 346px;
  1649. margin: 0 14px;
  1650. padding: 10px;
  1651. background: #00377c33;
  1652. backdrop-filter: blur(2px);
  1653. .tab {
  1654. width: 323px;
  1655. background: var(--image-lr-tab-bg) no-repeat;
  1656. display: flex;
  1657. .tab-item {
  1658. flex: 1;
  1659. text-align: center;
  1660. padding-top: 2px;
  1661. color: #ffffff99;
  1662. cursor: pointer;
  1663. }
  1664. .tab-item-active-l {
  1665. color: var(--vent-font-action-link);
  1666. background-image: var(--image-l-tab-active);
  1667. background-repeat: no-repeat;
  1668. background-size: auto;
  1669. background-position: 6px 3px;
  1670. }
  1671. .tab-item-active-r {
  1672. color: var(--vent-font-action-link);
  1673. background-image: var(--image-r-tab-active);
  1674. background-repeat: no-repeat;
  1675. background-position: 0 3px;
  1676. }
  1677. }
  1678. .container-group {
  1679. width: 314px;
  1680. margin: 0px 4px;
  1681. background: var(--container-group-bg);
  1682. max-height: 440px;
  1683. overflow-y: auto;
  1684. }
  1685. .container-item {
  1686. width: 100%;
  1687. height: 60px;
  1688. display: flex;
  1689. padding: 10px 0 0 20px;
  1690. margin-bottom: 5px;
  1691. position: relative;
  1692. background: var(--image-plane-bottom) no-repeat;
  1693. background-size: auto;
  1694. background-position: bottom;
  1695. &::before {
  1696. content: '';
  1697. display: block;
  1698. width: 100%;
  1699. height: 5px;
  1700. position: absolute;
  1701. top: 62px;
  1702. left: 0;
  1703. background-color: #73f4ff66;
  1704. backdrop-filter: blur(5px);
  1705. }
  1706. .item-icon {
  1707. width: 54px;
  1708. height: 45px;
  1709. background: var(--image-plane-icon-bg) no-repeat;
  1710. background-size: cover;
  1711. .icon-style {
  1712. font-size: 18px;
  1713. margin: 10px 0 0 20px;
  1714. color: #ffc800;
  1715. }
  1716. }
  1717. .item-name {
  1718. width: 180px;
  1719. display: flex;
  1720. align-items: center; /* 垂直居中 */
  1721. word-wrap: break-word;
  1722. white-space: normal;
  1723. }
  1724. .item-value {
  1725. position: relative;
  1726. height: 26px;
  1727. line-height: 24px;
  1728. margin: 15px 0;
  1729. text-align: center;
  1730. width: 80px;
  1731. border: 1px solid var(--vent-base-border);
  1732. border-radius: 13px;
  1733. background: linear-gradient(to right, #00f5fe44, #0090ff44);
  1734. &::before {
  1735. width: 6px;
  1736. height: 6px;
  1737. content: '';
  1738. position: absolute;
  1739. left: -3px;
  1740. top: 8px;
  1741. background: #ffa500;
  1742. border-radius: 3px;
  1743. }
  1744. }
  1745. .text-red-bold {
  1746. color: red;
  1747. font-weight: bold;
  1748. }
  1749. }
  1750. .warning-header {
  1751. display: flex;
  1752. font-size: 14px;
  1753. .header-item {
  1754. flex: 1;
  1755. display: flex;
  1756. justify-content: center;
  1757. align-items: center;
  1758. .header-title {
  1759. width: 100%;
  1760. text-align: center;
  1761. padding: 1px 0;
  1762. color: var(--vent-font-action-link);
  1763. margin-top: 10px;
  1764. background: #1eb0ff22;
  1765. }
  1766. .header-value {
  1767. // width: 133px;
  1768. height: 36px;
  1769. font-weight: 600;
  1770. font-family: 'douyuFont';
  1771. font-size: 16px;
  1772. color: #ffa500;
  1773. display: flex;
  1774. justify-content: center;
  1775. align-items: center;
  1776. margin-top: 15px;
  1777. margin-left: 8px;
  1778. }
  1779. }
  1780. }
  1781. .warning-group {
  1782. padding: 0 10px;
  1783. position: relative;
  1784. .warning-item {
  1785. display: flex;
  1786. flex-direction: row;
  1787. justify-content: space-between;
  1788. align-items: center;
  1789. height: 38px;
  1790. .item-name {
  1791. display: flex;
  1792. align-items: center;
  1793. // padding-left: 5px;
  1794. .icon {
  1795. width: 6px;
  1796. height: 6px;
  1797. display: inline-block;
  1798. background-color: var(--vent-base-light-bg);
  1799. border-radius: 3px;
  1800. position: relative;
  1801. margin-right: 8px;
  1802. &::before {
  1803. content: '';
  1804. width: 10px;
  1805. height: 10px;
  1806. display: block;
  1807. border: 1px solid #34edff99;
  1808. border-radius: 5px;
  1809. position: absolute;
  1810. top: -2px;
  1811. left: -2px;
  1812. }
  1813. }
  1814. &::before {
  1815. content: '';
  1816. display: block;
  1817. width: 1px;
  1818. height: 38px;
  1819. position: absolute;
  1820. left: 12px;
  1821. background-color: var(--vent-base-light-bg);
  1822. }
  1823. }
  1824. }
  1825. }
  1826. .warning-group-r {
  1827. &::before {
  1828. content: '';
  1829. display: block;
  1830. width: 1px;
  1831. height: 100%;
  1832. position: absolute;
  1833. left: 12px;
  1834. background-color: var(--vent-base-light-bg);
  1835. }
  1836. }
  1837. }
  1838. }
  1839. }
  1840. .input-box {
  1841. display: flex;
  1842. align-items: center;
  1843. .input-title {
  1844. color: #73e8fe;
  1845. width: auto;
  1846. }
  1847. margin-right: 10px;
  1848. }
  1849. .label {
  1850. max-width: 220px;
  1851. }
  1852. #fanLocalSelectDom {
  1853. :deep(.@{ventSpace}-select-dropdown) {
  1854. left: 0px !important;
  1855. top: 35px !important;
  1856. }
  1857. }
  1858. .@{ventSpace}-input {
  1859. width: 150px;
  1860. }
  1861. :deep(#LivePlayerBox) {
  1862. display: flex;
  1863. flex-direction: row;
  1864. justify-content: flex-end;
  1865. padding-right: 380px;
  1866. pointer-events: none;
  1867. .video-parent {
  1868. height: 208px;
  1869. pointer-events: auto !important;
  1870. }
  1871. }
  1872. .to-right {
  1873. :deep(#LivePlayerBox) {
  1874. padding-right: 0px;
  1875. }
  1876. }
  1877. :deep(.button-box) {
  1878. position: relative;
  1879. padding: 5px;
  1880. // border: 1px transparent solid;
  1881. border-radius: 5px;
  1882. margin-left: 8px;
  1883. margin-right: 8px;
  1884. width: auto;
  1885. // height: 40px;
  1886. // border: 1px solid #65dbea;
  1887. height: 35px !important;
  1888. display: flex;
  1889. align-items: center;
  1890. justify-content: center;
  1891. color: var(--vent-font-color);
  1892. padding: 0 15px 5px 15px;
  1893. cursor: pointer;
  1894. &:hover {
  1895. background: var(--vent-device-manager-control-btn-hover);
  1896. }
  1897. &::before {
  1898. width: calc(100% - 6px);
  1899. height: 27px;
  1900. content: '';
  1901. position: absolute;
  1902. top: 3px;
  1903. right: 0;
  1904. left: 3px;
  1905. bottom: 0;
  1906. z-index: -1;
  1907. border-radius: inherit;
  1908. /*important*/
  1909. background: var(--vent-device-manager-control-btn);
  1910. }
  1911. &::after {
  1912. width: calc(100% + 32px);
  1913. height: 10px;
  1914. content: '';
  1915. position: absolute;
  1916. top: 28px;
  1917. right: 0;
  1918. left: -16px;
  1919. bottom: 0;
  1920. z-index: -1;
  1921. border-radius: inherit;
  1922. /*important*/
  1923. background-position: center;
  1924. background-size: 100%;
  1925. z-index: 999;
  1926. }
  1927. }
  1928. .video-icon {
  1929. width: 30px;
  1930. height: 38px;
  1931. position: absolute;
  1932. top: 580px;
  1933. right: 395px;
  1934. color: var(--vent-font-color);
  1935. z-index: 1;
  1936. font-size: 28px;
  1937. }
  1938. .no-play {
  1939. &::after {
  1940. position: absolute;
  1941. width: 80%;
  1942. height: 100%;
  1943. content: '';
  1944. left: 12%;
  1945. top: -5px;
  1946. background: linear-gradient(
  1947. to bottom left,
  1948. transparent 0%,
  1949. transparent calc(50% - 2px),
  1950. #ffffff 50%,
  1951. transparent calc(50% + 2px),
  1952. transparent 100%
  1953. );
  1954. }
  1955. }
  1956. </style>