index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <div class="threejs-Object-CSS"></div>
  3. <div id="nitrogen3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"></div>
  4. <div class="vent-home">
  5. <div class="vent-home-header">
  6. <Decoration5 class="header-icon" :dur="2" :color="['#21437F', '#2CF7FE']" style="width:500px;height:40px;" />
  7. <div class="header-text">智能压风管控系统</div>
  8. </div>
  9. <div class="nitrogen-container">
  10. <div class="top-box">
  11. <!-- 左边监测数据 -->
  12. <div class="lr-box left-box">
  13. <div class="item item-l" v-for="groupNum in monitorDataGroupNum" :key="groupNum">
  14. <dv-decoration7 style="height:30px;">
  15. <div class="base-title">空压机{{ groupNum }}</div>
  16. </dv-decoration7>
  17. <div class="monitor-box">
  18. <div class="state-item" v-for="(data, index) in showMonitorData" :key="index">
  19. <div class="item-col" v-if="Object.values(data).length > 0">
  20. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  21. <span class="state-val">{{ (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[0]]) >= 0 ? monitorData[groupNum - 1][Object.keys(data)[0]] : '-' }}</span>
  22. </div>
  23. <div class="item-col" v-if="Object.values(data).length > 1">
  24. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  25. <span class="state-val">{{ (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[1]]) >= 0 ? monitorData[groupNum - 1][Object.keys(data)[1]] : '-' }}</span>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- 右边控制状态 -->
  32. <div class="lr-box right-box">
  33. <div class="item" >
  34. <div class="control-item">
  35. <div class="control-item-l">
  36. <!-- <img src="@/assets/img/yccz.png" alt="" width="36px" height="36px" style="margin-right: 10px;"> -->
  37. <span style="font-size: 18px;">远程控制</span>
  38. </div>
  39. </div>
  40. <div class="control-item" v-for="groupNum in monitorDataGroupNum" :key="groupNum">
  41. <div class="control-item-l">
  42. <span class="round"></span>
  43. <span>{{ kyjs[groupNum - 1] }}</span>
  44. </div>
  45. <div class="control-item-r" style="display: flex; align-items: center;">
  46. <a-switch
  47. v-model="airCompressorState[groupNum - 1][`compressRunSigF1`]"
  48. checked-children="开启"
  49. un-checked-children="关闭"
  50. :disabled="airCompressorState[groupNum - 1][`controlModel`]"
  51. @change="handlerDevice(airCompressorState[groupNum - 1])">
  52. </a-switch>
  53. <div class="button-box">
  54. <!-- <a-button type="primary" siz="small" @click="resetDevice(airCompressorState[groupNum - 1])">复位</a-button> -->
  55. <span class="">复位</span>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="control-item">
  60. <div class="control-item-l">
  61. <span class="round"></span>
  62. <span>控制模式</span>
  63. </div>
  64. <div>
  65. <a-switch
  66. v-model="airCompressorState[0][`controlModel`]"
  67. checked-children="就地"
  68. un-checked-children="远程"
  69. @change="handlerControlModel(airCompressorState[0])">
  70. </a-switch>
  71. </div>
  72. </div>
  73. </div>
  74. <!-- <div class="item" >
  75. <assembly-flv ref="video" class="video-box" height="250px" :url="videoUrl" :destroy="isDestroyVideo" ></assembly-flv>
  76. </div> -->
  77. </div>
  78. </div>
  79. </div>
  80. <div class="bottom-btn-group">
  81. <div v-for="item in bottomBtnList" :key="item.value" class="vent-row-center btn-item" @click="setBtn('click', item)" @mouseenter="setBtn('over', item)" @mouseleave="setBtn('leave', item)">
  82. <dv-decoration11 :color="isBtnActive === item.value ? activeColors : item.isHover ? activeColors : noActiveColors" style="width:200px;height:60px;">
  83. {{ item.text }}
  84. </dv-decoration11>
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <script lang="ts" setup>
  90. import { onMounted, onUnmounted, ref } from 'vue'
  91. import { Decoration5, Decoration11 as DvDecoration11, Decoration7 as DvDecoration7, BorderBox7 as DvBorderBox7 } from '@kjgl77/datav-vue3'
  92. import { bottomBtnList } from './nitrogen.data'
  93. import { mountedThree } from './nitrogen.threejs'
  94. const activeColors = ['#009BFF', '#28DBE4']
  95. const noActiveColors = ['#aaa', '#aaa']
  96. const isBtnActive = ref('workFace')
  97. const kyjs = ['1号空压机', '2号空压机', '3号空压机', '4号空压机'];
  98. // const cqgs = ['1号储气罐', '2号储气罐', '3号储气罐', '4号储气罐'];
  99. // const checkedKyjs = new Set(['1号空压机']);
  100. const monitorDataGroupNum = 3;
  101. const airCompressorState = ref([
  102. {
  103. id: '',
  104. compressRunSigF1: false,
  105. controlModel: false
  106. },
  107. {
  108. id: '',
  109. compressRunSigF1: false,
  110. controlModel: false
  111. },
  112. {
  113. id: '',
  114. compressRunSigF1: false,
  115. controlModel: false
  116. },
  117. {
  118. id: '',
  119. compressRunSigF1: false,
  120. controlModel: false
  121. }
  122. ]);
  123. const showMonitorData = [
  124. {
  125. supVolt1: '电流A(A)',
  126. supVolt2: '电流B(A)',
  127. },
  128. {
  129. supVolt3: '电流C(A)',
  130. current: '电源电压(V)',
  131. },
  132. {
  133. shock1: '震动X(mm/s)',
  134. shock2: '震动Y(mm/s)',
  135. },
  136. {
  137. shock3: '震动Z(mm/s)',
  138. noise: '噪声',
  139. },
  140. {
  141. ambTempCol: '环境温度(℃)',
  142. },
  143. ];
  144. const monitorData = ref(new Array(4).fill({
  145. strName: '空压机',
  146. compressGroupName: '',
  147. compressExhaustPressF1: '-',
  148. compressSeparatePressF1: '-',
  149. compressHostTempF1: '-',
  150. compressCrewTempF1: '-',
  151. compressRunTimeF1: '-',
  152. controlModel: 'LOC'
  153. }));
  154. function setBtn(type, activeObj) {
  155. if (type === 'over') {
  156. activeObj.isHover = true
  157. } else if (type === 'leave') {
  158. activeObj.isHover = false
  159. } else if (type === 'click') {
  160. isBtnActive.value = activeObj.value
  161. }
  162. }
  163. function handlerDevice(data) {
  164. // if (data.length < 1) return
  165. // handleAirCompressor({ id: data.id, compressRunF1: data.compressRunSigF1 }).then(res => {
  166. // if (res.success) {
  167. // message.success('操作成功')
  168. // } else {
  169. // message.warning(data.msg)
  170. // }
  171. // })
  172. };
  173. function resetDevice(data) {
  174. }
  175. function handlerControlModel(data) {
  176. }
  177. onMounted(() => {
  178. mountedThree()
  179. })
  180. onUnmounted(() => {
  181. })
  182. </script>
  183. <style lang="less">
  184. @import '/@/design/vent/modal.less';
  185. .@{ventSpace}-select-dropdown {
  186. border-bottom: 1px solid #ececec66;
  187. background: transparent !important;
  188. backdrop-filter: blur(50px);
  189. .@{ventSpace}-select-item {
  190. color: #fff !important;
  191. }
  192. .@{ventSpace}-select-item-option-selected,
  193. .@{ventSpace}-select-item-option-active {
  194. background-color: #00678b66 !important;
  195. }
  196. .@{ventSpace}-select-item:hover {
  197. background-color: #008fc366 !important;
  198. }
  199. }
  200. </style>
  201. <style lang="less" scoped>
  202. @ventSpace: zxm;
  203. .vent-home {
  204. width: 100%;
  205. height: calc(100%);
  206. position: fixed;
  207. z-index: 99;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: center;
  211. align-items: center;
  212. pointer-events: none;
  213. .vent-home-header {
  214. width: 100%;
  215. height: 100px;
  216. position: fixed;
  217. top: 0;
  218. background: url('/@/assets/images/vent/new-home/header-bg.png') no-repeat;
  219. background-size: contain;
  220. display: flex;
  221. justify-content: center;
  222. .header-icon {
  223. margin-top: 45px;
  224. }
  225. .header-text {
  226. position: fixed;
  227. top: 18px;
  228. color: #fff;
  229. font-size: 24px;
  230. }
  231. }
  232. .nitrogen-container {
  233. width: 100%;
  234. height: calc(100% - 200px);
  235. display: flex;
  236. justify-content: space-between;
  237. margin-bottom: 100px;
  238. .top-box{
  239. width: 100%;
  240. padding: 10px;
  241. overflow: hidden;
  242. display: flex;
  243. justify-content: space-between;
  244. .lr-box{
  245. height: fit-content;
  246. display: flex;
  247. flex-direction: column;
  248. position: relative;
  249. overflow: hidden;
  250. z-index: 9999;
  251. }
  252. .item{
  253. width: 285px;
  254. height: auto;
  255. position: relative;
  256. border-radius: 5px;
  257. margin-top: 10px;
  258. margin-bottom: 0px;
  259. pointer-events: auto;
  260. color: #fff;
  261. overflow: hidden;
  262. .control-item{
  263. height: auto;
  264. min-height: 35px;
  265. display: flex;
  266. flex-direction: row;
  267. justify-content: space-between;
  268. align-items: center;
  269. padding: 5px;
  270. margin: 0 10px 0 3px;
  271. pointer-events: auto;
  272. background: linear-gradient(to right, #0063CD22, #0063CD04);
  273. margin-bottom: 5px;
  274. border-width: 1px;
  275. border-style: dashed;
  276. border-image: linear-gradient(to right, #008ccd66, #0063CD04)1 1;
  277. border-radius: 5px;
  278. &:last-child{
  279. margin-bottom: 0
  280. }
  281. .control-item-l{
  282. display: flex;
  283. align-items: center;
  284. font-size: 14px;
  285. .round{
  286. display: inline-block;
  287. width: 3px;
  288. height: 3px;
  289. padding: 1px;
  290. border-radius: 50%;
  291. background-color: #3DF6FF;
  292. margin-right: 5px;
  293. box-shadow: 0 0 1px 1px #64f7ff;
  294. }
  295. }
  296. .control-item-r{
  297. text-align: right;
  298. }
  299. .button-box{
  300. position: relative;
  301. padding: 5px;
  302. border:1px transparent solid;
  303. background-clip: border-box;
  304. border-radius: 5px;
  305. margin-left: 8px;
  306. }
  307. .a-button{
  308. pointer-events: auto;
  309. }
  310. &::v-deep .a-button--mini {
  311. padding: 6px 10px;
  312. }
  313. &::v-deep .a-button--mini.is-round{
  314. padding: 6px 10px;
  315. }
  316. }
  317. .base-title {
  318. width: calc(100% - 60px);
  319. text-align: center;
  320. color: #00d8ff;
  321. }
  322. .state-item{
  323. display: flex;
  324. flex-direction: row;
  325. padding: 5px;
  326. .item-col{
  327. width: 50%;
  328. display: flex;
  329. justify-content: center;
  330. align-items: center;
  331. padding-right: 4px;
  332. .state-title{
  333. color: #ffffffcc;
  334. flex: 9;
  335. font-size: 14px;
  336. .unit{
  337. // color: #ffffffbb;
  338. }
  339. }
  340. .state-val{
  341. flex: 1;
  342. color: #e4a300;
  343. margin-right: 5px;
  344. text-align: right;
  345. font-size: 14px;
  346. }
  347. }
  348. }
  349. .signal-box{
  350. margin: 5px 0;
  351. display: flex;
  352. align-items: center;
  353. .signal-title{
  354. color: #7AF5FF;
  355. margin: 0 5px;
  356. }
  357. &:last-child{
  358. margin-right: 0px;
  359. }
  360. }
  361. .list-item {
  362. padding: 0 10px;
  363. display: flex;
  364. justify-content: space-between;
  365. align-items: center;
  366. .item-data-key{
  367. color: #ffffff99;
  368. }
  369. }
  370. .item-data-box {
  371. color: #fff;
  372. .state-icon {
  373. display: inline-block;
  374. width: 12px;
  375. height: 12px;
  376. border-radius: 12px;
  377. }
  378. .open {
  379. border: 5px solid #133a56;
  380. background: #4ecb73;
  381. }
  382. .close {
  383. border: 5px solid #192961;
  384. background: #6d7898;
  385. }
  386. }
  387. }
  388. .item-l{
  389. width: 335px;
  390. .monitor-box{
  391. width: 335px;
  392. background-color: #ffffff05;
  393. margin-left: 2px;
  394. border-radius: 5px;
  395. backdrop-filter: blur(10px);
  396. }
  397. }
  398. .right-box{
  399. .item{
  400. height: auto;
  401. }
  402. }
  403. .left-box{
  404. width: 365px;
  405. .control-item{
  406. height: 36px;
  407. }
  408. }
  409. }
  410. }
  411. .bottom-btn-group {
  412. display: flex;
  413. position: fixed;
  414. width: calc(100% - 400px);
  415. height: 100px;
  416. bottom: 20px;
  417. align-items: center;
  418. justify-content: center;
  419. .btn-item {
  420. width: 200px;
  421. height: 60px;
  422. margin: 10px;
  423. color: #fff;
  424. cursor: pointer;
  425. pointer-events: auto;
  426. }
  427. }
  428. }
  429. :deep(.zxm-select) {
  430. width: 300px;
  431. .@{ventSpace}-select-selector {
  432. background: transparent !important;
  433. border: none !important;
  434. box-shadow: none !important;
  435. .zxm-select-selection-item {
  436. color: #fff !important;
  437. font-size: 20px;
  438. }
  439. }
  440. .@{ventSpace}-select-arrow {
  441. color: #fff !important;
  442. }
  443. }</style>