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.
@@ -29578,7 +29578,7 @@ __webpack_require__.d(__webpack_exports__, {
29578
29578
  getLoginPageNotices: function() { return /* reexport */ getLoginPageNotices; },
29579
29579
  getMappingAppInfoByID: function() { return /* reexport */ getMappingAppInfoByID; },
29580
29580
  getMenuDatasByGroupID: function() { return /* reexport */ getMenuDatasByGroupID; },
29581
- getMenuDatasByRoleIDs: function() { return /* reexport */ getMenuDatasByRoleIDs; },
29581
+ getMenuMappingDatasByRoleIDs: function() { return /* reexport */ getMenuMappingDatasByRoleIDs; },
29582
29582
  getObjectUseTimes: function() { return /* reexport */ getObjectUseTimes; },
29583
29583
  getOfficeInfosByIDs: function() { return /* reexport */ getOfficeInfosByIDs; },
29584
29584
  getPageIDByComponentID: function() { return /* reexport */ getPageIDByComponentID; },
@@ -29596,7 +29596,6 @@ __webpack_require__.d(__webpack_exports__, {
29596
29596
  getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
29597
29597
  getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
29598
29598
  getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
29599
- getUserRoles: function() { return /* reexport */ getUserRoles; },
29600
29599
  hasListener: function() { return /* reexport */ hasListener; },
29601
29600
  initEventCenter: function() { return /* reexport */ initEventCenter; },
29602
29601
  initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
@@ -29615,6 +29614,8 @@ __webpack_require__.d(__webpack_exports__, {
29615
29614
  sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
29616
29615
  setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
29617
29616
  switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
29617
+ transformPortalQuickMenuDatas: function() { return /* reexport */ transformPortalQuickMenuDatas; },
29618
+ transformPortalSystemMenuDatas: function() { return /* reexport */ transformPortalSystemMenuDatas; },
29618
29619
  updateIMMapping: function() { return /* reexport */ updateIMMapping; },
29619
29620
  updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
29620
29621
  validateSSOPageLoaded: function() { return /* reexport */ validateSSOPageLoaded; }
@@ -29875,21 +29876,31 @@ const getMenuDatasByGroupID = async (group_id, role_ids) => {
29875
29876
  }
29876
29877
  };
29877
29878
  let result = await request.post(`/dataservice/rest/orchestration/getMenuDatasByGroupID`, queryData_groupData);
29879
+ //所有的快捷访问菜单信息
29878
29880
  let portalMenuDatas = result.data.resultDatas;
29879
29881
  let menuTypes = result.data.menuTypes;
29880
29882
  if (role_ids && role_ids.length > 0) {
29881
- let result = await getMenuDatasByRoleIDs(role_ids, group_id);
29883
+ //获取当前角色下对应的角色快捷访问菜单的映射信息(到应用自定义菜单)和快捷访问菜单的信息
29884
+ let result = await getMenuMappingDatasByRoleIDs(role_ids, group_id);
29885
+ //对应角色的快捷访问菜单映射信息
29882
29886
  let quickMenuMappingDatas = result.data.quickMenuMappingDatas || [];
29883
29887
  let filterObjectMap = {};
29888
+ let tempMap = {};
29889
+ for (const tempData of portalMenuDatas) {
29890
+ let id = tempData.id;
29891
+ tempMap[id] = tempData;
29892
+ }
29884
29893
  for (const data of quickMenuMappingDatas) {
29885
29894
  let id = data.menu_mapping_id;
29886
- filterObjectMap[id] = data;
29887
- }
29888
- let menuMappingDatas = result.data.menuMappingDatas || [];
29889
- for (const data of menuMappingDatas) {
29890
- let id = data.id;
29891
- filterObjectMap[id] = data;
29892
- }
29895
+ let quickMenuMapping = tempMap[id];
29896
+ filterObjectMap[id] = quickMenuMapping;
29897
+ }
29898
+ // //对应角色的快捷访问菜单信息
29899
+ // let menuMappingDatas = result.data.menuMappingDatas||[];
29900
+ // for (const data of menuMappingDatas) {
29901
+ // let id= data.id;
29902
+ // filterObjectMap[id]=data;
29903
+ // }
29893
29904
  return transformPortalData(portalMenuDatas, menuTypes, filterObjectMap);
29894
29905
  } else {
29895
29906
  return transformPortalData(portalMenuDatas, menuTypes, []);
@@ -29897,11 +29908,11 @@ const getMenuDatasByGroupID = async (group_id, role_ids) => {
29897
29908
  };
29898
29909
 
29899
29910
  /**
29900
- * 查询对应角色的门户快捷菜单信息
29911
+ * 查询对应角色的门户快捷菜单映射信息
29901
29912
  * @param id GroupID
29902
29913
  *
29903
29914
  */
29904
- const getMenuDatasByRoleIDs = async (role_ids, group_id) => {
29915
+ const getMenuMappingDatasByRoleIDs = async (role_ids, group_id) => {
29905
29916
  let queryData_groupData = {
29906
29917
  "param": {
29907
29918
  "role_ids": role_ids,
@@ -29953,15 +29964,22 @@ const getRoleIDsByUserAndGroupID = async (user_id, app_id, group_id) => {
29953
29964
 
29954
29965
  /**
29955
29966
  * 转换门户菜单数据
29956
- * @param {*} datas
29957
- * @param {*} menuTypes
29958
- * @param {*} filterObjectMap
29967
+ * @param {*} datas 所有的快捷菜单访问信息
29968
+ * @param {*} menuTypes 快捷访问菜单类型
29969
+ * @param {*} filterObjectMap 角色快捷菜单访问映射信息
29959
29970
  * @returns
29960
29971
  */
29961
29972
  const transformPortalData = (datas, menuTypes, filterObjectMap) => {
29962
- // console.log(datas);
29963
29973
  let menuMaps = {};
29964
29974
  let menuTypeMaps = {};
29975
+ let parentMaps = {};
29976
+ for (let key in filterObjectMap) {
29977
+ let item = filterObjectMap[key];
29978
+ let parent_id = item.parent_id;
29979
+ if (parent_id) {
29980
+ parentMaps[parent_id] = true;
29981
+ }
29982
+ }
29965
29983
  for (const data of datas) {
29966
29984
  let id = data.id;
29967
29985
  let tempMenuData = {
@@ -29980,7 +29998,8 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
29980
29998
  };
29981
29999
  //如果存在快捷菜单映射数据或者是主菜单入口
29982
30000
  if (filterObjectMap) {
29983
- if (filterObjectMap[id] || data.type == "4") {
30001
+ //如果是主菜单或者存在快捷访问映射或者孩子存在快捷访问映射,则纳入到菜单中
30002
+ if (filterObjectMap[id] || data.type == "4" || parentMaps[id]) {
29984
30003
  menuMaps[id] = tempMenuData;
29985
30004
  }
29986
30005
  } else {
@@ -30002,6 +30021,7 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
30002
30021
  let tempType = tempMenuData.beyond_type;
30003
30022
  // let tempType_sort =tempMenuData.beyond_type_sort;
30004
30023
  let tempParentMenu = menuMaps[parent_id];
30024
+ if (!tempParentMenu) continue;
30005
30025
  let parentTypes = tempParentMenu.children;
30006
30026
  let parentType = parentTypes.find(tempTypeItem => {
30007
30027
  return tempTypeItem.id == tempType;
@@ -30079,6 +30099,110 @@ const transformPortalData = (datas, menuTypes, filterObjectMap) => {
30079
30099
  return menuList;
30080
30100
  };
30081
30101
 
30102
+ /**
30103
+ * 转换门户用户快捷菜单数据
30104
+ * @param {*} quickDatas
30105
+ * @returns
30106
+ */
30107
+ const transformPortalQuickMenuDatas = quickDatas => {
30108
+ let quickMenuMaps = {};
30109
+ for (const data of quickDatas) {
30110
+ let id = data.id;
30111
+ let tempMenuData = {
30112
+ id: id,
30113
+ label: data.title,
30114
+ sort: data.sort,
30115
+ children: [],
30116
+ parent_id: data.parent_id,
30117
+ type: data.type
30118
+ };
30119
+ quickMenuMaps[id] = tempMenuData;
30120
+ }
30121
+ for (const data of quickDatas) {
30122
+ let tempMenuData = quickMenuMaps[data.id];
30123
+ //5:子菜单入口
30124
+ if (tempMenuData.type == "5") {
30125
+ let parent_id = tempMenuData.parent_id;
30126
+ let tempParentMenu = quickMenuMaps[parent_id];
30127
+ if (tempParentMenu) {
30128
+ let parentChilden = tempParentMenu.children;
30129
+ parentChilden.push(tempMenuData);
30130
+ }
30131
+ }
30132
+ }
30133
+ const menuList = [];
30134
+ for (const data of quickDatas) {
30135
+ let tempMenuData = quickMenuMaps[data.id];
30136
+ //4:主菜单入口
30137
+ if (tempMenuData.type == "4") {
30138
+ menuList.push(tempMenuData);
30139
+ let tempArrys = tempMenuData.children;
30140
+ tempArrys.sort((data1, data2) => {
30141
+ if (Number.isNaN(data1.sort)) return 1;
30142
+ if (Number.isNaN(data2.sort)) return -1;
30143
+ return data1.sort - data2.sort;
30144
+ });
30145
+ }
30146
+ }
30147
+ menuList.sort((data1, data2) => {
30148
+ if (Number.isNaN(data1.sort)) return 1;
30149
+ if (Number.isNaN(data2.sort)) return -1;
30150
+ return data1.sort - data2.sort;
30151
+ });
30152
+ return menuList;
30153
+ };
30154
+ const transformPortalSystemMenuDatas = datas => {
30155
+ let menuMaps = {};
30156
+ for (const data of datas) {
30157
+ let id = data.id;
30158
+ let tempMenuData = {
30159
+ id: id,
30160
+ label: data.name,
30161
+ sort: data.sort,
30162
+ icon: data.icon,
30163
+ children: [],
30164
+ app_id: data.datapp_id,
30165
+ parent_id: data.parent_id,
30166
+ leaf_flag: data.leaf_flag
30167
+ };
30168
+ menuMaps[id] = tempMenuData;
30169
+ }
30170
+ for (const data of datas) {
30171
+ let leaf_flag = data.leaf_flag;
30172
+ //5:子菜单入口
30173
+ if (leaf_flag == 1) {
30174
+ let tempMenuData = menuMaps[data.id];
30175
+ let parent_id = data.parent_id;
30176
+ let tempParentMenu = menuMaps[parent_id];
30177
+ if (tempParentMenu) {
30178
+ let parentChilden = tempParentMenu.children;
30179
+ parentChilden.push(tempMenuData);
30180
+ }
30181
+ }
30182
+ }
30183
+ const menuList = [];
30184
+ for (const data of datas) {
30185
+ let leaf_flag = data.leaf_flag;
30186
+ //4:主菜单入口
30187
+ if (leaf_flag == 0) {
30188
+ let tempMenuData = menuMaps[data.id];
30189
+ menuList.push(tempMenuData);
30190
+ let tempArrys = tempMenuData.children;
30191
+ tempArrys.sort((data1, data2) => {
30192
+ if (Number.isNaN(data1.sort)) return 1;
30193
+ if (Number.isNaN(data2.sort)) return -1;
30194
+ return data1.sort - data2.sort;
30195
+ });
30196
+ }
30197
+ }
30198
+ menuList.sort((data1, data2) => {
30199
+ if (Number.isNaN(data1.sort)) return 1;
30200
+ if (Number.isNaN(data2.sort)) return -1;
30201
+ return data1.sort - data2.sort;
30202
+ });
30203
+ return menuList;
30204
+ };
30205
+
30082
30206
  /**
30083
30207
  * 获取当前用户默认的门户页面ID
30084
30208
  *
@@ -30570,22 +30694,6 @@ const getIntegrateAppInfoByID = async appID => {
30570
30694
  let appInfo = result.data.appInfo;
30571
30695
  return appInfo;
30572
30696
  };
30573
-
30574
- /**
30575
- * getUserRoles
30576
- * @param {信息} userID
30577
- * @returns
30578
- */
30579
- const getUserRoles = async userID => {
30580
- let queryData = {
30581
- "param": {
30582
- "userID": userID
30583
- }
30584
- };
30585
- let responseData = await request.post(`/dataservice/rest/orchestration/getUserRoles`, queryData);
30586
- let role_ids = responseData.data.role_ids;
30587
- return role_ids;
30588
- };
30589
30697
  // EXTERNAL MODULE: ./node_modules/crypto-js/index.js
30590
30698
  var crypto_js = __webpack_require__(1396);
30591
30699
  var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
@@ -31351,10 +31459,10 @@ const getDifyFileType = fileType => {
31351
31459
  return typeOptions[key] || "custom";
31352
31460
  };
31353
31461
 
31354
- /**
31355
- * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
31356
- * @param {string} url - 文件 URL
31357
- * @returns {string} - 提取的文件名
31462
+ /**
31463
+ * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
31464
+ * @param {string} url - 文件 URL
31465
+ * @returns {string} - 提取的文件名
31358
31466
  */
31359
31467
  const dify_extractFilenameFromUrl = url => {
31360
31468
  try {