eoss-ui 0.5.74 → 0.5.76

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 (72) hide show
  1. package/lib/button-group.js +125 -23
  2. package/lib/button.js +125 -23
  3. package/lib/checkbox-group.js +125 -23
  4. package/lib/data-table-form.js +125 -23
  5. package/lib/data-table.js +155 -40
  6. package/lib/date-picker.js +125 -23
  7. package/lib/dialog.js +125 -23
  8. package/lib/eoss-ui.common.js +520 -296
  9. package/lib/flow-group.js +125 -23
  10. package/lib/flow-list.js +136 -31
  11. package/lib/flow.js +125 -23
  12. package/lib/form.js +125 -23
  13. package/lib/handle-user.js +125 -23
  14. package/lib/handler.js +125 -23
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +124 -22
  17. package/lib/input.js +141 -29
  18. package/lib/login.js +293 -143
  19. package/lib/main.js +125 -23
  20. package/lib/nav.js +125 -23
  21. package/lib/page.js +125 -23
  22. package/lib/player.js +125 -23
  23. package/lib/qr-code.js +178 -59
  24. package/lib/radio-group.js +125 -23
  25. package/lib/retrial-auth.js +125 -23
  26. package/lib/select-ganged.js +125 -23
  27. package/lib/select.js +140 -28
  28. package/lib/selector-panel.js +125 -23
  29. package/lib/selector.js +125 -23
  30. package/lib/sizer.js +125 -23
  31. package/lib/steps.js +125 -23
  32. package/lib/switch.js +124 -22
  33. package/lib/table-form.js +125 -23
  34. package/lib/tabs.js +125 -23
  35. package/lib/theme-chalk/base.css +1 -1
  36. package/lib/theme-chalk/index.css +1 -1
  37. package/lib/theme-chalk/login.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/menu.css +1 -1
  40. package/lib/theme-chalk/sizer.css +1 -1
  41. package/lib/theme-chalk/upload.css +1 -1
  42. package/lib/tips.js +125 -23
  43. package/lib/toolbar.js +3 -2
  44. package/lib/tree-group.js +159 -57
  45. package/lib/tree.js +140 -26
  46. package/lib/upload.js +125 -23
  47. package/lib/utils/util.js +124 -22
  48. package/lib/wujie.js +125 -23
  49. package/lib/wxlogin.js +152 -34
  50. package/package.json +2 -2
  51. package/packages/data-table/src/main.vue +25 -15
  52. package/packages/flow-list/src/main.vue +63 -41
  53. package/packages/input/src/main.vue +7 -6
  54. package/packages/login/src/main.vue +42 -14
  55. package/packages/qr-code/src/main.vue +48 -37
  56. package/packages/select/src/main.vue +6 -5
  57. package/packages/theme-chalk/lib/base.css +1 -1
  58. package/packages/theme-chalk/lib/index.css +1 -1
  59. package/packages/theme-chalk/lib/login.css +1 -1
  60. package/packages/theme-chalk/lib/main.css +1 -1
  61. package/packages/theme-chalk/lib/menu.css +1 -1
  62. package/packages/theme-chalk/lib/sizer.css +1 -1
  63. package/packages/theme-chalk/lib/upload.css +1 -1
  64. package/packages/theme-chalk/src/base.scss +3 -0
  65. package/packages/theme-chalk/src/login.scss +862 -376
  66. package/packages/theme-chalk/src/main.scss +5 -2
  67. package/packages/toolbar/src/main.vue +16 -6
  68. package/packages/tree/src/main.vue +13 -1
  69. package/packages/tree-group/src/main.vue +24 -37
  70. package/packages/wxlogin/src/main.vue +30 -12
  71. package/src/index.js +1 -1
  72. package/src/utils/util.js +138 -23
@@ -21,7 +21,7 @@
21
21
 
22
22
  .es-main-logo {
23
23
  max-height: 60%;
24
- margin-left: 20px;
24
+ margin-left: 50px;
25
25
  }
26
26
 
27
27
  .es-logo-error {
@@ -185,7 +185,10 @@
185
185
  padding-top: 16px;
186
186
  padding-bottom: 16px;
187
187
  }
188
- .es-nav-main {
188
+ .es-main-left {
189
+ border-right: $--border-base;
190
+ }
191
+ .es-nav-main:not(.es-nav-overlap) {
189
192
  background-color: transparent;
190
193
  border-right: 0;
191
194
  }
@@ -137,8 +137,16 @@ export default {
137
137
  let filter = [];
138
138
 
139
139
  this.contents.forEach((items) => {
140
- let { config, type, reset, multiCondition, contents, group, ...other } =
141
- items;
140
+ let {
141
+ config,
142
+ type,
143
+ reset,
144
+ multiCondition,
145
+ contents,
146
+ group,
147
+ events,
148
+ ...other
149
+ } = items;
142
150
  if (type === 'text') {
143
151
  text = [
144
152
  h(
@@ -370,10 +378,12 @@ export default {
370
378
  model: this.advancedData,
371
379
  contents: contents
372
380
  },
373
- on: {
374
- submit: this.hanleSubmit,
375
- reset: this.hanleCancel
376
- }
381
+ on: events
382
+ ? events
383
+ : {
384
+ submit: this.hanleSubmit,
385
+ reset: this.hanleCancel
386
+ }
377
387
  },
378
388
  []
379
389
  )
@@ -365,6 +365,18 @@ export default {
365
365
  this.$refs.oaTree.filter(val);
366
366
  }
367
367
  }
368
+ },
369
+ param: {
370
+ deep: true,
371
+ handler() {
372
+ this.getTreeData();
373
+ }
374
+ },
375
+ where: {
376
+ deep: true,
377
+ handler() {
378
+ this.getTreeData();
379
+ }
368
380
  }
369
381
  },
370
382
  beforeCreate() {
@@ -393,7 +405,7 @@ export default {
393
405
  },
394
406
  //获取树节点
395
407
  getTreeDatas(param) {
396
- let params = util.extend({}, this.param, this.where, param);
408
+ let params = util.extend({}, this.param, this.where, param || {});
397
409
  if (!this.url || !this.isRemote) return;
398
410
  this.loading = true;
399
411
  util
@@ -87,7 +87,7 @@
87
87
  <template v-if="buttons" slot="button">
88
88
  <es-button
89
89
  v-for="(item, index) in buttons"
90
- :key="index"
90
+ :key="item.id || index"
91
91
  size="small"
92
92
  v-bind="item"
93
93
  v-on="item.events"
@@ -112,11 +112,15 @@
112
112
  >
113
113
  </es-tabs> -->
114
114
  <es-data-table
115
- :key="count"
116
115
  v-else-if="table"
117
116
  size="mini"
118
- v-bind="{ close: true, ...table }"
119
- :param="param"
117
+ v-bind="
118
+ handleExclAttribute({
119
+ data: { close: true, ...table },
120
+ attrs: ['param']
121
+ })
122
+ "
123
+ :param="params"
120
124
  :ref="table.ref ? table.ref : 'esDataTable'"
121
125
  v-on="{ ...$listeners, ...table.events }"
122
126
  >
@@ -276,17 +280,6 @@ export default {
276
280
  return 'wujie';
277
281
  }
278
282
  }
279
- },
280
- param() {
281
- if (this.params) {
282
- return this.params;
283
- } else if (
284
- this.table &&
285
- Object.prototype.hasOwnProperty.call(this.table, 'param')
286
- ) {
287
- return this.table.param;
288
- }
289
- return undefined;
290
283
  }
291
284
  },
292
285
  watch: {
@@ -306,34 +299,23 @@ export default {
306
299
  }
307
300
  }
308
301
  },
302
+ 'table.param': {
303
+ immediate: true,
304
+ deep: true,
305
+ handler(val, old) {
306
+ if (!util.isObjectEqual(val, old)) {
307
+ this.params = JSON.parse(JSON.stringify(val || {}));
308
+ }
309
+ }
310
+ },
309
311
  checkeds: {
310
312
  deep: true,
311
313
  handler() {
312
314
  let params = this.setParams();
313
315
  if (params) {
314
- if (
315
- this.table &&
316
- Object.prototype.hasOwnProperty.call(this.table, 'param')
317
- ) {
318
- this.params = util.extend(true, this.table.param, params);
319
- } else {
320
- this.params = params;
321
- }
316
+ this.params = { ...this.params, ...params };
322
317
  }
323
318
  }
324
- },
325
- //监听table,变化后重新加载,解决点击树节点后改变table对象导致的样式错乱问题
326
- table: {
327
- handler(val, oldVal) {
328
- if (val && val.param) {
329
- this.params = { ...this.params, ...val.param };
330
- }
331
- if (oldVal && val && val.url !== oldVal.url) {
332
- this.count++;
333
- }
334
- },
335
- deep: true,
336
- immediate: true
337
319
  }
338
320
  },
339
321
  data() {
@@ -341,13 +323,18 @@ export default {
341
323
  active: '0',
342
324
  checkeds: null,
343
325
  params: null,
344
- count: 0,
345
326
  wjprops: {}
346
327
  };
347
328
  },
348
329
  created() {},
349
330
  mounted() {},
350
331
  methods: {
332
+ handleExclAttribute({ data, attrs }) {
333
+ return util.exclAttribute({
334
+ data: data,
335
+ attrs: attrs
336
+ });
337
+ },
351
338
  getUrl(url, param, res) {
352
339
  let urls = url.split('?');
353
340
  if (urls[0].indexOf('.js') > 0) {
@@ -1,16 +1,17 @@
1
1
  <template>
2
2
  <div
3
3
  id="wxqrcode"
4
+ ref="wxqrcode"
4
5
  class="es-wx-qrcode"
5
- :style="{ width: width, height: height }"
6
+ :style="{ width: mwidth, height: mheight }"
6
7
  >
7
8
  <iframe
8
- v-if="src"
9
+ v-if="src && mwidth && mheight"
9
10
  frameborder="0"
10
11
  allowTransparency="true"
11
12
  scrolling="no"
12
- :width="width"
13
- :height="height"
13
+ :width="mwidth"
14
+ :height="mheight"
14
15
  :src="src"
15
16
  ></iframe>
16
17
  </div>
@@ -28,7 +29,7 @@ export default {
28
29
  default: false
29
30
  },
30
31
  appid: {
31
- required: true,
32
+ //required: true,
32
33
  type: String
33
34
  },
34
35
  scope: {
@@ -36,20 +37,20 @@ export default {
36
37
  type: [String, Array]
37
38
  },
38
39
  redirect_uri: {
39
- required: true,
40
+ //required: true,
40
41
  type: String
41
42
  },
42
43
  state: String,
43
44
  color: {
44
45
  type: String,
45
- validator: value => {
46
+ validator: (value) => {
46
47
  return ['black', 'white'].includes(value);
47
48
  }
48
49
  },
49
50
  href: String,
50
51
  lang: {
51
52
  type: String,
52
- validator: value => {
53
+ validator: (value) => {
53
54
  return ['en', 'cn'].includes(value);
54
55
  }
55
56
  },
@@ -59,8 +60,9 @@ export default {
59
60
  },
60
61
  height: {
61
62
  type: String,
62
- default: '400px'
63
+ default: '300px'
63
64
  },
65
+ auto: Boolean,
64
66
  param: {
65
67
  type: Object,
66
68
  default() {
@@ -70,15 +72,31 @@ export default {
70
72
  },
71
73
  data() {
72
74
  return {
73
- src: ''
75
+ src: '',
76
+ mwidth: 0,
77
+ mheight: 0
74
78
  };
75
79
  },
76
80
  computed: {},
77
81
  watch: {},
78
- created() {
82
+ created() {},
83
+ mounted() {
84
+ if (this.auto) {
85
+ let parent = this.$refs.wxqrcode.parentNode;
86
+ let h =
87
+ parent.offsetHeight -
88
+ parseInt(util.getStyle(parent, 'padding-top'), 10) -
89
+ parseInt(util.getStyle(parent, 'padding-bottom'), 10);
90
+ if (h > 0) {
91
+ this.mwidth = h + 'px';
92
+ this.mheight = h + 'px';
93
+ }
94
+ } else {
95
+ this.mwidth = this.width;
96
+ this.mheight = this.height;
97
+ }
79
98
  this.wxLogin();
80
99
  },
81
- mounted() {},
82
100
  methods: {
83
101
  wxLogin() {
84
102
  let option = util.extend(
package/src/index.js CHANGED
@@ -121,7 +121,7 @@ if (typeof window !== 'undefined' && window.Vue) {
121
121
  }
122
122
 
123
123
  export default {
124
- version: '0.5.74',
124
+ version: '0.5.76',
125
125
  install,
126
126
  Button,
127
127
  ButtonGroup,
package/src/utils/util.js CHANGED
@@ -555,6 +555,35 @@ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
555
555
  return workdays;
556
556
  };
557
557
 
558
+ /**
559
+ * chunkToChinese
560
+ * @desc 将四位数的整数转换为中文大写
561
+ * @param {number} chunk - 数字
562
+ **/
563
+ function chunkToChinese(chunk) {
564
+ const numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
565
+ const capitalDigits = ['', '拾', '佰', '仟'];
566
+
567
+ let result = '';
568
+ let digitIndex = 0;
569
+
570
+ while (chunk > 0) {
571
+ const digit = chunk % 10;
572
+ if (digit > 0) {
573
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
574
+ } else {
575
+ // 当前数字是零,需要判断是否需要添加零
576
+ if (result.charAt(0) !== '零') {
577
+ result = '零' + result;
578
+ }
579
+ }
580
+ chunk = Math.floor(chunk / 10);
581
+ digitIndex++;
582
+ }
583
+
584
+ return result;
585
+ }
586
+
558
587
  /**
559
588
  * concatenate
560
589
  * @desc 指定连接符合并文本
@@ -1753,6 +1782,34 @@ const getWeekday = function (date, type = 0) {
1753
1782
  return adjustedDay === 0 ? 7 : adjustedDay;
1754
1783
  };
1755
1784
 
1785
+ /**
1786
+ * getZoom
1787
+ * @desc 获取缩放比
1788
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1789
+ **/
1790
+ const getZoom = function () {
1791
+ let ratio = 0;
1792
+ let screen = window.screen;
1793
+ let ua = navigator.userAgent.toLowerCase();
1794
+ if (window.devicePixelRatio !== undefined) {
1795
+ ratio = window.devicePixelRatio;
1796
+ } else if (~ua.indexOf('msie')) {
1797
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1798
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1799
+ }
1800
+ } else if (
1801
+ window.outerWidth !== undefined &&
1802
+ window.innerWidth !== undefined
1803
+ ) {
1804
+ ratio = window.outerWidth / window.innerWidth;
1805
+ }
1806
+
1807
+ if (ratio) {
1808
+ ratio = Math.round(ratio * 100);
1809
+ }
1810
+
1811
+ return ratio / 100;
1812
+ };
1756
1813
  /**
1757
1814
  * handlerUrl
1758
1815
  * @desc:更新url参数中的时间戳
@@ -2226,6 +2283,31 @@ const isObject = function (obj) {
2226
2283
  );
2227
2284
  };
2228
2285
 
2286
+ /**
2287
+ * isObjectEqual
2288
+ * @desc:判断对象是否相等
2289
+ * @author huangbo
2290
+ * @date 2022年5月7日
2291
+ * @param {Object} [obj] - 对象
2292
+ * @param {Object} [_obj] - 对象
2293
+ **/
2294
+ const isObjectEqual = function (obj, _obj) {
2295
+ if ((obj === undefined && _obj) || (obj && _obj === undefined)) {
2296
+ return false;
2297
+ }
2298
+ var aProps = Object.getOwnPropertyNames(obj);
2299
+ var bProps = Object.getOwnPropertyNames(_obj);
2300
+ if (aProps.length !== bProps.length) {
2301
+ return false;
2302
+ }
2303
+ for (let i in obj) {
2304
+ if (obj[i] !== _obj[i]) {
2305
+ return false;
2306
+ }
2307
+ }
2308
+ return true;
2309
+ };
2310
+
2229
2311
  /**
2230
2312
  * jointUrl
2231
2313
  * @desc:判断url地址是否以字符开头,没有则添加
@@ -2525,32 +2607,63 @@ const rmbToCapital = function (number) {
2525
2607
 
2526
2608
  return result;
2527
2609
  };
2528
-
2529
- // 辅助函数,将四位数的整数转换为中文大写
2530
- function chunkToChinese(chunk) {
2531
- const numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2532
- const capitalDigits = ['', '拾', '佰', '仟'];
2533
-
2534
- let result = '';
2535
- let digitIndex = 0;
2536
-
2537
- while (chunk > 0) {
2538
- const digit = chunk % 10;
2539
- if (digit > 0) {
2540
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2610
+ /**
2611
+ * setScale
2612
+ * @desc 设置缩放
2613
+ * @param {number} width - 分辨率宽度
2614
+ * @param {number} height - 分辨率高度
2615
+ **/
2616
+ const setScale = function (width = 1920, height = 1080) {
2617
+ let n = 1;
2618
+ let isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2619
+ let zoom = getZoom();
2620
+ if (isMac) {
2621
+ n = 2;
2622
+ } else {
2623
+ n = 1;
2624
+ }
2625
+ if (zoom === 1) {
2626
+ document.body.style.removeProperty('transform');
2627
+ document.body.style.removeProperty('width');
2628
+ document.body.style.removeProperty('height');
2629
+ document.body.style.removeProperty('transform-origin');
2630
+ return;
2631
+ }
2632
+ if (
2633
+ Math.abs(parseInt(width - (window.innerWidth * zoom) / n, 10)) >
2634
+ 15 &&
2635
+ (window.innerWidth * zoom) / n !== width
2636
+ ) {
2637
+ let scale =
2638
+ 'scale(' +
2639
+ (window.innerWidth * zoom) / width / zoom +
2640
+ ',' +
2641
+ (window.innerHeight * zoom) / height / zoom +
2642
+ ')';
2643
+ document.body.style.transform = scale;
2644
+ document.body.style.width = width + 'px';
2645
+ document.body.style.height = height + 'px';
2646
+ document.body.style.transformOrigin = '0 0';
2647
+ } else {
2648
+ if (isMac) {
2649
+ let scale = 'scale(' + (1 * n) / zoom + ')';
2650
+ document.body.style.transform = scale;
2651
+ document.body.style.width =
2652
+ parseInt((window.innerWidth * zoom) / n, 10) + 'px';
2653
+ document.body.style.height =
2654
+ parseInt((window.innerHeight * zoom) / n, 10) + 'px';
2655
+ document.body.style.transformOrigin = '0 0';
2541
2656
  } else {
2542
- // 当前数字是零,需要判断是否需要添加零
2543
- if (result.charAt(0) !== '零') {
2544
- result = '零' + result;
2545
- }
2657
+ let scale = 'scale(' + (1 * n) / zoom + ')';
2658
+ document.body.style.transform = scale;
2659
+ document.body.style.width =
2660
+ parseInt((window.innerWidth * zoom) / n, 10) + 'px';
2661
+ document.body.style.height =
2662
+ parseInt((window.innerHeight * zoom) / n, 10) + 'px';
2663
+ document.body.style.transformOrigin = '0 0';
2546
2664
  }
2547
- chunk = Math.floor(chunk / 10);
2548
- digitIndex++;
2549
2665
  }
2550
-
2551
- return result;
2552
- }
2553
-
2666
+ };
2554
2667
  /**
2555
2668
  * sendMessage
2556
2669
  * @desc:向iframe发送信息
@@ -3049,6 +3162,7 @@ export default {
3049
3162
  isLogged,
3050
3163
  isLogined,
3051
3164
  isObject,
3165
+ isObjectEqual,
3052
3166
  jointUrl,
3053
3167
  loadJs,
3054
3168
  loading,
@@ -3063,6 +3177,7 @@ export default {
3063
3177
  rmbToCapital,
3064
3178
  sendMessage,
3065
3179
  setFavicon,
3180
+ setScale,
3066
3181
  setStorage,
3067
3182
  socket,
3068
3183
  startWith,