RightSection.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <div class="right-section">
  3. <div class="data-box1" style="margin-top: 9px">
  4. <div class="title-box">
  5. <div class="gradient-text">公共服务承灾体总数</div>
  6. </div>
  7. <div class="box-content" style="padding: 5px 0 5px 5px; height: 195px">
  8. <div class="box4">
  9. <div v-for="(item, index) in riskData" :key="index" class="item" :title="item.name" :style="{ backgroundImage: `url(${item.icon})` }">
  10. <div class="text1">{{ item.name }}</div>
  11. <div class="text2">{{ item.value }}</div>
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="data-box1" style="margin-top: 9px">
  17. <div class="title-box2">
  18. <div class="gradient-text">茂名市公共服务承灾体数量</div>
  19. </div>
  20. <div class="box-content" style="padding: 5px 0 5px 5px; height: 220px">
  21. <Chart :option="option1" />
  22. </div>
  23. </div>
  24. <div class="data-box1" style="margin-top: 9px">
  25. <div class="title-box3">
  26. <div class="gradient-text">茂名市公共服务承灾体数量统计表</div>
  27. </div>
  28. <div class="box-content" style="padding: 5px 0 5px 5px; height: 255px">
  29. <div class="box4">
  30. <div class="common-table">
  31. <div class="table-header">
  32. <div class="td" style="width: 152px">区县</div>
  33. <div class="td" style="width: 152px">星级饭店</div>
  34. <div class="td" style="width: 152px">旅游景区</div>
  35. </div>
  36. <div v-for="(item, index) in tableData" :key="index" class="tr">
  37. <div class="td">{{ item.area }}</div>
  38. <div class="td">{{ item.data1 }}</div>
  39. <div class="td">{{ item.data2 }}</div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </template>
  47. <script lang="ts" setup name="RightSection">
  48. import { getImageUrl } from './data';
  49. let riskData = reactive([
  50. { name: '学校', value: '1', icon: getImageUrl('school2') },
  51. { name: '医疗卫生机构', value: '1', icon: getImageUrl('hospital2') },
  52. { name: '提供住宿的社会服务机构', value: '1', icon: getImageUrl('socialInstitution2') },
  53. { name: '公共文化场所', value: '1', icon: getImageUrl('publicPlace2') },
  54. { name: '旅游景区', value: '1', icon: getImageUrl('scenicSpot2') },
  55. { name: '星级饭店', value: '1', icon: getImageUrl('restaurant2') },
  56. { name: '体育场馆', value: '1', icon: getImageUrl('gymnasium2') },
  57. { name: '宗教活动场所', value: '1', icon: getImageUrl('religiousPlace2') },
  58. { name: '大型超市', value: '1', icon: getImageUrl('supermarket2') }
  59. ]);
  60. let option1 = reactive({
  61. tooltip: {
  62. trigger: 'axis',
  63. axisPointer: {
  64. type: 'shadow'
  65. }
  66. },
  67. color: ['#3172f3', '#5cc4f1'],
  68. legend: {
  69. textStyle: {
  70. color: '#9a9ea7'
  71. }
  72. },
  73. grid: {
  74. top: '25',
  75. left: '10px',
  76. right: '20px',
  77. bottom: '10px',
  78. containLabel: true
  79. },
  80. xAxis: {
  81. type: 'value',
  82. boundaryGap: [0, 0.01],
  83. axisLabel: {
  84. color: '#9a9ea7'
  85. },
  86. splitLine: {
  87. show: false
  88. },
  89. axisLine: {
  90. show: true,
  91. lineStyle: {
  92. color: '#2b3446'
  93. }
  94. }
  95. },
  96. yAxis: {
  97. type: 'category',
  98. axisLine: {
  99. lineStyle: {
  100. color: '#2b3446'
  101. }
  102. },
  103. axisTick: {
  104. show: false
  105. },
  106. axisLabel: {
  107. color: '#9a9ea7'
  108. },
  109. data: []
  110. },
  111. series: [
  112. {
  113. name: '星级饭店',
  114. type: 'bar',
  115. data: []
  116. },
  117. {
  118. name: '旅游景点',
  119. type: 'bar',
  120. data: []
  121. }
  122. ]
  123. });
  124. //
  125. const tableData = ref([]);
  126. const getData = () => {
  127. tableData.value = [
  128. { area: '茂南区', data1: '123', data2: '74' },
  129. { area: '电白区', data1: '23', data2: '12' },
  130. { area: '高州区', data1: '14', data2: '23' },
  131. { area: '化州区', data1: '25', data2: '14' },
  132. { area: '信宜区', data1: '21', data2: '24' }
  133. ];
  134. option1.yAxis.data = ['茂南区', '电白区', '高州区', '化州区', '信宜区'];
  135. option1.series[0].data = [182, 234, 290, 104, 131];
  136. option1.series[1].data = [193, 234, 310, 121, 134];
  137. };
  138. onMounted(() => {
  139. getData();
  140. });
  141. </script>
  142. <style lang="scss" scoped>
  143. .right-section {
  144. width: 100%;
  145. height: 100%;
  146. overflow: hidden;
  147. color: #ffffff;
  148. padding-right: 20px;
  149. .data-box1 {
  150. &::after {
  151. content: '';
  152. display: block;
  153. width: 517px;
  154. height: 19px;
  155. background: url('@/assets/images/censusDataAnalysis/line.png') no-repeat;
  156. background-size: 100% 100%;
  157. margin-top: -8px;
  158. }
  159. .title-box {
  160. width: 450px;
  161. height: 40px;
  162. background: url('@/assets/images/censusDataAnalysis/titleBox6.png') no-repeat;
  163. background-size: 100% 100%;
  164. padding-left: 50px;
  165. .gradient-text {
  166. font-size: 24px;
  167. }
  168. }
  169. .title-box2 {
  170. width: 516px;
  171. height: 40px;
  172. background: url('@/assets/images/censusDataAnalysis/titleBox4.png') no-repeat;
  173. background-size: 100% 100%;
  174. padding-left: 50px;
  175. .gradient-text {
  176. font-size: 24px;
  177. }
  178. }
  179. .title-box3 {
  180. width: 518px;
  181. height: 40px;
  182. background: url('@/assets/images/censusDataAnalysis/titleBox5.png') no-repeat;
  183. background-size: 100% 100%;
  184. padding-left: 50px;
  185. .gradient-text {
  186. font-size: 24px;
  187. }
  188. }
  189. .box-content {
  190. min-height: 123px;
  191. background: url('@/assets/images/censusDataAnalysis/box.png') no-repeat;
  192. background-size: 100% 100%;
  193. padding: 5px 28px;
  194. .btn-box {
  195. display: flex;
  196. justify-content: flex-end;
  197. align-items: center;
  198. margin-top: -23px;
  199. padding-right: 20px;
  200. .line {
  201. margin: 0 5px;
  202. }
  203. .text {
  204. font-size: 14px;
  205. color: #ffffff;
  206. cursor: pointer;
  207. }
  208. .text-active {
  209. color: #00fce7;
  210. }
  211. }
  212. .box1 {
  213. display: flex;
  214. align-items: center;
  215. width: 235px;
  216. height: 20px;
  217. background: url('@/assets/images/censusDataAnalysis/forestFire/box1.png') no-repeat bottom left;
  218. background-size: 100% 13px;
  219. .icon-address {
  220. width: 11px;
  221. height: 10px;
  222. background: url('@/assets/images/censusDataAnalysis/forestFire/address.png') no-repeat;
  223. background-size: 100% 100%;
  224. margin-right: 5px;
  225. }
  226. .text1 {
  227. font-size: 12px;
  228. color: #edfaff;
  229. display: flex;
  230. align-items: center;
  231. }
  232. }
  233. .box2 {
  234. display: flex;
  235. flex-wrap: wrap;
  236. margin-top: 8px;
  237. .box-item {
  238. display: flex;
  239. margin-left: 42px;
  240. &:nth-child(1),
  241. &:nth-child(4) {
  242. margin-left: 0;
  243. }
  244. .icon1 {
  245. background: url('@/assets/images/censusDataAnalysis/forestFire/iconRisk1.png') no-repeat;
  246. }
  247. .icon2 {
  248. background: url('@/assets/images/censusDataAnalysis/forestFire/iconRisk2.png') no-repeat;
  249. }
  250. .icon3 {
  251. background: url('@/assets/images/censusDataAnalysis/forestFire/iconRisk3.png') no-repeat;
  252. }
  253. .icon4 {
  254. background: url('@/assets/images/censusDataAnalysis/forestFire/iconRisk4.png') no-repeat;
  255. }
  256. .icon5 {
  257. background: url('@/assets/images/censusDataAnalysis/forestFire/iconRisk5.png') no-repeat;
  258. }
  259. .icon1,
  260. .icon2,
  261. .icon3,
  262. .icon4,
  263. .icon5 {
  264. width: 48px;
  265. height: 49px;
  266. background-size: 100% 100%;
  267. }
  268. .text-box {
  269. margin-left: 8px;
  270. .text-box2 {
  271. display: flex;
  272. align-items: baseline;
  273. margin-bottom: 6px;
  274. .red-text,
  275. .orange-text,
  276. .yellow-text,
  277. .blue-text,
  278. .green-text {
  279. min-width: 25px;
  280. font-size: 16px;
  281. color: transparent;
  282. -webkit-background-clip: text;
  283. background-clip: text;
  284. display: inline-block;
  285. font-family: BEBAS-1;
  286. }
  287. .red-text {
  288. background-image: linear-gradient(to bottom, #ffffff 30%, #ffc4be 50%, #ff2f3c 100%);
  289. }
  290. .orange-text {
  291. background-image: linear-gradient(to bottom, #ffffff 30%, #ffddc7 50%, #f88726 100%);
  292. }
  293. .yellow-text {
  294. background-image: linear-gradient(to bottom, #ffffff 30%, #fcfed0 50%, #f7f71e 100%);
  295. }
  296. .blue-text {
  297. background-image: linear-gradient(to bottom, #ffffff 30%, #c1dbff 50%, #2c81ff 100%);
  298. }
  299. .green-text {
  300. background-image: linear-gradient(to bottom, #ffffff 30%, #d1ffdb 50%, #22fb81 100%);
  301. }
  302. }
  303. .text1 {
  304. font-size: 12px;
  305. color: #a8ccde;
  306. }
  307. .text2 {
  308. font-size: 12px;
  309. color: #ffffff;
  310. }
  311. }
  312. }
  313. }
  314. .box3 {
  315. width: 100%;
  316. display: flex;
  317. justify-content: space-between;
  318. align-items: center;
  319. .item {
  320. width: 116px;
  321. height: 58px;
  322. background: url('@/assets/images/censusDataAnalysis/forestFire/box2.png') no-repeat;
  323. background-size: 100% 100%;
  324. display: flex;
  325. align-items: center;
  326. position: relative;
  327. padding-left: 40px;
  328. box-sizing: border-box;
  329. .icon1 {
  330. background: url('@/assets/images/censusDataAnalysis/forestFire/town.png') no-repeat;
  331. }
  332. .icon2 {
  333. background: url('@/assets/images/censusDataAnalysis/forestFire/population.png') no-repeat;
  334. }
  335. .icon3 {
  336. background: url('@/assets/images/censusDataAnalysis/forestFire/area.png') no-repeat;
  337. }
  338. .icon4 {
  339. background: url('@/assets/images/censusDataAnalysis/forestFire/gdp.png') no-repeat;
  340. }
  341. .icon1,
  342. .icon2,
  343. .icon3,
  344. .icon4 {
  345. position: absolute;
  346. left: -32px;
  347. top: -24px;
  348. flex-shrink: 0;
  349. display: inline-block;
  350. width: 106px;
  351. height: 106px;
  352. margin-right: 10px;
  353. background-size: 100% 100%;
  354. }
  355. .text-box {
  356. .text1 {
  357. font-size: 14px;
  358. color: #ffffff;
  359. }
  360. .text-box2 {
  361. display: flex;
  362. align-items: baseline;
  363. .text2 {
  364. font-size: 16px;
  365. min-width: 40px;
  366. color: transparent;
  367. -webkit-background-clip: text;
  368. background-clip: text;
  369. display: inline-block;
  370. font-family: BEBAS-1;
  371. background-image: linear-gradient(to bottom, #ffffff 30%, #c1dbff 50%, #2c81ff 100%);
  372. }
  373. .text3 {
  374. font-size: 12px;
  375. color: #a8ccde;
  376. }
  377. }
  378. }
  379. }
  380. }
  381. .box4 {
  382. display: flex;
  383. flex-wrap: wrap;
  384. align-items: center;
  385. .item {
  386. box-sizing: border-box;
  387. padding-top: 5px;
  388. padding-left: 70px;
  389. width: 163px;
  390. height: 57px;
  391. background-repeat: no-repeat;
  392. background-size: 100% 100%;
  393. margin-left: 10px;
  394. margin-top: 7px;
  395. //&:nth-child(1),
  396. //&:nth-child(2),
  397. //&:nth-child(3) {
  398. // margin-top: 0;
  399. //}
  400. &:nth-child(3n + 1) {
  401. margin-left: 0;
  402. }
  403. .text1 {
  404. font-size: 14px;
  405. overflow: hidden;
  406. white-space: nowrap;
  407. text-overflow: ellipsis;
  408. }
  409. .text2 {
  410. font-size: 18px;
  411. color: transparent;
  412. -webkit-background-clip: text;
  413. background-clip: text;
  414. display: inline-block;
  415. font-family: BEBAS-1;
  416. background-image: linear-gradient(to bottom, #ffffff 30%, #c1dbff 50%, #2c81ff 100%);
  417. margin-top: 5px;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. .data-box2 {
  424. width: 506px;
  425. height: 135px;
  426. background: url('@/assets/images/censusDataAnalysis/box2.png') no-repeat;
  427. background-size: 100% 100%;
  428. padding: 8px 10px;
  429. .box-header {
  430. display: flex;
  431. justify-content: space-between;
  432. align-items: center;
  433. .header-left {
  434. display: flex;
  435. align-items: center;
  436. .header-title {
  437. font-size: 16px;
  438. color: transparent;
  439. background-image: linear-gradient(to bottom, #fff 40%, #65a3ff 70%, #3385ff 100%);
  440. -webkit-background-clip: text;
  441. background-clip: text;
  442. display: inline-block;
  443. }
  444. .time {
  445. color: #edfaff;
  446. font-size: 12px;
  447. margin-left: 15px;
  448. }
  449. }
  450. .btn {
  451. width: 106px;
  452. height: 40px;
  453. background: url('@/assets/images/censusDataAnalysis/btn.png') no-repeat;
  454. background-size: 100% 100%;
  455. font-size: 12px;
  456. color: #edfaff;
  457. display: flex;
  458. justify-content: center;
  459. align-items: center;
  460. padding-left: 15px;
  461. cursor: pointer;
  462. }
  463. }
  464. .box-content {
  465. display: flex;
  466. align-items: center;
  467. .icon {
  468. display: inline-block;
  469. flex-shrink: 0;
  470. width: 64px;
  471. height: 65px;
  472. background: url('@/assets/images/censusDataAnalysis/riskOverview.png') no-repeat;
  473. background-size: 100% 100%;
  474. }
  475. .line {
  476. width: 1.5px;
  477. height: 39px;
  478. margin: 0 10px;
  479. background-color: #535353;
  480. }
  481. .text {
  482. overflow: hidden;
  483. text-overflow: ellipsis;
  484. display: -webkit-box;
  485. -webkit-box-orient: vertical;
  486. -webkit-line-clamp: 4;
  487. font-size: 14px;
  488. }
  489. }
  490. }
  491. }
  492. .flex-box {
  493. display: flex;
  494. flex-direction: column;
  495. justify-content: center;
  496. align-items: center;
  497. font-size: 16px;
  498. color: #c9daf0;
  499. .icon-chart {
  500. width: 79px;
  501. height: 62px;
  502. background: url('@/assets/images/censusDataAnalysis/forestFire/chart.png') no-repeat;
  503. background-size: 100% 100%;
  504. }
  505. }
  506. .common-table {
  507. .table-header {
  508. padding: 0;
  509. }
  510. .tr {
  511. padding: 2px 0;
  512. }
  513. }
  514. </style>