index.vue 54 KB

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