clickgo 3.16.26 → 3.16.28
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/app.js +4 -16
- package/dist/app/demo/config.json +4 -1
- package/dist/app/demo/form/control/arteditor/arteditor.js +7 -18
- package/dist/app/demo/form/control/button/button.js +2 -13
- package/dist/app/demo/form/control/check/check.js +3 -14
- package/dist/app/demo/form/control/content/content.js +3 -14
- package/dist/app/demo/form/control/daterange/daterange.js +1 -1
- package/dist/app/demo/form/control/delete/delete.js +3 -14
- package/dist/app/demo/form/control/dialog/dialog.js +2 -0
- package/dist/app/demo/form/control/dialog/dialog.xml +26 -12
- package/dist/app/demo/form/control/flow/flow.js +2 -13
- package/dist/app/demo/form/control/form/form.js +4 -15
- package/dist/app/demo/form/control/iconview/iconview.js +12 -29
- package/dist/app/demo/form/control/jodit/jodit.js +7 -18
- package/dist/app/demo/form/control/link/link.js +2 -13
- package/dist/app/demo/form/control/list/list.js +40 -52
- package/dist/app/demo/form/control/list/list.xml +20 -10
- package/dist/app/demo/form/control/map/map.js +17 -28
- package/dist/app/demo/form/control/menu/menu.js +6 -17
- package/dist/app/demo/form/control/mpegts/mpegts.js +1 -1
- package/dist/app/demo/form/control/nav/nav.js +6 -17
- package/dist/app/demo/form/control/novnc/novnc.js +75 -0
- package/dist/app/demo/form/control/novnc/novnc.xml +13 -0
- package/dist/app/demo/form/control/panel/panel.js +9 -20
- package/dist/app/demo/form/control/panel/test1.js +20 -41
- package/dist/app/demo/form/control/pdf/pdf.js +7 -20
- package/dist/app/demo/form/control/progress/progress.js +3 -12
- package/dist/app/demo/form/control/radio/radio.js +6 -17
- package/dist/app/demo/form/control/select/select.js +28 -41
- package/dist/app/demo/form/control/switch/switch.js +3 -14
- package/dist/app/demo/form/control/tab/tab.js +7 -18
- package/dist/app/demo/form/control/table/table.js +8 -23
- package/dist/app/demo/form/control/text/text.js +2 -13
- package/dist/app/demo/form/control/tuieditor/tuieditor.js +7 -18
- package/dist/app/demo/form/control/uploader/uploader.js +20 -31
- package/dist/app/demo/form/control/vflow/vflow.js +2 -13
- package/dist/app/demo/form/event/form/form.js +11 -22
- package/dist/app/demo/form/event/task/task.js +14 -29
- package/dist/app/demo/form/main.js +381 -387
- package/dist/app/demo/form/main.xml +3 -0
- package/dist/app/demo/form/method/acontrol/acontrol.js +2 -13
- package/dist/app/demo/form/method/aform/aform.js +41 -60
- package/dist/app/demo/form/method/aform/sd.js +3 -14
- package/dist/app/demo/form/method/core/core.js +25 -50
- package/dist/app/demo/form/method/dom/dom.js +35 -58
- package/dist/app/demo/form/method/form/form.js +106 -149
- package/dist/app/demo/form/method/fs/fs.js +126 -147
- package/dist/app/demo/form/method/native/native.js +44 -72
- package/dist/app/demo/form/method/storage/storage.js +9 -27
- package/dist/app/demo/form/method/system/system.js +16 -41
- package/dist/app/demo/form/method/task/task.js +18 -37
- package/dist/app/demo/form/method/theme/theme.js +39 -54
- package/dist/app/demo/form/method/tool/tool.js +22 -43
- package/dist/app/demo/form/method/tool/tool.xml +1 -1
- package/dist/app/demo/form/method/zip/zip.js +18 -29
- package/dist/app/demo/form/solution/backpanel/backpanel.js +10 -23
- package/dist/app/task/app.js +2 -13
- package/dist/app/task/form/bar/bar.js +32 -45
- package/dist/clickgo.js +1 -1
- package/dist/control/arteditor.cgc +0 -0
- package/dist/control/box.cgc +0 -0
- package/dist/control/captcha.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/drawer.cgc +0 -0
- package/dist/control/echarts.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/jodit.cgc +0 -0
- package/dist/control/map.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/mpegts.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/novnc.cgc +0 -0
- package/dist/control/page.cgc +0 -0
- package/dist/control/pdf.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/qrcode.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/tplink.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/control/tuiviewer.cgc +0 -0
- package/dist/control/xterm.cgc +0 -0
- package/dist/index.js +59 -71
- package/dist/lib/control.js +213 -235
- package/dist/lib/core.js +356 -379
- package/dist/lib/dom.js +62 -91
- package/dist/lib/form.js +834 -906
- package/dist/lib/fs.js +834 -892
- package/dist/lib/native.js +32 -63
- package/dist/lib/storage.js +21 -33
- package/dist/lib/task.js +1054 -1098
- package/dist/lib/theme.js +102 -121
- package/dist/lib/tool.js +65 -98
- package/dist/lib/zip.js +27 -42
- package/dist/theme/blue.cgt +0 -0
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/dark.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
package/dist/lib/control.js
CHANGED
|
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
36
|
exports.AbstractControl = void 0;
|
|
46
37
|
exports.read = read;
|
|
@@ -91,8 +82,7 @@ class AbstractControl {
|
|
|
91
82
|
return this._rootControl;
|
|
92
83
|
}
|
|
93
84
|
get formFocus() {
|
|
94
|
-
|
|
95
|
-
return (_b = (_a = this.rootForm) === null || _a === void 0 ? void 0 : _a.formFocus) !== null && _b !== void 0 ? _b : false;
|
|
85
|
+
return this.rootForm?.formFocus ?? false;
|
|
96
86
|
}
|
|
97
87
|
get path() {
|
|
98
88
|
return '';
|
|
@@ -105,8 +95,7 @@ class AbstractControl {
|
|
|
105
95
|
}
|
|
106
96
|
get l() {
|
|
107
97
|
return (key, data) => {
|
|
108
|
-
|
|
109
|
-
const loc = (_b = (_a = this.localeData) === null || _a === void 0 ? void 0 : _a[this.locale][key]) !== null && _b !== void 0 ? _b : '[LocaleError]' + key;
|
|
98
|
+
const loc = this.localeData?.[this.locale][key] ?? '[LocaleError]' + key;
|
|
110
99
|
if (!data) {
|
|
111
100
|
return loc;
|
|
112
101
|
}
|
|
@@ -284,227 +273,223 @@ class AbstractControl {
|
|
|
284
273
|
}
|
|
285
274
|
}
|
|
286
275
|
exports.AbstractControl = AbstractControl;
|
|
287
|
-
function read(blob) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
276
|
+
async function read(blob) {
|
|
277
|
+
const z = await zip.get(blob);
|
|
278
|
+
if (!z) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const controlPkg = {};
|
|
282
|
+
const list = z.readDir('/');
|
|
283
|
+
for (const sub of list) {
|
|
284
|
+
if (sub.isFile) {
|
|
285
|
+
continue;
|
|
292
286
|
}
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const configContent = yield z.getContent('/' + sub.name + '/config.json');
|
|
300
|
-
if (!configContent) {
|
|
301
|
-
form.notify({
|
|
302
|
-
'title': 'Error',
|
|
303
|
-
'content': `Control file not found.\nFile: "${'/' + sub.name + '/config.json'}".`,
|
|
304
|
-
'type': 'danger'
|
|
305
|
-
});
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
const config = JSON.parse(configContent);
|
|
309
|
-
controlPkg[config.name] = {
|
|
310
|
-
'type': 'control',
|
|
311
|
-
'config': config,
|
|
312
|
-
'files': {}
|
|
313
|
-
};
|
|
314
|
-
const list = z.readDir('/' + sub.name + '/', {
|
|
315
|
-
'hasChildren': true
|
|
287
|
+
const configContent = await z.getContent('/' + sub.name + '/config.json');
|
|
288
|
+
if (!configContent) {
|
|
289
|
+
form.notify({
|
|
290
|
+
'title': 'Error',
|
|
291
|
+
'content': `Control file not found.\nFile: "${'/' + sub.name + '/config.json'}".`,
|
|
292
|
+
'type': 'danger'
|
|
316
293
|
});
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const config = JSON.parse(configContent);
|
|
297
|
+
controlPkg[config.name] = {
|
|
298
|
+
'type': 'control',
|
|
299
|
+
'config': config,
|
|
300
|
+
'files': {}
|
|
301
|
+
};
|
|
302
|
+
const list = z.readDir('/' + sub.name + '/', {
|
|
303
|
+
'hasChildren': true
|
|
304
|
+
});
|
|
305
|
+
for (const file of list) {
|
|
306
|
+
const pre = file.path.slice(config.name.length + 1);
|
|
307
|
+
const mime = tool.getMimeByPath(file.name);
|
|
308
|
+
if (['txt', 'json', 'js', 'css', 'xml', 'html'].includes(mime.ext)) {
|
|
309
|
+
const fab = await z.getContent(file.path + file.name, 'string');
|
|
310
|
+
if (!fab) {
|
|
311
|
+
continue;
|
|
326
312
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
'type': mime.mime
|
|
334
|
-
});
|
|
313
|
+
controlPkg[config.name].files[pre + file.name] = fab.replace(/^\ufeff/, '');
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
const fab = await z.getContent(file.path + file.name, 'arraybuffer');
|
|
317
|
+
if (!fab) {
|
|
318
|
+
continue;
|
|
335
319
|
}
|
|
320
|
+
controlPkg[config.name].files[pre + file.name] = new Blob([fab], {
|
|
321
|
+
'type': mime.mime
|
|
322
|
+
});
|
|
336
323
|
}
|
|
337
324
|
}
|
|
338
|
-
|
|
339
|
-
|
|
325
|
+
}
|
|
326
|
+
return controlPkg;
|
|
340
327
|
}
|
|
341
|
-
function init(taskId, invoke, cache) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
328
|
+
async function init(taskId, invoke, cache) {
|
|
329
|
+
const t = task.list[taskId];
|
|
330
|
+
if (!t) {
|
|
331
|
+
return -1;
|
|
332
|
+
}
|
|
333
|
+
for (let path of t.app.config.controls) {
|
|
334
|
+
if (!path.endsWith('.cgc')) {
|
|
335
|
+
path += '.cgc';
|
|
346
336
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
t.controls[name].layout = tool.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
form.notify({
|
|
408
|
-
'title': 'Error',
|
|
409
|
-
'content': `The "eval" is prohibited.\nFile: "${path}".`,
|
|
410
|
-
'type': 'danger'
|
|
411
|
-
});
|
|
412
|
-
return '';
|
|
413
|
-
}
|
|
414
|
-
code = code.replace(/extends[\s\S]+?\.\s*AbstractControl\s*{/, (t) => {
|
|
415
|
-
return t + 'get filename() {return __filename;}';
|
|
337
|
+
path = tool.urlResolve('/', path);
|
|
338
|
+
const file = await fs.getContent(path, {
|
|
339
|
+
'cache': cache
|
|
340
|
+
}, taskId);
|
|
341
|
+
if (file && typeof file !== 'string') {
|
|
342
|
+
const c = await read(file);
|
|
343
|
+
if (c) {
|
|
344
|
+
for (const name in c) {
|
|
345
|
+
const item = c[name];
|
|
346
|
+
let prep = '';
|
|
347
|
+
t.controls[name] = {
|
|
348
|
+
'layout': '',
|
|
349
|
+
'files': item.files,
|
|
350
|
+
'props': {},
|
|
351
|
+
'emits': {},
|
|
352
|
+
'data': {},
|
|
353
|
+
'access': {},
|
|
354
|
+
'methods': {},
|
|
355
|
+
'computed': {}
|
|
356
|
+
};
|
|
357
|
+
t.controls[name].layout = item.files[item.config.layout + '.html'];
|
|
358
|
+
if (t.controls[name].layout === undefined) {
|
|
359
|
+
return -2;
|
|
360
|
+
}
|
|
361
|
+
t.controls[name].layout = t.controls[name].layout.replace(/^(<[a-zA-Z0-9-]+)( |>)/, '$1 data-cg-control="' + name + '"$2');
|
|
362
|
+
const style = item.files[item.config.style + '.css'];
|
|
363
|
+
if (style) {
|
|
364
|
+
const r = tool.stylePrepend(style);
|
|
365
|
+
prep = r.prep;
|
|
366
|
+
dom.pushStyle(t.id, await tool.styleUrl2DataUrl(item.config.style, r.style, item.files), 'control', name);
|
|
367
|
+
}
|
|
368
|
+
const prepList = [
|
|
369
|
+
'cg-theme-task' + t.id.toString() + '-' + name + '_'
|
|
370
|
+
];
|
|
371
|
+
if (prep !== '') {
|
|
372
|
+
prepList.push(prep);
|
|
373
|
+
}
|
|
374
|
+
t.controls[name].layout = tool.layoutAddTagClassAndReTagName(t.controls[name].layout, false);
|
|
375
|
+
t.controls[name].layout = tool.layoutClassPrepend(t.controls[name].layout, prepList);
|
|
376
|
+
t.controls[name].layout = tool.eventsAttrWrap(t.controls[name].layout);
|
|
377
|
+
if (t.controls[name].layout.includes('<teleport')) {
|
|
378
|
+
t.controls[name].layout = tool.teleportGlue(t.controls[name].layout, '{{{formId}}}');
|
|
379
|
+
}
|
|
380
|
+
t.controls[name].access['cgPCMap'] = tool.random(8, tool.RANDOM_LUNS, '"<>$');
|
|
381
|
+
t.controls[name].layout = t.controls[name].layout.replace(/(<cg-[a-zA-Z0-9-_]+)/g, `$1 data-cg-rootcontrol="${t.controls[name].access['cgPCMap']}"`);
|
|
382
|
+
let cls;
|
|
383
|
+
if (item.files[item.config.code + '.js']) {
|
|
384
|
+
item.files['/invoke/clickgo.js'] = `module.exports = invokeClickgo;`;
|
|
385
|
+
let expo = [];
|
|
386
|
+
try {
|
|
387
|
+
expo = loader.require(item.config.code, item.files, {
|
|
388
|
+
'dir': '/',
|
|
389
|
+
'invoke': invoke,
|
|
390
|
+
'preprocess': function (code, path) {
|
|
391
|
+
const exec = /eval\W/.exec(code);
|
|
392
|
+
if (exec) {
|
|
393
|
+
form.notify({
|
|
394
|
+
'title': 'Error',
|
|
395
|
+
'content': `The "eval" is prohibited.\nFile: "${path}".`,
|
|
396
|
+
'type': 'danger'
|
|
416
397
|
});
|
|
417
|
-
return
|
|
418
|
-
},
|
|
419
|
-
'map': {
|
|
420
|
-
'clickgo': '/invoke/clickgo'
|
|
398
|
+
return '';
|
|
421
399
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
const msg = '"default" not found on "' + item.config.code + '" of "' + name + '" control.';
|
|
430
|
-
core.trigger('error', taskId, 0, new Error(msg), msg);
|
|
431
|
-
return -4;
|
|
432
|
-
}
|
|
433
|
-
cls = new expo.default();
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
cls = new (class extends AbstractControl {
|
|
437
|
-
get taskId() {
|
|
438
|
-
return taskId;
|
|
400
|
+
code = code.replace(/extends[\s\S]+?\.\s*AbstractControl\s*{/, (t) => {
|
|
401
|
+
return t + 'get filename() {return __filename;}';
|
|
402
|
+
});
|
|
403
|
+
return code;
|
|
404
|
+
},
|
|
405
|
+
'map': {
|
|
406
|
+
'clickgo': '/invoke/clickgo'
|
|
439
407
|
}
|
|
440
|
-
})
|
|
408
|
+
})[0];
|
|
441
409
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
'default': cls.props[key]
|
|
446
|
-
};
|
|
447
|
-
}
|
|
410
|
+
catch (e) {
|
|
411
|
+
core.trigger('error', taskId, 0, e, e.message + '(-4)');
|
|
412
|
+
return -3;
|
|
448
413
|
}
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
414
|
+
if (!expo?.default) {
|
|
415
|
+
const msg = '"default" not found on "' + item.config.code + '" of "' + name + '" control.';
|
|
416
|
+
core.trigger('error', taskId, 0, new Error(msg), msg);
|
|
417
|
+
return -4;
|
|
453
418
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
t.controls[name].access = item[1];
|
|
461
|
-
continue;
|
|
419
|
+
cls = new expo.default();
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
cls = new (class extends AbstractControl {
|
|
423
|
+
get taskId() {
|
|
424
|
+
return taskId;
|
|
462
425
|
}
|
|
463
|
-
|
|
426
|
+
})();
|
|
427
|
+
}
|
|
428
|
+
if (cls.props) {
|
|
429
|
+
for (const key in cls.props) {
|
|
430
|
+
t.controls[name].props[key] = {
|
|
431
|
+
'default': cls.props[key]
|
|
432
|
+
};
|
|
464
433
|
}
|
|
465
|
-
const prot = tool.getClassPrototype(cls);
|
|
466
|
-
t.controls[name].methods = prot.method;
|
|
467
|
-
Object.assign(t.controls[name].computed, prot.access);
|
|
468
|
-
t.controls[name].computed.controlName = {
|
|
469
|
-
get: function () {
|
|
470
|
-
return name;
|
|
471
|
-
},
|
|
472
|
-
set: function () {
|
|
473
|
-
form.notify({
|
|
474
|
-
'title': 'Error',
|
|
475
|
-
'content': `The software tries to modify the system variable "controlName".\nControl: ${name}`,
|
|
476
|
-
'type': 'danger'
|
|
477
|
-
});
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
t.controls[name].computed.prep = {
|
|
482
|
-
get: function () {
|
|
483
|
-
return prep;
|
|
484
|
-
},
|
|
485
|
-
set: function () {
|
|
486
|
-
form.notify({
|
|
487
|
-
'title': 'Error',
|
|
488
|
-
'content': `The software tries to modify the system variable "prep".\nControl: ${name}`,
|
|
489
|
-
'type': 'danger'
|
|
490
|
-
});
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
434
|
}
|
|
435
|
+
if (cls.emits) {
|
|
436
|
+
for (const key in cls.emits) {
|
|
437
|
+
t.controls[name].emits[key] = cls.emits[key];
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const cdata = Object.entries(cls);
|
|
441
|
+
for (const item of cdata) {
|
|
442
|
+
if (item[0] === 'files') {
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
if (item[0] === 'access') {
|
|
446
|
+
t.controls[name].access = item[1];
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
t.controls[name].data[item[0]] = item[1];
|
|
450
|
+
}
|
|
451
|
+
const prot = tool.getClassPrototype(cls);
|
|
452
|
+
t.controls[name].methods = prot.method;
|
|
453
|
+
Object.assign(t.controls[name].computed, prot.access);
|
|
454
|
+
t.controls[name].computed.controlName = {
|
|
455
|
+
get: function () {
|
|
456
|
+
return name;
|
|
457
|
+
},
|
|
458
|
+
set: function () {
|
|
459
|
+
form.notify({
|
|
460
|
+
'title': 'Error',
|
|
461
|
+
'content': `The software tries to modify the system variable "controlName".\nControl: ${name}`,
|
|
462
|
+
'type': 'danger'
|
|
463
|
+
});
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
t.controls[name].computed.prep = {
|
|
468
|
+
get: function () {
|
|
469
|
+
return prep;
|
|
470
|
+
},
|
|
471
|
+
set: function () {
|
|
472
|
+
form.notify({
|
|
473
|
+
'title': 'Error',
|
|
474
|
+
'content': `The software tries to modify the system variable "prep".\nControl: ${name}`,
|
|
475
|
+
'type': 'danger'
|
|
476
|
+
});
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
};
|
|
495
480
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
form.notify({
|
|
484
|
+
'title': 'Error',
|
|
485
|
+
'content': 'Control failed to load.\nTask id: ' + t.id.toString() + '\nPath: ' + path,
|
|
486
|
+
'type': 'danger'
|
|
487
|
+
});
|
|
488
|
+
return -5;
|
|
504
489
|
}
|
|
505
490
|
}
|
|
506
|
-
|
|
507
|
-
|
|
491
|
+
}
|
|
492
|
+
return 1;
|
|
508
493
|
}
|
|
509
494
|
function buildComponents(taskId, formId, path) {
|
|
510
495
|
const t = task.list[taskId];
|
|
@@ -569,36 +554,29 @@ function buildComponents(taskId, formId, path) {
|
|
|
569
554
|
beforeMount: function () {
|
|
570
555
|
this.onBeforeMount();
|
|
571
556
|
},
|
|
572
|
-
mounted: function () {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
if (rc) {
|
|
578
|
-
this._rootControl = rc;
|
|
579
|
-
}
|
|
557
|
+
mounted: async function () {
|
|
558
|
+
if (this.element.dataset?.cgRootcontrol !== undefined) {
|
|
559
|
+
const rc = this.parentByAccess('cgPCMap', this.element.dataset.cgRootcontrol);
|
|
560
|
+
if (rc) {
|
|
561
|
+
this._rootControl = rc;
|
|
580
562
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
563
|
+
}
|
|
564
|
+
await this.$nextTick();
|
|
565
|
+
this.onMounted();
|
|
584
566
|
},
|
|
585
567
|
beforeUpdate: function () {
|
|
586
568
|
this.onBeforeUpdate();
|
|
587
569
|
},
|
|
588
|
-
updated: function () {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
this.onUpdated();
|
|
592
|
-
});
|
|
570
|
+
updated: async function () {
|
|
571
|
+
await this.$nextTick();
|
|
572
|
+
this.onUpdated();
|
|
593
573
|
},
|
|
594
574
|
beforeUnmount: function () {
|
|
595
575
|
this.onBeforeUnmount();
|
|
596
576
|
},
|
|
597
|
-
unmounted: function () {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
this.onUnmounted();
|
|
601
|
-
});
|
|
577
|
+
unmounted: async function () {
|
|
578
|
+
await this.$nextTick();
|
|
579
|
+
this.onUnmounted();
|
|
602
580
|
}
|
|
603
581
|
};
|
|
604
582
|
}
|