index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101
  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" @click="showTree('treeShow', false)" />
  11. <div class="device-select-box">
  12. <a-tree :show-line="true" :tree-data="treeData" v-model:selectedKeys="selectedKeys"
  13. :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)" id="monitorBox">
  50. <dv-border-box8 :dur="5" :style="`padding: 5px; height: ${scroll.y + 100}px`" >
  51. <div class="to-small" @click="toHome"></div>
  52. <div class="device-button-group" v-if="deviceList.length > 0">
  53. <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }"
  54. v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}</div>
  55. <div class="enter-detail" @click="goDetail()">
  56. <send-outlined />
  57. {{ treeNodeTitle }}详情
  58. </div>
  59. </div>
  60. <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox" v-if="isRefresh">
  61. <a-tab-pane key="1" tab="实时监测">
  62. <template v-if="deviceType == 'fan' && activeKey == '1'">
  63. <GroupMonitorTable :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" />
  64. </template>
  65. <template v-else-if="activeKey == '1'">
  66. <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
  67. design-scope="device_monitor" :isShowPagination="false" :isShowActionColumn="true" title="设备监测"
  68. :scroll="scroll">
  69. <template #action="{ record }">
  70. <TableAction :actions="[
  71. {
  72. label: '详情',
  73. onClick: goDetail.bind(null, record),
  74. },
  75. {
  76. label: '定位',
  77. onClick: goLocation.bind(null, record),
  78. },
  79. ]" />
  80. </template>
  81. <template #filterCell="{ column, record }">
  82. <template v-if="deviceType.startsWith('gate')">
  83. <template v-if="record.frontGateOpenCtrl">
  84. <a-tag
  85. v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
  86. color="red">正在打开</a-tag>
  87. <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
  88. </template>
  89. <template v-else>
  90. <a-tag
  91. v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
  92. color="red">正在关闭</a-tag>
  93. <a-tag
  94. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
  95. color="default">关闭</a-tag>
  96. <a-tag
  97. v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0"
  98. color="default">打开</a-tag>
  99. </template>
  100. <template v-if="record.rearGateOpenCtrl">
  101. <a-tag
  102. v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
  103. color="red">正在打开</a-tag>
  104. <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
  105. </template>
  106. <template v-else>
  107. <a-tag
  108. v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
  109. color="red">正在关闭</a-tag>
  110. <a-tag
  111. v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1"
  112. color="default">关闭</a-tag>
  113. <a-tag
  114. v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0"
  115. color="default">打开</a-tag>
  116. </template>
  117. </template>
  118. <template v-if="deviceType.startsWith('windrect')">
  119. <a-tag v-if="column.dataIndex === 'sign'"
  120. :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
  121. record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
  122. }}</a-tag>
  123. <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
  124. <a-tag v-if="record.isRun == -2 || record.isRun == -1"
  125. :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
  126. record.isRun == -2 ? '空闲' : '等待'
  127. }}</a-tag>
  128. <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
  129. <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
  130. </template>
  131. </template>
  132. <a-tag v-if="column.dataIndex === 'warnFlag'"
  133. :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"> {{
  134. record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
  135. }}</a-tag>
  136. <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
  137. record.netStatus == 0 ? '断开' : '连接'
  138. }}</a-tag>
  139. </template>
  140. </MonitorTable>
  141. </template>
  142. </a-tab-pane>
  143. <a-tab-pane key="2" tab="历史数据">
  144. <div class="tab-item">
  145. <HistoryTable ref="historyTable" v-if="activeKey == '2'" :sysId="systemID"
  146. :columns-type="`${deviceType}`" :device-type="deviceType"
  147. :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })"
  148. designScope="device-history" :scroll="scroll" />
  149. </div>
  150. </a-tab-pane>
  151. <a-tab-pane key="3" tab="报警历史">
  152. <div class="tab-item">
  153. <AlarmHistoryTable ref="alarmHistoryTable" v-if="activeKey == '3'" :sysId="systemID"
  154. columns-type="alarm" :device-type="deviceType"
  155. :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })" :scroll="scroll"
  156. designScope="alarm-history" />
  157. </div>
  158. </a-tab-pane>
  159. <a-tab-pane key="4" tab="操作历史">
  160. <div class="tab-item">
  161. <HandlerHistoryTable ref="handlerHistoryTable" v-if="activeKey == '4'" :sysId="systemID"
  162. columns-type="operatorhistory" :device-type="deviceType"
  163. :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })" :scroll="scroll"
  164. designScope="operator-history" />
  165. </div>
  166. </a-tab-pane>
  167. </a-tabs>
  168. </dv-border-box8>
  169. </div>
  170. <component v-if="modalVisible" :is="currentModal" v-model:visible="modalVisible" :dataSource="dataSource"
  171. :activeID="activeID" />
  172. </div>
  173. </template>
  174. <script setup lang="ts">
  175. import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, nextTick, watch, reactive, defineProps } from 'vue'
  176. import { SendOutlined } from '@ant-design/icons-vue';
  177. import { list, getDeviceList, getDeviceTypeList } from './device.api'
  178. import AlarmHistoryTable from '../../../comment/AlarmHistoryTable.vue';
  179. import HistoryTable from '../../../comment/HistoryTable.vue';
  180. import HandlerHistoryTable from '../../../comment/HandlerHistoryTable.vue';
  181. import MonitorTable from '../../../comment/MonitorTable.vue';
  182. import GroupMonitorTable from '../../../comment/GroupMonitorTable.vue';
  183. import { TreeProps, message, Progress } from 'ant-design-vue';
  184. import { TableAction } from '/@/components/Table';
  185. import FiberModal from './modal/fiber.modal.vue';
  186. import BundleModal from './modal/bundle.modal.vue'
  187. import DustModal from './modal/dust.modal.vue'
  188. import { SvgIcon } from '/@/components/Icon';
  189. import { getActions } from '/@/qiankun/state';
  190. import { useRouter } from 'vue-router';
  191. import { setDivHeight } from '/@/utils/event';
  192. import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
  193. type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
  194. const props = defineProps({
  195. pageData: {
  196. type: Object,
  197. default: () => {}
  198. }
  199. })
  200. const router = useRouter()
  201. const actions = getActions();
  202. // actions.setGlobalState({ pageObj: { pageType: 'home' } });
  203. const monitorTable = ref()
  204. const historyTable = ref()
  205. const alarmHistoryTable = ref()
  206. const handlerHistoryTable = ref()
  207. // const routerParam = ref('home') // 默认进来时首页
  208. const isRefresh = ref(true)
  209. // 模态框
  210. const currentModal = shallowRef<Nullable<ComponentOptions>>(null); //模态框
  211. const modalVisible = ref<Boolean>(false); // 模态框是否可见
  212. // const drawerHeight = ref(240) // 监测框最小高度
  213. const treeShow = ref(true) //是否显示树形菜单
  214. const locationSettingShow = ref(false) //是否显示树形菜单
  215. const treeNodeTitle = ref('') // 选中的树形标题
  216. const locationList = ref([]) //巷道定位图标显示列表
  217. const deviceList = ref<DeviceType[]>([]) //关联设备列表
  218. const deviceActive = ref('')
  219. const activeKey = ref('1'); // tab key
  220. const dataSource = shallowRef([]) // 实时监测数据
  221. const activeID = ref('') // 打开详情modal时监测的设备id
  222. const deviceType = ref('') // 监测设备类型
  223. const systemType = ref('')
  224. const systemID = ref('') // 系统监测时,系统id
  225. const selectedKeys = ref<string[]>([]);
  226. const expandedKeys = ref<string[]>(['0-0-0-1']);
  227. const scroll = reactive({
  228. y: 220
  229. })
  230. const treeData = ref<TreeProps['treeData']>([]);
  231. //树形菜单选择事件
  232. const onSelect: TreeProps['onSelect'] = (keys, e) => {
  233. deviceType.value = ''
  234. systemID.value = ''
  235. deviceList.value = []
  236. if (e.node.parent && (e.node.parent.node.type.toString()).startsWith('sys')) {
  237. systemType.value = e.node.parent.node.type
  238. deviceType.value = e.node.parent.node.type
  239. systemID.value = e.node.type
  240. // 传递工作面id信息,用于定位
  241. actions.setGlobalState({ locationObj: { pageType: deviceType.value, deviceid: systemID.value }, pageObj: null });
  242. } else {
  243. systemType.value = e.node.type
  244. deviceType.value = e.node.type
  245. }
  246. selectedKeys.value = keys
  247. treeNodeTitle.value = e.node.title
  248. dataSource.value = []
  249. };
  250. function tabChange(activeKeyVal) {
  251. activeKey.value = activeKeyVal;
  252. };
  253. function showTree(flag, value) {
  254. if (flag == 'treeShow') treeShow.value = value
  255. if (flag == 'location') locationSettingShow.value = value
  256. }
  257. async function getDeviceType() {
  258. if(treeData.value?.length > 0) return
  259. const result = await getDeviceTypeList({})
  260. if (result.length > 0) {
  261. const dataSource = <TreeProps['treeData']>[]
  262. let key = '0'
  263. const getData = (resultList, dataSourceList, keyVal) => {
  264. resultList.forEach((item, index) => {
  265. if (item.children && item.children.length > 0) {
  266. const children = getData(item.children, [], `${keyVal}-${index}`)
  267. dataSourceList.push({
  268. children: children,
  269. title: item.itemText,
  270. key: `${keyVal}-${index}`,
  271. type: item.itemValue,
  272. parentKey: `${keyVal}`
  273. });
  274. } else {
  275. dataSourceList.push({
  276. children: [],
  277. title: item.itemText,
  278. key: `${keyVal}-${index}`,
  279. type: item.itemValue,
  280. parentKey: `${keyVal}`
  281. });
  282. }
  283. });
  284. return dataSourceList
  285. }
  286. treeData.value = getData(result, dataSource, key)
  287. }
  288. }
  289. // https获取监测数据
  290. let timer: null | NodeJS.Timeout = undefined;
  291. function getMonitor() {
  292. if (deviceType.value) {
  293. if (timer) timer = null
  294. if (Object.prototype.toString.call(timer) === '[object Null]') {
  295. timer = setTimeout(async () => {
  296. await getDataSource()
  297. if (timer) {
  298. getMonitor();
  299. }
  300. }, 1000);
  301. }
  302. }
  303. };
  304. async function getDataSource() {
  305. if (deviceType.value && deviceType.value.startsWith('sys') && systemID.value) {
  306. const res = await list({ devicetype: 'sys', systemID: systemID.value });
  307. const result = res.msgTxt;
  308. const deviceArr = <DeviceType[]>[]
  309. result.forEach(item => {
  310. const data = item['datalist'].filter((data: any) => {
  311. const readData = data.readData;
  312. return Object.assign(data, readData);
  313. })
  314. if (item.type != 'sys') {
  315. deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
  316. }
  317. })
  318. deviceList.value = deviceArr
  319. if (deviceArr.length > 0) {
  320. if (deviceArr[1]) {
  321. deviceActive.value = deviceArr[1].deviceType
  322. monitorChange(1)
  323. } else {
  324. deviceActive.value = deviceArr[0].deviceType
  325. monitorChange(0)
  326. }
  327. }
  328. } else {
  329. const res = await list({ devicetype: deviceType.value, pagetype: 'normal' })
  330. if (res.msgTxt[0]) {
  331. dataSource.value = res.msgTxt[0].datalist || [];
  332. dataSource.value.filter((data: any) => {
  333. const readData = data.readData;
  334. return Object.assign(data, readData);
  335. });
  336. }
  337. }
  338. }
  339. function goLocation(record) {
  340. actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
  341. }
  342. function goDetail(record?) {
  343. if (record) {
  344. if (deviceType.value.startsWith('fiber')) {
  345. activeID.value = record.deviceID
  346. currentModal.value = FiberModal
  347. modalVisible.value = true;
  348. } else if (deviceType.value.startsWith('dusting')) { //bundletube
  349. activeID.value = record.deviceID
  350. currentModal.value = DustModal
  351. modalVisible.value = true;
  352. } else if (deviceType.value.startsWith('bundletube')) {
  353. activeID.value = record.deviceID
  354. currentModal.value = BundleModal
  355. modalVisible.value = true;
  356. } else if (deviceType.value.indexOf("gate") != -1) {
  357. const newPage = router.resolve({ path: '/monitorChannel/monitor-gate' })
  358. window.open(newPage.href, '_blank')
  359. } else if (deviceType.value.indexOf("window") != -1) {
  360. const newPage = router.resolve({ path: '/monitorChannel/monitor-window' })
  361. window.open(newPage.href, '_blank')
  362. } else if (deviceType.value.indexOf("windrect") != -1) {
  363. const newPage = router.resolve({ path: '/monitorChannel/monitor-windrect' })
  364. window.open(newPage.href, '_blank')
  365. } else if (deviceType.value.indexOf("fanmain") != -1) {
  366. const newPage = router.resolve({ path: '/monitorChannel/monitor-fan-main' })
  367. window.open(newPage.href, '_blank')
  368. } else if (deviceType.value.indexOf("fanlocal") != -1) {
  369. const newPage = router.resolve({ path: '/monitorChannel/monitor-fan-local' })
  370. window.open(newPage.href, '_blank')
  371. } else if (deviceType.value.indexOf("nitrogen") != -1) {
  372. const newPage = router.resolve({ path: '/compressor-home' })
  373. window.open(newPage.href, '_blank')
  374. } else if (deviceType.value.indexOf("pulping") != -1) {
  375. const newPage = router.resolve({ path: '/grout-home' })
  376. window.open(newPage.href, '_blank')
  377. } else if (deviceType.value.indexOf("pressurefan") != -1) {
  378. const newPage = router.resolve({ path: '/nitrogen/home' })
  379. window.open(newPage.href, '_blank')
  380. } else if (deviceType.value.indexOf("chamber") != -1) {
  381. const newPage = router.resolve({ path: '/chamber-home' })
  382. window.open(newPage.href, '_blank')
  383. } else {
  384. message.info('待开发。。。')
  385. }
  386. } else {
  387. if (systemType.value.indexOf("sys_dongshi") != -1) {
  388. const newPage = router.resolve({ path: '/chamber-home', query: { id: systemID.value } })
  389. window.open(newPage.href, '_blank')
  390. } else {
  391. message.info('待开发。。。')
  392. }
  393. }
  394. }
  395. function toHome() {
  396. deviceList.value = []
  397. if (timer) clearTimeout(timer)
  398. timer = undefined
  399. deviceType.value = ''
  400. actions.setGlobalState({ pageObj: { pageType: 'home' } });
  401. }
  402. async function findTreeDataValue(obj) {
  403. const findDeviceType = (data: [], obj) => {
  404. let type = ''
  405. if (obj.deviceid) {
  406. type = obj.deviceid
  407. } else {
  408. type = obj.deviceType
  409. }
  410. data.find((item: any) => {
  411. if (item.children.length > 0) {
  412. findDeviceType(item.children, obj)
  413. }
  414. if (item.type == type) {
  415. deviceType.value = obj.deviceid ? 'sys' : item.type
  416. if (obj.deviceid) systemID.value = obj.deviceid
  417. selectedKeys.value = [item.key]
  418. expandedKeys.value = [item.key]
  419. treeNodeTitle.value = item.title
  420. return true
  421. }
  422. return false
  423. })
  424. }
  425. findDeviceType(treeData.value, obj)
  426. if (timer === undefined) {
  427. timer = null
  428. await getDataSource()
  429. getMonitor()
  430. }
  431. }
  432. function monitorChange(index) {
  433. dataSource.value = []
  434. deviceActive.value = deviceType.value = deviceList.value[index].deviceType
  435. if (activeKey.value == '1' && monitorTable.value) {
  436. monitorTable.value.setLoading(true)
  437. dataSource.value = deviceList.value[index].datalist
  438. }
  439. if (activeKey.value == '2' && historyTable.value) {
  440. historyTable.value.setLoading(true)
  441. }
  442. if (activeKey.value == '3' && alarmHistoryTable.value) {
  443. alarmHistoryTable.value.setLoading(true)
  444. }
  445. if (activeKey.value == '4' && handlerHistoryTable.value) {
  446. handlerHistoryTable.value.setLoading(true)
  447. }
  448. }
  449. /**
  450. * 设置巷道设备定位图标的显示与隐藏
  451. */
  452. function setLocation() {
  453. let locationStr = ''
  454. locationList.value.forEach((item: any) => {
  455. if (item.Visible) {
  456. locationStr = locationStr ? locationStr + ',' + item.value : item.value
  457. }
  458. })
  459. actions.setGlobalState({ locationId: null, locationObj: null, pageObj: null, locationPlane: locationStr });
  460. setTimeout(() => {
  461. message.success('设置成功')
  462. }, 600)
  463. }
  464. onMounted(async () => {
  465. await getDeviceType()
  466. const pageObj = props.pageData
  467. if (pageObj.deviceid) {
  468. findTreeDataValue({ deviceid: pageObj.deviceid })
  469. } else {
  470. findTreeDataValue({ deviceType: pageObj.pageType })
  471. }
  472. // 定位
  473. const posShowData = pageObj.locationPlane
  474. if (posShowData) {
  475. locationList.value = posShowData
  476. }
  477. })
  478. onUnmounted(() => {
  479. if (timer) {
  480. clearTimeout(timer);
  481. }
  482. timer = undefined;
  483. })
  484. </script>
  485. <style lang="less" scoped >
  486. @import '/@/design/vent/modal.less';
  487. @ventSpace: zxm;
  488. .top-header{
  489. position: fixed;
  490. width: 100%;
  491. height: 56px;
  492. background: url('/@/assets/images/vent/home/modal-top.png');
  493. text-align: center;
  494. line-height: 56px;
  495. font-size: 28px;
  496. color: #ffffffdd;
  497. font-weight: 600;
  498. z-index: 1;
  499. letter-spacing: 2px;
  500. font-size: 30px;
  501. }
  502. .select-node {
  503. position: fixed;
  504. top: 60px;
  505. left: 10px;
  506. color: #fff;
  507. display: flex;
  508. justify-content: center;
  509. font-size: 22px;
  510. .title {
  511. margin-left: 10px;
  512. }
  513. }
  514. .expansion-icon {
  515. background: url('/@/assets/images/vent/home/tree-icon-bg.png') no-repeat;
  516. background-size: contain;
  517. position: absolute;
  518. left: 190px;
  519. top: 25px;
  520. &:hover {
  521. background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  522. background-size: contain;
  523. }
  524. }
  525. .device-select {
  526. width: 250px;
  527. height: 500px;
  528. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  529. position: fixed;
  530. top: 60px;
  531. left: 10px;
  532. background-size: contain;
  533. pointer-events: auto;
  534. padding: 20px 10px 30px 10px;
  535. }
  536. .is-expansion-icon {
  537. padding: 5px;
  538. pointer-events: auto;
  539. z-index: 999;
  540. }
  541. .device-select-show {
  542. left: 10px;
  543. animation-name: treeShow;
  544. /* 持续时间 */
  545. animation-duration: 1s;
  546. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  547. }
  548. .device-select-hide {
  549. left: -250px;
  550. animation-name: treeHide;
  551. /* 持续时间 */
  552. animation-duration: 1s;
  553. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  554. }
  555. .node-select-show {
  556. width: 276px;
  557. height: 44px;
  558. background: url('/@/assets/images/vent/home/tree-expansion-bg.png') no-repeat;
  559. left: 10px;
  560. animation-name: treeShow;
  561. /* 持续时间 */
  562. animation-duration: 1s;
  563. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  564. display: flex;
  565. align-items: center;
  566. margin-left: 0;
  567. justify-content: flex-start;
  568. pointer-events: auto;
  569. &:hover {
  570. background: url('/@/assets/images/vent/home/tree-expansion-hover-bg.png') no-repeat;
  571. }
  572. .put-away-icon {
  573. position: relative;
  574. display: inline-block;
  575. left: 4px;
  576. }
  577. }
  578. .node-select-hide {
  579. left: -400px;
  580. animation-name: treeHide;
  581. /* 持续时间 */
  582. animation-duration: 1s;
  583. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  584. }
  585. .device-select-box {
  586. width: 208px;
  587. height: 450px;
  588. overflow-y: auto;
  589. color: #fff;
  590. :deep(.zxm-tree) {
  591. background: transparent !important;
  592. color: #fff !important;
  593. .zxm-tree-switcher {
  594. background: transparent !important;
  595. }
  596. .zxm-tree-node-content-wrapper.zxm-tree-node-selected {
  597. background-color: #00b1c8;
  598. }
  599. .zxm-tree-node-content-wrapper:hover {
  600. background-color: #00b1c855;
  601. }
  602. input {
  603. height: 0px !important;
  604. }
  605. }
  606. &::-webkit-scrollbar-track {
  607. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  608. border-radius: 10px;
  609. background: #ededed22;
  610. height: 100px;
  611. }
  612. &::-webkit-scrollbar-thumb {
  613. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  614. background: #4288A444;
  615. }
  616. }
  617. .location-icon {
  618. width: 46px;
  619. height: 178px;
  620. position: absolute;
  621. top: 60px;
  622. // right: 0;
  623. background: url('/@/assets/images/vent/home/location-bg.png') no-repeat;
  624. background-size: contain;
  625. writing-mode: vertical-lr;
  626. line-height: 46px;
  627. color: #fff;
  628. padding-top: 10px;
  629. pointer-events: auto;
  630. cursor: pointer;
  631. &:hover {
  632. background: url('/@/assets/images/vent/home/location-hover-bg.png') no-repeat;
  633. }
  634. .location-text {
  635. padding-top: 20px;
  636. letter-spacing: 3px;
  637. font-size: 16px;
  638. }
  639. }
  640. .location-select {
  641. position: fixed;
  642. top: 60px;
  643. // right: 240px;
  644. pointer-events: auto;
  645. .location-select-box {
  646. width: 100%;
  647. height: 100%;
  648. position: relative;
  649. &::before {
  650. content: "";
  651. position: absolute;
  652. width: 230px;
  653. height: 500px;
  654. top: 0;
  655. left: 0;
  656. background: url('/@/assets/images/vent/home/tree-bg.png') no-repeat;
  657. background-size: contain;
  658. transform: rotateY(180deg);
  659. z-index: -1;
  660. // &:hover {
  661. // background: url('/@/assets/images/vent/home/tree-icon-hover-bg.png') no-repeat;
  662. // background-size: contain;
  663. // }
  664. }
  665. .location-top-title {
  666. color: #fff;
  667. position: absolute;
  668. width: 225px;
  669. height: 68px;
  670. background: url('/@/assets/images/vent/home/turn-location-top-bg.png') no-repeat;
  671. background-size: contain;
  672. top: 5px;
  673. left: 5px;
  674. display: flex;
  675. flex-direction: row;
  676. justify-content: space-between;
  677. align-items: flex-end;
  678. .title {
  679. font-size: 18px;
  680. position: relative;
  681. top: -14px;
  682. right: 15px;
  683. }
  684. }
  685. .location-expansion-icon {
  686. background: url('/@/assets/images/vent/home/tree-icon-cover-bg.png') no-repeat;
  687. background-size: contain;
  688. position: relative;
  689. left: 10px;
  690. top: -15px;
  691. padding: 5px;
  692. &:hover {
  693. background: url('/@/assets/images/vent/home/tree-icon-cover-hover-bg.png') no-repeat;
  694. background-size: contain;
  695. }
  696. }
  697. }
  698. .location-container {
  699. width: 200px;
  700. height: 390px;
  701. position: absolute;
  702. display: flex;
  703. flex-direction: column;
  704. top: 80px;
  705. left: 18px;
  706. overflow-y: auto;
  707. .location-item {
  708. color: #fff;
  709. line-height: 30px;
  710. display: flex;
  711. justify-content: space-between;
  712. background-image: linear-gradient(to left, #39f5ff05, #39f5ff10);
  713. margin: 3px 0;
  714. .item-title {
  715. width: 80px;
  716. text-align: right;
  717. color: #87f1ff;
  718. }
  719. }
  720. .location-bottom-btn {
  721. width: 100%;
  722. color: #fff;
  723. display: flex;
  724. justify-content: flex-end;
  725. margin-top: 20px;
  726. span {
  727. display: inline-block;
  728. width: 100%;
  729. background: #00709955;
  730. border-radius: 3px;
  731. border: 1px solid rgba(174, 243, 255, 0.3);
  732. text-align: center;
  733. padding: 2px 0;
  734. cursor: pointer;
  735. &:hover {
  736. background: #00557422;
  737. }
  738. }
  739. }
  740. }
  741. }
  742. .location-select-show {
  743. right: 240px;
  744. animation-name: locationShow;
  745. /* 持续时间 */
  746. animation-duration: 1s;
  747. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  748. }
  749. .location-select-hide {
  750. right: -2px;
  751. animation-name: locationHide;
  752. /* 持续时间 */
  753. animation-duration: 1s;
  754. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  755. }
  756. .location-btn-show {
  757. right: -0px;
  758. animation-name: locationBtnShow;
  759. /* 持续时间 */
  760. animation-duration: 1s;
  761. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  762. }
  763. .location-btn-hide {
  764. right: -240px;
  765. animation-name: locationBtnHide;
  766. /* 持续时间 */
  767. animation-duration: 1s;
  768. transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1) .5s;
  769. }
  770. .bottom-tabs-box {
  771. position: relative;
  772. height: 320px !important;
  773. .to-small {
  774. width: 60px;
  775. height: 60px;
  776. background: url('/@/assets/images/vent/home/tosmall.png') no-repeat center;
  777. background-size: auto;
  778. position: absolute;
  779. top: -65px;
  780. right: 36px;
  781. border-radius: 10px;
  782. padding: 8px;
  783. backdrop-filter: blur(10px);
  784. background-color: rgba(45, 86, 137, 0.418);
  785. &:hover {
  786. background-color: rgba(79, 104, 134, 0.418);
  787. }
  788. }
  789. .device-button-group {
  790. position: absolute;
  791. top: -30px;
  792. display: flex;
  793. width: 100%;
  794. .device-button {
  795. height: 26px;
  796. padding: 0 20px;
  797. background: linear-gradient(45deg, #04e6fb55, #0c5cab55);
  798. clip-path: polygon(10px 0,
  799. 0 50%,
  800. 10px 100%,
  801. 100% 100%,
  802. calc(100% - 10px) 50%,
  803. 100% 0);
  804. display: flex;
  805. justify-content: center;
  806. align-items: center;
  807. color: #FFF;
  808. position: relative;
  809. cursor: pointer;
  810. &:nth-child(1) {
  811. left: calc(-6px * 1);
  812. }
  813. &:nth-child(2) {
  814. left: calc(-6px * 2);
  815. }
  816. &:nth-child(3) {
  817. left: calc(-6px * 3);
  818. }
  819. &:nth-child(4) {
  820. left: calc(-6px * 4);
  821. }
  822. &:nth-child(5) {
  823. left: calc(-6px * 5);
  824. }
  825. &:nth-child(6) {
  826. left: calc(-6px * 6);
  827. }
  828. &:nth-child(7) {
  829. left: calc(-6px * 7);
  830. }
  831. &:nth-child(8) {
  832. left: calc(-6px * 8);
  833. }
  834. &:nth-child(9) {
  835. left: calc(-6px * 9);
  836. }
  837. &:nth-child(10) {
  838. left: calc(-6px * 10);
  839. }
  840. &:nth-child(11) {
  841. left: calc(-6px * 11);
  842. }
  843. &:nth-child(12) {
  844. left: calc(-6px * 12);
  845. }
  846. &:nth-child(13) {
  847. left: calc(-6px * 13);
  848. }
  849. &:nth-child(14) {
  850. left: calc(-6px * 14);
  851. }
  852. &:nth-child(15) {
  853. left: calc(-6px * 15);
  854. }
  855. &:first-child {
  856. clip-path: polygon(0 0,
  857. 10px 50%,
  858. 0 100%,
  859. 100% 100%,
  860. calc(100% - 10px) 50%,
  861. 100% 0);
  862. }
  863. }
  864. .device-active {
  865. background: linear-gradient(45deg, #04e6fb, #0c5cab);
  866. &::before {
  867. border-color: #0efcff;
  868. box-shadow: 1px 1px 3px 1px #0efcff inset;
  869. }
  870. }
  871. }
  872. .enter-detail {
  873. color: #fff;
  874. cursor: pointer;
  875. position: absolute;
  876. right: 120px;
  877. top: -6px;
  878. padding: 5px;
  879. border-radius: 5px;
  880. margin-left: 8px;
  881. margin-right: 8px;
  882. width: auto;
  883. height: 33px !important;
  884. display: flex;
  885. align-items: center;
  886. justify-content: center;
  887. color: #fff;
  888. padding: 5px 15px 5px 15px;
  889. cursor: pointer;
  890. &:hover {
  891. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  892. }
  893. &::before {
  894. width: calc(100% - 6px);
  895. height: 27px;
  896. content: '';
  897. position: absolute;
  898. top: 3px;
  899. right: 0;
  900. left: 3px;
  901. bottom: 0;
  902. z-index: -1;
  903. border-radius: inherit;
  904. /*important*/
  905. background: linear-gradient(#1fa6cb, #127cb5);
  906. }
  907. }
  908. }
  909. @keyframes treeShow {
  910. 0% {
  911. left: -400px;
  912. opacity: 0;
  913. }
  914. 100% {
  915. left: 10px;
  916. opacity: 1;
  917. }
  918. }
  919. @keyframes treeHide {
  920. 0% {
  921. left: 10px;
  922. opacity: 1;
  923. }
  924. 100% {
  925. left: -400px;
  926. opacity: 0;
  927. }
  928. }
  929. @keyframes locationShow {
  930. 0% {
  931. right: 0px;
  932. opacity: 0;
  933. }
  934. 100% {
  935. right: 240px;
  936. opacity: 1;
  937. }
  938. }
  939. @keyframes locationHide {
  940. 0% {
  941. right: 240px;
  942. opacity: 1;
  943. }
  944. 100% {
  945. right: 0;
  946. opacity: 0;
  947. }
  948. }
  949. @keyframes locationBtnShow {
  950. 0% {
  951. right: -240px;
  952. opacity: 0;
  953. }
  954. 100% {
  955. right: -2px;
  956. opacity: 1;
  957. }
  958. }
  959. @keyframes locationBtnHide {
  960. 0% {
  961. right: -2px;
  962. opacity: 1;
  963. }
  964. 100% {
  965. right: -240px;
  966. opacity: 0;
  967. }
  968. }
  969. :deep(.@{ventSpace}-tabs-tabpane-active) {
  970. // overflow: auto;
  971. height: 100%;
  972. }
  973. :deep(.zxm-select-dropdown) {
  974. left: 0 !important;
  975. }</style>