index.vue 54 KB

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