lw-cdp-ui 1.1.60 → 1.1.62

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.
@@ -84,7 +84,7 @@ export default {
84
84
  }
85
85
  },
86
86
  /**
87
- * 节点数据 在没有完整modelValue 用以自动创建节点
87
+ * 节点数据 在没有 modelValue 用以自动创建节点 默认使用modelValue
88
88
  */
89
89
  nodes: {
90
90
  type: Array,
@@ -284,7 +284,7 @@ export default {
284
284
  })
285
285
  this.initMenu()
286
286
  await this.initNode()
287
- if (!this.modelValue) {
287
+ if (this.modelValue && this.modelValue.length > 0) {
288
288
  this.logicFlow.render(this.modelValue)
289
289
  } else {
290
290
  // 根据节点数据初始化节点
@@ -339,18 +339,25 @@ export default {
339
339
 
340
340
  // 创建边
341
341
  this.nodes.forEach(item => {
342
- const sourceKey = item.from;
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
- if (nodeMap[sourceKey] && nodeMap[targetKey]) {
345
- edges.push(generateEdge(nodeMap[sourceKey], nodeMap[targetKey]));
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
  })
353
- this.logicFlow.extension.dagre.layout()
359
+
360
+ this.logicFlow?.extension?.dagre?.layout()
354
361
 
355
362
  },
356
363
  /**
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <el-select :disabled="item.disabled" :placeholder="item.label || '请选择'" :popper-append-to-body="item.appendToBody" v-model="value" clearable filterable :multiple="item.multiple" collapse-tags allow-search size="" style="width: 100%;">
3
+ <el-select :disabled="item.disabled" :placeholder="item.label || '请选择'" :popper-append-to-body="item.appendToBody" v-model="value" :clearable="item.clearable" filterable :multiple="item.multiple" collapse-tags allow-search size="" style="width: 100%;">
4
4
  <el-option v-for="(items, index) in item.options" :disabled="items.disabled" :key="item.key ? item.key : item.valueKey ? items[item.valueKey] + items[item.labelKey] + index : items.code + items.name + index" :label="item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name)" :value="item.valueKey ? items[item.valueKey] : items.code">
5
5
  <el-tooltip :content="item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name)">
6
6
  <span>{{ item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name) }}</span>