0221854a31f1529ce27ba41ccf2686903f2ddbf0.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, ViewParams, LayerPopUp, LayerDialog, _crd;
  4. function _reportPossibleCrUseOfUICallbacks(extras) {
  5. _reporterNs.report("UICallbacks", "./Defines", _context.meta, extras);
  6. }
  7. function _reportPossibleCrUseOfViewParams(extras) {
  8. _reporterNs.report("ViewParams", "./Defines", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfUIConfig(extras) {
  11. _reporterNs.report("UIConfig", "./LayerManager", _context.meta, extras);
  12. }
  13. function _reportPossibleCrUseOfLayerPopUp(extras) {
  14. _reporterNs.report("LayerPopUp", "./LayerPopup", _context.meta, extras);
  15. }
  16. _export("LayerDialog", void 0);
  17. return {
  18. setters: [function (_unresolved_) {
  19. _reporterNs = _unresolved_;
  20. }, function (_cc) {
  21. _cclegacy = _cc.cclegacy;
  22. }, function (_unresolved_2) {
  23. ViewParams = _unresolved_2.ViewParams;
  24. }, function (_unresolved_3) {
  25. LayerPopUp = _unresolved_3.LayerPopUp;
  26. }],
  27. execute: function () {
  28. _crd = true;
  29. _cclegacy._RF.push({}, "dcad5w8wHlEDJpIKJ4gUxEP", "LayerDialog", undefined);
  30. /*
  31. * @Author: dgflash
  32. * @Date: 2021-07-03 16:13:17
  33. * @LastEditors: dgflash
  34. * @LastEditTime: 2023-07-24 17:14:57
  35. */
  36. /** 模式弹窗数据 */
  37. /*
  38. * 模式弹窗层,该层的窗口同时只能显示一个,删除以后会自动从队列当中取一个弹窗,直到队列为空
  39. */
  40. _export("LayerDialog", LayerDialog = class LayerDialog extends (_crd && LayerPopUp === void 0 ? (_reportPossibleCrUseOfLayerPopUp({
  41. error: Error()
  42. }), LayerPopUp) : LayerPopUp) {
  43. constructor(...args) {
  44. super(...args);
  45. /** 窗口调用参数队列 */
  46. this.params = [];
  47. }
  48. add(config, params, callbacks) {
  49. // 控制同一时间只能显示一个模式窗口
  50. if (this.ui_nodes.size > 0) {
  51. this.params.push({
  52. config: config,
  53. params: params,
  54. callbacks: callbacks
  55. });
  56. return;
  57. }
  58. this.black.enabled = true;
  59. this.show(config, params, callbacks);
  60. }
  61. /** 显示模式弹窗 */
  62. show(config, params, callbacks) {
  63. let vp = this.ui_cache.get(config.prefab);
  64. if (vp == null) {
  65. vp = new (_crd && ViewParams === void 0 ? (_reportPossibleCrUseOfViewParams({
  66. error: Error()
  67. }), ViewParams) : ViewParams)();
  68. vp.valid = true;
  69. vp.config = config;
  70. }
  71. vp.params = params || {};
  72. vp.callbacks = callbacks != null ? callbacks : {};
  73. this.ui_nodes.set(vp.config.prefab, vp);
  74. this.load(vp, config.bundle);
  75. }
  76. onCloseWindow(vp) {
  77. super.onCloseWindow(vp);
  78. setTimeout(this.next.bind(this), 0);
  79. }
  80. setBlackDisable() {
  81. if (this.params.length == 0) {
  82. this.black.enabled = false;
  83. this.closeVacancyRemove();
  84. this.closeMask();
  85. }
  86. }
  87. next() {
  88. if (this.params.length > 0) {
  89. let param = this.params.shift();
  90. this.show(param.config, param.params, param.callbacks);
  91. }
  92. }
  93. });
  94. _cclegacy._RF.pop();
  95. _crd = false;
  96. }
  97. };
  98. });
  99. //# sourceMappingURL=0221854a31f1529ce27ba41ccf2686903f2ddbf0.js.map