市局:能力统计,部门数漏斗图更改,覆盖部门量更改为资源汇聚部门量,与部门总数保持一直

This commit is contained in:
guoyue 2022-10-03 15:46:11 +08:00
parent 12d3cc221c
commit 1d5d4845c2
1 changed files with 552 additions and 492 deletions

View File

@ -11,12 +11,9 @@
<div v-for="item in dataList.dataList" :key="item.name"> <div v-for="item in dataList.dataList" :key="item.name">
<div v-if="item.type !== '资源汇聚总量'" class="content-left"> <div v-if="item.type !== '资源汇聚总量'" class="content-left">
<div class="name"> <div class="name">
<span <span class="name-photo" :style="{
class="name-photo"
:style="{
backgroundImage: `url(${item.photo}) `, backgroundImage: `url(${item.photo}) `,
}" }"></span>
></span>
<span class="name-text">{{ item.type }}</span> <span class="name-text">{{ item.type }}</span>
</div> </div>
<div class="organization-value"> <div class="organization-value">
@ -103,52 +100,71 @@
// dataList.value.dataList[index].organization = '' // dataList.value.dataList[index].organization = ''
// dataList.value.dataList[index].photo = photo.value[index] // dataList.value.dataList[index].photo = photo.value[index]
// }) // })
let imgObj = {
'组件服务': require('../../../assets/abilityStatistics/banner-zj.png'),
'应用资源': require('../../../assets/abilityStatistics/banner-yy.png'),
'基础设施': require('../../../assets/abilityStatistics/banner-jc.png'),
'数据资源': require('../../../assets/abilityStatistics/banner-sj.png'),
'知识库': require('../../../assets/abilityStatistics/banner-zs.png'),
}
res.data.data.total.forEach((val) => { res.data.data.total.forEach((val) => {
switch (val.type) { let _obj = {
case '组件服务':
dataList.value.dataList.push({
organization: '个', organization: '个',
type: '组件服务', type: val.type,
photo: require('../../../assets/abilityStatistics/banner-zj.png'), photo: val.type && imgObj[val.type],
amount: val.count, amount: val.count,
}) }
break if (val.type == '基础设施') {
case '应用资源':
dataList.value.dataList.push({
organization: '个',
type: '应用资源',
photo: require('../../../assets/abilityStatistics/banner-yy.png'),
amount: val.count,
})
break
case '基础设施':
if (uavAndIndividualSoldier.num) { if (uavAndIndividualSoldier.num) {
val.count = val.count - 0 + uavAndIndividualSoldier.num _obj.amount = val.count - 0 + uavAndIndividualSoldier.num
} }
dataList.value.dataList.push({
organization: '个',
type: '基础设施',
photo: require('../../../assets/abilityStatistics/banner-jc.png'),
amount: val.count,
})
break
case '数据资源':
dataList.value.dataList.push({
organization: '个',
type: '数据资源',
photo: require('../../../assets/abilityStatistics/banner-sj.png'),
amount: val.count,
})
break
case '知识库':
dataList.value.dataList.push({
organization: '个',
type: '知识库',
photo: require('../../../assets/abilityStatistics/banner-zs.png'),
amount: val.count,
})
break
} }
dataList.value.dataList.push(_obj)
// switch (val.type) {
// case '':
// dataList.value.dataList.push({
// organization: '',
// type: '',
// photo: require('../../../assets/abilityStatistics/banner-zj.png'),
// amount: val.count,
// })
// break
// case '':
// dataList.value.dataList.push({
// organization: '',
// type: '',
// photo: require('../../../assets/abilityStatistics/banner-yy.png'),
// amount: val.count,
// })
// break
// case '':
// if (uavAndIndividualSoldier.num) {
// val.count = val.count - 0 + uavAndIndividualSoldier.num
// }
// dataList.value.dataList.push({
// organization: '',
// type: '',
// photo: require('../../../assets/abilityStatistics/banner-jc.png'),
// amount: val.count,
// })
// break
// case '':
// dataList.value.dataList.push({
// organization: '',
// type: '',
// photo: require('../../../assets/abilityStatistics/banner-sj.png'),
// amount: val.count,
// })
// break
// case '':
// dataList.value.dataList.push({
// organization: '',
// type: '',
// photo: require('../../../assets/abilityStatistics/banner-zs.png'),
// amount: val.count,
// })
// break
// }
}) })
let arr = ['组件服务', '应用资源', '基础设施', '数据资源', '知识库'] let arr = ['组件服务', '应用资源', '基础设施', '数据资源', '知识库']
dataList.value.dataList.sort((a, b) => { dataList.value.dataList.sort((a, b) => {
@ -294,28 +310,44 @@
} }
// //
const funnelPlot = (dataList) => { const funnelPlot = (dataList) => {
// let arr = ['0-5', '5-10', '10-15', '15-20', '20'] //
// dataList.sort((a, b) => { let arrCopy = ['0-5', '5-10', '10-15', '15-20', '20以上']
// console.log(arr.indexOf(a.fanwei), arr.indexOf(b.fanwei)) //
// return arr.indexOf(b.fanwei) - arr.indexOf(a.fanwei) dataList.sort((a, b) => {
// }) console.log(arrCopy.indexOf(a.fanwei), arrCopy.indexOf(b.fanwei))
return arrCopy.indexOf(b.fanwei) - arrCopy.indexOf(a.fanwei)
})
let _arr = dataList.map(v => v.fanwei) || arrCopy;
//
let chartData = _arr.map((v, i) => {
return {
name: v,
value: 10 + 10 * i,
}
})
let newArr = [];
dataList.map(v => {
if (v.value && Number(v.value > 0)) {
newArr.push({
name: v.fanwei,
value: v.value
})
}
})
console.log('============》', dataList) console.log('============》', dataList)
echarts.init(document.getElementById('right')).dispose() echarts.init(document.getElementById('right')).dispose()
let chartDom = document.getElementById('right') let chartDom = document.getElementById('right')
let myChart = echarts.init(chartDom) let myChart = echarts.init(chartDom)
let option let option = {
option = {
// title: {
// text: '',
// },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: function (name) { formatter: function (info) {
let _obj = dataList.find(v => v.fanwei == info.data.name) || {}
let dom = ref() let dom = ref()
dom.value = dom.value =
'部门数<br/>' + name.data.fanwei + ' : ' + name.data.value + '个' '部门数<br/>' + (_obj.fanwei || '--') + ' : ' + (_obj.value || _obj.value === 0 ? _obj.value : '--') + '个'
console.log('name', name.data) console.log('name', info.data)
return dom.value return dom.value
}, },
}, },
@ -340,26 +372,34 @@
{ {
name: '部门数', name: '部门数',
type: 'funnel', type: 'funnel',
left: '20%', left: '28%',
top: '10%', right: '35%',
width: '60%', top: '15%',
height: '80%', bottom: '10%',
min: 0,
max: 100,
minSize: '0%', minSize: '0%',
maxSize: '100%', maxSize: '100%',
sort: 'ascending', sort: 'ascending',
gap: 2,
label: { label: {
show: true, show: true,
position: 'inside', formatter: function (info) {
let _obj = dataList.find(v => v.fanwei == info.data.name) || {}
let dom = ref()
dom.value = (_obj.fanwei || '--') + ' : ' + (_obj.value || _obj.value === 0 ? _obj.value : '--') + '个';
console.log('name', info.data)
return dom.value
},
rich: {
b: {
fontSize: 14
}
}
}, },
labelLine: { labelLine: {
length: 10, length: 40,
lineStyle: { lineStyle: {
width: 1, width: 1,
type: 'solid', type: 'solid'
}, }
}, },
itemStyle: { itemStyle: {
borderColor: '#fff', borderColor: '#fff',
@ -370,12 +410,8 @@
fontSize: 20, fontSize: 20,
}, },
}, },
data: dataList, data: chartData,
}, }
{
data: [],
type: 'bar',
},
], ],
} }
@ -407,16 +443,19 @@
font-family: 'num-typeface'; font-family: 'num-typeface';
src: url('~@/assets/newHome/font/num-typeface.otf'); src: url('~@/assets/newHome/font/num-typeface.otf');
} }
@font-face { @font-face {
font-family: 'text-typeface'; font-family: 'text-typeface';
src: url('~@/assets/newHome/font/text-typeface.otf'); src: url('~@/assets/newHome/font/text-typeface.otf');
} }
.num { .num {
font-family: num-typeface; font-family: num-typeface;
font-size: 32px; font-size: 32px;
font-weight: 600; font-weight: 600;
margin-right: 5px; margin-right: 5px;
} }
.hengxian { .hengxian {
height: 3px; height: 3px;
width: 30px; width: 30px;
@ -424,6 +463,7 @@
margin-top: 6px; margin-top: 6px;
background: #0058e1; background: #0058e1;
} }
.resource-aggregation { .resource-aggregation {
font-size: 18px; font-size: 18px;
font-family: text-typeface; font-family: text-typeface;
@ -432,6 +472,7 @@
justify-content: center; justify-content: center;
background: #f3f5f9; background: #f3f5f9;
padding-bottom: 60px; padding-bottom: 60px;
.resource-aggregation-left { .resource-aggregation-left {
background: #fff; background: #fff;
border: 1px solid #e6e9ed; border: 1px solid #e6e9ed;
@ -442,12 +483,14 @@
padding: 20px; padding: 20px;
padding-top: 64px; padding-top: 64px;
position: relative; position: relative;
.title { .title {
position: absolute; position: absolute;
top: 20px; top: 20px;
font-size: 18px; font-size: 18px;
color: #212121; color: #212121;
} }
.content { .content {
.content-son { .content-son {
.content-left { .content-left {
@ -459,10 +502,12 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-radius: 1px; border-radius: 1px;
.name { .name {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.name-photo { .name-photo {
margin-left: 10px; margin-left: 10px;
display: inline-block; display: inline-block;
@ -471,11 +516,14 @@
margin-right: 11px; margin-right: 11px;
} }
} }
.organization-value { .organization-value {
margin-right: 16px; margin-right: 16px;
.num { .num {
font-size: 26px; font-size: 26px;
} }
span:nth-child(2) { span:nth-child(2) {
font-size: 16px; font-size: 16px;
} }
@ -484,6 +532,7 @@
} }
} }
} }
.resource-aggregation-right { .resource-aggregation-right {
background: #fff; background: #fff;
border: 1px solid #e6e9ed; border: 1px solid #e6e9ed;
@ -497,6 +546,7 @@
position: relative; position: relative;
display: flex; display: flex;
padding-left: 120px; padding-left: 120px;
.title { .title {
position: absolute; position: absolute;
top: 20px; top: 20px;
@ -504,6 +554,7 @@
font-size: 18px; font-size: 18px;
color: #212121; color: #212121;
} }
.bumensnum { .bumensnum {
width: 100px; width: 100px;
position: absolute; position: absolute;
@ -516,49 +567,58 @@
background: rgba(0, 88, 225, 0.1); background: rgba(0, 88, 225, 0.1);
border-right: 1px solid rgba(0, 88, 225, 0.5); border-right: 1px solid rgba(0, 88, 225, 0.5);
border-radius: 2px; border-radius: 2px;
.bumensnum-photo { .bumensnum-photo {
height: 50px; height: 50px;
width: 50px; width: 50px;
background: url('~@/assets/abilityStatistics/bumenzongshu.png') background: url('~@/assets/abilityStatistics/bumenzongshu.png') no-repeat;
no-repeat;
margin-bottom: 30px; margin-bottom: 30px;
} }
p { p {
margin-top: 18px; margin-top: 18px;
color: #0058e1; color: #0058e1;
.num { .num {
font-size: 30px; font-size: 30px;
} }
span:last-child { span:last-child {
font-size: 16px; font-size: 16px;
} }
} }
} }
.content { .content {
width: 779px; width: 779px;
height: 313px; height: 313px;
display: flex; display: flex;
position: relative; position: relative;
background: #f1f4fb; background: #f1f4fb;
.left { .left {
width: 373px; width: 373px;
height: 313px; height: 313px;
} }
.center { .center {
height: 240px; height: 240px;
width: 1px; width: 1px;
margin-top: 31px; margin-top: 31px;
background: #d0d4de; background: #d0d4de;
} }
.right { .right {
width: 406px; width: 406px;
height: 313px; height: 313px;
} }
.right-son1 { .right-son1 {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 52.5%; left: 52.5%;
} }
.right-son2 { .right-son2 {
position: absolute; position: absolute;
top: 10px; top: 10px;