aldehyde 0.2.315 → 0.2.317

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.
Files changed (37) hide show
  1. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  2. package/lib/controls/entity-select/entity-select.js.map +1 -1
  3. package/lib/lowcode-components/base-button/index.d.ts +6 -0
  4. package/lib/lowcode-components/base-button/index.d.ts.map +1 -1
  5. package/lib/lowcode-components/base-button/index.js +27 -2
  6. package/lib/lowcode-components/base-button/index.js.map +1 -1
  7. package/lib/lowcode-components/base-map/index.d.ts.map +1 -1
  8. package/lib/lowcode-components/base-map/index.js +4 -2
  9. package/lib/lowcode-components/base-map/index.js.map +1 -1
  10. package/lib/lowcode-components/data-number/index.d.ts.map +1 -1
  11. package/lib/lowcode-components/data-number/index.js +2 -1
  12. package/lib/lowcode-components/data-number/index.js.map +1 -1
  13. package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -1
  14. package/lib/lowcode-components/effectScatter-map/index.js +4 -2
  15. package/lib/lowcode-components/effectScatter-map/index.js.map +1 -1
  16. package/lib/lowcode-components/effectScatter-map-3d/index.d.ts.map +1 -1
  17. package/lib/lowcode-components/effectScatter-map-3d/index.js +4 -2
  18. package/lib/lowcode-components/effectScatter-map-3d/index.js.map +1 -1
  19. package/lib/lowcode-components/lowcode-view/component/component-container.d.ts.map +1 -1
  20. package/lib/lowcode-components/lowcode-view/component/component-container.js +3 -1
  21. package/lib/lowcode-components/lowcode-view/component/component-container.js.map +1 -1
  22. package/lib/lowcode-components/pie-chart/index.js +7 -7
  23. package/lib/lowcode-components/pie-chart/index.js.map +1 -1
  24. package/lib/tmpl/hcservice-v3.d.ts +1 -1
  25. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  26. package/lib/tmpl/hcservice-v3.js +2 -1
  27. package/lib/tmpl/hcservice-v3.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/aldehyde/controls/entity-select/entity-select.tsx +0 -2
  30. package/src/aldehyde/lowcode-components/base-button/index.tsx +34 -2
  31. package/src/aldehyde/lowcode-components/base-map/index.tsx +4 -2
  32. package/src/aldehyde/lowcode-components/data-number/index.tsx +2 -1
  33. package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +4 -2
  34. package/src/aldehyde/lowcode-components/effectScatter-map-3d/index.tsx +4 -2
  35. package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +3 -1
  36. package/src/aldehyde/lowcode-components/pie-chart/index.tsx +7 -7
  37. package/src/aldehyde/tmpl/hcservice-v3.tsx +61 -59
@@ -41,7 +41,7 @@ export default class HcserviceV3 {
41
41
  return jsonFile;
42
42
  }
43
43
 
44
- static toFilePath(value,serverKey) {
44
+ static toFilePath(value, serverKey) {
45
45
  if (!value) {
46
46
  return null;
47
47
  }
@@ -57,24 +57,24 @@ export default class HcserviceV3 {
57
57
  filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
58
58
  } else {
59
59
  let jsonValue = this.getJsonValue(value);
60
- filePath=this.toFilePathObject(jsonValue,serverKey);
60
+ filePath = this.toFilePathObject(jsonValue, serverKey);
61
61
  }
62
- }else if(value.base){
63
- filePath=this.toFilePathObject(value,serverKey);
62
+ } else if (value.base) {
63
+ filePath = this.toFilePathObject(value, serverKey);
64
64
  }
65
65
  return filePath;
66
66
  }
67
67
 
68
- static toFilePathObject(jsonValue,serverKey:string){
69
- let filePath:any={};
68
+ static toFilePathObject(jsonValue, serverKey: string) {
69
+ let filePath: any = {};
70
70
  if (jsonValue) {
71
71
  filePath.path = this.getFileUrl(serverKey, jsonValue.base?.path);
72
72
  filePath.iconPath = jsonValue.icon?.path ? this.getFileUrl(serverKey, jsonValue.icon?.path) : null;
73
73
  filePath.fileName = jsonValue.fileName ? jsonValue.fileName : this.getFileNameFrom(jsonValue.base?.path);
74
74
  filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
75
75
  filePath.valid = jsonValue.valid;
76
- filePath.baseType=jsonValue.base?.type;
77
- filePath.basePath=jsonValue.base?.path;
76
+ filePath.baseType = jsonValue.base?.type;
77
+ filePath.basePath = jsonValue.base?.path;
78
78
  return filePath;
79
79
  }
80
80
  return null;
@@ -217,18 +217,18 @@ export default class HcserviceV3 {
217
217
  }
218
218
 
219
219
  static async requestQueryReportData(
220
- serverKey:string,
221
- queryKey:string,language:string
222
- ){
223
- let url="/v3/ltmpl/report-data";
220
+ serverKey: string,
221
+ queryKey: string, language: string
222
+ ) {
223
+ let url = "/v3/ltmpl/report-data";
224
224
  let res = await Super.super({
225
225
  url: url,
226
226
  serverKey,
227
227
  method: "GET",
228
- query:{queryKey,language},
228
+ query: { queryKey, language },
229
229
  });
230
230
  return res;
231
- }
231
+ }
232
232
 
233
233
  static async requestTtmplRootData(
234
234
  serverKey: string,
@@ -310,20 +310,20 @@ export default class HcserviceV3 {
310
310
  }
311
311
  }
312
312
 
313
- static isForeignLanguageMode(){
314
- if(translate("${保存}")=="保存"){
313
+ static isForeignLanguageMode() {
314
+ if (translate("${保存}") == "保存") {
315
315
  return false;
316
- }else{
316
+ } else {
317
317
  return true;
318
318
  }
319
319
  }
320
320
 
321
- static async requestVersionList(serverKey: string, sourceId: string, code,pageNo?:number) {
321
+ static async requestVersionList(serverKey: string, sourceId: string, code, pageNo?: number) {
322
322
  let res = await Super.super({
323
323
  url: `/v3/dtmpl/data/versions`,
324
324
  serverKey,
325
325
  query: {
326
- pageNo: pageNo?pageNo:1,
326
+ pageNo: pageNo ? pageNo : 1,
327
327
  sourceId,
328
328
  code,
329
329
  },
@@ -667,7 +667,7 @@ export default class HcserviceV3 {
667
667
  return res;
668
668
  }
669
669
 
670
- static async doPostRequest(serverKey: string, url:string,params?:object) {
670
+ static async doPostRequest(serverKey: string, url: string, params?: object) {
671
671
  let res = await Super.super({
672
672
  url,
673
673
  serverKey,
@@ -677,7 +677,7 @@ export default class HcserviceV3 {
677
677
  return res;
678
678
  }
679
679
 
680
- static async doGetRequest(serverKey: string, url:string,params?:object) {
680
+ static async doGetRequest(serverKey: string, url: string, params?: object) {
681
681
  let res = await Super.super({
682
682
  url,
683
683
  serverKey,
@@ -688,8 +688,8 @@ export default class HcserviceV3 {
688
688
  }
689
689
 
690
690
  static async requestChartData(
691
- serverKey: string,
692
- sourceId: string,
691
+ serverKey: string,
692
+ sourceId: string,
693
693
  ) {
694
694
  let res = await Super.super({
695
695
  url: `/v3/chart/data`,
@@ -868,25 +868,25 @@ export default class HcserviceV3 {
868
868
  Units.openFile(path, fileName, toolbar);
869
869
  }
870
870
 
871
- static getFileUrl(serverKey: string, path:string) {
871
+ static getFileUrl(serverKey: string, path: string) {
872
872
  const hydrocarbonToken = Units.serverHydrocarbonToken(serverKey);
873
873
  const programCode = Units.programCode(serverKey);
874
874
  let root;
875
875
  let url;
876
876
  //判断是否为全URL
877
- if(path?.startsWith("http") || path?.startsWith("HTTP")){
878
- root=path;
879
- if(path.indexOf("?")>0){
877
+ if (path?.startsWith("http") || path?.startsWith("HTTP")) {
878
+ root = path;
879
+ if (path.indexOf("?") > 0) {
880
880
  url = root +
881
- `&@token=${hydrocarbonToken}&@programToken=${programCode}`;
882
- }else{
881
+ `&@token=${hydrocarbonToken}&@programToken=${programCode}`;
882
+ } else {
883
883
  url = root +
884
- `?@token=${hydrocarbonToken}&@programToken=${programCode}`;
884
+ `?@token=${hydrocarbonToken}&@programToken=${programCode}`;
885
885
  }
886
- }else{
887
- root=Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files", path));
886
+ } else {
887
+ root = Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files", path));
888
888
  url = root +
889
- `?@token=${hydrocarbonToken}&@programToken=${programCode}`;
889
+ `?@token=${hydrocarbonToken}&@programToken=${programCode}`;
890
890
  }
891
891
 
892
892
  let encodeUri = encodeURI(url);
@@ -906,12 +906,14 @@ export default class HcserviceV3 {
906
906
 
907
907
  static async requestBlocks(
908
908
  l2MenuId: string,
909
- blockId: string
909
+ blockId: string,
910
+ programCode?: string,
910
911
  ): Promise<MenuConfigAPIType> {
911
912
  let url = `/v3/menu/blocks`;
912
913
  let res = await Super.super({
913
914
  url: url,
914
915
  method: "GET",
916
+ header: { programCode },
915
917
  query: {
916
918
  l2MenuId,
917
919
  blockId,
@@ -993,10 +995,10 @@ export default class HcserviceV3 {
993
995
  }
994
996
 
995
997
  static async resetPassword2(
996
- serverKey: string,userName:string,
997
- oPassword: string,
998
- nPassword: string,
999
- pubkey
998
+ serverKey: string, userName: string,
999
+ oPassword: string,
1000
+ nPassword: string,
1001
+ pubkey
1000
1002
  ) {
1001
1003
  let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
1002
1004
  let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
@@ -1034,19 +1036,19 @@ export default class HcserviceV3 {
1034
1036
  return res ? res.value : null;
1035
1037
  }
1036
1038
 
1037
- static async loginServer(serverKey:string,username:string,password:string){
1038
- let pubkey=await this.getRasPubkey(serverKey);
1039
- if(pubkey){
1040
- let json = {username, password};
1041
- let res= await this.login(json,null,null,pubkey,null,serverKey);
1042
- if(res.status == "success"){
1043
- Units.setServerHydrocarbonToken(serverKey,res.token);
1044
- return res;
1045
- }else{
1046
- return {status:"error",message:"登陆失败"}
1047
- }
1048
- }else{
1049
- return {status:"error",message:"登陆失败"}
1039
+ static async loginServer(serverKey: string, username: string, password: string) {
1040
+ let pubkey = await this.getRasPubkey(serverKey);
1041
+ if (pubkey) {
1042
+ let json = { username, password };
1043
+ let res = await this.login(json, null, null, pubkey, null, serverKey);
1044
+ if (res.status == "success") {
1045
+ Units.setServerHydrocarbonToken(serverKey, res.token);
1046
+ return res;
1047
+ } else {
1048
+ return { status: "error", message: "登陆失败" }
1049
+ }
1050
+ } else {
1051
+ return { status: "error", message: "登陆失败" }
1050
1052
  }
1051
1053
  }
1052
1054
 
@@ -1076,16 +1078,16 @@ export default class HcserviceV3 {
1076
1078
  },
1077
1079
  method: "GET",
1078
1080
  });
1079
- if(res.passwordState){
1080
- if(res.passwordState=="expiry"){
1081
- message.warning(translate("${"+res.message+"}"), 10);
1082
- }else if(res.passwordState=="expiried"){
1083
- message.error(translate("${"+res.message+"}"), 10)
1084
- }else if(res.passwordState=="restricted"){
1085
- message.error(translate("${"+res.message+"}"), 15)
1081
+ if (res.passwordState) {
1082
+ if (res.passwordState == "expiry") {
1083
+ message.warning(translate("${" + res.message + "}"), 10);
1084
+ } else if (res.passwordState == "expiried") {
1085
+ message.error(translate("${" + res.message + "}"), 10)
1086
+ } else if (res.passwordState == "restricted") {
1087
+ message.error(translate("${" + res.message + "}"), 15)
1086
1088
  }
1087
1089
  }
1088
- return {status:res.status,token:res.token};
1090
+ return { status: res.status, token: res.token };
1089
1091
  }
1090
1092
 
1091
1093
  static async setContext(json) {