index.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445
  1. <template>
  2. <div class="scene-box" v-if="isRefresh">
  3. <!-- <div class="top-header">智能通风管理系统</div> -->
  4. <div class="select-node" :class="{ 'node-select-show': !treeShow, 'node-select-hide': treeShow, }"
  5. @click="showTree('treeShow', true)">
  6. <SvgIcon class="is-expansion-icon put-away-icon" size="38" name="expansion" />
  7. <span class="title">{{ treeNodeTitle }}</span>
  8. </div>
  9. <div class="device-select" :class="{ 'device-select-show': treeShow, 'device-select-hide': !treeShow, }">
  10. <SvgIcon class="is-expansion-icon expansion-icon" size="28" name="put-away" @click="showTree('treeShow', false)" />
  11. <div class="device-select-box">
  12. <a-tree :show-line="true" :tree-data="treeData" v-model:selectedKeys="selectedKeys" :autoExpandParent="true"
  13. v-model:expandedKeys="expandedKeys" @select="onSelect">
  14. </a-tree>
  15. </div>
  16. </div>
  17. <div class="location-icon"
  18. :class="{ 'location-btn-show': !locationSettingShow, 'location-btn-hide': locationSettingShow, }"
  19. @click="showTree('location', true)">
  20. <SvgIcon size="18" name="put-away" />
  21. <span class="location-text">定位图标显示</span>
  22. </div>
  23. <div class="location-select"
  24. :class="{ 'location-select-show': locationSettingShow, 'location-select-hide': !locationSettingShow, }">
  25. <div class="location-select-box">
  26. <div class="location-top-title" @click="showTree('location', false)">
  27. <SvgIcon class="is-expansion-icon location-expansion-icon" size="28" name="expansion" />
  28. <div class="title">定位图标显示</div>
  29. </div>
  30. <div class="location-container">
  31. <template v-for="location in locationList" :key="location.deviceType">
  32. <div class="location-item">
  33. <div class="item-title">{{ location.title }}&nbsp;:</div>
  34. <div>
  35. <a-radio-group v-model:value="location.Visible" :name="location.deviceType">
  36. <a-radio :value="1">是</a-radio>
  37. <a-radio :value="0">否</a-radio>
  38. </a-radio-group>
  39. </div>
  40. </div>
  41. </template>
  42. <div class="location-bottom-btn">
  43. <span @click="setLocation">提交</span>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 230, scroll, 125)" id="monitorBox">
  49. <!-- <dv-border-box8 :dur="5" :style="`padding: 5px; height: ${scroll.y + 100}px`" > -->
  50. <div :style="`padding: 5px; height: ${scroll.y + 100}px`">
  51. <div class="to-small" @click="toHome"></div>
  52. <div class="device-button-group" v-if="deviceList.length > 0">
  53. <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }"
  54. v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}</div>
  55. <div v-if="haveSysDetailArr.find((item) => deviceType.startsWith(item))" class="enter-detail" @click="goDetail()">
  56. <send-outlined />
  57. {{ treeNodeTitle }}详情
  58. </div>
  59. </div>
  60. <div v-else-if="deviceType == 'forcFan'">
  61. <div class="device-button-group">
  62. <div class="enter-detail" @click="goDetail()">
  63. <send-outlined />
  64. {{ treeNodeTitle }}详情
  65. </div>
  66. </div>
  67. </div>
  68. <div style="color: #fff;">{{ deviceType }}</div>
  69. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox">
  70. <a-tab-pane key="1" tab="实时监测">
  71. <template v-if="(deviceType.startsWith('fanlocal') || deviceType.startsWith('fanmain')) && activeKey == '1'">
  72. <GroupMonitorTable ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll" :isAction="true" :isShowSelect="false">
  73. <template #action="{ record }">
  74. <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
  75. {
  76. label: '详情',
  77. onClick: goDetail.bind(null, record),
  78. },
  79. {
  80. label: '定位',
  81. onClick: goLocation.bind(null, record),
  82. },
  83. ] : [
  84. {
  85. label: '定位',
  86. onClick: goLocation.bind(null, record),
  87. },
  88. ]" />
  89. </template>
  90. </GroupMonitorTable>
  91. </template>
  92. <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
  93. <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="{ y: scroll.y - 30 }" :pagination="false"></a-table>
  94. </template>
  95. <template v-else-if="deviceType.startsWith('safetymonitor') && activeKey == '1'">
  96. <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
  97. design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
  98. :form-config="formConfig" :scroll="{ y: scroll.y - 110 }">
  99. <template #action="{ record }">
  100. <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
  101. {
  102. label: '详情',
  103. onClick: goDetail.bind(null, record),
  104. },
  105. {
  106. label: '定位',
  107. onClick: goLocation.bind(null, record),
  108. },
  109. ] : [
  110. {
  111. label: '定位',
  112. onClick: goLocation.bind(null, record),
  113. },
  114. ]" />
  115. </template>
  116. <template #filterCell="{ column, record }">
  117. <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
  118. <div v-if="!record.V && column.dataIndex === 'V'">-</div>
  119. <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
  120. <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
  121. <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
  122. <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
  123. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  124. record.netStatus == '0' ? '断开' : '连接'
  125. }}</a-tag>
  126. </template>
  127. </MonitorTable>
  128. </template>
  129. <template v-else-if="deviceType.startsWith('location') && activeKey == '1'">
  130. <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
  131. design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
  132. :form-config="locationFormConfig" :scroll="{ y: scroll.y - 110 }">
  133. <template #action="{ record }">
  134. <TableAction :actions=" [
  135. {
  136. label: '定位',
  137. onClick: goLocation.bind(null, record),
  138. },
  139. ]" />
  140. </template>
  141. </MonitorTable>
  142. </template>
  143. <template v-else-if="deviceType.startsWith('vehicle') && activeKey == '1'">
  144. <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
  145. design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
  146. :form-config="vehicleFormConfig" :scroll="{ y: scroll.y - 110 }">
  147. <template #action="{ record }">
  148. <TableAction :actions=" [
  149. {
  150. label: '定位',
  151. onClick: goLocation.bind(null, record),
  152. },
  153. ]" />
  154. </template>
  155. </MonitorTable>
  156. </template>
  157. <template v-else>
  158. <!-- 工作面echarts图标 -->
  159. <BarAndLine
  160. v-if="activeKey == '1' && deviceType == 'surface_history'"
  161. class="echarts-line"
  162. xAxisPropType="time"
  163. :dataSource="surfaceEchartsData"
  164. height="300px"
  165. :chartsColumns="surfaceChartsColumns"
  166. :option="echatsOption"
  167. chartsType="listMonitor" />
  168. <MonitorTable v-else-if="activeKey == '1'" ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
  169. design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
  170. :scroll="{ y: scroll.y - 30 }">
  171. <template #action="{ record }">
  172. <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
  173. {
  174. label: '详情',
  175. onClick: goDetail.bind(null, record),
  176. },
  177. {
  178. label: '定位',
  179. onClick: goLocation.bind(null, record),
  180. },
  181. ] : [
  182. {
  183. label: '定位',
  184. onClick: goLocation.bind(null, record),
  185. },
  186. ]" />
  187. </template>
  188. <template #filterCell="{ column, record }">
  189. <template v-if="deviceType.startsWith('gate')">
  190. <template v-if="record.frontGateOpenCtrl == 1 || record.frontGateOpenCtrl === true">
  191. <a-tag
  192. v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
  193. color="red">正在打开</a-tag>
  194. <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
  195. </template>
  196. <template v-else-if="record.frontGateOpenCtrl == 0 || record.frontGateOpenCtrl === false">
  197. <a-tag
  198. v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
  199. color="red">正在关闭</a-tag>
  200. <a-tag
  201. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
  202. color="default">关闭</a-tag>
  203. <a-tag
  204. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0"
  205. color="default">打开</a-tag>
  206. </template>
  207. <template v-if="record.rearGateOpenCtrl == 1 || record.rearGateOpenCtrl === true">
  208. <a-tag
  209. v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
  210. color="red">正在打开</a-tag>
  211. <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
  212. </template>
  213. <template v-else-if="record.rearGateOpenCtrl == 0 || record.rearGateOpenCtrl === false">
  214. <a-tag
  215. v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
  216. color="red">正在关闭</a-tag>
  217. <a-tag
  218. v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1"
  219. color="default">关闭</a-tag>
  220. <a-tag
  221. v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0"
  222. color="default">打开</a-tag>
  223. </template>
  224. <template v-if="column.dataIndex === 'ndoortype'">
  225. <span
  226. v-if="record.ndoortype == 0"
  227. color="red">行车风门</span>
  228. <span
  229. v-else
  230. color="default">行人风门</span>
  231. </template>
  232. </template>
  233. <template v-else-if="deviceType.startsWith('windrect')">
  234. <a-tag v-if="column.dataIndex === 'sign'"
  235. :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
  236. record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
  237. }}</a-tag>
  238. <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
  239. <a-tag v-if="record.isRun == -2 || record.isRun == -1"
  240. :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
  241. record.isRun == -2 ? '空闲' : '等待'
  242. }}</a-tag>
  243. <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
  244. <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
  245. </template>
  246. </template>
  247. <template v-else-if="deviceType.startsWith('safetymonitor')">
  248. <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
  249. <div v-if="!record.V && column.dataIndex === 'V'">-</div>
  250. <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
  251. <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
  252. <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
  253. <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
  254. </template>
  255. <a-tag v-if="column.dataIndex === 'warnFlag'"
  256. :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"> {{
  257. record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
  258. }}</a-tag>
  259. <template v-else-if="column.dataIndex === 'warnLevel'">
  260. <a-tag v-if="record.warnLevel == '101'" color="green">低风险</a-tag>
  261. <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">一般风险</a-tag>
  262. <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">较大风险</a-tag>
  263. <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">重大风险</a-tag>
  264. <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
  265. <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
  266. <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
  267. <a-tag v-else color="green">正常</a-tag>
  268. </template>
  269. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
  270. record.netStatus == '0' ? '断开' : '连接'
  271. }}</a-tag>
  272. </template>
  273. </MonitorTable>
  274. </template>
  275. </a-tab-pane>
  276. <a-tab-pane key="2" tab="历史数据" v-if="!(noHistoryArr()).find((item) => deviceType.startsWith(item))">
  277. <div class="tab-item" >
  278. <HistoryTable ref="historyTable" v-if="activeKey == '2'"
  279. :sysId="systemID"
  280. :columns-type="`${deviceType}`"
  281. :device-type="deviceType"
  282. designScope="device-history" :scroll="scroll" />
  283. </div>
  284. </a-tab-pane>
  285. <a-tab-pane key="3" tab="报警历史" v-if="!noWarningArr.find((item) => deviceType.startsWith(item))">
  286. <div class="tab-item">
  287. <AlarmHistoryTable ref="alarmHistoryTable" v-if="activeKey == '3'" :sysId="systemID" columns-type="alarm"
  288. :device-type="deviceType"
  289. :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID, pageSize: 10000 })" :scroll="scroll"
  290. designScope="alarm-history" />
  291. </div>
  292. </a-tab-pane>
  293. <a-tab-pane key="4" tab="操作历史" v-if="haveHandlerArr.find((item) => deviceType.startsWith(item))">
  294. <div class="tab-item">
  295. <HandlerHistoryTable ref="handlerHistoryTable" v-if="activeKey == '4'" :sysId="systemID"
  296. columns-type="operator_history" :device-type="deviceType"
  297. :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })" :scroll="scroll"
  298. designScope="operator-history" />
  299. </div>
  300. </a-tab-pane>
  301. </a-tabs>
  302. <!-- </dv-border-box8> -->
  303. </div>
  304. </div>
  305. <mainPath v-if="deviceType == 'majorpath'" :dataSource="majorPathEchartsData" style="width: 300px; height: 300px; position: absolute; left: 250px;"/>
  306. <component v-if="modalVisible" :is="currentModal" v-model:visible="modalVisible" :dataSource="dataSource"
  307. :activeID="activeID" />
  308. </div>
  309. </template>
  310. <script setup lang="ts">
  311. import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch } from 'vue'
  312. import { SendOutlined } from '@ant-design/icons-vue';
  313. import { list, getDeviceList, getDeviceTypeList, devPosition } from './device.api'
  314. import AlarmHistoryTable from '../../../comment/AlarmHistoryTable.vue';
  315. import HistoryTable from '../../../comment/HistoryTable.vue';
  316. import HandlerHistoryTable from '../../../comment/HandlerHistoryTable.vue';
  317. import MonitorTable from '../../../comment/MonitorTable.vue';
  318. import GroupMonitorTable from '../../../comment/GroupMonitorTable.vue';
  319. import { TreeProps, message, Progress } from 'ant-design-vue';
  320. import { TableAction } from '/@/components/Table';
  321. import { SvgIcon } from '/@/components/Icon';
  322. import { getActions } from '/@/qiankun/state';
  323. import { useRouter } from 'vue-router';
  324. import { setDivHeight } from '/@/utils/event';
  325. import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr, surfaceChartsColumns, noHistoryArr, getMonitorComponent, locationFormConfig, vehicleFormConfig } from './device.data'
  326. import mainPath from './modal/mainPath.vue'
  327. import { formConfig } from '../../../safetyMonitor/safety.data'
  328. import { getDictItemsByCode } from '/@/utils/dict';
  329. import BarAndLine from '/@/components/chart/BarAndLine.vue';
  330. import { nextTick } from 'vue';
  331. // import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  332. const {FiberModal, BundleModal, DustModal, BallvalveModal, AtomizingModal, GaspatrolModal} = getMonitorComponent()
  333. type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
  334. const props = defineProps({
  335. pageData: {
  336. type: Object,
  337. default: () => { }
  338. }
  339. })
  340. const echatsOption = {
  341. grid: {
  342. top: '35',
  343. left: '30',
  344. right: '45',
  345. bottom: '25',
  346. containLabel: true
  347. },
  348. toolbox: {
  349. feature: {}
  350. },
  351. }
  352. const router = useRouter()
  353. const actions = getActions();
  354. // actions.setGlobalState({ pageObj: { pageType: 'home' } });
  355. const monitorTable = ref()
  356. const historyTable = ref()
  357. const alarmHistoryTable = ref()
  358. const handlerHistoryTable = ref()
  359. // const routerParam = ref('home') // 默认进来时首页
  360. const isRefresh = ref(true)
  361. // 模态框
  362. const currentModal = shallowRef<Nullable<ComponentOptions>>(null); //模态框
  363. const modalVisible = ref<Boolean>(false); // 模态框是否可见
  364. // const drawerHeight = ref(240) // 监测框最小高度
  365. const treeShow = ref(true) //是否显示树形菜单
  366. const locationSettingShow = ref(false) //是否显示树形菜单
  367. const treeNodeTitle = ref('') // 选中的树形标题
  368. const locationList = ref([]) //巷道定位图标显示列表
  369. const deviceList = ref<DeviceType[]>([]) //关联设备列表
  370. const deviceActive = ref('')
  371. const activeKey = ref('1'); // tab key
  372. const dataSource = shallowRef([]) // 实时监测数据
  373. const majorPathEchartsData = ref({}) // 关键路线echarts数据
  374. const surfaceEchartsData = ref<any[]>() // 工作面历史记录,echarts数据
  375. const activeID = ref('') // 打开详情modal时监测的设备id
  376. const deviceType = ref('') // 监测设备类型
  377. const systemType = ref('')
  378. const systemID = ref('') // 系统监测时,系统id
  379. const selectedKeys = ref<string[]>([]);
  380. const expandedKeys = ref<string[]>([]);
  381. const scroll = reactive({
  382. y: 210
  383. })
  384. const treeData = ref<TreeProps['treeData']>([]);
  385. //树形菜单选择事件
  386. const onSelect: TreeProps['onSelect'] = (keys, e) => {
  387. deviceType.value = ''
  388. systemID.value = ''
  389. deviceList.value = []
  390. const title = e.node.title; // 在
  391. debugger;
  392. if (e.node.parent && (e.node.parent.node.type.toString()).startsWith('sys')) {
  393. systemType.value = e.node.parent.node.type
  394. deviceType.value = e.node.parent.node.type
  395. systemID.value = e.node.type
  396. // 传递工作面id信息,用于定位
  397. actions.setGlobalState({ locationObj: { pageType: deviceType.value, deviceid: systemID.value }, pageObj: null });
  398. } else {
  399. systemType.value = e.node.type
  400. deviceType.value = e.node.type
  401. actions.setGlobalState({ locationObj: { pageType: deviceType.value }, pageObj: null });
  402. }
  403. if(timer == null){
  404. timer = undefined
  405. }
  406. if(timer){
  407. clearTimeout(timer)
  408. timer = undefined
  409. }
  410. setTimeout(() => {
  411. expandedKeys.value = keys
  412. selectedKeys.value = keys
  413. treeNodeTitle.value = e.node.title
  414. console.log('树选择器--------------->', selectedKeys.value, treeNodeTitle.value, e)
  415. dataSource.value = []
  416. activeKey.value = '1'
  417. timer = null
  418. if(e.node.children?.length < 1){
  419. getMonitor(true)
  420. }
  421. }, 200)
  422. };
  423. function tabChange(activeKeyVal) {
  424. activeKey.value = activeKeyVal;
  425. };
  426. function showTree(flag, value) {
  427. if (flag == 'treeShow') treeShow.value = value
  428. if (flag == 'location') locationSettingShow.value = value
  429. }
  430. async function getDeviceType() {
  431. if (treeData.value?.length > 0) return
  432. const result = await getDeviceTypeList({})
  433. if (result.length > 0) {
  434. const dataSource = <TreeProps['treeData']>[]
  435. let key = '0'
  436. const getData = (resultList, dataSourceList, keyVal) => {
  437. resultList.forEach((item, index) => {
  438. if (item.deviceType != 'sys' && item.children && item.children.length > 0) {
  439. const children = getData(item.children, [], `${keyVal}-${index}`)
  440. dataSourceList.push({
  441. children: children,
  442. title: item.itemText,
  443. key: `${keyVal}-${index}`,
  444. type: item.itemValue,
  445. parentKey: `${keyVal}`
  446. });
  447. } else {
  448. dataSourceList.push({
  449. children: [],
  450. title: item.itemText,
  451. key: `${keyVal}-${index}`,
  452. type: item.itemValue,
  453. parentKey: `${keyVal}`
  454. });
  455. }
  456. });
  457. return dataSourceList
  458. }
  459. treeData.value = getData(result, dataSource, key)
  460. }
  461. }
  462. // https获取监测数据
  463. let timer: null | NodeJS.Timeout = undefined;
  464. function getMonitor(flag?) {
  465. if (deviceType.value) {
  466. if (timer) timer = null
  467. if (Object.prototype.toString.call(timer) === '[object Null]') {
  468. timer = setTimeout(async () => {
  469. await getDataSource()
  470. if (timer) {
  471. getMonitor();
  472. }
  473. }, flag ? 0 : 1000);
  474. }
  475. }
  476. };
  477. async function getDataSource() {
  478. if (deviceType.value && deviceType.value.startsWith('sys') && systemID.value) {
  479. const res = await list({ devicetype: 'sys', systemID: systemID.value });
  480. const result = res.msgTxt;
  481. const deviceArr = <DeviceType[]>[]
  482. result.forEach(item => {
  483. const data = item['datalist'].filter((data: any) => {
  484. const readData = data.readData;
  485. return Object.assign(data, readData);
  486. })
  487. if (item.type != 'sys') {
  488. if(item.type === 'majorpath'){
  489. deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] })
  490. majorPathEchartsData.value = item['datalist'][0]
  491. }else if(item.type.startsWith('surface_history')) {
  492. surfaceEchartsData.value = item['datalist'][0]
  493. deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
  494. } else{
  495. deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
  496. }
  497. }
  498. })
  499. deviceList.value = deviceArr
  500. if (deviceArr.length > 0) {
  501. // if (deviceArr[1]) {
  502. // deviceActive.value = deviceArr[1].deviceType
  503. // monitorChange(1)
  504. // } else {
  505. // deviceActive.value = deviceArr[0].deviceType
  506. // monitorChange(0)
  507. // }
  508. deviceActive.value = deviceArr[0].deviceType
  509. monitorChange(0)
  510. }
  511. } else {
  512. let res = null
  513. if(systemID.value){
  514. res = await list({ devicetype: 'sys', types: deviceType.value, systemID: systemID.value })
  515. if (res && res.msgTxt) {
  516. const result = res.msgTxt;
  517. result.forEach(item => {
  518. const data = item['datalist'].filter((data: any) => {
  519. const readData = data.readData;
  520. return Object.assign(data, readData);
  521. })
  522. if (item.type != 'sys') {
  523. if (item.type.startsWith('majorpath') && item.type == deviceType.value) {
  524. dataSource.value = item['datalist'][0]['paths']
  525. majorPathEchartsData.value = item['datalist'][0]
  526. return
  527. }else if(item.type == deviceType.value) {
  528. if( item.type == 'surface_history') { // 工作面图标数据
  529. surfaceEchartsData.value = item['datalist'][0]
  530. }else{
  531. dataSource.value = data
  532. console.log('关联设备数据--------------->', data)
  533. }
  534. return
  535. }
  536. }
  537. })
  538. }
  539. }else{
  540. let resultData, searchForm;
  541. if(monitorTable.value){
  542. // 安全监控
  543. const formData = monitorTable.value.getForm()
  544. searchForm = formData.getFieldsValue()
  545. if(deviceType.value.startsWith('safetymonitor')){
  546. resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { ...searchForm } })
  547. }else if(deviceType.value.startsWith('location') || deviceType.value.startsWith('vehicle')) {
  548. const {strname, stationname} = searchForm
  549. // resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', strname: strname? '*'+strname+'*':'', stationname: stationname? '*'+stationname+'*':'' })
  550. resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', ...searchForm})
  551. }else{
  552. resultData = await list({ devicetype: deviceType.value, pagetype: 'normal'})
  553. }
  554. }else{
  555. // 非安全监控
  556. resultData = await list({ devicetype: deviceType.value, pagetype: 'normal'})
  557. }
  558. if (resultData && resultData.msgTxt) {
  559. const result = resultData.msgTxt[0];
  560. if(result){
  561. const data = result['datalist'].filter((data: any) => {
  562. const readData = data.readData;
  563. return Object.assign(data, readData);
  564. })
  565. if (deviceType.value.startsWith('safetymonitor')) {
  566. const resultData = <any[]>[]
  567. // 如果是安全监控的数据时需要过滤常见设备数据,根据设定的常用安全监控字典去匹配
  568. const dictCodes = getDictItemsByCode('safetynormal')
  569. if (!searchForm['dataTypeName'] && dictCodes && dictCodes.length) {
  570. for (let i = 0; i < dictCodes.length; i++) {
  571. const dict = dictCodes[i]
  572. data.forEach((item) => {
  573. if (dict['value'] == item['dataTypeName']) {
  574. resultData.push(item)
  575. }
  576. })
  577. }
  578. dataSource.value = resultData
  579. } else {
  580. dataSource.value = data
  581. }
  582. } else {
  583. dataSource.value = data
  584. }
  585. }else{
  586. dataSource.value = []
  587. }
  588. }else{
  589. dataSource.value = []
  590. }
  591. }
  592. }
  593. }
  594. function goLocation(record) {
  595. actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
  596. }
  597. function goDetail(record?) {
  598. if (record) {
  599. activeID.value = record.deviceID
  600. if (deviceType.value.startsWith('fiber')) {
  601. currentModal.value = FiberModal
  602. modalVisible.value = true;
  603. } else if (deviceType.value.startsWith('dusting')) {
  604. currentModal.value = DustModal
  605. modalVisible.value = true;
  606. }else if(deviceType.value.startsWith('gasmonitor')){//瓦斯巡检
  607. currentModal.value = gasModal
  608. modalVisible.value = true;
  609. } else if (deviceType.value.startsWith('bundletube')) {
  610. currentModal.value = BundleModal
  611. modalVisible.value = true;
  612. } else if (deviceType.value.startsWith('ballvalve')) {
  613. currentModal.value = BallvalveModal
  614. modalVisible.value = true;
  615. } else if (deviceType.value.startsWith('atomizing')) {
  616. currentModal.value = AtomizingModal
  617. modalVisible.value = true;
  618. } else if (deviceType.value.startsWith('gaspatrol')) {
  619. currentModal.value = GaspatrolModal
  620. modalVisible.value = true;
  621. } else if (deviceType.value.indexOf("gate") != -1) {
  622. const newPage = router.resolve({ path: '/monitorChannel/monitor-gate', query: { id: activeID.value } })
  623. window.open(newPage.href, '_blank')
  624. } else if (deviceType.value.indexOf("window") != -1) {
  625. const newPage = router.resolve({ path: '/monitorChannel/monitor-window', query: { id: activeID.value } })
  626. window.open(newPage.href, '_blank')
  627. } else if (deviceType.value.indexOf("windrect") != -1) {
  628. const newPage = router.resolve({ path: '/monitorChannel/monitor-windrect', query: { id: activeID.value } })
  629. window.open(newPage.href, '_blank')
  630. } else if (deviceType.value.indexOf("fanmain") != -1) {
  631. const newPage = router.resolve({ path: '/monitorChannel/monitor-fanmain', query: { id: activeID.value } })
  632. window.open(newPage.href, '_blank')
  633. } else if (deviceType.value.indexOf("fanlocal") != -1) {
  634. const newPage = router.resolve({ path: '/monitorChannel/monitor-fanlocal', query: { id: activeID.value, deviceType: deviceType.value } })
  635. window.open(newPage.href, '_blank')
  636. } else if (deviceType.value.indexOf("pulping") != -1) {
  637. const newPage = router.resolve({ path: '/grout-home', query: { id: activeID.value } })
  638. window.open(newPage.href, '_blank')
  639. } else if (deviceType.value.indexOf("pressurefan") != -1) {
  640. const newPage = router.resolve({ path: '/nitrogen/home', query: { id: activeID.value } })
  641. window.open(newPage.href, '_blank')
  642. } else if (deviceType.value.indexOf("chamber") != -1) {
  643. const newPage = router.resolve({ path: '/chamber-home', query: { id: activeID.value } })
  644. window.open(newPage.href, '_blank')
  645. } else if (deviceType.value.indexOf("safetymonitor") != -1) {
  646. const newPage = router.resolve({ path: '/monitorChannel/device-monitor/safetymonitor', query: { id: activeID.value } })
  647. window.open(newPage.href, '_blank')
  648. } else if (deviceType.value.indexOf("pump") != -1) {
  649. const newPage = router.resolve({ path: '/monitorChannel/gasPump-home', query: { id: activeID.value } })
  650. window.open(newPage.href, '_blank')
  651. } else if (systemType.value.indexOf("nitrogen") != -1) {
  652. const newPage = router.resolve({ path: '/nitrogen-home', query: { id: systemID.value } })
  653. window.open(newPage.href, '_blank')
  654. } else {
  655. message.info('待开发。。。')
  656. }
  657. } else {
  658. if (systemType.value.indexOf("sys_dongshi") != -1) {
  659. const newPage = router.resolve({ path: '/chamber-home', query: { id: systemID.value } })
  660. window.open(newPage.href, '_blank')
  661. } else if (systemType.value.indexOf("sys_obfurage") != -1) {
  662. const newPage = router.resolve({ path: '/monitorChannel/obfurage-home', query: { id: systemID.value } })
  663. window.open(newPage.href, '_blank')
  664. } else if (systemType.value.indexOf("sys_surface_caimei") != -1) {
  665. const newPage = router.resolve({ path: '/monitorChannel/wokerFace-home', query: { id: systemID.value } })
  666. window.open(newPage.href, '_blank')
  667. } else if (systemType.value.indexOf("sys_surface_juejin") != -1) {
  668. const newPage = router.resolve({ path: '/monitorChannel/tunFace-home', query: { id: systemID.value } })
  669. window.open(newPage.href, '_blank')
  670. } else if (systemType.value.indexOf("sys_maintunnel_leather") != -1) {
  671. const newPage = router.resolve({ path: '/monitorChannel/beltTun-home', query: { id: systemID.value } })
  672. window.open(newPage.href, '_blank')
  673. } else if (systemType.value.indexOf("sys_surface_junya") != -1) {
  674. const newPage = router.resolve({ path: '/monitorChannel/balancePress-home', query: { id: systemID.value } })
  675. window.open(newPage.href, '_blank')
  676. } else if (systemType.value.indexOf("sys_nitrogen") != -1) {
  677. const newPage = router.resolve({ path: '/nitrogen-home', query: { id: systemID.value } })
  678. window.open(newPage.href, '_blank')
  679. } else if (deviceType.value.indexOf("forcFan") != -1) {
  680. const newPage = router.resolve({ path: '/forcFan/home', query: { id: activeID.value } })
  681. window.open(newPage.href, '_blank')
  682. } else {
  683. message.info('待开发。。。')
  684. }
  685. }
  686. }
  687. function toHome() {
  688. deviceList.value = []
  689. if (timer) clearTimeout(timer)
  690. timer = undefined
  691. deviceType.value = ''
  692. actions.setGlobalState({ pageObj: { pageType: 'home' } });
  693. }
  694. async function findTreeDataValue(obj) {
  695. const findDeviceType = (data: [], obj) => {
  696. let type = ''
  697. if (obj.deviceid) {
  698. type = obj.deviceid
  699. } else {
  700. type = obj.deviceType
  701. }
  702. data.find((item: any) => {
  703. if (item.children.length > 0) {
  704. findDeviceType(item.children, obj)
  705. }
  706. if (item.type == type) {
  707. deviceType.value = obj.deviceid ? 'sys' : item.type
  708. if (obj.deviceid) systemID.value = obj.deviceid
  709. // const setKey = (item) => {
  710. // if(item.parentKey){
  711. // selectedKeys.value.push(item.parentKey)
  712. // expandedKeys.value.push(item.parentKey)
  713. // }
  714. // selectedKeys.value.push(item.key)
  715. // expandedKeys.value.push(item.key)
  716. // }
  717. // setKey(item)
  718. selectedKeys.value = [item.key]
  719. expandedKeys.value = [item.key]
  720. treeNodeTitle.value = item.title
  721. return true
  722. }
  723. return false
  724. })
  725. }
  726. findDeviceType(treeData.value, obj)
  727. // 无类型时
  728. if (!treeNodeTitle.value && treeData.value && treeData.value[0] && treeData.value[0]['children']) {
  729. const defaultData = treeData.value[0]['children'][0]
  730. deviceType.value = defaultData.type
  731. selectedKeys.value = [(defaultData.key as string)]
  732. expandedKeys.value = [(defaultData.key as string)]
  733. treeNodeTitle.value = defaultData.title
  734. }
  735. if (timer === undefined) {
  736. timer = null
  737. await getDataSource()
  738. getMonitor(true)
  739. }
  740. }
  741. function monitorChange(index) {
  742. dataSource.value = []
  743. deviceActive.value = deviceType.value = deviceList.value[index].deviceType
  744. if (activeKey.value == '1' && monitorTable.value) {
  745. monitorTable.value.setLoading(true)
  746. dataSource.value = deviceList.value[index].datalist
  747. }
  748. if (activeKey.value == '2' && historyTable.value) {
  749. historyTable.value.setLoading(true)
  750. }
  751. if (activeKey.value == '3' && alarmHistoryTable.value) {
  752. alarmHistoryTable.value.setLoading(true)
  753. }
  754. if (activeKey.value == '4' && handlerHistoryTable.value) {
  755. handlerHistoryTable.value.setLoading(true)
  756. }
  757. }
  758. /**
  759. * 设置巷道设备定位图标的显示与隐藏
  760. */
  761. function setLocation() {
  762. let locationStr = ''
  763. locationList.value.forEach((item: any) => {
  764. if (item.Visible) {
  765. locationStr = locationStr ? locationStr + ',' + item.value : item.value
  766. }
  767. })
  768. actions.setGlobalState({ locationId: null, locationObj: null, pageObj: null, locationPlane: locationStr });
  769. setTimeout(() => {
  770. message.success('设置成功')
  771. }, 600)
  772. }
  773. watch(() => props.pageData, (pageObj) => {
  774. isRefresh.value = false
  775. nextTick(() => {
  776. isRefresh.value = true
  777. if (pageObj.deviceid) {
  778. findTreeDataValue({ deviceid: pageObj.deviceid })
  779. } else if (pageObj.pageType) {
  780. findTreeDataValue({ deviceType: pageObj.pageType })
  781. }
  782. })
  783. })
  784. onMounted(async () => {
  785. await getDeviceType()
  786. const pageObj = props.pageData
  787. if(!pageObj) return
  788. if (pageObj.deviceid) {
  789. findTreeDataValue({ deviceid: pageObj.deviceid })
  790. } else {
  791. findTreeDataValue({ deviceType: pageObj.pageType })
  792. }
  793. // 定位
  794. const posShowData = pageObj.locationPlane
  795. if (posShowData) {
  796. locationList.value = posShowData
  797. }else{
  798. locationList.value = await devPosition({})
  799. }
  800. })
  801. onUnmounted(() => {
  802. if (timer) {
  803. clearTimeout(timer);
  804. }
  805. timer = undefined;
  806. })
  807. </script>
  808. <style lang="less" scoped >
  809. @import '/@/design/vent/modal.less';
  810. @ventSpace: zxm;
  811. .top-header {
  812. position: fixed;
  813. width: 100%;
  814. height: 56px;
  815. background: url('/@/assets/images/vent/home/modal-top.png');
  816. text-align: center;
  817. line-height: 56px;
  818. font-size: 28px;
  819. color: #ffffffdd;
  820. font-weight: 600;
  821. z-index: 1;
  822. letter-spacing: 2px;
  823. font-size: 30px;
  824. }
  825. .select-node {
  826. position: fixed;
  827. top: 60px;
  828. left: 10px;
  829. color: #fff;
  830. display: flex;
  831. justify-content: center;
  832. font-size: 22px;
  833. .title {
  834. margin-left: 10px;
  835. }
  836. }
  837. .expansion-icon {
  838. background: url('/@/assets/images/vent/home/tree-icon-bg.png') no-repeat;
  839. background-size: contain;
  840. position: absolute;
  841. left: 190px;
  842. top: 25px;
  843. &:hover {
  844. background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  845. background-size: contain;
  846. }
  847. }
  848. .device-select {
  849. width: 250px;
  850. height: 500px;
  851. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  852. position: fixed;
  853. top: 60px;
  854. left: 10px;
  855. background-size: contain;
  856. pointer-events: auto;
  857. padding: 20px 10px 30px 10px;
  858. }
  859. .is-expansion-icon {
  860. padding: 5px;
  861. pointer-events: auto;
  862. z-index: 999;
  863. }
  864. .device-select-show {
  865. left: 10px;
  866. animation-name: treeShow;
  867. /* 持续时间 */
  868. animation-duration: 1s;
  869. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  870. }
  871. .device-select-hide {
  872. left: -250px;
  873. animation-name: treeHide;
  874. /* 持续时间 */
  875. animation-duration: 1s;
  876. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  877. }
  878. .node-select-show {
  879. width: 276px;
  880. height: 44px;
  881. background: url('/@/assets/images/vent/home/tree-expansion-bg.png') no-repeat;
  882. left: 10px;
  883. animation-name: treeShow;
  884. /* 持续时间 */
  885. animation-duration: 1s;
  886. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  887. display: flex;
  888. align-items: center;
  889. margin-left: 0;
  890. justify-content: flex-start;
  891. pointer-events: auto;
  892. &:hover {
  893. background: url('/@/assets/images/vent/home/tree-expansion-hover-bg.png') no-repeat;
  894. }
  895. .put-away-icon {
  896. position: relative;
  897. display: inline-block;
  898. left: 4px;
  899. }
  900. }
  901. .node-select-hide {
  902. left: -400px;
  903. animation-name: treeHide;
  904. /* 持续时间 */
  905. animation-duration: 1s;
  906. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  907. }
  908. .device-select-box {
  909. width: 208px;
  910. height: 450px;
  911. overflow-y: auto;
  912. color: #fff;
  913. :deep(.zxm-tree) {
  914. background: transparent !important;
  915. color: #fff !important;
  916. .zxm-tree-switcher {
  917. background: transparent !important;
  918. }
  919. .zxm-tree-node-content-wrapper.zxm-tree-node-selected {
  920. background-color: #00b1c8;
  921. }
  922. .zxm-tree-node-content-wrapper:hover {
  923. background-color: #00b1c855;
  924. }
  925. input {
  926. height: 0px !important;
  927. }
  928. }
  929. &::-webkit-scrollbar-track {
  930. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  931. border-radius: 10px;
  932. background: #ededed22;
  933. height: 100px;
  934. }
  935. &::-webkit-scrollbar-thumb {
  936. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  937. background: #4288A444;
  938. }
  939. }
  940. .location-icon {
  941. width: 46px;
  942. height: 178px;
  943. position: absolute;
  944. top: 60px;
  945. // right: 0;
  946. background: url('/@/assets/images/vent/home/location-bg.png') no-repeat;
  947. background-size: contain;
  948. writing-mode: vertical-lr;
  949. line-height: 46px;
  950. color: #fff;
  951. padding-top: 10px;
  952. pointer-events: auto;
  953. cursor: pointer;
  954. &:hover {
  955. background: url('/@/assets/images/vent/home/location-hover-bg.png') no-repeat;
  956. }
  957. .location-text {
  958. padding-top: 20px;
  959. letter-spacing: 3px;
  960. font-size: 16px;
  961. }
  962. }
  963. .location-select {
  964. position: fixed;
  965. top: 60px;
  966. // right: 240px;
  967. pointer-events: auto;
  968. .location-select-box {
  969. width: 100%;
  970. height: 100%;
  971. position: relative;
  972. &::before {
  973. content: "";
  974. position: absolute;
  975. width: 230px;
  976. height: 500px;
  977. top: 0;
  978. left: 0;
  979. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  980. background-size: contain;
  981. transform: rotateY(180deg);
  982. z-index: -1;
  983. // &:hover {
  984. // background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  985. // background-size: contain;
  986. // }
  987. }
  988. .location-top-title {
  989. color: #fff;
  990. position: absolute;
  991. width: 225px;
  992. height: 68px;
  993. background: url('/@/assets/images/vent/home/turn-location-top-bg.png') no-repeat;
  994. background-size: contain;
  995. top: 5px;
  996. left: 5px;
  997. display: flex;
  998. flex-direction: row;
  999. justify-content: space-between;
  1000. align-items: flex-end;
  1001. .title {
  1002. font-size: 18px;
  1003. position: relative;
  1004. top: -14px;
  1005. right: 15px;
  1006. }
  1007. }
  1008. .location-expansion-icon {
  1009. background: url('/@/assets/images/vent/home/tree-icon-cover-bg.png') no-repeat;
  1010. background-size: contain;
  1011. position: relative;
  1012. left: 10px;
  1013. top: -15px;
  1014. padding: 5px;
  1015. &:hover {
  1016. background: url('/@/assets/images/vent/home/tree-icon-cover-hover-bg.png') no-repeat;
  1017. background-size: contain;
  1018. }
  1019. }
  1020. }
  1021. .location-container {
  1022. width: 200px;
  1023. height: 390px;
  1024. position: absolute;
  1025. display: flex;
  1026. flex-direction: column;
  1027. top: 80px;
  1028. left: 18px;
  1029. overflow-y: auto;
  1030. .location-item {
  1031. color: #fff;
  1032. line-height: 30px;
  1033. display: flex;
  1034. justify-content: space-between;
  1035. background-image: linear-gradient(to left, #39f5ff05, #39f5ff10);
  1036. margin: 3px 0;
  1037. .item-title {
  1038. width: 80px;
  1039. text-align: right;
  1040. color: #87f1ff;
  1041. }
  1042. }
  1043. .location-bottom-btn {
  1044. width: 100%;
  1045. color: #fff;
  1046. display: flex;
  1047. justify-content: flex-end;
  1048. margin-top: 20px;
  1049. span {
  1050. display: inline-block;
  1051. width: 100%;
  1052. background: #00709955;
  1053. border-radius: 3px;
  1054. border: 1px solid rgba(174, 243, 255, 0.3);
  1055. text-align: center;
  1056. padding: 2px 0;
  1057. cursor: pointer;
  1058. &:hover {
  1059. background: #00557422;
  1060. }
  1061. }
  1062. }
  1063. }
  1064. }
  1065. .location-select-show {
  1066. right: 240px;
  1067. animation-name: locationShow;
  1068. /* 持续时间 */
  1069. animation-duration: 1s;
  1070. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  1071. }
  1072. .location-select-hide {
  1073. right: -2px;
  1074. animation-name: locationHide;
  1075. /* 持续时间 */
  1076. animation-duration: 1s;
  1077. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  1078. }
  1079. .location-btn-show {
  1080. right: -0px;
  1081. animation-name: locationBtnShow;
  1082. /* 持续时间 */
  1083. animation-duration: 1s;
  1084. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  1085. }
  1086. .location-btn-hide {
  1087. right: -240px;
  1088. animation-name: locationBtnHide;
  1089. /* 持续时间 */
  1090. animation-duration: 1s;
  1091. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  1092. }
  1093. .bottom-tabs-box {
  1094. position: relative;
  1095. .tabs-box {
  1096. width: calc(100% - 12px) !important;
  1097. bottom: 3px !important;
  1098. }
  1099. .to-small {
  1100. width: 60px;
  1101. height: 60px;
  1102. background: url('/@/assets/images/vent/home/tosmall.png') no-repeat center;
  1103. background-size: auto;
  1104. position: absolute;
  1105. top: -65px;
  1106. right: 36px;
  1107. border-radius: 10px;
  1108. padding: 8px;
  1109. backdrop-filter: blur(10px);
  1110. background-color: rgba(45, 86, 137, 0.418);
  1111. &:hover {
  1112. background-color: rgba(79, 104, 134, 0.418);
  1113. }
  1114. }
  1115. .device-button-group {
  1116. position: absolute;
  1117. top: -30px;
  1118. display: flex;
  1119. width: 100%;
  1120. .device-button {
  1121. height: 26px;
  1122. padding: 0 20px;
  1123. background: linear-gradient(45deg, #04e6fb55, #0c5cab55);
  1124. clip-path: polygon(10px 0,
  1125. 0 50%,
  1126. 10px 100%,
  1127. 100% 100%,
  1128. calc(100% - 10px) 50%,
  1129. 100% 0);
  1130. display: flex;
  1131. justify-content: center;
  1132. align-items: center;
  1133. color: #FFF;
  1134. position: relative;
  1135. cursor: pointer;
  1136. &:nth-child(1) {
  1137. left: calc(-6px * 1);
  1138. }
  1139. &:nth-child(2) {
  1140. left: calc(-6px * 2);
  1141. }
  1142. &:nth-child(3) {
  1143. left: calc(-6px * 3);
  1144. }
  1145. &:nth-child(4) {
  1146. left: calc(-6px * 4);
  1147. }
  1148. &:nth-child(5) {
  1149. left: calc(-6px * 5);
  1150. }
  1151. &:nth-child(6) {
  1152. left: calc(-6px * 6);
  1153. }
  1154. &:nth-child(7) {
  1155. left: calc(-6px * 7);
  1156. }
  1157. &:nth-child(8) {
  1158. left: calc(-6px * 8);
  1159. }
  1160. &:nth-child(9) {
  1161. left: calc(-6px * 9);
  1162. }
  1163. &:nth-child(10) {
  1164. left: calc(-6px * 10);
  1165. }
  1166. &:nth-child(11) {
  1167. left: calc(-6px * 11);
  1168. }
  1169. &:nth-child(12) {
  1170. left: calc(-6px * 12);
  1171. }
  1172. &:nth-child(13) {
  1173. left: calc(-6px * 13);
  1174. }
  1175. &:nth-child(14) {
  1176. left: calc(-6px * 14);
  1177. }
  1178. &:nth-child(15) {
  1179. left: calc(-6px * 15);
  1180. }
  1181. &:nth-child(16) {
  1182. left: calc(-6px * 16);
  1183. }
  1184. &:nth-child(17) {
  1185. left: calc(-6px * 17);
  1186. }
  1187. &:nth-child(18) {
  1188. left: calc(-6px * 18);
  1189. }
  1190. &:nth-child(19) {
  1191. left: calc(-6px * 19);
  1192. }
  1193. &:first-child {
  1194. clip-path: polygon(0 0,
  1195. 10px 50%,
  1196. 0 100%,
  1197. 100% 100%,
  1198. calc(100% - 10px) 50%,
  1199. 100% 0);
  1200. }
  1201. }
  1202. .device-active {
  1203. background: linear-gradient(45deg, #04e6fb, #0c5cab);
  1204. &::before {
  1205. border-color: #0efcff;
  1206. box-shadow: 1px 1px 3px 1px #0efcff inset;
  1207. }
  1208. }
  1209. }
  1210. .enter-detail {
  1211. color: #fff;
  1212. cursor: pointer;
  1213. position: absolute;
  1214. right: 20px;
  1215. top: 35px;
  1216. padding: 5px;
  1217. border-radius: 5px;
  1218. margin-left: 8px;
  1219. margin-right: 8px;
  1220. width: auto;
  1221. height: 33px !important;
  1222. display: flex;
  1223. align-items: center;
  1224. justify-content: center;
  1225. color: #fff;
  1226. padding: 5px 15px 5px 15px;
  1227. z-index: 999;
  1228. cursor: pointer;
  1229. &:hover {
  1230. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  1231. }
  1232. &::before {
  1233. width: calc(100% - 6px);
  1234. height: 27px;
  1235. content: '';
  1236. position: absolute;
  1237. top: 3px;
  1238. right: 0;
  1239. left: 3px;
  1240. bottom: 0;
  1241. z-index: -1;
  1242. border-radius: inherit;
  1243. /*important*/
  1244. background: linear-gradient(#1fa6cb, #127cb5);
  1245. }
  1246. }
  1247. }
  1248. @keyframes treeShow {
  1249. 0% {
  1250. left: -400px;
  1251. opacity: 0;
  1252. }
  1253. 100% {
  1254. left: 10px;
  1255. opacity: 1;
  1256. }
  1257. }
  1258. @keyframes treeHide {
  1259. 0% {
  1260. left: 10px;
  1261. opacity: 1;
  1262. }
  1263. 100% {
  1264. left: -400px;
  1265. opacity: 0;
  1266. }
  1267. }
  1268. @keyframes locationShow {
  1269. 0% {
  1270. right: 0px;
  1271. opacity: 0;
  1272. }
  1273. 100% {
  1274. right: 240px;
  1275. opacity: 1;
  1276. }
  1277. }
  1278. @keyframes locationHide {
  1279. 0% {
  1280. right: 240px;
  1281. opacity: 1;
  1282. }
  1283. 100% {
  1284. right: 0;
  1285. opacity: 0;
  1286. }
  1287. }
  1288. @keyframes locationBtnShow {
  1289. 0% {
  1290. right: -240px;
  1291. opacity: 0;
  1292. }
  1293. 100% {
  1294. right: -2px;
  1295. opacity: 1;
  1296. }
  1297. }
  1298. @keyframes locationBtnHide {
  1299. 0% {
  1300. right: -2px;
  1301. opacity: 1;
  1302. }
  1303. 100% {
  1304. right: -240px;
  1305. opacity: 0;
  1306. }
  1307. }
  1308. :deep(.@{ventSpace}-tabs-tabpane-active) {
  1309. // overflow: auto;
  1310. height: 100%;
  1311. }
  1312. :deep(.zxm-select-dropdown) {
  1313. left: 0 !important;
  1314. color: #000000 !important;
  1315. }
  1316. // :deep(.@{ventSpace}-pagination){
  1317. // margin-right: 20px !important;
  1318. // margin-top: 5px !important;
  1319. // display: flex;
  1320. // align-items: center;
  1321. // }
  1322. </style>