ftdsy-attr 2.1.16 → 2.1.18
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 +99 -81
- package/dist/ftdsy-attr.cjs.js.map +1 -1
- package/dist/ftdsy-attr.d.ts +11 -1
- package/dist/ftdsy-attr.esm.mjs +37 -27
- package/dist/ftdsy-attr.esm.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ftdsy-attr.cjs.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"undefined" != typeof process && process.versions && process.versions.node;
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
});
|
|
6
|
+
|
|
3
7
|
var t = require("axios"), s = require("@/globalThis-utils");
|
|
4
8
|
|
|
5
9
|
function e(t, s) {
|
|
@@ -70195,7 +70199,7 @@ function B(t) {
|
|
|
70195
70199
|
}
|
|
70196
70200
|
}
|
|
70197
70201
|
|
|
70198
|
-
function
|
|
70202
|
+
function T(t, s) {
|
|
70199
70203
|
var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "includeOne";
|
|
70200
70204
|
if ("[object String]" !== Object.prototype.toString.call(t)) throw new Error("text 参数错误有误,只能是String类型");
|
|
70201
70205
|
if ("[object Array]" !== Object.prototype.toString.call(s)) throw new Error("arr 参数错误有误,只能是Array类型");
|
|
@@ -70208,7 +70212,7 @@ function A(t, s) {
|
|
|
70208
70212
|
throw new Error("type 参数错误有误,只能是includeOne或includeAll");
|
|
70209
70213
|
}
|
|
70210
70214
|
|
|
70211
|
-
function
|
|
70215
|
+
function A() {
|
|
70212
70216
|
var t = new Date, s = t.getFullYear(), e = t.getMonth() + 1, k = "", d = "";
|
|
70213
70217
|
return e >= 3 && e <= 5 ? (k = "春季", d = "夏季") : e >= 6 && e <= 8 ? (k = "夏季", d = "秋季") : e >= 9 && e <= 11 ? (k = "秋季",
|
|
70214
70218
|
d = "冬季") : (k = "冬季", d = "春季"), {
|
|
@@ -70333,13 +70337,13 @@ function F(t, s, e) {
|
|
|
70333
70337
|
var d = "".concat(e[0]), i = d.match(/(\d{4})[^\d]*/);
|
|
70334
70338
|
if (i) {
|
|
70335
70339
|
var b = "".concat(i[1]), p = "";
|
|
70336
|
-
if (
|
|
70340
|
+
if (T(d, [ "春", "夏", "秋", "冬" ]) && (d.includes("秋冬") ? p = "11" : d.includes("春季") ? p = "03" : d.includes("夏季") ? p = "06" : d.includes("秋季") ? p = "09" : d.includes("冬季") && (p = "12")),
|
|
70337
70341
|
"input" == s.property_type) return p ? b + "-" + p : b;
|
|
70338
70342
|
if ("date" === s.property_type) {
|
|
70339
70343
|
var o, h = (null == s || null === (o = s.date_format) || void 0 === o ? void 0 : o.toUpperCase()) || "YYYY-MM-DD";
|
|
70340
70344
|
if ("YYYY" === h) return b;
|
|
70341
70345
|
if ("YYYY-MM" === h && p) return b + "-" + p;
|
|
70342
|
-
var l =
|
|
70346
|
+
var l = A();
|
|
70343
70347
|
if ("YYYY-MM" === h) return b + "-" + l.month;
|
|
70344
70348
|
if ("YYYY-MM-DD" === h) return b + "-" + l.month + "-" + l.day;
|
|
70345
70349
|
}
|
|
@@ -70577,17 +70581,17 @@ function Z(t, s, e, k) {
|
|
|
70577
70581
|
return "秋季" === t.name;
|
|
70578
70582
|
}) : k.includes("春秋") && (p = e.find(function(t) {
|
|
70579
70583
|
return "春季" === t.name;
|
|
70580
|
-
})) : "袖长" === s.property_name ?
|
|
70584
|
+
})) : "袖长" === s.property_name ? T(k, [ "夏季" ]) ? p = e.find(function(t) {
|
|
70581
70585
|
return "短袖" === t.name;
|
|
70582
|
-
}) :
|
|
70586
|
+
}) : T(k, [ "春季", "秋季", "冬季", "秋冬", "春秋" ]) && (p = e.find(function(t) {
|
|
70583
70587
|
return "长袖" === t.name;
|
|
70584
|
-
})) : "厚度" === s.property_name ?
|
|
70588
|
+
})) : "厚度" === s.property_name ? T(k, [ "夏季", "秋季", "春季", "春秋" ]) ? p = e.find(function(t) {
|
|
70585
70589
|
return "薄款" === t.name;
|
|
70586
|
-
}) :
|
|
70590
|
+
}) : T(k, [ "冬季", "秋冬" ]) && (p = e.find(function(t) {
|
|
70587
70591
|
return "厚款" === t.name;
|
|
70588
|
-
})) : "上衣款式" === s.property_name ?
|
|
70592
|
+
})) : "上衣款式" === s.property_name ? T(k, [ "polo", "Polo", "POLO" ]) && (p = e.find(function(t) {
|
|
70589
70593
|
return "POLO衫" === t.name;
|
|
70590
|
-
})) : "组合件数" !== s.property_name && "组合形式" !== s.property_name ||
|
|
70594
|
+
})) : "组合件数" !== s.property_name && "组合形式" !== s.property_name || T(k, [ "套装", "两件套", "三件套" ]) && (p = e.find(function(t) {
|
|
70591
70595
|
return "多件" === t.name;
|
|
70592
70596
|
}))), p) return p;
|
|
70593
70597
|
} else if ("multiSelect" == s.property_type) {
|
|
@@ -70644,7 +70648,7 @@ function Z(t, s, e, k) {
|
|
|
70644
70648
|
}
|
|
70645
70649
|
if ([ "主面料成分的含量", "面料材质成分含量", "面料成分含量", "面料材质成分含量(%)" ].includes(s.property_name) && [ "input", "inputComponent" ].includes(d)) "input" == d ? s.property_value = "81%(含)—90%(含)" : "inputComponent" === d && (s.property_value = "80"); else if (s.property_name.includes("里料成分含量") && s.property_required && [ "input", "inputComponent" ].includes(d)) "input" == d ? s.property_value = "100%" : "inputComponent" == d && (s.property_value = "100"); else {
|
|
70646
70650
|
if ([ "上市时间", "上市年份季节", "上市时节", "适用季节", "上市年份/季节", "年份季节", "适合季节", "上市年份" ].includes(s.property_name) || "date" == d) {
|
|
70647
|
-
var r =
|
|
70651
|
+
var r = A();
|
|
70648
70652
|
if ("date" == d) {
|
|
70649
70653
|
var U = ((null == s ? void 0 : s.date_format) || "yyyy-MM-dd").toUpperCase(), w = "";
|
|
70650
70654
|
return w = "YYYY-MM-DD" === U ? "".concat(r.year, "-").concat(r.month, "-").concat(r.day) : "YYYY-MM" === U ? "".concat(r.year, "-").concat(r.month) : "".concat(r.year),
|
|
@@ -70653,7 +70657,7 @@ function Z(t, s, e, k) {
|
|
|
70653
70657
|
if ("input" == d) return void (s.property_value = (null == r ? void 0 : r.year) || "");
|
|
70654
70658
|
if ([ "上市年份季节", "上市时节", "上市时间", "上市年份/季节", "年份季节", "上市年份" ].includes(s.property_name) && [ "singleSelect", "multiSelect" ].includes(d)) {
|
|
70655
70659
|
var j = r.year + "年" + r.season, u = i.find(function(t) {
|
|
70656
|
-
return
|
|
70660
|
+
return T(t.name, [ "春", "夏", "秋", "冬" ]) ? t.name === j || t.name + "季" === j : t.name.includes(r.year + "年");
|
|
70657
70661
|
});
|
|
70658
70662
|
if (u) return void ("singleSelect" == d ? s.property_value = u : "multiSelect" == d && (s.property_value = [ u ]));
|
|
70659
70663
|
}
|
|
@@ -71723,8 +71727,72 @@ function lt(t, s) {
|
|
|
71723
71727
|
}
|
|
71724
71728
|
}
|
|
71725
71729
|
|
|
71726
|
-
function at() {
|
|
71727
|
-
|
|
71730
|
+
function at(t, s) {
|
|
71731
|
+
switch (t) {
|
|
71732
|
+
case "pdd":
|
|
71733
|
+
case "tm":
|
|
71734
|
+
case "jd":
|
|
71735
|
+
case "dy":
|
|
71736
|
+
case "shopee":
|
|
71737
|
+
case "xhs":
|
|
71738
|
+
case "ks":
|
|
71739
|
+
case "albb":
|
|
71740
|
+
case "wxsph":
|
|
71741
|
+
default:
|
|
71742
|
+
return "";
|
|
71743
|
+
|
|
71744
|
+
case "tb":
|
|
71745
|
+
return function t(s) {
|
|
71746
|
+
switch (s) {
|
|
71747
|
+
case "singleSelect":
|
|
71748
|
+
return "singleCheck";
|
|
71749
|
+
|
|
71750
|
+
case "multiSelect":
|
|
71751
|
+
return "multiCheck";
|
|
71752
|
+
|
|
71753
|
+
case "multiComplex":
|
|
71754
|
+
return "multiComplex";
|
|
71755
|
+
|
|
71756
|
+
case "inputComponent":
|
|
71757
|
+
case "date":
|
|
71758
|
+
case "input":
|
|
71759
|
+
return "input";
|
|
71760
|
+
|
|
71761
|
+
default:
|
|
71762
|
+
return "unknown";
|
|
71763
|
+
}
|
|
71764
|
+
}(s);
|
|
71765
|
+
|
|
71766
|
+
case "dsy":
|
|
71767
|
+
return function e(t) {
|
|
71768
|
+
switch (t) {
|
|
71769
|
+
case "singleSelect":
|
|
71770
|
+
return "select";
|
|
71771
|
+
|
|
71772
|
+
case "multiSelect":
|
|
71773
|
+
return "checkbox";
|
|
71774
|
+
|
|
71775
|
+
case "multiComplex":
|
|
71776
|
+
return "multiComplex";
|
|
71777
|
+
|
|
71778
|
+
case "inputComponent":
|
|
71779
|
+
case "date":
|
|
71780
|
+
case "input":
|
|
71781
|
+
return "input";
|
|
71782
|
+
|
|
71783
|
+
default:
|
|
71784
|
+
return "unknown";
|
|
71785
|
+
}
|
|
71786
|
+
}(s);
|
|
71787
|
+
}
|
|
71788
|
+
}
|
|
71789
|
+
|
|
71790
|
+
function xt(t) {
|
|
71791
|
+
return mt.apply(this, arguments);
|
|
71792
|
+
}
|
|
71793
|
+
|
|
71794
|
+
function mt() {
|
|
71795
|
+
return mt = d(h().m(function t(s) {
|
|
71728
71796
|
var e, k, d, i, b, p, o, l, a, x, m, f = arguments;
|
|
71729
71797
|
return h().w(function(t) {
|
|
71730
71798
|
for (;;) switch (t.p = t.n) {
|
|
@@ -71738,7 +71806,7 @@ function at() {
|
|
|
71738
71806
|
is_prediction: e >= 1,
|
|
71739
71807
|
is_required_force: e >= 2,
|
|
71740
71808
|
is_other_force: e >= 3
|
|
71741
|
-
}, p =
|
|
71809
|
+
}, p = ft(s.attrs || []), o = {
|
|
71742
71810
|
title: s.title,
|
|
71743
71811
|
goods_sn: s.goods_sn,
|
|
71744
71812
|
remark: s.remark,
|
|
@@ -71780,7 +71848,7 @@ function at() {
|
|
|
71780
71848
|
}
|
|
71781
71849
|
return t.a(2, Promise.resolve({
|
|
71782
71850
|
msg: "成功",
|
|
71783
|
-
data:
|
|
71851
|
+
data: ft(a),
|
|
71784
71852
|
code: 1
|
|
71785
71853
|
}));
|
|
71786
71854
|
|
|
@@ -71816,10 +71884,10 @@ function at() {
|
|
|
71816
71884
|
return t.a(2);
|
|
71817
71885
|
}
|
|
71818
71886
|
}, t, null, [ [ 1, 8 ] ]);
|
|
71819
|
-
})),
|
|
71887
|
+
})), mt.apply(this, arguments);
|
|
71820
71888
|
}
|
|
71821
71889
|
|
|
71822
|
-
function
|
|
71890
|
+
function ft(t) {
|
|
71823
71891
|
var s = [];
|
|
71824
71892
|
return t.forEach(function(t) {
|
|
71825
71893
|
var e = {
|
|
@@ -71836,71 +71904,21 @@ function xt(t) {
|
|
|
71836
71904
|
}), s;
|
|
71837
71905
|
}
|
|
71838
71906
|
|
|
71839
|
-
|
|
71907
|
+
var yt = {
|
|
71908
|
+
createCategoryProperties: lt,
|
|
71909
|
+
getOriginProperty: at,
|
|
71910
|
+
matchCategoryProperties: xt,
|
|
71911
|
+
createCategoryPropertyTemplate: ft
|
|
71912
|
+
};
|
|
71913
|
+
|
|
71914
|
+
"undefined" != typeof module && module.exports && (module.exports = yt, module.exports.default = yt),
|
|
71915
|
+
"undefined" != typeof globalThis && (globalThis.ftdsyAttr = yt), Object.defineProperty(exports, "getGlobal", {
|
|
71840
71916
|
enumerable: !0,
|
|
71841
71917
|
get: function() {
|
|
71842
71918
|
return s.getGlobal;
|
|
71843
71919
|
}
|
|
71844
|
-
}), exports.createCategoryProperties = lt, exports.createCategoryPropertyTemplate =
|
|
71845
|
-
exports.getOriginProperty =
|
|
71846
|
-
|
|
71847
|
-
|
|
71848
|
-
case "tm":
|
|
71849
|
-
case "jd":
|
|
71850
|
-
case "dy":
|
|
71851
|
-
case "shopee":
|
|
71852
|
-
case "xhs":
|
|
71853
|
-
case "ks":
|
|
71854
|
-
case "albb":
|
|
71855
|
-
case "wxsph":
|
|
71856
|
-
default:
|
|
71857
|
-
return "";
|
|
71858
|
-
|
|
71859
|
-
case "tb":
|
|
71860
|
-
return function t(s) {
|
|
71861
|
-
switch (s) {
|
|
71862
|
-
case "singleSelect":
|
|
71863
|
-
return "singleCheck";
|
|
71864
|
-
|
|
71865
|
-
case "multiSelect":
|
|
71866
|
-
return "multiCheck";
|
|
71867
|
-
|
|
71868
|
-
case "multiComplex":
|
|
71869
|
-
return "multiComplex";
|
|
71870
|
-
|
|
71871
|
-
case "inputComponent":
|
|
71872
|
-
case "date":
|
|
71873
|
-
case "input":
|
|
71874
|
-
return "input";
|
|
71875
|
-
|
|
71876
|
-
default:
|
|
71877
|
-
return "unknown";
|
|
71878
|
-
}
|
|
71879
|
-
}(s);
|
|
71880
|
-
|
|
71881
|
-
case "dsy":
|
|
71882
|
-
return function e(t) {
|
|
71883
|
-
switch (t) {
|
|
71884
|
-
case "singleSelect":
|
|
71885
|
-
return "select";
|
|
71886
|
-
|
|
71887
|
-
case "multiSelect":
|
|
71888
|
-
return "checkbox";
|
|
71889
|
-
|
|
71890
|
-
case "multiComplex":
|
|
71891
|
-
return "multiComplex";
|
|
71892
|
-
|
|
71893
|
-
case "inputComponent":
|
|
71894
|
-
case "date":
|
|
71895
|
-
case "input":
|
|
71896
|
-
return "input";
|
|
71897
|
-
|
|
71898
|
-
default:
|
|
71899
|
-
return "unknown";
|
|
71900
|
-
}
|
|
71901
|
-
}(s);
|
|
71902
|
-
}
|
|
71903
|
-
}, exports.matchCategoryProperties = function ft(t) {
|
|
71904
|
-
return at.apply(this, arguments);
|
|
71905
|
-
}, "undefined" != typeof module && module.exports && (module.exports = exports.default || exports);
|
|
71920
|
+
}), exports.createCategoryProperties = lt, exports.createCategoryPropertyTemplate = ft,
|
|
71921
|
+
exports.default = yt, exports.getOriginProperty = at, exports.matchCategoryProperties = xt,
|
|
71922
|
+
"undefined" != typeof module && module.exports && (module.exports = exports.default || exports,
|
|
71923
|
+
module.exports.default = exports.default || {});
|
|
71906
71924
|
//# sourceMappingURL=ftdsy-attr.cjs.js.map
|