ftdsy-attr 2.1.14 → 2.1.16
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/ftdsy-attr.cjs.js +70 -79
- package/dist/ftdsy-attr.cjs.js.map +1 -1
- package/dist/ftdsy-attr.d.ts +1 -8
- package/dist/ftdsy-attr.esm.mjs +99 -100
- package/dist/ftdsy-attr.esm.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ftdsy-attr.d.ts
CHANGED
|
@@ -68,13 +68,6 @@ type MatchDatas = {
|
|
|
68
68
|
specs?: any;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
declare const _default: {
|
|
72
|
-
createCategoryProperties: typeof createCategoryProperties;
|
|
73
|
-
getOriginProperty: typeof getOriginProperty;
|
|
74
|
-
matchCategoryProperties: typeof matchCategoryProperties;
|
|
75
|
-
createCategoryPropertyTemplate: typeof createCategoryPropertyTemplate;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
71
|
/**
|
|
79
72
|
* 转换自定义属性列表,
|
|
80
73
|
* */
|
|
@@ -113,5 +106,5 @@ declare function matchCategoryProperties(matchDatas: MatchDatas, matchLevel?: nu
|
|
|
113
106
|
* */
|
|
114
107
|
declare function createCategoryPropertyTemplate(properties: (DsyAttrWithValue | goodsAttr)[]): goodsAttr[];
|
|
115
108
|
|
|
116
|
-
export {
|
|
109
|
+
export { createCategoryProperties, createCategoryPropertyTemplate, getOriginProperty, matchCategoryProperties };
|
|
117
110
|
export type { ComponentType, Condition, DsyAttr, DsyAttrValue, DsyAttrWithValue, MatchDatas, PropertyComponent, PropertyOption, PropertyType, Pt, Rule, RuleName, goodsAttr };
|
package/dist/ftdsy-attr.esm.mjs
CHANGED
|
@@ -297,7 +297,7 @@ var y = function t(s) {
|
|
|
297
297
|
return s.values && s.values.length > 0 ? 1 === s.choose_max_num ? "singleSelect" : "multiSelect" : 5 == s.property_value_type ? "date" : s.value_unit && s.value_unit.length > 0 ? "inputComponent" : "input";
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
-
function
|
|
300
|
+
function U(t) {
|
|
301
301
|
return t && Array.isArray(t);
|
|
302
302
|
}
|
|
303
303
|
|
|
@@ -307,7 +307,7 @@ Object.getPrototypeOf(k(o().m(function t() {
|
|
|
307
307
|
}, t);
|
|
308
308
|
}))).constructor;
|
|
309
309
|
|
|
310
|
-
var
|
|
310
|
+
var w = function t(s) {
|
|
311
311
|
switch (s) {
|
|
312
312
|
case "singleCheck":
|
|
313
313
|
return "singleSelect";
|
|
@@ -326,15 +326,15 @@ var U = function t(s) {
|
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
function
|
|
329
|
+
function r(t) {
|
|
330
330
|
return t.map(function(t) {
|
|
331
331
|
var s, e, k, d, i = [];
|
|
332
|
-
null != t && t.options && (i =
|
|
332
|
+
null != t && t.options && (i = U(null == t || null === (e = t.options) || void 0 === e ? void 0 : e.option) ? null == t || null === (d = t.options) || void 0 === d ? void 0 : d.option : [ null == t || null === (k = t.options) || void 0 === k ? void 0 : k.option ]);
|
|
333
333
|
var b = {
|
|
334
334
|
property_id: t.id,
|
|
335
335
|
property_required: !1,
|
|
336
336
|
property_name: t.name,
|
|
337
|
-
property_type:
|
|
337
|
+
property_type: w(t.type),
|
|
338
338
|
property_values: (null === (s = i) || void 0 === s ? void 0 : s.map(function(t) {
|
|
339
339
|
return {
|
|
340
340
|
label: t.displayName,
|
|
@@ -345,7 +345,7 @@ function w(t) {
|
|
|
345
345
|
has_children: !1
|
|
346
346
|
};
|
|
347
347
|
if (t.rules) {
|
|
348
|
-
var o, h =
|
|
348
|
+
var o, h = U(null === (o = t.rules) || void 0 === o ? void 0 : o.rule) ? t.rules.rule : [ t.rules.rule ];
|
|
349
349
|
b.property_required = h.some(function(t) {
|
|
350
350
|
return "requiredRule" === t.name;
|
|
351
351
|
}) || !1, b.select_custom = h.some(function(t) {
|
|
@@ -355,11 +355,11 @@ function w(t) {
|
|
|
355
355
|
}) || !1;
|
|
356
356
|
}
|
|
357
357
|
if ("input" === b.property_type && t.properties) {
|
|
358
|
-
var l = t.properties.property.taoSirType.value, a =
|
|
358
|
+
var l = t.properties.property.taoSirType.value, a = U(t.properties.property.formats.format) ? t.properties.property.formats.format : [ t.properties.property.formats.format ];
|
|
359
359
|
if ("date" === l) {
|
|
360
360
|
var x;
|
|
361
361
|
b.property_type = "date";
|
|
362
|
-
var m =
|
|
362
|
+
var m = U(t.properties.property.unitNames.unitName) ? (null === (x = t.properties.property.unitNames.unitName[0]) || void 0 === x ? void 0 : x.value) || "" : t.properties.property.unitNames.unitName.value;
|
|
363
363
|
"年" === m ? b.rules.push({
|
|
364
364
|
name: "format",
|
|
365
365
|
value: "YYYY"
|
|
@@ -378,7 +378,7 @@ function w(t) {
|
|
|
378
378
|
type: s.type,
|
|
379
379
|
options: "unit" === s.type ? function() {
|
|
380
380
|
var s = t.properties.property.unitNames.unitName;
|
|
381
|
-
return
|
|
381
|
+
return U(s) || (s = [ s ]), s.map(function(t) {
|
|
382
382
|
return {
|
|
383
383
|
label: t.value,
|
|
384
384
|
value: t.value
|
|
@@ -391,7 +391,7 @@ function w(t) {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
if ("multiComplex" === b.property_type) {
|
|
394
|
-
var y =
|
|
394
|
+
var y = U(t.fields.field) ? t.fields.field : [ t.fields.field ];
|
|
395
395
|
b.property_component = y.map(function(t) {
|
|
396
396
|
var s;
|
|
397
397
|
return {
|
|
@@ -70646,14 +70646,14 @@ function Q(t, s, e, k) {
|
|
|
70646
70646
|
if ([ "上市时间", "上市年份季节", "上市时节", "适用季节", "上市年份/季节", "年份季节", "适合季节", "上市年份" ].includes(s.property_name) || "date" == d) {
|
|
70647
70647
|
var y = A();
|
|
70648
70648
|
if ("date" == d) {
|
|
70649
|
-
var
|
|
70650
|
-
return
|
|
70651
|
-
void (s.property_value =
|
|
70649
|
+
var U = ((null == s ? void 0 : s.date_format) || "yyyy-MM-dd").toUpperCase(), w = "";
|
|
70650
|
+
return w = "YYYY-MM-DD" === U ? "".concat(y.year, "-").concat(y.month, "-").concat(y.day) : "YYYY-MM" === U ? "".concat(y.year, "-").concat(y.month) : "".concat(y.year),
|
|
70651
|
+
void (s.property_value = w);
|
|
70652
70652
|
}
|
|
70653
70653
|
if ("input" == d) return void (s.property_value = (null == y ? void 0 : y.year) || "");
|
|
70654
70654
|
if ([ "上市年份季节", "上市时节", "上市时间", "上市年份/季节", "年份季节", "上市年份" ].includes(s.property_name) && [ "singleSelect", "multiSelect" ].includes(d)) {
|
|
70655
|
-
var
|
|
70656
|
-
return B(t.name, [ "春", "夏", "秋", "冬" ]) ? t.name ===
|
|
70655
|
+
var r = y.year + "年" + y.season, j = i.find(function(t) {
|
|
70656
|
+
return B(t.name, [ "春", "夏", "秋", "冬" ]) ? t.name === r || t.name + "季" === r : t.name.includes(y.year + "年");
|
|
70657
70657
|
});
|
|
70658
70658
|
if (j) return void ("singleSelect" == d ? s.property_value = j : "multiSelect" == d && (s.property_value = [ j ]));
|
|
70659
70659
|
}
|
|
@@ -70896,7 +70896,7 @@ var Z = function() {
|
|
|
70896
70896
|
|
|
70897
70897
|
function dt() {
|
|
70898
70898
|
return dt = k(o().m(function t(s, e) {
|
|
70899
|
-
var k, i, b, h, l, a, x, m, f, y,
|
|
70899
|
+
var k, i, b, h, l, a, x, m, f, y, U, w, r, j, u, n, c, v, _, C, S, I = arguments;
|
|
70900
70900
|
return o().w(function(t) {
|
|
70901
70901
|
for (;;) switch (t.p = t.n) {
|
|
70902
70902
|
case 0:
|
|
@@ -70964,11 +70964,11 @@ function dt() {
|
|
|
70964
70964
|
t.n = 15;
|
|
70965
70965
|
break;
|
|
70966
70966
|
}
|
|
70967
|
-
if (O((
|
|
70967
|
+
if (O((U = y.value).property_value)) {
|
|
70968
70968
|
t.n = 14;
|
|
70969
70969
|
break;
|
|
70970
70970
|
}
|
|
70971
|
-
if (Q(s,
|
|
70971
|
+
if (Q(s, U, l.join("、"), i), O(U.property_value)) {
|
|
70972
70972
|
t.n = 13;
|
|
70973
70973
|
break;
|
|
70974
70974
|
}
|
|
@@ -70976,11 +70976,11 @@ function dt() {
|
|
|
70976
70976
|
break;
|
|
70977
70977
|
|
|
70978
70978
|
case 13:
|
|
70979
|
-
if (!
|
|
70979
|
+
if (!U.has_children) {
|
|
70980
70980
|
t.n = 14;
|
|
70981
70981
|
break;
|
|
70982
70982
|
}
|
|
70983
|
-
return t.n = 14, bt(s,
|
|
70983
|
+
return t.n = 14, bt(s, U, b);
|
|
70984
70984
|
|
|
70985
70985
|
case 14:
|
|
70986
70986
|
t.n = 12;
|
|
@@ -71001,10 +71001,10 @@ function dt() {
|
|
|
71001
71001
|
t.n = 26;
|
|
71002
71002
|
break;
|
|
71003
71003
|
}
|
|
71004
|
-
|
|
71004
|
+
w = s.is_other_force ? b.list : b.required_list, r = d(w), t.p = 19, r.s();
|
|
71005
71005
|
|
|
71006
71006
|
case 20:
|
|
71007
|
-
if ((j =
|
|
71007
|
+
if ((j = r.n()).done) {
|
|
71008
71008
|
t.n = 23;
|
|
71009
71009
|
break;
|
|
71010
71010
|
}
|
|
@@ -71037,10 +71037,10 @@ function dt() {
|
|
|
71037
71037
|
break;
|
|
71038
71038
|
|
|
71039
71039
|
case 24:
|
|
71040
|
-
t.p = 24, S = t.v,
|
|
71040
|
+
t.p = 24, S = t.v, r.e(S);
|
|
71041
71041
|
|
|
71042
71042
|
case 25:
|
|
71043
|
-
return t.p = 25,
|
|
71043
|
+
return t.p = 25, r.f(), t.f(25);
|
|
71044
71044
|
|
|
71045
71045
|
case 26:
|
|
71046
71046
|
return v = b.list.map(function(t) {
|
|
@@ -71226,7 +71226,7 @@ function pt() {
|
|
|
71226
71226
|
t.n = 2, st(l);
|
|
71227
71227
|
|
|
71228
71228
|
case 2:
|
|
71229
|
-
(a = t.v) && (x = a.data).length > 0 && (
|
|
71229
|
+
(a = t.v) && (x = a.data).length > 0 && (r(x) || []).forEach(function(t) {
|
|
71230
71230
|
if (b && b.property_id === t.property_id) if (h && h.parent_value_ids) h.parent_value_ids.push(d); else {
|
|
71231
71231
|
var s = b.show_condition || [];
|
|
71232
71232
|
s.push({
|
|
@@ -71290,74 +71290,9 @@ var ot = function t(s) {
|
|
|
71290
71290
|
code: k,
|
|
71291
71291
|
type: d
|
|
71292
71292
|
};
|
|
71293
|
-
}, ht = {
|
|
71294
|
-
createCategoryProperties: xt,
|
|
71295
|
-
getOriginProperty: function lt(t, s) {
|
|
71296
|
-
switch (t) {
|
|
71297
|
-
case "pdd":
|
|
71298
|
-
case "tm":
|
|
71299
|
-
case "jd":
|
|
71300
|
-
case "dy":
|
|
71301
|
-
case "shopee":
|
|
71302
|
-
case "xhs":
|
|
71303
|
-
case "ks":
|
|
71304
|
-
case "albb":
|
|
71305
|
-
case "wxsph":
|
|
71306
|
-
default:
|
|
71307
|
-
return "";
|
|
71308
|
-
|
|
71309
|
-
case "tb":
|
|
71310
|
-
return function t(s) {
|
|
71311
|
-
switch (s) {
|
|
71312
|
-
case "singleSelect":
|
|
71313
|
-
return "singleCheck";
|
|
71314
|
-
|
|
71315
|
-
case "multiSelect":
|
|
71316
|
-
return "multiCheck";
|
|
71317
|
-
|
|
71318
|
-
case "multiComplex":
|
|
71319
|
-
return "multiComplex";
|
|
71320
|
-
|
|
71321
|
-
case "inputComponent":
|
|
71322
|
-
case "date":
|
|
71323
|
-
case "input":
|
|
71324
|
-
return "input";
|
|
71325
|
-
|
|
71326
|
-
default:
|
|
71327
|
-
return "unknown";
|
|
71328
|
-
}
|
|
71329
|
-
}(s);
|
|
71330
|
-
|
|
71331
|
-
case "dsy":
|
|
71332
|
-
return function t(s) {
|
|
71333
|
-
switch (s) {
|
|
71334
|
-
case "singleSelect":
|
|
71335
|
-
return "select";
|
|
71336
|
-
|
|
71337
|
-
case "multiSelect":
|
|
71338
|
-
return "checkbox";
|
|
71339
|
-
|
|
71340
|
-
case "multiComplex":
|
|
71341
|
-
return "multiComplex";
|
|
71342
|
-
|
|
71343
|
-
case "inputComponent":
|
|
71344
|
-
case "date":
|
|
71345
|
-
case "input":
|
|
71346
|
-
return "input";
|
|
71347
|
-
|
|
71348
|
-
default:
|
|
71349
|
-
return "unknown";
|
|
71350
|
-
}
|
|
71351
|
-
}(s);
|
|
71352
|
-
}
|
|
71353
|
-
},
|
|
71354
|
-
matchCategoryProperties: function at(t) {
|
|
71355
|
-
return mt.apply(this, arguments);
|
|
71356
|
-
},
|
|
71357
|
-
createCategoryPropertyTemplate: ft
|
|
71358
71293
|
};
|
|
71359
71294
|
|
|
71360
|
-
function
|
|
71295
|
+
function ht(t, s) {
|
|
71361
71296
|
switch (t) {
|
|
71362
71297
|
case "pdd":
|
|
71363
71298
|
return function t(s) {
|
|
@@ -71435,7 +71370,7 @@ function xt(t, s) {
|
|
|
71435
71370
|
}(s);
|
|
71436
71371
|
|
|
71437
71372
|
case "tb":
|
|
71438
|
-
return
|
|
71373
|
+
return r(s);
|
|
71439
71374
|
|
|
71440
71375
|
case "jd":
|
|
71441
71376
|
return function e(t) {
|
|
@@ -71788,8 +71723,72 @@ function xt(t, s) {
|
|
|
71788
71723
|
}
|
|
71789
71724
|
}
|
|
71790
71725
|
|
|
71791
|
-
function
|
|
71792
|
-
|
|
71726
|
+
function lt(t, s) {
|
|
71727
|
+
switch (t) {
|
|
71728
|
+
case "pdd":
|
|
71729
|
+
case "tm":
|
|
71730
|
+
case "jd":
|
|
71731
|
+
case "dy":
|
|
71732
|
+
case "shopee":
|
|
71733
|
+
case "xhs":
|
|
71734
|
+
case "ks":
|
|
71735
|
+
case "albb":
|
|
71736
|
+
case "wxsph":
|
|
71737
|
+
default:
|
|
71738
|
+
return "";
|
|
71739
|
+
|
|
71740
|
+
case "tb":
|
|
71741
|
+
return function t(s) {
|
|
71742
|
+
switch (s) {
|
|
71743
|
+
case "singleSelect":
|
|
71744
|
+
return "singleCheck";
|
|
71745
|
+
|
|
71746
|
+
case "multiSelect":
|
|
71747
|
+
return "multiCheck";
|
|
71748
|
+
|
|
71749
|
+
case "multiComplex":
|
|
71750
|
+
return "multiComplex";
|
|
71751
|
+
|
|
71752
|
+
case "inputComponent":
|
|
71753
|
+
case "date":
|
|
71754
|
+
case "input":
|
|
71755
|
+
return "input";
|
|
71756
|
+
|
|
71757
|
+
default:
|
|
71758
|
+
return "unknown";
|
|
71759
|
+
}
|
|
71760
|
+
}(s);
|
|
71761
|
+
|
|
71762
|
+
case "dsy":
|
|
71763
|
+
return function t(s) {
|
|
71764
|
+
switch (s) {
|
|
71765
|
+
case "singleSelect":
|
|
71766
|
+
return "select";
|
|
71767
|
+
|
|
71768
|
+
case "multiSelect":
|
|
71769
|
+
return "checkbox";
|
|
71770
|
+
|
|
71771
|
+
case "multiComplex":
|
|
71772
|
+
return "multiComplex";
|
|
71773
|
+
|
|
71774
|
+
case "inputComponent":
|
|
71775
|
+
case "date":
|
|
71776
|
+
case "input":
|
|
71777
|
+
return "input";
|
|
71778
|
+
|
|
71779
|
+
default:
|
|
71780
|
+
return "unknown";
|
|
71781
|
+
}
|
|
71782
|
+
}(s);
|
|
71783
|
+
}
|
|
71784
|
+
}
|
|
71785
|
+
|
|
71786
|
+
function at(t) {
|
|
71787
|
+
return xt.apply(this, arguments);
|
|
71788
|
+
}
|
|
71789
|
+
|
|
71790
|
+
function xt() {
|
|
71791
|
+
return xt = k(o().m(function t(s) {
|
|
71793
71792
|
var e, k, d, i, b, p, h, l, a, x, m, f = arguments;
|
|
71794
71793
|
return o().w(function(t) {
|
|
71795
71794
|
for (;;) switch (t.p = t.n) {
|
|
@@ -71803,13 +71802,13 @@ function mt() {
|
|
|
71803
71802
|
is_prediction: e >= 1,
|
|
71804
71803
|
is_required_force: e >= 2,
|
|
71805
71804
|
is_other_force: e >= 3
|
|
71806
|
-
}, p =
|
|
71805
|
+
}, p = mt(s.attrs || []), h = {
|
|
71807
71806
|
title: s.title,
|
|
71808
71807
|
goods_sn: s.goods_sn,
|
|
71809
71808
|
remark: s.remark,
|
|
71810
71809
|
ccc_code: s.ccc_code,
|
|
71811
71810
|
specs: s.specs
|
|
71812
|
-
}, null != (l =
|
|
71811
|
+
}, null != (l = ht(s.platform, s.properties)) && l) {
|
|
71813
71812
|
t.n = 2;
|
|
71814
71813
|
break;
|
|
71815
71814
|
}
|
|
@@ -71845,7 +71844,7 @@ function mt() {
|
|
|
71845
71844
|
}
|
|
71846
71845
|
return t.a(2, Promise.resolve({
|
|
71847
71846
|
msg: "成功",
|
|
71848
|
-
data:
|
|
71847
|
+
data: mt(a),
|
|
71849
71848
|
code: 1
|
|
71850
71849
|
}));
|
|
71851
71850
|
|
|
@@ -71881,10 +71880,10 @@ function mt() {
|
|
|
71881
71880
|
return t.a(2);
|
|
71882
71881
|
}
|
|
71883
71882
|
}, t, null, [ [ 1, 8 ] ]);
|
|
71884
|
-
})),
|
|
71883
|
+
})), xt.apply(this, arguments);
|
|
71885
71884
|
}
|
|
71886
71885
|
|
|
71887
|
-
function
|
|
71886
|
+
function mt(t) {
|
|
71888
71887
|
var s = [];
|
|
71889
71888
|
return t.forEach(function(t) {
|
|
71890
71889
|
var e = {
|
|
@@ -71901,5 +71900,5 @@ function ft(t) {
|
|
|
71901
71900
|
}), s;
|
|
71902
71901
|
}
|
|
71903
71902
|
|
|
71904
|
-
export { ht as
|
|
71903
|
+
export { ht as createCategoryProperties, mt as createCategoryPropertyTemplate, lt as getOriginProperty, at as matchCategoryProperties };
|
|
71905
71904
|
//# sourceMappingURL=ftdsy-attr.esm.mjs.map
|