personnel_orientation.vue 3.8 KB

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