index.vue 55 KB

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