First.jsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import { onMount, createSignal, For } from "solid-js"
  2. import { Scene, Marker, Popup } from '@antv/l7';
  3. // import { ProvinceLayer } from '@antv/l7-district';
  4. import { GaodeMap } from '@antv/l7-maps';
  5. import Laydate from "../components/laydate"
  6. // import config from "../base/config"
  7. import "../assets/style/first.css"
  8. import Table from "../components/table";
  9. const [tab, setTab] = createSignal(0)
  10. async function mapChart() {
  11. const scene = new Scene({
  12. id: 'map1',
  13. logoVisible: false,
  14. map: new GaodeMap({
  15. center: [108.2825, 36],
  16. pitch: 30,
  17. style: 'dark',
  18. zoom: 6,
  19. minZoom: 4,
  20. maxZoom: 10
  21. })
  22. });
  23. scene.on('loaded', () => {
  24. const popup = new Popup({
  25. offsets: [0, 20]
  26. }).setText('hello');
  27. const marker = new Marker()
  28. .setLnglat([109, 35])
  29. .setPopup(popup);
  30. scene.addMarker(marker);
  31. // new CountryLayer(scene, {
  32. // data: [
  33. // {
  34. // value: 1000
  35. // }
  36. // ],
  37. // depth: 1,
  38. // coastlineWidth: 0,
  39. // provinceStrokeWidth: 1,
  40. // provinceStroke: "#2999c0",
  41. // chinaNationalWidth: 1,
  42. // chinaNationalStroke: '#2b3a7c',
  43. // label: {
  44. // size: 14,
  45. // strokeWidth: 0,
  46. // stroke: 'rgba(0,0,0,0)',
  47. // color: "#fff"
  48. // },
  49. // fill: {
  50. // color: {
  51. // field: 'value',
  52. // values: ['rgba(43,58,124, .1)']
  53. // },
  54. // activeColor: false
  55. // },
  56. // popup: {
  57. // enable: false,
  58. // }
  59. // });
  60. });
  61. }
  62. function first() {
  63. onMount(() => {
  64. mapChart()
  65. })
  66. const tHead = [{ text: '发布时间', type: 'Text' }, { text: '信息来源', type: 'Text' }, { text: '信息标题', type: 'Text', flex: 2 }];
  67. const tBody = [
  68. {
  69. color: "",
  70. col: [
  71. { text: '31分钟前', type: 'Text', color: "rgb(215 1 1 / 60%)", flex: 1 },
  72. { text: '懂车帝', type: 'Text', color: "rgb(215 1 1 / 60%)", flex: 1 },
  73. {
  74. flex: 2,
  75. text: '国足又输了 [流泪][流泪][流泪] 孔老二搬家 ……尽是书 说实话,怪不了这帮小子,他们尽力了,他们也就这能耐。 没有高考不行! 但是,高考为大众目标的教育,必然导致足球人口畸少而且素质极差。 此题',
  76. type: 'Scroll',
  77. color: "rgb(215 1 1 / 60%)"
  78. }
  79. ]
  80. }
  81. ]
  82. console.log("---")
  83. return (
  84. <div class="page firstStyle">
  85. <div class="firstTitle">
  86. <div class="T">
  87. <div class="STitle">舆论场态势实时感知</div>
  88. </div>
  89. <div class="B">
  90. <div class="row btnGroup">
  91. <For each={['全部热点', '行业热点']}>{(v, i) =>
  92. <div class={'col1 button ' + (tab() === i() ? 'select' : '')} tab={i()} onClick={() => setTab(i())}>{v}</div>
  93. }</For>
  94. </div>
  95. <Laydate width="13em" id="laydate" />
  96. </div>
  97. </div>
  98. <Table localclass="secTableleft" head={tHead} body={tBody} />
  99. <Table localclass="secTableright" head={tHead} body={tBody} />
  100. <div id="map1"></div>
  101. </div>
  102. );
  103. }
  104. export default first;