clickgo 3.1.7-dev16 → 3.1.9-dev18

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 CHANGED
@@ -19,7 +19,7 @@ Load the module loader first, and then load it using the module loader.
19
19
  **index.html**
20
20
 
21
21
  ```html
22
- <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.6/dist/loader.min.js?path=index&npm={'clickgo':'3.1.7-dev16'}"></script>
22
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.8/dist/loader.min.js?path=index&npm={'clickgo':'3.1.9-dev18'}"></script>
23
23
  ```
24
24
 
25
25
  **index.js**
@@ -38,9 +38,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
38
  const clickgo = __importStar(require("clickgo"));
39
39
  const main_1 = __importDefault(require("./form/main"));
40
40
  class default_1 extends clickgo.core.AbstractApp {
41
- main() {
41
+ main(data) {
42
+ var _a;
42
43
  return __awaiter(this, void 0, void 0, function* () {
43
- this.run(yield clickgo.form.create(main_1.default));
44
+ this.run(yield clickgo.form.create(main_1.default, {
45
+ 'param': (_a = data.param) !== null && _a !== void 0 ? _a : 'none'
46
+ }));
44
47
  });
45
48
  }
46
49
  }
@@ -77,6 +77,7 @@ class default_1 extends clickgo.form.AbstractForm {
77
77
  constructor() {
78
78
  super(...arguments);
79
79
  this.ntab = '';
80
+ this.adata = {};
80
81
  }
81
82
  openForm(name) {
82
83
  return __awaiter(this, void 0, void 0, function* () {
@@ -257,5 +258,8 @@ class default_1 extends clickgo.form.AbstractForm {
257
258
  frm.show();
258
259
  });
259
260
  }
261
+ onMounted(data) {
262
+ this.adata = data;
263
+ }
260
264
  }
261
265
  exports.default = default_1;
@@ -2,6 +2,7 @@
2
2
  <tab v-model="ntab" :tabs="['control', 'method', 'event']" style="margin: 10px; flex: 1;">
3
3
  <flow v-if="ntab === 'control'" class="inner" direction="v">
4
4
  <layout class="buttons" gutter="10" direction="v">
5
+ <label>App data: {{adata}}</label>
5
6
  <button @click="openForm('cform')">Form</button>
6
7
  <button @click="openForm('clayout')">Layout</button>
7
8
  <button @click="openForm('cimg')">Img</button>
package/dist/lib/core.ts CHANGED
@@ -67,7 +67,7 @@ export abstract class AbstractApp {
67
67
  }
68
68
 
69
69
  /** --- App 的入口文件 --- */
70
- public abstract main(): Promise<void>;
70
+ public abstract main(data: Record<string, any>): Promise<void>;
71
71
 
72
72
  /**
73
73
  * --- 以某个窗体进行正式启动这个 app(入口 form),不启动则任务也启动失败 ---
package/dist/lib/form.ts CHANGED
@@ -397,7 +397,7 @@ export abstract class AbstractForm extends AbstractCommon {
397
397
 
398
398
  // --- 窗体可以接收到的事件 ---
399
399
 
400
- public onMounted(obj: Record<string, any>): void | Promise<void>;
400
+ public onMounted(data: Record<string, any>): void | Promise<void>;
401
401
  public onMounted(): void {
402
402
  return;
403
403
  }
package/dist/lib/task.js CHANGED
@@ -193,7 +193,7 @@ function getList() {
193
193
  }
194
194
  exports.getList = getList;
195
195
  function run(url, opt = {}, ntid) {
196
- var _a, _b, _c, _d;
196
+ var _a, _b, _c, _d, _e;
197
197
  return __awaiter(this, void 0, void 0, function* () {
198
198
  if (!url.endsWith('/') && !url.endsWith('.cga')) {
199
199
  return 0;
@@ -998,7 +998,7 @@ function run(url, opt = {}, ntid) {
998
998
  const data = JSON.parse(lcontent);
999
999
  loadLocaleData(locale, data, '', taskId);
1000
1000
  }
1001
- catch (_e) {
1001
+ catch (_f) {
1002
1002
  }
1003
1003
  }
1004
1004
  }
@@ -1066,7 +1066,7 @@ function run(url, opt = {}, ntid) {
1066
1066
  }
1067
1067
  const appCls = new expo.default();
1068
1068
  exports.list[taskId].class = appCls;
1069
- yield appCls.main();
1069
+ yield appCls.main((_e = opt.data) !== null && _e !== void 0 ? _e : {});
1070
1070
  return taskId;
1071
1071
  });
1072
1072
  }
package/dist/lib/task.ts CHANGED
@@ -1186,7 +1186,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
1186
1186
  // --- 执行 app ---
1187
1187
  const appCls: core.AbstractApp = new expo.default();
1188
1188
  list[taskId].class = appCls;
1189
- await appCls.main();
1189
+ await appCls.main(opt.data ?? {});
1190
1190
  return taskId;
1191
1191
  }
1192
1192
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.1.7-dev16",
3
+ "version": "3.1.9-dev18",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",
package/types/index.d.ts CHANGED
@@ -427,6 +427,8 @@ export interface ITaskRunOptions {
427
427
  'unblock'?: string[];
428
428
  /** --- 直接赋予此任务相应权限,App 模式下有 "root" 权限的应用才能设置 --- */
429
429
  'permissions'?: string[];
430
+ /** --- 给 task 传值 --- */
431
+ 'data'?: Record<string, any>;
430
432
  }
431
433
 
432
434
  export interface ICreateTimerOptions {