谐波溯源删除,新增,左侧表格联动
This commit is contained in:
@@ -611,7 +611,11 @@ const handleChartClick = (params: any) => {
|
||||
};
|
||||
|
||||
// 定义 emit
|
||||
const emit = defineEmits(["flag-changed", "expand-detail"]);
|
||||
const emit = defineEmits([
|
||||
"flag-changed",
|
||||
"expand-detail",
|
||||
"refresh-security-detail",
|
||||
]);
|
||||
|
||||
watch(flag, (newVal) => {
|
||||
// 向父组件发送 flag 变化事件
|
||||
@@ -950,6 +954,8 @@ const initialResponsibilityList = () => {
|
||||
}
|
||||
loading.value = false;
|
||||
}
|
||||
// 通知父组件刷新 manage/securityDetail.vue 中的数据
|
||||
emit("refresh-security-detail");
|
||||
})
|
||||
.catch((error) => {
|
||||
traceabilityTableData.value = [];
|
||||
|
||||
@@ -420,7 +420,7 @@ const submit = () => {
|
||||
|
||||
// 执行
|
||||
const execute = async (item: any, index: number) => {
|
||||
if (item.time == undefined) {
|
||||
if (time.value == undefined || time.value.length == 0) {
|
||||
return ElMessage.warning("请选择时间范围");
|
||||
}
|
||||
tabList.value[activeName.value].showDynamic = false;
|
||||
|
||||
@@ -526,6 +526,7 @@ const loading = ref(false);
|
||||
|
||||
const trendChartRef = ref();
|
||||
|
||||
|
||||
// 页码
|
||||
const params = reactive({
|
||||
pageNum: 1,
|
||||
@@ -945,9 +946,14 @@ const init = () => {
|
||||
eventList();
|
||||
};
|
||||
|
||||
const refreshResponsibilityList = () => {
|
||||
initialResponsibilityList();
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
setShowDetail, // 暴露方法给父组件调用
|
||||
refreshResponsibilityList
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
@data-updated="handleDataUpdate"
|
||||
@flag-changed="handleFlagChange"
|
||||
@expand-detail="handleExpandDetail"
|
||||
@refresh-security-detail="refreshSecurityDetail"
|
||||
/>
|
||||
</dv-border-box-13>
|
||||
<!-- <dv-border-box-13 :color="color[0]">
|
||||
@@ -294,6 +295,13 @@ const handleDataUpdate = (data: string[]) => {
|
||||
eventListData.value = data;
|
||||
};
|
||||
|
||||
const refreshSecurityDetail = () => {
|
||||
// 调用 securityDetail 组件的刷新方法
|
||||
if (securityDetail.value) {
|
||||
securityDetail.value.refreshResponsibilityList();
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化并获取数据
|
||||
const initComponents = () => {
|
||||
if (eventStatistics.value) {
|
||||
|
||||
Reference in New Issue
Block a user