options.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. import _ from 'lodash-es';
  2. import { Config } from './types';
  3. export const ModuleSizeMap = {
  4. 'width:450px;height:280px;': '标准尺寸(450*280)',
  5. 'width:450px;height:570px;': '纵向拉伸(450*570)',
  6. 'width:450px;height:860px;': '纵向填充(450*860)',
  7. 'width:1000px;height:280px;': '横向拉伸(1000*280)',
  8. 'width:1920px;height:280px;': '横向填充(1920*280)',
  9. };
  10. export const ModuleSizeOptions = _.map(ModuleSizeMap, (v, k) => ({
  11. value: k,
  12. label: v,
  13. }));
  14. export const ModuleVersionOptions = _.map(['原版', '新版'], (k) => ({
  15. value: k,
  16. label: k,
  17. }));
  18. export const ModulePositionMap = {
  19. 'display:none;': '不展示',
  20. 'top:60px;left:0;': '左上',
  21. 'top:350px;left:0;': '左中',
  22. 'top:640px;left:0;': '左下',
  23. 'top:60px;right:0;': '右上',
  24. 'top:350px;right:0;': '右中',
  25. 'top:640px;right:0;': '右下',
  26. 'top:640px;left:460px;': '中下',
  27. };
  28. export const ModulePositionOptions = _.map(ModulePositionMap, (v, k) => ({
  29. value: k,
  30. label: v,
  31. }));
  32. export const ModulePresetOptions = _.map(
  33. [
  34. '告示版(1*1)',
  35. '折线图(1*1)',
  36. '面积图(1*1)',
  37. '饼状图(1*1)',
  38. '柱状图(2*1)',
  39. '画廊(1*1)',
  40. '列表(1*1)',
  41. '表格(1*1)',
  42. '爆炸三角形(1*1)',
  43. ],
  44. (k) => ({
  45. value: k,
  46. label: k,
  47. })
  48. );
  49. export const ModulePresetMap: Record<
  50. string,
  51. {
  52. moduleData: Config['moduleData'];
  53. showStyle: Partial<Config['showStyle']>;
  54. }
  55. > = {
  56. '告示版(1*1)': {
  57. moduleData: {
  58. header: {
  59. show: true,
  60. showSelector: true,
  61. showSlot: true,
  62. selector: {
  63. prop: 'strinstallpos',
  64. },
  65. slot: {
  66. prop: 'strinstallpos',
  67. },
  68. },
  69. background: {
  70. show: false,
  71. type: 'image',
  72. link: '',
  73. },
  74. layout: ['board'],
  75. board: [
  76. {
  77. type: 'A',
  78. layout: 'val-top',
  79. readFrom: 'readData',
  80. items: [
  81. {
  82. prop: 'Fan1StartStatus_str',
  83. label: '一号机状态',
  84. },
  85. {
  86. prop: 'Fan2StartStatus_str',
  87. label: '二号机状态',
  88. },
  89. ],
  90. },
  91. ],
  92. list: [],
  93. chart: [],
  94. table: [],
  95. gallery: [],
  96. preset: [],
  97. complex_list: [],
  98. },
  99. showStyle: {
  100. size: 'width:450px;height:280px;',
  101. },
  102. },
  103. '折线图(1*1)': {
  104. moduleData: {
  105. header: {
  106. show: false,
  107. showSelector: true,
  108. showSlot: true,
  109. selector: {
  110. prop: 'strinstallpos',
  111. },
  112. slot: {
  113. prop: 'strinstallpos',
  114. },
  115. },
  116. background: {
  117. show: false,
  118. type: 'video',
  119. link: '',
  120. },
  121. layout: ['chart'],
  122. board: [],
  123. list: [],
  124. chart: [
  125. {
  126. type: 'line',
  127. readFrom: 'majorpath.paths',
  128. xAxis: [{ prop: 'name' }],
  129. yAxis: [
  130. { label: 'Drag', align: 'left' },
  131. { label: 'M3', align: 'right' },
  132. ],
  133. series: [
  134. { label: 'Drag', prop: 'drag' },
  135. { label: 'M3', prop: 'm3' },
  136. // { label: '回2', prop: 'hui2' },
  137. ],
  138. },
  139. ],
  140. gallery: [],
  141. table: [],
  142. preset: [],
  143. complex_list: [],
  144. },
  145. showStyle: {
  146. size: 'width:450px;height:280px;',
  147. },
  148. },
  149. '面积图(1*1)': {
  150. moduleData: {
  151. header: {
  152. show: false,
  153. showSelector: true,
  154. showSlot: true,
  155. selector: {
  156. prop: 'strinstallpos',
  157. },
  158. slot: {
  159. prop: 'strinstallpos',
  160. },
  161. },
  162. background: {
  163. show: false,
  164. type: 'video',
  165. link: '',
  166. },
  167. layout: ['chart'],
  168. board: [],
  169. list: [],
  170. chart: [
  171. {
  172. type: 'line_area',
  173. readFrom: 'majorpath.paths',
  174. xAxis: [{ prop: 'name' }],
  175. yAxis: [
  176. { label: 'Drag', align: 'left' },
  177. { label: 'M3', align: 'right' },
  178. ],
  179. series: [
  180. { label: 'Drag', prop: 'drag' },
  181. { label: 'M3', prop: 'm3' },
  182. // { label: '回2', prop: 'hui2' },
  183. ],
  184. },
  185. ],
  186. gallery: [],
  187. table: [],
  188. preset: [],
  189. complex_list: [],
  190. },
  191. showStyle: { size: 'width:450px;height:280px;' },
  192. },
  193. '饼状图(1*1)': {
  194. moduleData: {
  195. header: {
  196. show: false,
  197. showSelector: true,
  198. showSlot: true,
  199. selector: {
  200. prop: 'strinstallpos',
  201. },
  202. slot: {
  203. prop: 'strinstallpos',
  204. },
  205. },
  206. background: {
  207. show: false,
  208. type: 'video',
  209. link: '',
  210. },
  211. layout: ['chart'],
  212. board: [],
  213. list: [],
  214. chart: [
  215. {
  216. type: 'pie',
  217. readFrom: 'history',
  218. xAxis: [],
  219. yAxis: [],
  220. series: [
  221. { label: 'Drag', prop: 'drag' },
  222. { label: 'M3', prop: 'm3' },
  223. // { label: '回2', prop: 'hui2' },
  224. ],
  225. },
  226. ],
  227. gallery: [],
  228. table: [],
  229. preset: [],
  230. complex_list: [],
  231. },
  232. showStyle: { size: 'width:450px;height:280px;' },
  233. },
  234. '柱状图(2*1)': {
  235. moduleData: {
  236. header: {
  237. show: false,
  238. showSelector: false,
  239. showSlot: false,
  240. selector: {
  241. prop: 'strinstallpos',
  242. },
  243. slot: {
  244. prop: 'strinstallpos',
  245. },
  246. },
  247. background: {
  248. show: false,
  249. type: 'video',
  250. link: '',
  251. },
  252. layout: ['chart'],
  253. board: [],
  254. list: [],
  255. table: [],
  256. preset: [],
  257. gallery: [],
  258. complex_list: [],
  259. chart: [
  260. {
  261. type: 'bar',
  262. readFrom: 'sysdata.history',
  263. xAxis: [{ prop: 'time' }],
  264. yAxis: [{ label: '回1', align: 'left' }],
  265. series: [{ label: '回1', prop: 'hui1' }],
  266. },
  267. ],
  268. },
  269. showStyle: { size: 'width:450px;height:280px;' },
  270. },
  271. '画廊(1*1)': {
  272. moduleData: {
  273. header: {
  274. show: false,
  275. showSelector: false,
  276. showSlot: false,
  277. selector: {
  278. prop: 'devicePos',
  279. },
  280. slot: {
  281. prop: 'devicePos',
  282. },
  283. },
  284. background: {
  285. show: false,
  286. type: 'video',
  287. link: '',
  288. },
  289. layout: ['gallery'],
  290. board: [],
  291. gallery: [
  292. {
  293. type: 'A',
  294. readFrom: 'device',
  295. items: [
  296. {
  297. prop: 'gate',
  298. label: '风门',
  299. // label: '光纤预警',
  300. color: 'blue',
  301. },
  302. {
  303. prop: 'window',
  304. label: '风窗',
  305. // label: '喷雾开启数',
  306. color: 'blue',
  307. },
  308. {
  309. prop: 'windrect',
  310. label: '测风',
  311. // label: '联网数量',
  312. color: 'blue',
  313. },
  314. {
  315. prop: 'stationtype',
  316. label: '空位',
  317. // label: '断网数量',
  318. color: 'blue',
  319. },
  320. ],
  321. },
  322. ],
  323. list: [],
  324. table: [],
  325. chart: [],
  326. preset: [],
  327. complex_list: [],
  328. },
  329. showStyle: { size: 'width:450px;height:280px;' },
  330. },
  331. '列表(1*1)': {
  332. moduleData: {
  333. header: {
  334. show: false,
  335. showSelector: false,
  336. showSlot: true,
  337. selector: {
  338. prop: 'strinstallpos',
  339. },
  340. slot: {
  341. prop: 'netstatus.val',
  342. formatter: '网络异常:${} 台',
  343. },
  344. },
  345. background: {
  346. show: false,
  347. type: 'video',
  348. link: '',
  349. },
  350. layout: ['list'],
  351. board: [],
  352. chart: [],
  353. table: [],
  354. preset: [],
  355. complex_list: [],
  356. gallery: [],
  357. list: [
  358. {
  359. type: 'timeline',
  360. readFrom: '',
  361. items: [
  362. {
  363. label: '正常',
  364. prop: 'blue.val',
  365. color: 'blue',
  366. info: '',
  367. },
  368. {
  369. label: '告警',
  370. prop: 'orange.val',
  371. color: 'orange',
  372. info: '',
  373. },
  374. {
  375. label: '报警',
  376. prop: 'yellow.val',
  377. color: 'yellow',
  378. info: '',
  379. },
  380. {
  381. label: '危险',
  382. prop: 'red.val',
  383. color: 'red',
  384. info: '',
  385. },
  386. {
  387. label: '错误',
  388. prop: 'alarm.val',
  389. color: 'green',
  390. info: '',
  391. },
  392. ],
  393. },
  394. ],
  395. },
  396. showStyle: { size: 'width:450px;height:280px;' },
  397. },
  398. '表格(1*1)': {
  399. moduleData: {
  400. header: {
  401. show: false,
  402. showSelector: true,
  403. showSlot: true,
  404. selector: {
  405. prop: 'devicePos',
  406. },
  407. slot: {
  408. prop: 'devicePos',
  409. },
  410. },
  411. background: {
  412. show: false,
  413. type: 'video',
  414. link: '',
  415. },
  416. layout: ['table'],
  417. board: [],
  418. list: [],
  419. preset: [],
  420. gallery: [],
  421. complex_list: [],
  422. table: [
  423. {
  424. type: 'B',
  425. readFrom: 'history',
  426. columns: [
  427. {
  428. prop: 'cate',
  429. label: '类别',
  430. },
  431. {
  432. prop: 'temp',
  433. label: '温度',
  434. },
  435. {
  436. prop: 'wspd',
  437. label: '风速',
  438. },
  439. {
  440. prop: 'spst',
  441. label: '喷雾状态',
  442. },
  443. ],
  444. },
  445. ],
  446. chart: [],
  447. },
  448. showStyle: { size: 'width:450px;height:280px;' },
  449. },
  450. '爆炸三角形(1*1)': {
  451. moduleData: {
  452. header: {
  453. show: false,
  454. showSelector: true,
  455. showSlot: false,
  456. selector: {
  457. prop: 'strinstallpos',
  458. },
  459. slot: {
  460. prop: 'strinstallpos',
  461. },
  462. },
  463. background: {
  464. show: false,
  465. type: 'video',
  466. link: '',
  467. },
  468. layout: ['blast_delta'],
  469. board: [],
  470. gallery: [],
  471. list: [],
  472. table: [],
  473. chart: [],
  474. complex_list: [],
  475. preset: [{}],
  476. },
  477. showStyle: { size: 'width:450px;height:280px;' },
  478. },
  479. '采空区火情综合预警(1*1)': {
  480. moduleData: {
  481. header: {
  482. show: false,
  483. showSelector: false,
  484. showSlot: true,
  485. selector: {
  486. prop: 'strinstallpos',
  487. },
  488. slot: {
  489. prop: 'netstatus.val',
  490. formatter: '网络异常:${} 台',
  491. },
  492. },
  493. background: {
  494. show: false,
  495. type: 'video',
  496. link: '',
  497. },
  498. layout: ['complex_list', 'list'],
  499. // layout: ['list'],
  500. board: [],
  501. chart: [],
  502. gallery: [],
  503. table: [],
  504. list: [
  505. {
  506. type: 'B',
  507. readFrom: '',
  508. items: [
  509. {
  510. label: '堵塞状态',
  511. prop: 'fsectarea',
  512. color: 'yellow',
  513. info: '',
  514. },
  515. {
  516. label: '甲烷浓度',
  517. prop: 'stationname',
  518. color: 'yellow',
  519. info: '',
  520. },
  521. ],
  522. },
  523. ],
  524. complex_list: [
  525. {
  526. type: 'A',
  527. readFrom: '',
  528. items: [
  529. {
  530. label: '火情状态',
  531. prop: 'fsectarea',
  532. color: 'yellow',
  533. info: '',
  534. },
  535. {
  536. label: '回采位置',
  537. prop: 'stationname',
  538. color: 'white',
  539. info: '',
  540. },
  541. {
  542. label: '硐室火情',
  543. prop: 'stationtype',
  544. color: 'blue',
  545. info: '',
  546. },
  547. {
  548. label: '联动设备状态',
  549. prop: 'typeName',
  550. color: 'blue',
  551. info: '',
  552. },
  553. ],
  554. galleryItems: [
  555. {
  556. prop: 'total',
  557. label: '',
  558. formatter: '低风险',
  559. color: 'white',
  560. },
  561. {
  562. prop: 'total',
  563. label: '',
  564. formatter: 'CO',
  565. color: 'white',
  566. },
  567. ],
  568. },
  569. ],
  570. preset: [],
  571. },
  572. showStyle: {
  573. size: 'width:450px;height:280px;',
  574. },
  575. },
  576. '重点区域实时火情(1*2)': {
  577. moduleData: {
  578. header: {
  579. show: false,
  580. showSelector: true,
  581. showSlot: true,
  582. selector: {
  583. prop: 'devicePos',
  584. },
  585. slot: {
  586. prop: 'devicePos',
  587. },
  588. },
  589. background: {
  590. show: false,
  591. type: 'video',
  592. link: '',
  593. },
  594. layout: ['complex_list', 'blast_delta', 'list'],
  595. board: [],
  596. gallery: [],
  597. list: [
  598. {
  599. type: 'E',
  600. readFrom: '',
  601. items: [
  602. {
  603. label: '火情状态',
  604. prop: 'fsectarea',
  605. color: 'yellow',
  606. info: '',
  607. },
  608. {
  609. label: '回采位置',
  610. prop: 'stationname',
  611. color: 'white',
  612. info: '',
  613. },
  614. {
  615. label: '硐室火情',
  616. prop: 'stationtype',
  617. color: 'blue',
  618. info: '',
  619. },
  620. {
  621. label: '联动设备状态',
  622. prop: 'typeName',
  623. color: 'blue',
  624. info: '',
  625. },
  626. {
  627. label: '火情状态',
  628. prop: 'fsectarea',
  629. color: 'yellow',
  630. info: '',
  631. },
  632. {
  633. label: '回采位置',
  634. prop: 'stationname',
  635. color: 'white',
  636. info: '',
  637. },
  638. {
  639. label: '硐室火情',
  640. prop: 'stationtype',
  641. color: 'blue',
  642. info: '',
  643. },
  644. {
  645. label: '联动设备状态',
  646. prop: 'typeName',
  647. color: 'blue',
  648. info: '',
  649. },
  650. // {
  651. // label: '火情状态',
  652. // prop: 'fsectarea',
  653. // color: 'yellow',
  654. // info: '',
  655. // },
  656. // {
  657. // label: '回采位置',
  658. // prop: 'stationname',
  659. // color: 'white',
  660. // info: '',
  661. // },
  662. // {
  663. // label: '硐室火情',
  664. // prop: 'stationtype',
  665. // color: 'blue',
  666. // info: '',
  667. // },
  668. // {
  669. // label: '联动设备状态',
  670. // prop: 'typeName',
  671. // color: 'blue',
  672. // info: '',
  673. // },
  674. ],
  675. },
  676. ],
  677. table: [],
  678. chart: [],
  679. preset: [{}],
  680. complex_list: [
  681. {
  682. type: 'B',
  683. readFrom: '',
  684. items: [
  685. {
  686. label: '火情状态',
  687. prop: 'fsectarea',
  688. color: 'yellow',
  689. info: '',
  690. },
  691. {
  692. label: '回采位置',
  693. prop: 'stationname',
  694. color: 'white',
  695. info: '',
  696. },
  697. {
  698. label: '硐室火情',
  699. prop: 'stationtype',
  700. color: 'blue',
  701. info: '',
  702. },
  703. {
  704. label: '联动设备状态',
  705. prop: 'typeName',
  706. color: 'blue',
  707. info: '',
  708. },
  709. ],
  710. galleryItems: [
  711. {
  712. prop: 'total',
  713. label: '风险等级',
  714. formatter: '低风险',
  715. color: 'white',
  716. },
  717. ],
  718. },
  719. ],
  720. },
  721. showStyle: {
  722. size: 'width:450px;height:570px;',
  723. },
  724. },
  725. };
  726. // export const ModuleChartTypeMap = {
  727. // pie: '饼状图',
  728. // bar: '柱状图',
  729. // line: '折线图',
  730. // };
  731. // export const ModuleChartTypeOptions = _.map(ModuleChartTypeMap, (v, k) => ({
  732. // value: k,
  733. // label: v,
  734. // }));