options.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  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. },
  343. },
  344. background: {
  345. show: false,
  346. type: 'video',
  347. link: '',
  348. },
  349. layout: ['list'],
  350. board: [],
  351. chart: [],
  352. table: [],
  353. preset: [],
  354. complex_list: [],
  355. gallery: [],
  356. list: [
  357. {
  358. type: 'timeline',
  359. readFrom: '',
  360. items: [
  361. {
  362. label: '正常',
  363. prop: '${blue}.val',
  364. color: 'blue',
  365. info: '',
  366. },
  367. {
  368. label: '告警',
  369. prop: '${orange}.val',
  370. color: 'orange',
  371. info: '',
  372. },
  373. {
  374. label: '报警',
  375. prop: '${yellow}.val',
  376. color: 'yellow',
  377. info: '',
  378. },
  379. {
  380. label: '危险',
  381. prop: '${red}.val',
  382. color: 'red',
  383. info: '',
  384. },
  385. {
  386. label: '错误',
  387. prop: '${alarm}.val',
  388. color: 'green',
  389. info: '',
  390. },
  391. ],
  392. },
  393. ],
  394. },
  395. showStyle: { size: 'width:450px;height:280px;' },
  396. },
  397. '表格(1*1)': {
  398. moduleData: {
  399. header: {
  400. show: false,
  401. showSelector: true,
  402. showSlot: true,
  403. selector: {
  404. prop: '${devicePos}',
  405. },
  406. slot: {
  407. prop: '${devicePos}',
  408. },
  409. },
  410. background: {
  411. show: false,
  412. type: 'video',
  413. link: '',
  414. },
  415. layout: ['table'],
  416. board: [],
  417. list: [],
  418. preset: [],
  419. gallery: [],
  420. complex_list: [],
  421. table: [
  422. {
  423. type: 'B',
  424. readFrom: 'history',
  425. columns: [
  426. {
  427. prop: '${cate}',
  428. label: '类别',
  429. },
  430. {
  431. prop: '${temp}',
  432. label: '温度',
  433. },
  434. {
  435. prop: '${wspd}',
  436. label: '风速',
  437. },
  438. {
  439. prop: '${spst}',
  440. label: '喷雾状态',
  441. },
  442. ],
  443. },
  444. ],
  445. chart: [],
  446. },
  447. showStyle: { size: 'width:450px;height:280px;' },
  448. },
  449. '爆炸三角形(1*1)': {
  450. moduleData: {
  451. header: {
  452. show: false,
  453. showSelector: true,
  454. showSlot: false,
  455. selector: {
  456. prop: '${strinstallpos}',
  457. },
  458. slot: {
  459. prop: '${strinstallpos}',
  460. },
  461. },
  462. background: {
  463. show: false,
  464. type: 'video',
  465. link: '',
  466. },
  467. layout: ['blast_delta'],
  468. board: [],
  469. gallery: [],
  470. list: [],
  471. table: [],
  472. chart: [],
  473. complex_list: [],
  474. preset: [{}],
  475. },
  476. showStyle: { size: 'width:450px;height:280px;' },
  477. },
  478. '采空区火情综合预警(1*1)': {
  479. moduleData: {
  480. header: {
  481. show: false,
  482. showSelector: false,
  483. showSlot: true,
  484. selector: {
  485. prop: '${strinstallpos}',
  486. },
  487. slot: {
  488. prop: '${网络异常:}${netstatus.val} 台',
  489. },
  490. },
  491. background: {
  492. show: false,
  493. type: 'video',
  494. link: '',
  495. },
  496. layout: ['complex_list', 'list'],
  497. // layout: ['list'],
  498. board: [],
  499. chart: [],
  500. gallery: [],
  501. table: [],
  502. list: [
  503. {
  504. type: 'B',
  505. readFrom: '',
  506. items: [
  507. {
  508. label: '堵塞状态',
  509. prop: '${fsectarea}',
  510. color: 'yellow',
  511. info: '',
  512. },
  513. {
  514. label: '甲烷浓度',
  515. prop: '${stationname}',
  516. color: 'yellow',
  517. info: '',
  518. },
  519. ],
  520. },
  521. ],
  522. complex_list: [
  523. {
  524. type: 'A',
  525. readFrom: '',
  526. items: [
  527. {
  528. label: '火情状态',
  529. prop: '${fsectarea}',
  530. color: 'yellow',
  531. info: '',
  532. },
  533. {
  534. label: '回采位置',
  535. prop: '${stationname}',
  536. color: 'white',
  537. info: '',
  538. },
  539. {
  540. label: '硐室火情',
  541. prop: '${stationtype}',
  542. color: 'blue',
  543. info: '',
  544. },
  545. {
  546. label: '联动设备状态',
  547. prop: '${typeName}',
  548. color: 'blue',
  549. info: '',
  550. },
  551. ],
  552. galleryItems: [
  553. {
  554. prop: '${低风险}',
  555. label: '',
  556. color: 'white',
  557. },
  558. {
  559. prop: '${CO}',
  560. label: '',
  561. color: 'white',
  562. },
  563. ],
  564. },
  565. ],
  566. preset: [],
  567. },
  568. showStyle: {
  569. size: 'width:450px;height:280px;',
  570. },
  571. },
  572. '重点区域实时火情(1*2)': {
  573. moduleData: {
  574. header: {
  575. show: false,
  576. showSelector: true,
  577. showSlot: true,
  578. selector: {
  579. prop: '${devicePos}',
  580. },
  581. slot: {
  582. prop: '${devicePos}',
  583. },
  584. },
  585. background: {
  586. show: false,
  587. type: 'video',
  588. link: '',
  589. },
  590. layout: ['complex_list', 'blast_delta', 'list'],
  591. board: [],
  592. gallery: [],
  593. list: [
  594. {
  595. type: 'E',
  596. readFrom: '',
  597. items: [
  598. {
  599. label: '火情状态',
  600. prop: '${fsectarea}',
  601. color: 'yellow',
  602. info: '',
  603. },
  604. {
  605. label: '回采位置',
  606. prop: '${stationname}',
  607. color: 'white',
  608. info: '',
  609. },
  610. {
  611. label: '硐室火情',
  612. prop: '${stationtype}',
  613. color: 'blue',
  614. info: '',
  615. },
  616. {
  617. label: '联动设备状态',
  618. prop: '${typeName}',
  619. color: 'blue',
  620. info: '',
  621. },
  622. {
  623. label: '火情状态',
  624. prop: '${fsectarea}',
  625. color: 'yellow',
  626. info: '',
  627. },
  628. {
  629. label: '回采位置',
  630. prop: '${stationname}',
  631. color: 'white',
  632. info: '',
  633. },
  634. {
  635. label: '硐室火情',
  636. prop: '${stationtype}',
  637. color: 'blue',
  638. info: '',
  639. },
  640. {
  641. label: '联动设备状态',
  642. prop: '${typeName}',
  643. color: 'blue',
  644. info: '',
  645. },
  646. // {
  647. // label: '火情状态',
  648. // prop: '${fsectarea}',
  649. // color: 'yellow',
  650. // info: '',
  651. // },
  652. // {
  653. // label: '回采位置',
  654. // prop: '${stationname}',
  655. // color: 'white',
  656. // info: '',
  657. // },
  658. // {
  659. // label: '硐室火情',
  660. // prop: '${stationtype}',
  661. // color: 'blue',
  662. // info: '',
  663. // },
  664. // {
  665. // label: '联动设备状态',
  666. // prop: '${typeName}',
  667. // color: 'blue',
  668. // info: '',
  669. // },
  670. ],
  671. },
  672. ],
  673. table: [],
  674. chart: [],
  675. preset: [{}],
  676. complex_list: [
  677. {
  678. type: 'B',
  679. readFrom: '',
  680. items: [
  681. {
  682. label: '火情状态',
  683. prop: '${fsectarea}',
  684. color: 'yellow',
  685. info: '',
  686. },
  687. {
  688. label: '回采位置',
  689. prop: '${stationname}',
  690. color: 'white',
  691. info: '',
  692. },
  693. {
  694. label: '硐室火情',
  695. prop: '${stationtype}',
  696. color: 'blue',
  697. info: '',
  698. },
  699. {
  700. label: '联动设备状态',
  701. prop: '${typeName}',
  702. color: 'blue',
  703. info: '',
  704. },
  705. ],
  706. galleryItems: [
  707. {
  708. prop: '${低风险}',
  709. label: '风险等级',
  710. color: 'white',
  711. },
  712. ],
  713. },
  714. ],
  715. },
  716. showStyle: {
  717. size: 'width:450px;height:570px;',
  718. },
  719. },
  720. };
  721. // export const ModuleChartTypeMap = {
  722. // pie: '饼状图',
  723. // bar: '柱状图',
  724. // line: '折线图',
  725. // };
  726. // export const ModuleChartTypeOptions = _.map(ModuleChartTypeMap, (v, k) => ({
  727. // value: k,
  728. // label: v,
  729. // }));