@ibiz-template/model-helper 0.1.18 → 0.1.19

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/dist/index.esm.js CHANGED
@@ -14982,13 +14982,38 @@ var ModelUtil = class {
14982
14982
  appPath = "/PSSYSAPP.hub.json";
14983
14983
  }
14984
14984
  if (this.permission === false) {
14985
- appPath = "/PSSYSAPP.simple.json";
14985
+ appPath = "/simple/PSSYSAPP.simple.json";
14986
14986
  }
14987
14987
  this.appModel = await this.getModel(appPath);
14988
14988
  this.appModel.id = this.appId;
14989
14989
  }
14990
14990
  return this.appModel;
14991
14991
  }
14992
+ /**
14993
+ * 加载应用模型全局样式
14994
+ *
14995
+ * @author chitanda
14996
+ * @date 2023-09-06 10:09:11
14997
+ * @return {*} {(Promise<string | null>)}
14998
+ */
14999
+ async getAppStyle() {
15000
+ let style = "";
15001
+ try {
15002
+ let stylePath = "/PSSYSAPP.json.css";
15003
+ if (this.hub && ibiz.env.hub) {
15004
+ stylePath = "/PSSYSAPP.hub.json.css";
15005
+ }
15006
+ if (this.permission === false) {
15007
+ stylePath = "/simple/PSSYSAPP.simple.json.css";
15008
+ }
15009
+ style = await this.getModel(stylePath);
15010
+ if (style) {
15011
+ return style;
15012
+ }
15013
+ } catch (error) {
15014
+ }
15015
+ return null;
15016
+ }
14992
15017
  /**
14993
15018
  * 根据应用实体 codeName 或者 id 获取应用实体模型
14994
15019
  *
@@ -15160,6 +15185,9 @@ var ModelLoader = class {
15160
15185
  getAppDataEntityByCodeName(appId, codeName) {
15161
15186
  return this.helper.getAppDataEntityModel(codeName, appId, false);
15162
15187
  }
15188
+ getAppStyle(appId) {
15189
+ return this.helper.getAppStyle(appId);
15190
+ }
15163
15191
  };
15164
15192
 
15165
15193
  // src/model-helper.ts
@@ -15262,6 +15290,17 @@ var ModelHelper = class {
15262
15290
  const app = this.dsl.application(model);
15263
15291
  return app;
15264
15292
  }
15293
+ /**
15294
+ * 获取应用全局样式
15295
+ *
15296
+ * @author chitanda
15297
+ * @date 2023-09-06 10:09:48
15298
+ * @param {(string | IObject)} [appId]
15299
+ * @return {*} {(Promise<string | null>)}
15300
+ */
15301
+ getAppStyle(appId) {
15302
+ return this.getModelUtil(appId).getAppStyle();
15303
+ }
15265
15304
  /**
15266
15305
  * 根据应用实体 codeName 获取应用实体模型
15267
15306
  *