hazardousChemicals.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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 0;
  209. box-sizing: border-box;
  210. .chart-t {
  211. width: 650rpx;
  212. height: 452rpx;
  213. }
  214. .chart-b {
  215. padding: 0 30rpx;
  216. box-sizing: border-box;
  217. display: flex;
  218. justify-content: flex-start;
  219. align-items: center;
  220. height: 40rpx;
  221. margin-bottom: 36rpx;
  222. >view {
  223. overflow: hidden;
  224. text-overflow: ellipsis;
  225. white-space: nowrap;
  226. }
  227. >view:nth-of-type(1) {
  228. width: 32rpx;
  229. height: 32rpx;
  230. font-weight: 400;
  231. font-size: 28rpx;
  232. line-height: 32rpx;
  233. text-align: center;
  234. margin-right: 18rpx;
  235. }
  236. >view:nth-of-type(2) {
  237. width: 246rpx;
  238. font-weight: 400;
  239. font-size: 28rpx;
  240. color: #FFFFFF;
  241. line-height: 39rpx;
  242. }
  243. >view:nth-of-type(3) {
  244. width: 132rpx;
  245. font-weight: 400;
  246. font-size: 28rpx;
  247. color: #FFFFFF;
  248. line-height: 39rpx;
  249. }
  250. >view:nth-of-type(4) {
  251. width: 2rpx;
  252. height: 20rpx;
  253. background: #D8D8D8;
  254. margin-right: 22rpx;
  255. }
  256. >view:nth-of-type(5) {
  257. width: 154rpx;
  258. font-weight: 400;
  259. font-size: 28rpx;
  260. color: #FFFFFF;
  261. line-height: 39rpx;
  262. }
  263. >img {
  264. width: 22rpx;
  265. height: 28rpx;
  266. }
  267. }
  268. .chartOne {
  269. background: rgba(255, 0, 0, 0.2);
  270. color: #FF0000;
  271. }
  272. .chartTow {
  273. background: #FFE3CC;
  274. color: #FF9900;
  275. }
  276. .chartThree {
  277. background: #FFEECC;
  278. color: #FFAA00;
  279. }
  280. .chartFive {
  281. background: #CCE6FE;
  282. color: #0183FA;
  283. }
  284. }
  285. .statistics {
  286. width: 690rpx;
  287. height: 241rpx;
  288. background: #3E414F;
  289. border-radius: 20rpx 20rpx 20rpx 20rpx;
  290. margin-top: 20rpx;
  291. .statistics-t {
  292. height: 100rpx;
  293. display: flex;
  294. justify-content: space-between;
  295. align-items: center;
  296. border-bottom: 1rpx solid #52545F;
  297. padding: 0 42rpx 0 38rpx;
  298. box-sizing: border-box;
  299. .statistics-t-l {
  300. font-weight: 400;
  301. font-size: 32rpx;
  302. color: #FFFFFF;
  303. line-height: 45rpx;
  304. }
  305. .statistics-t-r {
  306. font-weight: 400;
  307. font-size: 36rpx;
  308. color: #FFFFFF;
  309. line-height: 50rpx;
  310. }
  311. }
  312. .statistics-b {
  313. display: flex;
  314. justify-content: space-between;
  315. align-items: center;
  316. .statistics-b-li {
  317. flex: 1;
  318. text-align: center;
  319. .statistics-b-li-t {
  320. font-weight: 400;
  321. font-size: 36rpx;
  322. line-height: 50rpx;
  323. margin-top: 28rpx;
  324. }
  325. .statistics-b-li-b {
  326. font-weight: 400;
  327. font-size: 28rpx;
  328. color: #FFFFFF;
  329. line-height: 39rpx;
  330. margin-top: 9rpx;
  331. }
  332. }
  333. .line {
  334. width: 2rpx;
  335. height: 30rpx;
  336. background: #D8D8D8;
  337. }
  338. .color-A {
  339. color: #FF8C00;
  340. }
  341. .color-B {
  342. color: #26C736;
  343. }
  344. .color-C {
  345. color: #FF0000;
  346. }
  347. }
  348. }
  349. .table {
  350. width: 690rpx;
  351. margin-top: 20rpx;
  352. border-radius: 20rpx 20rpx 0 0;
  353. overflow: hidden;
  354. }
  355. }
  356. </style>