diff --git a/modeler/src/style.less b/modeler/src/style.less index 48e7e4c..ad463ef 100644 --- a/modeler/src/style.less +++ b/modeler/src/style.less @@ -1291,6 +1291,10 @@ } } +.ant-select:not(.ant-select-customize-input) .ant-select-selector{ + border: 1px solid #475f71 +} + .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill, .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill:hover, .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill:focus, @@ -1504,9 +1508,7 @@ border-inline-end-width: 1px; } } -.ant-select:not(.ant-select-customize-input) .ant-select-selector{ - border: 1px solid #2c2a2a; -} + .ant-select .ant-select-selection-placeholder, .ant-select .ant-select-selection-search-input{ background: transparent diff --git a/modeler/src/views/decision/algorithm/management.vue b/modeler/src/views/decision/algorithm/management.vue index d47e326..193ec07 100644 --- a/modeler/src/views/decision/algorithm/management.vue +++ b/modeler/src/views/decision/algorithm/management.vue @@ -274,8 +274,11 @@ const getAlgorithmTypeName = (type: NullableString): NullableString => { const load = () => { algorithms.value = []; algorithmsTotal.value = 0; - formRef.value?.resetFields(); - selectedAlgorithm.value = resolveItem(defaultAlgorithm); + + if(selectedAlgorithm.value.id <= 0){ + formRef.value?.resetFields(); + selectedAlgorithm.value = resolveItem(defaultAlgorithm); + } findAlgorithmsByQuery(query.value).then(r => { algorithms.value = r.rows ?? []; diff --git a/modeler/src/views/decision/rule/PlatformSelect.vue b/modeler/src/views/decision/rule/PlatformSelect.vue index 5aa60af..0b3ddb6 100644 --- a/modeler/src/views/decision/rule/PlatformSelect.vue +++ b/modeler/src/views/decision/rule/PlatformSelect.vue @@ -3,12 +3,13 @@ {{ item.description || item.name || '未命名平台' }} @@ -18,13 +19,13 @@ {{ item.description || item.name || '未命名组件' }} @@ -34,135 +35,84 @@ \ No newline at end of file diff --git a/modeler/src/views/decision/rule/management.vue b/modeler/src/views/decision/rule/management.vue index 24d54ad..c802453 100644 --- a/modeler/src/views/decision/rule/management.vue +++ b/modeler/src/views/decision/rule/management.vue @@ -32,9 +32,7 @@
- -
- 通用 @@ -73,23 +70,32 @@ +
-
+
- + + - - + + @@ -98,23 +104,32 @@ +
-
+
- + + - - + + @@ -126,24 +141,21 @@ - + 保存规则 - 删除规则 - - -
- -
\ No newline at end of file diff --git a/modeler/src/views/decision/rule/store.ts b/modeler/src/views/decision/rule/store.ts new file mode 100644 index 0000000..5b688b9 --- /dev/null +++ b/modeler/src/views/decision/rule/store.ts @@ -0,0 +1,64 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import { onMounted, ref, type Ref } from 'vue'; +import type { Platform, PlatformComponent, PlatformWithComponents, PlatformWithComponentsResponse } from '../types'; +import { findAllPlatformWithComponents } from './api'; + +const loading: Ref = ref(true); +const platforms: Ref = ref([]); +const platformMap: Ref> = ref>(new Map()); +const componentMap: Ref> = ref>(new Map()); +const loaded: Ref = ref(false); + +export interface UsePlatformComponentsReturn { + loading: Ref; + platforms: Ref; + platformMap: Ref>; + componentMap: Ref>; + loaded: Ref; +} + +export const usePlatformComponents = (): UsePlatformComponentsReturn => { + const load = () => { + if (!loaded.value) { + loading.value = true; + platformMap.value.clear(); + componentMap.value.clear(); + + findAllPlatformWithComponents() + .then((res: PlatformWithComponentsResponse) => { // 显式标注响应类型 + platforms.value = res.data || []; + platforms.value.forEach(platform => { + platformMap.value.set(platform.id, platform); + platform.components?.forEach(component => { + componentMap.value.set(component.id, component); + }); + }); + loaded.value = true; + }) + .catch((err: unknown) => { + console.error('加载平台组件失败:', err); + }) + .finally(() => { + loading.value = false; + }); + } + }; + + onMounted(() => load()); + + return { + loading, + platforms, + platformMap, + componentMap, + loaded, + }; +}; \ No newline at end of file