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
|
@@ -112,6 +112,12 @@
|
|
|
112
112
|
border: $--table-border;
|
|
113
113
|
padding: 8px 12px;
|
|
114
114
|
background-color: $--table-page-background-color;
|
|
115
|
+
&.es-loading-page {
|
|
116
|
+
line-height: 30px;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
color: rgba(0, 0, 0, 0.75);
|
|
120
|
+
}
|
|
115
121
|
}
|
|
116
122
|
.es-thead-border {
|
|
117
123
|
.el-table__header {
|
|
@@ -224,7 +224,8 @@ export default {
|
|
|
224
224
|
checkedAsSearch: {
|
|
225
225
|
type: Boolean,
|
|
226
226
|
default: true
|
|
227
|
-
}
|
|
227
|
+
},
|
|
228
|
+
iframe: Boolean
|
|
228
229
|
},
|
|
229
230
|
computed: {
|
|
230
231
|
wujieName() {
|
|
@@ -238,7 +239,8 @@ export default {
|
|
|
238
239
|
return 'wujie';
|
|
239
240
|
} else if (
|
|
240
241
|
src.indexOf('dhtml') > -1 ||
|
|
241
|
-
(src.indexOf('html') > -1 && src.indexOf('html#') === -1)
|
|
242
|
+
(src.indexOf('html') > -1 && src.indexOf('html#') === -1) ||
|
|
243
|
+
this.iframe
|
|
242
244
|
) {
|
|
243
245
|
return 'iframe';
|
|
244
246
|
} else {
|
|
@@ -524,6 +526,38 @@ export default {
|
|
|
524
526
|
},
|
|
525
527
|
handleCurrentFirst(type, res, tabs) {
|
|
526
528
|
this.$emit('current-first', type, res, tabs);
|
|
529
|
+
},
|
|
530
|
+
hasRouter(res, url) {
|
|
531
|
+
if (!url) {
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
if (Array.isArray(res)) {
|
|
535
|
+
for (let i in res) {
|
|
536
|
+
let path = this.hasRouter(res[i], url);
|
|
537
|
+
if (path) {
|
|
538
|
+
return path;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
let path = res.path;
|
|
543
|
+
if (path !== '/' && path !== '/404') {
|
|
544
|
+
path = path.replace(path[1], path[1].toLowerCase());
|
|
545
|
+
}
|
|
546
|
+
let pathname = url.substring(url.indexOf('#/') + 1);
|
|
547
|
+
pathname = pathname
|
|
548
|
+
.replace(pathname[1], pathname[1].toLowerCase())
|
|
549
|
+
.split('?')[0];
|
|
550
|
+
if (res.path !== '/' && pathname == path) {
|
|
551
|
+
return pathname;
|
|
552
|
+
}
|
|
553
|
+
if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
|
|
554
|
+
let path = this.hasRouter(res.children, url);
|
|
555
|
+
if (path) {
|
|
556
|
+
return path;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return false;
|
|
527
561
|
}
|
|
528
562
|
}
|
|
529
563
|
};
|
|
@@ -802,7 +802,16 @@ export default {
|
|
|
802
802
|
this.$refs.upload.submit();
|
|
803
803
|
},
|
|
804
804
|
openKkfileview(file) {
|
|
805
|
-
let host =
|
|
805
|
+
let host = '';
|
|
806
|
+
try {
|
|
807
|
+
host = util.win.top.location.origin;
|
|
808
|
+
} catch (error) {
|
|
809
|
+
try {
|
|
810
|
+
host = util.win.parent.location.origin;
|
|
811
|
+
} catch (error) {
|
|
812
|
+
host = util.win.location.origin;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
806
815
|
if (this.host) {
|
|
807
816
|
if (util.startWith(this.host, 'http')) {
|
|
808
817
|
host = this.host;
|
|
@@ -821,7 +830,7 @@ export default {
|
|
|
821
830
|
}&fullfilename=${file.originalName}`
|
|
822
831
|
)
|
|
823
832
|
);
|
|
824
|
-
util.win.
|
|
833
|
+
util.win.open(`${this.kkfileview}?url=${url}`);
|
|
825
834
|
},
|
|
826
835
|
handlePreview(res) {
|
|
827
836
|
if (this.preview) {
|
|
@@ -848,7 +857,7 @@ export default {
|
|
|
848
857
|
if (this.kkfileview) {
|
|
849
858
|
this.openKkfileview(file);
|
|
850
859
|
} else {
|
|
851
|
-
util.win.
|
|
860
|
+
util.win.open(
|
|
852
861
|
this.host +
|
|
853
862
|
(url ? url : previewAdjunctOffice) +
|
|
854
863
|
'?cmd=view&bucketName=' +
|
|
@@ -863,7 +872,7 @@ export default {
|
|
|
863
872
|
if (this.kkfileview) {
|
|
864
873
|
this.openKkfileview(file);
|
|
865
874
|
} else {
|
|
866
|
-
util.win.
|
|
875
|
+
util.win.open(
|
|
867
876
|
this.host +
|
|
868
877
|
(url ? url : previewAdjunct2) +
|
|
869
878
|
'/' +
|
|
@@ -904,7 +913,7 @@ export default {
|
|
|
904
913
|
if (this.kkfileview) {
|
|
905
914
|
this.openKkfileview(file);
|
|
906
915
|
} else {
|
|
907
|
-
util.win.
|
|
916
|
+
util.win.open(
|
|
908
917
|
this.host +
|
|
909
918
|
(url ? url : this.previewAdjunct) +
|
|
910
919
|
'?adjunctId=' +
|
|
@@ -913,7 +922,7 @@ export default {
|
|
|
913
922
|
}
|
|
914
923
|
}
|
|
915
924
|
} else {
|
|
916
|
-
util.win.
|
|
925
|
+
util.win.open(URL.createObjectURL(file.raw));
|
|
917
926
|
}
|
|
918
927
|
}
|
|
919
928
|
}
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -185,9 +185,15 @@ const ajax = function ({
|
|
|
185
185
|
'mainConfig',
|
|
186
186
|
'jump'
|
|
187
187
|
]);
|
|
188
|
+
let href = '';
|
|
189
|
+
try {
|
|
190
|
+
href = win.top.location.href;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
href = win.location.href;
|
|
193
|
+
}
|
|
188
194
|
if (
|
|
189
|
-
|
|
190
|
-
|
|
195
|
+
href.indexOf('#/login') === -1 &&
|
|
196
|
+
href.indexOf('/login.html') === -1
|
|
191
197
|
) {
|
|
192
198
|
let remind = sessionStorage.getItem('remind');
|
|
193
199
|
if (!remind) {
|
|
@@ -213,36 +219,40 @@ const ajax = function ({
|
|
|
213
219
|
}
|
|
214
220
|
)
|
|
215
221
|
.then(() => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
pathname
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
try {
|
|
223
|
+
const loginPage = getStorage('login') || getStorage('loginPage');
|
|
224
|
+
if (loginPage) {
|
|
225
|
+
let src;
|
|
226
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
227
|
+
let pathname = win.top.location.pathname;
|
|
228
|
+
if (pathname !== '/') {
|
|
229
|
+
pathname = pathname.split('/');
|
|
230
|
+
pathname.splice(pathname.length - 1);
|
|
231
|
+
pathname = pathname.join('/');
|
|
232
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
233
|
+
} else {
|
|
234
|
+
src = pathname + loginPage.replace('./', '');
|
|
235
|
+
}
|
|
226
236
|
} else {
|
|
227
|
-
src =
|
|
237
|
+
src = loginPage;
|
|
228
238
|
}
|
|
239
|
+
win.top.location.href = src;
|
|
240
|
+
} else if (
|
|
241
|
+
win.top.location.href.indexOf('main.html') > -1
|
|
242
|
+
) {
|
|
243
|
+
win.top.location.href = './login.html';
|
|
229
244
|
} else {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const hash = win.top.location.hash;
|
|
239
|
-
if (hash) {
|
|
240
|
-
const len = win.top.location.href.indexOf(hash);
|
|
241
|
-
win.top.location.href =
|
|
242
|
-
win.location.href.slice(0, len) + '#/login';
|
|
243
|
-
} else {
|
|
244
|
-
win.top.location.href = '/login.html';
|
|
245
|
+
const hash = win.top.location.hash;
|
|
246
|
+
if (hash) {
|
|
247
|
+
const len = win.top.location.href.indexOf(hash);
|
|
248
|
+
win.top.location.href =
|
|
249
|
+
win.location.href.slice(0, len) + '#/login';
|
|
250
|
+
} else {
|
|
251
|
+
win.top.location.href = '/login.html';
|
|
252
|
+
}
|
|
245
253
|
}
|
|
254
|
+
} catch (error) {
|
|
255
|
+
win.postMessage({ type: 1 }, '*');
|
|
246
256
|
}
|
|
247
257
|
})
|
|
248
258
|
.catch(e => {
|
|
@@ -663,7 +673,13 @@ const debounce = function (callback, delay) {
|
|
|
663
673
|
* @param {String,Array} [key] - 参数名
|
|
664
674
|
**/
|
|
665
675
|
const delUrlParam = function ({ url, key }) {
|
|
666
|
-
let
|
|
676
|
+
let pUrl = '';
|
|
677
|
+
try {
|
|
678
|
+
pUrl = win.top.location.href;
|
|
679
|
+
} catch (error) {
|
|
680
|
+
pUrl = win.location.href;
|
|
681
|
+
}
|
|
682
|
+
let src = url ? decodeURI(url) : decodeURI(pUrl);
|
|
667
683
|
let param = getParams({ url: src });
|
|
668
684
|
if (param && key.length) {
|
|
669
685
|
if (Array.isArray(key)) {
|
|
@@ -1923,15 +1939,20 @@ const isLogined = function ({
|
|
|
1923
1939
|
let quit = getParams('quit') || getParams('logout');
|
|
1924
1940
|
if (quit) {
|
|
1925
1941
|
ajax({ method: 'post', url: logout })
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1942
|
+
.then((res) => {
|
|
1943
|
+
if (res.rCode === 0) {
|
|
1944
|
+
removeStorage();
|
|
1945
|
+
}
|
|
1946
|
+
})
|
|
1947
|
+
.catch(() => { });
|
|
1932
1948
|
return;
|
|
1933
1949
|
}
|
|
1934
|
-
let pathname =
|
|
1950
|
+
let pathname = '';
|
|
1951
|
+
try {
|
|
1952
|
+
pathname = win.top.location.pathname;
|
|
1953
|
+
} catch (error) {
|
|
1954
|
+
pathname = win.location.pathname;
|
|
1955
|
+
}
|
|
1935
1956
|
if (loginPage) {
|
|
1936
1957
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1937
1958
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -1974,25 +1995,44 @@ const isLogined = function ({
|
|
|
1974
1995
|
deviceUnique: results.deviceUnique
|
|
1975
1996
|
}
|
|
1976
1997
|
});
|
|
1977
|
-
|
|
1978
|
-
url
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1998
|
+
try {
|
|
1999
|
+
let url = delUrlParam({
|
|
2000
|
+
url: win.top.location.href,
|
|
2001
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2002
|
+
});
|
|
2003
|
+
win.top.location.href = url;
|
|
2004
|
+
setTimeout(() => {
|
|
2005
|
+
win.top.location.reload();
|
|
2006
|
+
}, 200);
|
|
2007
|
+
} catch (error) {
|
|
2008
|
+
let url = delUrlParam({
|
|
2009
|
+
url: win.location.href,
|
|
2010
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2011
|
+
});
|
|
2012
|
+
win.location.href = url;
|
|
2013
|
+
setTimeout(() => {
|
|
2014
|
+
win.location.reload();
|
|
2015
|
+
}, 200);
|
|
2016
|
+
}
|
|
1985
2017
|
break;
|
|
1986
2018
|
case 1:
|
|
1987
2019
|
break;
|
|
1988
2020
|
case 2:
|
|
1989
2021
|
break;
|
|
1990
2022
|
case 3:
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2023
|
+
try {
|
|
2024
|
+
const href = results.authorizeUrl.replace(
|
|
2025
|
+
'{redirectUri}',
|
|
2026
|
+
encodeURIComponent(win.top.location.href)
|
|
2027
|
+
);
|
|
2028
|
+
win.top.location.href = href;
|
|
2029
|
+
} catch (error) {
|
|
2030
|
+
const href = results.authorizeUrl.replace(
|
|
2031
|
+
'{redirectUri}',
|
|
2032
|
+
encodeURIComponent(win.location.href)
|
|
2033
|
+
);
|
|
2034
|
+
win.location.href = href;
|
|
2035
|
+
}
|
|
1996
2036
|
break;
|
|
1997
2037
|
case 4:
|
|
1998
2038
|
MessageBox.alert(
|
|
@@ -2006,14 +2046,18 @@ const isLogined = function ({
|
|
|
2006
2046
|
'extUserBindHandleId',
|
|
2007
2047
|
results.extUserBindHandleId
|
|
2008
2048
|
);
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
win.top.location.href
|
|
2015
|
-
|
|
2016
|
-
|
|
2049
|
+
try {
|
|
2050
|
+
if (loginPage) {
|
|
2051
|
+
win.top.location.replace(loginPage);
|
|
2052
|
+
} else if (document.referrer) {
|
|
2053
|
+
win.top.location.replace(document.referrer);
|
|
2054
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2055
|
+
win.top.location.href = './login.html';
|
|
2056
|
+
} else {
|
|
2057
|
+
next('/login');
|
|
2058
|
+
}
|
|
2059
|
+
} catch (error) {
|
|
2060
|
+
win.postMessage({ type: 1 }, '*');
|
|
2017
2061
|
}
|
|
2018
2062
|
}
|
|
2019
2063
|
}
|
|
@@ -2028,14 +2072,18 @@ const isLogined = function ({
|
|
|
2028
2072
|
confirmButtonText: '确定',
|
|
2029
2073
|
type: 'error',
|
|
2030
2074
|
callback: () => {
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
win.top.location.href
|
|
2037
|
-
|
|
2038
|
-
|
|
2075
|
+
try {
|
|
2076
|
+
if (loginPage) {
|
|
2077
|
+
win.top.location.replace(loginPage);
|
|
2078
|
+
} else if (document.referrer) {
|
|
2079
|
+
win.top.location.replace(document.referrer);
|
|
2080
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2081
|
+
win.top.location.href = './login.html';
|
|
2082
|
+
} else {
|
|
2083
|
+
next('/login');
|
|
2084
|
+
}
|
|
2085
|
+
} catch (error) {
|
|
2086
|
+
win.postMessage({ type: 1 }, '*');
|
|
2039
2087
|
}
|
|
2040
2088
|
}
|
|
2041
2089
|
}
|
|
@@ -2057,14 +2105,18 @@ const isLogined = function ({
|
|
|
2057
2105
|
next();
|
|
2058
2106
|
}
|
|
2059
2107
|
} else {
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
win.top.location.href
|
|
2066
|
-
|
|
2067
|
-
|
|
2108
|
+
try {
|
|
2109
|
+
if (loginPage) {
|
|
2110
|
+
win.top.location.replace(loginPage);
|
|
2111
|
+
} else if (document.referrer) {
|
|
2112
|
+
win.top.location.replace(document.referrer);
|
|
2113
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2114
|
+
win.top.location.href = './login.html';
|
|
2115
|
+
} else {
|
|
2116
|
+
next('/login');
|
|
2117
|
+
}
|
|
2118
|
+
} catch (error) {
|
|
2119
|
+
win.postMessage({ type: 1 }, '*');
|
|
2068
2120
|
}
|
|
2069
2121
|
}
|
|
2070
2122
|
}
|
|
@@ -2484,30 +2536,30 @@ const setStorage = function ({ type, key, value }) {
|
|
|
2484
2536
|
if (value && typeof value === 'object') {
|
|
2485
2537
|
value = JSON.stringify(value);
|
|
2486
2538
|
}
|
|
2487
|
-
if (type ===
|
|
2539
|
+
if (type === 'localStorage') {
|
|
2488
2540
|
if (typeof key === 'string') {
|
|
2489
|
-
|
|
2541
|
+
localStorage.setItem(key, value);
|
|
2490
2542
|
} else if (Array.isArray(key)) {
|
|
2491
2543
|
for (let i in key) {
|
|
2492
|
-
|
|
2544
|
+
localStorage.setItem(key[i], value);
|
|
2493
2545
|
}
|
|
2494
2546
|
} else {
|
|
2495
2547
|
for (let i in key) {
|
|
2496
2548
|
let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
|
|
2497
|
-
|
|
2549
|
+
localStorage.setItem(i, val);
|
|
2498
2550
|
}
|
|
2499
2551
|
}
|
|
2500
2552
|
} else {
|
|
2501
2553
|
if (typeof key === 'string') {
|
|
2502
|
-
|
|
2554
|
+
sessionStorage.setItem(key, value);
|
|
2503
2555
|
} else if (Array.isArray(key)) {
|
|
2504
2556
|
for (let i in key) {
|
|
2505
|
-
|
|
2557
|
+
sessionStorage.setItem(key[i], value);
|
|
2506
2558
|
}
|
|
2507
2559
|
} else {
|
|
2508
2560
|
for (let i in key) {
|
|
2509
2561
|
let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
|
|
2510
|
-
|
|
2562
|
+
sessionStorage.setItem(i, val);
|
|
2511
2563
|
}
|
|
2512
2564
|
}
|
|
2513
2565
|
}
|