hazardousChemicals.vue 7.8 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">{{totalNumber}} </view>
  8. </view>
  9. <view class="statistics-b">
  10. <view class="statistics-b-li">
  11. <view class="statistics-b-li-t color-A">{{totalAmount}} 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">{{newTotal}} </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">{{todayAdded}} 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.deptSortName}}</view>
  39. <view>总数{{item.totalNumber}}</view>
  40. <view>|</view>
  41. <view>今日新增{{item.newTotal}}</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. reportAppStatisticsChemicalStockSort
  60. } from '@/pages/api/index.js'
  61. export default {
  62. name: "hazardSources",
  63. components: {
  64. },
  65. data() {
  66. return {
  67. opts: {
  68. color: ['#FF0000', '#D40000', '#FF5900', '#FF9900', '#FF9900'],
  69. legend: {
  70. show: false,
  71. },
  72. padding: [15, 85, 6, 5],
  73. enableScroll: false,
  74. extra: {
  75. funnel: {
  76. activeOpacity: 0.3,
  77. activeWidth: 10,
  78. border: false,
  79. borderWidth: 2,
  80. borderColor: "#FFFFFF",
  81. fillOpacity: 1,
  82. labelAlign: "right",
  83. type: "pyramid"
  84. }
  85. }
  86. },
  87. chartData: {},
  88. totalNumber:0,
  89. totalAmount:0,
  90. newTotal:0,
  91. todayAdded:0,
  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: 'deptSortName',
  106. label: '学院单位',
  107. fixed: true,
  108. width: 80,
  109. align: 'center',
  110. },
  111. {
  112. name: 'totalNumber',
  113. label: '总数',
  114. align: 'center',
  115. },
  116. {
  117. name: 'newTotal',
  118. label: '总量',
  119. align: 'center',
  120. },
  121. {
  122. name: 'todayAdded',
  123. label: '今日新增',
  124. align: 'center',
  125. },
  126. ],
  127. dataList: [],
  128. total: 0,
  129. }
  130. },
  131. created() {
  132. },
  133. beforeMount() {
  134. },
  135. mounted() {
  136. this.reportAppStatisticsChemicalStockSort();
  137. },
  138. methods: {
  139. dateClick(index) {
  140. this.dateIndex = index;
  141. },
  142. async reportAppStatisticsChemicalStockSort() {
  143. let self = this;
  144. const {
  145. data
  146. } = await reportAppStatisticsChemicalStockSort();
  147. if (data.code == 200) {
  148. this.$set(self, 'totalNumber', data.data.totalNumber);
  149. this.$set(self, 'totalAmount', data.data.totalAmount);
  150. this.$set(self, 'newTotal', data.data.newTotal);
  151. this.$set(self, 'todayAdded', data.data.todayAdded);
  152. //列表
  153. this.dataList=data.data.chemicalStockSubs;
  154. //图表
  155. if(data.data.chemicalStockSubs[0]){
  156. let list=[];
  157. data.data.chemicalStockSubs.forEach(function(item,index){
  158. if(index<5){
  159. list.push({
  160. "name": item.deptSortName,
  161. "value": item.totalNumber,
  162. "labelText": "总量"+item.totalNumber+'kg',
  163. "textColor": "#fff",
  164. })
  165. }
  166. })
  167. let res = {
  168. series: [{
  169. data:list
  170. }]
  171. };
  172. this.chartData = JSON.parse(JSON.stringify(res));
  173. }
  174. }
  175. },
  176. },
  177. }
  178. </script>
  179. <style lang="stylus" scoped>
  180. .hazardSources {
  181. height: 100%;
  182. width: 100%;
  183. background: #363744;
  184. padding: 20rpx 30rpx 36rpx;
  185. box-sizing: border-box;
  186. .small-title {
  187. display: flex;
  188. justify-content: space-between;
  189. align-items: center;
  190. .small-title-l {
  191. font-weight: 400;
  192. font-size: 32rpx;
  193. color: #FFFFFF;
  194. line-height: 45rpx;
  195. text-align: left;
  196. margin: 28rpx 0;
  197. }
  198. .small-title-r {
  199. width: 15rpx;
  200. height: 18rpx;
  201. }
  202. }
  203. .chart {
  204. width: 690rpx;
  205. // height: 850rpx;
  206. background: #3E414F;
  207. border-radius: 20rpx 20rpx 20rpx 20rpx;
  208. padding: 24rpx 20rpx 1rpx;
  209. box-sizing: border-box;
  210. .chart-t {
  211. width: 650rpx;
  212. height: 452rpx;
  213. margin-bottom:20rpx;
  214. }
  215. .chart-b {
  216. padding: 0 30rpx;
  217. box-sizing: border-box;
  218. display: flex;
  219. justify-content: flex-start;
  220. align-items: center;
  221. height: 40rpx;
  222. margin-bottom: 36rpx;
  223. >view {
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. white-space: nowrap;
  227. }
  228. >view:nth-of-type(1) {
  229. width: 32rpx;
  230. height: 32rpx;
  231. font-weight: 400;
  232. font-size: 28rpx;
  233. line-height: 32rpx;
  234. text-align: center;
  235. margin-right: 18rpx;
  236. }
  237. >view:nth-of-type(2) {
  238. width: 246rpx;
  239. font-weight: 400;
  240. font-size: 28rpx;
  241. color: #FFFFFF;
  242. line-height: 39rpx;
  243. }
  244. >view:nth-of-type(3) {
  245. width: 132rpx;
  246. font-weight: 400;
  247. font-size: 28rpx;
  248. color: #FFFFFF;
  249. line-height: 39rpx;
  250. }
  251. >view:nth-of-type(4) {
  252. width: 2rpx;
  253. height: 20rpx;
  254. background: #D8D8D8;
  255. margin-right: 22rpx;
  256. }
  257. >view:nth-of-type(5) {
  258. width: 154rpx;
  259. font-weight: 400;
  260. font-size: 28rpx;
  261. color: #FFFFFF;
  262. line-height: 39rpx;
  263. }
  264. >img {
  265. width: 22rpx;
  266. height: 28rpx;
  267. }
  268. }
  269. .chartOne {
  270. background: rgba(255, 0, 0, 0.2);
  271. color: #FF0000;
  272. }
  273. .chartTow {
  274. background: #FFE3CC;
  275. color: #FF9900;
  276. }
  277. .chartThree {
  278. background: #FFEECC;
  279. color: #FFAA00;
  280. }
  281. .chartFive {
  282. background: #CCE6FE;
  283. color: #0183FA;
  284. }
  285. }
  286. .statistics {
  287. width: 690rpx;
  288. height: 241rpx;
  289. background: #3E414F;
  290. border-radius: 20rpx 20rpx 20rpx 20rpx;
  291. margin-top: 20rpx;
  292. .statistics-t {
  293. height: 100rpx;
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. border-bottom: 1rpx solid #52545F;
  298. padding: 0 42rpx 0 38rpx;
  299. box-sizing: border-box;
  300. .statistics-t-l {
  301. font-weight: 400;
  302. font-size: 32rpx;
  303. color: #FFFFFF;
  304. line-height: 45rpx;
  305. }
  306. .statistics-t-r {
  307. font-weight: 400;
  308. font-size: 36rpx;
  309. color: #FFFFFF;
  310. line-height: 50rpx;
  311. }
  312. }
  313. .statistics-b {
  314. display: flex;
  315. justify-content: space-between;
  316. align-items: center;
  317. .statistics-b-li {
  318. flex: 1;
  319. text-align: center;
  320. .statistics-b-li-t {
  321. font-weight: 400;
  322. font-size: 36rpx;
  323. line-height: 50rpx;
  324. margin-top: 28rpx;
  325. }
  326. .statistics-b-li-b {
  327. font-weight: 400;
  328. font-size: 28rpx;
  329. color: #FFFFFF;
  330. line-height: 39rpx;
  331. margin-top: 9rpx;
  332. }
  333. }
  334. .line {
  335. width: 2rpx;
  336. height: 30rpx;
  337. background: #D8D8D8;
  338. }
  339. .color-A {
  340. color: #FF8C00;
  341. }
  342. .color-B {
  343. color: #26C736;
  344. }
  345. .color-C {
  346. color: #FF0000;
  347. }
  348. }
  349. }
  350. .table {
  351. width: 690rpx;
  352. margin-top: 20rpx;
  353. border-radius: 20rpx 20rpx 0 0;
  354. overflow: hidden;
  355. }
  356. }
  357. </style>