Merge branch 'main' of http://192.168.0.56:3000/hywen/YNUtdPlatform
This commit is contained in:
commit
1c1f3303a2
|
|
@ -0,0 +1,88 @@
|
|||
<template>
|
||||
<view class="charts-container">
|
||||
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" @getIndex="handleChartClick" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chartData: {},
|
||||
opts: {
|
||||
color: ['#fc8483', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
|
||||
padding: undefined,
|
||||
backgroundColor: '#fc8483',
|
||||
title: {
|
||||
name: '',
|
||||
fontSize: 0,
|
||||
color: ''
|
||||
},
|
||||
subtitle: {
|
||||
name: '',
|
||||
fontSize: 0,
|
||||
color: ''
|
||||
},
|
||||
extra: {
|
||||
arcbar: {
|
||||
type: 'default',
|
||||
width: 14,
|
||||
backgroundColor: '#E9E9E9',
|
||||
startAngle: 0.25,
|
||||
endAngle: 0.75,
|
||||
gap: 2,
|
||||
direction: 'ccw',
|
||||
linearType: 'custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getServerData()
|
||||
},
|
||||
methods: {
|
||||
getServerData() {
|
||||
getHomePageListApi().then(res => {
|
||||
setTimeout(() => {
|
||||
const { workerMsgBean } = res.data
|
||||
|
||||
const maleNum = workerMsgBean.maleNum
|
||||
const femaleNum = workerMsgBean.femaleNum
|
||||
const dataGirl = femaleNum / (maleNum + femaleNum)
|
||||
let data = {
|
||||
series: [
|
||||
{
|
||||
color: '#fc8483',
|
||||
backgroundColor: '#fc8483',
|
||||
data: dataGirl
|
||||
}
|
||||
]
|
||||
}
|
||||
this.chartData = JSON.parse(JSON.stringify(data))
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
handleChartClick(index) {
|
||||
// const { currentIndex } = index // 获取当前点击的图表索引
|
||||
// const chartsData = this.chartData.series[0].data
|
||||
// const currenRows = chartsData[currentIndex]
|
||||
// console.log('currenRows选中的工程类型', currenRows.name)
|
||||
// // 电压等级信息
|
||||
// const voltageLevel = {
|
||||
// currentIndex,
|
||||
// name: currenRows.name
|
||||
// }
|
||||
// uni.navigateTo({ url: `/pages/realName/index/pages/project?voltageLevel=${JSON.stringify(voltageLevel)}` })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.charts-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<view class="charts-container">
|
||||
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" @getIndex="handleChartClick" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chartData: {},
|
||||
opts: {
|
||||
color: ['#67cde6', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
|
||||
backgroundColor: '#67cde6',
|
||||
padding: undefined,
|
||||
title: {
|
||||
name: '',
|
||||
fontSize: 0,
|
||||
color: '#2fc25b'
|
||||
},
|
||||
subtitle: {
|
||||
name: '',
|
||||
fontSize: 0,
|
||||
color: '#666666'
|
||||
},
|
||||
extra: {
|
||||
arcbar: {
|
||||
type: 'default',
|
||||
width: 14,
|
||||
backgroundColor: '#E9E9E9',
|
||||
startAngle: 0.75,
|
||||
endAngle: 0.25,
|
||||
gap: 2,
|
||||
linearType: 'custom'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getServerData()
|
||||
},
|
||||
methods: {
|
||||
getServerData() {
|
||||
getHomePageListApi().then(res => {
|
||||
setTimeout(() => {
|
||||
const { workerMsgBean } = res.data
|
||||
|
||||
const maleNum = workerMsgBean.maleNum
|
||||
const femaleNum = workerMsgBean.femaleNum
|
||||
const dataBoy = maleNum / (maleNum + femaleNum)
|
||||
let data = {
|
||||
series: [
|
||||
{
|
||||
color: '#67cde6',
|
||||
backgroundColor: '#67cde6',
|
||||
data: dataBoy
|
||||
}
|
||||
]
|
||||
}
|
||||
this.chartData = JSON.parse(JSON.stringify(data))
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
handleChartClick(index) {
|
||||
// const { currentIndex } = index // 获取当前点击的图表索引
|
||||
// const chartsData = this.chartData.series[0].data
|
||||
// const currenRows = chartsData[currentIndex]
|
||||
// console.log('currenRows选中的工程类型', currenRows.name)
|
||||
// // 电压等级信息
|
||||
// const voltageLevel = {
|
||||
// currentIndex,
|
||||
// name: currenRows.name
|
||||
// }
|
||||
// uni.navigateTo({ url: `/pages/realName/index/pages/project?voltageLevel=${JSON.stringify(voltageLevel)}` })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.charts-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -227,18 +227,15 @@
|
|||
<view>男({{ maleNum }})</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
@tap="onJumpColorLight(4)"
|
||||
class="gender-img"
|
||||
style="margin-left: 30rpx; background-color: #67cde6"
|
||||
></view>
|
||||
<view @tap="onJumpColorLight(4)" class="gender-img" style="margin-left: 30rpx">
|
||||
<PieChartsModelMan />
|
||||
</view>
|
||||
</view>
|
||||
<view class="girl-right">
|
||||
<view
|
||||
@tap="onJumpColorLight(5)"
|
||||
class="gender-img"
|
||||
style="margin-right: 30rpx; background-color: #fc8483"
|
||||
></view>
|
||||
<view @tap="onJumpColorLight(5)" class="gender-img" style="margin-right: 30rpx">
|
||||
<PieChartsModelGirl />
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view>
|
||||
{{
|
||||
|
|
@ -351,13 +348,18 @@ import PieChartsModel from './components/pie-charts-model'
|
|||
import BarChartsModel from './components/bar-charts-model'
|
||||
import PieChartsModelRing from './components/pie-charts-model-ring'
|
||||
import PieChartsModelRingTwo from './components/pie-charts-model-ring-two'
|
||||
import PieChartsModelMan from './components/pie-charts-model-man.vue'
|
||||
import PieChartsModelGirl from './components/pie-charts-model-girl.vue'
|
||||
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PieChartsModel,
|
||||
BarChartsModel,
|
||||
PieChartsModelRing,
|
||||
PieChartsModelRingTwo
|
||||
PieChartsModelRingTwo,
|
||||
PieChartsModelMan,
|
||||
PieChartsModelGirl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -521,6 +523,7 @@ export default {
|
|||
this.getPro()
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this.type.indexOf('4') > -1) {
|
||||
//监督端
|
||||
|
|
@ -1204,7 +1207,7 @@ export default {
|
|||
.gender-img {
|
||||
width: 120rpx;
|
||||
height: 240rpx;
|
||||
background-color: orange;
|
||||
// background-color: orange;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1249,4 +1252,10 @@ export default {
|
|||
.gender-img {
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
|
||||
.demo {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
background-color: orange;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue