2024-04-18 17:01:10 +08:00
|
|
|
<!--
|
|
|
|
filename: DoubleRingWrapper.vue
|
|
|
|
author: liubin
|
|
|
|
date: 2024-04-17 09:55:12
|
|
|
|
description:
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="double-ring-wrapper">
|
2024-04-24 16:31:27 +08:00
|
|
|
<template v-if="period == '月' || period == '年'">
|
|
|
|
<copilot-select
|
|
|
|
@update:active="handleActiveUpdate"
|
|
|
|
:options="cityOptions"
|
|
|
|
/>
|
|
|
|
<div class="flex-1 stretch">
|
|
|
|
<DoubleRingChartVue :period="period" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<CityData :data-source="dataSource" :period="period" />
|
|
|
|
</template>
|
2024-04-18 17:01:10 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import CopilotSelect from "../../select.vue";
|
|
|
|
import fetcher from "./fetcherDoubleRing";
|
|
|
|
import DoubleRingChartVue from "./DoubleRingChart.vue";
|
2024-04-24 16:31:27 +08:00
|
|
|
import CityData from './CityData.vue';
|
2024-04-18 17:01:10 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "DoubleRingWrapper",
|
2024-04-24 16:31:27 +08:00
|
|
|
components: { CopilotSelect, DoubleRingChartVue, CityData },
|
|
|
|
props: {
|
|
|
|
dataSource: {
|
|
|
|
type: Object,
|
|
|
|
default: () => ({}),
|
|
|
|
},
|
|
|
|
period: {
|
|
|
|
type: String,
|
|
|
|
default: "日",
|
|
|
|
},
|
|
|
|
},
|
2024-04-18 17:01:10 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
cityOptions: [
|
|
|
|
"成都",
|
|
|
|
"邯郸",
|
|
|
|
"株洲",
|
|
|
|
"瑞昌",
|
|
|
|
"佳木斯",
|
|
|
|
"凯盛光伏",
|
|
|
|
"蚌埠兴科",
|
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {},
|
|
|
|
mounted() {
|
|
|
|
fetcher.getData().then((res) => {
|
|
|
|
console.log("getData--->", res);
|
|
|
|
});
|
|
|
|
},
|
2024-04-24 16:31:27 +08:00
|
|
|
methods: {
|
|
|
|
handleActiveUpdate(val) {
|
|
|
|
console.log("handleActiveUpdate--->", val);
|
|
|
|
},
|
|
|
|
},
|
2024-04-18 17:01:10 +08:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.double-ring-wrapper {
|
|
|
|
height: 100%;
|
|
|
|
padding: 12px 24px;
|
|
|
|
display: flex;
|
|
|
|
gap: 12px;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.flex-1 {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stretch {
|
|
|
|
align-self: stretch;
|
|
|
|
}
|
|
|
|
</style>
|