hazardSources.vue 7.6 KB

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