From fb7f2c2c9479f4be19119778ff71aa764cb1cadd Mon Sep 17 00:00:00 2001 From: nanasikeai Date: Thu, 16 Jan 2025 15:52:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=81=94=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=96=B0=E5=BB=BA=EF=BC=8C=E5=85=B3=E8=81=94=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E8=81=94=E5=8A=A8=20--story=3D120608092?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/scheme-input/event-log.vue | 27 ++++++ .../components/scheme-input/other.vue | 95 +++++++++++++++---- .../components/scheme-input/resource-data.vue | 41 +++++++- .../link-data-create/components/links.vue | 18 ++-- 4 files changed, 150 insertions(+), 31 deletions(-) diff --git a/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/event-log.vue b/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/event-log.vue index 8b8af360..03096d08 100644 --- a/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/event-log.vue +++ b/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/event-log.vue @@ -24,6 +24,8 @@ import { + computed, onMounted, ref, } from 'vue'; @@ -68,12 +71,33 @@ type ModelValue = LinkDataDetailModel['config']['links'][0]['left_table'] | LinkDataDetailModel['config']['links'][0]['right_table'] + interface Props { + links: LinkDataDetailModel['config']['links'] + } + + const props = defineProps(); const modelValue = defineModel({ required: true, }); const { t } = useI18n(); const statusSystems = ref>>([]); + const firstSystemIds = computed(() => { + if (props.links.length > 1) { + const leftSystemIds = props.links[0].left_table.system_ids; + const rightSystemIds = props.links[0].right_table.system_ids; + if (leftSystemIds && leftSystemIds.length) { + return leftSystemIds; + } if (rightSystemIds && rightSystemIds.length) { + return rightSystemIds; + } + return []; + } + return []; + }); + + const isDisabled = computed(() => firstSystemIds.value.length > 0); + // 获取rt_id const { data: tableData, @@ -116,6 +140,9 @@ name: item.name, status: result[item.id].status, })); + if (isDisabled.value) { + modelValue.value.system_ids = firstSystemIds.value; + } statusSystems.value.sort((a, b) => { if (a.status !== 'unset') return -1; if (b.status !== 'unset') return 1; diff --git a/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/other.vue b/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/other.vue index 4fadffb0..c484e43a 100644 --- a/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/other.vue +++ b/src/frontend/src/views/link-data-manage/link-data-create/components/components/scheme-input/other.vue @@ -15,33 +15,33 @@ to the current version of the project delivered to anyone in the future. -->