2026-03-25 14:54:15 +08:00
|
|
|
<template>
|
2026-03-27 16:01:49 +08:00
|
|
|
<ChartCard margin="0 0 30rpx 0" title="应急数据">
|
2026-03-25 14:54:15 +08:00
|
|
|
<view class="emergencyCard">
|
2026-03-26 14:49:26 +08:00
|
|
|
<qiun-data-charts type="column" :opts="opts" :canvas2d="false" :chartData="chartData" @getIndex="handleTap" />
|
2026-03-25 14:54:15 +08:00
|
|
|
</view>
|
|
|
|
|
</ChartCard>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-03-27 16:01:49 +08:00
|
|
|
import ChartCard from '@/components/chartCard.vue';
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
|
|
|
|
|
const opts = ref({
|
|
|
|
|
padding: [15, 15, 0, 5],
|
|
|
|
|
enableScroll: false,
|
|
|
|
|
legend: { show: false },
|
|
|
|
|
xAxis: {
|
|
|
|
|
disableGrid: true,
|
|
|
|
|
rotateLabel: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
rotateAngle: -30
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
data: [
|
|
|
|
|
{
|
2026-03-25 14:54:15 +08:00
|
|
|
min: 0
|
|
|
|
|
}
|
2026-03-27 16:01:49 +08:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
extra: {
|
|
|
|
|
column: {
|
|
|
|
|
type: 'group',
|
|
|
|
|
width: 20,
|
|
|
|
|
activeBgColor: '#000000',
|
|
|
|
|
activeBgOpacity: 0.08
|
2026-03-25 14:54:15 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-27 16:01:49 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const chartData = ref({});
|
|
|
|
|
|
|
|
|
|
const handleTap = (e) => {
|
|
|
|
|
console.log(e);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
let res = {
|
|
|
|
|
categories: ['综合预案', '专项预案', '现场处置\n预案', '演练次数 ', '参演人数'],
|
|
|
|
|
series: [
|
|
|
|
|
{
|
2026-03-25 14:54:15 +08:00
|
|
|
data: [35, 36, 31, 33, 13],
|
|
|
|
|
color: '#eef82f'
|
|
|
|
|
}
|
2026-03-27 16:01:49 +08:00
|
|
|
],
|
|
|
|
|
formatter: function (value, index, series, opts) {
|
|
|
|
|
console.log(value);
|
|
|
|
|
console.log(index);
|
|
|
|
|
console.log(series);
|
|
|
|
|
console.log(opts);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
chartData.value = JSON.parse(JSON.stringify(res));
|
|
|
|
|
});
|
2026-03-25 14:54:15 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2026-03-27 16:01:49 +08:00
|
|
|
.emergencyCard {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 400rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|