clickgo 3.5.2 → 3.5.4
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/README.md +51 -2
- package/dist/app/demo/form/control/svg/svg.js +3 -3
- package/dist/app/demo/form/control/svg/svg.xml +1 -1
- package/dist/app/demo/form/event/form/form.js +13 -4
- package/dist/app/demo/form/event/form/form.xml +1 -1
- package/dist/app/demo/form/method/aform/aform.xml +10 -8
- package/dist/app/demo/form/method/core/core.js +8 -0
- package/dist/app/demo/form/method/core/core.xml +10 -9
- package/dist/app/demo/form/method/form/form.js +0 -5
- package/dist/app/demo/res/icon.svg +2 -2
- package/dist/app/demo/res/marker.svg +6 -1
- package/dist/app/demo/res/r-1.svg +1 -1
- package/dist/app/demo/res/r-2.svg +1 -1
- package/dist/app/demo/res/sql.svg +1 -1
- package/dist/app/demo/res/txt.svg +1 -1
- package/dist/app/demo/res/zip.svg +1 -1
- package/dist/app/task/form/bar/bar.js +72 -8
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/box.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/echarts.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/html.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/map.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/page.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/xterm.cgc +0 -0
- package/dist/index.js +3 -0
- package/dist/index.ts +9 -1
- package/dist/lib/core.js +50 -16
- package/dist/lib/core.ts +51 -8
- package/dist/lib/form.js +82 -10
- package/dist/lib/form.ts +108 -13
- package/dist/lib/task.js +3 -0
- package/dist/lib/task.ts +3 -0
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/familiar.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +4 -1
- package/dist/control/aform-cell.cgc +0 -0
- package/dist/control/aform-row.cgc +0 -0
- package/dist/control/aform.cgc +0 -0
- package/dist/control/alayout.cgc +0 -0
package/dist/lib/core.js
CHANGED
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.getLocation = exports.location = exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
35
|
+
exports.back = exports.getLocation = exports.location = exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
36
36
|
const clickgo = __importStar(require("../clickgo"));
|
|
37
37
|
const fs = __importStar(require("./fs"));
|
|
38
38
|
const form = __importStar(require("./form"));
|
|
@@ -115,6 +115,9 @@ class AbstractApp {
|
|
|
115
115
|
onFormFlash() {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
+
onFormShowInSystemTaskChange() {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
118
121
|
onTaskStarted() {
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
@@ -338,8 +341,8 @@ const globalEvents = {
|
|
|
338
341
|
}
|
|
339
342
|
}
|
|
340
343
|
};
|
|
341
|
-
function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
342
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
|
|
344
|
+
function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '', param3 = true) {
|
|
345
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
343
346
|
const eventName = 'on' + name[0].toUpperCase() + name.slice(1);
|
|
344
347
|
switch (name) {
|
|
345
348
|
case 'error': {
|
|
@@ -384,13 +387,13 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
384
387
|
}
|
|
385
388
|
case 'formCreated':
|
|
386
389
|
case 'formRemoved': {
|
|
387
|
-
(_l = (_k = globalEvents)[name]) === null || _l === void 0 ? void 0 : _l.call(_k, taskId, formId, param1, param2);
|
|
388
|
-
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId, formId, param1, param2);
|
|
390
|
+
(_l = (_k = globalEvents)[name]) === null || _l === void 0 ? void 0 : _l.call(_k, taskId, formId, param1, param2, param3);
|
|
391
|
+
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId, formId, param1, param2, param3);
|
|
389
392
|
for (const tid in task.list) {
|
|
390
393
|
const t = task.list[tid];
|
|
391
|
-
(_m = t.class) === null || _m === void 0 ? void 0 : _m[eventName](taskId, formId, param1, param2);
|
|
394
|
+
(_m = t.class) === null || _m === void 0 ? void 0 : _m[eventName](taskId, formId, param1, param2, param3);
|
|
392
395
|
for (const fid in t.forms) {
|
|
393
|
-
(_p = (_o = t.forms[fid].vroot)[eventName]) === null || _p === void 0 ? void 0 : _p.call(_o, taskId, formId, param1, param2);
|
|
396
|
+
(_p = (_o = t.forms[fid].vroot)[eventName]) === null || _p === void 0 ? void 0 : _p.call(_o, taskId, formId, param1, param2, param3);
|
|
394
397
|
}
|
|
395
398
|
}
|
|
396
399
|
break;
|
|
@@ -436,15 +439,27 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
436
439
|
}
|
|
437
440
|
break;
|
|
438
441
|
}
|
|
442
|
+
case 'formShowInSystemTaskChange': {
|
|
443
|
+
(_6 = (_5 = globalEvents)[name]) === null || _6 === void 0 ? void 0 : _6.call(_5, taskId, formId, param1);
|
|
444
|
+
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId, formId, param1);
|
|
445
|
+
for (const tid in task.list) {
|
|
446
|
+
const t = task.list[tid];
|
|
447
|
+
(_7 = t.class) === null || _7 === void 0 ? void 0 : _7[eventName](taskId, formId, param1);
|
|
448
|
+
for (const fid in t.forms) {
|
|
449
|
+
(_9 = (_8 = t.forms[fid].vroot)[eventName]) === null || _9 === void 0 ? void 0 : _9.call(_8, taskId, formId, param1);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
439
454
|
case 'taskStarted':
|
|
440
455
|
case 'taskEnded': {
|
|
441
|
-
(
|
|
456
|
+
(_11 = (_10 = globalEvents)[name]) === null || _11 === void 0 ? void 0 : _11.call(_10, taskId, formId);
|
|
442
457
|
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId, formId);
|
|
443
458
|
for (const tid in task.list) {
|
|
444
459
|
const t = task.list[tid];
|
|
445
|
-
(
|
|
460
|
+
(_12 = t.class) === null || _12 === void 0 ? void 0 : _12[eventName](taskId);
|
|
446
461
|
for (const fid in t.forms) {
|
|
447
|
-
(
|
|
462
|
+
(_14 = (_13 = t.forms[fid].vroot)[eventName]) === null || _14 === void 0 ? void 0 : _14.call(_13, taskId);
|
|
448
463
|
}
|
|
449
464
|
}
|
|
450
465
|
break;
|
|
@@ -459,9 +474,9 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
459
474
|
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId, formId);
|
|
460
475
|
for (const tid in task.list) {
|
|
461
476
|
const t = task.list[tid];
|
|
462
|
-
(
|
|
477
|
+
(_15 = t.class) === null || _15 === void 0 ? void 0 : _15[eventName](taskId, formId);
|
|
463
478
|
for (const fid in t.forms) {
|
|
464
|
-
(
|
|
479
|
+
(_17 = (_16 = t.forms[fid].vroot)[eventName]) === null || _17 === void 0 ? void 0 : _17.call(_16, taskId, formId);
|
|
465
480
|
}
|
|
466
481
|
}
|
|
467
482
|
break;
|
|
@@ -473,9 +488,9 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
473
488
|
exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId);
|
|
474
489
|
for (const tid in task.list) {
|
|
475
490
|
const t = task.list[tid];
|
|
476
|
-
(
|
|
491
|
+
(_18 = t.class) === null || _18 === void 0 ? void 0 : _18[eventName](taskId);
|
|
477
492
|
for (const fid in t.forms) {
|
|
478
|
-
(
|
|
493
|
+
(_20 = (_19 = t.forms[fid].vroot)[eventName]) === null || _20 === void 0 ? void 0 : _20.call(_19, taskId);
|
|
479
494
|
}
|
|
480
495
|
}
|
|
481
496
|
break;
|
|
@@ -676,7 +691,9 @@ function getAvailArea() {
|
|
|
676
691
|
'left': 0,
|
|
677
692
|
'top': 0,
|
|
678
693
|
'width': window.innerWidth,
|
|
679
|
-
'height': window.innerHeight - 46
|
|
694
|
+
'height': window.innerHeight - 46,
|
|
695
|
+
'owidth': window.innerWidth,
|
|
696
|
+
'oheight': window.innerHeight
|
|
680
697
|
};
|
|
681
698
|
}
|
|
682
699
|
else {
|
|
@@ -717,7 +734,9 @@ function getAvailArea() {
|
|
|
717
734
|
'left': left,
|
|
718
735
|
'top': top,
|
|
719
736
|
'width': width,
|
|
720
|
-
'height': height
|
|
737
|
+
'height': height,
|
|
738
|
+
'owidth': window.innerWidth,
|
|
739
|
+
'oheight': window.innerHeight
|
|
721
740
|
};
|
|
722
741
|
}
|
|
723
742
|
}
|
|
@@ -760,6 +779,21 @@ function getLocation() {
|
|
|
760
779
|
return window.location.href;
|
|
761
780
|
}
|
|
762
781
|
exports.getLocation = getLocation;
|
|
782
|
+
function back(taskId) {
|
|
783
|
+
if (!taskId) {
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
const t = task.list[taskId];
|
|
787
|
+
if (!t) {
|
|
788
|
+
return false;
|
|
789
|
+
}
|
|
790
|
+
if (!t.runtime.permissions.includes('root') && !t.runtime.permissions.includes('location')) {
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
window.history.back();
|
|
794
|
+
return true;
|
|
795
|
+
}
|
|
796
|
+
exports.back = back;
|
|
763
797
|
window.addEventListener('hashchange', function () {
|
|
764
798
|
trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
|
|
765
799
|
});
|
package/dist/lib/core.ts
CHANGED
|
@@ -96,7 +96,9 @@ export abstract class AbstractApp {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/** --- 窗体创建事件 --- */
|
|
99
|
-
public onFormCreated(
|
|
99
|
+
public onFormCreated(
|
|
100
|
+
taskId: number, formId: number, title: string, icon: string, showInSystemTask: boolean
|
|
101
|
+
): void | Promise<void>;
|
|
100
102
|
public onFormCreated(): void {
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
@@ -155,6 +157,12 @@ export abstract class AbstractApp {
|
|
|
155
157
|
return;
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
/** --- 窗体是否显示在任务栏属性改变事件 --- */
|
|
161
|
+
public onFormShowInSystemTaskChange(taskId: number, formId: number, value: boolean): void | Promise<void>;
|
|
162
|
+
public onFormShowInSystemTaskChange(): void {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
158
166
|
/** --- 任务开始事件 --- */
|
|
159
167
|
public onTaskStarted(taskId: number): void | Promise<void>;
|
|
160
168
|
public onTaskStarted(): void | Promise<void> {
|
|
@@ -416,7 +424,7 @@ const globalEvents = {
|
|
|
416
424
|
/**
|
|
417
425
|
* --- 主动触发系统级事件,App 中无效,用 this.trigger 替代 ---
|
|
418
426
|
*/
|
|
419
|
-
export function trigger(name: types.TGlobalEvent, taskId: number | string | boolean = 0, formId: number | string | boolean | Record<string, any> | null = 0, param1: boolean | Error | string = '', param2: string = ''): void {
|
|
427
|
+
export function trigger(name: types.TGlobalEvent, taskId: number | string | boolean = 0, formId: number | string | boolean | Record<string, any> | null = 0, param1: boolean | Error | string = '', param2: string = '', param3: boolean = true): void {
|
|
420
428
|
const eventName = 'on' + name[0].toUpperCase() + name.slice(1);
|
|
421
429
|
switch (name) {
|
|
422
430
|
case 'error': {
|
|
@@ -461,13 +469,13 @@ export function trigger(name: types.TGlobalEvent, taskId: number | string | bool
|
|
|
461
469
|
}
|
|
462
470
|
case 'formCreated':
|
|
463
471
|
case 'formRemoved': {
|
|
464
|
-
(globalEvents as any)[name]?.(taskId, formId, param1, param2);
|
|
465
|
-
(boot as any)?.[eventName](taskId, formId, param1, param2);
|
|
472
|
+
(globalEvents as any)[name]?.(taskId, formId, param1, param2, param3);
|
|
473
|
+
(boot as any)?.[eventName](taskId, formId, param1, param2, param3);
|
|
466
474
|
for (const tid in task.list) {
|
|
467
475
|
const t = task.list[tid];
|
|
468
|
-
(t.class as any)?.[eventName](taskId, formId, param1, param2);
|
|
476
|
+
(t.class as any)?.[eventName](taskId, formId, param1, param2, param3);
|
|
469
477
|
for (const fid in t.forms) {
|
|
470
|
-
t.forms[fid].vroot[eventName]?.(taskId, formId, param1, param2);
|
|
478
|
+
t.forms[fid].vroot[eventName]?.(taskId, formId, param1, param2, param3);
|
|
471
479
|
}
|
|
472
480
|
}
|
|
473
481
|
break;
|
|
@@ -513,6 +521,18 @@ export function trigger(name: types.TGlobalEvent, taskId: number | string | bool
|
|
|
513
521
|
}
|
|
514
522
|
break;
|
|
515
523
|
}
|
|
524
|
+
case 'formShowInSystemTaskChange': {
|
|
525
|
+
(globalEvents as any)[name]?.(taskId, formId, param1);
|
|
526
|
+
(boot as any)?.[eventName](taskId, formId, param1);
|
|
527
|
+
for (const tid in task.list) {
|
|
528
|
+
const t = task.list[tid];
|
|
529
|
+
(t.class as any)?.[eventName](taskId, formId, param1);
|
|
530
|
+
for (const fid in t.forms) {
|
|
531
|
+
t.forms[fid].vroot[eventName]?.(taskId, formId, param1);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
516
536
|
case 'taskStarted':
|
|
517
537
|
case 'taskEnded': {
|
|
518
538
|
(globalEvents as any)[name]?.(taskId, formId);
|
|
@@ -775,7 +795,9 @@ export function getAvailArea(): types.IAvailArea {
|
|
|
775
795
|
'left': 0,
|
|
776
796
|
'top': 0,
|
|
777
797
|
'width': window.innerWidth,
|
|
778
|
-
'height': window.innerHeight - 46
|
|
798
|
+
'height': window.innerHeight - 46,
|
|
799
|
+
'owidth': window.innerWidth,
|
|
800
|
+
'oheight': window.innerHeight
|
|
779
801
|
};
|
|
780
802
|
}
|
|
781
803
|
else {
|
|
@@ -816,7 +838,9 @@ export function getAvailArea(): types.IAvailArea {
|
|
|
816
838
|
'left': left,
|
|
817
839
|
'top': top,
|
|
818
840
|
'width': width,
|
|
819
|
-
'height': height
|
|
841
|
+
'height': height,
|
|
842
|
+
'owidth': window.innerWidth,
|
|
843
|
+
'oheight': window.innerHeight
|
|
820
844
|
};
|
|
821
845
|
}
|
|
822
846
|
}
|
|
@@ -875,6 +899,25 @@ export function getLocation(): string {
|
|
|
875
899
|
return window.location.href;
|
|
876
900
|
}
|
|
877
901
|
|
|
902
|
+
/**
|
|
903
|
+
* --- 对浏览器做返回操作 ---
|
|
904
|
+
* @param taskId 基任务,App 模式下无效
|
|
905
|
+
*/
|
|
906
|
+
export function back(taskId?: number): boolean {
|
|
907
|
+
if (!taskId) {
|
|
908
|
+
return false;
|
|
909
|
+
}
|
|
910
|
+
const t = task.list[taskId];
|
|
911
|
+
if (!t) {
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
if (!t.runtime.permissions.includes('root') && !t.runtime.permissions.includes('location')) {
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
window.history.back();
|
|
918
|
+
return true;
|
|
919
|
+
}
|
|
920
|
+
|
|
878
921
|
window.addEventListener('hashchange', function() {
|
|
879
922
|
trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
|
|
880
923
|
});
|
package/dist/lib/form.js
CHANGED
|
@@ -45,8 +45,9 @@ let focusId = null;
|
|
|
45
45
|
const info = {
|
|
46
46
|
'lastId': 0,
|
|
47
47
|
'lastPanelId': 0,
|
|
48
|
-
'
|
|
49
|
-
'
|
|
48
|
+
'bottomLastZIndex': 999,
|
|
49
|
+
'lastZIndex': 999999,
|
|
50
|
+
'topLastZIndex': 99999999,
|
|
50
51
|
'locale': {
|
|
51
52
|
'en': {
|
|
52
53
|
'ok': 'OK',
|
|
@@ -278,6 +279,11 @@ class AbstractForm extends AbstractCommon {
|
|
|
278
279
|
}
|
|
279
280
|
set topMost(v) {
|
|
280
281
|
}
|
|
282
|
+
get bottomMost() {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
set bottomMost(v) {
|
|
286
|
+
}
|
|
281
287
|
get isMask() {
|
|
282
288
|
return !task.list[this.taskId].runtime.dialogFormIds.length ||
|
|
283
289
|
task.list[this.taskId].runtime.dialogFormIds[task.list[this.taskId].runtime.dialogFormIds.length - 1]
|
|
@@ -286,6 +292,11 @@ class AbstractForm extends AbstractCommon {
|
|
|
286
292
|
get formFocus() {
|
|
287
293
|
return this._formFocus;
|
|
288
294
|
}
|
|
295
|
+
get showInSystemTask() {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
set showInSystemTask(v) {
|
|
299
|
+
}
|
|
289
300
|
show() {
|
|
290
301
|
const v = this;
|
|
291
302
|
if (this._firstShow) {
|
|
@@ -367,6 +378,9 @@ class AbstractForm extends AbstractCommon {
|
|
|
367
378
|
onFormFlash() {
|
|
368
379
|
return;
|
|
369
380
|
}
|
|
381
|
+
onFormShowInSystemTaskChange() {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
370
384
|
onTaskStarted() {
|
|
371
385
|
return;
|
|
372
386
|
}
|
|
@@ -437,7 +451,7 @@ exports.elements = {
|
|
|
437
451
|
this.gesture.id = 'cg-gesture';
|
|
438
452
|
this.wrap.appendChild(this.gesture);
|
|
439
453
|
this.drag.id = 'cg-drag';
|
|
440
|
-
this.drag.innerHTML = '<svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 8L40 40" stroke
|
|
454
|
+
this.drag.innerHTML = '<svg width="16" height="16" viewBox="0 0 48 48" fill="none" stroke="#FFF" xmlns="http://www.w3.org/2000/svg"><path d="M8 8L40 40" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/><path d="M8 40L40 8" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/></svg>';
|
|
441
455
|
this.wrap.appendChild(this.drag);
|
|
442
456
|
this.notify.id = 'cg-notify';
|
|
443
457
|
this.wrap.appendChild(this.notify);
|
|
@@ -780,10 +794,16 @@ function refreshMaxPosition() {
|
|
|
780
794
|
continue;
|
|
781
795
|
}
|
|
782
796
|
const vroot = task.list[taskId].forms[formId].vroot;
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
797
|
+
if (ef.dataset.cgBottomMost === undefined) {
|
|
798
|
+
vroot.$refs.form.setPropData('left', area.left);
|
|
799
|
+
vroot.$refs.form.setPropData('top', area.top);
|
|
800
|
+
vroot.$refs.form.setPropData('width', area.width);
|
|
801
|
+
vroot.$refs.form.setPropData('height', area.height);
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
vroot.$refs.form.setPropData('width', area.owidth);
|
|
805
|
+
vroot.$refs.form.setPropData('height', area.oheight);
|
|
806
|
+
}
|
|
787
807
|
}
|
|
788
808
|
}
|
|
789
809
|
exports.refreshMaxPosition = refreshMaxPosition;
|
|
@@ -812,7 +832,8 @@ function get(formId) {
|
|
|
812
832
|
'stateMax': item.vroot.$refs.form.stateMaxData,
|
|
813
833
|
'stateMin': item.vroot.$refs.form.stateMinData,
|
|
814
834
|
'show': item.vroot.$refs.form.isShow,
|
|
815
|
-
'focus': item.vroot.formFocus
|
|
835
|
+
'focus': item.vroot.formFocus,
|
|
836
|
+
'showInSystemTask': item.vroot.showInSystemTask
|
|
816
837
|
};
|
|
817
838
|
}
|
|
818
839
|
exports.get = get;
|
|
@@ -839,7 +860,8 @@ function getList(taskId) {
|
|
|
839
860
|
'stateMax': item.vroot.$refs.form.stateMaxData,
|
|
840
861
|
'stateMin': item.vroot.$refs.form.stateMinData,
|
|
841
862
|
'show': item.vroot.$refs.form.isShow,
|
|
842
|
-
'focus': item.vroot.formFocus
|
|
863
|
+
'focus': item.vroot.formFocus,
|
|
864
|
+
'showInSystemTask': item.vroot.showInSystemTask
|
|
843
865
|
};
|
|
844
866
|
}
|
|
845
867
|
return list;
|
|
@@ -944,6 +966,9 @@ function changeFocus(formId = 0) {
|
|
|
944
966
|
if (t.forms[dialogFormId].vroot._topMost) {
|
|
945
967
|
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
|
|
946
968
|
}
|
|
969
|
+
else if (t.forms[dialogFormId].vroot._bottomMost) {
|
|
970
|
+
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
971
|
+
}
|
|
947
972
|
else {
|
|
948
973
|
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
949
974
|
}
|
|
@@ -960,6 +985,9 @@ function changeFocus(formId = 0) {
|
|
|
960
985
|
if (t.forms[formId].vroot._topMost) {
|
|
961
986
|
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
|
|
962
987
|
}
|
|
988
|
+
else if (t.forms[formId].vroot._bottomMost) {
|
|
989
|
+
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
990
|
+
}
|
|
963
991
|
else {
|
|
964
992
|
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
965
993
|
}
|
|
@@ -2001,6 +2029,32 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2001
2029
|
return;
|
|
2002
2030
|
}
|
|
2003
2031
|
};
|
|
2032
|
+
idata._bottomMost = false;
|
|
2033
|
+
computed.bottomMost = {
|
|
2034
|
+
get: function () {
|
|
2035
|
+
return this._bottomMost;
|
|
2036
|
+
},
|
|
2037
|
+
set: function (v) {
|
|
2038
|
+
const form = t.forms[formId];
|
|
2039
|
+
if (!form) {
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
if (v) {
|
|
2043
|
+
form.vroot.$data._bottomMost = true;
|
|
2044
|
+
form.vroot.$el.dataset.cgBottomMost = '';
|
|
2045
|
+
if (form.vroot.$data._topMost) {
|
|
2046
|
+
form.vroot.$data._topMost = false;
|
|
2047
|
+
}
|
|
2048
|
+
form.vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
2049
|
+
}
|
|
2050
|
+
else {
|
|
2051
|
+
form.vroot.$data._bottomMost = false;
|
|
2052
|
+
form.vroot.$el.removeAttribute('data-cg-bottom-most');
|
|
2053
|
+
form.vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
2054
|
+
}
|
|
2055
|
+
return;
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2004
2058
|
idata._topMost = false;
|
|
2005
2059
|
computed.topMost = {
|
|
2006
2060
|
get: function () {
|
|
@@ -2013,6 +2067,10 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2013
2067
|
}
|
|
2014
2068
|
if (v) {
|
|
2015
2069
|
form.vroot.$data._topMost = true;
|
|
2070
|
+
if (form.vroot.$data._bottomMost) {
|
|
2071
|
+
form.vroot.$data._bottomMost = false;
|
|
2072
|
+
form.vroot.$el.removeAttribute('data-cg-bottom-most');
|
|
2073
|
+
}
|
|
2016
2074
|
if (!form.vroot._formFocus) {
|
|
2017
2075
|
changeFocus(form.id);
|
|
2018
2076
|
}
|
|
@@ -2027,6 +2085,20 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2027
2085
|
return;
|
|
2028
2086
|
}
|
|
2029
2087
|
};
|
|
2088
|
+
idata._showInSystemTask = true;
|
|
2089
|
+
computed.showInSystemTask = {
|
|
2090
|
+
get: function () {
|
|
2091
|
+
return this._showInSystemTask;
|
|
2092
|
+
},
|
|
2093
|
+
set: function (v) {
|
|
2094
|
+
const form = t.forms[formId];
|
|
2095
|
+
if (!form) {
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
form.vroot.$data._showInSystemTask = v;
|
|
2099
|
+
core.trigger('formShowInSystemTaskChange', t.id, formId, v);
|
|
2100
|
+
}
|
|
2101
|
+
};
|
|
2030
2102
|
exports.elements.list.insertAdjacentHTML('beforeend', `<div class="cg-form-wrap" data-form-id="${formId.toString()}" data-task-id="${t.id.toString()}"></div>`);
|
|
2031
2103
|
exports.elements.popList.insertAdjacentHTML('beforeend', `<div data-form-id="${formId.toString()}" data-task-id="${t.id.toString()}"></div>`);
|
|
2032
2104
|
if (style) {
|
|
@@ -2139,7 +2211,7 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2139
2211
|
dom.removeStyle(rtn.vroot.taskId, 'form', rtn.vroot.formId);
|
|
2140
2212
|
throw err;
|
|
2141
2213
|
}
|
|
2142
|
-
core.trigger('formCreated', t.id, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconDataUrl);
|
|
2214
|
+
core.trigger('formCreated', t.id, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconDataUrl, rtn.vroot.showInSystemTask);
|
|
2143
2215
|
if (rtn.vroot.isNativeSync) {
|
|
2144
2216
|
yield native.invoke('cg-set-size', native.getToken(), rtn.vroot.$refs.form.$el.offsetWidth, rtn.vroot.$refs.form.$el.offsetHeight);
|
|
2145
2217
|
window.addEventListener('resize', function () {
|
package/dist/lib/form.ts
CHANGED
|
@@ -32,9 +32,11 @@ const info: {
|
|
|
32
32
|
lastId: number;
|
|
33
33
|
/** --- 最后一个 panel id --- */
|
|
34
34
|
lastPanelId: number;
|
|
35
|
-
/** ---
|
|
35
|
+
/** --- 最后一个置底窗体层级,1000(一千)开始 --- */
|
|
36
|
+
bottomLastZIndex: number;
|
|
37
|
+
/** --- 最后一个窗体层级,1000000(百万)开始 --- */
|
|
36
38
|
lastZIndex: number;
|
|
37
|
-
/** --- 最后一个置顶窗体层级,
|
|
39
|
+
/** --- 最后一个置顶窗体层级,100000000(一亿)开始 --- */
|
|
38
40
|
topLastZIndex: number;
|
|
39
41
|
/** --- 用到的语言包 --- */
|
|
40
42
|
locale: Record<string, {
|
|
@@ -47,8 +49,9 @@ const info: {
|
|
|
47
49
|
} = {
|
|
48
50
|
'lastId': 0,
|
|
49
51
|
'lastPanelId': 0,
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
+
'bottomLastZIndex': 999,
|
|
53
|
+
'lastZIndex': 999999,
|
|
54
|
+
'topLastZIndex': 99999999,
|
|
52
55
|
'locale': {
|
|
53
56
|
'en': {
|
|
54
57
|
'ok': 'OK',
|
|
@@ -383,6 +386,16 @@ export abstract class AbstractForm extends AbstractCommon {
|
|
|
383
386
|
// --- 会进行重写 ---
|
|
384
387
|
}
|
|
385
388
|
|
|
389
|
+
/** --- 是否是置底 --- */
|
|
390
|
+
public get bottomMost(): boolean {
|
|
391
|
+
// --- 将在初始化时系统自动重写本函数 ---
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
public set bottomMost(v: boolean) {
|
|
396
|
+
// --- 会进行重写 ---
|
|
397
|
+
}
|
|
398
|
+
|
|
386
399
|
/**
|
|
387
400
|
* --- 是否在本窗体上显示遮罩层 ---
|
|
388
401
|
*/
|
|
@@ -398,6 +411,16 @@ export abstract class AbstractForm extends AbstractCommon {
|
|
|
398
411
|
return (this as any)._formFocus;
|
|
399
412
|
}
|
|
400
413
|
|
|
414
|
+
/** --- 当前窗体是否显示在任务栏 --- */
|
|
415
|
+
public get showInSystemTask(): boolean {
|
|
416
|
+
// --- 将在初始化时系统自动重写本函数 ---
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
public set showInSystemTask(v: boolean) {
|
|
421
|
+
// --- 会进行重写 ---
|
|
422
|
+
}
|
|
423
|
+
|
|
401
424
|
/** --- 当前是不是初次显示 --- */
|
|
402
425
|
private _firstShow: boolean = true;
|
|
403
426
|
|
|
@@ -487,7 +510,9 @@ export abstract class AbstractForm extends AbstractCommon {
|
|
|
487
510
|
}
|
|
488
511
|
|
|
489
512
|
/** --- 窗体创建事件 --- */
|
|
490
|
-
public onFormCreated(
|
|
513
|
+
public onFormCreated(
|
|
514
|
+
taskId: number, formId: number, title: string, icon: string, showInSystemTask: boolean
|
|
515
|
+
): void | Promise<void>;
|
|
491
516
|
public onFormCreated(): void {
|
|
492
517
|
return;
|
|
493
518
|
}
|
|
@@ -546,6 +571,12 @@ export abstract class AbstractForm extends AbstractCommon {
|
|
|
546
571
|
return;
|
|
547
572
|
}
|
|
548
573
|
|
|
574
|
+
/** --- 窗体是否显示在任务栏属性改变事件 --- */
|
|
575
|
+
public onFormShowInSystemTaskChange(taskId: number, formId: number, value: boolean): void | Promise<void>;
|
|
576
|
+
public onFormShowInSystemTaskChange(): void {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
|
|
549
580
|
/** --- 任务开始事件 --- */
|
|
550
581
|
public onTaskStarted(taskId: number): void | Promise<void>;
|
|
551
582
|
public onTaskStarted(): void {
|
|
@@ -672,7 +703,7 @@ export const elements: {
|
|
|
672
703
|
|
|
673
704
|
// --- drag drop 的拖动占位符 ---
|
|
674
705
|
this.drag.id = 'cg-drag';
|
|
675
|
-
this.drag.innerHTML = '<svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 8L40 40" stroke
|
|
706
|
+
this.drag.innerHTML = '<svg width="16" height="16" viewBox="0 0 48 48" fill="none" stroke="#FFF" xmlns="http://www.w3.org/2000/svg"><path d="M8 8L40 40" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/><path d="M8 40L40 8" stroke-width="4" stroke-linecap="butt" stroke-linejoin="miter"/></svg>';
|
|
676
707
|
this.wrap.appendChild(this.drag);
|
|
677
708
|
|
|
678
709
|
// --- 添加 cg-system 的 dom ---
|
|
@@ -1062,10 +1093,18 @@ export function refreshMaxPosition(): void {
|
|
|
1062
1093
|
continue;
|
|
1063
1094
|
}
|
|
1064
1095
|
const vroot = task.list[taskId].forms[formId].vroot;
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1096
|
+
if (ef.dataset.cgBottomMost === undefined) {
|
|
1097
|
+
// --- 不是置底窗体 ---
|
|
1098
|
+
vroot.$refs.form.setPropData('left', area.left);
|
|
1099
|
+
vroot.$refs.form.setPropData('top', area.top);
|
|
1100
|
+
vroot.$refs.form.setPropData('width', area.width);
|
|
1101
|
+
vroot.$refs.form.setPropData('height', area.height);
|
|
1102
|
+
}
|
|
1103
|
+
else {
|
|
1104
|
+
// --- 是置底窗体 ---
|
|
1105
|
+
vroot.$refs.form.setPropData('width', area.owidth);
|
|
1106
|
+
vroot.$refs.form.setPropData('height', area.oheight);
|
|
1107
|
+
}
|
|
1069
1108
|
}
|
|
1070
1109
|
}
|
|
1071
1110
|
|
|
@@ -1103,7 +1142,8 @@ export function get(formId: number): types.IFormInfo | null {
|
|
|
1103
1142
|
'stateMax': item.vroot.$refs.form.stateMaxData,
|
|
1104
1143
|
'stateMin': item.vroot.$refs.form.stateMinData,
|
|
1105
1144
|
'show': item.vroot.$refs.form.isShow,
|
|
1106
|
-
'focus': item.vroot.formFocus
|
|
1145
|
+
'focus': item.vroot.formFocus,
|
|
1146
|
+
'showInSystemTask': item.vroot.showInSystemTask
|
|
1107
1147
|
};
|
|
1108
1148
|
}
|
|
1109
1149
|
|
|
@@ -1139,7 +1179,8 @@ export function getList(taskId: number): Record<string, types.IFormInfo> {
|
|
|
1139
1179
|
'stateMax': item.vroot.$refs.form.stateMaxData,
|
|
1140
1180
|
'stateMin': item.vroot.$refs.form.stateMinData,
|
|
1141
1181
|
'show': item.vroot.$refs.form.isShow,
|
|
1142
|
-
'focus': item.vroot.formFocus
|
|
1182
|
+
'focus': item.vroot.formFocus,
|
|
1183
|
+
'showInSystemTask': item.vroot.showInSystemTask
|
|
1143
1184
|
};
|
|
1144
1185
|
}
|
|
1145
1186
|
return list;
|
|
@@ -1275,6 +1316,9 @@ export function changeFocus(formId: number = 0): void {
|
|
|
1275
1316
|
if (t.forms[dialogFormId].vroot._topMost) {
|
|
1276
1317
|
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
|
|
1277
1318
|
}
|
|
1319
|
+
else if (t.forms[dialogFormId].vroot._bottomMost) {
|
|
1320
|
+
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
1321
|
+
}
|
|
1278
1322
|
else {
|
|
1279
1323
|
t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
1280
1324
|
}
|
|
@@ -1296,6 +1340,9 @@ export function changeFocus(formId: number = 0): void {
|
|
|
1296
1340
|
if (t.forms[formId].vroot._topMost) {
|
|
1297
1341
|
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
|
|
1298
1342
|
}
|
|
1343
|
+
else if (t.forms[formId].vroot._bottomMost) {
|
|
1344
|
+
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
1345
|
+
}
|
|
1299
1346
|
else {
|
|
1300
1347
|
t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
1301
1348
|
}
|
|
@@ -2562,6 +2609,35 @@ export async function create<T extends AbstractForm>(
|
|
|
2562
2609
|
return;
|
|
2563
2610
|
}
|
|
2564
2611
|
};
|
|
2612
|
+
// --- 是否在底层的窗体 ---
|
|
2613
|
+
idata._bottomMost = false;
|
|
2614
|
+
computed.bottomMost = {
|
|
2615
|
+
get: function(this: types.IVue): number {
|
|
2616
|
+
return this._bottomMost;
|
|
2617
|
+
},
|
|
2618
|
+
set: function(v: boolean): void {
|
|
2619
|
+
const form = t.forms[formId];
|
|
2620
|
+
if (!form) {
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
if (v) {
|
|
2624
|
+
// --- 置底 ---
|
|
2625
|
+
form.vroot.$data._bottomMost = true;
|
|
2626
|
+
form.vroot.$el.dataset.cgBottomMost = '';
|
|
2627
|
+
if (form.vroot.$data._topMost) {
|
|
2628
|
+
form.vroot.$data._topMost = false;
|
|
2629
|
+
}
|
|
2630
|
+
form.vroot.$refs.form.$data.zIndex = ++info.bottomLastZIndex;
|
|
2631
|
+
}
|
|
2632
|
+
else {
|
|
2633
|
+
// --- 取消置底 ---
|
|
2634
|
+
form.vroot.$data._bottomMost = false;
|
|
2635
|
+
form.vroot.$el.removeAttribute('data-cg-bottom-most');
|
|
2636
|
+
form.vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
|
|
2637
|
+
}
|
|
2638
|
+
return;
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2565
2641
|
// --- 是否在顶层的窗体 ---
|
|
2566
2642
|
idata._topMost = false;
|
|
2567
2643
|
computed.topMost = {
|
|
@@ -2576,6 +2652,10 @@ export async function create<T extends AbstractForm>(
|
|
|
2576
2652
|
if (v) {
|
|
2577
2653
|
// --- 置顶 ---
|
|
2578
2654
|
form.vroot.$data._topMost = true;
|
|
2655
|
+
if (form.vroot.$data._bottomMost) {
|
|
2656
|
+
form.vroot.$data._bottomMost = false;
|
|
2657
|
+
form.vroot.$el.removeAttribute('data-cg-bottom-most');
|
|
2658
|
+
}
|
|
2579
2659
|
if (!form.vroot._formFocus) {
|
|
2580
2660
|
changeFocus(form.id);
|
|
2581
2661
|
}
|
|
@@ -2591,6 +2671,21 @@ export async function create<T extends AbstractForm>(
|
|
|
2591
2671
|
return;
|
|
2592
2672
|
}
|
|
2593
2673
|
};
|
|
2674
|
+
// --- 当前窗体是否显示在任务栏 ---
|
|
2675
|
+
idata._showInSystemTask = true;
|
|
2676
|
+
computed.showInSystemTask = {
|
|
2677
|
+
get: function(this: types.IVue): number {
|
|
2678
|
+
return this._showInSystemTask;
|
|
2679
|
+
},
|
|
2680
|
+
set: function(v: boolean): void {
|
|
2681
|
+
const form = t.forms[formId];
|
|
2682
|
+
if (!form) {
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
form.vroot.$data._showInSystemTask = v;
|
|
2686
|
+
core.trigger('formShowInSystemTaskChange', t.id, formId, v);
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2594
2689
|
|
|
2595
2690
|
// --- 插入 dom ---
|
|
2596
2691
|
elements.list.insertAdjacentHTML('beforeend', `<div class="cg-form-wrap" data-form-id="${formId.toString()}" data-task-id="${t.id.toString()}"></div>`);
|
|
@@ -2717,7 +2812,7 @@ export async function create<T extends AbstractForm>(
|
|
|
2717
2812
|
throw err;
|
|
2718
2813
|
}
|
|
2719
2814
|
// --- 触发 formCreated 事件 ---
|
|
2720
|
-
core.trigger('formCreated', t.id, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconDataUrl);
|
|
2815
|
+
core.trigger('formCreated', t.id, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconDataUrl, rtn.vroot.showInSystemTask);
|
|
2721
2816
|
// --- 同步的窗体先进行同步一下 ---
|
|
2722
2817
|
if (rtn.vroot.isNativeSync) {
|
|
2723
2818
|
await native.invoke('cg-set-size', native.getToken(), rtn.vroot.$refs.form.$el.offsetWidth, rtn.vroot.$refs.form.$el.offsetHeight);
|