isdata-customer-sdk 0.1.72 → 0.1.74

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.umd.js CHANGED
@@ -29588,7 +29588,7 @@ __webpack_require__.d(__webpack_exports__, {
29588
29588
  getLoginPageNotices: function() { return /* reexport */ getLoginPageNotices; },
29589
29589
  getMappingAppInfoByID: function() { return /* reexport */ getMappingAppInfoByID; },
29590
29590
  getMenuDatasByGroupID: function() { return /* reexport */ getMenuDatasByGroupID; },
29591
- getMenuDatasByRoleIDs: function() { return /* reexport */ getMenuDatasByRoleIDs; },
29591
+ getMenuMappingDatasByRoleIDs: function() { return /* reexport */ getMenuMappingDatasByRoleIDs; },
29592
29592
  getObjectUseTimes: function() { return /* reexport */ getObjectUseTimes; },
29593
29593
  getOfficeInfosByIDs: function() { return /* reexport */ getOfficeInfosByIDs; },
29594
29594
  getPageIDByComponentID: function() { return /* reexport */ getPageIDByComponentID; },
@@ -29606,7 +29606,6 @@ __webpack_require__.d(__webpack_exports__, {
29606
29606
  getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
29607
29607
  getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
29608
29608
  getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
29609
- getUserRoles: function() { return /* reexport */ getUserRoles; },
29610
29609
  hasListener: function() { return /* reexport */ hasListener; },
29611
29610
  initEventCenter: function() { return /* reexport */ initEventCenter; },
29612
29611
  initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
@@ -29625,6 +29624,8 @@ __webpack_require__.d(__webpack_exports__, {
29625
29624
  sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
29626
29625
  setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
29627
29626
  switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
29627
+ transformPortalQuickMenuDatas: function() { return /* reexport */ transformPortalQuickMenuDatas; },
29628
+ transformPortalSystemMenuDatas: function() { return /* reexport */ transformPortalSystemMenuDatas; },
29628
29629
  updateIMMapping: function() { return /* reexport */ updateIMMapping; },
29629
29630
  updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
29630
29631
  validateSSOPageLoaded: function() { return /* reexport */ validateSSOPageLoaded; }
@@ -29885,21 +29886,31 @@ const getMenuDatasByGroupID = async (group_id, role_ids) => {
29885
29886
  }
29886
29887
  };
29887
29888
  let result = await request.post(`/dataservice/rest/orchestration/getMenuDatasByGroupID`, queryData_groupData);
29889
+ //所有的快捷访问菜单信息
29888
29890
  let portalMenuDatas = result.data.resultDatas;
29889
29891
  let menuTypes = result.data.menuTypes;
29890
29892
  if (role_ids && role_ids.length > 0) {
29891
- let result = await getMenuDatasByRoleIDs(role_ids, group_id);
29893
+ //获取当前角色下对应的角色快捷访问菜单的映射信息(到应用自定义菜单)和快捷访问菜单的信息
29894
+ let result = await getMenuMappingDatasByRoleIDs(role_ids, group_id);
29895
+ //对应角色的快捷访问菜单映射信息
29892
29896
  let quickMenuMappingDatas = result.data.quickMenuMappingDatas || [];
29893
29897
  let filterObjectMap = {};
29898
+ let tempMap = {};
29899
+ for (const tempData of portalMenuDatas) {
29900
+ let id = tempData.id;
29901
+ tempMap[id] = tempData;
29902
+ }
29894
29903
  for (const data of quickMenuMappingDatas) {
29895
29904
  let id = data.menu_mapping_id;
29896
- filterObjectMap[id] = data;
29897
- }
29898
- let menuMappingDatas = result.data.menuMappingDatas || [];
29899
- for (const data of menuMappingDatas) {
29900
- let id = data.id;
29901
- filterObjectMap[id] = data;
29902
- }
29905
+ let quickMenuMapping = tempMap[id];
29906
+ filterObjectMap[id] = quickMenuMapping;
29907
+ }
29908
+ // //对应角色的快捷访问菜单信息
29909
+ // let menuMappingDatas = result.data.menuMappingDatas||[];
29910
+ // for (const data of menuMappingDatas) {
29911
+ // let id= data.id;
29912
+ // filterObjectMap[id]=data;
29913
+ // }
29903
29914
  return transformPortalData(portalMenuDatas, menuTypes, filterObjectMap);
29904
29915
  } else {
29905
29916
  return transformPortalData(portalMenuDatas, menuTypes, []);
@@ -29907,11 +29918,11 @@ const getMenuDatasByGroupID = async (group_id, role_ids) => {
29907
29918
  };
29908
29919
 
29909
29920
  /**
29910
- * 查询对应角色的门户快捷菜单信息
29921
+ * 查询对应角色的门户快捷菜单映射信息
29911
29922
  * @param id GroupID
29912
29923
  *
29913
29924
  */
29914
- const getMenuDatasByRoleIDs = async (role_ids, group_id) => {
29925
+ const getMenuMappingDatasByRoleIDs = async (role_ids, group_id) => {
29915
29926
  let queryData_groupData = {
29916
29927
  "param": {
29917
29928
  "role_ids": role_ids,
@@ -29963,15 +29974,22 @@ const getRoleIDsByUserAndGroupID = async (user_id, app_id, group_id) => {
29963
29974
 
29964
29975
  /**
29965
29976
  * 转换门户菜单数据
29966
- * @param {*} datas
29967
- * @param {*} menuTypes
29968
- * @param {*} filterObjectMap
29977
+ * @param {*} datas 所有的快捷菜单访问信息
29978
+ * @param {*} menuTypes 快捷访问菜单类型
29979
+ * @param {*} filterObjectMap 角色快捷菜单访问映射信息
29969
29980
  * @returns
29970
29981
  */
29971
29982
  const transformPortalData = (datas, menuTypes, filterObjectMap) => {
29972
- // console.log(datas);
29973
29983
  let menuMaps = {};
29974
29984
  let menuTypeMaps = {};
29985
+ let parentMaps = {};
29986
+ for (let key in filterObjectMap) {
29987
+ let item = filterObjectMap[key];
29988
+ let parent_id = item.parent_id;
29989
+ if (parent_id) {
29990
+ parentMaps[parent_id] = true;
29991
+ }
29992
+ }
29975
29993
  for (const data of datas) {
29976
29994
  let id = data.id;
29977
29995
  let tempMenuData = {
@@ -29990,7 +30008,8 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
29990
30008
  };
29991
30009
  //如果存在快捷菜单映射数据或者是主菜单入口
29992
30010
  if (filterObjectMap) {
29993
- if (filterObjectMap[id] || data.type == "4") {
30011
+ //如果是主菜单或者存在快捷访问映射或者孩子存在快捷访问映射,则纳入到菜单中
30012
+ if (filterObjectMap[id] || data.type == "4" || parentMaps[id]) {
29994
30013
  menuMaps[id] = tempMenuData;
29995
30014
  }
29996
30015
  } else {
@@ -30012,6 +30031,7 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
30012
30031
  let tempType = tempMenuData.beyond_type;
30013
30032
  // let tempType_sort =tempMenuData.beyond_type_sort;
30014
30033
  let tempParentMenu = menuMaps[parent_id];
30034
+ if (!tempParentMenu) continue;
30015
30035
  let parentTypes = tempParentMenu.children;
30016
30036
  let parentType = parentTypes.find(tempTypeItem => {
30017
30037
  return tempTypeItem.id == tempType;
@@ -30089,6 +30109,110 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
30089
30109
  return menuList;
30090
30110
  };
30091
30111
 
30112
+ /**
30113
+ * 转换门户用户快捷菜单数据
30114
+ * @param {*} quickDatas
30115
+ * @returns
30116
+ */
30117
+ const transformPortalQuickMenuDatas = quickDatas => {
30118
+ let quickMenuMaps = {};
30119
+ for (const data of quickDatas) {
30120
+ let id = data.id;
30121
+ let tempMenuData = {
30122
+ id: id,
30123
+ label: data.title,
30124
+ sort: data.sort,
30125
+ children: [],
30126
+ parent_id: data.parent_id,
30127
+ type: data.type
30128
+ };
30129
+ quickMenuMaps[id] = tempMenuData;
30130
+ }
30131
+ for (const data of quickDatas) {
30132
+ let tempMenuData = quickMenuMaps[data.id];
30133
+ //5:子菜单入口
30134
+ if (tempMenuData.type == "5") {
30135
+ let parent_id = tempMenuData.parent_id;
30136
+ let tempParentMenu = quickMenuMaps[parent_id];
30137
+ if (tempParentMenu) {
30138
+ let parentChilden = tempParentMenu.children;
30139
+ parentChilden.push(tempMenuData);
30140
+ }
30141
+ }
30142
+ }
30143
+ const menuList = [];
30144
+ for (const data of quickDatas) {
30145
+ let tempMenuData = quickMenuMaps[data.id];
30146
+ //4:主菜单入口
30147
+ if (tempMenuData.type == "4") {
30148
+ menuList.push(tempMenuData);
30149
+ let tempArrys = tempMenuData.children;
30150
+ tempArrys.sort((data1, data2) => {
30151
+ if (Number.isNaN(data1.sort)) return 1;
30152
+ if (Number.isNaN(data2.sort)) return -1;
30153
+ return data1.sort - data2.sort;
30154
+ });
30155
+ }
30156
+ }
30157
+ menuList.sort((data1, data2) => {
30158
+ if (Number.isNaN(data1.sort)) return 1;
30159
+ if (Number.isNaN(data2.sort)) return -1;
30160
+ return data1.sort - data2.sort;
30161
+ });
30162
+ return menuList;
30163
+ };
30164
+ const transformPortalSystemMenuDatas = datas => {
30165
+ let menuMaps = {};
30166
+ for (const data of datas) {
30167
+ let id = data.id;
30168
+ let tempMenuData = {
30169
+ id: id,
30170
+ label: data.name,
30171
+ sort: data.sort,
30172
+ icon: data.icon,
30173
+ children: [],
30174
+ app_id: data.datapp_id,
30175
+ parent_id: data.parent_id,
30176
+ leaf_flag: data.leaf_flag
30177
+ };
30178
+ menuMaps[id] = tempMenuData;
30179
+ }
30180
+ for (const data of datas) {
30181
+ let leaf_flag = data.leaf_flag;
30182
+ //5:子菜单入口
30183
+ if (leaf_flag == 1) {
30184
+ let tempMenuData = menuMaps[data.id];
30185
+ let parent_id = data.parent_id;
30186
+ let tempParentMenu = menuMaps[parent_id];
30187
+ if (tempParentMenu) {
30188
+ let parentChilden = tempParentMenu.children;
30189
+ parentChilden.push(tempMenuData);
30190
+ }
30191
+ }
30192
+ }
30193
+ const menuList = [];
30194
+ for (const data of datas) {
30195
+ let leaf_flag = data.leaf_flag;
30196
+ //4:主菜单入口
30197
+ if (leaf_flag == 0) {
30198
+ let tempMenuData = menuMaps[data.id];
30199
+ menuList.push(tempMenuData);
30200
+ let tempArrys = tempMenuData.children;
30201
+ tempArrys.sort((data1, data2) => {
30202
+ if (Number.isNaN(data1.sort)) return 1;
30203
+ if (Number.isNaN(data2.sort)) return -1;
30204
+ return data1.sort - data2.sort;
30205
+ });
30206
+ }
30207
+ }
30208
+ menuList.sort((data1, data2) => {
30209
+ if (Number.isNaN(data1.sort)) return 1;
30210
+ if (Number.isNaN(data2.sort)) return -1;
30211
+ return data1.sort - data2.sort;
30212
+ });
30213
+ return menuList;
30214
+ };
30215
+
30092
30216
  /**
30093
30217
  * 获取当前用户默认的门户页面ID
30094
30218
  *
@@ -30580,22 +30704,6 @@ const getIntegrateAppInfoByID = async appID => {
30580
30704
  let appInfo = result.data.appInfo;
30581
30705
  return appInfo;
30582
30706
  };
30583
-
30584
- /**
30585
- * getUserRoles
30586
- * @param {信息} userID
30587
- * @returns
30588
- */
30589
- const getUserRoles = async userID => {
30590
- let queryData = {
30591
- "param": {
30592
- "userID": userID
30593
- }
30594
- };
30595
- let responseData = await request.post(`/dataservice/rest/orchestration/getUserRoles`, queryData);
30596
- let role_ids = responseData.data.role_ids;
30597
- return role_ids;
30598
- };
30599
30707
  // EXTERNAL MODULE: ./node_modules/crypto-js/index.js
30600
30708
  var crypto_js = __webpack_require__(1396);
30601
30709
  var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
@@ -31361,10 +31469,10 @@ const getDifyFileType = fileType => {
31361
31469
  return typeOptions[key] || "custom";
31362
31470
  };
31363
31471
 
31364
- /**
31365
- * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
31366
- * @param {string} url - 文件 URL
31367
- * @returns {string} - 提取的文件名
31472
+ /**
31473
+ * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
31474
+ * @param {string} url - 文件 URL
31475
+ * @returns {string} - 提取的文件名
31368
31476
  */
31369
31477
  const dify_extractFilenameFromUrl = url => {
31370
31478
  try {