eoss-ui 0.5.81-beta9 → 0.5.83

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 (130) hide show
  1. package/lib/button-group.js +82 -55
  2. package/lib/button.js +57 -48
  3. package/lib/checkbox-group.js +55 -47
  4. package/lib/clients.js +4 -3
  5. package/lib/config/api.js +3 -1
  6. package/lib/data-table-form.js +55 -47
  7. package/lib/data-table.js +479 -277
  8. package/lib/date-picker.js +69 -59
  9. package/lib/dialog.js +86 -73
  10. package/lib/eoss-ui.common.js +4000 -3052
  11. package/lib/flow-group.js +102 -65
  12. package/lib/flow-list.js +56 -48
  13. package/lib/flow.js +158 -85
  14. package/lib/form.js +88 -59
  15. package/lib/handle-user.js +66 -51
  16. package/lib/handler.js +69 -50
  17. package/lib/icon.js +55 -47
  18. package/lib/index.js +1 -1
  19. package/lib/input-number.js +55 -47
  20. package/lib/input.js +55 -47
  21. package/lib/login.js +104 -85
  22. package/lib/main.js +1375 -925
  23. package/lib/menu.js +1 -1
  24. package/lib/nav.js +55 -47
  25. package/lib/notify.js +54 -50
  26. package/lib/page.js +55 -47
  27. package/lib/pagination.js +3723 -3
  28. package/lib/player.js +60 -52
  29. package/lib/qr-code.js +55 -47
  30. package/lib/radio-group.js +55 -47
  31. package/lib/retrial-auth.js +56 -48
  32. package/lib/select-ganged.js +55 -47
  33. package/lib/select.js +55 -47
  34. package/lib/selector-panel.js +69 -60
  35. package/lib/selector.js +495 -424
  36. package/lib/sizer.js +55 -47
  37. package/lib/steps.js +55 -47
  38. package/lib/switch.js +55 -47
  39. package/lib/table-form.js +55 -47
  40. package/lib/tabs.js +1532 -1480
  41. package/lib/theme-chalk/base.css +1 -1
  42. package/lib/theme-chalk/button-group.css +1 -1
  43. package/lib/theme-chalk/data-table.css +1 -1
  44. package/lib/theme-chalk/dialog.css +1 -1
  45. package/lib/theme-chalk/flow-group.css +1 -1
  46. package/lib/theme-chalk/form.css +1 -1
  47. package/lib/theme-chalk/index.css +1 -1
  48. package/lib/theme-chalk/main.css +1 -1
  49. package/lib/theme-chalk/menu.css +1 -1
  50. package/lib/theme-chalk/pagination.css +1 -1
  51. package/lib/theme-chalk/simplicity.css +1 -1
  52. package/lib/theme-chalk/sizer.css +1 -1
  53. package/lib/theme-chalk/tabs.css +1 -1
  54. package/lib/theme-chalk/toolbar.css +1 -1
  55. package/lib/theme-chalk/tree-group.css +1 -1
  56. package/lib/theme-chalk/tree.css +1 -1
  57. package/lib/theme-chalk/upload.css +1 -1
  58. package/lib/tips.js +55 -47
  59. package/lib/tree-group.js +79 -50
  60. package/lib/tree.js +55 -47
  61. package/lib/upload.js +59 -51
  62. package/lib/utils/util.js +6 -2
  63. package/lib/wujie.js +55 -47
  64. package/lib/wxlogin.js +55 -47
  65. package/package.json +3 -3
  66. package/packages/button/src/main.vue +2 -1
  67. package/packages/button-group/src/main.vue +8 -6
  68. package/packages/clients/src/main.vue +2 -1
  69. package/packages/data-table/src/column.vue +137 -54
  70. package/packages/data-table/src/main.vue +81 -69
  71. package/packages/data-table/src/sizer.vue +2 -0
  72. package/packages/date-picker/src/main.vue +22 -14
  73. package/packages/dialog/src/main.vue +23 -24
  74. package/packages/flow/src/main.vue +32 -17
  75. package/packages/flow-group/src/main.vue +18 -11
  76. package/packages/form/src/main.vue +21 -10
  77. package/packages/handle-user/src/main.vue +5 -1
  78. package/packages/handler/src/main.vue +7 -3
  79. package/packages/login/src/main.vue +22 -15
  80. package/packages/main/src/default/index.vue +111 -179
  81. package/packages/main/src/main.vue +233 -4
  82. package/packages/main/src/public/online.vue +89 -0
  83. package/packages/main/src/simplicity/apps.vue +3 -3
  84. package/packages/main/src/simplicity/handler.vue +6 -2
  85. package/packages/main/src/simplicity/index.vue +283 -238
  86. package/packages/main/src/simplicity/menu-list.vue +3 -2
  87. package/packages/main/src/simplicity/router-page.vue +5 -14
  88. package/packages/main/src/simplicity/sub-menu.vue +31 -9
  89. package/packages/menu/src/main.vue +4 -3
  90. package/packages/pagination/src/main.vue +20 -1
  91. package/packages/selector/src/main.vue +147 -135
  92. package/packages/selector-panel/src/main.vue +3 -2
  93. package/packages/selector-panel/src/selection.vue +2 -2
  94. package/packages/tabs/src/main.vue +25 -15
  95. package/packages/theme-chalk/lib/base.css +1 -1
  96. package/packages/theme-chalk/lib/button-group.css +1 -1
  97. package/packages/theme-chalk/lib/data-table.css +1 -1
  98. package/packages/theme-chalk/lib/dialog.css +1 -1
  99. package/packages/theme-chalk/lib/flow-group.css +1 -1
  100. package/packages/theme-chalk/lib/form.css +1 -1
  101. package/packages/theme-chalk/lib/index.css +1 -1
  102. package/packages/theme-chalk/lib/main.css +1 -1
  103. package/packages/theme-chalk/lib/menu.css +1 -1
  104. package/packages/theme-chalk/lib/pagination.css +1 -1
  105. package/packages/theme-chalk/lib/simplicity.css +1 -1
  106. package/packages/theme-chalk/lib/sizer.css +1 -1
  107. package/packages/theme-chalk/lib/tabs.css +1 -1
  108. package/packages/theme-chalk/lib/toolbar.css +1 -1
  109. package/packages/theme-chalk/lib/tree-group.css +1 -1
  110. package/packages/theme-chalk/lib/tree.css +1 -1
  111. package/packages/theme-chalk/lib/upload.css +1 -1
  112. package/packages/theme-chalk/src/base.scss +39 -0
  113. package/packages/theme-chalk/src/button-group.scss +16 -2
  114. package/packages/theme-chalk/src/common/var.scss +7 -2
  115. package/packages/theme-chalk/src/data-table.scss +60 -23
  116. package/packages/theme-chalk/src/dialog.scss +10 -0
  117. package/packages/theme-chalk/src/flow-group.scss +1 -0
  118. package/packages/theme-chalk/src/form.scss +42 -40
  119. package/packages/theme-chalk/src/main.scss +11 -0
  120. package/packages/theme-chalk/src/pagination.scss +7 -0
  121. package/packages/theme-chalk/src/simplicity.scss +45 -4
  122. package/packages/theme-chalk/src/tabs.scss +24 -28
  123. package/packages/theme-chalk/src/toolbar.scss +16 -4
  124. package/packages/theme-chalk/src/tree-group.scss +8 -0
  125. package/packages/theme-chalk/src/tree.scss +19 -6
  126. package/packages/tree-group/src/main.vue +15 -7
  127. package/src/config/api.js +3 -1
  128. package/src/index.js +157 -157
  129. package/src/utils/util.js +6 -1
  130. package/CHANGELOG.md +0 -929
@@ -13,18 +13,44 @@
13
13
  ref="main"
14
14
  v-on="$listeners"
15
15
  ></main-default>
16
+
17
+ <!-- 公用弹窗 -->
18
+ <es-dialog
19
+ v-for="(item, index) in dialogs"
20
+ :visible.sync="visibles[index]"
21
+ :key="item.id || item.name || index"
22
+ size="md"
23
+ v-bind="
24
+ exclAttribute({
25
+ data: item,
26
+ attrs: ['visible', 'url']
27
+ })
28
+ "
29
+ @closed="handleClosed(item, index)"
30
+ >
31
+ <iframe
32
+ v-if="visibles[index]"
33
+ width="100%"
34
+ height="100%"
35
+ frameborder="0"
36
+ :src="item.url"
37
+ ></iframe>
38
+ </es-dialog>
39
+ <!-- 公用弹窗 end -->
16
40
  </div>
17
41
  </template>
18
42
  <script>
19
43
  import Simplicity from './simplicity/index.vue';
20
44
  import MainDefault from './default/index.vue';
21
45
  import util from 'eoss-ui/src/utils/util';
46
+ import WujieVue from 'wujie-vue2';
47
+ const { bus } = WujieVue;
22
48
  export default {
23
49
  name: 'EsMain',
24
50
  inheritAttrs: false,
25
51
  provide() {
26
52
  return {
27
- esMain: this
53
+ reLogin: this.handleReLogin
28
54
  };
29
55
  },
30
56
  components: {
@@ -38,17 +64,167 @@ export default {
38
64
  watch: {},
39
65
  data() {
40
66
  return {
67
+ sysCode: '',
41
68
  appCode: '',
42
- params: {}
69
+ params: {},
70
+ dialogs: [],
71
+ visibles: []
43
72
  };
44
73
  },
45
74
  created() {
46
75
  this.params = util.getParams() || {};
76
+ this.sysCode = this.params.sysCode;
47
77
  this.appCode = this.params.appCode;
48
78
  this.getConfig(this.params);
79
+ // 主应用监听事件
80
+ },
81
+ mounted() {
82
+ if (util.win.$wujie) {
83
+ util.win.$wujie.bus.$on('changeTheme', (res) => {
84
+ util.updateTheme(res);
85
+ });
86
+ }
87
+
88
+ util.win.reLogin = this.handleReLogin;
89
+ util.win.windowOpen = this.openPage;
90
+ util.win.refresh = this.$refs.main.handleRefresh;
91
+ util.win.jumpMenu = this.$refs.main.jumpMenu;
92
+ bus.$on('reLogin', this.handleReLogin);
93
+ bus.$on('refresh', this.$refs.main.handleRefresh);
94
+ bus.$on('jumpMenu', this.$refs.main.jumpMenu);
95
+ bus.$on('emit', function (method, args) {
96
+ // 主应用发送事件
97
+ bus.$emit(method, args);
98
+ });
99
+
100
+ window.addEventListener('message', (method, args) => {
101
+ switch (method) {
102
+ case 'reLogin':
103
+ this.handleReLogin(args);
104
+ break;
105
+ case 'refresh':
106
+ this.$refs.main.handleRefresh(args);
107
+ break;
108
+ case 'jumpMenu':
109
+ this.$refs.main.jumpMenu(args);
110
+ break;
111
+ case 'emit':
112
+ let origin = args.origin || '*';
113
+ window.postMessage(args, origin);
114
+ break;
115
+ case 'openDialog':
116
+ this.dialogs.push(args);
117
+ let index = this.visibles.length;
118
+ this.visibles.push(false);
119
+ this.$nextTick(() => {
120
+ this.$set(this.visibles, index, true);
121
+ });
122
+ break;
123
+ case 'closeDialog':
124
+ for (let i = 0; i < this.dialogs.length; i++) {
125
+ let item = this.dialogs[i];
126
+ if (item.url == args.url) {
127
+ this.$set(this.visibles, i, false);
128
+ }
129
+ }
130
+ break;
131
+ }
132
+ });
49
133
  },
50
- mounted() {},
51
134
  methods: {
135
+ /**
136
+ * @desc:重新登录
137
+ * @author huangbo
138
+ * @date 2024年9月7日
139
+ **/
140
+ handleReLogin(res) {
141
+ if (res && typeof res == 'string') {
142
+ res = JSON.parse(res);
143
+ }
144
+ let msg = '提示';
145
+ let btn = {
146
+ confirmButtonText: '确定',
147
+ cancelButtonText: '取消',
148
+ closeOnClickModal: false,
149
+ type: 'warning'
150
+ };
151
+ if (res) {
152
+ if (res.rCode === 69) {
153
+ msg = '该账号在其他地方已登陆!';
154
+ btn = {
155
+ confirmButtonText: '确定',
156
+ closeOnClickModal: false,
157
+ type: 'warning'
158
+ };
159
+ } else {
160
+ msg = '登录已过期,请重新登录!';
161
+ }
162
+ }
163
+ cl;
164
+ let remind = sessionStorage.getItem('remind');
165
+ if (!remind) {
166
+ clearTimeout(this.timer);
167
+ this.timer = setTimeout(() => {
168
+ console.log('handleReLogin');
169
+ sessionStorage.setItem('remind', 1);
170
+ this.$confirm(msg, btn)
171
+ .then(() => {
172
+ util.removeStorage([
173
+ 'Authorization',
174
+ 'token',
175
+ 'ssId',
176
+ 'userId',
177
+ 'userName',
178
+ 'auth',
179
+ 'deviceUnique',
180
+ 'menus',
181
+ 'useCaseCodes',
182
+ 'mainConfig',
183
+ 'jump'
184
+ ]);
185
+ const loginPage =
186
+ util.getStorage('login') || util.getStorage('loginPage');
187
+ try {
188
+ if (loginPage) {
189
+ let src;
190
+ if (!util.startWith(loginPage, ['http', '/'], true)) {
191
+ let pathname = util.win.top.location.pathname;
192
+ if (pathname !== '/') {
193
+ pathname = pathname.split('/');
194
+ pathname.splice(pathname.length - 1);
195
+ pathname = pathname.join('/');
196
+ src = pathname + '/' + loginPage.replace('./', '');
197
+ } else {
198
+ src = pathname + loginPage.replace('./', '');
199
+ }
200
+ } else {
201
+ src = loginPage;
202
+ }
203
+ util.win.top.location.href = src;
204
+ } else if (
205
+ util.win.top.location.href.indexOf('main.html') > -1
206
+ ) {
207
+ util.win.top.location.href = './login.html';
208
+ } else {
209
+ const hash = util.win.top.location.hash;
210
+ if (hash) {
211
+ const len = util.win.top.location.href.indexOf(hash);
212
+ util.win.top.location.href =
213
+ util.win.location.href.slice(0, len) + '#/login';
214
+ } else {
215
+ util.win.top.location.href = '/login.html';
216
+ }
217
+ }
218
+ } catch (error) {
219
+ util.win.postMessage({ type: 1 }, '*');
220
+ }
221
+ })
222
+ .catch((e) => {
223
+ sessionStorage.removeItem('remind');
224
+ });
225
+ }, 2000);
226
+ }
227
+ },
52
228
  /**
53
229
  * @desc:获取系统配置
54
230
  * @author huangbo
@@ -64,11 +240,64 @@ export default {
64
240
  ) {
65
241
  return false;
66
242
  }
67
- if (!util.getStorage('mainConfig')) {
243
+ let mainConfig = util.getStorage('mainConfig');
244
+ if (!mainConfig || mainConfig == '{}') {
68
245
  util.getMainConfig((res) => {
69
246
  this.$refs.main.init(res);
70
247
  });
71
248
  }
249
+ },
250
+ /**
251
+ * @desc:打开页面
252
+ * @author huangbo
253
+ * @date 2024年9月7日
254
+ **/
255
+ openPage(url, name, width, height) {
256
+ let src = url;
257
+ if (!util.startWith(url, ['http', '/'], true)) {
258
+ let pathname = window.location.pathname;
259
+ if (pathname !== '/') {
260
+ pathname = pathname.split('/');
261
+ pathname.splice(pathname.length - 1);
262
+ pathname = pathname.join('/');
263
+ }
264
+ src = pathname + url.replace('./', '/');
265
+ }
266
+ if (name) {
267
+ let w = 0;
268
+ let h = 0;
269
+ try {
270
+ w = width ? width : util.win.top.screen.availWidth - 10;
271
+ h = height ? height : util.win.top.screen.availHeight - 60;
272
+ } catch (error) {
273
+ w = width ? width : util.win.screen.availWidth - 10;
274
+ h = height ? height : util.win.screen.availHeight - 60;
275
+ }
276
+ return util.win.open(
277
+ src,
278
+ name,
279
+ `width=${w}px,height=${h}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
280
+ );
281
+ } else {
282
+ return util.win.open(src);
283
+ }
284
+ },
285
+ /**
286
+ * @desc:排除属性
287
+ * @author huangbo
288
+ * @date 2024年9月7日
289
+ **/
290
+ exclAttribute({ data, attrs }) {
291
+ return util.exclAttribute({ data, attrs });
292
+ },
293
+ /**
294
+ * @desc:关闭dialog
295
+ * @author huangbo
296
+ * @date 2024年9月7日
297
+ **/
298
+ handleClosed(res, index) {
299
+ this.dialogs.splice(index, 1);
300
+ this.visibles.splice(index, 1);
72
301
  }
73
302
  },
74
303
  beforeDestroy() {}
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <es-data-table
3
+ numbers
4
+ :url="sysuseronline"
5
+ :thead="thead"
6
+ page
7
+ ></es-data-table>
8
+ </template>
9
+
10
+ <script>
11
+ import { userOnline } from 'eoss-ui/src/config/api.js';
12
+ export default {
13
+ name: 'Online',
14
+ components: {},
15
+ props: {
16
+ sysuseronline: {
17
+ type: String,
18
+ default: userOnline
19
+ }
20
+ },
21
+ data() {
22
+ return {
23
+ thead: [
24
+ {
25
+ title: '单位',
26
+ field: 'orgName',
27
+ minWidth: 120
28
+ },
29
+ {
30
+ title: '部门',
31
+ field: 'depName',
32
+ align: 'center',
33
+ minWidth: 120
34
+ },
35
+ {
36
+ title: '姓名',
37
+ field: 'userName',
38
+ align: 'center',
39
+ width: 120
40
+ },
41
+ {
42
+ title: '职务',
43
+ field: 'position',
44
+ align: 'center',
45
+ width: 120
46
+ },
47
+ {
48
+ title: '账号',
49
+ field: 'loginName',
50
+ align: 'center',
51
+ width: 120
52
+ },
53
+ {
54
+ title: '登录时间',
55
+ field: 'loginDate',
56
+ align: 'center',
57
+ width: 156
58
+ },
59
+ {
60
+ title: '登录次数',
61
+ field: 'freQuency',
62
+ align: 'center',
63
+ width: 100
64
+ },
65
+ {
66
+ title: '登录方式',
67
+ field: 'loginModel',
68
+ align: 'center',
69
+ width: 100,
70
+ render: (h, params) => {
71
+ let {
72
+ row: { loginModel }
73
+ } = params;
74
+ let types = ['普通登录', 'CA登录', '手机登录'];
75
+ return h('span', {}, [types[loginModel] || types[0]]);
76
+ }
77
+ }
78
+ ]
79
+ };
80
+ },
81
+ computed: {},
82
+ watch: {},
83
+ created() {},
84
+ mounted() {},
85
+ methods: {}
86
+ };
87
+ </script>
88
+
89
+ <style lang="scss" scoped></style>
@@ -116,7 +116,7 @@
116
116
  background
117
117
  layout="total,prev, pager, next"
118
118
  total-text="共 {total} 专项业务系统"
119
- :page-size="appSize"
119
+ :page-size="bsSize"
120
120
  :total="business.length"
121
121
  @current-change="
122
122
  (res) => {
@@ -169,8 +169,8 @@
169
169
  layout="total,prev, pager, next"
170
170
  total-text="共 {total} 系统设置"
171
171
  hide-on-single-page
172
- :page-size="appSize"
173
- :total="business.length"
172
+ :page-size="sysSize"
173
+ :total="systems.length"
174
174
  @current-change="
175
175
  (res) => {
176
176
  this.handleChange(res, 2);
@@ -6,7 +6,11 @@
6
6
  </div>
7
7
  <div class="es-simplicity-online">
8
8
  当前
9
- <span class="es-simplicity-online-num" :class="{ 'es-pointer': isClick }">
9
+ <span
10
+ class="es-simplicity-online-num"
11
+ @click="isClick ? handleClick({ type: 'online' }) : ''"
12
+ :class="{ 'es-pointer': isClick }"
13
+ >
10
14
  {{ online }}
11
15
  </span>
12
16
  人在线
@@ -63,7 +67,7 @@ export default {
63
67
  default() {
64
68
  return {
65
69
  type: 'index',
66
- open: doorIndex,
70
+ link: doorIndex,
67
71
  icon: 'es-icon-home',
68
72
  title: '门户'
69
73
  };