hazardSources.vue 7.6 KB

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