clickgo 3.5.1 → 3.5.3
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 +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/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 +81 -9
- package/dist/lib/form.ts +107 -12
- 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/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.5.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.5.3'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -62,12 +62,13 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
62
62
|
'stateMin': flist[fid].stateMin,
|
|
63
63
|
'show': flist[fid].show,
|
|
64
64
|
'focus': flist[fid].focus,
|
|
65
|
-
'flash': false
|
|
65
|
+
'flash': false,
|
|
66
|
+
'showInTask': flist[fid].showInSystemTask
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
onFormCreated(taskId, formId, title, icon) {
|
|
71
|
+
onFormCreated(taskId, formId, title, icon, showInSystemTask) {
|
|
71
72
|
this.flist[formId] = {
|
|
72
73
|
'title': title,
|
|
73
74
|
'icon': icon,
|
|
@@ -75,9 +76,10 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
75
76
|
'stateMin': false,
|
|
76
77
|
'show': false,
|
|
77
78
|
'focus': false,
|
|
78
|
-
'flash': false
|
|
79
|
+
'flash': false,
|
|
80
|
+
'showInTask': true
|
|
79
81
|
};
|
|
80
|
-
this.pushConsole('formCreated', `taskId: ${taskId}, formId: ${formId}, title: ${title}, icon: ${icon ? icon.slice(0, 10) + '...' : 'null'}`);
|
|
82
|
+
this.pushConsole('formCreated', `taskId: ${taskId}, formId: ${formId}, title: ${title}, icon: ${icon ? icon.slice(0, 10) + '...' : 'null'}, sist: ${showInSystemTask ? 'true' : 'false'}`);
|
|
81
83
|
}
|
|
82
84
|
onFormRemoved(taskId, formId, title, icon) {
|
|
83
85
|
if (!this.flist[formId]) {
|
|
@@ -150,5 +152,12 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
150
152
|
this.flist[formId].flash = false;
|
|
151
153
|
});
|
|
152
154
|
}
|
|
155
|
+
onFormShowInSystemTaskChange(taskId, formId, value) {
|
|
156
|
+
if (!this.flist[formId]) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.flist[formId].title = value;
|
|
160
|
+
this.pushConsole('formShowInSystemTaskChange', `taskId: ${taskId}, formId: ${formId}, value: ${value}`);
|
|
161
|
+
}
|
|
153
162
|
}
|
|
154
163
|
exports.default = default_1;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</layout>
|
|
9
9
|
</layout>
|
|
10
10
|
<layout gutter="10" style="margin-top: 10px; height: 80px;">
|
|
11
|
-
<list :data="['formCreated', 'formRemoved', 'formTitleChanged', 'formIconChanged', 'formStateMinChanged', 'formStateMaxChanged', 'formShowChanged', 'formFocused', 'formBlurred', 'formFlash']" style="width: 150px;"></list>
|
|
11
|
+
<list :data="['formCreated', 'formRemoved', 'formTitleChanged', 'formIconChanged', 'formStateMinChanged', 'formStateMaxChanged', 'formShowChanged', 'formFocused', 'formBlurred', 'formFlash', 'formShowInSystemTaskChange']" style="width: 150px;"></list>
|
|
12
12
|
<vflow v-slot="data" :data="list" direction="v" style="color: #FFF; background: hsl(0, 0%, 20%); line-height: 1.5; flex: 1; width: 0; padding: 10px;" same>
|
|
13
13
|
<label>[{{data.row.time}}] {{data.row.name}}, {{data.row.text}}.</label>
|
|
14
14
|
</vflow>
|
|
@@ -11,24 +11,26 @@
|
|
|
11
11
|
<label>isMask: {{isMask}}</label>
|
|
12
12
|
<layout gutter="10" align-v="center">
|
|
13
13
|
<label>test: {{test}}</label>
|
|
14
|
-
<button @click="test = test === 'A' ? 'B' : 'A'" style="
|
|
14
|
+
<button @click="test = test === 'A' ? 'B' : 'A'" style="flex: 1;">watch('test', () => { dialog })</button>
|
|
15
15
|
</layout>
|
|
16
|
-
<button @click="topMost = !topMost"
|
|
16
|
+
<button @click="topMost = !topMost">topMost: {{topMost ? 'true' : 'false'}}</button>
|
|
17
|
+
<button @click="bottomMost = !bottomMost">bottomMost: {{bottomMost ? 'true' : 'false'}}</button>
|
|
18
|
+
<button @click="showInSystemTask = !showInSystemTask">showInSystemTask: {{showInSystemTask ? 'true' : 'false'}}</button>
|
|
17
19
|
<layout gutter="10" align-v="center">
|
|
18
20
|
<label>Form ID:</label>
|
|
19
|
-
<text v-model="fid" style="flex: 1; width: 0;
|
|
21
|
+
<text v-model="fid" style="flex: 1; width: 0;"></text>
|
|
20
22
|
</layout>
|
|
21
23
|
<layout gutter="10" align-v="center">
|
|
22
24
|
<label>Send: </label>
|
|
23
|
-
<text v-model="sendValue" style="flex: 1; width: 0;
|
|
24
|
-
<button @click="ssend"
|
|
25
|
+
<text v-model="sendValue" style="flex: 1; width: 0;"></text>
|
|
26
|
+
<button @click="ssend">send({{fid}}, { 'key': '{{sendValue}}' })</button>
|
|
25
27
|
</layout>
|
|
26
|
-
<button @click="hhide"
|
|
28
|
+
<button @click="hhide">hide() and show()</button>
|
|
27
29
|
<layout gutter="10" align-v="center">
|
|
28
|
-
<button @click="sshowDialog" style="
|
|
30
|
+
<button @click="sshowDialog" style="flex: 1;">showDialog()</button>
|
|
29
31
|
<label>result: {{dr}}</label>
|
|
30
32
|
</layout>
|
|
31
|
-
<button @click="close"
|
|
33
|
+
<button @click="close">close()</button>
|
|
32
34
|
</layout>
|
|
33
35
|
</flow>
|
|
34
36
|
</form>
|
|
@@ -78,5 +78,13 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
78
78
|
yield clickgo.form.dialog('Location is: ' + clickgo.core.getLocation());
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
back() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
if (clickgo.core.back()) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
yield clickgo.form.dialog('No permission.');
|
|
87
|
+
});
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
exports.default = default_1;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
<form width="350" height="
|
|
1
|
+
<form width="350" height="430" title="Library task" padding="10">
|
|
2
2
|
<layout direction="v" gutter="10" style="flex: 1;">
|
|
3
3
|
<label>config:</label>
|
|
4
4
|
<text v-model="config" readonly multi style="flex: 1;"></text>
|
|
5
|
-
<button @click="getCdn"
|
|
6
|
-
<button @click="getAvailArea"
|
|
7
|
-
<layout gutter="10"
|
|
5
|
+
<button @click="getCdn">getCdn()</button>
|
|
6
|
+
<button @click="getAvailArea">getAvailArea()</button>
|
|
7
|
+
<layout gutter="10">
|
|
8
8
|
<text v-model="hash" style="flex: 1;" />
|
|
9
|
-
<button @click="hashe"
|
|
9
|
+
<button @click="hashe">hash('{{hash}}')</button>
|
|
10
10
|
</layout>
|
|
11
|
-
<button @click="getHash"
|
|
12
|
-
<layout gutter="10"
|
|
11
|
+
<button @click="getHash">getHash()</button>
|
|
12
|
+
<layout gutter="10">
|
|
13
13
|
<text v-model="location" style="flex: 1;" />
|
|
14
|
-
<button @click="locatione"
|
|
14
|
+
<button @click="locatione">location('...{{location.slice(-5)}}')</button>
|
|
15
15
|
</layout>
|
|
16
|
-
<button @click="getLocation"
|
|
16
|
+
<button @click="getLocation">getLocation()</button>
|
|
17
|
+
<button @click="back">back()</button>
|
|
17
18
|
</layout>
|
|
18
19
|
</form>
|
|
@@ -41,7 +41,6 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
41
41
|
this.type = ['primary'];
|
|
42
42
|
this.progress = ['noraml'];
|
|
43
43
|
this.dr = '';
|
|
44
|
-
this.setTopMostValue = false;
|
|
45
44
|
}
|
|
46
45
|
min() {
|
|
47
46
|
clickgo.form.min(this.formId);
|
|
@@ -225,10 +224,6 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
225
224
|
}
|
|
226
225
|
});
|
|
227
226
|
}
|
|
228
|
-
setTopMost() {
|
|
229
|
-
this.setTopMostValue = !this.setTopMostValue;
|
|
230
|
-
this.topMost = this.setTopMostValue;
|
|
231
|
-
}
|
|
232
227
|
flash() {
|
|
233
228
|
clickgo.form.flash(this.formId);
|
|
234
229
|
}
|
|
@@ -144,12 +144,13 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
144
144
|
continue;
|
|
145
145
|
}
|
|
146
146
|
const task = tasks[taskId];
|
|
147
|
-
let
|
|
147
|
+
let app = undefined;
|
|
148
|
+
const appIndex = this.getAppIndexByPath(task.path);
|
|
148
149
|
if (appIndex >= 0) {
|
|
149
150
|
this.apps[appIndex].opened = true;
|
|
150
151
|
}
|
|
151
152
|
else {
|
|
152
|
-
|
|
153
|
+
app = {
|
|
153
154
|
'name': task.name,
|
|
154
155
|
'path': task.path,
|
|
155
156
|
'icon': task.icon,
|
|
@@ -158,21 +159,26 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
158
159
|
'forms': {},
|
|
159
160
|
'formCount': 0,
|
|
160
161
|
'pin': false
|
|
161
|
-
}
|
|
162
|
-
appIndex = this.apps.length - 1;
|
|
162
|
+
};
|
|
163
163
|
}
|
|
164
164
|
const forms = clickgo.form.getList(parseInt(taskId));
|
|
165
165
|
for (const formId in forms) {
|
|
166
166
|
const form = forms[formId];
|
|
167
|
-
|
|
167
|
+
if (!form.showInSystemTask) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
(app !== null && app !== void 0 ? app : this.apps[appIndex]).forms[formId] = {
|
|
168
171
|
'title': form.title,
|
|
169
|
-
'icon': form.icon || this.apps[appIndex].icon
|
|
172
|
+
'icon': form.icon || (app !== null && app !== void 0 ? app : this.apps[appIndex]).icon
|
|
170
173
|
};
|
|
171
174
|
}
|
|
172
|
-
this.apps[appIndex].formCount = Object.keys(this.apps[appIndex].forms).length;
|
|
175
|
+
(app !== null && app !== void 0 ? app : this.apps[appIndex]).formCount = Object.keys((app !== null && app !== void 0 ? app : this.apps[appIndex]).forms).length;
|
|
176
|
+
if (app === null || app === void 0 ? void 0 : app.formCount) {
|
|
177
|
+
this.apps.push(app);
|
|
178
|
+
}
|
|
173
179
|
}
|
|
174
180
|
}
|
|
175
|
-
onFormCreated(taskId, formId, title, icon) {
|
|
181
|
+
onFormCreated(taskId, formId, title, icon, sist) {
|
|
176
182
|
if (taskId === this.taskId) {
|
|
177
183
|
return;
|
|
178
184
|
}
|
|
@@ -180,6 +186,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
180
186
|
if (!task) {
|
|
181
187
|
return;
|
|
182
188
|
}
|
|
189
|
+
if (!sist) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
183
192
|
let appIndex = this.getAppIndexByPath(task.path);
|
|
184
193
|
if (appIndex >= 0) {
|
|
185
194
|
this.apps[appIndex].opened = true;
|
|
@@ -212,6 +221,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
212
221
|
if (appIndex < 0) {
|
|
213
222
|
return;
|
|
214
223
|
}
|
|
224
|
+
if (!this.apps[appIndex].forms[formId]) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
215
227
|
delete this.apps[appIndex].forms[formId];
|
|
216
228
|
--this.apps[appIndex].formCount;
|
|
217
229
|
if (this.apps[appIndex].formCount > 0) {
|
|
@@ -275,6 +287,58 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
275
287
|
}
|
|
276
288
|
this.apps[appIndex].forms[formId].icon = icon || this.apps[appIndex].icon;
|
|
277
289
|
}
|
|
290
|
+
onFormShowInSystemTaskChange(taskId, formId, value) {
|
|
291
|
+
const task = clickgo.task.get(taskId);
|
|
292
|
+
if (!task) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (value) {
|
|
296
|
+
const form = clickgo.form.get(formId);
|
|
297
|
+
if (!form) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
let appIndex = this.getAppIndexByPath(task.path);
|
|
301
|
+
if (appIndex >= 0) {
|
|
302
|
+
this.apps[appIndex].opened = true;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.apps.push({
|
|
306
|
+
'name': task.name,
|
|
307
|
+
'path': task.path,
|
|
308
|
+
'icon': task.icon,
|
|
309
|
+
'selected': false,
|
|
310
|
+
'opened': true,
|
|
311
|
+
'forms': {},
|
|
312
|
+
'formCount': 0,
|
|
313
|
+
'pin': false
|
|
314
|
+
});
|
|
315
|
+
appIndex = this.apps.length - 1;
|
|
316
|
+
}
|
|
317
|
+
this.apps[appIndex].forms[formId] = {
|
|
318
|
+
'title': form.title,
|
|
319
|
+
'icon': form.icon || this.apps[appIndex].icon
|
|
320
|
+
};
|
|
321
|
+
++this.apps[appIndex].formCount;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
const appIndex = this.getAppIndexByPath(task.path);
|
|
325
|
+
if (appIndex < 0) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
delete this.apps[appIndex].forms[formId];
|
|
329
|
+
--this.apps[appIndex].formCount;
|
|
330
|
+
if (this.apps[appIndex].formCount > 0) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const pinPaths = Object.keys(clickgo.core.config['task.pin']);
|
|
334
|
+
if (pinPaths.includes(this.apps[appIndex].path)) {
|
|
335
|
+
this.apps[appIndex].opened = false;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
this.apps.splice(appIndex, 1);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
278
342
|
onConfigChanged(n, v) {
|
|
279
343
|
if (n !== 'task.pin') {
|
|
280
344
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<form title="Bar" border="none" :resize="false" background="transparent">
|
|
2
2
|
<task :position="position">
|
|
3
3
|
<task-item @click="showLauncher">
|
|
4
4
|
<img src="/clickgo/icon.png" style="width: 16px; height: 16px;" />
|
package/dist/clickgo.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
|
|
27
|
-
const version = '3.5.
|
|
27
|
+
const version = '3.5.3';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
package/dist/control/box.cgc
CHANGED
|
Binary file
|
package/dist/control/common.cgc
CHANGED
|
Binary file
|
package/dist/control/desc.cgc
CHANGED
|
Binary file
|
package/dist/control/echarts.cgc
CHANGED
|
Binary file
|
package/dist/control/form.cgc
CHANGED
|
Binary file
|
package/dist/control/html.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/map.cgc
CHANGED
|
Binary file
|
package/dist/control/monaco.cgc
CHANGED
|
Binary file
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
package/dist/control/page.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/table.cgc
CHANGED
|
Binary file
|
package/dist/control/task.cgc
CHANGED
|
Binary file
|
package/dist/control/xterm.cgc
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
package/dist/index.ts
CHANGED
|
@@ -60,7 +60,9 @@ export abstract class AbstractBoot {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/** --- 窗体创建事件 --- */
|
|
63
|
-
public onFormCreated(
|
|
63
|
+
public onFormCreated(
|
|
64
|
+
taskId: number, formId: number, title: string, icon: string, showInSystemTask: boolean
|
|
65
|
+
): void | Promise<void>;
|
|
64
66
|
public onFormCreated(): void {
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
@@ -119,6 +121,12 @@ export abstract class AbstractBoot {
|
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
/** --- 窗体是否显示在任务栏属性改变事件 --- */
|
|
125
|
+
public onFormShowInSystemTaskChange(taskId: number, formId: number, value: boolean): void | Promise<void>;
|
|
126
|
+
public onFormShowInSystemTaskChange(): void {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
122
130
|
/** --- 任务开始事件 --- */
|
|
123
131
|
public onTaskStarted(taskId: number): void | Promise<void>;
|
|
124
132
|
public onTaskStarted(): void | Promise<void> {
|
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
|
}
|
|
@@ -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 {
|
|
@@ -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);
|
package/dist/lib/task.js
CHANGED
package/dist/lib/task.ts
CHANGED
|
@@ -512,6 +512,9 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
512
512
|
},
|
|
513
513
|
getLocation: function(): string {
|
|
514
514
|
return core.getLocation();
|
|
515
|
+
},
|
|
516
|
+
back: function(): boolean {
|
|
517
|
+
return core.back(taskId);
|
|
515
518
|
}
|
|
516
519
|
},
|
|
517
520
|
'dom': {
|
package/dist/theme/byterun.cgt
CHANGED
|
Binary file
|
package/dist/theme/familiar.cgt
CHANGED
|
Binary file
|
package/dist/theme/light.cgt
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -80,10 +80,12 @@ export interface IAvailArea {
|
|
|
80
80
|
'top': number;
|
|
81
81
|
'width': number;
|
|
82
82
|
'height': number;
|
|
83
|
+
'owidth': number;
|
|
84
|
+
'oheight': number;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
/** --- 全局事件类型 --- */
|
|
86
|
-
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged';
|
|
88
|
+
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged';
|
|
87
89
|
|
|
88
90
|
/** --- 现场下载 app 的参数 --- */
|
|
89
91
|
export interface ICoreFetchAppOptions {
|
|
@@ -311,6 +313,7 @@ export interface IFormInfo {
|
|
|
311
313
|
'stateMin': boolean;
|
|
312
314
|
'show': boolean;
|
|
313
315
|
'focus': boolean;
|
|
316
|
+
'showInSystemTask': boolean;
|
|
314
317
|
}
|
|
315
318
|
|
|
316
319
|
// --------------------------
|
|
Binary file
|
|
Binary file
|
package/dist/control/aform.cgc
DELETED
|
Binary file
|
package/dist/control/alayout.cgc
DELETED
|
Binary file
|