@lambo-design/shared 1.0.0-beta.59 → 1.0.0-beta.60

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.
File without changes
File without changes
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.59",
4
- "description": "",
5
- "main": "index.js",
6
- "author": "lambo",
7
- "license": "ISC",
8
- "publishConfig": {
9
- "access": "public",
10
- "registry": "https://registry.npmjs.org/"
11
- },
12
- "dependencies": {
13
- "axios": "^0.24.0",
14
- "axios-cache-plugin": "^0.1.0",
15
- "qs": "^6.11.0",
16
- "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
17
- "classnames": "^2.3.1",
18
- "xlsx-style": "^0.8.13",
19
- "moment": "2.29.4"
20
- },
21
- "scripts": {}
22
- }
1
+ {
2
+ "name": "@lambo-design/shared",
3
+ "version": "1.0.0-beta.60",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {},
7
+ "author": "lambo",
8
+ "license": "ISC",
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "registry": "https://registry.npmjs.org/"
12
+ },
13
+ "dependencies": {
14
+ "axios": "^0.24.0",
15
+ "axios-cache-plugin": "^0.1.0",
16
+ "qs": "^6.11.0",
17
+ "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
18
+ "classnames": "^2.3.1",
19
+ "xlsx-style": "^0.8.13",
20
+ "moment": "2.29.4"
21
+ }
22
+ }
package/utils/assist.js CHANGED
@@ -1,88 +1,88 @@
1
- // deepCopy
2
-
3
-
4
- export function deepCopy(data) {
5
- let i;
6
- const t = typeOf(data);
7
- let o;
8
-
9
- if (t === 'array') {
10
- o = [];
11
- } else if (t === 'object') {
12
- o = {};
13
- } else {
14
- return data;
15
- }
16
-
17
- if (t === 'array') {
18
- for (i = 0; i < data.length; i++) {
19
- o.push(deepCopy(data[i]));
20
- }
21
- } else if (t === 'object') {
22
- for (i in data) {
23
- o[i] = deepCopy(data[i]);
24
- }
25
- }
26
- return o;
27
- }
28
-
29
- export function typeOf(obj) {
30
- const toString = Object.prototype.toString;
31
- const map = {
32
- '[object Boolean]': 'boolean',
33
- '[object Number]': 'number',
34
- '[object String]': 'string',
35
- '[object Function]': 'function',
36
- '[object Array]': 'array',
37
- '[object Date]': 'date',
38
- '[object RegExp]': 'regExp',
39
- '[object Undefined]': 'undefined',
40
- '[object Null]': 'null',
41
- '[object Object]': 'object'
42
- };
43
- return map[toString.call(obj)];
44
- }
45
-
46
- export function operateBtn(vm, h, currentRow, operationName, operation, type, permission) {
47
- return h('Button', {
48
- props: {
49
- type: type,
50
- size: "small",
51
- ghost: true,
52
- },
53
- directives: [(permission === '' || permission === null) ? '' : {
54
- name: "permission",
55
- value: permission
56
- }],
57
- style: {
58
- margin: '0 2px'
59
- },
60
- on: {
61
- 'click': () => {
62
- operation(vm, currentRow);
63
- }
64
- }
65
- }, operationName);
66
-
67
- }
68
-
69
- export function operateHref(vm, h, currentRow, operationName, operation, type, permission) {
70
- return h('a', {
71
- style: {
72
- margin: '0 4px'
73
- },
74
- directives: [(permission === '' || permission === null) ? '' : {
75
- name: "permission",
76
- value: permission
77
- }],
78
- on: {
79
- 'click': () => {
80
- operation(vm, currentRow);
81
- }
82
- }
83
- }, operationName);
84
- }
85
-
86
- export function isJson(arg) {
87
- return typeof (arg) == "object" && Object.prototype.toString.call(arg).toLowerCase() == "[object object]" && !arg.length
88
- };
1
+ // deepCopy
2
+
3
+
4
+ export function deepCopy(data) {
5
+ let i;
6
+ const t = typeOf(data);
7
+ let o;
8
+
9
+ if (t === 'array') {
10
+ o = [];
11
+ } else if (t === 'object') {
12
+ o = {};
13
+ } else {
14
+ return data;
15
+ }
16
+
17
+ if (t === 'array') {
18
+ for (i = 0; i < data.length; i++) {
19
+ o.push(deepCopy(data[i]));
20
+ }
21
+ } else if (t === 'object') {
22
+ for (i in data) {
23
+ o[i] = deepCopy(data[i]);
24
+ }
25
+ }
26
+ return o;
27
+ }
28
+
29
+ export function typeOf(obj) {
30
+ const toString = Object.prototype.toString;
31
+ const map = {
32
+ '[object Boolean]': 'boolean',
33
+ '[object Number]': 'number',
34
+ '[object String]': 'string',
35
+ '[object Function]': 'function',
36
+ '[object Array]': 'array',
37
+ '[object Date]': 'date',
38
+ '[object RegExp]': 'regExp',
39
+ '[object Undefined]': 'undefined',
40
+ '[object Null]': 'null',
41
+ '[object Object]': 'object'
42
+ };
43
+ return map[toString.call(obj)];
44
+ }
45
+
46
+ export function operateBtn(vm, h, currentRow, operationName, operation, type, permission) {
47
+ return h('Button', {
48
+ props: {
49
+ type: type,
50
+ size: "small",
51
+ ghost: true,
52
+ },
53
+ directives: [(permission === '' || permission === null) ? '' : {
54
+ name: "permission",
55
+ value: permission
56
+ }],
57
+ style: {
58
+ margin: '0 2px'
59
+ },
60
+ on: {
61
+ 'click': () => {
62
+ operation(vm, currentRow);
63
+ }
64
+ }
65
+ }, operationName);
66
+
67
+ }
68
+
69
+ export function operateHref(vm, h, currentRow, operationName, operation, type, permission) {
70
+ return h('a', {
71
+ style: {
72
+ margin: '0 4px'
73
+ },
74
+ directives: [(permission === '' || permission === null) ? '' : {
75
+ name: "permission",
76
+ value: permission
77
+ }],
78
+ on: {
79
+ 'click': () => {
80
+ operation(vm, currentRow);
81
+ }
82
+ }
83
+ }, operationName);
84
+ }
85
+
86
+ export function isJson(arg) {
87
+ return typeof (arg) == "object" && Object.prototype.toString.call(arg).toLowerCase() == "[object object]" && !arg.length
88
+ };
package/utils/platform.js CHANGED
@@ -428,8 +428,11 @@ export const setTitle = (configTitle,routeItem, vm) => {
428
428
  window.document.title = resTitle
429
429
  }
430
430
 
431
- export const getUrlParams = () => {
432
- const url = location.search; //获取url中"?"符后的字串
431
+ export const getUrlParams = (url) => {
432
+ if (!url){
433
+ url = location.search;
434
+ }
435
+ //const url = location.search; //获取url中"?"符后的字串
433
436
  const theRequest = new Object();
434
437
  if (url.indexOf("?") != -1) {
435
438
  const str = url.substr(1);
@@ -592,4 +595,4 @@ export const turnToPage = (vm, name ,url) =>{
592
595
  name: name
593
596
  })
594
597
  }
595
- }
598
+ }