hazardSources.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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
  47. :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
  48. </view>
  49. <view>{{item.data1}}</view>
  50. <view>{{item.data2}}</view>
  51. <view>{{item.data3}}</view>
  52. <view>{{item.data4}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. config
  61. } from '@/api/request/config.js'
  62. import {
  63. } from '@/pages_basics/api/index.js'
  64. export default {
  65. name: "hazardSources",
  66. components: {
  67. },
  68. data() {
  69. return {
  70. opts: {
  71. color: ["#FF8C00", "#0183FA", ],
  72. padding: [2, 20, 0, 0],
  73. enableScroll: false,
  74. legend: {
  75. position: 'top',
  76. legendShape: 'square',
  77. fontColor: '#fff',
  78. },
  79. xAxis: {
  80. disabled: true,
  81. axisLine: false,
  82. disableGrid: true,
  83. fontColor: '#fff',
  84. },
  85. yAxis: {},
  86. extra: {
  87. bar: {
  88. type: "stack",
  89. width: 30,
  90. meterBorde: 1,
  91. meterFillColor: "#FFFFFF",
  92. activeBgColor: "#000000",
  93. activeBgOpacity: 0.08,
  94. categoryGap: 2
  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. categories: ["化学与药物", "植物保护", "资源环境", "理学院", "园林艺术"],
  160. series: [{
  161. name: "危险品",
  162. textColor: "#FFFFFF",
  163. data: [35, 36, 31, 33, 13]
  164. },
  165. {
  166. name: "冷热设备与特种设备",
  167. textColor: "#FFFFFF",
  168. data: [18, 27, 21, 24, 6]
  169. }
  170. ]
  171. };
  172. this.chartData = JSON.parse(JSON.stringify(res));
  173. }, 500);
  174. },
  175. },
  176. }
  177. </script>
  178. <style lang="stylus" scoped>
  179. .hazardSources {
  180. height: 100%;
  181. width: 100%;
  182. background: #363744;
  183. padding: 20rpx 30rpx 0;
  184. box-sizing: border-box;
  185. .small-title {
  186. display: flex;
  187. justify-content: space-between;
  188. .small-title-l {
  189. font-weight: 400;
  190. font-size: 32rpx;
  191. color: #FFFFFF;
  192. line-height: 45rpx;
  193. text-align: left;
  194. margin: 28rpx 0;
  195. }
  196. .small-title-r {
  197. width: 15rpx;
  198. height: 18rpx;
  199. }
  200. }
  201. .chart {
  202. width: 690rpx;
  203. height: 400rpx;
  204. background: #3E414F;
  205. border-radius: 20rpx 20rpx 20rpx 20rpx;
  206. padding: 34rpx 30rpx 26rpx;
  207. box-sizing: border-box;
  208. .chart-b {
  209. width: 630rpx;
  210. height: 344rpx;
  211. }
  212. }
  213. .statistics {
  214. width: 690rpx;
  215. height: 241rpx;
  216. background: #3E414F;
  217. border-radius: 20rpx 20rpx 20rpx 20rpx;
  218. margin-top: 20rpx;
  219. .statistics-t {
  220. height: 100rpx;
  221. display: flex;
  222. justify-content: space-between;
  223. align-items: center;
  224. border-bottom: 1rpx solid #52545F;
  225. padding: 0 42rpx 0 38rpx;
  226. box-sizing: border-box;
  227. .statistics-t-l {
  228. font-weight: 400;
  229. font-size: 32rpx;
  230. color: #FFFFFF;
  231. line-height: 45rpx;
  232. }
  233. .statistics-t-r {
  234. font-weight: 400;
  235. font-size: 36rpx;
  236. color: #FFFFFF;
  237. line-height: 50rpx;
  238. }
  239. }
  240. .statistics-b {
  241. display: flex;
  242. justify-content: space-between;
  243. align-items: center;
  244. .statistics-b-li {
  245. flex: 1;
  246. text-align: center;
  247. .statistics-b-li-t {
  248. font-weight: 400;
  249. font-size: 36rpx;
  250. line-height: 50rpx;
  251. margin-top: 28rpx;
  252. }
  253. .statistics-b-li-b {
  254. font-weight: 400;
  255. font-size: 28rpx;
  256. color: #FFFFFF;
  257. line-height: 39rpx;
  258. margin-top: 9rpx;
  259. }
  260. }
  261. .line {
  262. width: 2rpx;
  263. height: 30rpx;
  264. background: #D8D8D8;
  265. }
  266. .color-A {
  267. color: #FF8C00;
  268. }
  269. .color-B {
  270. color: #26C736;
  271. }
  272. .color-C {
  273. color: #FF0000;
  274. }
  275. }
  276. }
  277. .table {
  278. width: 720rpx;
  279. margin-top: 20rpx;
  280. .table-border {
  281. overflow: auto;
  282. }
  283. .table-th {
  284. width: 860rpx;
  285. height: 80rpx;
  286. background: rgba(162, 162, 162, 0.2);
  287. border-radius: 20rpx 20rpx 0rpx 0rpx;
  288. display: flex;
  289. justify-content: flex-start;
  290. padding: 0 30rpx;
  291. box-sizing: border-box;
  292. >view {
  293. font-weight: 400;
  294. font-size: 30rpx;
  295. color: #FFFFFF;
  296. line-height: 80rpx;
  297. text-align: center;
  298. margin-right: 38rpx;
  299. width: 120rpx;
  300. overflow: hidden;
  301. text-overflow: ellipsis;
  302. white-space: nowrap;
  303. }
  304. >view:nth-of-type(1) {
  305. width: 64rpx;
  306. }
  307. >view:nth-of-type(2) {
  308. width: 168rpx;
  309. }
  310. >view:last-child {
  311. margin-right: 0;
  312. width: 168rpx;
  313. }
  314. }
  315. .table-tb {
  316. width: 860rpx;
  317. height: 80rpx;
  318. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  319. display: flex;
  320. justify-content: flex-start;
  321. align-items: center;
  322. background: #3E414F;
  323. padding: 0 30rpx;
  324. box-sizing: border-box;
  325. >view {
  326. font-weight: 400;
  327. font-size: 28rpx;
  328. color: #FFFFFF;
  329. line-height: 80rpx;
  330. text-align: center;
  331. margin-right: 38rpx;
  332. width: 120rpx;
  333. overflow: hidden;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. }
  337. >view:nth-of-type(1) {
  338. width: 64rpx;
  339. }
  340. >view:nth-of-type(2) {
  341. width: 168rpx;
  342. }
  343. >view:last-child {
  344. margin-right: 0;
  345. width: 168rpx;
  346. }
  347. }
  348. .sortOne {
  349. display: inline-block;
  350. width: 40rpx;
  351. height: 40rpx;
  352. padding: 4rpx;
  353. box-sizing: border-box;
  354. background: rgba(255, 0, 0, 0.2);
  355. font-weight: 400;
  356. font-size: 28rpx;
  357. color: #FF0000;
  358. line-height: 40rpx;
  359. text-align: center;
  360. border-radius: 20rpx;
  361. }
  362. .sortTow {
  363. display: inline-block;
  364. width: 40rpx;
  365. height: 40rpx;
  366. padding: 4rpx;
  367. box-sizing: border-box;
  368. background: rgba(255, 153, 0, 0.2);
  369. font-weight: 400;
  370. font-size: 28rpx;
  371. color: #FF9900;
  372. line-height: 40rpx;
  373. text-align: center;
  374. border-radius: 20rpx;
  375. }
  376. .sortThree {
  377. display: inline-block;
  378. width: 40rpx;
  379. height: 40rpx;
  380. padding: 4rpx;
  381. box-sizing: border-box;
  382. background: rgba(255, 242, 0, 0.2);
  383. font-weight: 400;
  384. font-size: 28rpx;
  385. color: #FFF200;
  386. line-height: 40rpx;
  387. text-align: center;
  388. border-radius: 20rpx;
  389. }
  390. .sortFive {
  391. display: inline-block;
  392. width: 40rpx;
  393. height: 40rpx;
  394. padding: 4rpx;
  395. box-sizing: border-box;
  396. background: rgba(1, 131, 250, 0.2);
  397. font-weight: 400;
  398. font-size: 28rpx;
  399. color: #0183FA;
  400. line-height: 40rpx;
  401. text-align: center;
  402. border-radius: 20rpx;
  403. }
  404. }
  405. }
  406. </style>