2026-02-06 17:22:22 +08:00
|
|
|
/*
|
|
|
|
|
* This file is part of the kernelstudio package.
|
|
|
|
|
*
|
|
|
|
|
* (c) 2014-2025 zlin <admin@kernelstudio.com>
|
|
|
|
|
*
|
|
|
|
|
* For the full copyright and license information, please view the LICENSE file
|
|
|
|
|
* that was distributed with this source code.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { register } from '@antv/x6-vue-shape';
|
|
|
|
|
import ModelElement from './node.vue';
|
2026-02-08 15:59:14 +08:00
|
|
|
import { createPorts } from './ports';
|
2026-02-06 17:22:22 +08:00
|
|
|
|
2026-02-08 15:59:14 +08:00
|
|
|
export const registerNodeElement = (type: string = 'task') => {
|
2026-02-06 17:22:22 +08:00
|
|
|
console.info('registerNodeElement');
|
|
|
|
|
register({
|
2026-02-08 15:59:14 +08:00
|
|
|
shape: type,
|
2026-02-06 17:22:22 +08:00
|
|
|
component: ModelElement,
|
|
|
|
|
width: 120,
|
|
|
|
|
attrs: {
|
|
|
|
|
body: {
|
|
|
|
|
stroke: 'transparent',
|
|
|
|
|
strokeWidth: 0,
|
|
|
|
|
fill: 'transparent',
|
|
|
|
|
rx: 4,
|
|
|
|
|
ry: 4,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
dragging: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
},
|
2026-02-08 15:59:14 +08:00
|
|
|
ports: createPorts(),
|
2026-02-06 17:22:22 +08:00
|
|
|
});
|
|
|
|
|
};
|