lw-cdp-ui 1.2.30 → 1.2.32

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.
@@ -157,22 +157,22 @@ export default class Dagre {
157
157
  // 根据源节点和目标节点的位置计算路径点
158
158
  if (newSourceNodeData.x < newTargetNodeData.x) {
159
159
  pointsList.push({
160
- x: newSourceNodeData.x + sourceNodeModel.width / 2 + 5,
161
- y: newSourceNodeData.y + 5
162
- })
160
+ x: newSourceNodeData.x + sourceNodeModel.width / 2,
161
+ y: newSourceNodeData.y,
162
+ });
163
163
  pointsList.push({
164
164
  x: newSourceNodeData.x + sourceNodeModel.width / 2 + (model.offset || 50),
165
- y: newSourceNodeData.y + 5
166
- })
165
+ y: newSourceNodeData.y,
166
+ });
167
167
  pointsList.push({
168
168
  x: newSourceNodeData.x + sourceNodeModel.width / 2 + (model.offset || 50),
169
- y: newTargetNodeData.y + 5
170
- })
169
+ y: newTargetNodeData.y,
170
+ });
171
171
  pointsList.push({
172
- x: newTargetNodeData.x - targetNodeModel.width / 2 + 5,
173
- y: newTargetNodeData.y + 5
174
- })
175
- return this.pointFilter(pointsList)
172
+ x: newTargetNodeData.x - targetNodeModel.width / 2,
173
+ y: newTargetNodeData.y,
174
+ });
175
+ return this.pointFilter(pointsList);
176
176
  }
177
177
  if (newSourceNodeData.x > newTargetNodeData.x) {
178
178
  if (newSourceNodeData.y >= newTargetNodeData.y) {
@@ -283,7 +283,7 @@ export default {
283
283
  })
284
284
  this.initMenu()
285
285
  await this.initNode()
286
- if (this.modelValue && this.modelValue?.nodes.length > 0) {
286
+ if (this.modelValue && this.modelValue?.nodes?.length > 0) {
287
287
  this.logicFlow.render(this.modelValue)
288
288
  } else {
289
289
  // 根据节点数据初始化节点
@@ -101,7 +101,12 @@
101
101
  </template>
102
102
  <!-- date -->
103
103
  <template v-else-if="item.component == 'date'">
104
- {{ dayjs(objItem.value).format(item?.options?.valueFormat || 'YYYY-MM-DD HH:mm:ss') }}
104
+ <template v-if="typeof objItem.value == 'string'">
105
+ {{ dayjs(objItem.value).format(item?.options?.valueFormat || 'YYYY-MM-DD HH:mm:ss') }}
106
+ </template>
107
+ <template v-if="typeof objItem.value == 'object'">
108
+ {{ objItem.value.length > 0 ? dayjs(objItem.value[0]).format(item?.options?.valueFormat || 'YYYY-MM-DD HH:mm:ss') + ' - ' + dayjs(objItem.value[1]).format(item?.options?.valueFormat || 'YYYY-MM-DD HH:mm:ss') : '--' }}
109
+ </template>
105
110
  </template>
106
111
  <!-- number -->
107
112
  <template v-else-if="item.component == 'number'">
@@ -282,7 +287,7 @@ export default {
282
287
  // key to label
283
288
  getKeyToLabel(val, items = []) {
284
289
  let item = items.find(item => { return item.value == val })
285
- return item?.label || '--'
290
+ return item?.label || val || '--'
286
291
  },
287
292
  dayjs: dayjs
288
293
  }
@@ -21,6 +21,7 @@
21
21
  <el-form v-else
22
22
  ref="form"
23
23
  :model="form"
24
+ :disabled="isView"
24
25
  :label-width="config.labelWidth"
25
26
  :label-position="$i18n.locale == 'en-us' ? 'top' : config.labelPosition"
26
27
  v-loading="loading"
@@ -2,7 +2,7 @@
2
2
  <span class="item-text"
3
3
  :style="{width: textWidth}">
4
4
  <!-- 根据加密状态显示加密或解密后的文本 -->
5
- <span>{{ isEncrypted ? encryptedText : modelValue }}</span>
5
+ <span>{{ isEncrypted ? encryptedText : (modelValue || '--') }}</span>
6
6
  <!-- 切换加密/解密按钮 -->
7
7
  <el-icon v-if="password"
8
8
  class="primary"