index.vue 54 KB

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