eoss-ui 0.5.81-beta2 → 0.5.81-beta21

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