eoss-ui 0.4.65 → 0.4.67

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 (65) hide show
  1. package/lib/button-group.js +17 -8
  2. package/lib/button.js +17 -8
  3. package/lib/checkbox-group.js +53 -15
  4. package/lib/data-table-form.js +17 -8
  5. package/lib/data-table.js +17 -8
  6. package/lib/date-picker.js +17 -8
  7. package/lib/dialog.js +20 -11
  8. package/lib/editor.js +2 -2
  9. package/lib/eoss-ui.common.js +6479 -5844
  10. package/lib/flow-group.js +17 -8
  11. package/lib/flow-list.js +17 -8
  12. package/lib/flow.js +22 -12
  13. package/lib/form.js +6354 -5979
  14. package/lib/handle-user.js +17 -8
  15. package/lib/handler.js +17 -8
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +17 -8
  18. package/lib/input.js +37 -15
  19. package/lib/login.js +22 -15
  20. package/lib/main.js +138 -101
  21. package/lib/menu.js +7 -3
  22. package/lib/nav.js +21 -11
  23. package/lib/page.js +17 -8
  24. package/lib/player.js +19 -10
  25. package/lib/qr-code.js +17 -8
  26. package/lib/radio-group.js +53 -15
  27. package/lib/retrial-auth.js +17 -8
  28. package/lib/select-ganged.js +42 -13
  29. package/lib/select.js +72 -23
  30. package/lib/selector-panel.js +17 -8
  31. package/lib/selector.js +17 -8
  32. package/lib/sizer.js +17 -8
  33. package/lib/steps.js +17 -8
  34. package/lib/switch.js +17 -8
  35. package/lib/table-form.js +1320 -1204
  36. package/lib/tabs.js +17 -8
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/tips.js +17 -8
  40. package/lib/tree-group.js +17 -8
  41. package/lib/tree.js +17 -8
  42. package/lib/upload.js +17 -8
  43. package/lib/utils/util.js +17 -8
  44. package/lib/wujie.js +17 -8
  45. package/lib/wxlogin.js +17 -8
  46. package/package.json +2 -2
  47. package/packages/checkbox-group/src/main.vue +47 -5
  48. package/packages/flow/src/main.vue +6 -5
  49. package/packages/form/src/main.vue +1442 -1315
  50. package/packages/form/src/table.vue +375 -318
  51. package/packages/input/src/main.vue +20 -7
  52. package/packages/login/src/main.vue +3 -5
  53. package/packages/main/src/main.vue +82 -61
  54. package/packages/main/src/userinfo.vue +12 -2
  55. package/packages/menu/src/main.vue +19 -3
  56. package/packages/nav/src/main.vue +2 -1
  57. package/packages/radio-group/src/main.vue +47 -5
  58. package/packages/select/src/main.vue +66 -21
  59. package/packages/select-ganged/src/main.vue +42 -18
  60. package/packages/theme-chalk/lib/index.css +1 -1
  61. package/packages/theme-chalk/lib/main.css +1 -1
  62. package/packages/theme-chalk/src/main.scss +5 -1
  63. package/packages/theme-chalk/src/menu.scss +1 -1
  64. package/src/index.js +1 -1
  65. package/src/utils/util.js +18 -8
@@ -2275,16 +2275,19 @@ var uuid = function uuid(len) {
2275
2275
  **/
2276
2276
  var watermark = function watermark(option) {
2277
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);
2278
2282
  var config = {
2279
- rows: 5, // 水印行数
2280
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2281
2285
  html: '水印示例', // 水印文本内容
2282
2286
  angle: -15, // 旋转角度
2283
2287
  color: '#000', // 水印文字颜色
2284
- width: '', // 水印宽度
2285
- minWidth: 300, // 水印最小宽度
2286
- height: 120, // 水印高度
2287
- lineHeight: 120, // 水印行高
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2290
+ lineHeight: 20, // 水印行高
2288
2291
  opacity: 0.1, // 水印透明度
2289
2292
  fontSize: 14, // 水印文字字体大小
2290
2293
  fontWeight: 400, // 水印字体粗细
@@ -2310,7 +2313,6 @@ var watermark = function watermark(option) {
2310
2313
  html = options.html,
2311
2314
  angle = options.angle,
2312
2315
  color = options.color,
2313
- width = options.width,
2314
2316
  minWidth = options.minWidth,
2315
2317
  height = options.height,
2316
2318
  lineHeight = options.lineHeight,
@@ -2327,11 +2329,18 @@ var watermark = function watermark(option) {
2327
2329
  for (var i = 0; i < num; i++) {
2328
2330
  var item = document.createElement('div');
2329
2331
  item.innerHTML = html;
2330
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2331
2333
  docFrag.appendChild(item);
2332
2334
  }
2333
2335
  wrap.appendChild(docFrag);
2334
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
+ };
2335
2344
  };
2336
2345
 
2337
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
package/lib/button.js CHANGED
@@ -2275,16 +2275,19 @@ var uuid = function uuid(len) {
2275
2275
  **/
2276
2276
  var watermark = function watermark(option) {
2277
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);
2278
2282
  var config = {
2279
- rows: 5, // 水印行数
2280
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2281
2285
  html: '水印示例', // 水印文本内容
2282
2286
  angle: -15, // 旋转角度
2283
2287
  color: '#000', // 水印文字颜色
2284
- width: '', // 水印宽度
2285
- minWidth: 300, // 水印最小宽度
2286
- height: 120, // 水印高度
2287
- lineHeight: 120, // 水印行高
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2290
+ lineHeight: 20, // 水印行高
2288
2291
  opacity: 0.1, // 水印透明度
2289
2292
  fontSize: 14, // 水印文字字体大小
2290
2293
  fontWeight: 400, // 水印字体粗细
@@ -2310,7 +2313,6 @@ var watermark = function watermark(option) {
2310
2313
  html = options.html,
2311
2314
  angle = options.angle,
2312
2315
  color = options.color,
2313
- width = options.width,
2314
2316
  minWidth = options.minWidth,
2315
2317
  height = options.height,
2316
2318
  lineHeight = options.lineHeight,
@@ -2327,11 +2329,18 @@ var watermark = function watermark(option) {
2327
2329
  for (var i = 0; i < num; i++) {
2328
2330
  var item = document.createElement('div');
2329
2331
  item.innerHTML = html;
2330
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2331
2333
  docFrag.appendChild(item);
2332
2334
  }
2333
2335
  wrap.appendChild(docFrag);
2334
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
+ };
2335
2344
  };
2336
2345
 
2337
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2275,16 +2275,19 @@ var uuid = function uuid(len) {
2275
2275
  **/
2276
2276
  var watermark = function watermark(option) {
2277
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);
2278
2282
  var config = {
2279
- rows: 5, // 水印行数
2280
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2281
2285
  html: '水印示例', // 水印文本内容
2282
2286
  angle: -15, // 旋转角度
2283
2287
  color: '#000', // 水印文字颜色
2284
- width: '', // 水印宽度
2285
- minWidth: 300, // 水印最小宽度
2286
- height: 120, // 水印高度
2287
- lineHeight: 120, // 水印行高
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2290
+ lineHeight: 20, // 水印行高
2288
2291
  opacity: 0.1, // 水印透明度
2289
2292
  fontSize: 14, // 水印文字字体大小
2290
2293
  fontWeight: 400, // 水印字体粗细
@@ -2310,7 +2313,6 @@ var watermark = function watermark(option) {
2310
2313
  html = options.html,
2311
2314
  angle = options.angle,
2312
2315
  color = options.color,
2313
- width = options.width,
2314
2316
  minWidth = options.minWidth,
2315
2317
  height = options.height,
2316
2318
  lineHeight = options.lineHeight,
@@ -2327,11 +2329,18 @@ var watermark = function watermark(option) {
2327
2329
  for (var i = 0; i < num; i++) {
2328
2330
  var item = document.createElement('div');
2329
2331
  item.innerHTML = html;
2330
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2331
2333
  docFrag.appendChild(item);
2332
2334
  }
2333
2335
  wrap.appendChild(docFrag);
2334
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
+ };
2335
2344
  };
2336
2345
 
2337
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2856,7 +2865,7 @@ function normalizeComponent(
2856
2865
  // ESM COMPAT FLAG
2857
2866
  __webpack_require__.r(__webpack_exports__);
2858
2867
 
2859
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox-group/src/main.vue?vue&type=template&id=d474eac6&
2868
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox-group/src/main.vue?vue&type=template&id=667a17b1&
2860
2869
  var render = function () {
2861
2870
  var _vm = this
2862
2871
  var _h = _vm.$createElement
@@ -2989,7 +2998,7 @@ var staticRenderFns = []
2989
2998
  render._withStripped = true
2990
2999
 
2991
3000
 
2992
- // CONCATENATED MODULE: ./packages/checkbox-group/src/main.vue?vue&type=template&id=d474eac6&
3001
+ // CONCATENATED MODULE: ./packages/checkbox-group/src/main.vue?vue&type=template&id=667a17b1&
2993
3002
 
2994
3003
  // EXTERNAL MODULE: ./src/config/api.js
2995
3004
  var api = __webpack_require__(1);
@@ -3065,6 +3074,14 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3065
3074
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
3066
3075
  name: 'EsCheckboxGroup',
3067
3076
  inheritAttrs: false,
3077
+ inject: {
3078
+ esForm: {
3079
+ default: ''
3080
+ },
3081
+ sysCodes: {
3082
+ default: ''
3083
+ }
3084
+ },
3068
3085
  props: {
3069
3086
  method: {
3070
3087
  type: String,
@@ -3126,11 +3143,13 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3126
3143
  isNoParamRequest: {
3127
3144
  type: Boolean,
3128
3145
  default: true
3129
- }
3146
+ },
3147
+ dataKey: String
3130
3148
  },
3131
3149
  data: function data() {
3132
3150
  return {
3133
- options: ''
3151
+ options: '',
3152
+ canceled: false
3134
3153
  };
3135
3154
  },
3136
3155
 
@@ -3217,6 +3236,18 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3217
3236
  handler: function handler() {
3218
3237
  this.url && this.getData(this.url);
3219
3238
  }
3239
+ },
3240
+ sysCodes: {
3241
+ deep: true,
3242
+ handler: function handler(val) {
3243
+ if (this.canceled && val && (this.sysCode && val[this.sysCode] || this.dataKey && val[this.dataKey])) {
3244
+ if (this.parseData) {
3245
+ this.options = this.parseData(JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey])));
3246
+ } else {
3247
+ this.options = JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey]));
3248
+ }
3249
+ }
3250
+ }
3220
3251
  }
3221
3252
  },
3222
3253
  created: function created() {},
@@ -3243,9 +3274,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3243
3274
  data: params
3244
3275
  }).then(function (res) {
3245
3276
  _this2.loading = false;
3277
+ _this2.canceled = false;
3246
3278
  if (res.rCode === 0) {
3247
3279
  _this2.options = JSON.parse(JSON.stringify(res.results));
3248
- if (sysCode) {
3280
+ if (sysCode || _this2.dataKey) {
3281
+ _this2.esForm && _this2.esForm.setSysCodes(sysCode || _this2.dataKey, JSON.parse(JSON.stringify(_this2.options)));
3249
3282
  store["a" /* default */].set(sysCode, JSON.parse(JSON.stringify(res.results)));
3250
3283
  }
3251
3284
  } else {
@@ -3254,8 +3287,13 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3254
3287
  }
3255
3288
  }).catch(function (err) {
3256
3289
  _this2.loading = false;
3257
- if (err.message && err.message !== 'canceled') {
3258
- _this2.$message.error(err.message);
3290
+ if (err.message) {
3291
+ if (err.message !== 'canceled') {
3292
+ _this2.$message.error(err.message);
3293
+ }
3294
+ if (err.message === 'canceled' && sysCode) {
3295
+ _this2.canceled = true;
3296
+ }
3259
3297
  }
3260
3298
  });
3261
3299
  },
@@ -2274,16 +2274,19 @@ var uuid = function uuid(len) {
2274
2274
  **/
2275
2275
  var watermark = function watermark(option) {
2276
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);
2277
2281
  var config = {
2278
- rows: 5, // 水印行数
2279
- cols: 5,
2282
+ rows: _rows, // 水印行数
2283
+ cols: _cols,
2280
2284
  html: '水印示例', // 水印文本内容
2281
2285
  angle: -15, // 旋转角度
2282
2286
  color: '#000', // 水印文字颜色
2283
- width: '', // 水印宽度
2284
- minWidth: 300, // 水印最小宽度
2285
- height: 120, // 水印高度
2286
- lineHeight: 120, // 水印行高
2287
+ minWidth: _width, // 水印最小宽度
2288
+ height: _height, // 水印高度
2289
+ lineHeight: 20, // 水印行高
2287
2290
  opacity: 0.1, // 水印透明度
2288
2291
  fontSize: 14, // 水印文字字体大小
2289
2292
  fontWeight: 400, // 水印字体粗细
@@ -2309,7 +2312,6 @@ var watermark = function watermark(option) {
2309
2312
  html = options.html,
2310
2313
  angle = options.angle,
2311
2314
  color = options.color,
2312
- width = options.width,
2313
2315
  minWidth = options.minWidth,
2314
2316
  height = options.height,
2315
2317
  lineHeight = options.lineHeight,
@@ -2326,11 +2328,18 @@ var watermark = function watermark(option) {
2326
2328
  for (var i = 0; i < num; i++) {
2327
2329
  var item = document.createElement('div');
2328
2330
  item.innerHTML = html;
2329
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2330
2332
  docFrag.appendChild(item);
2331
2333
  }
2332
2334
  wrap.appendChild(docFrag);
2333
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
+ };
2334
2343
  };
2335
2344
 
2336
2345
  /* harmony default export */ __webpack_exports__["a"] = ({
package/lib/data-table.js CHANGED
@@ -2274,16 +2274,19 @@ var uuid = function uuid(len) {
2274
2274
  **/
2275
2275
  var watermark = function watermark(option) {
2276
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);
2277
2281
  var config = {
2278
- rows: 5, // 水印行数
2279
- cols: 5,
2282
+ rows: _rows, // 水印行数
2283
+ cols: _cols,
2280
2284
  html: '水印示例', // 水印文本内容
2281
2285
  angle: -15, // 旋转角度
2282
2286
  color: '#000', // 水印文字颜色
2283
- width: '', // 水印宽度
2284
- minWidth: 300, // 水印最小宽度
2285
- height: 120, // 水印高度
2286
- lineHeight: 120, // 水印行高
2287
+ minWidth: _width, // 水印最小宽度
2288
+ height: _height, // 水印高度
2289
+ lineHeight: 20, // 水印行高
2287
2290
  opacity: 0.1, // 水印透明度
2288
2291
  fontSize: 14, // 水印文字字体大小
2289
2292
  fontWeight: 400, // 水印字体粗细
@@ -2309,7 +2312,6 @@ var watermark = function watermark(option) {
2309
2312
  html = options.html,
2310
2313
  angle = options.angle,
2311
2314
  color = options.color,
2312
- width = options.width,
2313
2315
  minWidth = options.minWidth,
2314
2316
  height = options.height,
2315
2317
  lineHeight = options.lineHeight,
@@ -2326,11 +2328,18 @@ var watermark = function watermark(option) {
2326
2328
  for (var i = 0; i < num; i++) {
2327
2329
  var item = document.createElement('div');
2328
2330
  item.innerHTML = html;
2329
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2330
2332
  docFrag.appendChild(item);
2331
2333
  }
2332
2334
  wrap.appendChild(docFrag);
2333
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
+ };
2334
2343
  };
2335
2344
 
2336
2345
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2275,16 +2275,19 @@ var uuid = function uuid(len) {
2275
2275
  **/
2276
2276
  var watermark = function watermark(option) {
2277
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);
2278
2282
  var config = {
2279
- rows: 5, // 水印行数
2280
- cols: 5,
2283
+ rows: _rows, // 水印行数
2284
+ cols: _cols,
2281
2285
  html: '水印示例', // 水印文本内容
2282
2286
  angle: -15, // 旋转角度
2283
2287
  color: '#000', // 水印文字颜色
2284
- width: '', // 水印宽度
2285
- minWidth: 300, // 水印最小宽度
2286
- height: 120, // 水印高度
2287
- lineHeight: 120, // 水印行高
2288
+ minWidth: _width, // 水印最小宽度
2289
+ height: _height, // 水印高度
2290
+ lineHeight: 20, // 水印行高
2288
2291
  opacity: 0.1, // 水印透明度
2289
2292
  fontSize: 14, // 水印文字字体大小
2290
2293
  fontWeight: 400, // 水印字体粗细
@@ -2310,7 +2313,6 @@ var watermark = function watermark(option) {
2310
2313
  html = options.html,
2311
2314
  angle = options.angle,
2312
2315
  color = options.color,
2313
- width = options.width,
2314
2316
  minWidth = options.minWidth,
2315
2317
  height = options.height,
2316
2318
  lineHeight = options.lineHeight,
@@ -2327,11 +2329,18 @@ var watermark = function watermark(option) {
2327
2329
  for (var i = 0; i < num; i++) {
2328
2330
  var item = document.createElement('div');
2329
2331
  item.innerHTML = html;
2330
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2331
2333
  docFrag.appendChild(item);
2332
2334
  }
2333
2335
  wrap.appendChild(docFrag);
2334
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
+ };
2335
2344
  };
2336
2345
 
2337
2346
  /* harmony default export */ __webpack_exports__["a"] = ({
package/lib/dialog.js CHANGED
@@ -2274,16 +2274,19 @@ var uuid = function uuid(len) {
2274
2274
  **/
2275
2275
  var watermark = function watermark(option) {
2276
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);
2277
2281
  var config = {
2278
- rows: 5, // 水印行数
2279
- cols: 5,
2282
+ rows: _rows, // 水印行数
2283
+ cols: _cols,
2280
2284
  html: '水印示例', // 水印文本内容
2281
2285
  angle: -15, // 旋转角度
2282
2286
  color: '#000', // 水印文字颜色
2283
- width: '', // 水印宽度
2284
- minWidth: 300, // 水印最小宽度
2285
- height: 120, // 水印高度
2286
- lineHeight: 120, // 水印行高
2287
+ minWidth: _width, // 水印最小宽度
2288
+ height: _height, // 水印高度
2289
+ lineHeight: 20, // 水印行高
2287
2290
  opacity: 0.1, // 水印透明度
2288
2291
  fontSize: 14, // 水印文字字体大小
2289
2292
  fontWeight: 400, // 水印字体粗细
@@ -2309,7 +2312,6 @@ var watermark = function watermark(option) {
2309
2312
  html = options.html,
2310
2313
  angle = options.angle,
2311
2314
  color = options.color,
2312
- width = options.width,
2313
2315
  minWidth = options.minWidth,
2314
2316
  height = options.height,
2315
2317
  lineHeight = options.lineHeight,
@@ -2326,11 +2328,18 @@ var watermark = function watermark(option) {
2326
2328
  for (var i = 0; i < num; i++) {
2327
2329
  var item = document.createElement('div');
2328
2330
  item.innerHTML = html;
2329
- item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (width ? parseInt(width, 10) + 'px' : 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 + ';';
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 + ';';
2330
2332
  docFrag.appendChild(item);
2331
2333
  }
2332
2334
  wrap.appendChild(docFrag);
2333
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
+ };
2334
2343
  };
2335
2344
 
2336
2345
  /* harmony default export */ __webpack_exports__["a"] = ({
@@ -2895,13 +2904,13 @@ module.exports = require("vue");
2895
2904
 
2896
2905
  /***/ }),
2897
2906
  /* 14 */,
2898
- /* 15 */
2907
+ /* 15 */,
2908
+ /* 16 */
2899
2909
  /***/ (function(module, exports) {
2900
2910
 
2901
2911
  module.exports = require("wujie-vue2");
2902
2912
 
2903
2913
  /***/ }),
2904
- /* 16 */,
2905
2914
  /* 17 */,
2906
2915
  /* 18 */,
2907
2916
  /* 19 */,
@@ -3453,7 +3462,7 @@ var regenerator_ = __webpack_require__(9);
3453
3462
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
3454
3463
 
3455
3464
  // EXTERNAL MODULE: external "wujie-vue2"
3456
- var external_wujie_vue2_ = __webpack_require__(15);
3465
+ var external_wujie_vue2_ = __webpack_require__(16);
3457
3466
  var external_wujie_vue2_default = /*#__PURE__*/__webpack_require__.n(external_wujie_vue2_);
3458
3467
 
3459
3468
  // EXTERNAL MODULE: ./src/utils/util.js
package/lib/editor.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 16:
90
+ /***/ 14:
91
91
  /***/ (function(module, exports) {
92
92
 
93
93
  module.exports = require("slate");
@@ -255,7 +255,7 @@ render._withStripped = true
255
255
  // CONCATENATED MODULE: ./packages/editor/src/main.vue?vue&type=template&id=f482498c&
256
256
 
257
257
  // EXTERNAL MODULE: external "slate"
258
- var external_slate_ = __webpack_require__(16);
258
+ var external_slate_ = __webpack_require__(14);
259
259
 
260
260
  // EXTERNAL MODULE: external "slate-history"
261
261
  var external_slate_history_ = __webpack_require__(17);