歷史資料: 按鈕說明不換行、暫時移除table loadind | 能源管理: sankey的分支顏色明顯

This commit is contained in:
koko 2024-11-08 11:53:01 +08:00
parent ac867d368c
commit eee56c4273
3 changed files with 15 additions and 7 deletions

View File

@ -39,7 +39,7 @@ const chartOption = {
borderWidth: 0, borderWidth: 0,
}, },
lineStyle: { lineStyle: {
color: "target", color: 'gradient',
opacity: 0.7, opacity: 0.7,
curveness: 0.5, curveness: 0.5,
}, },
@ -64,15 +64,21 @@ const loadData = async () => {
]; ];
// links // links
const links = rawData.map((item) => ({ const links = rawData.map((item, index) => ({
source: "Total", source: "Total",
target: item.key, target: item.key,
value: item.value, value: item.value,
percentage: item.percentage, percentage: item.percentage,
})); }));
const colors = ["#45f4ef", "#f5d54e", "#63ed84", "#5a5cac", "#ff5e5e", "#e266fe"];
// chartOption // chartOption
chartOption.series[0].data = data; chartOption.series[0].data = data.map((item, index) => ({
...item,
itemStyle: {
color: colors[index % colors.length], //
},
}));
chartOption.series[0].links = links; chartOption.series[0].links = links;
// //

View File

@ -160,7 +160,7 @@ onBeforeMount(() => {
<div class="flex flex-col custom-border p-4 mb-4"> <div class="flex flex-col custom-border p-4 mb-4">
<!-- <HistoryFavoriteOption class="mb-4" />--> <!-- <HistoryFavoriteOption class="mb-4" />-->
<div class="flex items-center gap-4 mb-4"> <div class="flex items-center gap-4 mb-4">
<h2 class="text-lg font-bold ps-2"> <h2 class="text-lg font-bold ps-2 whitespace-nowrap">
{{ $t("history.system_category") }} : {{ $t("history.system_category") }} :
</h2> </h2>
<ButtonGroup <ButtonGroup
@ -174,7 +174,7 @@ onBeforeMount(() => {
/> />
</div> </div>
<div class="flex items-center gap-4 mb-4"> <div class="flex items-center gap-4 mb-4">
<h2 class="text-lg font-bold ps-2"> <h2 class="text-lg font-bold ps-2 whitespace-nowrap">
{{ $t("history.device_category") }} : {{ $t("history.device_category") }} :
</h2> </h2>
<ButtonGroup <ButtonGroup
@ -188,7 +188,9 @@ onBeforeMount(() => {
/> />
</div> </div>
<div class="flex items-center gap-4 mb-4"> <div class="flex items-center gap-4 mb-4">
<h2 class="text-lg font-bold ps-2">{{ $t("history.point") }} :</h2> <h2 class="text-lg font-bold ps-2 whitespace-nowrap">
{{ $t("history.point") }} :
</h2>
<ButtonGroup <ButtonGroup
v-if="searchParams?.Device_list" v-if="searchParams?.Device_list"
:items="points" :items="points"

View File

@ -39,7 +39,7 @@ const { tableData, loading } = inject("history_table_data");
</script> </script>
<template> <template>
<Table :loading="loading" :columns="columns" :dataSource="tableData"></Table> <Table :columns="columns" :dataSource="tableData"></Table>
</template> </template>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>