UPDATE: VERSION-20260315

This commit is contained in:
libertyspy
2026-03-15 20:20:56 +08:00
parent f2e81c6e5c
commit b97837ec6a
8 changed files with 112 additions and 164 deletions

View File

@@ -14,7 +14,7 @@
@dragend="handleDragEnd"
@dragstart="handleDragStart($event, nm)"
>
<img :alt="nm.description ?? nm.name ?? ''" class="icon" src="@/assets/icons/model-4.svg" />
<img :alt="nm.description ?? nm.name ?? ''" class="icon" src="@/assets/icons/model.svg" />
<span class="desc">{{ nm.description ?? nm.name }}</span>
</div>
</a-col>
@@ -27,23 +27,30 @@
</template>
<script lang="ts">
import { defineComponent, onMounted, ref } from 'vue';
import { defineComponent, onMounted, type PropType, ref } from 'vue';
import { safePreventDefault, safeStopPropagation } from '@/utils/event';
import {findPlatformWithComponents} from './api'
import {type PlatformWithComponents} from './types'
import { type PlatformWithComponents, type Scenario } from './types';
export default defineComponent({
emits: ['drag-item-start', 'drag-item-end'],
props: {
scenario: {
type: Object as PropType<Scenario>,
required: true,
}
},
setup(_props, { emit }) {
const activeKey = ref<number>(1);
const templateData = ref<PlatformWithComponents[]>([]);
const isDraggingOver = ref<boolean>(false);
const draggedNodeData = ref<PlatformWithComponents | null>(null);
const currentScenario = ref<Scenario|null>(_props.scenario)
const loadTress = () => {
templateData.value = []
findPlatformWithComponents(1).then(r => {
findPlatformWithComponents(_props.scenario?.id).then(r => {
templateData.value = r.data ?? []
});
};