hazardousChemicals.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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">1455 </view>
  8. </view>
  9. <view class="statistics-b">
  10. <view class="statistics-b-li">
  11. <view class="statistics-b-li-t color-A">1769 kg</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">14 </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">115.3 kg</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-t">
  32. <qiun-data-charts type="funnel" :opts="opts" :echartsH5="true" :chartData="chartData" />
  33. </view>
  34. <view class="chart-b" v-for="(item,index) in dataList" :key="index">
  35. <view :class="index==0?'chartOne':(index==1?'chartTow':(index==2?'chartThree':'chartFive'))">
  36. {{index+1}}
  37. </view>
  38. <view>{{item.data1}}</view>
  39. <view>总数{{item.data2}}</view>
  40. <view>|</view>
  41. <view>今日新增{{item.data3}}</view>
  42. <img src="@/pages/images/dataBoard/dataBoard-icon2.png">
  43. </view>
  44. </view>
  45. <view class="table">
  46. <uni-card>
  47. <view style="height: 200px">
  48. <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
  49. </view>
  50. </uni-card>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. config
  57. } from '@/api/request/config.js'
  58. import {
  59. } from '@/pages_basics/api/index.js'
  60. export default {
  61. name: "hazardSources",
  62. components: {
  63. },
  64. data() {
  65. return {
  66. opts: {
  67. color: ['#FF0000', '#D40000', '#FF5900', '#FF9900', '#FF9900'],
  68. legend: {
  69. show: false,
  70. },
  71. padding: [15, 85, 6, 5],
  72. enableScroll: false,
  73. extra: {
  74. funnel: {
  75. activeOpacity: 0.3,
  76. activeWidth: 10,
  77. border: false,
  78. borderWidth: 2,
  79. borderColor: "#FFFFFF",
  80. fillOpacity: 1,
  81. labelAlign: "right",
  82. type: "pyramid"
  83. }
  84. }
  85. },
  86. chartData: {},
  87. // 查询参数
  88. queryParams: {
  89. page: 1,
  90. pageSize: 10,
  91. },
  92. column: [{
  93. type: 'index',
  94. label: '排行',
  95. fixed: true,
  96. width: 60,
  97. align: 'center',
  98. },
  99. {
  100. name: 'data1',
  101. label: '学院单位',
  102. fixed: true,
  103. width: 80,
  104. align: 'center',
  105. },
  106. {
  107. name: 'data2',
  108. label: '总数',
  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. dataList: [{
  123. data1: '植物保护',
  124. data2: '102',
  125. data3: '47',
  126. data4: '22',
  127. data5: '13',
  128. },
  129. {
  130. data1: '资源环境',
  131. data2: '74',
  132. data3: '8',
  133. data4: '32',
  134. data5: '18',
  135. },
  136. {
  137. data1: '生命科学',
  138. data2: '66',
  139. data3: '28',
  140. data4: '10',
  141. data5: '8',
  142. },
  143. {
  144. data1: '园林艺术',
  145. data2: '56',
  146. data3: '23',
  147. data4: '17',
  148. data5: '5',
  149. },
  150. {
  151. data1: '化学与药物',
  152. data2: '34',
  153. data3: '12',
  154. data4: '11',
  155. data5: '21',
  156. },
  157. ],
  158. total: 0,
  159. }
  160. },
  161. created() {
  162. },
  163. beforeMount() {
  164. },
  165. mounted() {
  166. this.getServerData();
  167. },
  168. methods: {
  169. dateClick(index) {
  170. this.dateIndex = index;
  171. },
  172. getServerData() {
  173. //模拟从服务器获取数据时的延时
  174. setTimeout(() => {
  175. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  176. let res = {
  177. series: [{
  178. data: [{
  179. "name": "植物保护",
  180. "value": 50,
  181. "labelText": "总量36.65kg",
  182. "textColor": "#fff",
  183. }, {
  184. "name": "园林艺术",
  185. "value": 30,
  186. "labelText": "总量39.12kg",
  187. "textColor": "#fff",
  188. }, {
  189. "name": "生命科学",
  190. "value": 20,
  191. "labelText": "总量42.56kg",
  192. "textColor": "#fff",
  193. }, {
  194. "name": "理学院",
  195. "value": 18,
  196. "labelText": "总量56.00kg",
  197. "textColor": "#fff",
  198. }, {
  199. "name": "农学院",
  200. "value": 8,
  201. "labelText": "总量88.88kg",
  202. "textColor": "#fff",
  203. }]
  204. }]
  205. };
  206. this.chartData = JSON.parse(JSON.stringify(res));
  207. }, 500);
  208. },
  209. },
  210. }
  211. </script>
  212. <style lang="stylus" scoped>
  213. .hazardSources {
  214. height: 100%;
  215. width: 100%;
  216. background: #363744;
  217. padding: 20rpx 30rpx 36rpx;
  218. box-sizing: border-box;
  219. .small-title {
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. .small-title-l {
  224. font-weight: 400;
  225. font-size: 32rpx;
  226. color: #FFFFFF;
  227. line-height: 45rpx;
  228. text-align: left;
  229. margin: 28rpx 0;
  230. }
  231. .small-title-r {
  232. width: 15rpx;
  233. height: 18rpx;
  234. }
  235. }
  236. .chart {
  237. width: 690rpx;
  238. height: 850rpx;
  239. background: #3E414F;
  240. border-radius: 20rpx 20rpx 20rpx 20rpx;
  241. padding: 24rpx 20rpx 0;
  242. box-sizing: border-box;
  243. .chart-t {
  244. width: 650rpx;
  245. height: 452rpx;
  246. }
  247. .chart-b {
  248. padding: 0 30rpx;
  249. box-sizing: border-box;
  250. display: flex;
  251. justify-content: flex-start;
  252. align-items: center;
  253. height: 40rpx;
  254. margin-bottom: 36rpx;
  255. >view {
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. white-space: nowrap;
  259. }
  260. >view:nth-of-type(1) {
  261. width: 32rpx;
  262. height: 32rpx;
  263. font-weight: 400;
  264. font-size: 28rpx;
  265. line-height: 32rpx;
  266. text-align: center;
  267. margin-right: 18rpx;
  268. }
  269. >view:nth-of-type(2) {
  270. width: 246rpx;
  271. font-weight: 400;
  272. font-size: 28rpx;
  273. color: #FFFFFF;
  274. line-height: 39rpx;
  275. }
  276. >view:nth-of-type(3) {
  277. width: 132rpx;
  278. font-weight: 400;
  279. font-size: 28rpx;
  280. color: #FFFFFF;
  281. line-height: 39rpx;
  282. }
  283. >view:nth-of-type(4) {
  284. width: 2rpx;
  285. height: 20rpx;
  286. background: #D8D8D8;
  287. margin-right: 22rpx;
  288. }
  289. >view:nth-of-type(5) {
  290. width: 154rpx;
  291. font-weight: 400;
  292. font-size: 28rpx;
  293. color: #FFFFFF;
  294. line-height: 39rpx;
  295. }
  296. >img {
  297. width: 22rpx;
  298. height: 28rpx;
  299. }
  300. }
  301. .chartOne {
  302. background: rgba(255, 0, 0, 0.2);
  303. color: #FF0000;
  304. }
  305. .chartTow {
  306. background: #FFE3CC;
  307. color: #FF9900;
  308. }
  309. .chartThree {
  310. background: #FFEECC;
  311. color: #FFAA00;
  312. }
  313. .chartFive {
  314. background: #CCE6FE;
  315. color: #0183FA;
  316. }
  317. }
  318. .statistics {
  319. width: 690rpx;
  320. height: 241rpx;
  321. background: #3E414F;
  322. border-radius: 20rpx 20rpx 20rpx 20rpx;
  323. margin-top: 20rpx;
  324. .statistics-t {
  325. height: 100rpx;
  326. display: flex;
  327. justify-content: space-between;
  328. align-items: center;
  329. border-bottom: 1rpx solid #52545F;
  330. padding: 0 42rpx 0 38rpx;
  331. box-sizing: border-box;
  332. .statistics-t-l {
  333. font-weight: 400;
  334. font-size: 32rpx;
  335. color: #FFFFFF;
  336. line-height: 45rpx;
  337. }
  338. .statistics-t-r {
  339. font-weight: 400;
  340. font-size: 36rpx;
  341. color: #FFFFFF;
  342. line-height: 50rpx;
  343. }
  344. }
  345. .statistics-b {
  346. display: flex;
  347. justify-content: space-between;
  348. align-items: center;
  349. .statistics-b-li {
  350. flex: 1;
  351. text-align: center;
  352. .statistics-b-li-t {
  353. font-weight: 400;
  354. font-size: 36rpx;
  355. line-height: 50rpx;
  356. margin-top: 28rpx;
  357. }
  358. .statistics-b-li-b {
  359. font-weight: 400;
  360. font-size: 28rpx;
  361. color: #FFFFFF;
  362. line-height: 39rpx;
  363. margin-top: 9rpx;
  364. }
  365. }
  366. .line {
  367. width: 2rpx;
  368. height: 30rpx;
  369. background: #D8D8D8;
  370. }
  371. .color-A {
  372. color: #FF8C00;
  373. }
  374. .color-B {
  375. color: #26C736;
  376. }
  377. .color-C {
  378. color: #FF0000;
  379. }
  380. }
  381. }
  382. .table {
  383. width: 690rpx;
  384. margin-top: 20rpx;
  385. border-radius: 20rpx 20rpx 0 0;
  386. overflow: hidden;
  387. }
  388. }
  389. </style>