hazardousChemicals.vue 11 KB

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