为星位视图添加颜色

master
yezhichao 2021-12-01 10:57:24 +08:00
parent 7045f10960
commit a2413e104f
2 changed files with 14 additions and 10 deletions

View File

@ -22,13 +22,17 @@ use([
]); ]);
const props = defineProps({ const props = defineProps({
title: String title: String,
color: String
}) })
const option = reactive({ const option = reactive({
title: { title: {
text: props.title, text: props.title,
left: 'center' left: 'center',
textStyle: {
color: 'white'
}
}, },
polar: { polar: {
radius: '72%' radius: '72%'
@ -77,8 +81,8 @@ const option = reactive({
formatter: '{@[2]}' formatter: '{@[2]}'
}, },
itemStyle: { itemStyle: {
color: '#9ca3af' color: props.color
} },
}, { }, {
nmea: 'in-positioning', nmea: 'in-positioning',
coordinateSystem: 'polar', coordinateSystem: 'polar',
@ -89,8 +93,8 @@ const option = reactive({
formatter: '{@[2]}' formatter: '{@[2]}'
}, },
itemStyle: { itemStyle: {
color: '#e5323e' color: props.color
} },
}] }]
}) })

View File

@ -4,16 +4,16 @@
<div class="main-content flex-1 grid grid-cols-2 grid-rows-2"> <div class="main-content flex-1 grid grid-cols-2 grid-rows-2">
<div> <div>
<PlanisphereView ref="BDPlanisphereView" title="北斗" /> <PlanisphereView ref="BDPlanisphereView" color="rgb(0,204,255)" title="北斗" />
</div> </div>
<div> <div>
<PlanisphereView ref="GPPlanisphereView" title="GPS" /> <PlanisphereView ref="GPPlanisphereView" color="rgb(255,255,0)" title="GPS" />
</div> </div>
<div> <div>
<PlanisphereView ref="GLPlanisphereView" title="格洛纳斯" /> <PlanisphereView ref="GLPlanisphereView" color="rgb(102,0,255)" title="格洛纳斯" />
</div> </div>
<div> <div>
<PlanisphereView ref="GAPlanisphereView" title="伽利略" /> <PlanisphereView ref="GAPlanisphereView" color="rgb(0,204,102)" title="伽利略" />
</div> </div>
</div> </div>
</full-screen-container> </full-screen-container>