添加行为树复制功能
This commit is contained in:
@@ -29,6 +29,12 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-flex class="ks-tree-actions">
|
<a-flex class="ks-tree-actions">
|
||||||
<!-- <span style="margin-right: 10px"><EditFilled /></span>-->
|
<!-- <span style="margin-right: 10px"><EditFilled /></span>-->
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定复制?"
|
||||||
|
@confirm="()=> handleCopy(item)"
|
||||||
|
>
|
||||||
|
<span class="ks-tree-action ks-tree-action-copy" @click.stop style="margin-right: 10px"><CopyOutlined /></span>
|
||||||
|
</a-popconfirm>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确定删除?"
|
title="确定删除?"
|
||||||
@confirm="()=> handleDelete(item)"
|
@confirm="()=> handleDelete(item)"
|
||||||
@@ -51,15 +57,16 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, onMounted, ref } from 'vue';
|
import { defineComponent, onMounted, ref } from 'vue';
|
||||||
import { CheckOutlined, DeleteOutlined, EditFilled, PlusOutlined } from '@ant-design/icons-vue';
|
import { CheckOutlined, CopyOutlined, DeleteOutlined, EditFilled, PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import type { BehaviorTree, BehaviorTreeRequest } from './tree';
|
import type { BehaviorTree, BehaviorTreeRequest } from './tree';
|
||||||
import { deleteOneTreeById, findTreesByQuery } from './api';
|
import { copyTree, deleteOneTreeById, findTreesByQuery } from './api';
|
||||||
import { substring } from '@/utils/strings';
|
import { substring } from '@/utils/strings';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
emits: ['select-tree', 'create-tree'],
|
emits: ['select-tree', 'create-tree'],
|
||||||
components: {
|
components: {
|
||||||
CheckOutlined,
|
CheckOutlined,
|
||||||
|
CopyOutlined,
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditFilled,
|
EditFilled,
|
||||||
@@ -95,6 +102,14 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCopy = (item: BehaviorTree) => {
|
||||||
|
copyTree({ id: item.id }).then(r => {
|
||||||
|
if (r.code === 200) {
|
||||||
|
loadTress();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '名称',
|
||||||
@@ -133,6 +148,7 @@ export default defineComponent({
|
|||||||
handleSelect,
|
handleSelect,
|
||||||
handleChange,
|
handleChange,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
|
handleCopy,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user