hazardSources.vue 7.4 KB

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