index.vue 49 KB

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