@steedos/service-pages 2.3.0 → 2.3.1-beta.2

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.
@@ -327,13 +327,63 @@
327
327
  Steedos.Page.Form.StandardNew.render = function (appId, objectApiName, title, initialValues, options) {
328
328
  const page = Steedos.Page.getPage('form', appId, objectApiName);
329
329
  if (page && page.schema) {
330
- // const elementId = getModalElement(`${objectApiName}-standard_new`);
331
- return Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
330
+ const elementId = getModalElement(`${objectApiName}-standard_new`);
331
+ page.schema = {
332
+ "type": "service",
333
+ "className": "hidden",
334
+ "body": [
335
+ {
336
+ "type": "button",
337
+ "label": "新建",
338
+ "id": "u:standard_new",
339
+ "level": "default",
340
+ "onEvent": {
341
+ "click": {
342
+ "actions": [
343
+ {
344
+ "actionType": "dialog",
345
+ "dialog": {
346
+ "type": "dialog",
347
+ "title": title,
348
+ "bodyClassName": "",
349
+ "body": [
350
+ JSON.parse(page.schema)
351
+ ],
352
+ "id": "u:0b96577db93c",
353
+ "closeOnEsc": false,
354
+ "closeOnOutside": false,
355
+ "showCloseButton": true,
356
+ "size": "lg"
357
+ }
358
+ }
359
+ ],
360
+ "weight": 0
361
+ }
362
+ }
363
+ }
364
+ ],
365
+ "regions": [
366
+ "body"
367
+ ],
368
+ "bodyClassName": "p-0",
369
+ "id": "u:aef99d937b10"
370
+ }
371
+ const scope = Steedos.Page.render(elementId, page, Object.assign({}, options, {
332
372
  appId: appId,
333
373
  objectName: objectApiName,
334
374
  title: title,
335
375
  data: initialValues,
336
376
  }));
377
+ setTimeout(()=>{
378
+ $("button", scope).trigger("click")
379
+ }, 300)
380
+ return scope ;
381
+ // return Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
382
+ // appId: appId,
383
+ // objectName: objectApiName,
384
+ // title: title,
385
+ // data: initialValues,
386
+ // }));
337
387
  }
338
388
 
339
389
  SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
@@ -354,13 +404,63 @@
354
404
  Steedos.Page.Form.StandardEdit.render = function (appId, objectApiName, title, recordId, options) {
355
405
  const page = Steedos.Page.getPage('form', appId, objectApiName, recordId);
356
406
  if (page && page.schema) {
357
- // const elementId = getModalElement(`${objectApiName}-standard_edit`);
358
- return Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
407
+ const elementId = getModalElement(`${objectApiName}-standard_edit`);
408
+ page.schema = {
409
+ "type": "service",
410
+ "className": "hidden",
411
+ "body": [
412
+ {
413
+ "type": "button",
414
+ "label": "编辑",
415
+ "id": "u:standard_new",
416
+ "level": "default",
417
+ "onEvent": {
418
+ "click": {
419
+ "actions": [
420
+ {
421
+ "actionType": "dialog",
422
+ "dialog": {
423
+ "type": "dialog",
424
+ "title": title,
425
+ "bodyClassName": "",
426
+ "body": [
427
+ JSON.parse(page.schema)
428
+ ],
429
+ "id": "u:0b96577db93c",
430
+ "closeOnEsc": false,
431
+ "closeOnOutside": false,
432
+ "showCloseButton": true,
433
+ "size": "lg"
434
+ }
435
+ }
436
+ ],
437
+ "weight": 0
438
+ }
439
+ }
440
+ }
441
+ ],
442
+ "regions": [
443
+ "body"
444
+ ],
445
+ "bodyClassName": "p-0",
446
+ "id": "u:aef99d937b10"
447
+ }
448
+ const scope = Steedos.Page.render(elementId, page, Object.assign({}, options, {
359
449
  appId: appId,
360
450
  objectName: objectApiName,
361
451
  title: title,
362
452
  recordId: recordId
363
453
  }));
454
+ setTimeout(()=>{
455
+ $("button", scope).trigger("click")
456
+ }, 300)
457
+ return scope ;
458
+ // return Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
459
+ // appId: appId,
460
+ // objectName: objectApiName,
461
+ // title: title,
462
+ // recordId: recordId
463
+ // }));
364
464
  }
365
465
 
366
466
  return SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-beta.2",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "b00e79e6fb8549b2fabed7b6cd6d4847775ba5df",
11
+ "gitHead": "90c8b343e760df21f482433b89fdc95e076ca566",
12
12
  "dependencies": {
13
13
  "ejs": "^3.1.8"
14
14
  }