lw-cdp-ui 1.1.59 → 1.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lwFlow/index.vue +15 -8
- package/dist/components/lwFormMini/index.vue +2 -1
- package/dist/lw-cdp-ui.esm.js +983 -978
- package/dist/lw-cdp-ui.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import LogicFlow from '@logicflow/core'
|
|
32
32
|
import '@logicflow/core/dist/index.css';
|
|
33
33
|
import { Menu, MiniMap } from "@logicflow/extension";
|
|
34
|
-
import {
|
|
34
|
+
import { Dagre } from '@logicflow/layout';
|
|
35
35
|
import '@logicflow/extension/lib/style/index.css';
|
|
36
36
|
|
|
37
37
|
// 注册组件
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
/**
|
|
87
|
-
* 节点数据
|
|
87
|
+
* 节点数据 在没有 modelValue时 用以自动创建节点 默认使用modelValue
|
|
88
88
|
*/
|
|
89
89
|
nodes: {
|
|
90
90
|
type: Array,
|
|
@@ -274,7 +274,7 @@ export default {
|
|
|
274
274
|
this.logicFlow = new LogicFlow({
|
|
275
275
|
container: this.$refs.container,
|
|
276
276
|
// 注册组件
|
|
277
|
-
plugins: [Menu, MiniMap,
|
|
277
|
+
plugins: [Menu, MiniMap, Dagre],
|
|
278
278
|
// 不可编辑
|
|
279
279
|
isSilentMode: this.isView,
|
|
280
280
|
hoverOutline: !this.isView,
|
|
@@ -284,7 +284,7 @@ export default {
|
|
|
284
284
|
})
|
|
285
285
|
this.initMenu()
|
|
286
286
|
await this.initNode()
|
|
287
|
-
if (
|
|
287
|
+
if (this.modelValue && this.modelValue.length > 0) {
|
|
288
288
|
this.logicFlow.render(this.modelValue)
|
|
289
289
|
} else {
|
|
290
290
|
// 根据节点数据初始化节点
|
|
@@ -339,17 +339,24 @@ export default {
|
|
|
339
339
|
|
|
340
340
|
// 创建边
|
|
341
341
|
this.nodes.forEach(item => {
|
|
342
|
-
|
|
342
|
+
let sourceKeys = Array.isArray(item.from)
|
|
343
|
+
? item.from.map(subItem => subItem.name) // 如果是数组,提取每个 name
|
|
344
|
+
: [item.from]; // 如果是字符串,直接作为 sourceKey
|
|
345
|
+
|
|
343
346
|
const targetKey = item.into;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
+
|
|
348
|
+
sourceKeys.forEach(sourceKey => {
|
|
349
|
+
if (nodeMap[sourceKey] && nodeMap[targetKey]) {
|
|
350
|
+
edges.push(generateEdge(nodeMap[sourceKey], nodeMap[targetKey]));
|
|
351
|
+
}
|
|
352
|
+
});
|
|
347
353
|
});
|
|
348
354
|
|
|
349
355
|
this.logicFlow.renderRawData({
|
|
350
356
|
nodes,
|
|
351
357
|
edges
|
|
352
358
|
})
|
|
359
|
+
|
|
353
360
|
this.logicFlow.extension.dagre.layout()
|
|
354
361
|
|
|
355
362
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-affix v-if="showMenu"
|
|
3
|
-
:offset="100">
|
|
3
|
+
:offset="100" style="width: 100%; height: 45px;">
|
|
4
4
|
<ul class="affix-body">
|
|
5
5
|
<template v-for="(item, index) in config.formItems"
|
|
6
6
|
:key="index">
|
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
style="width: 100%;"
|
|
155
155
|
:props="item?.options?.props"
|
|
156
156
|
:separator="item?.options?.separator"
|
|
157
|
+
:disabled="item?.options?.disabled"
|
|
157
158
|
:options="item?.options.items"
|
|
158
159
|
clearable></el-cascader>
|
|
159
160
|
</template>
|