12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import { GroupNode } from '@logicflow/extension'
- import { storeToRefs } from 'pinia';
- import { useThemeConfig } from '/@/stores/themeConfig';
- const storesThemeConfig = useThemeConfig();
- const { themeConfig } = storeToRefs(storesThemeConfig);
- import { nodeStyleHandle } from '../tool'
- class SubProcessView extends GroupNode.view {
- }
- class SubProcessModel extends GroupNode.model {
- initNodeData (data: any) {
- super.initNodeData(data)
- this.isRestrict = true
- this.resizable = true
- this.foldable = false
- this.width = 500
- this.height = 300
- this.foldedWidth = 50
- this.foldedHeight = 50
- }
- getNodeStyle ():{
- [x: string]: any;
- width?: number;
- height?: number;
- radius?: number;
- fill?: string;
- stroke?: string;
- strokeWidth?: number;
- } {
- const style = super.getNodeStyle()
- // 设置样式
- if(themeConfig.value.isIsDark){
- style.fill = "#191919";
- style.stroke = "#fff"
- }else{
- style.fill = "#fff";
- style.stroke = "#3C50E0";
- }
- return nodeStyleHandle(this, style)
- }
- }
- const SubProcess = {
- type: 'hotline:subProcess',
- view: SubProcessView,
- model: SubProcessModel
- }
- export { SubProcess, SubProcessModel }
- export default SubProcess
|