index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="company-home">
  4. <div class="top-bg">
  5. <div class="main-title">{{ mainTitle }}</div>
  6. </div>
  7. <a-dropdown class="module-dropdown" :class="{ 'module-dropdown-original': isOriginal }" :trigger="['click']" placement="bottomRight">
  8. <a class="ant-dropdown-link" @click.prevent>
  9. 全矿井通风检测
  10. <CaretDownOutlined />
  11. </a>
  12. <template #overlay>
  13. <MonitorCenter />
  14. </template>
  15. </a-dropdown>
  16. <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
  17. <!-- <SubVentilate />
  18. <Ventilate />
  19. <VentilateControl />
  20. <AirVolumeMonitor />
  21. <VentilateAnalysis />
  22. <WorkSurface />
  23. <DeviceWarning /> -->
  24. <template v-if="isOriginal">
  25. <ModuleOriginal v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle" :module-name="cfg.moduleName" :visible="visible">
  26. <Content v-bind="cfg" />
  27. </ModuleOriginal>
  28. </template>
  29. <template v-else>
  30. <ModuleEnhanced v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle" :module-name="cfg.moduleName" :visible="visible">
  31. <Content v-bind="cfg" />
  32. </ModuleEnhanced>
  33. </template>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. import { onMounted, ref } from 'vue';
  38. // import SubVentilate from './components/SubVentilate.vue';
  39. // import Ventilate from './components/Ventilate.vue';
  40. import { CaretDownOutlined } from '@ant-design/icons-vue';
  41. // import VentilateControl from './components/VentilateControl.vue';
  42. // import AirVolumeMonitor from './components/AirVolumeMonitor.vue';
  43. // import VentilateAnalysis from './components/VentilateAnalysis.vue';
  44. // import WorkSurface from './components/WorkSurface.vue';
  45. // import DeviceWarning from './components/DeviceWarning.vue';
  46. import MonitorCenter from './components/MonitorCenter.vue';
  47. // import { useInitConfigs } from './hooks/useInit';
  48. import { Config } from '../../deviceManager/configurationTable/types';
  49. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  50. import ModuleOriginal from './components/ModuleOriginal.vue';
  51. import Content from './components/content.vue';
  52. // import mapComponent from './components/3Dmap/index.vue';
  53. const mainTitle = ref('智能通风管控系统');
  54. // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
  55. const configs = ref<Config[]>([
  56. {
  57. deviceType: 'fanlocal',
  58. moduleName: '测试局扇',
  59. pageType: '',
  60. moduleData: {
  61. header: {
  62. show: true,
  63. showSelector: true,
  64. showSlot: true,
  65. selector: {
  66. prop: 'strinstallpos',
  67. },
  68. slot: {
  69. prop: 'strinstallpos',
  70. },
  71. },
  72. background: {
  73. show: true,
  74. type: 'video',
  75. link: '/src/assets/vedio/fanLocal.mp4',
  76. },
  77. layout: ['board'],
  78. board: [
  79. {
  80. label: '风速1',
  81. type: 'A',
  82. layout: 'val-top',
  83. prop: 'readData.windSpeed1',
  84. },
  85. {
  86. label: '风速2',
  87. type: 'B',
  88. layout: 'label-top',
  89. prop: 'readData.windSpeed2',
  90. },
  91. ],
  92. list: [],
  93. chart: [],
  94. table: [],
  95. },
  96. showStyle: {
  97. size: 'width:450px;height:280px;',
  98. version: 'enhanced',
  99. position: 'top:60px;left:0;',
  100. },
  101. },
  102. {
  103. deviceType: 'sys_majorpath',
  104. moduleName: '测试折线图',
  105. pageType: '',
  106. moduleData: {
  107. header: {
  108. show: true,
  109. showSelector: true,
  110. showSlot: true,
  111. selector: {
  112. prop: 'strinstallpos',
  113. },
  114. slot: {
  115. prop: 'strinstallpos',
  116. },
  117. },
  118. background: {
  119. show: false,
  120. type: 'video',
  121. link: '',
  122. },
  123. layout: ['chart'],
  124. board: [],
  125. list: [],
  126. chart: [
  127. {
  128. type: 'line_area',
  129. readFrom: 'majorpath.paths',
  130. xAxis: [{ prop: 'name' }],
  131. yAxis: [
  132. { label: 'Drag', align: 'left' },
  133. { label: 'M3', align: 'right' },
  134. ],
  135. series: [
  136. { label: 'Drag', prop: 'drag' },
  137. { label: 'M3', prop: 'm3' },
  138. // { label: '回2', prop: 'hui2' },
  139. ],
  140. },
  141. ],
  142. table: [],
  143. },
  144. showStyle: {
  145. size: 'width:450px;height:280px;',
  146. version: 'enhanced',
  147. position: 'top:350px;left:0;',
  148. },
  149. },
  150. {
  151. deviceType: 'warn',
  152. moduleName: '测试报警',
  153. pageType: '',
  154. moduleData: {
  155. header: {
  156. show: false,
  157. showSelector: false,
  158. showSlot: true,
  159. selector: {
  160. prop: 'strinstallpos',
  161. },
  162. slot: {
  163. prop: 'netstatus.val',
  164. formatter: '网络异常:${} 台',
  165. },
  166. },
  167. background: {
  168. show: false,
  169. type: 'video',
  170. link: '',
  171. },
  172. layout: ['fire_warn'],
  173. // layout: ['list'],
  174. board: [],
  175. chart: [],
  176. table: [],
  177. list: [
  178. {
  179. label: '正常',
  180. prop: 'blue.val',
  181. color: 'blue',
  182. type: 'B',
  183. },
  184. {
  185. label: '告警',
  186. prop: 'orange.val',
  187. color: 'orange',
  188. type: 'B',
  189. },
  190. {
  191. label: '报警',
  192. prop: 'yellow.val',
  193. color: 'yellow',
  194. type: 'B',
  195. },
  196. {
  197. label: '危险',
  198. prop: 'red.val',
  199. color: 'red',
  200. type: 'B',
  201. },
  202. {
  203. label: '错误',
  204. prop: 'alarm.val',
  205. color: 'green',
  206. type: 'B',
  207. },
  208. ],
  209. },
  210. showStyle: {
  211. size: 'width:450px;height:280px;',
  212. version: 'enhanced',
  213. position: 'top:640px;left:0;',
  214. },
  215. },
  216. {
  217. deviceType: 'midinfo',
  218. moduleName: '测试中间模块',
  219. pageType: '',
  220. moduleData: {
  221. header: {
  222. show: false,
  223. showSelector: false,
  224. showSlot: false,
  225. selector: {
  226. icon: 'SwapOutlined',
  227. prop: 'strinstallpos',
  228. },
  229. slot: {
  230. icon: 'SwapOutlined',
  231. prop: 'strinstallpos',
  232. },
  233. },
  234. background: {
  235. show: false,
  236. type: 'video',
  237. link: '',
  238. },
  239. layout: ['chart'],
  240. board: [],
  241. list: [],
  242. table: [],
  243. chart: [
  244. {
  245. type: 'bar',
  246. readFrom: 'sysdata.history',
  247. xAxis: [{ prop: 'time' }],
  248. yAxis: [
  249. { label: '回1', align: 'left' },
  250. // { label: '回2', align: 'right' },
  251. ],
  252. series: [
  253. { label: '回1', prop: 'hui1' },
  254. // { label: '回2', prop: 'hui2' },
  255. ],
  256. },
  257. ],
  258. },
  259. showStyle: {
  260. size: 'width:1000px;height:280px;',
  261. version: 'enhanced',
  262. position: 'top:640px;left:460px;',
  263. },
  264. },
  265. {
  266. deviceType: 'sys_wind',
  267. moduleName: '测试测风装置',
  268. pageType: '',
  269. moduleData: {
  270. header: {
  271. show: false,
  272. showSelector: true,
  273. showSlot: false,
  274. selector: {
  275. prop: 'strinstallpos',
  276. },
  277. slot: {
  278. prop: 'strinstallpos',
  279. },
  280. },
  281. background: {
  282. show: false,
  283. type: 'video',
  284. link: '',
  285. },
  286. layout: ['blast_delta'],
  287. board: [
  288. {
  289. label: '风量',
  290. type: 'C',
  291. layout: 'val-top',
  292. prop: 'f1Val',
  293. },
  294. {
  295. label: '风速',
  296. type: 'C',
  297. layout: 'val-top',
  298. prop: 'f2Val',
  299. },
  300. ],
  301. list: [],
  302. table: [],
  303. chart: [
  304. {
  305. type: 'pie',
  306. readFrom: 'readData',
  307. xAxis: [{ prop: 'stationname' }],
  308. yAxis: [
  309. { label: '风量1', align: 'left' },
  310. // { label: '回2', align: 'right' },
  311. ],
  312. series: [
  313. { label: '风量1', prop: 'va' },
  314. { label: '风量2', prop: 'va2' },
  315. // { label: '回2', prop: 'hui2' },
  316. ],
  317. },
  318. ],
  319. },
  320. showStyle: {
  321. size: 'width:450px;height:280px;',
  322. version: 'enhanced',
  323. position: 'top:60px;right:0;',
  324. },
  325. },
  326. {
  327. deviceType: 'sys_majorpath',
  328. moduleName: '测试关键路线',
  329. pageType: '',
  330. moduleData: {
  331. header: {
  332. show: false,
  333. showSelector: true,
  334. showSlot: true,
  335. selector: {
  336. prop: 'devicePos',
  337. },
  338. slot: {
  339. prop: 'devicePos',
  340. },
  341. },
  342. background: {
  343. show: false,
  344. type: 'video',
  345. link: '',
  346. },
  347. layout: ['table'],
  348. board: [],
  349. list: [],
  350. table: [
  351. {
  352. readFrom: 'history',
  353. columns: [
  354. {
  355. prop: 'index',
  356. label: '编号',
  357. },
  358. {
  359. prop: 'time',
  360. label: '报警时间',
  361. },
  362. {
  363. prop: 'warn',
  364. label: '报警内容',
  365. },
  366. ],
  367. },
  368. ],
  369. chart: [],
  370. },
  371. showStyle: {
  372. size: 'width:450px;height:280px;',
  373. version: 'enhanced',
  374. position: 'top:350px;right:0;',
  375. },
  376. },
  377. {
  378. deviceType: 'sys_majorpath',
  379. moduleName: '测试关键路线',
  380. pageType: '',
  381. moduleData: {
  382. header: {
  383. show: false,
  384. showSelector: true,
  385. showSlot: true,
  386. selector: {
  387. prop: 'devicePos',
  388. },
  389. slot: {
  390. prop: 'devicePos',
  391. },
  392. },
  393. background: {
  394. show: false,
  395. type: 'video',
  396. link: '',
  397. },
  398. layout: ['fire_control'],
  399. board: [],
  400. list: [],
  401. table: [],
  402. chart: [],
  403. },
  404. showStyle: {
  405. size: 'width:450px;height:280px;',
  406. version: 'enhanced',
  407. position: 'top:640px;right:0;',
  408. },
  409. },
  410. ]);
  411. const isOriginal = true;
  412. const visible = ref(true);
  413. // const { configs, isOriginal, fetchConfigs } = useInitConfigs();
  414. onMounted(() => {
  415. // fetchConfigs();
  416. });
  417. </script>
  418. <style lang="less" scoped>
  419. @font-face {
  420. font-family: 'douyuFont';
  421. src: url('../../../../assets/font/douyuFont.otf');
  422. }
  423. .company-home {
  424. width: 100%;
  425. height: 100%;
  426. color: @white;
  427. position: relative;
  428. .top-bg {
  429. width: 100%;
  430. height: 56px;
  431. background: url('@/assets/images/home-container/configurable/main_title_bg.png') no-repeat center;
  432. position: absolute;
  433. z-index: 1;
  434. .main-title {
  435. height: 56px;
  436. font-family: 'douyuFont';
  437. font-size: 20px;
  438. letter-spacing: 2px;
  439. display: flex;
  440. justify-content: center;
  441. align-items: center;
  442. }
  443. }
  444. // .module-left {
  445. // position: absolute;
  446. // width: 450px;
  447. // height: 280px;
  448. // left: 0;
  449. // }
  450. // .module-right {
  451. // position: absolute;
  452. // width: 450px;
  453. // height: 280px;
  454. // right: 0;
  455. // }
  456. // .module-bottom {
  457. // position: absolute;
  458. // width: 1000px;
  459. // height: 280px;
  460. // }
  461. .module-dropdown {
  462. padding: 10px;
  463. background-image: linear-gradient(to bottom, #036886, #072a40);
  464. border-bottom: 2px solid #3df6ff;
  465. color: #fff;
  466. position: absolute;
  467. top: 70px;
  468. right: 460px;
  469. }
  470. .module-dropdown-original {
  471. padding: 10px;
  472. background-image: linear-gradient(to bottom, #036886, #072a40);
  473. border-bottom: 2px solid #3df6ff;
  474. color: #fff;
  475. position: absolute;
  476. top: 70px;
  477. right: 460px;
  478. }
  479. }
  480. </style>