全局配置
在导入组件时可进行全局配置
app.use(EasyProcess, {
// 全局配置
})
nodeImplPath
指定节点视图实现和节点配置实现目录,路径必需使用import.meta.glob()包裹。
app.use(EasyProcess, {
nodeImplPath: import.meta.glob('src/views/node/**')
})
nodeConfig
节点配置,可在该项中配置自定义节点以及覆盖组件内置节点配置
app.use(EasyProcess, {
nodeConfig: [
{
"nodeType": "", // 节点类型,若为组件内置节点类型可覆盖其他配置项
"nodeName": "", // 节点名称
"color": "", // 节点标题颜色,例:#FFFFFF
"bgColor": "", // 节点标题背景颜色,例:#8225e4
"enable": true, // 节点是否可用
"canAdd": true, // 节点是否可以增加
"canRemoved": true, // 节点是否能够移除
"hasDrawer": true, // 节点是否可以进行配置
"icon": { // 图标
"name": "", // 图标名,参考自定义节点章节
"color": "" // 颜色,例:#8225e4
},
"config": { // 根据需求定义节点默认的配置数据
},
}
]
})
gatewayTypeConfig
该功能v3.1.0以上版本支持
网关类型配置,可覆盖默认配置
app.use(EasyProcess, {
gatewayTypeConfig: [
{
type: 'exclusive', // 网关类型
enable: true, // 是否启用,默认为true
isDefault: true, // 是否为默认网关类型(添加网关节点时的默认网关类型),只能有一个网关类型生效
icon: 'ep-exclusive-gateway', // 网关类型图标
},
{
type: 'parallel',
name: '并行网关',
enable: true,
isDefault: true,
icon: 'ep-parallel-gateway',
}
]
})
zIndexConfig
配置组件内一些css样式的z-index值,有两种方式:
zIndexConfig.initZIndexValue
指定一个初始值,此后在该值上进行递增。
zIndexConfig.bindZIndexFunction
绑定一个获取z-index值的方法,当配置此项后initZIndexValue则不生效。
app.use(EasyProcess, {
zIndexConfig: {
bindZIndexFunction: () => {
if (!window.zIndex) {
window.zIndex = 500
}
return window.zIndex++
}
}
})
也可以绑定UI组件库内置的获取z-index值的方法,例如绑定element-plus中的方法
import ElementPlus, {useZIndex} from 'element-plus'
const { nextZIndex } = useZIndex()
app.use(EasyProcess, {
zIndexConfig: {
bindZIndexFunction: nextZIndex
}
})
iconConfig
图标配置
iconConfig.prefix
图标前缀,根据vite-plugin-svg-icons插件配置的symbolId进行调整,例如symbolId = 'icon-[dir]-[name]':
app.use(EasyProcess, {
iconConfig: {
prefix: '#icon-'
}
})
