From 19d7fadfbe1c5fde7515d92ed093808893749658 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Mon, 15 May 2023 13:57:58 +0800 Subject: [PATCH] fix: bug#12259 --- .../Instance/Detail/Running/Event/index.vue | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/views/device/Instance/Detail/Running/Event/index.vue b/src/views/device/Instance/Detail/Running/Event/index.vue index be6d4cb0..9ca7cd50 100644 --- a/src/views/device/Instance/Detail/Running/Event/index.vue +++ b/src/views/device/Instance/Detail/Running/Event/index.vue @@ -45,23 +45,25 @@ const events = defineProps({ }); const instanceStore = useInstanceStore(); -const columns = ref>([ - { - title: '时间', - dataIndex: 'timestamp', - key: 'timestamp', - scopedSlots: true, - search: { - type: 'date', - }, +const defaultColumns = [ + { + title: '时间', + dataIndex: 'timestamp', + key: 'timestamp', + scopedSlots: true, + search: { + type: 'date', }, - { - title: '操作', - dataIndex: 'action', - key: 'action', - scopedSlots: true, - }, -]); + }, + { + title: '操作', + dataIndex: 'action', + key: 'action', + scopedSlots: true, + } +] + +const columns = ref>>([...defaultColumns]); const params = ref>({}); const visible = ref(false); const info = ref>({}); @@ -70,6 +72,7 @@ const _getEventList = (_params: any) => getEventList(instanceStore.current.id || '', events.data.id || '', _params); watchEffect(() => { + columns.value = [...defaultColumns] if (events.data?.valueType?.type === 'object') { (events.data.valueType?.properties || []).reverse().map((i: any) => { columns.value.splice(0, 0, {