eoss-ui 0.4.64 → 0.4.66

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 (56) hide show
  1. package/lib/button-group.js +33 -18
  2. package/lib/button.js +35 -20
  3. package/lib/checkbox-group.js +33 -18
  4. package/lib/data-table-form.js +33 -18
  5. package/lib/data-table.js +33 -18
  6. package/lib/date-picker.js +33 -18
  7. package/lib/dialog.js +36 -21
  8. package/lib/eoss-ui.common.js +7036 -6505
  9. package/lib/flow-group.js +33 -18
  10. package/lib/flow-list.js +33 -18
  11. package/lib/flow.js +38 -22
  12. package/lib/form.js +8659 -8284
  13. package/lib/handle-user.js +33 -18
  14. package/lib/handler.js +33 -18
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +33 -18
  17. package/lib/input.js +53 -25
  18. package/lib/login.js +38 -25
  19. package/lib/main.js +95 -70
  20. package/lib/nav.js +36 -21
  21. package/lib/page.js +33 -18
  22. package/lib/player.js +33 -18
  23. package/lib/qr-code.js +33 -18
  24. package/lib/radio-group.js +33 -18
  25. package/lib/retrial-auth.js +33 -18
  26. package/lib/select-ganged.js +33 -18
  27. package/lib/select.js +35 -19
  28. package/lib/selector-panel.js +33 -18
  29. package/lib/selector.js +33 -18
  30. package/lib/sizer.js +33 -18
  31. package/lib/steps.js +33 -18
  32. package/lib/switch.js +33 -18
  33. package/lib/table-form.js +1336 -1214
  34. package/lib/tabs.js +33 -18
  35. package/lib/tips.js +33 -18
  36. package/lib/tree-group.js +36 -21
  37. package/lib/tree.js +33 -18
  38. package/lib/upload.js +384 -343
  39. package/lib/utils/util.js +33 -18
  40. package/lib/wujie.js +33 -18
  41. package/lib/wxlogin.js +33 -18
  42. package/package.json +2 -2
  43. package/packages/button/src/main.vue +2 -2
  44. package/packages/dialog/src/main.vue +1 -1
  45. package/packages/flow/src/main.vue +6 -5
  46. package/packages/form/src/main.vue +1435 -1314
  47. package/packages/form/src/table.vue +375 -318
  48. package/packages/input/src/main.vue +20 -7
  49. package/packages/login/src/main.vue +3 -5
  50. package/packages/main/src/main.vue +61 -54
  51. package/packages/nav/src/main.vue +1 -1
  52. package/packages/select/src/main.vue +2 -1
  53. package/packages/tree-group/src/main.vue +1 -1
  54. package/packages/upload/src/main.vue +10 -1
  55. package/src/index.js +1 -1
  56. package/src/utils/util.js +33 -19
package/lib/main.js CHANGED
@@ -2086,19 +2086,16 @@ var startWith = function startWith(value, reg) {
2086
2086
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2087
2087
 
2088
2088
  if (Array.isArray(reg)) {
2089
- var flag = true;
2090
- for (var i = 0; i < reg.length; i++) {
2091
- var item = reg[i];
2092
- if (new RegExp('^' + item).test(value)) {
2093
- if (or) {
2094
- flag = true;
2095
- return true;
2096
- }
2097
- } else {
2098
- flag = false;
2099
- }
2089
+ if (!reg.length) {
2090
+ return true;
2100
2091
  }
2101
- return flag;
2092
+ var regs = reg.map(function (item) {
2093
+ return new RegExp('^' + item).test(value);
2094
+ });
2095
+ if (or) {
2096
+ return regs.indexOf(true) > -1;
2097
+ }
2098
+ return regs.indexOf(false) === -1;
2102
2099
  }
2103
2100
  if (new RegExp('^' + reg).test(value)) {
2104
2101
  return true;
@@ -2277,14 +2274,18 @@ var uuid = function uuid(len) {
2277
2274
  **/
2278
2275
  var watermark = function watermark(option) {
2279
2276
  // 默认设置
2277
+ var _width = parseInt(option.width || 480, 10);
2278
+ var _height = parseInt(option.width || 180, 10);
2279
+ var _rows = Math.round(document.body.clientHeight / _height);
2280
+ var _cols = Math.round(document.body.clientWidth / _width);
2280
2281
  var config = {
2281
- rows: 5, // 水印行数
2282
- cols: 5,
2282
+ rows: _rows, // 水印行数
2283
+ cols: _cols,
2283
2284
  html: '水印示例', // 水印文本内容
2284
2285
  angle: -15, // 旋转角度
2285
2286
  color: '#000', // 水印文字颜色
2286
- width: 100, // 水印宽度
2287
- height: 20, // 水印高度
2287
+ minWidth: _width, // 水印最小宽度
2288
+ height: _height, // 水印高度
2288
2289
  lineHeight: 20, // 水印行高
2289
2290
  opacity: 0.1, // 水印透明度
2290
2291
  fontSize: 14, // 水印文字字体大小
@@ -2294,7 +2295,13 @@ var watermark = function watermark(option) {
2294
2295
  zIndex: 999999 // 水印文字的层级
2295
2296
  };
2296
2297
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2297
- var wrap = document.createElement('div');
2298
+ var wrap = document.getElementById('watermark');
2299
+ if (!wrap) {
2300
+ wrap = document.createElement('div');
2301
+ wrap.id = 'watermark';
2302
+ } else {
2303
+ wrap.innerHTML = '';
2304
+ }
2298
2305
  // 禁止选择和复制
2299
2306
  wrap.onselectstart = wrap.oncontextmenu = function () {
2300
2307
  return false;
@@ -2305,6 +2312,7 @@ var watermark = function watermark(option) {
2305
2312
  html = options.html,
2306
2313
  angle = options.angle,
2307
2314
  color = options.color,
2315
+ minWidth = options.minWidth,
2308
2316
  height = options.height,
2309
2317
  lineHeight = options.lineHeight,
2310
2318
  opacity = options.opacity,
@@ -2320,11 +2328,18 @@ var watermark = function watermark(option) {
2320
2328
  for (var i = 0; i < num; i++) {
2321
2329
  var item = document.createElement('div');
2322
2330
  item.innerHTML = html;
2323
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2331
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2324
2332
  docFrag.appendChild(item);
2325
2333
  }
2326
2334
  wrap.appendChild(docFrag);
2327
2335
  document.body.appendChild(wrap);
2336
+ var _timeout = void 0;
2337
+ window.onresize = function () {
2338
+ clearTimeout(_timeout);
2339
+ _timeout = setTimeout(function () {
2340
+ watermark(options);
2341
+ }, 1000);
2342
+ };
2328
2343
  };
2329
2344
 
2330
2345
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2936,7 +2951,7 @@ module.exports = require("stompjs");
2936
2951
  // ESM COMPAT FLAG
2937
2952
  __webpack_require__.r(__webpack_exports__);
2938
2953
 
2939
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=1686d4f2&
2954
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=9f517a06&
2940
2955
  var render = function () {
2941
2956
  var _vm = this
2942
2957
  var _h = _vm.$createElement
@@ -3362,7 +3377,7 @@ var staticRenderFns = []
3362
3377
  render._withStripped = true
3363
3378
 
3364
3379
 
3365
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=1686d4f2&
3380
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=9f517a06&
3366
3381
 
3367
3382
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/userinfo.vue?vue&type=template&id=c2c69d4a&
3368
3383
  var userinfovue_type_template_id_c2c69d4a_render = function () {
@@ -5869,13 +5884,16 @@ var log = util["a" /* default */].getParams('console');
5869
5884
  }
5870
5885
  },
5871
5886
  setTitle: function setTitle(id) {
5887
+ var node = void 0;
5872
5888
  for (var i = 0; i < this.menus.length; i++) {
5873
5889
  var item = this.menus[i];
5874
5890
  if (item.id == id) {
5875
5891
  this.title = item.text;
5876
- return item;
5892
+ node = item;
5893
+ break;
5877
5894
  }
5878
5895
  }
5896
+ return node;
5879
5897
  },
5880
5898
  renderMenu: function renderMenu() {
5881
5899
  if (this.data !== undefined && this.data.length) {
@@ -6011,6 +6029,7 @@ var log = util["a" /* default */].getParams('console');
6011
6029
  this.color = unescape(results[i].color).toLowerCase();
6012
6030
  }
6013
6031
  if (i === 'subsystemExtend' && results[i].webPageWatermark) {
6032
+ util["a" /* default */].win.top.webPageWatermark = results[i].webPageWatermark;
6014
6033
  util["a" /* default */].watermark(results[i].webPageWatermark);
6015
6034
  }
6016
6035
  store["a" /* default */].set(i, results[i]);
@@ -6344,6 +6363,7 @@ var log = util["a" /* default */].getParams('console');
6344
6363
 
6345
6364
  //设置默认导航页面
6346
6365
  setDefault: function setDefault(res, active) {
6366
+ this.navIds = JSON.parse(JSON.stringify(active));
6347
6367
  this.sysId = '';
6348
6368
  this.tabsId = '';
6349
6369
  this.active = '';
@@ -6441,14 +6461,9 @@ var log = util["a" /* default */].getParams('console');
6441
6461
 
6442
6462
  //应用导航交互
6443
6463
  handleSelect: function handleSelect(res, type, open) {
6444
- console.log(type, 11);
6445
6464
  var node = res.node,
6446
6465
  fourthTabs = res.fourthTabs;
6447
6466
 
6448
- var openIdex = 0;
6449
- if (node.extendData && (node.extendData.subDefOpenIndex || node.extendData.subDefOpen)) {
6450
- openIdex = parseInt(node.extendData.subDefOpenIndex || node.extendData.subDefOpen, 10);
6451
- }
6452
6467
  if (!open) {
6453
6468
  if (node.extendData && node.extendData.businessStatus == 0 && node.extendData.businessWarnMsg) {
6454
6469
  this.$alert(node.extendData.businessWarnMsg, '提示', {
@@ -6468,7 +6483,7 @@ var log = util["a" /* default */].getParams('console');
6468
6483
  this.menu = node.children;
6469
6484
  this.title = node.text;
6470
6485
  if (this.setFirstAsDefault) {
6471
- var subNode = this.getFirst(node.children[openIdex]);
6486
+ var subNode = this.getFirst(node);
6472
6487
  if (subNode) {
6473
6488
  this.active = subNode.id;
6474
6489
  this.navIds = [node.id].concat(this.getId(node.children, subNode.url, true));
@@ -6487,7 +6502,11 @@ var log = util["a" /* default */].getParams('console');
6487
6502
  this.menu = node.children;
6488
6503
  this.title = node.text;
6489
6504
  if (this.setFirstAsDefault) {
6490
- this.active = this.getFirst(node.children[openIdex]).id;
6505
+ var _subNode = this.getFirst(node);
6506
+ if (_subNode) {
6507
+ this.active = _subNode.id;
6508
+ this.navIds = [node.id].concat(this.getId(node.children, _subNode.url, true));
6509
+ }
6491
6510
  }
6492
6511
  this.isSide = true;
6493
6512
  }
@@ -6498,55 +6517,66 @@ var log = util["a" /* default */].getParams('console');
6498
6517
  this.tabs = [];
6499
6518
  }
6500
6519
  if (this.setFirstAsDefault) {
6501
- var _subNode = this.getFirst(node);
6520
+ var _subNode2 = this.getFirst(node);
6502
6521
  this.active = [node.id];
6503
- if (_subNode && node.id !== _subNode.id) {
6504
- this.navIds = this.getId(this.menus, _subNode.url, true);
6505
- this.$set(this.active, 1, _subNode.id);
6522
+ if (_subNode2 && node.id !== _subNode2.id) {
6523
+ this.navIds = this.getId(this.menus, _subNode2.url, true);
6524
+ this.$set(this.active, 1, _subNode2.id);
6506
6525
  }
6507
6526
  }
6508
6527
  break;
6509
6528
  case 'menu':
6510
6529
  if (!open) {
6511
6530
  this.tabs = [];
6512
- if (this.setFirstAsDefault) {
6513
- if (this.biserial) {
6514
- this.$set(this.active, 1, node.id);
6515
- } else {
6516
- this.active = node.id;
6517
- }
6531
+ if (this.biserial) {
6532
+ this.$set(this.active, 1, node.id);
6533
+ } else {
6534
+ this.active = node.id;
6518
6535
  }
6519
- }
6520
- if (node.url) {
6521
- if (node.children && node.children.length) {
6522
- var tab = node.children.filter(function (item) {
6523
- return item.url === node.url;
6524
- })[0];
6525
- if (tab) {
6526
- if (this.biserial) {
6527
- this.$set(this.active, 1, tab.id);
6536
+ if (node.url) {
6537
+ if (node.children && node.children.length) {
6538
+ var tab = node.children.filter(function (item) {
6539
+ return item.url === node.url;
6540
+ })[0];
6541
+ if (tab) {
6542
+ if (this.biserial) {
6543
+ this.$set(this.active, 1, tab.id);
6544
+ } else {
6545
+ this.active = tab.id;
6546
+ }
6547
+ this.navIds = this.getId(this.menus, tab.url, true);
6548
+ }
6549
+ } else {
6550
+ var _tab = (node.fourthTabs || []).filter(function (item) {
6551
+ return item.url === node.url;
6552
+ })[0];
6553
+ if (_tab) {
6554
+ this.tabs = node.fourthTabs;
6555
+ this.tabsId = _tab.id;
6556
+ this.navIds = this.getId(this.menus, _tab.url, true);
6528
6557
  } else {
6529
- this.active = tab.id;
6558
+ this.navIds = this.getId(this.menus, node.url, true);
6530
6559
  }
6531
- this.navIds = this.getId(this.menus, tab.url, true);
6532
6560
  }
6533
6561
  } else {
6534
- var _tab = (node.fourthTabs || []).filter(function (item) {
6535
- return item.url === node.url;
6536
- })[0];
6537
- if (_tab) {
6562
+ if (node.fourthTabs.length) {
6538
6563
  this.tabs = node.fourthTabs;
6539
- this.tabsId = _tab.id;
6540
- this.navIds = this.getId(this.menus, _tab.url, true);
6564
+ this.tabsId = this.tabs[0].id;
6565
+ this.handleJump(this.tabs[0].url, this.tabs[0].urlopenmode, this.tabs[0]);
6566
+ this.navIds = this.getId(this.menus, this.tabs[0].url, true);
6567
+ }
6568
+ }
6569
+ } else if (this.setFirstAsDefault) {
6570
+ this.tabs = [];
6571
+ var _subNode3 = this.getFirst(node);
6572
+ if (_subNode3) {
6573
+ if (this.biserial) {
6574
+ this.$set(this.active, 1, _subNode3.id);
6541
6575
  } else {
6542
- this.navIds = this.getId(this.menus, node.url, true);
6576
+ this.active = _subNode3.id;
6543
6577
  }
6578
+ this.navIds = this.getId(this.menus, _subNode3.url, true);
6544
6579
  }
6545
- } else if (node.fourthTabs.length) {
6546
- this.tabs = node.fourthTabs;
6547
- this.tabsId = this.tabs[0].id;
6548
- this.handleJump(this.tabs[0].url, this.tabs[0].urlopenmode, this.tabs[0]);
6549
- this.navIds = this.getId(this.menus, this.tabs[0].url, true);
6550
6580
  }
6551
6581
  break;
6552
6582
  case 'tabs':
@@ -6765,17 +6795,12 @@ var log = util["a" /* default */].getParams('console');
6765
6795
  }
6766
6796
  }
6767
6797
  } else {
6768
- if (menus.fourthTabs && menus.fourthTabs.length) {
6769
- for (var _i = 0; _i < menus.fourthTabs.length; _i++) {
6770
- var item = menus.fourthTabs[_i];
6771
- if (item.id === id) {
6772
- return item;
6773
- }
6774
- }
6798
+ if (menus.fourthTabs && menus.fourthTabs.length && menus.id === id) {
6799
+ return menus;
6775
6800
  }
6776
6801
  if (menus.children && menus.children.length) {
6777
- for (var _i2 = 0; _i2 < menus.children.length; _i2++) {
6778
- var _fourth = this.getFourthTabs(menus.children[_i2], id);
6802
+ for (var _i = 0; _i < menus.children.length; _i++) {
6803
+ var _fourth = this.getFourthTabs(menus.children[_i], id);
6779
6804
  if (_fourth) {
6780
6805
  return _fourth;
6781
6806
  }
package/lib/nav.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
2278
2275
  **/
2279
2276
  var watermark = function watermark(option) {
2280
2277
  // 默认设置
2278
+ var _width = parseInt(option.width || 480, 10);
2279
+ var _height = parseInt(option.width || 180, 10);
2280
+ var _rows = Math.round(document.body.clientHeight / _height);
2281
+ var _cols = Math.round(document.body.clientWidth / _width);
2281
2282
  var config = {
2282
- rows: 5, // 水印行数
2283
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2284
2285
  html: '水印示例', // 水印文本内容
2285
2286
  angle: -15, // 旋转角度
2286
2287
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2289
2290
  lineHeight: 20, // 水印行高
2290
2291
  opacity: 0.1, // 水印透明度
2291
2292
  fontSize: 14, // 水印文字字体大小
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
2295
2296
  zIndex: 999999 // 水印文字的层级
2296
2297
  };
2297
2298
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2299
+ var wrap = document.getElementById('watermark');
2300
+ if (!wrap) {
2301
+ wrap = document.createElement('div');
2302
+ wrap.id = 'watermark';
2303
+ } else {
2304
+ wrap.innerHTML = '';
2305
+ }
2299
2306
  // 禁止选择和复制
2300
2307
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2308
  return false;
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
2306
2313
  html = options.html,
2307
2314
  angle = options.angle,
2308
2315
  color = options.color,
2316
+ minWidth = options.minWidth,
2309
2317
  height = options.height,
2310
2318
  lineHeight = options.lineHeight,
2311
2319
  opacity = options.opacity,
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
2321
2329
  for (var i = 0; i < num; i++) {
2322
2330
  var item = document.createElement('div');
2323
2331
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2332
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2333
  docFrag.appendChild(item);
2326
2334
  }
2327
2335
  wrap.appendChild(docFrag);
2328
2336
  document.body.appendChild(wrap);
2337
+ var _timeout = void 0;
2338
+ window.onresize = function () {
2339
+ clearTimeout(_timeout);
2340
+ _timeout = setTimeout(function () {
2341
+ watermark(options);
2342
+ }, 1000);
2343
+ };
2329
2344
  };
2330
2345
 
2331
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2857,7 +2872,7 @@ module.exports = require("qs");
2857
2872
  // ESM COMPAT FLAG
2858
2873
  __webpack_require__.r(__webpack_exports__);
2859
2874
 
2860
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/nav/src/main.vue?vue&type=template&id=fd9419ca&
2875
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/nav/src/main.vue?vue&type=template&id=57ae81a0&
2861
2876
  var render = function () {
2862
2877
  var _vm = this
2863
2878
  var _h = _vm.$createElement
@@ -3000,7 +3015,7 @@ var staticRenderFns = []
3000
3015
  render._withStripped = true
3001
3016
 
3002
3017
 
3003
- // CONCATENATED MODULE: ./packages/nav/src/main.vue?vue&type=template&id=fd9419ca&
3018
+ // CONCATENATED MODULE: ./packages/nav/src/main.vue?vue&type=template&id=57ae81a0&
3004
3019
 
3005
3020
  // EXTERNAL MODULE: ./src/utils/util.js
3006
3021
  var util = __webpack_require__(0);
@@ -3109,7 +3124,7 @@ var util = __webpack_require__(0);
3109
3124
  return active;
3110
3125
  },
3111
3126
  menuActive: function menuActive() {
3112
- var active = this.defaultActive === 'string' ? this.defaultActive : this.defaultActive.length ? this.defaultActive[this.defaultActive.length - 1] : undefined;
3127
+ var active = typeof this.defaultActive === 'string' ? this.defaultActive : this.defaultActive.length ? this.defaultActive[this.defaultActive.length - 1] : undefined;
3113
3128
  return active;
3114
3129
  },
3115
3130
  boxWidth: function boxWidth() {
package/lib/page.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
2278
2275
  **/
2279
2276
  var watermark = function watermark(option) {
2280
2277
  // 默认设置
2278
+ var _width = parseInt(option.width || 480, 10);
2279
+ var _height = parseInt(option.width || 180, 10);
2280
+ var _rows = Math.round(document.body.clientHeight / _height);
2281
+ var _cols = Math.round(document.body.clientWidth / _width);
2281
2282
  var config = {
2282
- rows: 5, // 水印行数
2283
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2284
2285
  html: '水印示例', // 水印文本内容
2285
2286
  angle: -15, // 旋转角度
2286
2287
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2289
2290
  lineHeight: 20, // 水印行高
2290
2291
  opacity: 0.1, // 水印透明度
2291
2292
  fontSize: 14, // 水印文字字体大小
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
2295
2296
  zIndex: 999999 // 水印文字的层级
2296
2297
  };
2297
2298
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2299
+ var wrap = document.getElementById('watermark');
2300
+ if (!wrap) {
2301
+ wrap = document.createElement('div');
2302
+ wrap.id = 'watermark';
2303
+ } else {
2304
+ wrap.innerHTML = '';
2305
+ }
2299
2306
  // 禁止选择和复制
2300
2307
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2308
  return false;
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
2306
2313
  html = options.html,
2307
2314
  angle = options.angle,
2308
2315
  color = options.color,
2316
+ minWidth = options.minWidth,
2309
2317
  height = options.height,
2310
2318
  lineHeight = options.lineHeight,
2311
2319
  opacity = options.opacity,
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
2321
2329
  for (var i = 0; i < num; i++) {
2322
2330
  var item = document.createElement('div');
2323
2331
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2332
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2333
  docFrag.appendChild(item);
2326
2334
  }
2327
2335
  wrap.appendChild(docFrag);
2328
2336
  document.body.appendChild(wrap);
2337
+ var _timeout = void 0;
2338
+ window.onresize = function () {
2339
+ clearTimeout(_timeout);
2340
+ _timeout = setTimeout(function () {
2341
+ watermark(options);
2342
+ }, 1000);
2343
+ };
2329
2344
  };
2330
2345
 
2331
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
package/lib/player.js CHANGED
@@ -2087,19 +2087,16 @@ var startWith = function startWith(value, reg) {
2087
2087
  var or = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2088
2088
 
2089
2089
  if (Array.isArray(reg)) {
2090
- var flag = true;
2091
- for (var i = 0; i < reg.length; i++) {
2092
- var item = reg[i];
2093
- if (new RegExp('^' + item).test(value)) {
2094
- if (or) {
2095
- flag = true;
2096
- return true;
2097
- }
2098
- } else {
2099
- flag = false;
2100
- }
2090
+ if (!reg.length) {
2091
+ return true;
2101
2092
  }
2102
- return flag;
2093
+ var regs = reg.map(function (item) {
2094
+ return new RegExp('^' + item).test(value);
2095
+ });
2096
+ if (or) {
2097
+ return regs.indexOf(true) > -1;
2098
+ }
2099
+ return regs.indexOf(false) === -1;
2103
2100
  }
2104
2101
  if (new RegExp('^' + reg).test(value)) {
2105
2102
  return true;
@@ -2278,14 +2275,18 @@ var uuid = function uuid(len) {
2278
2275
  **/
2279
2276
  var watermark = function watermark(option) {
2280
2277
  // 默认设置
2278
+ var _width = parseInt(option.width || 480, 10);
2279
+ var _height = parseInt(option.width || 180, 10);
2280
+ var _rows = Math.round(document.body.clientHeight / _height);
2281
+ var _cols = Math.round(document.body.clientWidth / _width);
2281
2282
  var config = {
2282
- rows: 5, // 水印行数
2283
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2284
2285
  html: '水印示例', // 水印文本内容
2285
2286
  angle: -15, // 旋转角度
2286
2287
  color: '#000', // 水印文字颜色
2287
- width: 100, // 水印宽度
2288
- height: 20, // 水印高度
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2289
2290
  lineHeight: 20, // 水印行高
2290
2291
  opacity: 0.1, // 水印透明度
2291
2292
  fontSize: 14, // 水印文字字体大小
@@ -2295,7 +2296,13 @@ var watermark = function watermark(option) {
2295
2296
  zIndex: 999999 // 水印文字的层级
2296
2297
  };
2297
2298
  var options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
2298
- var wrap = document.createElement('div');
2299
+ var wrap = document.getElementById('watermark');
2300
+ if (!wrap) {
2301
+ wrap = document.createElement('div');
2302
+ wrap.id = 'watermark';
2303
+ } else {
2304
+ wrap.innerHTML = '';
2305
+ }
2299
2306
  // 禁止选择和复制
2300
2307
  wrap.onselectstart = wrap.oncontextmenu = function () {
2301
2308
  return false;
@@ -2306,6 +2313,7 @@ var watermark = function watermark(option) {
2306
2313
  html = options.html,
2307
2314
  angle = options.angle,
2308
2315
  color = options.color,
2316
+ minWidth = options.minWidth,
2309
2317
  height = options.height,
2310
2318
  lineHeight = options.lineHeight,
2311
2319
  opacity = options.opacity,
@@ -2321,11 +2329,18 @@ var watermark = function watermark(option) {
2321
2329
  for (var i = 0; i < num; i++) {
2322
2330
  var item = document.createElement('div');
2323
2331
  item.innerHTML = html;
2324
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2332
+ item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + 100 / cols + '%;min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
2325
2333
  docFrag.appendChild(item);
2326
2334
  }
2327
2335
  wrap.appendChild(docFrag);
2328
2336
  document.body.appendChild(wrap);
2337
+ var _timeout = void 0;
2338
+ window.onresize = function () {
2339
+ clearTimeout(_timeout);
2340
+ _timeout = setTimeout(function () {
2341
+ watermark(options);
2342
+ }, 1000);
2343
+ };
2329
2344
  };
2330
2345
 
2331
2346
  /* harmony default export */ __webpack_exports__["a"] = ({