balancePressHome.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <a-spin tip="Loading..." :spinning="loading">
  3. <div class="monitor-container">
  4. <div class="lr left-box">
  5. <div class="monitor-info item-box">
  6. <ventBox1>
  7. <template #title>
  8. <div>均压与低氧参数监测与设置</div>
  9. </template>
  10. <template #container>
  11. <div class="vent-flex-row-between auto-control">
  12. <div class="title">自动调节:</div>
  13. <a-radio-group v-model:value="isAutoControl" name="radioGroup"
  14. @change="changeType(isAutoControl)">
  15. <a-radio value="1">关闭</a-radio>
  16. <a-radio value="2">开启</a-radio>
  17. </a-radio-group>
  18. </div>
  19. <div class="input-box">
  20. <div class="divider-line">开始条件</div>
  21. <div v-for="(item, index) in settingParam1" class="input-item" :key="index">
  22. <div class="title">{{ item.title }}:</div>
  23. <a-input-number class="input-value" v-model="item.value" placeholder="" />
  24. <div class="unit">{{ item.unit }}</div>
  25. </div>
  26. <div class="divider-line">调节参数</div>
  27. <div v-for="(item, index) in settingParam2" class="input-item" :key="index">
  28. <div class="title">{{ item.title }}:</div>
  29. <a-input-number class="input-value" v-model="item.value" placeholder="" />
  30. <div class="unit">{{ item.unit }}</div>
  31. </div>
  32. <div class="divider-line">结束时间</div>
  33. <div v-for="(item, index) in settingParam3" class="input-item" :key="index">
  34. <div class="title">{{ item.title }}:</div>
  35. <a-input-number class="input-value" v-model="item.value" placeholder="" />
  36. <div class="unit">{{ item.unit }}</div>
  37. </div>
  38. </div>
  39. <div class="btn-box" style="text-align: center;">
  40. <div class="btn btn1">提交</div>
  41. </div>
  42. </template>
  43. </ventBox1>
  44. </div>
  45. </div>
  46. <div class="lr right-box">
  47. <div class="item-box sensor-container">
  48. <ventBox1>
  49. <template #title>
  50. <div>CO与O2监测</div>
  51. </template>
  52. <template #container>
  53. </template>
  54. </ventBox1>
  55. <ventBox1 class="vent-margin-t-10">
  56. <template #title>
  57. <div>设备监测详情</div>
  58. </template>
  59. <template #container>
  60. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="fiber-title"/><span>风窗</span></div>
  61. <div class="input-box">
  62. <div v-for="(item, index) in windowParam" class="input-item" :key="index">
  63. <div class="title">{{ item.title }}</div>
  64. <div class="value">-</div>
  65. <div class="unit">{{ item.unit }}</div>
  66. </div>
  67. </div>
  68. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="fiber-title"/><span>均压局扇</span></div>
  69. <div class="input-box">
  70. <div v-for="(item, index) in localFanParam" class="input-item" :key="index">
  71. <div class="title">{{ item.title }}</div>
  72. <div class="value">-</div>
  73. <div class="unit">{{ item.unit }}</div>
  74. </div>
  75. </div>
  76. </template>
  77. </ventBox1>
  78. </div>
  79. <div class="item-box vent-margin-t-10" >
  80. <LivePlayer id="fm-player1" style="height: 250px;" ref="player1" :videoUrl="flvURL1()" muted live loading controls />
  81. </div>
  82. </div>
  83. </div>
  84. </a-spin>
  85. </template>
  86. <script setup lang="ts">
  87. import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
  88. import ventBox1 from '/@/components/vent/ventBox1.vue'
  89. import { SvgIcon } from '/@/components/Icon';
  90. import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
  91. import { settingParam1, settingParam2, settingParam3, windowParam, localFanParam } from '../balancePress.data'
  92. import { list } from '../balancePress.api';
  93. import LivePlayer from '@liveqing/liveplayer-v3';
  94. const props = defineProps({
  95. deviceId: {
  96. type: String,
  97. require: true
  98. }
  99. })
  100. const loading = ref(false);
  101. // 默认初始是第一行
  102. const isAutoControl = ref('1')
  103. // 监测数据
  104. const selectData = reactive({
  105. frontRearDP: '-',
  106. sourcePressure: '-',
  107. fault: '-'
  108. });
  109. const changeType = (isAutoControl) =>{
  110. isAutoControl
  111. //
  112. }
  113. const flvURL1 = () => {
  114. return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  115. // return ''
  116. };
  117. // https获取监测数据
  118. let timer: null | NodeJS.Timeout = null;
  119. function getMonitor(flag?) {
  120. if (Object.prototype.toString.call(timer) === '[object Null]') {
  121. timer = setTimeout(async () => {
  122. if (props.deviceId) {
  123. const data = await getDataSource(props.deviceId)
  124. Object.assign(selectData, data);
  125. updateText(selectData)
  126. }
  127. if (timer) {
  128. timer = null;
  129. }
  130. await getMonitor();
  131. loading.value = false
  132. }, flag ? 0 : 1000);
  133. }
  134. };
  135. async function getDataSource(systemID) {
  136. const res = await list({ devicetype: 'sys', systemID });
  137. const result = res.msgTxt;
  138. result.forEach(item => {
  139. if (item.type === 'sys') {
  140. // 硐室基本
  141. // fiberDataSource.value = item.filter((data: any) => {
  142. // const readData = data.readData;
  143. // return Object.assign(data, readData);
  144. // })
  145. }
  146. })
  147. }
  148. // 喷粉操作
  149. function handleDust() {
  150. //
  151. }
  152. watch(() => props.deviceId, (newVal, oldVal) => {
  153. if(newVal && oldVal != undefined){
  154. setModelType('balancePressBase')
  155. }
  156. loading.value = true
  157. })
  158. onBeforeMount(() => {
  159. });
  160. onMounted(() => {
  161. // getMonitor()
  162. loading.value = true;
  163. mountedThree().then(async () => {
  164. await setModelType('balancePressBase');
  165. loading.value = false;
  166. timer = null
  167. await getMonitor(true)
  168. play('startSmoke', 'top', 30, 'open', 0)
  169. });
  170. });
  171. onUnmounted(() => {
  172. destroy();
  173. if (timer) {
  174. clearTimeout(timer);
  175. timer = undefined;
  176. }
  177. });
  178. </script>
  179. <style lang="less" scoped>
  180. @import '/@/design/vent/modal.less';
  181. @import '../../comment/less/workFace.less';
  182. @ventSpace: zxm;
  183. .lr{
  184. width: 340px !important;
  185. }
  186. .auto-control{
  187. padding: 10px 8px;
  188. margin: 0 4px 4px 4px;
  189. border-radius: 4px;
  190. border: 1px solid #ffffff05;
  191. background-image: linear-gradient(to left, #39deff15, #3977e500, #39deff15);
  192. }
  193. .divider-line{
  194. position: relative;
  195. color: aqua;
  196. padding-left: 20px;
  197. font-size: 14px;
  198. &::before{
  199. position: absolute;
  200. content: '';
  201. display: block;
  202. top: 10px;
  203. left: 0;
  204. height: 1px;
  205. width: 15px;
  206. background-color: #ffffff33;
  207. }
  208. &::after{
  209. position: absolute;
  210. content: '';
  211. display: block;
  212. top: 10px;
  213. right: 0;
  214. height: 1px;
  215. width: calc(100% - 85px);
  216. background-color: #ffffff33;
  217. }
  218. }
  219. .input-value{
  220. width: 120px !important;
  221. }
  222. .unit{
  223. text-align: right;
  224. }
  225. .btn-box{
  226. margin: 10px 4px;
  227. .btn1{
  228. padding: 4px 0;
  229. }
  230. }
  231. :deep(.@{ventSpace}-tabs-tabpane-active) {
  232. overflow: auto;
  233. }
  234. :deep(.@{ventSpace}-input-number) {
  235. border-color: #ffffff88 !important;
  236. }
  237. </style>