eoss-ui 0.7.70 → 0.7.71

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 (58) hide show
  1. package/lib/button-group.js +60 -56
  2. package/lib/button.js +60 -56
  3. package/lib/calogin.js +60 -56
  4. package/lib/checkbox-group.js +60 -56
  5. package/lib/config/api.js +4 -1
  6. package/lib/data-table-form.js +60 -56
  7. package/lib/data-table.js +60 -56
  8. package/lib/date-picker.js +60 -56
  9. package/lib/dialog.js +60 -56
  10. package/lib/eoss-ui.common.js +655 -567
  11. package/lib/flow-group.js +60 -56
  12. package/lib/flow-list.js +62 -58
  13. package/lib/flow.js +90 -86
  14. package/lib/form.js +60 -56
  15. package/lib/handle-user.js +61 -57
  16. package/lib/handler.js +60 -56
  17. package/lib/icon.js +60 -56
  18. package/lib/index.js +1 -1
  19. package/lib/input-number.js +60 -56
  20. package/lib/input.js +60 -56
  21. package/lib/login.js +60 -56
  22. package/lib/main.js +727 -638
  23. package/lib/nav.js +60 -56
  24. package/lib/notify.js +65 -61
  25. package/lib/page.js +60 -56
  26. package/lib/pagination.js +60 -56
  27. package/lib/player.js +60 -56
  28. package/lib/qr-code.js +60 -56
  29. package/lib/radio-group.js +60 -56
  30. package/lib/retrial-auth.js +61 -57
  31. package/lib/select-ganged.js +60 -56
  32. package/lib/select.js +60 -56
  33. package/lib/selector-panel.js +60 -56
  34. package/lib/selector.js +60 -56
  35. package/lib/sizer.js +60 -56
  36. package/lib/steps.js +60 -56
  37. package/lib/switch.js +60 -56
  38. package/lib/table-form.js +60 -56
  39. package/lib/tabs.js +60 -56
  40. package/lib/theme-chalk/index.css +1 -1
  41. package/lib/theme-chalk/main.css +1 -1
  42. package/lib/theme-chalk/simplicity-top.css +1 -1
  43. package/lib/tips.js +60 -56
  44. package/lib/tree-group.js +60 -56
  45. package/lib/tree.js +60 -56
  46. package/lib/upload.js +64 -60
  47. package/lib/wujie.js +60 -56
  48. package/lib/wxlogin.js +60 -56
  49. package/package.json +1 -1
  50. package/packages/main/src/main.vue +54 -19
  51. package/packages/main/src/public/settings.vue +2 -2
  52. package/packages/main/src/simplicityTop/index.vue +99 -55
  53. package/packages/theme-chalk/lib/index.css +1 -1
  54. package/packages/theme-chalk/lib/main.css +1 -1
  55. package/packages/theme-chalk/lib/simplicity-top.css +1 -1
  56. package/packages/theme-chalk/src/simplicity-top.scss +3 -156
  57. package/src/config/api.js +4 -0
  58. package/src/index.js +1 -1
@@ -125,7 +125,7 @@
125
125
  </div>
126
126
  <div
127
127
  class="es-simplicitytop-main-fourth-tabs"
128
- v-if="currentPage.appCode && currentPage.appCode !== 'indexUrl'"
128
+ v-if="appCodes && appCodes !== 'indexUrl'"
129
129
  >
130
130
  <el-tabs
131
131
  ref="fourthTab"
@@ -269,6 +269,7 @@
269
269
  layout-type="simplicityTop"
270
270
  active="simplicity"
271
271
  :theme="themeColor"
272
+ :showSimplicityTop="showSimplicityTop"
272
273
  :predefine="themes"
273
274
  :visible.sync="showSet"
274
275
  @change="handleChange"
@@ -316,7 +317,8 @@ import {
316
317
  getIndexCount,
317
318
  getUserTipsInstanceNum,
318
319
  getShareFilesReceiveCountNew,
319
- getVoteMeetingNum
320
+ getVoteMeetingNum,
321
+ queryChildMenuUrl
320
322
  } from 'eoss-ui/src/config/api.js';
321
323
  import store from 'eoss-ui/src/utils/store';
322
324
  import util from 'eoss-ui/src/utils/util';
@@ -382,7 +384,7 @@ export default {
382
384
  provide() {
383
385
  return {
384
386
  esMain: this,
385
- refresh: this.handleRefresh,
387
+ menuRefresh: this.handleRefresh,
386
388
  jumpMenu: this.jumpTopMenu
387
389
  };
388
390
  },
@@ -405,6 +407,11 @@ export default {
405
407
  type: Boolean,
406
408
  default: true
407
409
  },
410
+ //是否显示顶部
411
+ showSimplicityTop: {
412
+ type: Boolean,
413
+ default: false
414
+ },
408
415
  //im用例编码
409
416
  imUseCaseCode: String,
410
417
  //ai用例编码
@@ -582,10 +589,15 @@ export default {
582
589
  userCommonMenu: {
583
590
  type: String,
584
591
  default: queryUseCommonMenu
592
+ },
593
+ queryChildMenu: {
594
+ type: String,
595
+ default: queryChildMenuUrl
585
596
  }
586
597
  },
587
598
  data() {
588
599
  return {
600
+ appCodes: 'indexUrl',
589
601
  tabActiveName: '',
590
602
  currentPage: {
591
603
  method: ''
@@ -1056,17 +1068,86 @@ export default {
1056
1068
  this.doorIndex = sessionStorage.getItem('doorIndex');
1057
1069
  },
1058
1070
  mounted() {
1071
+ console.log(
1072
+ this.menuUrl,
1073
+ this.topLogo,
1074
+ this.hides,
1075
+ this.showSimplicityTop,
1076
+ 'this.menuUrl'
1077
+ );
1078
+
1059
1079
  // this.handleListener();
1060
1080
  this.getNums();
1061
1081
  window.top.jumpMenu = window.top.jumpTopMenu = this.handleSelect;
1082
+ this.queryChildMenuData();
1062
1083
  },
1063
1084
  methods: {
1085
+ /**
1086
+ * queryChildMenu: 查询左侧我的提醒和我的快捷菜单
1087
+ */
1088
+ queryChildMenuData() {
1089
+ util
1090
+ .ajax({
1091
+ url: queryChildMenuUrl,
1092
+ method: 'get'
1093
+ })
1094
+ .then((res) => {
1095
+ if (res.rCode === 0) {
1096
+ console.log(res.results, 'res.results');
1097
+ const tree = this.flatToNestedTree(res.results);
1098
+ console.log(tree, 'tree');
1099
+ // this.myRemind = tree[0];
1100
+ // this.myShortcut = tree[1];
1101
+ }
1102
+ });
1103
+ },
1104
+
1105
+ flatToNestedTree(flatTree, rootPid = 'root') {
1106
+ if (!Array.isArray(flatTree)) {
1107
+ console.error('flatTree must be an array');
1108
+ return [];
1109
+ }
1110
+
1111
+ // 创建ID映射表,用于快速查找节点
1112
+ const idMap = new Map();
1113
+ // 存储根节点
1114
+ const rootNodes = [];
1115
+
1116
+ // 首次遍历:创建映射表并初始化每个节点的children数组
1117
+ flatTree.forEach((node) => {
1118
+ // 深拷贝节点,避免修改原数据
1119
+ const nodeCopy = { ...node };
1120
+ // 确保children数组存在且为空
1121
+ nodeCopy.children = [];
1122
+ // 建立ID到节点的映射
1123
+ idMap.set(nodeCopy.id, nodeCopy);
1124
+
1125
+ // 找出根节点
1126
+ if (nodeCopy.pid === rootPid) {
1127
+ rootNodes.push(nodeCopy);
1128
+ }
1129
+ });
1130
+
1131
+ // 第二次遍历:建立父子关系
1132
+ flatTree.forEach((node) => {
1133
+ const currentNode = idMap.get(node.id);
1134
+ const parentNode = idMap.get(node.pid);
1135
+
1136
+ // 如果找到父节点且父节点不是根节点
1137
+ if (parentNode && node.pid !== rootPid) {
1138
+ parentNode.children.push(currentNode);
1139
+ }
1140
+ });
1141
+
1142
+ return rootNodes;
1143
+ },
1064
1144
  // tab点击事件
1065
1145
  fourthTabClick(res) {
1066
1146
  const index = res.index;
1067
1147
  this.currentPage = {
1068
- appCode: this.fourthTabs[index]
1148
+ ...this.fourthTabs[index]
1069
1149
  };
1150
+ this.appCodes = this.fourthTabs[index].appCode;
1070
1151
  console.log(this.currentPage, 'this.currentPage');
1071
1152
 
1072
1153
  // console.log(this.fourthTabs[index], 'this.fourthTabs[index]');
@@ -1591,7 +1672,8 @@ export default {
1591
1672
  appCode: 'indexUrl'
1592
1673
  };
1593
1674
  this.homePage = this.setIframeType(obj);
1594
- this.currentPage = this.homePage;
1675
+ this.currentPage = { ...this.homePage };
1676
+ this.appCodes = 'indexUrl';
1595
1677
  // console.log(this.currentPage, 'currentPage');
1596
1678
  },
1597
1679
  /**
@@ -2103,49 +2185,8 @@ export default {
2103
2185
  * @author huangbo
2104
2186
  * @date 2024年9月7日
2105
2187
  **/
2106
- handleRefresh(arg) {
2188
+ handleRefresh() {
2107
2189
  this.getNums();
2108
- let i =
2109
- arg && arg != true && arg !== 'pageData'
2110
- ? util.indexOfObj(this.tabs, arg, 'appCode,code,id,url')
2111
- : util.indexOfObj(this.tabs, this.activeName, 'id');
2112
- let tab = this.tabs[i];
2113
- if (isIE || tab.method === 'iframe') {
2114
- if (arg && arg === 'pageData') {
2115
- let iframe = document.getElementById(tab.id || tab.appCode);
2116
- let source = tab.url;
2117
- if (source && !util.startWith(source, ['http', 'https'], true)) {
2118
- source = location.origin + source.replace('./', '/');
2119
- }
2120
- !iframe && (iframe = document.getElementById(this.iframeId));
2121
- iframe &&
2122
- iframe.contentWindow.postMessage(
2123
- { method: 'pageData' },
2124
- source || '*'
2125
- );
2126
- } else {
2127
- this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
2128
- }
2129
- return;
2130
- }
2131
- if (tab.method === 'wujie' && tab.appCode) {
2132
- if (arg && arg === 'pageData') {
2133
- WujieVue.$emit('pageData', tab);
2134
- } else {
2135
- window.document
2136
- .querySelector(`iframe[name=${tab.appCode}]`)
2137
- .contentWindow.location.reload(true);
2138
- }
2139
- return;
2140
- }
2141
- if (tab.method === 'router') {
2142
- if (arg && arg === 'pageData') {
2143
- const bus = this.bus || this.$root.Bus;
2144
- bus.$emit('pageData', tab);
2145
- } else {
2146
- this.$set(this.tabs[i], 'keys', util.uuid());
2147
- }
2148
- }
2149
2190
  },
2150
2191
  /**
2151
2192
  * @desc:删除iframe
@@ -2264,7 +2305,9 @@ export default {
2264
2305
  break;
2265
2306
  case 'index':
2266
2307
  // util.win.open(this.doorIndex, '_self');
2267
- this.currentPage = this.homePage;
2308
+ this.currentPage = { ...this.homePage };
2309
+ this.appCodes = 'indexUrl';
2310
+ console.log(this.currentPage, 'this.currentPage');
2268
2311
  break;
2269
2312
  case 'userinfo':
2270
2313
  this.$refs.user.handleOpen();
@@ -2483,14 +2526,12 @@ export default {
2483
2526
  **/
2484
2527
  handleSelect(res, params = {}) {
2485
2528
  console.log(res, 'handleSelect');
2486
-
2487
- if (res.urlopenmode == 1 || res.openModel == 1) {
2488
- util.win.open(res.url || res.menuurl);
2489
- } else if (res.urlopenmode == 2 || res.openModel == 2) {
2490
- util.win.open(res.url || res.menuurl, '_self');
2529
+ const node = res.node ? res.node : res;
2530
+ if (node.urlopenmode == 1 || node.openModel == 1) {
2531
+ util.win.open(node.url || node.menuurl);
2532
+ } else if (node.urlopenmode == 2 || node.openModel == 2) {
2533
+ util.win.open(node.url || node.menuurl, '_self');
2491
2534
  } else {
2492
- const node = res.node ? res.node : res;
2493
-
2494
2535
  let apps = node;
2495
2536
  let param = params;
2496
2537
  let reload = true;
@@ -2514,6 +2555,7 @@ export default {
2514
2555
  if (currentPage.fourthTabs && currentPage.fourthTabs.length > 0) {
2515
2556
  this.fourthTabs = currentPage.fourthTabs;
2516
2557
  this.currentPage = this.setIframeType(this.fourthTabs[0]);
2558
+ this.appCodes = this.currentPage.appCode;
2517
2559
  if (param) {
2518
2560
  this.currentPage.url = util.handlerUrl(
2519
2561
  this.currentPage.url,
@@ -2521,9 +2563,11 @@ export default {
2521
2563
  );
2522
2564
  }
2523
2565
  this.tabActiveName = this.currentPage.id;
2566
+ this.appCodes = this.currentPage.appCode;
2524
2567
  } else {
2525
2568
  this.fourthTabs = fourthTabs;
2526
2569
  this.currentPage = this.setIframeType(currentPage);
2570
+ this.appCodes = this.currentPage.appCode;
2527
2571
  if (param) {
2528
2572
  this.currentPage.url = util.handlerUrl(
2529
2573
  this.currentPage.url,