hazardousChemicals.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <!-- 数据看板-危化品 -->
  2. <template>
  3. <view class="hazardSources">
  4. <view class="statistics">
  5. <view class="statistics-t">
  6. <view class="statistics-t-l">危化品总数:</view>
  7. <view class="statistics-t-r">1455 </view>
  8. </view>
  9. <view class="statistics-b">
  10. <view class="statistics-b-li">
  11. <view class="statistics-b-li-t color-A">1769 kg</view>
  12. <view class="statistics-b-li-b">总量</view>
  13. </view>
  14. <view class="line"></view>
  15. <view class="statistics-b-li">
  16. <view class="statistics-b-li-t color-B">14 </view>
  17. <view class="statistics-b-li-b">今日新增数</view>
  18. </view>
  19. <view class="line"></view>
  20. <view class="statistics-b-li">
  21. <view class="statistics-b-li-t color-C">115.3 kg</view>
  22. <view class="statistics-b-li-b">今日新增量</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="small-title">
  27. <view class="small-title-l">危化品存量排行TOP5</view>
  28. <img class="small-title-r" src="@/pages/images/icon_wdwg_gd.png">
  29. </view>
  30. <view class="chart">
  31. <view class="chart-t">
  32. <qiun-data-charts type="funnel" :opts="opts" :echartsH5="true" :chartData="chartData" />
  33. </view>
  34. <view class="chart-b" v-for="(item,index) in dataList" :key="index">
  35. <view :class="index==0?'chartOne':(index==1?'chartTow':(index==2?'chartThree':'chartFive'))">
  36. {{index+1}}
  37. </view>
  38. <view>{{item.data1}}</view>
  39. <view>总数{{item.data2}}</view>
  40. <view>|</view>
  41. <view>今日新增{{item.data3}}</view>
  42. <img src="@/pages/images/dataBoard/dataBoard-icon2.png">
  43. </view>
  44. </view>
  45. <view class="table">
  46. <view class="table-border">
  47. <view class="table-th">
  48. <view class="table-th-li">
  49. <view>排行</view>
  50. <view>学院单位</view>
  51. <view>总数</view>
  52. <view>总量</view>
  53. <view>今日新增</view>
  54. </view>
  55. </view>
  56. <view class="table-tb">
  57. <view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
  58. <view>
  59. <text :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
  60. </view>
  61. <view>{{item.data1}}</view>
  62. <view>{{item.data2}}</view>
  63. <view>{{item.data3}}</view>
  64. <view>{{item.data4}}</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import {
  73. config
  74. } from '@/api/request/config.js'
  75. import {
  76. } from '@/pages_basics/api/index.js'
  77. export default {
  78. name: "hazardSources",
  79. components: {
  80. },
  81. data() {
  82. return {
  83. opts: {
  84. color: ['#FF0000','#D40000','#FF5900','#FF9900','#FF9900'],
  85. legend:{
  86. show:false,
  87. },
  88. padding: [15, 15, 6, 15],
  89. enableScroll: false,
  90. extra: {
  91. funnel: {
  92. type: 'triangle',
  93. border: false,
  94. labelAlign: "right",
  95. }
  96. }
  97. },
  98. chartData: {},
  99. // 查询参数
  100. queryParams: {
  101. page: 1,
  102. pageSize: 10,
  103. },
  104. dataList: [{
  105. data1: '植物保护',
  106. data2: '499',
  107. data3: '47',
  108. data4: '220',
  109. data5: '137',
  110. },
  111. {
  112. data1: '资源环境',
  113. data2: '199',
  114. data3: '7',
  115. data4: '120',
  116. data5: '37',
  117. },
  118. {
  119. data1: '生命科学',
  120. data2: '299',
  121. data3: '71',
  122. data4: '10',
  123. data5: '37',
  124. },
  125. {
  126. data1: '资源环境',
  127. data2: '199',
  128. data3: '7',
  129. data4: '120',
  130. data5: '37',
  131. },
  132. {
  133. data1: '生命科学',
  134. data2: '299',
  135. data3: '71',
  136. data4: '10',
  137. data5: '37',
  138. },
  139. ],
  140. total: 0,
  141. }
  142. },
  143. created() {
  144. },
  145. beforeMount() {
  146. },
  147. mounted() {
  148. this.getServerData();
  149. },
  150. methods: {
  151. dateClick(index) {
  152. this.dateIndex = index;
  153. },
  154. getServerData() {
  155. //模拟从服务器获取数据时的延时
  156. setTimeout(() => {
  157. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  158. let res = {
  159. series: [{
  160. data: [{
  161. "name": "植物保护",
  162. "centerText": "50",
  163. "value": 50,
  164. "labelText":"总量88.88kg",
  165. }, {
  166. "name": "园林艺术",
  167. "centerText": "30",
  168. "value": 30,
  169. "labelText":"总量88.88kg"
  170. }, {
  171. "name": "生命科学",
  172. "centerText": "20",
  173. "value": 20,
  174. "labelText":"总量88.88kg"
  175. }, {
  176. "name": "理学院",
  177. "centerText": "18",
  178. "value": 18,
  179. "labelText":"总量88.88kg"
  180. }, {
  181. "name": "农学院",
  182. "centerText": "8",
  183. "value": 8,
  184. "labelText":"总量88.88kg"
  185. }]
  186. }]
  187. };
  188. this.chartData = JSON.parse(JSON.stringify(res));
  189. }, 500);
  190. },
  191. },
  192. }
  193. </script>
  194. <style lang="stylus" scoped>
  195. .hazardSources {
  196. height: 100%;
  197. width: 100%;
  198. background: #363744;
  199. padding: 20rpx 30rpx 0;
  200. box-sizing: border-box;
  201. .small-title {
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. .small-title-l {
  206. font-weight: 400;
  207. font-size: 32rpx;
  208. color: #FFFFFF;
  209. line-height: 45rpx;
  210. text-align: left;
  211. margin: 28rpx 0;
  212. }
  213. .small-title-r {
  214. width: 15rpx;
  215. height: 18rpx;
  216. }
  217. }
  218. .chart {
  219. width: 690rpx;
  220. height: 850rpx;
  221. background: #3E414F;
  222. border-radius: 20rpx 20rpx 20rpx 20rpx;
  223. padding: 24rpx 20rpx 0;
  224. box-sizing: border-box;
  225. .chart-t {
  226. width: 650rpx;
  227. height: 452rpx;
  228. }
  229. .chart-b {
  230. padding: 0 30rpx;
  231. box-sizing: border-box;
  232. display: flex;
  233. justify-content: flex-start;
  234. align-items: center;
  235. height: 40rpx;
  236. margin-bottom: 36rpx;
  237. >view {
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. white-space: nowrap;
  241. }
  242. >view:nth-of-type(1) {
  243. width: 32rpx;
  244. height: 32rpx;
  245. font-weight: 400;
  246. font-size: 28rpx;
  247. line-height: 32rpx;
  248. text-align: center;
  249. margin-right: 18rpx;
  250. }
  251. >view:nth-of-type(2) {
  252. width: 246rpx;
  253. font-weight: 400;
  254. font-size: 28rpx;
  255. color: #FFFFFF;
  256. line-height: 39rpx;
  257. }
  258. >view:nth-of-type(3) {
  259. width: 132rpx;
  260. font-weight: 400;
  261. font-size: 28rpx;
  262. color: #FFFFFF;
  263. line-height: 39rpx;
  264. }
  265. >view:nth-of-type(4) {
  266. width: 2rpx;
  267. height: 20rpx;
  268. background: #D8D8D8;
  269. margin-right: 22rpx;
  270. }
  271. >view:nth-of-type(5) {
  272. width: 154rpx;
  273. font-weight: 400;
  274. font-size: 28rpx;
  275. color: #FFFFFF;
  276. line-height: 39rpx;
  277. }
  278. >img {
  279. width: 22rpx;
  280. height: 28rpx;
  281. }
  282. }
  283. .chartOne{
  284. background: rgba(255, 0, 0, 0.2);
  285. color: #FF0000;
  286. }
  287. .chartTow{
  288. background: #FFE3CC;
  289. color: #FF9900;
  290. }
  291. .chartThree{
  292. background: #FFEECC;
  293. color: #FFAA00;
  294. }
  295. .chartFive{
  296. background: #CCE6FE;
  297. color: #0183FA;
  298. }
  299. }
  300. .statistics {
  301. width: 690rpx;
  302. height: 241rpx;
  303. background: #3E414F;
  304. border-radius: 20rpx 20rpx 20rpx 20rpx;
  305. margin-top: 20rpx;
  306. .statistics-t {
  307. height: 100rpx;
  308. display: flex;
  309. justify-content: space-between;
  310. align-items: center;
  311. border-bottom: 1rpx solid #52545F;
  312. padding: 0 42rpx 0 38rpx;
  313. box-sizing: border-box;
  314. .statistics-t-l {
  315. font-weight: 400;
  316. font-size: 32rpx;
  317. color: #FFFFFF;
  318. line-height: 45rpx;
  319. }
  320. .statistics-t-r {
  321. font-weight: 400;
  322. font-size: 36rpx;
  323. color: #FFFFFF;
  324. line-height: 50rpx;
  325. }
  326. }
  327. .statistics-b {
  328. display: flex;
  329. justify-content: space-between;
  330. align-items: center;
  331. .statistics-b-li {
  332. flex: 1;
  333. text-align: center;
  334. .statistics-b-li-t {
  335. font-weight: 400;
  336. font-size: 36rpx;
  337. line-height: 50rpx;
  338. margin-top: 28rpx;
  339. }
  340. .statistics-b-li-b {
  341. font-weight: 400;
  342. font-size: 28rpx;
  343. color: #FFFFFF;
  344. line-height: 39rpx;
  345. margin-top: 9rpx;
  346. }
  347. }
  348. .line {
  349. width: 2rpx;
  350. height: 30rpx;
  351. background: #D8D8D8;
  352. }
  353. .color-A {
  354. color: #FF8C00;
  355. }
  356. .color-B {
  357. color: #26C736;
  358. }
  359. .color-C {
  360. color: #FF0000;
  361. }
  362. }
  363. }
  364. .table {
  365. width: 720rpx;
  366. margin-top: 20rpx;
  367. .table-border {
  368. overflow: auto;
  369. }
  370. .table-th {
  371. width: 860rpx;
  372. height: 80rpx;
  373. background: rgba(162, 162, 162, 0.2);
  374. border-radius: 20rpx 20rpx 0rpx 0rpx;
  375. padding: 0 30rpx;
  376. box-sizing: border-box;
  377. .table-th-li {
  378. height: 80rpx;
  379. display: flex;
  380. justify-content: flex-start;
  381. >view {
  382. font-weight: 400;
  383. font-size: 30rpx;
  384. color: #FFFFFF;
  385. line-height: 80rpx;
  386. text-align: center;
  387. margin-right: 38rpx;
  388. width: 120rpx;
  389. overflow: hidden;
  390. text-overflow: ellipsis;
  391. white-space: nowrap;
  392. }
  393. >view:nth-of-type(1) {
  394. width: 64rpx;
  395. }
  396. >view:nth-of-type(2) {
  397. width: 168rpx;
  398. }
  399. >view:last-child {
  400. margin-right: 0;
  401. width: 168rpx;
  402. }
  403. }
  404. }
  405. .table-tb {
  406. width: 860rpx;
  407. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  408. background: #3E414F;
  409. padding: 0 30rpx;
  410. box-sizing: border-box;
  411. .table-tb-li {
  412. height: 80rpx;
  413. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  414. display: flex;
  415. justify-content: flex-start;
  416. >view {
  417. font-weight: 400;
  418. font-size: 28rpx;
  419. color: #FFFFFF;
  420. line-height: 80rpx;
  421. text-align: center;
  422. margin-right: 38rpx;
  423. width: 120rpx;
  424. overflow: hidden;
  425. text-overflow: ellipsis;
  426. white-space: nowrap;
  427. }
  428. >view:nth-of-type(1) {
  429. width: 64rpx;
  430. }
  431. >view:nth-of-type(2) {
  432. width: 168rpx;
  433. }
  434. >view:last-child {
  435. margin-right: 0;
  436. width: 168rpx;
  437. }
  438. }
  439. .sortOne {
  440. display: inline-block;
  441. width: 40rpx;
  442. height: 40rpx;
  443. padding: 4rpx;
  444. box-sizing: border-box;
  445. background: rgba(255, 0, 0, 0.2);
  446. font-weight: 400;
  447. font-size: 28rpx;
  448. color: #FF0000;
  449. line-height: 40rpx;
  450. text-align: center;
  451. border-radius: 20rpx;
  452. }
  453. .sortTow {
  454. display: inline-block;
  455. width: 40rpx;
  456. height: 40rpx;
  457. padding: 4rpx;
  458. box-sizing: border-box;
  459. background: rgba(255, 153, 0, 0.2);
  460. font-weight: 400;
  461. font-size: 28rpx;
  462. color: #FF9900;
  463. line-height: 40rpx;
  464. text-align: center;
  465. border-radius: 20rpx;
  466. }
  467. .sortThree {
  468. display: inline-block;
  469. width: 40rpx;
  470. height: 40rpx;
  471. padding: 4rpx;
  472. box-sizing: border-box;
  473. background: rgba(255, 242, 0, 0.2);
  474. font-weight: 400;
  475. font-size: 28rpx;
  476. color: #FFF200;
  477. line-height: 40rpx;
  478. text-align: center;
  479. border-radius: 20rpx;
  480. }
  481. .sortFive {
  482. display: inline-block;
  483. width: 40rpx;
  484. height: 40rpx;
  485. padding: 4rpx;
  486. box-sizing: border-box;
  487. background: rgba(1, 131, 250, 0.2);
  488. font-weight: 400;
  489. font-size: 28rpx;
  490. color: #0183FA;
  491. line-height: 40rpx;
  492. text-align: center;
  493. border-radius: 20rpx;
  494. }
  495. }
  496. }
  497. }
  498. </style>