@lambo-design/shared 1.0.0-beta.119 → 1.0.0-beta.120

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.
@@ -0,0 +1,29 @@
1
+ /*
2
+ vxe-table
3
+ */
4
+ /*font*/
5
+ /*size*/
6
+ /*icon*/
7
+ /*color*/
8
+ /*input/radio/checkbox*/
9
+ /*popup*/
10
+ /*table*/
11
+ /*filter*/
12
+ /*menu*/
13
+ /*loading*/
14
+ /*validate*/
15
+ /*grid*/
16
+ /*toolbar*/
17
+ /*tooltip*/
18
+ /*pager*/
19
+ /*modal*/
20
+ /*checkbox*/
21
+ /*radio*/
22
+ /*button*/
23
+ /*input*/
24
+ /*textarea*/
25
+ /*form*/
26
+ /*select*/
27
+ /*switch*/
28
+ /*pulldown*/
29
+ /*# sourceMappingURL=var.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"var.css"}
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.119",
3
+ "version": "1.0.0-beta.120",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
package/utils/base64.js CHANGED
@@ -1,126 +1,126 @@
1
- let Base64 = {
2
- Base64Chars:
3
- "abcdefghijklmnopqrstuv" +
4
- "wxyzABCDEFGHIJKLMNOP" +
5
- "QRSTUVWXYZ0123456789@*-",
6
- /**
7
- * Encode a string to a Base64 string follow Bse64 regular.
8
- * @param s, a normal string
9
- * @return a Base64 string
10
- */
11
- encode: function (s) {
12
- if (!s || s.length == 0) return s;
13
-
14
- var d = "";
15
- var b = this.ucs2_utf8(s);
16
- var b0, b1, b2, b3;
17
- var len = b.length;
18
- var i = 0;
19
- while (i < len) {
20
- var tmp = b[i++];
21
- b0 = (tmp & 0xfc) >> 2;
22
- b1 = (tmp & 0x03) << 4;
23
- if (i < len) {
24
- tmp = b[i++];
25
- b1 |= (tmp & 0xf0) >> 4;
26
- b2 = (tmp & 0x0f) << 2;
27
- if (i < len) {
28
- tmp = b[i++];
29
- b2 |= (tmp & 0xc0) >> 6;
30
- b3 = tmp & 0x3f;
31
- } else {
32
- b3 = 64; // 1 byte "-" is supplement
33
-
34
- }
35
- } else {
36
- b2 = b3 = 64; // 2 bytes "-" are supplement
37
-
38
- }
39
-
40
- d += this.Base64Chars.charAt(b0);
41
- d += this.Base64Chars.charAt(b1);
42
- d += this.Base64Chars.charAt(b2);
43
- d += this.Base64Chars.charAt(b3);
44
- }
45
-
46
- return d;
47
-
48
- },
49
-
50
- /**
51
- * Encodes a ucs2 string to a utf8 integer array.
52
- * @param s, a string
53
- * @return an integer array
54
- */
55
- ucs2_utf8: function (s) {
56
- if (!s) return null;
57
- var d = new Array();
58
- if (s == "") return d;
59
-
60
- var c = 0, i = 0, j = 0;
61
- var len = s.length;
62
- while (i < len) {
63
- c = s.charCodeAt(i++);
64
- if (c <= 0x7f) {
65
- // 1 byte
66
-
67
- d[j++] = c;
68
- } else if ((c >= 0x80) && (c <= 0x7ff)) {
69
- // 2 bytes
70
-
71
- d[j++] = ((c >> 6) & 0x1f) | 0xc0;
72
- d[j++] = (c & 0x3f) | 0x80;
73
- } else {
74
- // 3 bytes
75
-
76
- d[j++] = (c >> 12) | 0xe0;
77
- d[j++] = ((c >> 6) & 0x3f) | 0x80;
78
- d[j++] = (c & 0x3f) | 0x80;
79
- }
80
- }
81
-
82
- return d;
83
- },
84
- /**
85
- * Encodes a utf8 integer array to a ucs2 string.
86
- * @param s, an integer array
87
- * @return a string
88
- */
89
- utf8_ucs2: function (s) {
90
- if (!s) return null;
91
- var len = s.length;
92
- if (len == 0) return "";
93
-
94
- var d = "";
95
- var c = 0, i = 0, tmp = 0;
96
- while (i < len) {
97
- c = s[i++];
98
- if ((c & 0xe0) == 0xe0) {
99
- // 3 bytes
100
-
101
- tmp = (c & 0x0f) << 12;
102
- c = s[i++];
103
- tmp |= ((c & 0x3f) << 6);
104
- c = s[i++];
105
- tmp |= (c & 0x3f);
106
- } else if ((c & 0xc0) == 0xc0) {
107
- // 2 bytes
108
-
109
- tmp = (c & 0x1f) << 6;
110
- c = s[i++];
111
- tmp |= (c & 0x3f);
112
- } else {
113
- // 1 byte
114
-
115
- tmp = c;
116
- }
117
-
118
- d += String.fromCharCode(tmp);
119
- }
120
-
121
- return d;
122
- }
123
- };
124
- export {
125
- Base64
126
- }
1
+ let Base64 = {
2
+ Base64Chars:
3
+ "abcdefghijklmnopqrstuv" +
4
+ "wxyzABCDEFGHIJKLMNOP" +
5
+ "QRSTUVWXYZ0123456789@*-",
6
+ /**
7
+ * Encode a string to a Base64 string follow Bse64 regular.
8
+ * @param s, a normal string
9
+ * @return a Base64 string
10
+ */
11
+ encode: function (s) {
12
+ if (!s || s.length == 0) return s;
13
+
14
+ var d = "";
15
+ var b = this.ucs2_utf8(s);
16
+ var b0, b1, b2, b3;
17
+ var len = b.length;
18
+ var i = 0;
19
+ while (i < len) {
20
+ var tmp = b[i++];
21
+ b0 = (tmp & 0xfc) >> 2;
22
+ b1 = (tmp & 0x03) << 4;
23
+ if (i < len) {
24
+ tmp = b[i++];
25
+ b1 |= (tmp & 0xf0) >> 4;
26
+ b2 = (tmp & 0x0f) << 2;
27
+ if (i < len) {
28
+ tmp = b[i++];
29
+ b2 |= (tmp & 0xc0) >> 6;
30
+ b3 = tmp & 0x3f;
31
+ } else {
32
+ b3 = 64; // 1 byte "-" is supplement
33
+
34
+ }
35
+ } else {
36
+ b2 = b3 = 64; // 2 bytes "-" are supplement
37
+
38
+ }
39
+
40
+ d += this.Base64Chars.charAt(b0);
41
+ d += this.Base64Chars.charAt(b1);
42
+ d += this.Base64Chars.charAt(b2);
43
+ d += this.Base64Chars.charAt(b3);
44
+ }
45
+
46
+ return d;
47
+
48
+ },
49
+
50
+ /**
51
+ * Encodes a ucs2 string to a utf8 integer array.
52
+ * @param s, a string
53
+ * @return an integer array
54
+ */
55
+ ucs2_utf8: function (s) {
56
+ if (!s) return null;
57
+ var d = new Array();
58
+ if (s == "") return d;
59
+
60
+ var c = 0, i = 0, j = 0;
61
+ var len = s.length;
62
+ while (i < len) {
63
+ c = s.charCodeAt(i++);
64
+ if (c <= 0x7f) {
65
+ // 1 byte
66
+
67
+ d[j++] = c;
68
+ } else if ((c >= 0x80) && (c <= 0x7ff)) {
69
+ // 2 bytes
70
+
71
+ d[j++] = ((c >> 6) & 0x1f) | 0xc0;
72
+ d[j++] = (c & 0x3f) | 0x80;
73
+ } else {
74
+ // 3 bytes
75
+
76
+ d[j++] = (c >> 12) | 0xe0;
77
+ d[j++] = ((c >> 6) & 0x3f) | 0x80;
78
+ d[j++] = (c & 0x3f) | 0x80;
79
+ }
80
+ }
81
+
82
+ return d;
83
+ },
84
+ /**
85
+ * Encodes a utf8 integer array to a ucs2 string.
86
+ * @param s, an integer array
87
+ * @return a string
88
+ */
89
+ utf8_ucs2: function (s) {
90
+ if (!s) return null;
91
+ var len = s.length;
92
+ if (len == 0) return "";
93
+
94
+ var d = "";
95
+ var c = 0, i = 0, tmp = 0;
96
+ while (i < len) {
97
+ c = s[i++];
98
+ if ((c & 0xe0) == 0xe0) {
99
+ // 3 bytes
100
+
101
+ tmp = (c & 0x0f) << 12;
102
+ c = s[i++];
103
+ tmp |= ((c & 0x3f) << 6);
104
+ c = s[i++];
105
+ tmp |= (c & 0x3f);
106
+ } else if ((c & 0xc0) == 0xc0) {
107
+ // 2 bytes
108
+
109
+ tmp = (c & 0x1f) << 6;
110
+ c = s[i++];
111
+ tmp |= (c & 0x3f);
112
+ } else {
113
+ // 1 byte
114
+
115
+ tmp = c;
116
+ }
117
+
118
+ d += String.fromCharCode(tmp);
119
+ }
120
+
121
+ return d;
122
+ }
123
+ };
124
+ export {
125
+ Base64
126
+ }
@@ -1,20 +1,20 @@
1
- export const builtInDictKeys = [
2
- 'SEX_ENUM',
3
- 'WHETHER_ENUM'
4
- ]
5
-
6
- export const builtInDictMap = {
7
- 'SEX_ENUM' : { '0': '女', '1': '男' },
8
- 'WHETHER_ENUM' : { '0': '否', '1': '是' }
9
- }
10
-
11
- export const builtInDictList = {
12
- 'SEX_ENUM' : [
13
- { K: '0', V: '女' },
14
- { K: '1', V: '男' },
15
- ],
16
- 'WHETHER_ENUM' : [
17
- { K: '0', V: '否' },
18
- { K: '1', V: '是' },
19
- ]
20
- }
1
+ export const builtInDictKeys = [
2
+ 'SEX_ENUM',
3
+ 'WHETHER_ENUM'
4
+ ]
5
+
6
+ export const builtInDictMap = {
7
+ 'SEX_ENUM' : { '0': '女', '1': '男' },
8
+ 'WHETHER_ENUM' : { '0': '否', '1': '是' }
9
+ }
10
+
11
+ export const builtInDictList = {
12
+ 'SEX_ENUM' : [
13
+ { K: '0', V: '女' },
14
+ { K: '1', V: '男' },
15
+ ],
16
+ 'WHETHER_ENUM' : [
17
+ { K: '0', V: '否' },
18
+ { K: '1', V: '是' },
19
+ ]
20
+ }
@@ -1,75 +1,75 @@
1
- import config from '../../config/config'
2
- import ajax from '../ajax'
3
- import { builtInDictKeys, builtInDictMap, builtInDictList} from './built-in-dict'
4
- import { setSessionStorage, getSessionStorage} from "../platform";
5
-
6
- export async function getAllDict(dictIdArray) {
7
- if (dictIdArray.length > 0) {
8
- try {
9
- const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsForMulti`, { params: { dictIds : dictIdArray.join(",") } })
10
- let result = {}
11
- if (data.code == 1) {
12
- let dictList = data.data;
13
- for (let key in dictList) {
14
- let dicts = dictList[key]
15
- result[key] = {};
16
- if (dicts.length > 0) {
17
- result[key]['enumList'] = dicts
18
- setSessionStorage(key + '_LIST', dicts)
19
- let dictMap = {}
20
- for(let dict of dicts) {
21
- dictMap[dict.K] = dict.V;
22
- }
23
- result[key]['enumData'] = dictMap
24
- setSessionStorage(key + '_MAP', dictMap)
25
- } else if (builtInDictKeys.includes(key)) {
26
- let dicts = builtInDictList[key]
27
- result[key]['enumList'] = dicts
28
- setSessionStorage(key + '_LIST', dicts)
29
- let dictMap = {}
30
- for(let dict of dicts) {
31
- dictMap[dict.K] = dict.V;
32
- }
33
- result[key]['enumData'] = dictMap
34
- setSessionStorage(key + '_MAP', dictMap)
35
- }
36
- }
37
- }
38
- return result
39
- } catch (error) {
40
- console.error(`getDictsForMulti error dictId=${dictIdArray}`, error)
41
- }
42
- }
43
- }
44
-
45
- export async function getDictList(dictId) {
46
- if (builtInDictKeys.includes(dictId)) {
47
- return builtInDictList[dictId]
48
- }
49
- const dictValue = getSessionStorage(dictId + '_LIST')
50
- if (!!dictValue) {
51
- return dictValue
52
- }
53
- let data = await getAllDict([dictId]);
54
- return data[dictId];
55
- }
56
-
57
- export async function getDictMap(dictId) {
58
- if (builtInDictKeys.includes(dictId)) {
59
- return builtInDictMap[dictId]
60
- }
61
- const dictValue = getSessionStorage(dictId + '_MAP')
62
- if (!!dictValue) {
63
- return dictValue
64
- }
65
-
66
- try {
67
- const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsMap`, { params: { dictId : dictId } })
68
- if (data.code == 1) {
69
- setSessionStorage(dictId + '_MAP', data.data)
70
- }
71
- return data.data
72
- } catch (error) {
73
- console.error(`getDictsMap error dictId=${dictId}`, error)
74
- }
75
- }
1
+ import config from '../../config/config'
2
+ import ajax from '../ajax'
3
+ import { builtInDictKeys, builtInDictMap, builtInDictList} from './built-in-dict'
4
+ import { setSessionStorage, getSessionStorage} from "../platform";
5
+
6
+ export async function getAllDict(dictIdArray) {
7
+ if (dictIdArray.length > 0) {
8
+ try {
9
+ const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsForMulti`, { params: { dictIds : dictIdArray.join(",") } })
10
+ let result = {}
11
+ if (data.code == 1) {
12
+ let dictList = data.data;
13
+ for (let key in dictList) {
14
+ let dicts = dictList[key]
15
+ result[key] = {};
16
+ if (dicts.length > 0) {
17
+ result[key]['enumList'] = dicts
18
+ setSessionStorage(key + '_LIST', dicts)
19
+ let dictMap = {}
20
+ for(let dict of dicts) {
21
+ dictMap[dict.K] = dict.V;
22
+ }
23
+ result[key]['enumData'] = dictMap
24
+ setSessionStorage(key + '_MAP', dictMap)
25
+ } else if (builtInDictKeys.includes(key)) {
26
+ let dicts = builtInDictList[key]
27
+ result[key]['enumList'] = dicts
28
+ setSessionStorage(key + '_LIST', dicts)
29
+ let dictMap = {}
30
+ for(let dict of dicts) {
31
+ dictMap[dict.K] = dict.V;
32
+ }
33
+ result[key]['enumData'] = dictMap
34
+ setSessionStorage(key + '_MAP', dictMap)
35
+ }
36
+ }
37
+ }
38
+ return result
39
+ } catch (error) {
40
+ console.error(`getDictsForMulti error dictId=${dictIdArray}`, error)
41
+ }
42
+ }
43
+ }
44
+
45
+ export async function getDictList(dictId) {
46
+ if (builtInDictKeys.includes(dictId)) {
47
+ return builtInDictList[dictId]
48
+ }
49
+ const dictValue = getSessionStorage(dictId + '_LIST')
50
+ if (!!dictValue) {
51
+ return dictValue
52
+ }
53
+ let data = await getAllDict([dictId]);
54
+ return data[dictId];
55
+ }
56
+
57
+ export async function getDictMap(dictId) {
58
+ if (builtInDictKeys.includes(dictId)) {
59
+ return builtInDictMap[dictId]
60
+ }
61
+ const dictValue = getSessionStorage(dictId + '_MAP')
62
+ if (!!dictValue) {
63
+ return dictValue
64
+ }
65
+
66
+ try {
67
+ const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsMap`, { params: { dictId : dictId } })
68
+ if (data.code == 1) {
69
+ setSessionStorage(dictId + '_MAP', data.data)
70
+ }
71
+ return data.data
72
+ } catch (error) {
73
+ console.error(`getDictsMap error dictId=${dictId}`, error)
74
+ }
75
+ }
package/utils/platform.js CHANGED
@@ -579,7 +579,7 @@ export function oneOf (value, validList) {
579
579
  */
580
580
  export const recursionKeyFindItem = (arr, filterKey, filterValue, recursionKey) => {
581
581
  for (const item of arr) {
582
- if (item[filterKey] && item[filterKey] == filterValue) {
582
+ if (item[filterKey] && item[filterKey] == filterValue && item['type'] == 2) {
583
583
  return item;
584
584
  }
585
585
  let result = null;