index.vue 53 KB

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