2023-11-20 17:56:43 +08:00
|
|
|
<template>
|
|
|
|
<div class="module">
|
|
|
|
<ModuleCard2 title="政治面貌统计">
|
2023-11-25 12:04:39 +08:00
|
|
|
<Pie3d id="pie3d" w="400" h="200" :data="pie3dData" :key="keyCount" @click="onClick"/>
|
2023-11-20 17:56:43 +08:00
|
|
|
</ModuleCard2>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2023-11-27 14:04:45 +08:00
|
|
|
import { ref, reactive, inject, defineEmits } from 'vue';
|
2023-11-20 17:56:43 +08:00
|
|
|
import ModuleCard2 from './card/ModuleCard2.vue';
|
2023-11-21 17:48:18 +08:00
|
|
|
import Pie3d from '../components/echarts/Pie3d.vue';
|
2023-11-20 17:56:43 +08:00
|
|
|
|
2023-11-27 14:04:45 +08:00
|
|
|
const emits = defineEmits(['click']);
|
|
|
|
|
2023-11-22 18:59:08 +08:00
|
|
|
const axios = inject('axios');
|
|
|
|
const keyCount = ref(0);
|
|
|
|
const pie3dData = reactive([]);
|
|
|
|
|
2023-11-25 12:04:39 +08:00
|
|
|
const onClick = (params) => {
|
2023-11-27 14:04:45 +08:00
|
|
|
emits('click', {
|
|
|
|
type: 'organization',
|
|
|
|
name: params.name
|
|
|
|
});
|
2023-11-25 12:04:39 +08:00
|
|
|
}
|
|
|
|
|
2023-11-23 23:17:10 +08:00
|
|
|
axios.get(`app/query/sqlrelease/qe41cc66`, {}).then(res => {
|
2023-11-22 18:59:08 +08:00
|
|
|
let data = res.data;
|
|
|
|
data.forEach(item => {
|
|
|
|
pie3dData.push(item)
|
|
|
|
})
|
|
|
|
keyCount.value++;
|
|
|
|
}).catch(err => {
|
|
|
|
console.error(err);
|
|
|
|
})
|
|
|
|
|
2023-11-20 17:56:43 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2023-11-22 18:59:08 +08:00
|
|
|
// .module
|
|
|
|
// .pie-3d
|
2023-11-23 23:17:10 +08:00
|
|
|
// background-image url(/assets/imgs/card/bg9.png)
|
2023-11-20 17:56:43 +08:00
|
|
|
</style>
|