belt-new.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <!-- belt-new.vue -->
  2. <template>
  3. <div class="company-home">
  4. <!-- 顶部标题栏 + 下拉选择 -->
  5. <!-- <div class="header-container">
  6. <customHeader> 皮带巷智能管控 </customHeader>
  7. </div> -->
  8. <!-- 主体区域 -->
  9. <div class="border">
  10. <!-- 配置模块区 -->
  11. <ModuleCommon
  12. v-for="cfg in configs"
  13. :key="cfg.deviceType"
  14. :show-style="cfg.showStyle"
  15. :module-data="cfg.moduleData"
  16. :module-name="cfg.moduleName"
  17. :device-type="cfg.deviceType"
  18. :page-type="cfg.pageType"
  19. :data="data"
  20. :visible="true"
  21. />
  22. </div>
  23. </div>
  24. </template>
  25. <script setup lang="ts">
  26. import { onMounted, ref } from 'vue';
  27. // import customHeader from './components/customHeader-belt.vue';
  28. import { useInitConfigs, useInitPage } from '../hooks/useInit';
  29. import { testBeltNew } from './configurable.data';
  30. import ModuleCommon from '@/views/vent/home/configurable/components/ModuleCommon.vue';
  31. // 初始化配置
  32. const { configs, fetchConfigs } = useInitConfigs();
  33. const { data, updateData } = useInitPage('皮带巷智能管控');
  34. // 下拉框选项
  35. const beltOptions = [
  36. { id: '1', beltName: '主运巷皮带 1' },
  37. { id: '2', beltName: '主运巷皮带 2' },
  38. ];
  39. const selectedBeltId = ref('1');
  40. // 模拟数据
  41. const readData = {
  42. fmhjcInfo: [
  43. {
  44. beltName: '主运巷皮带1',
  45. wz: { strtype: 'wz', avg: '111', max: '222', min: '333', alarm: false, pos: 'AAAA', maxTime: '2013-05-24 15:52:42' },
  46. hcl: { strtype: 'HCl', avg: 'XXX', max: 'XXX', min: 'XXX', alarm: false, pos: 'AAAA', maxTime: '2013-05-24 15:52:42' },
  47. gx: { strtype: 'gx', avg: 'XXX', max: 'XXX', min: 'XXX', alarm: false, pos: 'AAAA', maxTime: '2013-05-24 15:52:42' },
  48. co: { strtype: 'CO', avg: 'XXX', max: 'XXX', min: 'XXX', alarm: true, pos: 'AAAA', maxTime: '2013-05-24 15:52:42' },
  49. wd: { strtype: 'wd', avg: 'XXX', max: 'XXX', min: 'XXX', alarm: false, pos: 'AAAA', maxTime: '2013-05-24 15:52:42' },
  50. },
  51. ],
  52. pdhzfxInfo: [
  53. {
  54. beltName: '主运巷皮带1',
  55. warningLevel: '一般风险',
  56. sysList: [
  57. {
  58. time: '2026-03-21 13:23:34',
  59. area: '3#皮带区域',
  60. type: 'CO浓度异常',
  61. status: '三级预警',
  62. advice: '立即检查该区域设备,启动应急预案',
  63. action: '启动喷淋',
  64. },
  65. {
  66. time: '2026-03-21 13:23:34',
  67. area: '3#皮带区域',
  68. type: 'CO浓度异常',
  69. status: '三级预警',
  70. advice: '立即检查该区域设备,启动应急预案',
  71. action: '启动喷淋',
  72. },
  73. {
  74. time: '2026-03-21 13:23:34',
  75. area: '3#皮带区域',
  76. type: 'CO浓度异常',
  77. status: '三级预警',
  78. advice: '立即检查该区域设备,启动应急预案',
  79. action: '启动喷淋',
  80. },
  81. ],
  82. },
  83. ],
  84. sensorAnalysis: {
  85. hy: { name: '火焰传感器', alarm: false, maxTime: '2013-05-24 15:52:42', pos: '' },
  86. wd: { name: '温度传感器', alarm: false, maxTime: '2013-05-24 15:52:42', pos: '' },
  87. yw: { name: '烟雾传感器', alarm: false, maxTime: '2013-05-24 15:52:42', pos: '' },
  88. },
  89. vehicleCOAnalysis: {
  90. isRisk: true,
  91. activityList: [
  92. {
  93. pos: '1#皮带区域',
  94. vehicle: '车辆23425',
  95. status: '0',
  96. },
  97. {
  98. pos: '2#皮带区域',
  99. vehicle: '车辆53456',
  100. status: '1',
  101. },
  102. {
  103. pos: '3#皮带区域',
  104. vehicle: '未通过车辆',
  105. status: '0',
  106. },
  107. ],
  108. analysisList: [
  109. {
  110. pos: '1#皮带区域',
  111. analysisText: 'CO浓度异常升高,已确认为车辆干扰',
  112. },
  113. {
  114. pos: '1#皮带区域',
  115. analysisText: 'CO浓度异常升高,已确认为车辆干扰',
  116. },
  117. ],
  118. possibleCause: '皮带摩擦过热或电器设备故障',
  119. recommendation: '立即检查3#皮带区域设备',
  120. },
  121. };
  122. // 下拉框切换处理
  123. function handleBeltChange(id: string) {
  124. selectedBeltId.value = id;
  125. refresh();
  126. }
  127. // 风险等级样式映射
  128. function getLevelClass(level: string) {
  129. switch (level) {
  130. case '重大风险':
  131. return 'level-critical';
  132. case '高风险':
  133. return 'level-high';
  134. case '一般风险':
  135. return 'level-normal';
  136. default:
  137. return '';
  138. }
  139. }
  140. // 刷新数据
  141. function refresh() {
  142. fetchConfigs('belt').then(() => {
  143. configs.value = testBeltNew;
  144. Promise.resolve(readData).then(updateData);
  145. // updateEnhancedConfigs(configs.value);
  146. });
  147. }
  148. // 定时刷新
  149. function initInterval() {
  150. setInterval(() => {
  151. refresh();
  152. }, 60000);
  153. }
  154. onMounted(() => {
  155. refresh();
  156. initInterval();
  157. });
  158. </script>
  159. <style lang="less" scoped>
  160. .company-home {
  161. background: url('/@/assets/images/beltFire/baseMap.png') no-repeat center;
  162. width: 100%;
  163. height: 100%;
  164. color: @white;
  165. position: relative;
  166. font-family: 'Microsoft YaHei', sans-serif;
  167. .header-container {
  168. position: absolute;
  169. top: 20px;
  170. left: 20px;
  171. z-index: 10;
  172. }
  173. .border {
  174. width: 100%;
  175. height: 94%;
  176. background: url('/@/assets/images/beltFire/mainbj.png') no-repeat;
  177. background-size: 100% 100%;
  178. margin-top: 55px;
  179. position: relative;
  180. overflow: hidden;
  181. .box-container {
  182. position: relative;
  183. width: 100%;
  184. height: 100%;
  185. }
  186. }
  187. // 中间预警结果区
  188. .center-warning-container {
  189. position: absolute;
  190. left: 50%;
  191. transform: translateX(-50%);
  192. top: 50%;
  193. width: 600px;
  194. height: 200px;
  195. background-color: rgba(0, 0, 0, 0.7);
  196. border-radius: 10px;
  197. padding: 15px;
  198. box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  199. z-index: 5;
  200. color: #fff;
  201. .warning-header {
  202. font-size: 18px;
  203. font-weight: bold;
  204. margin-bottom: 10px;
  205. color: #ff6b6b;
  206. }
  207. .warning-list {
  208. width: 100%;
  209. height: 100%;
  210. overflow-y: auto;
  211. display: flex;
  212. flex-direction: column;
  213. gap: 8px;
  214. }
  215. .warning-item {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. padding: 8px;
  220. background-color: rgba(0, 0, 0, 0.5);
  221. border-radius: 5px;
  222. border-left: 4px solid #ff6b6b;
  223. .warning-time {
  224. font-size: 14px;
  225. color: #ccc;
  226. }
  227. .warning-level {
  228. font-size: 14px;
  229. font-weight: bold;
  230. padding: 4px 8px;
  231. border-radius: 4px;
  232. &.level-critical {
  233. background-color: #ff6b6b;
  234. color: white;
  235. }
  236. &.level-high {
  237. background-color: #ffcc00;
  238. color: black;
  239. }
  240. &.level-normal {
  241. background-color: #66cc66;
  242. color: white;
  243. }
  244. }
  245. .warning-action {
  246. .btn-start-spray {
  247. background-color: #00e1ff;
  248. color: #000;
  249. border: none;
  250. padding: 4px 10px;
  251. border-radius: 4px;
  252. cursor: pointer;
  253. font-size: 12px;
  254. transition: all 0.3s;
  255. &:hover {
  256. background-color: #00c3e6;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. // 巷道示意图
  263. .belt-diagram {
  264. position: absolute;
  265. left: 50%;
  266. transform: translateX(-50%);
  267. bottom: 50px;
  268. width: 800px;
  269. height: 100px;
  270. display: flex;
  271. justify-content: center;
  272. align-items: center;
  273. img {
  274. width: 100%;
  275. height: 100%;
  276. object-fit: contain;
  277. }
  278. }
  279. }
  280. </style>