index.vue 53 KB

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