lw-cdp-ui 1.5.1 → 1.5.2

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.
@@ -284,7 +284,7 @@ export default {
284
284
  return items?.map((item) => item.label).join('、') || val || '--'
285
285
  },
286
286
  // 根据 value 从树形数据中查找 label(支持自定义 props)
287
- getLabelByValue(data, value, props = {}) {
287
+ getLabelByValue(data, val, props = {}) {
288
288
  const {
289
289
  value: valueKey = 'value', // 默认字段名:value
290
290
  label: labelKey = 'label', // 默认字段名:label
@@ -293,13 +293,14 @@ export default {
293
293
 
294
294
  const findNode = (nodes) => {
295
295
  for (const node of nodes) {
296
- if (node[valueKey] === value) return node[labelKey]
297
- if (node[childrenKey]) {
296
+ if (node[valueKey] == val) return node[labelKey]
297
+
298
+ if (node[childrenKey] && node[childrenKey].length > 0) {
298
299
  const result = findNode(node[childrenKey])
299
- if (result) return result
300
+ if (result !== '--') return result
300
301
  }
301
302
  }
302
- return '--' // 未匹配时显示占位符
303
+ return '--'
303
304
  }
304
305
 
305
306
  return findNode(data)
@@ -2884,7 +2884,7 @@ function Z5(e, t, n, a, r, o) {
2884
2884
  [Mt, e.$route.meta.type == "iframe"]
2885
2885
  ]);
2886
2886
  }
2887
- const Y5 = /* @__PURE__ */ ae(G5, [["render", Z5], ["__scopeId", "data-v-91dc7bba"]]), K5 = "1.5.1", W5 = {
2887
+ const Y5 = /* @__PURE__ */ ae(G5, [["render", Z5], ["__scopeId", "data-v-91dc7bba"]]), K5 = "1.5.2", W5 = {
2888
2888
  version: K5
2889
2889
  }, J5 = {
2890
2890
  name: "lwLayout",
@@ -7033,10 +7033,10 @@ const x8 = /* @__PURE__ */ ae(E8, [["render", I8], ["__scopeId", "data-v-c63ed38
7033
7033
  // 默认字段名:children
7034
7034
  } = n, i = (l) => {
7035
7035
  for (const s of l) {
7036
- if (s[a] === t) return s[r];
7037
- if (s[o]) {
7036
+ if (s[a] == t) return s[r];
7037
+ if (s[o] && s[o].length > 0) {
7038
7038
  const u = i(s[o]);
7039
- if (u) return u;
7039
+ if (u !== "--") return u;
7040
7040
  }
7041
7041
  }
7042
7042
  return "--";
@@ -7223,7 +7223,7 @@ function D8(e, t, n, a, r, o) {
7223
7223
  _: 3
7224
7224
  }, 8, ["class", "prop", "rules"]));
7225
7225
  }
7226
- const V8 = /* @__PURE__ */ ae(B8, [["render", D8], ["__scopeId", "data-v-d84f32e1"]]), R8 = {
7226
+ const V8 = /* @__PURE__ */ ae(B8, [["render", D8], ["__scopeId", "data-v-6060479b"]]), R8 = {
7227
7227
  components: {
7228
7228
  FormItem: kc,
7229
7229
  ViewItem: V8