eoss-ui 0.5.42 → 0.5.44
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 +929 -0
- package/README.md +18 -0
- package/lib/button-group.js +120 -69
- package/lib/button.js +133 -72
- package/lib/checkbox-group.js +116 -67
- package/lib/data-table-form.js +126 -74
- package/lib/data-table.js +211 -106
- package/lib/date-picker.js +155 -71
- package/lib/dialog.js +132 -71
- package/lib/eoss-ui.common.js +744 -417
- package/lib/flow-group.js +144 -74
- package/lib/flow-list.js +120 -69
- package/lib/flow.js +169 -99
- package/lib/form.js +125 -69
- package/lib/handle-user.js +127 -70
- package/lib/handler.js +145 -92
- package/lib/index.js +1 -1
- package/lib/input-number.js +116 -67
- package/lib/input.js +116 -67
- package/lib/login.js +149 -97
- package/lib/main.js +234 -152
- package/lib/nav.js +116 -67
- package/lib/page.js +116 -67
- package/lib/player.js +116 -67
- package/lib/qr-code.js +116 -67
- package/lib/radio-group.js +116 -67
- package/lib/retrial-auth.js +130 -71
- package/lib/select-ganged.js +116 -67
- package/lib/select.js +116 -67
- package/lib/selector-panel.js +131 -74
- package/lib/selector.js +116 -67
- package/lib/sizer.js +116 -67
- package/lib/steps.js +116 -67
- package/lib/switch.js +116 -67
- package/lib/table-form.js +123 -72
- package/lib/tabs.js +119 -69
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/tips.js +116 -67
- package/lib/tree-group.js +151 -71
- package/lib/tree.js +116 -67
- package/lib/upload.js +136 -78
- package/lib/utils/util.js +116 -67
- package/lib/wujie.js +116 -67
- package/lib/wxlogin.js +116 -67
- package/package.json +2 -2
- package/packages/button/src/main.vue +17 -5
- package/packages/button-group/src/main.vue +2 -0
- package/packages/data-table/src/column.vue +4 -0
- package/packages/data-table/src/main.vue +67 -28
- package/packages/data-table-form/src/tbody.vue +3 -0
- package/packages/date-picker/src/main.vue +48 -5
- package/packages/dialog/src/main.vue +14 -2
- package/packages/flow/src/component/CustomPreset.vue +14 -7
- package/packages/flow/src/component/FileList.vue +4 -2
- package/packages/flow/src/component/Preset.vue +11 -13
- package/packages/flow/src/form.vue +5 -4
- package/packages/flow/src/main.vue +7 -7
- package/packages/flow/src/table.vue +8 -1
- package/packages/flow-group/src/main.vue +26 -5
- package/packages/form/src/main.vue +12 -0
- package/packages/form/src/table.vue +2 -0
- package/packages/handle-user/src/main.vue +9 -1
- package/packages/handler/src/main.vue +31 -27
- package/packages/login/src/main.vue +35 -31
- package/packages/main/src/async-component/index.vue +4 -2
- package/packages/main/src/main.vue +62 -30
- package/packages/main/src/userinfo.vue +29 -25
- package/packages/retrial-auth/src/main.vue +12 -2
- package/packages/selector-panel/src/selection.vue +6 -0
- package/packages/tabs/src/main.vue +1 -0
- package/packages/theme-chalk/lib/data-table.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/src/data-table.scss +6 -0
- package/packages/tree-group/src/main.vue +36 -2
- package/packages/upload/src/main.vue +15 -6
- package/src/index.js +1 -1
- package/src/utils/util.js +132 -80
package/lib/wxlogin.js
CHANGED
|
@@ -258,7 +258,13 @@ var ajax = function ajax(_ref) {
|
|
|
258
258
|
if (response.status === 200) {
|
|
259
259
|
if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
|
|
260
260
|
removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
|
|
261
|
-
|
|
261
|
+
var href = '';
|
|
262
|
+
try {
|
|
263
|
+
href = win.top.location.href;
|
|
264
|
+
} catch (error) {
|
|
265
|
+
href = win.location.href;
|
|
266
|
+
}
|
|
267
|
+
if (href.indexOf('#/login') === -1 && href.indexOf('/login.html') === -1) {
|
|
262
268
|
var remind = sessionStorage.getItem('remind');
|
|
263
269
|
if (!remind) {
|
|
264
270
|
clearTimeout(loginMsg);
|
|
@@ -274,33 +280,37 @@ var ajax = function ajax(_ref) {
|
|
|
274
280
|
closeOnClickModal: false,
|
|
275
281
|
type: 'warning'
|
|
276
282
|
}).then(function () {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
pathname
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
try {
|
|
284
|
+
var loginPage = getStorage('login') || getStorage('loginPage');
|
|
285
|
+
if (loginPage) {
|
|
286
|
+
var src = void 0;
|
|
287
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
288
|
+
var pathname = win.top.location.pathname;
|
|
289
|
+
if (pathname !== '/') {
|
|
290
|
+
pathname = pathname.split('/');
|
|
291
|
+
pathname.splice(pathname.length - 1);
|
|
292
|
+
pathname = pathname.join('/');
|
|
293
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
294
|
+
} else {
|
|
295
|
+
src = pathname + loginPage.replace('./', '');
|
|
296
|
+
}
|
|
287
297
|
} else {
|
|
288
|
-
src =
|
|
298
|
+
src = loginPage;
|
|
289
299
|
}
|
|
300
|
+
win.top.location.href = src;
|
|
301
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
302
|
+
win.top.location.href = './login.html';
|
|
290
303
|
} else {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (hash) {
|
|
299
|
-
var len = win.top.location.href.indexOf(hash);
|
|
300
|
-
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
301
|
-
} else {
|
|
302
|
-
win.top.location.href = '/login.html';
|
|
304
|
+
var hash = win.top.location.hash;
|
|
305
|
+
if (hash) {
|
|
306
|
+
var len = win.top.location.href.indexOf(hash);
|
|
307
|
+
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
308
|
+
} else {
|
|
309
|
+
win.top.location.href = '/login.html';
|
|
310
|
+
}
|
|
303
311
|
}
|
|
312
|
+
} catch (error) {
|
|
313
|
+
win.postMessage({ type: 1 }, '*');
|
|
304
314
|
}
|
|
305
315
|
}).catch(function (e) {
|
|
306
316
|
sessionStorage.removeItem('remind');
|
|
@@ -738,7 +748,13 @@ var delUrlParam = function delUrlParam(_ref2) {
|
|
|
738
748
|
var url = _ref2.url,
|
|
739
749
|
key = _ref2.key;
|
|
740
750
|
|
|
741
|
-
var
|
|
751
|
+
var pUrl = '';
|
|
752
|
+
try {
|
|
753
|
+
pUrl = win.top.location.href;
|
|
754
|
+
} catch (error) {
|
|
755
|
+
pUrl = win.location.href;
|
|
756
|
+
}
|
|
757
|
+
var src = url ? decodeURI(url) : decodeURI(pUrl);
|
|
742
758
|
var param = getParams({ url: src });
|
|
743
759
|
if (param && key.length) {
|
|
744
760
|
if (Array.isArray(key)) {
|
|
@@ -1988,7 +2004,12 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1988
2004
|
}).catch(function () {});
|
|
1989
2005
|
return;
|
|
1990
2006
|
}
|
|
1991
|
-
var pathname =
|
|
2007
|
+
var pathname = '';
|
|
2008
|
+
try {
|
|
2009
|
+
pathname = win.top.location.pathname;
|
|
2010
|
+
} catch (error) {
|
|
2011
|
+
pathname = win.location.pathname;
|
|
2012
|
+
}
|
|
1992
2013
|
if (loginPage) {
|
|
1993
2014
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1994
2015
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -2029,22 +2050,38 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2029
2050
|
deviceUnique: results.deviceUnique
|
|
2030
2051
|
}
|
|
2031
2052
|
});
|
|
2032
|
-
|
|
2033
|
-
url
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2053
|
+
try {
|
|
2054
|
+
var url = delUrlParam({
|
|
2055
|
+
url: win.top.location.href,
|
|
2056
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2057
|
+
});
|
|
2058
|
+
win.top.location.href = url;
|
|
2059
|
+
setTimeout(function () {
|
|
2060
|
+
win.top.location.reload();
|
|
2061
|
+
}, 200);
|
|
2062
|
+
} catch (error) {
|
|
2063
|
+
var _url2 = delUrlParam({
|
|
2064
|
+
url: win.location.href,
|
|
2065
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2066
|
+
});
|
|
2067
|
+
win.location.href = _url2;
|
|
2068
|
+
setTimeout(function () {
|
|
2069
|
+
win.location.reload();
|
|
2070
|
+
}, 200);
|
|
2071
|
+
}
|
|
2040
2072
|
break;
|
|
2041
2073
|
case 1:
|
|
2042
2074
|
break;
|
|
2043
2075
|
case 2:
|
|
2044
2076
|
break;
|
|
2045
2077
|
case 3:
|
|
2046
|
-
|
|
2047
|
-
|
|
2078
|
+
try {
|
|
2079
|
+
var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
|
|
2080
|
+
win.top.location.href = href;
|
|
2081
|
+
} catch (error) {
|
|
2082
|
+
var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
|
|
2083
|
+
win.location.href = _href;
|
|
2084
|
+
}
|
|
2048
2085
|
break;
|
|
2049
2086
|
case 4:
|
|
2050
2087
|
eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
|
|
@@ -2052,14 +2089,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2052
2089
|
type: 'error',
|
|
2053
2090
|
callback: function callback() {
|
|
2054
2091
|
sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
win.top.location.href
|
|
2061
|
-
|
|
2062
|
-
|
|
2092
|
+
try {
|
|
2093
|
+
if (loginPage) {
|
|
2094
|
+
win.top.location.replace(loginPage);
|
|
2095
|
+
} else if (document.referrer) {
|
|
2096
|
+
win.top.location.replace(document.referrer);
|
|
2097
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2098
|
+
win.top.location.href = './login.html';
|
|
2099
|
+
} else {
|
|
2100
|
+
next('/login');
|
|
2101
|
+
}
|
|
2102
|
+
} catch (error) {
|
|
2103
|
+
win.postMessage({ type: 1 }, '*');
|
|
2063
2104
|
}
|
|
2064
2105
|
}
|
|
2065
2106
|
});
|
|
@@ -2071,14 +2112,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2071
2112
|
confirmButtonText: '确定',
|
|
2072
2113
|
type: 'error',
|
|
2073
2114
|
callback: function callback() {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
win.top.location.href
|
|
2080
|
-
|
|
2081
|
-
|
|
2115
|
+
try {
|
|
2116
|
+
if (loginPage) {
|
|
2117
|
+
win.top.location.replace(loginPage);
|
|
2118
|
+
} else if (document.referrer) {
|
|
2119
|
+
win.top.location.replace(document.referrer);
|
|
2120
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2121
|
+
win.top.location.href = './login.html';
|
|
2122
|
+
} else {
|
|
2123
|
+
next('/login');
|
|
2124
|
+
}
|
|
2125
|
+
} catch (error) {
|
|
2126
|
+
win.postMessage({ type: 1 }, '*');
|
|
2082
2127
|
}
|
|
2083
2128
|
}
|
|
2084
2129
|
});
|
|
@@ -2091,14 +2136,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2091
2136
|
next();
|
|
2092
2137
|
}
|
|
2093
2138
|
} else {
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
win.top.location.href
|
|
2100
|
-
|
|
2101
|
-
|
|
2139
|
+
try {
|
|
2140
|
+
if (loginPage) {
|
|
2141
|
+
win.top.location.replace(loginPage);
|
|
2142
|
+
} else if (document.referrer) {
|
|
2143
|
+
win.top.location.replace(document.referrer);
|
|
2144
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2145
|
+
win.top.location.href = './login.html';
|
|
2146
|
+
} else {
|
|
2147
|
+
next('/login');
|
|
2148
|
+
}
|
|
2149
|
+
} catch (error) {
|
|
2150
|
+
win.postMessage({ type: 1 }, '*');
|
|
2102
2151
|
}
|
|
2103
2152
|
}
|
|
2104
2153
|
}
|
|
@@ -2528,30 +2577,30 @@ var setStorage = function setStorage(_ref14) {
|
|
|
2528
2577
|
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
2529
2578
|
value = JSON.stringify(value);
|
|
2530
2579
|
}
|
|
2531
|
-
if (type ===
|
|
2580
|
+
if (type === 'localStorage') {
|
|
2532
2581
|
if (typeof key === 'string') {
|
|
2533
|
-
|
|
2582
|
+
localStorage.setItem(key, value);
|
|
2534
2583
|
} else if (Array.isArray(key)) {
|
|
2535
2584
|
for (var i in key) {
|
|
2536
|
-
|
|
2585
|
+
localStorage.setItem(key[i], value);
|
|
2537
2586
|
}
|
|
2538
2587
|
} else {
|
|
2539
2588
|
for (var _i6 in key) {
|
|
2540
2589
|
var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
|
|
2541
|
-
|
|
2590
|
+
localStorage.setItem(_i6, val);
|
|
2542
2591
|
}
|
|
2543
2592
|
}
|
|
2544
2593
|
} else {
|
|
2545
2594
|
if (typeof key === 'string') {
|
|
2546
|
-
|
|
2595
|
+
sessionStorage.setItem(key, value);
|
|
2547
2596
|
} else if (Array.isArray(key)) {
|
|
2548
2597
|
for (var _i7 in key) {
|
|
2549
|
-
|
|
2598
|
+
sessionStorage.setItem(key[_i7], value);
|
|
2550
2599
|
}
|
|
2551
2600
|
} else {
|
|
2552
2601
|
for (var _i8 in key) {
|
|
2553
2602
|
var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
|
|
2554
|
-
|
|
2603
|
+
sessionStorage.setItem(_i8, _val);
|
|
2555
2604
|
}
|
|
2556
2605
|
}
|
|
2557
2606
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eoss-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.44",
|
|
4
4
|
"description": "eoss内部业务组件",
|
|
5
5
|
"main": "lib/eoss-ui.common.js",
|
|
6
6
|
"files": [
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"cp-cli": "^1.0.2",
|
|
97
97
|
"cross-env": "^3.1.3",
|
|
98
98
|
"css-loader": "^2.1.0",
|
|
99
|
-
"eoss-element": "^0.2.
|
|
99
|
+
"eoss-element": "^0.2.85",
|
|
100
100
|
"es6-promise": "^4.0.5",
|
|
101
101
|
"eslint": "4.18.2",
|
|
102
102
|
"eslint-config-elemefe": "0.1.1",
|
|
@@ -68,8 +68,20 @@ export default {
|
|
|
68
68
|
let param = this.param ? this.param : {};
|
|
69
69
|
evt.stopPropagation();
|
|
70
70
|
evt.preventDefault();
|
|
71
|
-
let width =
|
|
72
|
-
let height =
|
|
71
|
+
let width = 0;
|
|
72
|
+
let height = 0;
|
|
73
|
+
try {
|
|
74
|
+
width = util.win.top.screen.availWidth - 10;
|
|
75
|
+
height = util.win.top.screen.availHeight - 60;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
try {
|
|
78
|
+
width = util.win.parent.screen.availWidth - 10;
|
|
79
|
+
height = util.win.parent.screen.availHeight - 60;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
width = util.win.screen.availWidth - 10;
|
|
82
|
+
height = util.win.screen.availHeight - 60;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
73
85
|
let flag = true;
|
|
74
86
|
if (this.esForm) {
|
|
75
87
|
let params = util.getParams({ url: this.link });
|
|
@@ -211,20 +223,20 @@ export default {
|
|
|
211
223
|
if (flag) {
|
|
212
224
|
if (this.specs) {
|
|
213
225
|
if (typeof this.specs === 'boolean') {
|
|
214
|
-
windows = util.win.
|
|
226
|
+
windows = util.win.open(
|
|
215
227
|
util.urlJoinParams({ url: this.link, param: param }),
|
|
216
228
|
this.name,
|
|
217
229
|
`width=${width}px,height=${height}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
|
|
218
230
|
);
|
|
219
231
|
} else {
|
|
220
|
-
windows = util.win.
|
|
232
|
+
windows = util.win.open(
|
|
221
233
|
util.urlJoinParams({ url: this.link, param: param }),
|
|
222
234
|
this.name,
|
|
223
235
|
this.specs
|
|
224
236
|
);
|
|
225
237
|
}
|
|
226
238
|
} else {
|
|
227
|
-
windows = util.win.
|
|
239
|
+
windows = util.win.open(
|
|
228
240
|
util.urlJoinParams({ url: this.link, param: param })
|
|
229
241
|
);
|
|
230
242
|
}
|
|
@@ -114,9 +114,11 @@ export default {
|
|
|
114
114
|
},
|
|
115
115
|
handleClick(obj) {
|
|
116
116
|
this.$emit('handleClick', obj);
|
|
117
|
+
this.$emit('handle-click', obj);
|
|
117
118
|
},
|
|
118
119
|
handleCommand(res) {
|
|
119
120
|
this.$emit('handleClick', { row: this.data, handle: res });
|
|
121
|
+
this.$emit('handle-click', { row: this.data, handle: res });
|
|
120
122
|
},
|
|
121
123
|
resetWidth() {
|
|
122
124
|
this.$nextTick(() => {
|
|
@@ -800,10 +800,12 @@ export default {
|
|
|
800
800
|
handleBlur(data) {
|
|
801
801
|
this.events && this.events.blur && this.events.blur(data);
|
|
802
802
|
this.$emit('formBlur', data);
|
|
803
|
+
this.$emit('form-blur', data);
|
|
803
804
|
},
|
|
804
805
|
handleFocus(data) {
|
|
805
806
|
this.events && this.events.focus && this.events.focus(data);
|
|
806
807
|
this.$emit('formFocus', data);
|
|
808
|
+
this.$emit('form-focus', data);
|
|
807
809
|
},
|
|
808
810
|
handleChange(data) {
|
|
809
811
|
let { item } = data;
|
|
@@ -871,9 +873,11 @@ export default {
|
|
|
871
873
|
}
|
|
872
874
|
this.events && this.events.change && this.events.change(data);
|
|
873
875
|
this.$emit('formChange', data);
|
|
876
|
+
this.$emit('form-change', data);
|
|
874
877
|
},
|
|
875
878
|
handleClick(data) {
|
|
876
879
|
this.$emit('handleClick', data);
|
|
880
|
+
this.$emit('handle-click', data);
|
|
877
881
|
},
|
|
878
882
|
formatDate(date, fmt) {
|
|
879
883
|
return util.formatDate(date, fmt);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
label-width="0"
|
|
6
6
|
ref="component"
|
|
7
7
|
v-loading="tableLoading"
|
|
8
|
+
element-loading-background="rgba(0, 0, 0, 0.65)"
|
|
8
9
|
:model="tag === 'div' ? '' : datas"
|
|
9
10
|
:element-loading-text="tableLoadingText"
|
|
10
11
|
>
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
submit: hanleSubmit,
|
|
26
27
|
tabs: handleTabs,
|
|
27
28
|
reset: hanleReset,
|
|
28
|
-
cancel: hanleCancel
|
|
29
|
+
cancel: hanleCancel,
|
|
30
|
+
...(toolbars.events || {})
|
|
29
31
|
}"
|
|
30
32
|
></es-toolbar>
|
|
31
33
|
<p v-if="title" ref="title" class="es-table-title" v-html="title"></p>
|
|
@@ -48,7 +50,9 @@
|
|
|
48
50
|
tableHeight !== 'auto' && tableHeight !== false
|
|
49
51
|
? tableHeight
|
|
50
52
|
: undefined,
|
|
51
|
-
border: border
|
|
53
|
+
border: border,
|
|
54
|
+
infiniteScroll: getTableData,
|
|
55
|
+
infiniteScrollDisabled: infiniteDisabled
|
|
52
56
|
}"
|
|
53
57
|
v-on="{
|
|
54
58
|
...$listeners,
|
|
@@ -118,8 +122,12 @@
|
|
|
118
122
|
</template>
|
|
119
123
|
</el-table-column>
|
|
120
124
|
</el-table>
|
|
125
|
+
<div v-if="infiniteScroll" class="es-table-page es-loading-page">
|
|
126
|
+
<span>共{{ config.totalCount }}条,</span>
|
|
127
|
+
<span>已加载{{ datas.length }}条</span>
|
|
128
|
+
</div>
|
|
121
129
|
<es-pagination
|
|
122
|
-
v-if="page"
|
|
130
|
+
v-else-if="page"
|
|
123
131
|
v-bind="config"
|
|
124
132
|
class="es-table-page"
|
|
125
133
|
:style="{ 'text-align': page.position || 'center' }"
|
|
@@ -362,21 +370,16 @@ export default {
|
|
|
362
370
|
}
|
|
363
371
|
},
|
|
364
372
|
rowData: [Object, Boolean],
|
|
365
|
-
least:
|
|
366
|
-
type: Boolean,
|
|
367
|
-
default: false
|
|
368
|
-
},
|
|
373
|
+
least: Boolean,
|
|
369
374
|
//保留搜索参数
|
|
370
|
-
retainSearh:
|
|
371
|
-
|
|
372
|
-
default: false
|
|
373
|
-
}
|
|
375
|
+
retainSearh: Boolean,
|
|
376
|
+
infiniteScroll: Boolean
|
|
374
377
|
},
|
|
375
378
|
data() {
|
|
376
379
|
return {
|
|
377
380
|
requests: [],
|
|
378
381
|
theadData: [],
|
|
379
|
-
list:
|
|
382
|
+
list: [],
|
|
380
383
|
tableLoading: this.loading,
|
|
381
384
|
tableLoadingText: '加载中...',
|
|
382
385
|
isFirsetCheck: false,
|
|
@@ -390,7 +393,6 @@ export default {
|
|
|
390
393
|
pageSize: 20,
|
|
391
394
|
totalCount: 0
|
|
392
395
|
},
|
|
393
|
-
where: {},
|
|
394
396
|
wheres: {},
|
|
395
397
|
tableHeight: 'auto',
|
|
396
398
|
styles: {},
|
|
@@ -398,7 +400,8 @@ export default {
|
|
|
398
400
|
options: {},
|
|
399
401
|
icon: true,
|
|
400
402
|
show: true,
|
|
401
|
-
sysCodes: []
|
|
403
|
+
sysCodes: [],
|
|
404
|
+
infiniteDisabled: this.infiniteScroll
|
|
402
405
|
};
|
|
403
406
|
},
|
|
404
407
|
computed: {
|
|
@@ -419,18 +422,22 @@ export default {
|
|
|
419
422
|
});
|
|
420
423
|
}
|
|
421
424
|
if (this.numbers) {
|
|
425
|
+
let index = 1;
|
|
426
|
+
if (this.infiniteScroll) {
|
|
427
|
+
index = typeof this.index == 'boolean' ? 1 : this.index;
|
|
428
|
+
} else if (this.index || this.index === 0) {
|
|
429
|
+
index =
|
|
430
|
+
this.index === true
|
|
431
|
+
? (this.config.pageNum - 1) * this.config.pageSize + 1
|
|
432
|
+
: this.index;
|
|
433
|
+
}
|
|
422
434
|
thead.push({
|
|
423
435
|
type: 'index',
|
|
424
436
|
label: '序号',
|
|
425
437
|
width: '70',
|
|
426
438
|
align: 'center',
|
|
427
439
|
fixed: 'left',
|
|
428
|
-
index:
|
|
429
|
-
this.index === true
|
|
430
|
-
? (this.config.pageNum - 1) * this.config.pageSize + 1
|
|
431
|
-
: this.index === false
|
|
432
|
-
? 1
|
|
433
|
-
: this.index
|
|
440
|
+
index: index
|
|
434
441
|
});
|
|
435
442
|
}
|
|
436
443
|
if (this.theadData.length) {
|
|
@@ -446,14 +453,14 @@ export default {
|
|
|
446
453
|
},
|
|
447
454
|
datas: {
|
|
448
455
|
get() {
|
|
449
|
-
if (this.list) {
|
|
456
|
+
if (this.list && this.list.length) {
|
|
450
457
|
return this.list;
|
|
451
458
|
}
|
|
452
459
|
if (
|
|
453
460
|
this.page &&
|
|
454
461
|
this.data &&
|
|
455
462
|
this.data.length &&
|
|
456
|
-
this.config.totalCount < this.data.length +
|
|
463
|
+
this.config.totalCount < this.data.length + 2
|
|
457
464
|
) {
|
|
458
465
|
this.config.totalCount = this.data.length - this.lose;
|
|
459
466
|
return this.data.filter((item, index) => {
|
|
@@ -742,12 +749,19 @@ export default {
|
|
|
742
749
|
}
|
|
743
750
|
this.data.splice(index, 0, data);
|
|
744
751
|
this.$emit('dataChange', 'add', data);
|
|
752
|
+
this.$emit('data-change', 'add', data);
|
|
745
753
|
this.$emit('btnClick', {
|
|
746
754
|
event: 'addRow',
|
|
747
755
|
row: data,
|
|
748
756
|
index: index,
|
|
749
757
|
data: this.data
|
|
750
758
|
});
|
|
759
|
+
this.$emit('btn-click', {
|
|
760
|
+
event: 'addRow',
|
|
761
|
+
row: data,
|
|
762
|
+
index: index,
|
|
763
|
+
data: this.data
|
|
764
|
+
});
|
|
751
765
|
} else {
|
|
752
766
|
let index = this.data.length;
|
|
753
767
|
if (this.page) {
|
|
@@ -781,12 +795,19 @@ export default {
|
|
|
781
795
|
}
|
|
782
796
|
this.data.splice(index, 1);
|
|
783
797
|
this.$emit('dataChange', 'delete', data);
|
|
798
|
+
this.$emit('data-change', 'delete', data);
|
|
784
799
|
this.$emit('btnClick', {
|
|
785
800
|
event: 'deleteRow',
|
|
786
801
|
row: data,
|
|
787
802
|
index: index,
|
|
788
803
|
data: this.data
|
|
789
804
|
});
|
|
805
|
+
this.$emit('btn-click', {
|
|
806
|
+
event: 'deleteRow',
|
|
807
|
+
row: data,
|
|
808
|
+
index: index,
|
|
809
|
+
data: this.data
|
|
810
|
+
});
|
|
790
811
|
},
|
|
791
812
|
checkSelect(newVal) {
|
|
792
813
|
this.$nextTick(() => {
|
|
@@ -842,6 +863,7 @@ export default {
|
|
|
842
863
|
});
|
|
843
864
|
},
|
|
844
865
|
getTableData(res) {
|
|
866
|
+
console.log(11212);
|
|
845
867
|
let where;
|
|
846
868
|
let first;
|
|
847
869
|
if (res) {
|
|
@@ -851,7 +873,7 @@ export default {
|
|
|
851
873
|
if (!this.url) {
|
|
852
874
|
return;
|
|
853
875
|
}
|
|
854
|
-
if (first !== false) {
|
|
876
|
+
if (first !== false && !this.infiniteScroll) {
|
|
855
877
|
this.config.pageNum = 1;
|
|
856
878
|
}
|
|
857
879
|
this.tableLoadingText = '加载中...';
|
|
@@ -869,7 +891,7 @@ export default {
|
|
|
869
891
|
reqData = util.extend({}, reqData, where);
|
|
870
892
|
}
|
|
871
893
|
if (this.retainSearh) {
|
|
872
|
-
reqData = util.extend({}, reqData, this.
|
|
894
|
+
reqData = util.extend({}, reqData, this.wheres);
|
|
873
895
|
}
|
|
874
896
|
this.tableLoading = true;
|
|
875
897
|
util
|
|
@@ -883,20 +905,33 @@ export default {
|
|
|
883
905
|
.then((res) => {
|
|
884
906
|
this.tableLoading = false;
|
|
885
907
|
if (res.rCode === 0 || res.status === 'success') {
|
|
886
|
-
this.$refs.oaTable &&
|
|
887
|
-
this.$refs.oaTable.resetScroll &&
|
|
888
|
-
this.$refs.oaTable.resetScroll(0, 0);
|
|
889
908
|
let results =
|
|
890
909
|
this.parseData !== undefined
|
|
891
910
|
? this.parseData(res.results || res.data || res)
|
|
892
911
|
: res.results || res.data;
|
|
893
|
-
this.
|
|
912
|
+
if (this.infiniteScroll) {
|
|
913
|
+
this.list = this.list.concat(
|
|
914
|
+
results.data || results.records || results.list
|
|
915
|
+
);
|
|
916
|
+
this.config.pageNum += 1;
|
|
917
|
+
} else {
|
|
918
|
+
this.list = results.data || results.records || results.list || [];
|
|
919
|
+
this.$refs.oaTable &&
|
|
920
|
+
this.$refs.oaTable.resetScroll &&
|
|
921
|
+
this.$refs.oaTable.resetScroll(0, 0);
|
|
922
|
+
}
|
|
894
923
|
this.config.totalCount =
|
|
895
924
|
results.count || results.total || results.totalCount;
|
|
896
925
|
this.checked &&
|
|
897
926
|
this.$nextTick(() => {
|
|
898
927
|
this.checkSelect(this.checked);
|
|
899
928
|
});
|
|
929
|
+
if (
|
|
930
|
+
this.infiniteScroll &&
|
|
931
|
+
this.config.totalCount === this.list.length
|
|
932
|
+
) {
|
|
933
|
+
this.infiniteDisabled = true;
|
|
934
|
+
}
|
|
900
935
|
} else {
|
|
901
936
|
this.list = [];
|
|
902
937
|
//this.tableHeight = false;
|
|
@@ -1222,6 +1257,7 @@ export default {
|
|
|
1222
1257
|
sizeChange(res) {
|
|
1223
1258
|
this.config.pageSize = res;
|
|
1224
1259
|
this.config.pageNum = 1;
|
|
1260
|
+
this.checkSelect(this.checked);
|
|
1225
1261
|
this.$emit('page-size-change', res);
|
|
1226
1262
|
if (this.url) {
|
|
1227
1263
|
this.getTableData({ where: this.wheres, first: false });
|
|
@@ -1229,6 +1265,7 @@ export default {
|
|
|
1229
1265
|
},
|
|
1230
1266
|
currentChange(res) {
|
|
1231
1267
|
this.config.pageNum = res;
|
|
1268
|
+
this.checkSelect(this.checked);
|
|
1232
1269
|
this.$emit('page-current-change', res);
|
|
1233
1270
|
if (this.url) {
|
|
1234
1271
|
this.getTableData({ where: this.wheres, first: false });
|
|
@@ -1236,10 +1273,12 @@ export default {
|
|
|
1236
1273
|
},
|
|
1237
1274
|
preClick(res) {
|
|
1238
1275
|
this.config.pageNum = res;
|
|
1276
|
+
this.checkSelect(this.checked);
|
|
1239
1277
|
this.$emit('prev', res);
|
|
1240
1278
|
},
|
|
1241
1279
|
nextClick(res) {
|
|
1242
1280
|
this.config.pageNum = res;
|
|
1281
|
+
this.checkSelect(this.checked);
|
|
1243
1282
|
this.$emit('next', res);
|
|
1244
1283
|
},
|
|
1245
1284
|
hanleSearch(data) {
|
|
@@ -219,12 +219,15 @@ export default {
|
|
|
219
219
|
methods: {
|
|
220
220
|
handleBlur(data) {
|
|
221
221
|
this.$emit('formBlur', data);
|
|
222
|
+
this.$emit('form-blur', data);
|
|
222
223
|
},
|
|
223
224
|
handleFocus(data) {
|
|
224
225
|
this.$emit('formFocus', data);
|
|
226
|
+
this.$emit('form-focus', data);
|
|
225
227
|
},
|
|
226
228
|
handleChange(data) {
|
|
227
229
|
this.$emit('formChange', data);
|
|
230
|
+
this.$emit('form-change', data);
|
|
228
231
|
},
|
|
229
232
|
handeClick(res) {
|
|
230
233
|
let { item, data, event } = res;
|