CNCEC_APP/pages/index/board/safe/educationCard.vue

69 lines
1.2 KiB
Vue
Raw Normal View History

2026-03-25 14:54:15 +08:00
<template>
<ChartCard margin="0 0 30rpx 0" title="教育培训">
<view class="charts-box">
<qiun-data-charts type="area" :opts="opts" :canvas2d="false" :chartData="chartData" @getIndex="handleTap" />
2026-03-25 14:54:15 +08:00
</view>
</ChartCard>
</template>
<script setup>
import ChartCard from '@/components/chartCard.vue';
import { ref ,onMounted} from 'vue';
2026-03-25 14:54:15 +08:00
const opts = ref({
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {
show: false
},
xAxis: {
disableGrid: true,
rotateLabel: true,
rotateAngle: -30,
fontSize: 10
},
yAxis: {
gridType: 'dash',
dashLength: 2
},
extra: {
tooltip: {
showBox: false
2026-03-25 14:54:15 +08:00
},
area: {
type: 'curve',
opacity: 0.2,
addLine: true,
width: 2,
gradient: true,
activeType: 'hollow'
2026-03-25 14:54:15 +08:00
}
}
});
const chartData = ref({});
2026-03-25 14:54:15 +08:00
const handleTap = (e) => {
console.log(e);
};
2026-03-25 14:54:15 +08:00
onMounted(() => {
let res = {
categories: ['专项培训', '特种作业\n培训', '三级安全\n教育培训', '安全技术\n交底'],
series: [
{
2026-03-25 14:54:15 +08:00
data: [302265, 70770, 399175, 14851]
}
]
};
chartData.value = JSON.parse(JSON.stringify(res));
});
2026-03-25 14:54:15 +08:00
</script>
<style scoped>
.charts-box {
width: 100%;
height: 400rpx;
}
</style>