eoss-mobiles 0.2.30 → 0.2.32
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/CHANGELOG.md +8 -2
- package/lib/checkbox.js +22 -8
- package/lib/eoss-mobile.common.js +85 -54
- package/lib/flow-btn.js +22 -8
- package/lib/flow-list.js +22 -8
- package/lib/flow.js +22 -8
- package/lib/index.js +1 -1
- package/lib/picker.js +79 -48
- package/lib/radio.js +22 -8
- package/lib/retrial-auth.js +22 -8
- package/lib/selector.js +22 -8
- package/lib/table-column.js +22 -8
- package/lib/table.js +22 -8
- package/lib/utils/axios.js +16 -3
- package/lib/utils/http.js +6 -5
- package/package.json +1 -1
- package/packages/picker/src/main.vue +20 -2
- package/src/index.js +1 -1
- package/src/utils/axios.js +30 -6
- package/src/utils/http.js +31 -5
package/lib/table.js
CHANGED
|
@@ -1619,6 +1619,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1619
1619
|
var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1620
1620
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1621
1621
|
var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'get';
|
|
1622
|
+
var isData = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
1623
|
+
var isParams = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
1622
1624
|
|
|
1623
1625
|
var http = external_axios_default.a.create({
|
|
1624
1626
|
baseURL: apiUrl,
|
|
@@ -1682,6 +1684,13 @@ var axios_ajax = function ajax(url) {
|
|
|
1682
1684
|
if (config.url.search('mecp/overtime') !== -1 || config.url.search('mecp/leave') !== -1 || config.url.search('contractext') !== -1 || config.url.search('getSysParam') !== -1) {
|
|
1683
1685
|
delete config.headers.deviceId;
|
|
1684
1686
|
}
|
|
1687
|
+
if (!isData) {
|
|
1688
|
+
delete config.data;
|
|
1689
|
+
}
|
|
1690
|
+
if (!isParams) {
|
|
1691
|
+
delete config.params;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1685
1694
|
return config;
|
|
1686
1695
|
}, function (error) {
|
|
1687
1696
|
return Promise.error(error);
|
|
@@ -1765,6 +1774,8 @@ var base = {
|
|
|
1765
1774
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1766
1775
|
var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1767
1776
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
1777
|
+
var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1778
|
+
var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
1768
1779
|
|
|
1769
1780
|
if (params.params && url.search('registerNew') === -1) {
|
|
1770
1781
|
params.params.userId = params.params.userId ? params.params.userId : util["a" /* default */].getStorage('userId');
|
|
@@ -1783,16 +1794,18 @@ var base = {
|
|
|
1783
1794
|
}
|
|
1784
1795
|
return axios_ajax(url, {
|
|
1785
1796
|
params: params
|
|
1786
|
-
}, headers, format);
|
|
1797
|
+
}, headers, format, 'get', isData, isParams);
|
|
1787
1798
|
},
|
|
1788
1799
|
post: function post(url, params, headers, format) {
|
|
1789
|
-
|
|
1800
|
+
var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1801
|
+
var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
1802
|
+
|
|
1790
1803
|
if (params.params) {
|
|
1791
1804
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1792
1805
|
} else {
|
|
1793
1806
|
params.userId = params.userId || util["a" /* default */].getStorage('userId');
|
|
1794
1807
|
}
|
|
1795
|
-
return axios_ajax(url, params, headers, format, 'post');
|
|
1808
|
+
return axios_ajax(url, params, headers, format, 'post', isData, isParams);
|
|
1796
1809
|
}
|
|
1797
1810
|
};
|
|
1798
1811
|
/* harmony default export */ var axios = (base);
|
|
@@ -1800,21 +1813,22 @@ var base = {
|
|
|
1800
1813
|
|
|
1801
1814
|
var http_request = function request(options) {
|
|
1802
1815
|
var fn = void 0;
|
|
1816
|
+
console.log(options, 'sss');
|
|
1803
1817
|
switch (options.type) {
|
|
1804
1818
|
case 'post':
|
|
1805
|
-
fn = axios.post(options.url, options.params, options.headers, options.format);
|
|
1819
|
+
fn = axios.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
|
|
1806
1820
|
break;
|
|
1807
1821
|
case 'POST':
|
|
1808
|
-
fn = axios.post(options.url, options.params, options.headers, options.format);
|
|
1822
|
+
fn = axios.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
|
|
1809
1823
|
break;
|
|
1810
1824
|
case 'get':
|
|
1811
|
-
fn = axios.get(options.url, options.params, options.headers = {});
|
|
1825
|
+
fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
1812
1826
|
break;
|
|
1813
1827
|
case 'GET':
|
|
1814
|
-
fn = axios.get(options.url, options.params, options.headers = {});
|
|
1828
|
+
fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
1815
1829
|
break;
|
|
1816
1830
|
default:
|
|
1817
|
-
fn = axios.get(options.url, options.params, options.headers = {});
|
|
1831
|
+
fn = axios.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
1818
1832
|
}
|
|
1819
1833
|
return fn;
|
|
1820
1834
|
};
|
package/lib/utils/axios.js
CHANGED
|
@@ -25,6 +25,8 @@ var ajax = function ajax(url) {
|
|
|
25
25
|
var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
26
26
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
27
27
|
var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'get';
|
|
28
|
+
var isData = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
29
|
+
var isParams = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
28
30
|
|
|
29
31
|
var http = _axios2.default.create({
|
|
30
32
|
baseURL: apiUrl,
|
|
@@ -88,6 +90,13 @@ var ajax = function ajax(url) {
|
|
|
88
90
|
if (config.url.search('mecp/overtime') !== -1 || config.url.search('mecp/leave') !== -1 || config.url.search('contractext') !== -1 || config.url.search('getSysParam') !== -1) {
|
|
89
91
|
delete config.headers.deviceId;
|
|
90
92
|
}
|
|
93
|
+
if (!isData) {
|
|
94
|
+
delete config.data;
|
|
95
|
+
}
|
|
96
|
+
if (!isParams) {
|
|
97
|
+
delete config.params;
|
|
98
|
+
}
|
|
99
|
+
|
|
91
100
|
return config;
|
|
92
101
|
}, function (error) {
|
|
93
102
|
return Promise.error(error);
|
|
@@ -171,6 +180,8 @@ var base = {
|
|
|
171
180
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
172
181
|
var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
173
182
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
183
|
+
var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
184
|
+
var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
174
185
|
|
|
175
186
|
if (params.params && url.search('registerNew') === -1) {
|
|
176
187
|
params.params.userId = params.params.userId ? params.params.userId : _util2.default.getStorage('userId');
|
|
@@ -189,16 +200,18 @@ var base = {
|
|
|
189
200
|
}
|
|
190
201
|
return ajax(url, {
|
|
191
202
|
params: params
|
|
192
|
-
}, headers, format);
|
|
203
|
+
}, headers, format, 'get', isData, isParams);
|
|
193
204
|
},
|
|
194
205
|
post: function post(url, params, headers, format) {
|
|
195
|
-
|
|
206
|
+
var isData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
207
|
+
var isParams = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
208
|
+
|
|
196
209
|
if (params.params) {
|
|
197
210
|
params.params.userId = params.params.userId || _util2.default.getStorage('userId');
|
|
198
211
|
} else {
|
|
199
212
|
params.userId = params.userId || _util2.default.getStorage('userId');
|
|
200
213
|
}
|
|
201
|
-
return ajax(url, params, headers, format, 'post');
|
|
214
|
+
return ajax(url, params, headers, format, 'post', isData, isParams);
|
|
202
215
|
}
|
|
203
216
|
};
|
|
204
217
|
exports.default = base;
|
package/lib/utils/http.js
CHANGED
|
@@ -10,21 +10,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
10
10
|
|
|
11
11
|
var request = function request(options) {
|
|
12
12
|
var fn = void 0;
|
|
13
|
+
console.log(options, 'sss');
|
|
13
14
|
switch (options.type) {
|
|
14
15
|
case 'post':
|
|
15
|
-
fn = _axios2.default.post(options.url, options.params, options.headers, options.format);
|
|
16
|
+
fn = _axios2.default.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
|
|
16
17
|
break;
|
|
17
18
|
case 'POST':
|
|
18
|
-
fn = _axios2.default.post(options.url, options.params, options.headers, options.format);
|
|
19
|
+
fn = _axios2.default.post(options.url, options.params, options.headers, options.format, options.isData, options.isParams);
|
|
19
20
|
break;
|
|
20
21
|
case 'get':
|
|
21
|
-
fn = _axios2.default.get(options.url, options.params, options.headers = {});
|
|
22
|
+
fn = _axios2.default.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
22
23
|
break;
|
|
23
24
|
case 'GET':
|
|
24
|
-
fn = _axios2.default.get(options.url, options.params, options.headers = {});
|
|
25
|
+
fn = _axios2.default.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
25
26
|
break;
|
|
26
27
|
default:
|
|
27
|
-
fn = _axios2.default.get(options.url, options.params, options.headers = {});
|
|
28
|
+
fn = _axios2.default.get(options.url, options.params, options.headers = {}, options.format = false, options.isData = true, options.isParams = true);
|
|
28
29
|
}
|
|
29
30
|
return fn;
|
|
30
31
|
};
|
package/package.json
CHANGED
|
@@ -198,6 +198,10 @@ export default {
|
|
|
198
198
|
type: String,
|
|
199
199
|
default: 'name'
|
|
200
200
|
},
|
|
201
|
+
objectType: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: true
|
|
204
|
+
},
|
|
201
205
|
sysAppCode: {
|
|
202
206
|
type: String,
|
|
203
207
|
default: ''
|
|
@@ -244,7 +248,21 @@ export default {
|
|
|
244
248
|
return this.getValue();
|
|
245
249
|
},
|
|
246
250
|
set(val) {
|
|
247
|
-
this
|
|
251
|
+
if (!this.objectType && val.length === undefined) {
|
|
252
|
+
this.$emit(
|
|
253
|
+
'input',
|
|
254
|
+
val[this.sysAppCode ? 'cciValue' : this.valueKey]
|
|
255
|
+
);
|
|
256
|
+
} else if (!this.objectType && val.length != undefined) {
|
|
257
|
+
val.map(x => {
|
|
258
|
+
if (typeof x === 'object') {
|
|
259
|
+
x = x[this.sysAppCode ? 'cciValue' : this.valueKey];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
this.$emit('input', val);
|
|
263
|
+
} else {
|
|
264
|
+
this.$emit('input', val);
|
|
265
|
+
}
|
|
248
266
|
}
|
|
249
267
|
}
|
|
250
268
|
},
|
|
@@ -459,7 +477,7 @@ export default {
|
|
|
459
477
|
.then(res => {
|
|
460
478
|
const { status, data, message, rCode, results } = res;
|
|
461
479
|
this.listLoading = false;
|
|
462
|
-
if (status == 'success' || rCode === 0|| status === true) {
|
|
480
|
+
if (status == 'success' || rCode === 0 || status === true) {
|
|
463
481
|
let info = this.resultsName
|
|
464
482
|
? data
|
|
465
483
|
? data[this.resultsName]
|
package/src/index.js
CHANGED
package/src/utils/axios.js
CHANGED
|
@@ -4,7 +4,15 @@ import $ from './util';
|
|
|
4
4
|
import qs from 'qs';
|
|
5
5
|
let apiUrl = $.getStorage('host');
|
|
6
6
|
|
|
7
|
-
const ajax = (
|
|
7
|
+
const ajax = (
|
|
8
|
+
url,
|
|
9
|
+
params = {},
|
|
10
|
+
headers = {},
|
|
11
|
+
format = true,
|
|
12
|
+
type = 'get',
|
|
13
|
+
isData = true,
|
|
14
|
+
isParams = true
|
|
15
|
+
) => {
|
|
8
16
|
let http = Axios.create({
|
|
9
17
|
baseURL: apiUrl,
|
|
10
18
|
timeout: 60000,
|
|
@@ -77,6 +85,13 @@ const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
|
77
85
|
) {
|
|
78
86
|
delete config.headers.deviceId;
|
|
79
87
|
}
|
|
88
|
+
if (!isData) {
|
|
89
|
+
delete config.data;
|
|
90
|
+
}
|
|
91
|
+
if (!isParams) {
|
|
92
|
+
delete config.params;
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
return config;
|
|
81
96
|
},
|
|
82
97
|
error => {
|
|
@@ -161,7 +176,14 @@ const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
|
161
176
|
// 响应拦截器
|
|
162
177
|
|
|
163
178
|
const base = {
|
|
164
|
-
get: (
|
|
179
|
+
get: (
|
|
180
|
+
url,
|
|
181
|
+
params = {},
|
|
182
|
+
headers = {},
|
|
183
|
+
format = false,
|
|
184
|
+
isData = true,
|
|
185
|
+
isParams = true
|
|
186
|
+
) => {
|
|
165
187
|
if (params.params && url.search('registerNew') === -1) {
|
|
166
188
|
params.params.userId = params.params.userId
|
|
167
189
|
? params.params.userId
|
|
@@ -185,17 +207,19 @@ const base = {
|
|
|
185
207
|
params
|
|
186
208
|
},
|
|
187
209
|
headers,
|
|
188
|
-
format
|
|
210
|
+
format,
|
|
211
|
+
'get',
|
|
212
|
+
isData,
|
|
213
|
+
isParams
|
|
189
214
|
);
|
|
190
215
|
},
|
|
191
|
-
post: (url, params, headers, format) => {
|
|
192
|
-
console.log(params, 'params');
|
|
216
|
+
post: (url, params, headers, format, isData = true, isParams = true) => {
|
|
193
217
|
if (params.params) {
|
|
194
218
|
params.params.userId = params.params.userId || $.getStorage('userId');
|
|
195
219
|
} else {
|
|
196
220
|
params.userId = params.userId || $.getStorage('userId');
|
|
197
221
|
}
|
|
198
|
-
return ajax(url, params, headers, format, 'post');
|
|
222
|
+
return ajax(url, params, headers, format, 'post', isData, isParams);
|
|
199
223
|
}
|
|
200
224
|
};
|
|
201
225
|
export default base;
|
package/src/utils/http.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import base from './axios';
|
|
2
2
|
const request = options => {
|
|
3
3
|
let fn;
|
|
4
|
+
console.log(options, 'sss');
|
|
4
5
|
switch (options.type) {
|
|
5
6
|
case 'post':
|
|
6
7
|
fn = base.post(
|
|
7
8
|
options.url,
|
|
8
9
|
options.params,
|
|
9
10
|
options.headers,
|
|
10
|
-
options.format
|
|
11
|
+
options.format,
|
|
12
|
+
options.isData,
|
|
13
|
+
options.isParams
|
|
11
14
|
);
|
|
12
15
|
break;
|
|
13
16
|
case 'POST':
|
|
@@ -15,17 +18,40 @@ const request = options => {
|
|
|
15
18
|
options.url,
|
|
16
19
|
options.params,
|
|
17
20
|
options.headers,
|
|
18
|
-
options.format
|
|
21
|
+
options.format,
|
|
22
|
+
options.isData,
|
|
23
|
+
options.isParams
|
|
19
24
|
);
|
|
20
25
|
break;
|
|
21
26
|
case 'get':
|
|
22
|
-
fn = base.get(
|
|
27
|
+
fn = base.get(
|
|
28
|
+
options.url,
|
|
29
|
+
options.params,
|
|
30
|
+
(options.headers = {}),
|
|
31
|
+
(options.format = false),
|
|
32
|
+
(options.isData = true),
|
|
33
|
+
(options.isParams = true)
|
|
34
|
+
);
|
|
23
35
|
break;
|
|
24
36
|
case 'GET':
|
|
25
|
-
fn = base.get(
|
|
37
|
+
fn = base.get(
|
|
38
|
+
options.url,
|
|
39
|
+
options.params,
|
|
40
|
+
(options.headers = {}),
|
|
41
|
+
(options.format = false),
|
|
42
|
+
(options.isData = true),
|
|
43
|
+
(options.isParams = true)
|
|
44
|
+
);
|
|
26
45
|
break;
|
|
27
46
|
default:
|
|
28
|
-
fn = base.get(
|
|
47
|
+
fn = base.get(
|
|
48
|
+
options.url,
|
|
49
|
+
options.params,
|
|
50
|
+
(options.headers = {}),
|
|
51
|
+
(options.format = false),
|
|
52
|
+
(options.isData = true),
|
|
53
|
+
(options.isParams = true)
|
|
54
|
+
);
|
|
29
55
|
}
|
|
30
56
|
return fn;
|
|
31
57
|
};
|