eoss-ui 0.5.98 → 0.6.0

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 (83) hide show
  1. package/lib/button-group.js +2 -2
  2. package/lib/button.js +2 -2
  3. package/lib/calendar.js +2 -2
  4. package/lib/card.js +2 -2
  5. package/lib/cascader.js +2 -2
  6. package/lib/checkbox-group.js +3 -2
  7. package/lib/clients.js +2 -2
  8. package/lib/data-table-form.js +3 -2
  9. package/lib/data-table.js +3 -2
  10. package/lib/date-picker.js +2 -2
  11. package/lib/dialog.js +6 -5
  12. package/lib/enterprise.js +2 -2
  13. package/lib/eoss-ui.common.js +629 -722
  14. package/lib/error-page.js +2 -2
  15. package/lib/flow-group.js +2 -2
  16. package/lib/flow-list.js +2 -2
  17. package/lib/flow.js +3 -2
  18. package/lib/form.js +3 -2
  19. package/lib/handle-user.js +2 -2
  20. package/lib/handler.js +11 -15
  21. package/lib/icon.js +2 -2
  22. package/lib/icons.js +2 -2
  23. package/lib/index.js +1 -1
  24. package/lib/input-number.js +2 -2
  25. package/lib/input.js +2 -2
  26. package/lib/label.js +2 -2
  27. package/lib/layout.js +2 -2
  28. package/lib/login.js +6 -4
  29. package/lib/main.js +648 -738
  30. package/lib/menu.js +2 -2
  31. package/lib/nav.js +2 -2
  32. package/lib/notify.js +2 -2
  33. package/lib/page.js +2 -2
  34. package/lib/pagination.js +2 -2
  35. package/lib/player.js +4 -4
  36. package/lib/qr-code.js +4 -4
  37. package/lib/radio-group.js +2 -2
  38. package/lib/retrial-auth.js +9 -9
  39. package/lib/select-ganged.js +9 -9
  40. package/lib/select.js +2 -2
  41. package/lib/selector-panel.js +3 -2
  42. package/lib/selector.js +2 -2
  43. package/lib/sizer.js +2 -2
  44. package/lib/steps.js +2 -2
  45. package/lib/switch.js +2 -2
  46. package/lib/table-form.js +2 -2
  47. package/lib/tabs-panel.js +2 -2
  48. package/lib/tabs.js +2 -2
  49. package/lib/theme-chalk/index.css +1 -1
  50. package/lib/theme-chalk/login.css +1 -1
  51. package/lib/theme-chalk/main.css +1 -1
  52. package/lib/theme-chalk/simplicity.css +1 -1
  53. package/lib/tips.js +2 -2
  54. package/lib/toolbar.js +2 -2
  55. package/lib/tree-group.js +2 -2
  56. package/lib/tree.js +2 -2
  57. package/lib/upload.js +3 -2
  58. package/lib/wujie.js +145 -145
  59. package/lib/wxlogin.js +2 -2
  60. package/package.json +2 -2
  61. package/packages/.DS_Store +0 -0
  62. package/packages/dialog/src/main.vue +1 -1
  63. package/packages/handler/.DS_Store +0 -0
  64. package/packages/handler/src/main.vue +0 -5
  65. package/packages/login/.DS_Store +0 -0
  66. package/packages/login/src/main.vue +1 -0
  67. package/packages/main/.DS_Store +0 -0
  68. package/packages/main/src/.DS_Store +0 -0
  69. package/packages/main/src/default/index.vue +27 -21
  70. package/packages/main/src/main.vue +13 -7
  71. package/packages/main/src/{default → public}/settings.vue +51 -19
  72. package/packages/main/src/simplicity/handler.vue +0 -11
  73. package/packages/main/src/simplicity/index.vue +139 -115
  74. package/packages/theme-chalk/lib/index.css +1 -1
  75. package/packages/theme-chalk/lib/login.css +1 -1
  76. package/packages/theme-chalk/lib/main.css +1 -1
  77. package/packages/theme-chalk/lib/simplicity.css +1 -1
  78. package/packages/theme-chalk/src/.DS_Store +0 -0
  79. package/packages/theme-chalk/src/login.scss +6 -0
  80. package/packages/theme-chalk/src/main.scss +16 -0
  81. package/packages/theme-chalk/src/simplicity.scss +37 -0
  82. package/src/index.js +1 -1
  83. package/packages/main/src/simplicity/settings.vue +0 -119
@@ -44,9 +44,12 @@
44
44
  >
45
45
  <div
46
46
  class="es-setting-navs es-setting-top-nav"
47
- @click.stop="handleLayout('topnav')"
47
+ @click.stop="handleLayout('default', 'topnav')"
48
48
  >
49
- <i class="es-icon-gou" v-show="activeName == 'topnav'"></i>
49
+ <i
50
+ class="es-icon-gou"
51
+ v-show="layoutType == 'default' && activeName == 'topnav'"
52
+ ></i>
50
53
  </div>
51
54
  </el-tooltip>
52
55
  <el-tooltip
@@ -57,10 +60,13 @@
57
60
  >
58
61
  <div
59
62
  class="es-setting-navs es-setting-side-nav"
60
- @click.stop="handleLayout('default')"
63
+ @click.stop="handleLayout('default', 'default')"
61
64
  >
62
65
  <div class="es-setting-side-sub-nav"></div>
63
- <i class="es-icon-gou" v-show="activeName == 'default'"></i>
66
+ <i
67
+ class="es-icon-gou"
68
+ v-show="layoutType == 'default' && activeName == 'default'"
69
+ ></i>
64
70
  </div>
65
71
  </el-tooltip>
66
72
  <el-tooltip
@@ -71,9 +77,12 @@
71
77
  >
72
78
  <div
73
79
  class="es-setting-navs es-setting-subsystem-nav"
74
- @click.stop="handleLayout('subsystem')"
80
+ @click.stop="handleLayout('default', 'subsystem')"
75
81
  >
76
- <i class="es-icon-gou" v-show="activeName == 'subsystem'"></i>
82
+ <i
83
+ class="es-icon-gou"
84
+ v-show="layoutType == 'default' && activeName == 'subsystem'"
85
+ ></i>
77
86
  </div>
78
87
  </el-tooltip>
79
88
  <el-tooltip
@@ -84,9 +93,12 @@
84
93
  >
85
94
  <div
86
95
  class="es-setting-navs es-setting-top-side-nav"
87
- @click.stop="handleLayout('topside')"
96
+ @click.stop="handleLayout('default', 'topside')"
88
97
  >
89
- <i class="es-icon-gou" v-show="activeName == 'topside'"></i>
98
+ <i
99
+ class="es-icon-gou"
100
+ v-show="layoutType == 'default' && activeName == 'topside'"
101
+ ></i>
90
102
  </div>
91
103
  </el-tooltip>
92
104
  <el-tooltip
@@ -97,9 +109,29 @@
97
109
  >
98
110
  <div
99
111
  class="es-setting-navs es-setting-side-navs"
100
- @click.stop="handleLayout('side')"
112
+ @click.stop="handleLayout('default', 'side')"
101
113
  >
102
- <i class="es-icon-gou" v-show="activeName == 'side'"></i>
114
+ <i
115
+ class="es-icon-gou"
116
+ v-show="layoutType == 'default' && activeName == 'side'"
117
+ ></i>
118
+ </div>
119
+ </el-tooltip>
120
+ <el-tooltip
121
+ class="es-setting-navs-item"
122
+ effect="dark"
123
+ content="(新)应用菜单布局"
124
+ placement="bottom"
125
+ >
126
+ <div
127
+ class="es-setting-navs es-setting-app-nav"
128
+ @click.stop="handleLayout('simplicity')"
129
+ >
130
+ <div class="es-setting-side-sub-nav"></div>
131
+ <i
132
+ class="es-icon-gou"
133
+ v-show="layoutType == 'simplicity' && activeName == 'simplicity'"
134
+ ></i>
103
135
  </div>
104
136
  </el-tooltip>
105
137
  </div>
@@ -108,6 +140,7 @@
108
140
  </template>
109
141
  <script>
110
142
  import util from 'eoss-ui/src/utils/util';
143
+ import { string } from 'slate';
111
144
  export default {
112
145
  name: 'message',
113
146
  props: {
@@ -123,10 +156,8 @@ export default {
123
156
  return ['#a60006', '#409eff'];
124
157
  }
125
158
  },
126
- layout: {
127
- type: String,
128
- default: 'default'
129
- }
159
+ active: String,
160
+ layoutType: String
130
161
  },
131
162
  computed: {
132
163
  show: {
@@ -163,7 +194,8 @@ export default {
163
194
  data() {
164
195
  return {
165
196
  color: '',
166
- activeName: this.layout
197
+ layoutName: this.layoutType,
198
+ activeName: this.active
167
199
  };
168
200
  },
169
201
  mounted() {},
@@ -179,11 +211,11 @@ export default {
179
211
  //this.setTheme(res);
180
212
  },
181
213
  //选择菜单布局
182
- handleLayout(res) {
214
+ handleLayout(res, active) {
183
215
  let old = this.activeName;
184
- this.activeName = res;
185
- this.$emit('update:layout', res);
186
- this.$emit('layout', res, old);
216
+ this.layoutName = res;
217
+ this.activeName = active;
218
+ this.$emit('layout', res, active, old);
187
219
  }
188
220
  }
189
221
  };
@@ -79,16 +79,6 @@ export default {
79
79
  };
80
80
  }
81
81
  },
82
- old: {
83
- type: Object,
84
- default() {
85
- return {
86
- type: 'old',
87
- icon: 'es-icon-shiyongjiuban',
88
- title: '使用旧版'
89
- };
90
- }
91
- },
92
82
  notice: {
93
83
  type: Object,
94
84
  default() {
@@ -152,7 +142,6 @@ export default {
152
142
  this.search,
153
143
  this.index,
154
144
  this.home,
155
- this.old,
156
145
  this.notice,
157
146
  this.quit,
158
147
  this.set
@@ -276,10 +276,13 @@
276
276
  <!-- 设置 -->
277
277
  <settings
278
278
  v-bind="$attrs"
279
+ layout-type="simplicity"
280
+ active="simplicity"
279
281
  :theme="themeColor"
280
282
  :predefine="themes"
281
283
  :visible.sync="showSet"
282
284
  @change="handleChange"
285
+ @layout="handleLayout"
283
286
  ></settings>
284
287
  <!-- 设置 end-->
285
288
 
@@ -325,7 +328,7 @@ import apps from './apps.vue';
325
328
  import user from './user.vue';
326
329
  import message from './message.vue';
327
330
  import notice from './notice.vue';
328
- import settings from './settings.vue';
331
+ import settings from '../public/settings.vue';
329
332
  import routerPage from './router-page.vue';
330
333
  import online from '../public/online.vue';
331
334
  import search from '../public/search.vue';
@@ -731,18 +734,26 @@ export default {
731
734
  }
732
735
  let pathname = url.substring(url.indexOf('#/') + 1);
733
736
  pathname = pathname.split('?')[0];
737
+ let code;
734
738
  if (res.path !== '/' && pathname == path) {
735
739
  if (res.components) {
736
740
  if (!res.components[code]) {
737
- console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
741
+ console.error(
742
+ '路由“命名视图”规范属性名称与菜单appCode不一致',
743
+ res,
744
+ code
745
+ );
746
+ code = Object.keys(res.components).filter((item) => {
747
+ return item !== 'default';
748
+ })[0];
738
749
  }
739
750
  } else {
740
751
  console.error(
741
- '请根据“命名视图”规范,正确添加components属性名称',
752
+ '请根据路由“命名视图”规范,正确添加components属性名称',
742
753
  res
743
754
  );
744
755
  }
745
- return pathname;
756
+ return code ? { path: pathname, appCode: code } : pathname;
746
757
  }
747
758
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
748
759
  let path = this.hasRouter(res.children, url, code);
@@ -812,7 +823,7 @@ export default {
812
823
  util.setStorage('loginPage', results[i]);
813
824
  }
814
825
  if (i === 'sysLogoIco' && results[i]) {
815
- sessionStorage.setItem('sysLogoIco', results[i]);
826
+ localStorage.setItem('sysLogoIco', results[i]);
816
827
  util.setFavicon(results[i]);
817
828
  }
818
829
  if (i === 'userStyle' && results[i]) {
@@ -937,114 +948,21 @@ export default {
937
948
  * @date 2024年9月7日
938
949
  **/
939
950
  getMenus(loading) {
951
+ const menuData = store.get('nav');
952
+ if (menuData && menuData.length) {
953
+ loading.close();
954
+ this.renderMenus(menuData);
955
+ return;
956
+ }
940
957
  util
941
958
  .ajax({ url: this._menuUrl })
942
959
  .then((res) => {
943
960
  loading.close();
944
961
  if (res.rCode === 0) {
945
962
  if (res.results && res.results.length) {
946
- this.menus = res.results;
947
- this.setTips(this.menus);
948
- store.set('nav', this.menus);
949
- if (this.indexUrl) {
950
- let obj = this.getMenu(this.menus, this.indexUrl);
951
- obj = obj
952
- ? obj
953
- : {
954
- url: this.indexUrl,
955
- text: '工作台',
956
- id: '0',
957
- appCode: 'indexUrl'
958
- };
959
- this.homePage = this.setIframeType(obj);
960
- if (!this.appCode) {
961
- this.tabs = [this.homePage];
962
- this.activeName = this.homePage.id;
963
- }
964
- }
965
- if (this.appCode) {
966
- let code = this.sysCode || this.appCode;
967
- let app = this.userApps.filter((item) => {
968
- return item.code === code;
969
- })[0];
970
- if (app) {
971
- this.active = app.id;
972
- if (app.url) {
973
- let obj = this.getMenu(this.menus, app.url);
974
- if (obj) {
975
- let tab = this.setIframeType(obj);
976
- this.tabs = [tab];
977
- this.activeName = tab.id;
978
- } else {
979
- this.tabs = [app];
980
- }
981
- }
982
- }
983
- if (this.sysCode) {
984
- let subMenus = this.getMenu(
985
- this.menus,
986
- this.sysCode,
987
- 'appCode'
988
- );
989
- if (subMenus) {
990
- let obj = this.getMenu(this.menus, this.appCode, 'appCode');
991
- if (obj) {
992
- if (!obj.url) {
993
- obj = this.getFirst(obj);
994
- }
995
- this.subActive = obj.id;
996
- let tab = this.setIframeType(obj);
997
- this.tabs = [tab];
998
- this.activeName = tab.id;
999
- } else {
1000
- this.subActive = '';
1001
- }
1002
- this.subMenus = subMenus;
1003
- this.showMenu = true;
1004
- } else {
1005
- this.subMenus = null;
1006
- this.showMenu = false;
1007
- }
1008
- } else {
1009
- let subMenus = this.getMenu(
1010
- this.menus,
1011
- this.appCode,
1012
- 'appCode'
1013
- );
1014
- if (subMenus) {
1015
- if (this.tabs.length == 0) {
1016
- let obj = this.getFirst(subMenus);
1017
- if (obj) {
1018
- this.subActive = obj.id;
1019
- let tab = this.setIframeType(obj);
1020
- this.tabs = [tab];
1021
- this.activeName = tab.id;
1022
- } else {
1023
- this.subActive = '';
1024
- }
1025
- }
1026
- this.subMenus = subMenus;
1027
- this.showMenu = true;
1028
- } else {
1029
- this.subMenus = null;
1030
- this.showMenu = false;
1031
- }
1032
- }
1033
- } else if (
1034
- this.initApps &&
1035
- this.initApps.length &&
1036
- !this.indexUrl
1037
- ) {
1038
- let obj = this.getMenu(
1039
- this.menus,
1040
- this.initApps[this.initApps.length - 1]
1041
- );
1042
- if (obj) {
1043
- let tab = this.setIframeType(obj);
1044
- this.tabs.push(tab);
1045
- this.activeName = tab.id;
1046
- }
1047
- }
963
+ //this.$emit('update:menuData', res.results);
964
+ store.set('nav', JSON.parse(JSON.stringify(res.results)));
965
+ this.renderMenus(JSON.parse(JSON.stringify(res.results)));
1048
966
  } else {
1049
967
  this.$message.error('未分配菜单权限,请联系管理员!');
1050
968
  }
@@ -1060,6 +978,103 @@ export default {
1060
978
  }
1061
979
  });
1062
980
  },
981
+ /**
982
+ * @desc:处理菜单列表
983
+ * @author huangbo
984
+ * @date 2024年9月7日
985
+ **/
986
+ renderMenus(res) {
987
+ this.menus = res;
988
+ this.setTips(this.menus);
989
+ store.set('nav', this.menus);
990
+ if (this.indexUrl) {
991
+ let obj = this.getMenu(this.menus, this.indexUrl);
992
+ obj = obj
993
+ ? obj
994
+ : {
995
+ url: this.indexUrl,
996
+ text: '工作台',
997
+ id: '0',
998
+ appCode: 'indexUrl'
999
+ };
1000
+ this.homePage = this.setIframeType(obj);
1001
+ if (!this.appCode) {
1002
+ this.tabs = [this.homePage];
1003
+ this.activeName = this.homePage.id;
1004
+ }
1005
+ }
1006
+ if (this.appCode) {
1007
+ let code = this.sysCode || this.appCode;
1008
+ let app = this.userApps.filter((item) => {
1009
+ return item.code === code;
1010
+ })[0];
1011
+ if (app) {
1012
+ this.active = app.id;
1013
+ if (app.url) {
1014
+ let obj = this.getMenu(this.menus, app.url);
1015
+ if (obj) {
1016
+ let tab = this.setIframeType(obj);
1017
+ this.tabs = [tab];
1018
+ this.activeName = tab.id;
1019
+ } else {
1020
+ this.tabs = [app];
1021
+ }
1022
+ }
1023
+ }
1024
+ if (this.sysCode) {
1025
+ let subMenus = this.getMenu(this.menus, this.sysCode, 'appCode');
1026
+ if (subMenus) {
1027
+ let obj = this.getMenu(this.menus, this.appCode, 'appCode');
1028
+ if (obj) {
1029
+ if (!obj.url) {
1030
+ obj = this.getFirst(obj);
1031
+ }
1032
+ this.subActive = obj.id;
1033
+ let tab = this.setIframeType(obj);
1034
+ this.tabs = [tab];
1035
+ this.activeName = tab.id;
1036
+ } else {
1037
+ this.subActive = '';
1038
+ }
1039
+ this.subMenus = subMenus;
1040
+ this.showMenu = true;
1041
+ } else {
1042
+ this.subMenus = null;
1043
+ this.showMenu = false;
1044
+ }
1045
+ } else {
1046
+ let subMenus = this.getMenu(this.menus, this.appCode, 'appCode');
1047
+ if (subMenus) {
1048
+ if (this.tabs.length == 0) {
1049
+ let obj = this.getFirst(subMenus);
1050
+ if (obj) {
1051
+ this.subActive = obj.id;
1052
+ let tab = this.setIframeType(obj);
1053
+ this.tabs = [tab];
1054
+ this.activeName = tab.id;
1055
+ } else {
1056
+ this.subActive = '';
1057
+ }
1058
+ }
1059
+ this.subMenus = subMenus;
1060
+ this.showMenu = true;
1061
+ } else {
1062
+ this.subMenus = null;
1063
+ this.showMenu = false;
1064
+ }
1065
+ }
1066
+ } else if (this.initApps && this.initApps.length && !this.indexUrl) {
1067
+ let obj = this.getMenu(
1068
+ this.menus,
1069
+ this.initApps[this.initApps.length - 1]
1070
+ );
1071
+ if (obj) {
1072
+ let tab = this.setIframeType(obj);
1073
+ this.tabs.push(tab);
1074
+ this.activeName = tab.id;
1075
+ }
1076
+ }
1077
+ },
1063
1078
  /**
1064
1079
  * @desc:设置页面加载类型
1065
1080
  * @author huangbo
@@ -1087,7 +1102,12 @@ export default {
1087
1102
  let path = this.hasRouter(routes, urls[0], res.appCode);
1088
1103
  if (path && this.routeType !== 'wujie') {
1089
1104
  res.method = 'router';
1090
- res.path = path;
1105
+ if (typeof path === 'string') {
1106
+ res.path = path;
1107
+ } else {
1108
+ res.path = path.path;
1109
+ res.appCode = path.appCode;
1110
+ }
1091
1111
  res.keys = util.uuid();
1092
1112
  } else {
1093
1113
  let urlopenmode = util.getParams({
@@ -1660,13 +1680,6 @@ export default {
1660
1680
  case 'index':
1661
1681
  util.win.open(this.doorIndex, '_self');
1662
1682
  break;
1663
- case 'old':
1664
- if (typeof this.showOld === 'string') {
1665
- window.location.href = this.showOld;
1666
- } else {
1667
- this.$emit('chang-layout', 'default');
1668
- }
1669
- break;
1670
1683
  case 'set':
1671
1684
  this.showSet = !this.showSet;
1672
1685
  this.showMsg = false;
@@ -1804,6 +1817,17 @@ export default {
1804
1817
  break;
1805
1818
  }
1806
1819
  },
1820
+ /**
1821
+ * @desc:菜单布局样式切换
1822
+ * @author huangbo
1823
+ * @date 2024年9月7日
1824
+ **/
1825
+ handleLayout(res, active) {
1826
+ if (active) {
1827
+ localStorage.setItem('layout', active);
1828
+ }
1829
+ this.$emit('chang-layout', res, active);
1830
+ },
1807
1831
  /**
1808
1832
  * @desc:消息修改总数
1809
1833
  * @author huangbo