efront 4.28.4 → 4.29.0
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/#/345/233/275/351/231/205/345/214/226.yml +12 -3
- package/apps/pivot/main.js +7 -43
- package/apps/pivot/wow/root.js +10 -8
- package/apps//346/226/207/344/273/266/347/263/273/347/273/237/main.js +55 -0
- package/apps//346/226/207/344/273/266/347/263/273/347/273/237//344/270/273/351/241/265.jsp +42 -0
- package/apps//346/226/207/344/273/266/347/263/273/347/273/237//350/265/204/346/272/220/347/256/241/347/220/206/345/231/250.js +1 -0
- package/coms/basic/extend.js +2 -1
- package/coms/basic/extendIfNeeded.js +2 -1
- package/coms/basic/extendIfOccurs.js +1 -1
- package/coms/basic_/&Array.js +0 -4
- package/coms/basic_/&rest.js +3 -4
- package/coms/compile//347/264/240/351/246/250.js +47 -6
- package/coms/compile//347/264/240/351/246/250_test.js +19 -0
- package/coms/docs/helps.js +1 -0
- package/coms/explorer/Explorer.js +1 -0
- package/coms/explorer/context.js +18 -0
- package/coms/frame/login.xht +95 -0
- package/coms/zimoli/button.less +12 -26
- package/coms/zimoli/pending.less +12 -0
- package/coms/zimoli/progbar.xht +30 -9
- package/coms/zimoli/relogin.js +43 -0
- package/coms/zimoli/zimoli.js +15 -7
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/apps/pivot/auth/login.html +0 -13
- package/apps/pivot/auth/login.js +0 -49
- package/apps/pivot/auth/login.less +0 -28
- /package/coms/{pivot → basic}/sum.js +0 -0
package/coms/zimoli/progbar.xht
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
border-radius: 4px;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
white-space: nowrap;
|
|
14
|
+
cursor: pointer;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
&[danger] {
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
|
|
19
20
|
>[value] {
|
|
20
21
|
color: #c243;
|
|
21
|
-
@
|
|
22
|
+
@pending(#c24, #fff);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -35,30 +36,42 @@
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
@
|
|
39
|
-
background-image: linear-gradient(58deg, @back, 50%, @line, 50%, @line, 53%, @back, 53%, @back);
|
|
40
|
-
}
|
|
39
|
+
@import "pending.less";
|
|
41
40
|
|
|
42
41
|
>[value] {
|
|
43
|
-
@
|
|
44
|
-
background-
|
|
45
|
-
background-position: 0 0;
|
|
46
|
-
background-repeat: repeat;
|
|
42
|
+
@pending(#0004, #fff3);
|
|
43
|
+
background-position-x: right;
|
|
47
44
|
background-clip: border-box;
|
|
48
45
|
color: #3ae2;
|
|
46
|
+
|
|
47
|
+
&:last-child {
|
|
48
|
+
border-radius: inherit;
|
|
49
|
+
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
>[state] {
|
|
52
53
|
background-clip: content-box;
|
|
53
54
|
background-color: #6ca;
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
>span {
|
|
58
|
+
position: absolute;
|
|
59
|
+
display: block;
|
|
60
|
+
left: 0;
|
|
61
|
+
top: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
text-align: center;
|
|
65
|
+
right: 0;
|
|
66
|
+
}
|
|
55
67
|
</style>
|
|
56
68
|
<div>
|
|
69
|
+
<span #text></span>
|
|
57
70
|
<div value -style="{width:value}"></div>
|
|
58
71
|
<div state -repeat="(s,i) in state" -style="{width:s,color:color.rotate('#f003',i)}"></div>
|
|
59
72
|
</div>
|
|
60
73
|
<script>
|
|
61
|
-
var { total, current, pending } = this;
|
|
74
|
+
var { total, current, pending = [] } = this;
|
|
62
75
|
var calc = function (current) {
|
|
63
76
|
var v = (current / total * 10000 + .5) | 0;
|
|
64
77
|
if (v < 0) v = 0;
|
|
@@ -75,6 +88,14 @@
|
|
|
75
88
|
var state = calcAll(pending);
|
|
76
89
|
var value = calc(current);
|
|
77
90
|
Object.defineProperties(this, {
|
|
91
|
+
innerText: {
|
|
92
|
+
set(v) {
|
|
93
|
+
text.innerText = v;
|
|
94
|
+
},
|
|
95
|
+
get() {
|
|
96
|
+
return text.innerText;
|
|
97
|
+
},
|
|
98
|
+
},
|
|
78
99
|
pending: {
|
|
79
100
|
set(v) {
|
|
80
101
|
pending = v;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function relogin(auth_login) {
|
|
2
|
+
var login_queue = [], reject_queue = [];
|
|
3
|
+
return async function ({ status, url, headers }, reform, reject) {
|
|
4
|
+
if (status === 401) {
|
|
5
|
+
var xhr = this;
|
|
6
|
+
var abort = xhr.abort;
|
|
7
|
+
xhr.abort = function () {
|
|
8
|
+
removeFromList(login_queue, reform);
|
|
9
|
+
removeFromList(reject_queue, reject);
|
|
10
|
+
if (!login_queue.length) remove(reject_queue.splice(0, 1)[0]);
|
|
11
|
+
abort.call(this);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
if (login_queue.length) {
|
|
15
|
+
login_queue.push(reform);
|
|
16
|
+
reject_queue.push(reject);
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
var base = data.getInstance("base").base;
|
|
20
|
+
var { protocol, host } = parseURL(url);
|
|
21
|
+
var base1 = protocol + "//" + host + "/";
|
|
22
|
+
if (base !== base1) {
|
|
23
|
+
data.setSource(base1, null);
|
|
24
|
+
}
|
|
25
|
+
login_queue.push(reform);
|
|
26
|
+
var page = await popup(auth_login, base1);
|
|
27
|
+
if (!login_queue.length) return;
|
|
28
|
+
reject_queue.push(page, reject);
|
|
29
|
+
care(page, "login", function (info) {
|
|
30
|
+
data.setSource(base1, info);
|
|
31
|
+
headers.authorization = info;
|
|
32
|
+
login_queue.splice(0, login_queue.length).forEach(q => q());
|
|
33
|
+
reject_queue.splice(0, reject_queue.length);
|
|
34
|
+
});
|
|
35
|
+
on("remove")(page, function () {
|
|
36
|
+
login_queue.splice(0, login_queue.length);
|
|
37
|
+
if (reject_queue[0] === this) reject_queue.shift();
|
|
38
|
+
reject_queue.splice(0, reject_queue.length).forEach(r => r());
|
|
39
|
+
});
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -171,11 +171,11 @@ var getpgpath = function (pagepath) {
|
|
|
171
171
|
for (var m of mparams) argobj[m] = params.pop();
|
|
172
172
|
if (params.length) argobj[m] += "/" + params.reverse().join("/");
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
return [
|
|
174
|
+
var realpath = realmaped[pagepath] || pagepath;
|
|
175
|
+
return [realpath, argobj, pagepath];
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
return [pagepath];
|
|
177
|
+
var realpath = realmaped[pagepath] || pagepath;
|
|
178
|
+
return [realpath, null, pagepath];
|
|
179
179
|
};
|
|
180
180
|
function createState(pgpath) {
|
|
181
181
|
var [pgpath] = getpgpath(pgpath);
|
|
@@ -346,7 +346,7 @@ function create(pagepath, args, from, needroles, zimolidata) {
|
|
|
346
346
|
if (!isHandled(needroles)) needroles = zimolidata.roles;
|
|
347
347
|
}
|
|
348
348
|
if (typeof pagepath === 'string') {
|
|
349
|
-
var [pgpath, args0] = getpgpath(pagepath);
|
|
349
|
+
var [pgpath, args0, bspath] = getpgpath(pagepath);
|
|
350
350
|
var page_object = page_generators[pgpath];
|
|
351
351
|
if (!isEmpty(args0)) page_object.state.data = args, args = args0;
|
|
352
352
|
}
|
|
@@ -357,6 +357,9 @@ function create(pagepath, args, from, needroles, zimolidata) {
|
|
|
357
357
|
throw new Error(i18n`调用create前请确保prepare执行完毕:${pgpath}`);
|
|
358
358
|
}
|
|
359
359
|
var { pg, "with": _with_elements, state, onback: _pageback_listener, roles } = page_object;
|
|
360
|
+
state.realpath = pgpath;
|
|
361
|
+
state.basepath = bspath;
|
|
362
|
+
state.pagepath = pagepath;
|
|
360
363
|
}
|
|
361
364
|
else if (isFunction(pgpath)) {
|
|
362
365
|
var pg = pgpath;
|
|
@@ -379,6 +382,9 @@ function create(pagepath, args, from, needroles, zimolidata) {
|
|
|
379
382
|
_pageback_listener = handler;
|
|
380
383
|
};
|
|
381
384
|
var _page = pg.call(state, args, from);
|
|
385
|
+
_page.realpath = state.realpath;
|
|
386
|
+
_page.basepath = state.basepath;
|
|
387
|
+
_page.pagepath = pagepath;
|
|
382
388
|
if (undefined === args || null === args) args = {};
|
|
383
389
|
if (_page) {
|
|
384
390
|
var page_with = _with_elements.splice(_with_length, _with_elements.length - _with_length);
|
|
@@ -454,8 +460,9 @@ var createEmptyHistory = function (emptyState, allowForward = true) {
|
|
|
454
460
|
h.wardable = allowForward;
|
|
455
461
|
return h;
|
|
456
462
|
}
|
|
457
|
-
var zimoliid = 0, zimoliad = 0;
|
|
463
|
+
var zimoliid = 0, zimoliad = 0, zimolicd = 0;
|
|
458
464
|
function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
465
|
+
zimolicd = 1;
|
|
459
466
|
if (arguments.length === 0) {
|
|
460
467
|
if (zimoliid !== zimoliad) return;
|
|
461
468
|
history_name = current_history;
|
|
@@ -722,6 +729,7 @@ var _switch = zimoli.switch = function (history_name = default_history, target_b
|
|
|
722
729
|
else {
|
|
723
730
|
if (isString(history_name)) {
|
|
724
731
|
current_history = history_name = history_name.replace(/\/$/, '') + "/";
|
|
732
|
+
if (!zimolicd) default_history = current_history;
|
|
725
733
|
}
|
|
726
734
|
if (target_body) body = target_body;
|
|
727
735
|
}
|
|
@@ -736,7 +744,7 @@ var _switch = zimoli.switch = function (history_name = default_history, target_b
|
|
|
736
744
|
if (!history[current_history]) root_path = (history[current_history] = createEmptyHistory(emptyState))[0];
|
|
737
745
|
else {
|
|
738
746
|
var _history = history[current_history];
|
|
739
|
-
if (_history.index === 0) root_path = _history[0] = emptyState;
|
|
747
|
+
if (_history.index === 0 && _history.length <= 1) root_path = _history[0] = emptyState;
|
|
740
748
|
}
|
|
741
749
|
}
|
|
742
750
|
};
|