index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="spray-wrapper">
  4. <BasicMonitoring
  5. main-title="凝胶防灭火材料自动喷洒系统"
  6. :main-config="{
  7. operations: operations,
  8. configs: configs,
  9. }"
  10. :monitor-history-config="{}"
  11. :handler-history-config="{}"
  12. :alarm-history-config="{}"
  13. strtype="sys_surface_juejin"
  14. >
  15. <template #default="{ monitorData }">
  16. <div id="spray3D" class="w-full h-full flex justify-center items-center overflow-hidden">
  17. <a-spin :spinning="loading" />
  18. <div id="sprayCSS3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
  19. <!-- <FourBorderBg id="sprayCSS3DEnvA">
  20. <div>送料电机</div>
  21. <div>电压US:{{ get(monitorData, 'spray_auto[0].readData.SlDjdy', '-') }}</div>
  22. <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.SlDjAdl', '-') }}</div>
  23. <div>电流LB:{{ get(monitorData, 'spray_auto[0].readData.SlDjBdl', '-') }}</div>
  24. <div>电流LC:{{ get(monitorData, 'spray_auto[0].readData.SlDjCdl', '-') }}</div>
  25. </FourBorderBg>
  26. <FourBorderBg id="sprayCSS3DEnvB">
  27. <div>注浆电机</div>
  28. <div>电压US:{{ get(monitorData, 'spray_auto[0].readData.ZjDjdy', '-') }}</div>
  29. <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.ZjDjAdl', '-') }}</div>
  30. <div>电流LB:{{ get(monitorData, 'spray_auto[0].readData.ZjDjBdl', '-') }}</div>
  31. <div>电流LC:{{ get(monitorData, 'spray_auto[0].readData.ZjDjCdl', '-') }}</div>
  32. </FourBorderBg> -->
  33. </div>
  34. </div>
  35. </template>
  36. </BasicMonitoring>
  37. </div>
  38. </template>
  39. <script setup lang="ts">
  40. import { onMounted, ref } from 'vue';
  41. import BasicMonitoring from '/@/components/vent/BasicMonitoring.vue';
  42. import { Config } from '../../deviceManager/configurationTable/types';
  43. import { useInitConfigs } from '../../home/configurable/hooks/useInit';
  44. import { mountedThree, setModelType } from './spray.three';
  45. import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
  46. import { get } from 'lodash-es';
  47. import { zuhuabengConfigs } from './spray.data';
  48. const defaultConfigs: Config[] = [
  49. {
  50. deviceType: '',
  51. moduleName: '压力传感器',
  52. pageType: 'spray',
  53. moduleData: {
  54. header: {
  55. show: false,
  56. readFrom: '',
  57. selector: {
  58. show: false,
  59. value: '',
  60. },
  61. slot: {
  62. show: false,
  63. value: '',
  64. },
  65. },
  66. background: {
  67. show: false,
  68. type: 'video',
  69. link: '',
  70. },
  71. layout: {
  72. direction: 'row',
  73. items: [
  74. {
  75. name: 'board',
  76. basis: '100%',
  77. },
  78. ],
  79. },
  80. board: [
  81. {
  82. type: 'P',
  83. layout: 'label-top',
  84. items: [
  85. {
  86. label: '在线数量',
  87. value: '1',
  88. },
  89. {
  90. label: '异常数量',
  91. value: '0',
  92. },
  93. ],
  94. readFrom: '',
  95. },
  96. ],
  97. },
  98. showStyle: {
  99. size: 'width:440px;height:250px;',
  100. version: '保德',
  101. position: 'top:80px;left:10px;',
  102. },
  103. },
  104. {
  105. deviceType: '',
  106. moduleName: '喷洒实况',
  107. pageType: 'spray',
  108. moduleData: {
  109. header: {
  110. show: false,
  111. readFrom: '',
  112. selector: {
  113. show: false,
  114. value: '',
  115. },
  116. slot: {
  117. show: false,
  118. value: '',
  119. },
  120. },
  121. background: {
  122. show: false,
  123. type: 'video',
  124. link: '',
  125. },
  126. layout: {
  127. direction: 'row',
  128. items: [
  129. {
  130. name: 'table',
  131. basis: '100%',
  132. },
  133. ],
  134. },
  135. table: [
  136. {
  137. type: 'A',
  138. columns: [
  139. {
  140. name: '支架',
  141. prop: 'strinstallpos',
  142. },
  143. {
  144. name: '工作状态',
  145. prop: 'readData.online_str',
  146. },
  147. ],
  148. readFrom: 'spray_auto',
  149. },
  150. ],
  151. preset: [],
  152. },
  153. showStyle: {
  154. size: 'width:440px;height:430px;',
  155. version: '保德',
  156. position: 'top:350px;left:10px;',
  157. },
  158. },
  159. {
  160. deviceType: '',
  161. moduleName: '场景信息总览',
  162. pageType: 'spray',
  163. moduleData: {
  164. header: { show: false, readFrom: '', selector: { show: false, value: '' }, slot: { show: false, value: '' } },
  165. background: { show: false, type: 'video', link: '' },
  166. layout: {
  167. direction: 'column',
  168. items: [
  169. {
  170. name: 'list',
  171. basis: '50%',
  172. overflow: false,
  173. },
  174. {
  175. name: 'partition',
  176. basis: 'auto',
  177. overflow: false,
  178. },
  179. {
  180. name: 'list',
  181. basis: 'auto',
  182. overflow: false,
  183. },
  184. {
  185. name: 'partition',
  186. basis: 'auto',
  187. overflow: false,
  188. },
  189. {
  190. name: 'list',
  191. basis: 'auto',
  192. overflow: false,
  193. },
  194. ],
  195. },
  196. list: [
  197. {
  198. type: 'L',
  199. readFrom: '',
  200. items: [
  201. {
  202. label: '绑定控制箱名称',
  203. value: '${spray_auto[0].strinstallpos}',
  204. },
  205. {
  206. label: '控制箱地址',
  207. value: '${spray_auto[0].readData.snumber}',
  208. },
  209. {
  210. label: '故障从机',
  211. value: '${spray_auto[0].readData.Cjgz}',
  212. },
  213. {
  214. label: '浮球液位报警',
  215. value: '${spray_auto[0].readData.minimumgrouting}',
  216. },
  217. {
  218. label: '输送管道压力',
  219. value: '${spray_auto[0].readData.zjbhglpaV}',
  220. },
  221. ],
  222. },
  223. {
  224. type: 'N',
  225. readFrom: '',
  226. items: [
  227. {
  228. label: '启动状态',
  229. value: '${spray_auto[0].readData.online_str}',
  230. color: 'blue',
  231. },
  232. {
  233. label: '报警状态',
  234. value: '${spray_auto[0].warnLevel_str}',
  235. },
  236. ],
  237. },
  238. {
  239. type: 'N',
  240. readFrom: '',
  241. items: [
  242. {
  243. label: '启动状态',
  244. value: '${spray_auto[0].readData.online_str}',
  245. color: 'blue',
  246. },
  247. {
  248. label: '故障状态',
  249. value: '${spray_auto[0].readData.warnLevel_str}',
  250. },
  251. ],
  252. },
  253. ],
  254. partition: [
  255. {
  256. type: 'A',
  257. readFrom: '',
  258. layout: 'icon-pre',
  259. label: '送料电机',
  260. icon: '/src/assets/images/home-container/configurable/tashanhome/partition-icon-1.png',
  261. },
  262. {
  263. type: 'A',
  264. readFrom: '',
  265. layout: 'icon-pre',
  266. label: '输送电机',
  267. icon: '/src/assets/images/home-container/configurable/tashanhome/partition-icon-2.png',
  268. },
  269. ],
  270. },
  271. showStyle: {
  272. size: 'width:440px;height:700px;',
  273. version: '原版',
  274. position: 'top:80px;right:10px;',
  275. },
  276. },
  277. ];
  278. const { configs, fetchConfigs } = useInitConfigs();
  279. const loading = ref(false);
  280. // const operations = ref([
  281. // {
  282. // label: '开启控制箱',
  283. // key: 'run_auto_sign',
  284. // value: '1',
  285. // disabled: false,
  286. // showPassword: true,
  287. // // permission: 'spray:run_auto_sign',
  288. // },
  289. // {
  290. // label: '关闭控制箱',
  291. // key: 'run_auto_sign',
  292. // value: '0',
  293. // disabled: false,
  294. // showPassword: true,
  295. // // permission: 'spray:run_auto_sign',
  296. // },
  297. // ]);
  298. const operations = ref([
  299. {
  300. label: '急停',
  301. key: 'run_auto_sign',
  302. value: '1',
  303. disabled: false,
  304. showPassword: true,
  305. // permission: 'spray:run_auto_sign',
  306. },
  307. {
  308. label: '补水阀启停',
  309. key: 'run_auto_sign',
  310. value: '0',
  311. disabled: false,
  312. showPassword: true,
  313. // permission: 'spray:run_auto_sign',
  314. },
  315. {
  316. label: '搅拌阀启停',
  317. key: 'run_auto_sign',
  318. value: '0',
  319. disabled: false,
  320. showPassword: true,
  321. // permission: 'spray:run_auto_sign',
  322. },
  323. {
  324. label: '组化泵启停',
  325. key: 'run_auto_sign',
  326. value: '0',
  327. disabled: false,
  328. showPassword: true,
  329. // permission: 'spray:run_auto_sign',
  330. },
  331. {
  332. label: '上料机启停',
  333. key: 'run_auto_sign',
  334. value: '0',
  335. disabled: false,
  336. showPassword: true,
  337. // permission: 'spray:run_auto_sign',
  338. },
  339. // {
  340. // label: '上料机2启停',
  341. // key: 'run_auto_sign',
  342. // value: '0',
  343. // disabled: false,
  344. // showPassword: true,
  345. // // permission: 'spray:run_auto_sign',
  346. // },
  347. {
  348. label: '搅拌电机启停',
  349. key: 'run_auto_sign',
  350. value: '0',
  351. disabled: false,
  352. showPassword: true,
  353. // permission: 'spray:run_auto_sign',
  354. },
  355. {
  356. label: '上料自动',
  357. key: 'run_auto_sign',
  358. value: '0',
  359. disabled: false,
  360. showPassword: true,
  361. // permission: 'spray:run_auto_sign',
  362. },
  363. {
  364. label: '喷洒自动',
  365. key: 'run_auto_sign',
  366. value: '0',
  367. disabled: false,
  368. showPassword: true,
  369. // permission: 'spray:run_auto_sign',
  370. },
  371. ]);
  372. onMounted(() => {
  373. // fetchConfigs('spray');
  374. configs.value = zuhuabengConfigs;
  375. loading.value = true;
  376. mountedThree('#spray3D', ['#sprayCSS3D', '#sprayCSS3DEnvA', '#sprayCSS3DEnvB']).then(() => {
  377. setModelType('spray').finally(() => {
  378. loading.value = false;
  379. });
  380. });
  381. });
  382. </script>
  383. <style lang="less" scoped>
  384. .spray-wrapper {
  385. width: 100%;
  386. height: 100%;
  387. }
  388. #spray3D {
  389. pointer-events: all;
  390. }
  391. .spray-wrapper :deep(.list-item_L .list-item__icon_L) {
  392. background-image: url('/@/assets/images/home-container/configurable/minehome/list-icon-file.png');
  393. }
  394. .spray-wrapper :deep(.list-item_N:nth-child(1)) {
  395. background-image: url('/@/assets/images/home-container/configurable/minehome/list-bg-n5.png');
  396. }
  397. .spray-wrapper :deep(.list-item_N:nth-child(2)) {
  398. background-image: url('/@/assets/images/home-container/configurable/minehome/list-bg-n6.png');
  399. }
  400. </style>