@kmkf-fe-packages/kmkf-utils 0.21.4-alpha.4 → 0.21.4
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/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1122334
|
|
@@ -15,8 +15,25 @@ var BsAddressData = /*#__PURE__*/function () {
|
|
|
15
15
|
_defineProperty(this, "addrNameMap", {});
|
|
16
16
|
_defineProperty(this, "addressOptions", []);
|
|
17
17
|
_defineProperty(this, "initData", function () {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// if (Object.keys(this.addrData)?.length > 0) return;
|
|
19
|
+
try {
|
|
20
|
+
if (localStorage.getItem("bsAddressData")) {
|
|
21
|
+
var list = JSON.parse(localStorage.getItem("bsAddressData") || "[]");
|
|
22
|
+
var map = {};
|
|
23
|
+
var res = {};
|
|
24
|
+
for (var i = 0; i < list.length; i++) {
|
|
25
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
26
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
27
|
+
}
|
|
28
|
+
_this.addrData = res;
|
|
29
|
+
_this.addrNameMap = map;
|
|
30
|
+
_this.addressOptions = toTree(list, 1);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {
|
|
34
|
+
var _Object$keys;
|
|
35
|
+
if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
|
|
36
|
+
}
|
|
20
37
|
request({
|
|
21
38
|
url: "/qy/gdfw/template/queryBsAreas",
|
|
22
39
|
method: "get",
|
|
@@ -26,9 +43,10 @@ var BsAddressData = /*#__PURE__*/function () {
|
|
|
26
43
|
var res = {};
|
|
27
44
|
var _resp$data = resp.data,
|
|
28
45
|
list = _resp$data === void 0 ? [] : _resp$data;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
localStorage.setItem("bsAddressData", JSON.stringify(list));
|
|
47
|
+
for (var _i = 0; _i < list.length; _i++) {
|
|
48
|
+
res[list[_i]["id"]] = [list[_i]["name"], list[_i]["parentId"]];
|
|
49
|
+
map[list[_i]["name"]] = list[_i]["id"];
|
|
32
50
|
}
|
|
33
51
|
_this.addrData = res;
|
|
34
52
|
_this.addrNameMap = map;
|
|
@@ -33,9 +33,7 @@ var getExpression = function getExpression(condition, l, r) {
|
|
|
33
33
|
return l === null || l === void 0 ? void 0 : l.includes(r);
|
|
34
34
|
}
|
|
35
35
|
if (condition === 'NIN') {
|
|
36
|
-
|
|
37
|
-
var include = Array.isArray(l) ? ((_intersection = intersection(r, l)) === null || _intersection === void 0 ? void 0 : _intersection.length) > 0 : ((_intersection2 = intersection(r, [l])) === null || _intersection2 === void 0 ? void 0 : _intersection2.length) > 0;
|
|
38
|
-
return !include;
|
|
36
|
+
return !(l !== null && l !== void 0 && l.includes(r));
|
|
39
37
|
}
|
|
40
38
|
if (condition === 'NON') {
|
|
41
39
|
return isNull(l);
|
|
@@ -45,8 +43,8 @@ var getExpression = function getExpression(condition, l, r) {
|
|
|
45
43
|
}
|
|
46
44
|
// 包含任一
|
|
47
45
|
if (condition === 'INCLUDE') {
|
|
48
|
-
var
|
|
49
|
-
return Array.isArray(l) ? ((
|
|
46
|
+
var _intersection, _intersection2;
|
|
47
|
+
return Array.isArray(l) ? ((_intersection = intersection(r, l)) === null || _intersection === void 0 ? void 0 : _intersection.length) > 0 : ((_intersection2 = intersection(r, [l])) === null || _intersection2 === void 0 ? void 0 : _intersection2.length) > 0;
|
|
50
48
|
}
|
|
51
49
|
return false;
|
|
52
50
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "0.21.4
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"gitHooks": {
|
|
43
43
|
"pre-commit": "lint-staged"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "510c76d8426f214eb5653d9e75a59fa44e318939"
|
|
46
46
|
}
|