index.vue 77 KB

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