balancePressHome.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 } 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. const changeType = (isAutoControl) =>{
  106. isAutoControl
  107. //
  108. }
  109. const flvURL1 = () => {
  110. return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  111. // return ''
  112. };
  113. // https获取监测数据
  114. let timer: null | NodeJS.Timeout = null;
  115. function getMonitor() {
  116. if (Object.prototype.toString.call(timer) === '[object Null]') {
  117. timer = setTimeout(async () => {
  118. if (props.deviceId) {
  119. const data = await getDataSource(props.deviceId)
  120. Object.assign(selectData, data);
  121. }
  122. if (timer) {
  123. timer = null;
  124. }
  125. await getMonitor();
  126. loading.value = false
  127. }, 1000);
  128. }
  129. };
  130. async function getDataSource(systemID) {
  131. const res = await list({ devicetype: 'sys', systemID });
  132. const result = res.msgTxt;
  133. result.forEach(item => {
  134. if (item.type === 'sys') {
  135. // 硐室基本
  136. // fiberDataSource.value = item.filter((data: any) => {
  137. // const readData = data.readData;
  138. // return Object.assign(data, readData);
  139. // })
  140. }
  141. })
  142. }
  143. // 喷粉操作
  144. function handleDust() {
  145. //
  146. }
  147. watch(() => props.deviceId, (newVal, oldVal) => {
  148. if(newVal && oldVal != undefined){
  149. setModelType('balancePressBase')
  150. }
  151. loading.value = true
  152. })
  153. onBeforeMount(() => {
  154. });
  155. onMounted(() => {
  156. // getMonitor()
  157. loading.value = true;
  158. mountedThree().then(async () => {
  159. await setModelType('balancePressBase');
  160. loading.value = false;
  161. timer = null
  162. await getMonitor()
  163. });
  164. });
  165. onUnmounted(() => {
  166. destroy();
  167. if (timer) {
  168. clearTimeout(timer);
  169. timer = undefined;
  170. }
  171. });
  172. </script>
  173. <style lang="less" scoped>
  174. @import '/@/design/vent/modal.less';
  175. @import '../../comment/less/workFace.less';
  176. @ventSpace: zxm;
  177. .lr{
  178. width: 340px !important;
  179. }
  180. .auto-control{
  181. padding: 10px 8px;
  182. margin: 0 4px 4px 4px;
  183. border-radius: 4px;
  184. border: 1px solid #ffffff05;
  185. background-image: linear-gradient(to left, #39deff15, #3977e500, #39deff15);
  186. }
  187. .divider-line{
  188. position: relative;
  189. color: aqua;
  190. padding-left: 20px;
  191. font-size: 14px;
  192. &::before{
  193. position: absolute;
  194. content: '';
  195. display: block;
  196. top: 10px;
  197. left: 0;
  198. height: 1px;
  199. width: 15px;
  200. background-color: #ffffff33;
  201. }
  202. &::after{
  203. position: absolute;
  204. content: '';
  205. display: block;
  206. top: 10px;
  207. right: 0;
  208. height: 1px;
  209. width: calc(100% - 85px);
  210. background-color: #ffffff33;
  211. }
  212. }
  213. .input-value{
  214. width: 120px !important;
  215. }
  216. .unit{
  217. text-align: right;
  218. }
  219. .btn-box{
  220. margin: 10px 4px;
  221. .btn1{
  222. padding: 4px 0;
  223. }
  224. }
  225. :deep(.@{ventSpace}-tabs-tabpane-active) {
  226. overflow: auto;
  227. }
  228. :deep(.@{ventSpace}-input-number) {
  229. border-color: #ffffff88 !important;
  230. }
  231. </style>