123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <view>
- <view class="top">
- <image src="./icon/top.jpg" mode=""></image>
- </view>
- <view class="content">
- <view class="charts-box" v-if="chartData.series[0].data[0].value">
- <qiun-data-charts type="ring" :opts="ring_1" :chartData="chartData" background="none" />
- </view>
- <view class="list">
- <view class="item" v-for="(item,index) in list" :key="index">
- <view class="title" :style="{borderLeftColor: item.color}">{{item.cocalminename}}</view>
- <view class="inner">
- <view class="box" v-for="(item_2,index_2) in item.data">
- <view class="name">{{item_2.title}}</view>
- <view class="num">{{item_2.num}}个</view>
- </view>
- </view>
- <view class="right_arrow" @click="go_personnel_orientation(item.mine_code)">
- <view class="text">查看详情</view>
- <view class="icon"></view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- chartData: {
- categories: [],
- "series": [{
- "data": [{
- "name": "全矿下井人数",
- "value": 0
- },
- {
- "name": "矿级领导",
- "value": 0
- },
- {
- "name": "公司领导",
- "value": 0
- }
- ]
- }]
- },
- ring_1: {
- "dataLabel": false,
- "legend": {
- "position": "bottom",
- },
- "title": {
- "name": "下矿总人数",
- "color": "#555",
- },
- "subtitle": {
- "name": "3515人",
- "color": "#333",
- },
- "extra": {
- "ring": {
- "centerColor": "#F1F1F1",
- "border": false,
- },
- }
- },
- list: []
- };
- },
- onLoad() {
- this.get_data()
- },
- methods: {
- get_data() {
- this.$p_api.personnel_mineall_total({
- mine: "all"
- }).then((res) => {
- console.log(res.data.data)
- this.ring_1.subtitle.name = res.data.data.total + res.data.data.mine_leader_total + res.data
- .data.company_leader_total
- this.chartData.series[0].data[0].value = res.data.data.total
- this.chartData.series[0].data[1].value = res.data.data.mine_leader_total
- this.chartData.series[0].data[2].value = res.data.data.company_leader_total
- this.list = res.data.data.list
- })
- },
- //人员定位
- go_personnel_orientation(mine_code) {
- uni.navigateTo({
- url: "../../production/personnel_orientation/personnel_orientation?mine=" + mine_code
- })
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F1F1F1;
- }
- .top {
- image {
- width: 750rpx;
- height: 360rpx;
- }
- }
- /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
- .charts-box {
- width: 100%;
- height: 300px;
- }
- .content {
- width: 750rpx;
- box-sizing: border-box;
- padding: 25rpx;
- }
- .list {
- .item {
- width: 700rpx;
- background-color: #FFFFFF;
- border-radius: 8px;
- overflow: hidden;
- margin-bottom: 25rpx;
- .title {
- line-height: 80rpx;
- padding-left: 20rpx;
- border-left: 8rpx solid #83DCFC;
- border-bottom: 1px solid #eee;
- }
- .inner {
- display: flex;
- justify-content: space-around;
- .box {
- padding: 30rpx 0;
- color: #999;
- text-align: center;
- .name {
- line-height: 60rpx;
- }
- .num {
- color: #49C27D;
- }
- }
- .box:nth-child(2) {
- .num {
- color: #B85A56;
- }
- }
- .box:nth-child(3) {
- .num {
- color: #34383D;
- }
- }
- }
- .right_arrow {
- width: 160rpx;
- height: 60rpx;
- margin-left: 520rpx;
- display: flex;
- align-items: center;
- .text {
- font-size: 28rpx;
- color: #999999;
- margin-right: 8rpx;
- }
- .icon {
- width: 30rpx;
- height: 30rpx;
- background-image: url(./icon/right.png);
- background-size: cover;
- background-repeat: no-repeat;
- }
- }
- }
- }
- </style>
|