Initial commit

This commit is contained in:
libertyspy
2026-02-08 22:31:13 +08:00
parent 43837901f3
commit 0b55384442
11 changed files with 88 additions and 79 deletions

View File

@@ -5,28 +5,30 @@
<a-flex>
<span class="ks-model-builder-title-icon icon-model"></span>
<span style="color: #82c4e9;font-size: 16px;">我的行为树</span>
<!-- <span style="position: absolute; right: 15px;"><PlusOutlined @click="$emit('create-tree')"/></span>-->
<!-- <span style="position: absolute; right: 15px;"><PlusOutlined @click="$emit('create-tree')"/></span>-->
</a-flex>
</template>
<div class="w-full" style="padding: 5px;">
<a-flex>
<a-input-search size="small" allowClear v-model:value="behaviorTreeQuery.name" placeholder="行为树名称" @search="loadTress" />
<a-button size="small" style="margin-left: 10px;"><PlusOutlined style="margin-top: 0px;display: block;" @click="$emit('create-tree')"/></a-button>
<a-input-search v-model:value="behaviorTreeQuery.name" allowClear placeholder="行为树名称" size="small" @search="loadTress" />
<a-button size="small" style="margin-left: 10px;">
<PlusOutlined style="margin-top: 0px;display: block;" @click="$emit('create-tree')" />
</a-button>
</a-flex>
</div>
<a-list size="small" :data-source="behaviorTrees || []" style="min-height: 25vh">
<a-list :data-source="behaviorTrees || []" size="small" style="min-height: 25vh">
<template #renderItem="{ item }">
<a-list-item>
<a-flex>
<a-tooltip placement="right">
<template #title>
<p>名称: {{ item.name }}</p>
<p>说明: {{item.description}}</p>
<p>说明: {{ item.description }}</p>
</template>
<span>{{ substring(item.name, 15) }}</span>
</a-tooltip>
<a-flex class="ks-tree-actions">
<span style="margin-right: 10px" @click="()=> handleSelect(item)"><EditFilled /></span>
<span style="margin-right: 10px" @click="()=> handleSelect(item)"><EditFilled /></span>
<a-popconfirm
title="确定删除?"
@confirm="()=> handleDelete(item)"
@@ -39,10 +41,10 @@
</template>
</a-list>
<a-pagination
size="small"
v-model:current="behaviorTreeQuery.pageNum"
:page-size="behaviorTreeQuery.pageSize"
simple :total="totalTress" @change="handleChange" />
:total="totalTress"
simple size="small" @change="handleChange" />
</a-collapse-panel>
</a-collapse>
</template>
@@ -55,7 +57,7 @@ import { deleteOneTreeById, findTreesByQuery } from './api';
import { substring } from '@/utils/strings';
export default defineComponent({
emits: ['select-tree','create-tree'],
emits: ['select-tree', 'create-tree'],
components: {
CheckOutlined,
PlusOutlined,
@@ -69,7 +71,7 @@ export default defineComponent({
pageNum: 1,
pageSize: 8,
});
const activeKey = ref<number>(1)
const activeKey = ref<number>(1);
const totalTress = ref<number>(0);
const loadTress = () => {
@@ -102,7 +104,7 @@ export default defineComponent({
const handleSelect = (record: BehaviorTree) => {
emit('select-tree', record);
}
};
const customRow = (record: BehaviorTree) => {
return {
@@ -112,7 +114,7 @@ export default defineComponent({
};
};
const refresh = ()=> loadTress();
const refresh = () => loadTress();
onMounted(() => {
loadTress();
@@ -133,7 +135,7 @@ export default defineComponent({
handleDelete,
};
},
})
});
</script>
@@ -172,29 +174,33 @@ export default defineComponent({
position: relative;
}
.ant-pagination{
.ant-pagination {
position: absolute;
bottom: 10px;
width: 100%;
.ant-pagination-disabled .ant-pagination-item-link,
.ant-pagination-disabled:hover .ant-pagination-item-link,
.ant-pagination-prev .ant-pagination-item-link,
.ant-pagination-next .ant-pagination-item-link,
&.ant-pagination-mini .ant-pagination-total-text,
&.ant-pagination-mini .ant-pagination-simple-pager{
&.ant-pagination-mini .ant-pagination-simple-pager {
color: rgb(255 255 255 / 95%);
}
&.ant-pagination-simple .ant-pagination-simple-pager input {
background-color: transparent;
border: 1px solid #0f4a7c;
color:#eee;
color: #eee;
}
}
}
}
.create-tree-icon{
.create-tree-icon {
cursor: pointer;
}
.ant-list-item {
padding: 3px 5px;
cursor: pointer;