hazardSources.vue 7.0 KB

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