hazardSources.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  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">739 </view>
  8. </view>
  9. <view class="statistics-b">
  10. <view class="statistics-b-li">
  11. <view class="statistics-b-li-t color-A">2</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">30</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">200</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-b">
  32. <qiun-data-charts type="bar" :opts="opts" :echartsH5="true" :chartData="chartData" />
  33. </view>
  34. </view>
  35. <view class="table">
  36. <view class="table-border">
  37. <view class="table-th">
  38. <view>排行</view>
  39. <view>学院单位</view>
  40. <view>总数</view>
  41. <view>危化品数</view>
  42. <view>冷热设备数</view>
  43. </view>
  44. <view class="table-tb" v-for="(item,index) in dataList" :key="index">
  45. <view>
  46. <text :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
  47. </view>
  48. <view>{{item.data1}}</view>
  49. <view>{{item.data2}}</view>
  50. <view>{{item.data3}}</view>
  51. <view>{{item.data4}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. config
  60. } from '@/api/request/config.js'
  61. import {
  62. } from '@/pages_basics/api/index.js'
  63. export default {
  64. name: "hazardSources",
  65. components: {
  66. },
  67. data() {
  68. return {
  69. opts: {
  70. color: ["#FF8C00", "#0183FA", ],
  71. padding: [2, 20, 0, 0],
  72. enableScroll: false,
  73. legend: {
  74. position: 'top',
  75. legendShape: 'square',
  76. },
  77. xAxis: {
  78. disabled: true,
  79. axisLine: false,
  80. disableGrid: true,
  81. },
  82. yAxis: {},
  83. extra: {
  84. bar: {
  85. type: "stack",
  86. width: 30,
  87. meterBorde: 1,
  88. meterFillColor: "#FFFFFF",
  89. activeBgColor: "#000000",
  90. activeBgOpacity: 0.08,
  91. categoryGap: 2
  92. }
  93. }
  94. },
  95. chartData: {},
  96. // 查询参数
  97. queryParams: {
  98. page: 1,
  99. pageSize: 10,
  100. },
  101. dataList: [{
  102. data1: '植物保护',
  103. data2: '499',
  104. data3: '47',
  105. data4: '220',
  106. data5: '137',
  107. },
  108. {
  109. data1: '资源环境',
  110. data2: '199',
  111. data3: '7',
  112. data4: '120',
  113. data5: '37',
  114. },
  115. {
  116. data1: '生命科学',
  117. data2: '299',
  118. data3: '71',
  119. data4: '10',
  120. data5: '37',
  121. },
  122. {
  123. data1: '资源环境',
  124. data2: '199',
  125. data3: '7',
  126. data4: '120',
  127. data5: '37',
  128. },
  129. {
  130. data1: '生命科学',
  131. data2: '299',
  132. data3: '71',
  133. data4: '10',
  134. data5: '37',
  135. },
  136. ],
  137. total: 0,
  138. }
  139. },
  140. created() {
  141. },
  142. beforeMount() {
  143. },
  144. mounted() {
  145. this.getServerData();
  146. },
  147. methods: {
  148. dateClick(index) {
  149. this.dateIndex = index;
  150. },
  151. getServerData() {
  152. //模拟从服务器获取数据时的延时
  153. setTimeout(() => {
  154. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  155. let res = {
  156. categories: ["化学与药物", "植物保护", "资源环境", "理学院", "园林艺术"],
  157. series: [{
  158. name: "危险品",
  159. textColor: "#FFFFFF",
  160. data: [35, 36, 31, 33, 13]
  161. },
  162. {
  163. name: "冷热设备与特种设备",
  164. textColor: "#FFFFFF",
  165. data: [18, 27, 21, 24, 6]
  166. }
  167. ]
  168. };
  169. this.chartData = JSON.parse(JSON.stringify(res));
  170. }, 500);
  171. },
  172. },
  173. }
  174. </script>
  175. <style lang="stylus" scoped>
  176. .hazardSources {
  177. height: 100%;
  178. width: 100%;
  179. background: #363744;
  180. padding: 20rpx 30rpx 0;
  181. box-sizing: border-box;
  182. .small-title {
  183. display: flex;
  184. justify-content: space-between;
  185. .small-title-l {
  186. font-weight: 400;
  187. font-size: 32rpx;
  188. color: #FFFFFF;
  189. line-height: 45rpx;
  190. text-align: left;
  191. margin: 28rpx 0;
  192. }
  193. .small-title-r {
  194. width: 15rpx;
  195. height: 18rpx;
  196. }
  197. }
  198. .chart {
  199. width: 690rpx;
  200. height: 400rpx;
  201. background: #3E414F;
  202. border-radius: 20rpx 20rpx 20rpx 20rpx;
  203. padding: 34rpx 30rpx 26rpx;
  204. box-sizing: border-box;
  205. .chart-b {
  206. width: 630rpx;
  207. height: 344rpx;
  208. }
  209. }
  210. .statistics {
  211. width: 690rpx;
  212. height: 241rpx;
  213. background: #3E414F;
  214. border-radius: 20rpx 20rpx 20rpx 20rpx;
  215. margin-top: 20rpx;
  216. .statistics-t {
  217. height: 100rpx;
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. border-bottom: 1rpx solid #52545F;
  222. padding: 0 42rpx 0 38rpx;
  223. box-sizing: border-box;
  224. .statistics-t-l {
  225. font-weight: 400;
  226. font-size: 32rpx;
  227. color: #FFFFFF;
  228. line-height: 45rpx;
  229. }
  230. .statistics-t-r {
  231. font-weight: 400;
  232. font-size: 36rpx;
  233. color: #FFFFFF;
  234. line-height: 50rpx;
  235. }
  236. }
  237. .statistics-b {
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. .statistics-b-li {
  242. flex: 1;
  243. text-align: center;
  244. .statistics-b-li-t {
  245. font-weight: 400;
  246. font-size: 36rpx;
  247. line-height: 50rpx;
  248. margin-top: 28rpx;
  249. }
  250. .statistics-b-li-b {
  251. font-weight: 400;
  252. font-size: 28rpx;
  253. color: #FFFFFF;
  254. line-height: 39rpx;
  255. margin-top: 9rpx;
  256. }
  257. }
  258. .line {
  259. width: 2rpx;
  260. height: 30rpx;
  261. background: #D8D8D8;
  262. }
  263. .color-A {
  264. color: #FF8C00;
  265. }
  266. .color-B {
  267. color: #26C736;
  268. }
  269. .color-C {
  270. color: #FF0000;
  271. }
  272. }
  273. }
  274. .table {
  275. width: 720rpx;
  276. margin-top: 20rpx;
  277. .table-border {
  278. overflow: auto;
  279. }
  280. .table-th {
  281. width: 860rpx;
  282. height: 80rpx;
  283. background: rgba(162, 162, 162, 0.2);
  284. border-radius: 20rpx 20rpx 0rpx 0rpx;
  285. display: flex;
  286. justify-content: flex-start;
  287. padding: 0 30rpx;
  288. box-sizing: border-box;
  289. >view {
  290. font-weight: 400;
  291. font-size: 30rpx;
  292. color: #FFFFFF;
  293. line-height: 80rpx;
  294. text-align: center;
  295. margin-right: 38rpx;
  296. width: 120rpx;
  297. overflow: hidden;
  298. text-overflow: ellipsis;
  299. white-space: nowrap;
  300. }
  301. >view:nth-of-type(1) {
  302. width: 64rpx;
  303. }
  304. >view:nth-of-type(2) {
  305. width: 168rpx;
  306. }
  307. >view:last-child {
  308. margin-right: 0;
  309. width: 168rpx;
  310. }
  311. }
  312. .table-tb {
  313. width: 860rpx;
  314. height: 80rpx;
  315. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  316. display: flex;
  317. justify-content: flex-start;
  318. align-items: center;
  319. background: #3E414F;
  320. padding: 0 30rpx;
  321. box-sizing: border-box;
  322. >view {
  323. font-weight: 400;
  324. font-size: 28rpx;
  325. color: #FFFFFF;
  326. line-height: 80rpx;
  327. text-align: center;
  328. margin-right: 38rpx;
  329. width: 120rpx;
  330. overflow: hidden;
  331. text-overflow: ellipsis;
  332. white-space: nowrap;
  333. }
  334. >view:nth-of-type(1) {
  335. width: 64rpx;
  336. }
  337. >view:nth-of-type(2) {
  338. width: 168rpx;
  339. }
  340. >view:last-child {
  341. margin-right: 0;
  342. width: 168rpx;
  343. }
  344. }
  345. .sortOne {
  346. display: inline-block;
  347. width: 40rpx;
  348. height: 40rpx;
  349. padding: 4rpx;
  350. box-sizing: border-box;
  351. background: rgba(255, 0, 0, 0.2);
  352. font-weight: 400;
  353. font-size: 28rpx;
  354. color: #FF0000;
  355. line-height: 40rpx;
  356. text-align: center;
  357. border-radius: 20rpx;
  358. }
  359. .sortTow {
  360. display: inline-block;
  361. width: 40rpx;
  362. height: 40rpx;
  363. padding: 4rpx;
  364. box-sizing: border-box;
  365. background: rgba(255, 153, 0, 0.2);
  366. font-weight: 400;
  367. font-size: 28rpx;
  368. color: #FF9900;
  369. line-height: 40rpx;
  370. text-align: center;
  371. border-radius: 20rpx;
  372. }
  373. .sortThree {
  374. display: inline-block;
  375. width: 40rpx;
  376. height: 40rpx;
  377. padding: 4rpx;
  378. box-sizing: border-box;
  379. background: rgba(255, 242, 0, 0.2);
  380. font-weight: 400;
  381. font-size: 28rpx;
  382. color: #FFF200;
  383. line-height: 40rpx;
  384. text-align: center;
  385. border-radius: 20rpx;
  386. }
  387. .sortFive {
  388. display: inline-block;
  389. width: 40rpx;
  390. height: 40rpx;
  391. padding: 4rpx;
  392. box-sizing: border-box;
  393. background: rgba(1, 131, 250, 0.2);
  394. font-weight: 400;
  395. font-size: 28rpx;
  396. color: #0183FA;
  397. line-height: 40rpx;
  398. text-align: center;
  399. border-radius: 20rpx;
  400. }
  401. }
  402. }
  403. </style>