personnel_orientation.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <view class="top">
  4. <image src="./icon/top.jpg" mode=""></image>
  5. </view>
  6. <view class="content">
  7. <view class="section">
  8. <view class="title">当前井下人数</view>
  9. <view class="charts-box" v-if="chartData.series[0].data[0].value">
  10. <qiun-data-charts type="ring" :opts="ring_1" :chartData="chartData" background="none" />
  11. </view>
  12. </view>
  13. <!-- 下井趋势 -->
  14. <personnel-orientation-population-trend mine="all"></personnel-orientation-population-trend>
  15. <view class="list">
  16. <view class="item" v-for="(item,index) in list" :key="index"
  17. @click="go_personnel_orientation(item.mine_code)">
  18. <view class="title" :style="{borderLeftColor: item.color}">{{item.cocalminename}}</view>
  19. <view class="inner">
  20. <view class="box" v-for="(item_2,index_2) in item.data">
  21. <view class="name">{{item_2.title}}</view>
  22. <view class="num">{{item_2.num}}人</view>
  23. </view>
  24. </view>
  25. <!-- <view class="right_arrow">
  26. <view class="text">查看详情</view>
  27. <view class="icon"></view>
  28. </view> -->
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. chartData: {
  39. categories: [],
  40. "series": [{
  41. "data": [{
  42. "name": "全矿下井人数",
  43. "value": 0
  44. },
  45. {
  46. "name": "矿级领导",
  47. "value": 0
  48. },
  49. {
  50. "name": "公司领导",
  51. "value": 0
  52. }
  53. ]
  54. }]
  55. },
  56. ring_1: {
  57. "dataLabel": false,
  58. "legend": {
  59. "position": "bottom",
  60. },
  61. "title": {
  62. "name": "当前井下人数",
  63. "color": "#555",
  64. },
  65. "subtitle": {
  66. "name": "3515人",
  67. "color": "#333",
  68. },
  69. "extra": {
  70. "ring": {
  71. "centerColor": "#FFF",
  72. "border": false,
  73. },
  74. }
  75. },
  76. list: []
  77. };
  78. },
  79. onLoad() {
  80. this.get_data()
  81. },
  82. methods: {
  83. get_data() {
  84. this.$p_api.personnel_mineall_total({
  85. mine: "all"
  86. }).then((res) => {
  87. console.log(res.data.data)
  88. this.ring_1.subtitle.name = res.data.data.total + res.data.data.mine_leader_total + res.data
  89. .data.company_leader_total + '人'
  90. this.chartData.series[0].data[0].value = res.data.data.total
  91. this.chartData.series[0].data[1].value = res.data.data.mine_leader_total
  92. this.chartData.series[0].data[2].value = res.data.data.company_leader_total
  93. this.list = res.data.data.list
  94. })
  95. },
  96. //人员定位
  97. go_personnel_orientation(mine_code) {
  98. uni.navigateTo({
  99. url: "../../production/personnel_orientation/personnel_orientation?mine=" + mine_code
  100. })
  101. },
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. page {
  107. background-color: #f2faf7;
  108. }
  109. .top {
  110. image {
  111. width: 750rpx;
  112. height: 360rpx;
  113. }
  114. }
  115. /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
  116. .charts-box {
  117. width: 350px;
  118. height: 300px;
  119. }
  120. .content {
  121. width: 750rpx;
  122. box-sizing: border-box;
  123. padding: 25rpx;
  124. }
  125. .section {
  126. width: 700rpx;
  127. background-color: #FFFFFF;
  128. border-radius: 8px;
  129. overflow: hidden;
  130. padding-bottom: 30rpx;
  131. margin-bottom: 25rpx;
  132. .title {
  133. padding: 40rpx 20rpx 0;
  134. font-weight: 700;
  135. }
  136. }
  137. .list {
  138. .item {
  139. width: 700rpx;
  140. background-color: #FFFFFF;
  141. border-radius: 8px;
  142. overflow: hidden;
  143. margin-bottom: 25rpx;
  144. .title {
  145. line-height: 80rpx;
  146. padding-left: 20rpx;
  147. border-left: 8rpx solid #83DCFC;
  148. border-bottom: 1px solid #eee;
  149. }
  150. .inner {
  151. display: flex;
  152. justify-content: space-around;
  153. .box {
  154. padding: 30rpx 0;
  155. color: #999;
  156. text-align: center;
  157. .name {
  158. line-height: 60rpx;
  159. }
  160. .num {
  161. color: #49C27D;
  162. }
  163. }
  164. .box:nth-child(2) {
  165. .num {
  166. color: #B85A56;
  167. }
  168. }
  169. .box:nth-child(3) {
  170. .num {
  171. color: #34383D;
  172. }
  173. }
  174. }
  175. .right_arrow {
  176. width: 160rpx;
  177. height: 60rpx;
  178. margin-left: 520rpx;
  179. display: flex;
  180. align-items: center;
  181. .text {
  182. font-size: 28rpx;
  183. color: #999999;
  184. margin-right: 8rpx;
  185. }
  186. .icon {
  187. width: 30rpx;
  188. height: 30rpx;
  189. background-image: url(./icon/right.png);
  190. background-size: cover;
  191. background-repeat: no-repeat;
  192. }
  193. }
  194. }
  195. }
  196. </style>