Files
CNCEC_APP/pages/index/board/safe/safetyCard.vue
T

87 lines
1.5 KiB
Vue
Raw Normal View History

2026-03-27 16:01:49 +08:00
<template>
<ChartCard margin="0 0 30rpx 0" title="领导级安全检查数">
2026-08-17 11:01:21 +08:00
<view class="big-crisis" @click="router.push('/pages/index/leadershipSafety/index')">
2026-03-27 16:01:49 +08:00
<qiun-data-charts type="column" :opts="opts" :canvas2d="false" :chartData="chartData" @getIndex="handleTap" />
</view>
</ChartCard>
</template>
<script setup>
import ChartCard from '@/components/chartCard.vue';
2026-08-17 11:01:21 +08:00
import { ref, watch } from 'vue';
import { router } from '@/utils';
let props = defineProps({
hsseProblemData: {
type: Array,
default: () => []
},
hsseProblemDataNum: {
type: Array,
default: () => []
}
});
2026-03-27 16:01:49 +08:00
const opts = ref({
padding: [15, 15, 0, 5],
enableScroll: false,
legend: {
2026-08-17 11:01:21 +08:00
show: true,
itemGap:10
2026-03-27 16:01:49 +08:00
},
xAxis: {
disableGrid: true
},
yAxis: {
data: [
{
min: 0
}
]
},
extra: {
column: {
type: 'group',
width: 20,
activeBgColor: '#000000',
2026-08-17 11:01:21 +08:00
activeBgOpacity: 0.08,
seriesGap:3
2026-03-27 16:01:49 +08:00
}
}
});
const chartData = ref({});
const handleTap = (e) => {
console.log(e);
};
2026-08-17 11:01:21 +08:00
watch(
() => props.hsseProblemData,
(newVal) => {
if (newVal && newVal.length) {
// 只有当数据存在时才赋值
let res = {
categories: ['集团级检查数', '企业及分支机构检查数'],
series: [
{
name: '总数',
data: props.hsseProblemDataNum
},
{
name: '未完成',
data: newVal
}
]
};
chartData.value = JSON.parse(JSON.stringify(res));
}
},
{ deep: true, immediate: true }
);
2026-03-27 16:01:49 +08:00
</script>
<style lang="scss">
.big-crisis {
width: 100%;
height: 400rpx;
}
</style>