eoss-ui 0.4.90 → 0.4.92

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.
package/lib/utils/util.js CHANGED
@@ -364,11 +364,11 @@ var ajax = function ajax(_ref) {
364
364
  }
365
365
  if (method === 'post' && format) {
366
366
  data = _qs2.default.stringify(data);
367
- if (!header['content-type']) {
367
+ if (!header['content-type'] && !header['Content-Type']) {
368
368
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
369
369
  }
370
370
  } else {
371
- if (!header['content-type']) {
371
+ if (!header['content-type'] && !header['Content-Type']) {
372
372
  header['content-type'] = 'application/json;charset=UTF-8';
373
373
  }
374
374
  }
package/lib/wujie.js CHANGED
@@ -449,11 +449,11 @@ var ajax = function ajax(_ref) {
449
449
  }
450
450
  if (method === 'post' && format) {
451
451
  data = qs__WEBPACK_IMPORTED_MODULE_2___default.a.stringify(data);
452
- if (!header['content-type']) {
452
+ if (!header['content-type'] && !header['Content-Type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
455
  } else {
456
- if (!header['content-type']) {
456
+ if (!header['content-type'] && !header['Content-Type']) {
457
457
  header['content-type'] = 'application/json;charset=UTF-8';
458
458
  }
459
459
  }
package/lib/wxlogin.js CHANGED
@@ -449,11 +449,11 @@ var ajax = function ajax(_ref) {
449
449
  }
450
450
  if (method === 'post' && format) {
451
451
  data = qs__WEBPACK_IMPORTED_MODULE_2___default.a.stringify(data);
452
- if (!header['content-type']) {
452
+ if (!header['content-type'] && !header['Content-Type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
455
  } else {
456
- if (!header['content-type']) {
456
+ if (!header['content-type'] && !header['Content-Type']) {
457
457
  header['content-type'] = 'application/json;charset=UTF-8';
458
458
  }
459
459
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.4.90",
3
+ "version": "0.4.92",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -95,7 +95,7 @@
95
95
  "cp-cli": "^1.0.2",
96
96
  "cross-env": "^3.1.3",
97
97
  "css-loader": "^2.1.0",
98
- "eoss-element": "^0.2.71",
98
+ "eoss-element": "^0.2.73",
99
99
  "es6-promise": "^4.0.5",
100
100
  "eslint": "4.18.2",
101
101
  "eslint-config-elemefe": "0.1.1",
@@ -740,6 +740,17 @@ export default {
740
740
  this.navIds = ids;
741
741
  this.setTitle(ids[0]);
742
742
  }
743
+ } else if (sessionStorage.getItem('jump') && this.history) {
744
+ let ids = this.getId(
745
+ this.menus,
746
+ sessionStorage.getItem('jump'),
747
+ true
748
+ );
749
+ if (ids) {
750
+ this.defaultActive = ids;
751
+ this.navIds = ids;
752
+ this.setTitle(ids[0]);
753
+ }
743
754
  } else if (util.win.location.hash) {
744
755
  let hash = util.win.location.hash;
745
756
  if (hash) {
@@ -764,17 +775,6 @@ export default {
764
775
  this.setTitle(ids[0]);
765
776
  }
766
777
  }
767
- } else if (sessionStorage.getItem('jump') && this.history) {
768
- let ids = this.getId(
769
- this.menus,
770
- sessionStorage.getItem('jump'),
771
- true
772
- );
773
- if (ids) {
774
- this.defaultActive = ids;
775
- this.navIds = ids;
776
- this.setTitle(ids[0]);
777
- }
778
778
  }
779
779
  this.setMenu(this.menus);
780
780
  }
@@ -1027,6 +1027,17 @@ export default {
1027
1027
  if (ids) {
1028
1028
  this.defaultActive = ids;
1029
1029
  }
1030
+ } else if (sessionStorage.getItem('jump') && this.history) {
1031
+ let ids = this.getId(
1032
+ this.menus,
1033
+ sessionStorage.getItem('jump'),
1034
+ true
1035
+ );
1036
+ if (ids) {
1037
+ this.defaultActive = ids;
1038
+ this.navIds = ids;
1039
+ this.setTitle(ids[0]);
1040
+ }
1030
1041
  } else if (util.win.location.hash) {
1031
1042
  let hash = util.win.location.hash;
1032
1043
  if (hash) {
@@ -1055,17 +1066,6 @@ export default {
1055
1066
  this.setTitle(ids[0]);
1056
1067
  }
1057
1068
  }
1058
- } else if (sessionStorage.getItem('jump') && this.history) {
1059
- let ids = this.getId(
1060
- this.menus,
1061
- sessionStorage.getItem('jump'),
1062
- true
1063
- );
1064
- if (ids) {
1065
- this.defaultActive = ids;
1066
- this.navIds = ids;
1067
- this.setTitle(ids[0]);
1068
- }
1069
1069
  }
1070
1070
  this.setTips(this.menus);
1071
1071
  store.set('nav', this.menus);
@@ -175,10 +175,6 @@ export default {
175
175
  type: String,
176
176
  default: getOrgMainTree
177
177
  },
178
- currentFirstNode: {
179
- type: Boolean,
180
- default: false
181
- },
182
178
  system: {
183
179
  type: Boolean,
184
180
  default: false
@@ -405,6 +401,7 @@ export default {
405
401
  if (this.currentFirst) {
406
402
  let currentNode = treeList[0].id;
407
403
  if (!this.currentNodeKey && this.currentNodeKey != 0) {
404
+ this.$emit('current-first', 'current', treeList[0]);
408
405
  this.$nextTick(() => {
409
406
  this.$refs.oaTree.setCurrentKey(currentNode);
410
407
  });
@@ -416,6 +413,7 @@ export default {
416
413
  this.defaultCheckedKeys &&
417
414
  this.defaultCheckedKeys.indexOf(checkedNode) == -1
418
415
  ) {
416
+ this.$emit('current-first', 'checked', treeList[0]);
419
417
  this.checkedKeys = [checkedNode];
420
418
  }
421
419
  }
@@ -23,9 +23,31 @@
23
23
  <es-tree
24
24
  v-bind="item.tree"
25
25
  :ref="item.ref ? item.ref : 'groupTree' + index"
26
- @node-click="handleNodeClick"
27
- @check-change="handleCheckChange"
28
- @current-first="handleCurrentFirst"
26
+ @node-click="
27
+ (data, node) => {
28
+ handleNodeClick(data, node, item);
29
+ }
30
+ "
31
+ @check-change="
32
+ () => {
33
+ handleCheckChange(...arguments, item);
34
+ }
35
+ "
36
+ @results="
37
+ (res) => {
38
+ handleResults(res, item);
39
+ }
40
+ "
41
+ @sub-results="
42
+ (res) => {
43
+ handleSubResults(res, item);
44
+ }
45
+ "
46
+ @current-first="
47
+ (type, res) => {
48
+ handleCurrentFirst(type, res, item);
49
+ }
50
+ "
29
51
  v-on="item.tree && item.tree.events ? item.tree.events : {}"
30
52
  >
31
53
  <template v-if="item.enterprise" slot="filtrate">
@@ -51,6 +73,7 @@
51
73
  @check-change="handleCheckChange"
52
74
  @results="handleResults"
53
75
  @sub-results="handleSubResults"
76
+ @current-first="handleCurrentFirst"
54
77
  v-on="tree.events ? tree.events : {}"
55
78
  >
56
79
  <template v-if="enterprise" slot="filtrate">
@@ -413,14 +436,14 @@ export default {
413
436
  handleSelect() {
414
437
  this.$emit('tab-click', this.tabs[parseInt(this.active, 10)]);
415
438
  },
416
- handleNodeClick(data, node) {
439
+ handleNodeClick(data, node, tabs) {
417
440
  if (this.clickedAsSearch) {
418
441
  this.checkeds = data;
419
442
  }
420
443
  if (this.onNodeClick) {
421
- this.onNodeClick(this, data, node);
444
+ this.onNodeClick(this, data, node, tabs);
422
445
  } else {
423
- this.$emit('node-click', this, data, node);
446
+ this.$emit('node-click', this, data, node, tabs);
424
447
  }
425
448
  },
426
449
  handleCheckChange() {
@@ -447,7 +470,7 @@ export default {
447
470
  this.checkeds = res;
448
471
  this.$emit('enterprise-confirm', res);
449
472
  },
450
- handleResults(res) {
473
+ handleResults(res, tabs) {
451
474
  if (
452
475
  (this.tree.showCheckbox &&
453
476
  this.tree.checkedFirst &&
@@ -456,10 +479,10 @@ export default {
456
479
  ) {
457
480
  this.checkeds = res[0];
458
481
  }
459
- this.$emit('results', res);
482
+ this.$emit('results', res, tabs);
460
483
  },
461
- handleSubResults(res) {
462
- this.$emit('sub-results', res);
484
+ handleSubResults(res, tabs) {
485
+ this.$emit('sub-results', res, tabs);
463
486
  },
464
487
  setCurrentKey(keys, leafOnly) {
465
488
  let ref =
@@ -480,6 +503,9 @@ export default {
480
503
  : 'groupTree' + this.active
481
504
  : 'groupTree';
482
505
  return this.$refs[ref];
506
+ },
507
+ handleCurrentFirst(type, res, tabs) {
508
+ this.$emit('current-first', type, res, tabs);
483
509
  }
484
510
  }
485
511
  };
package/src/index.js CHANGED
@@ -117,7 +117,7 @@ if (typeof window !== 'undefined' && window.Vue) {
117
117
  }
118
118
 
119
119
  export default {
120
- version: '0.4.90',
120
+ version: '0.4.92',
121
121
  install,
122
122
  Button,
123
123
  ButtonGroup,
package/src/utils/util.js CHANGED
@@ -393,11 +393,11 @@ const ajax = function ({
393
393
  }
394
394
  if (method === 'post' && format) {
395
395
  data = qs.stringify(data);
396
- if (!header['content-type']) {
396
+ if (!header['content-type'] && !header['Content-Type']) {
397
397
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
398
398
  }
399
399
  } else {
400
- if (!header['content-type']) {
400
+ if (!header['content-type'] && !header['Content-Type']) {
401
401
  header['content-type'] = 'application/json;charset=UTF-8';
402
402
  }
403
403
  }