ecinc-cloud-wappaio 9.7.70 → 9.7.72

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.
@@ -32806,7 +32806,7 @@ src.install = function (Vue) {
32806
32806
 
32807
32807
  /***/ }),
32808
32808
 
32809
- /***/ 56410:
32809
+ /***/ 45219:
32810
32810
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32811
32811
 
32812
32812
  "use strict";
@@ -32818,7 +32818,7 @@ __webpack_require__.d(__webpack_exports__, {
32818
32818
  "default": function() { return /* binding */ RichtextEditor; }
32819
32819
  });
32820
32820
 
32821
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=template&id=0aca4eec&scoped=true
32821
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=template&id=70fde2ef&scoped=true
32822
32822
  var render = function render() {
32823
32823
  var _vm = this,
32824
32824
  _c = _vm._self._c;
@@ -32917,6 +32917,7 @@ var staticRenderFns = [];
32917
32917
  }
32918
32918
  },
32919
32919
  canEdit: function canEdit() {
32920
+ var _this = this;
32920
32921
  var readOnly = false;
32921
32922
  if (this.canEdit === 0 || this.canEdit === '0') {
32922
32923
  readOnly = true;
@@ -32924,13 +32925,18 @@ var staticRenderFns = [];
32924
32925
  this.ckeditor.destroy();
32925
32926
  this.initCkeditorToolbar(readOnly);
32926
32927
  var timer = window.setInterval(function () {
32927
- var ifrm = document.querySelector('.cke_wysiwyg_frame');
32928
- if (ifrm !== undefined && ifrm.contentDocument.body) {
32928
+ var editor = _this.ckeditor;
32929
+ if (!editor || editor.status !== 'ready' || !editor.window) return;
32930
+ var frame = editor.window.getFrame();
32931
+ var ifrm = frame && frame.$;
32932
+ if (ifrm && ifrm.contentDocument && ifrm.contentDocument.body) {
32929
32933
  window.clearInterval(timer);
32930
32934
  ifrm.contentDocument.body.style.margin = '5px';
32931
32935
  if (readOnly) {
32932
- document.querySelector('.cke_contents').style.height = ifrm.contentDocument.body.clientHeight + 90 + 'px';
32933
- document.querySelector('.cke_top').style.display = 'none';
32936
+ // 隐藏工具栏,内容区高度自适应正文内容高度(避免出现垂直滚动条)
32937
+ var topSpace = editor.ui.space('top');
32938
+ if (topSpace) topSpace.setStyle('display', 'none');
32939
+ _this.fitReadonlyHeight();
32934
32940
  }
32935
32941
  if (document.querySelector('.cke_browser_webkit')) {
32936
32942
  document.querySelector('.cke_browser_webkit').style.border = 0;
@@ -32940,7 +32946,7 @@ var staticRenderFns = [];
32940
32946
  }
32941
32947
  },
32942
32948
  mounted: function mounted() {
32943
- var _this = this;
32949
+ var _this2 = this;
32944
32950
  var toolbarBtns = [['Maximize'],
32945
32951
  // 加粗 斜体, 下划线
32946
32952
  ['Bold', 'Italic', 'Underline'],
@@ -33041,34 +33047,35 @@ var staticRenderFns = [];
33041
33047
  console.log('fileUploadResponse 上传结束.');
33042
33048
  var ifrm = document.querySelector('.cke_wysiwyg_frame');
33043
33049
  if (ifrm) {
33044
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33045
- _this.$emit('input', content);
33046
- _this.$emit('fileUploadResponse', res, content);
33050
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33051
+ _this2.$emit('input', content);
33052
+ _this2.$emit('fileUploadResponse', res, content);
33047
33053
  }
33048
33054
  });
33049
33055
  this.ckeditor.on('instanceReady', function () {
33050
33056
  console.log('instanceReady setData...');
33051
33057
 
33052
33058
  // 设置初始内容
33053
- _this.ckeditor.setData(_this.value);
33059
+ _this2.ckeditor.setData(_this2.value);
33054
33060
  var ifrm = document.querySelector('.cke_wysiwyg_frame');
33055
33061
  if (ifrm) {
33056
33062
  ifrm.contentDocument.body.style.margin = '5px';
33057
33063
  }
33058
- if (_this.startupMode !== 'source') {
33059
- _this.ckeditor.config.filebrowserImageUploadUrl = uploadUrl; // 上传图片的地址
33060
- _this.ckeditor.config.filebrowserImageBrowseUrl = _this.imageBrowseUrl; // 浏览图片的地址
33061
- _this.ckeditor.config.uploadUrl = _this.uploadUrl + '&paste=true'; // 剪贴版粘贴上传图片的地址
33062
- _this.ckeditor.config.filebrowserHtml5videoUploadUrl = uploadUrl; // 上传视频的地址
33063
- _this.ckeditor.config.filebrowserHtml5videoBrowseUrl = _this.videoBrowseUrl; // 浏览视频的地址
33064
- _this.ckeditor.config.filebrowserHtml5audioUploadUrl = uploadUrl; // 上传音频的地址
33065
- _this.ckeditor.config.filebrowserUploadUrl = _this.uploadUrl; // 上传附件的地址
33066
- _this.ckeditor.config.imageWidth = _this.imageWidth; // 图片/多图整体 - 宽度
33064
+ if (_this2.startupMode !== 'source') {
33065
+ _this2.ckeditor.config.filebrowserImageUploadUrl = uploadUrl; // 上传图片的地址
33066
+ _this2.ckeditor.config.filebrowserImageBrowseUrl = _this2.imageBrowseUrl; // 浏览图片的地址
33067
+ _this2.ckeditor.config.uploadUrl = _this2.uploadUrl + '&paste=true'; // 剪贴版粘贴上传图片的地址
33068
+ _this2.ckeditor.config.filebrowserHtml5videoUploadUrl = uploadUrl; // 上传视频的地址
33069
+ _this2.ckeditor.config.filebrowserHtml5videoBrowseUrl = _this2.videoBrowseUrl; // 浏览视频的地址
33070
+ _this2.ckeditor.config.filebrowserHtml5audioUploadUrl = uploadUrl; // 上传音频的地址
33071
+ _this2.ckeditor.config.filebrowserUploadUrl = _this2.uploadUrl; // 上传附件的地址
33072
+ _this2.ckeditor.config.imageWidth = _this2.imageWidth; // 图片/多图整体 - 宽度
33067
33073
 
33068
33074
  if (readOnly) {
33069
- var _ifrm = document.querySelector('.cke_wysiwyg_frame');
33070
- document.querySelector('.cke_contents').style.height = _ifrm.contentDocument.body.clientHeight + 90 + 'px';
33071
- document.querySelector('.cke_top').style.display = 'none';
33075
+ // 隐藏工具栏,内容区高度自适应正文内容高度(避免出现垂直滚动条)
33076
+ var topSpace = _this2.ckeditor.ui.space('top');
33077
+ if (topSpace) topSpace.setStyle('display', 'none');
33078
+ _this2.fitReadonlyHeight();
33072
33079
  }
33073
33080
  if (document.querySelector('.cke_browser_webkit')) {
33074
33081
  document.querySelector('.cke_browser_webkit').style.border = 0;
@@ -33076,21 +33083,26 @@ var staticRenderFns = [];
33076
33083
  }
33077
33084
  });
33078
33085
 
33086
+ // 只读模式下,内容加载完成后(含异步setData)重新自适应内容区高度
33087
+ this.ckeditor.on('dataReady', function () {
33088
+ if (readOnly) _this2.fitReadonlyHeight();
33089
+ });
33090
+
33079
33091
  // 监听数据加载完成事件,用于自动聚焦,光标定位到内容末尾
33080
33092
  if (this.autoFocus && !readOnly) {
33081
33093
  setTimeout(function () {
33082
- var range = _this.ckeditor.createRange();
33083
- range.selectNodeContents(_this.ckeditor.editable());
33094
+ var range = _this2.ckeditor.createRange();
33095
+ range.selectNodeContents(_this2.ckeditor.editable());
33084
33096
  range.shrink(CKEDITOR.SHRINK_ELEMENT, true);
33085
33097
  range.collapse();
33086
- _this.ckeditor.getSelection().selectRanges([range]);
33098
+ _this2.ckeditor.getSelection().selectRanges([range]);
33087
33099
  }, 50);
33088
33100
  }
33089
33101
 
33090
33102
  // 监听内容变更事件
33091
33103
  this.ckeditor.on('change', function () {
33092
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33093
- _this.$emit('input', content);
33104
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33105
+ _this2.$emit('input', content);
33094
33106
 
33095
33107
  // 绑定图片预览
33096
33108
  if (window.richtextEditorImgClick) {
@@ -33099,7 +33111,7 @@ var staticRenderFns = [];
33099
33111
  if (!readOnly) {
33100
33112
  ifrm.contentWindow.isCanRichtextEditor = true;
33101
33113
  }
33102
- _this.$nextTick(function () {
33114
+ _this2.$nextTick(function () {
33103
33115
  imgs.forEach(function (img) {
33104
33116
  img.setAttribute('onclick', 'if(!window.isCanRichtextEditor){window.open(this.src)}');
33105
33117
  });
@@ -33107,17 +33119,17 @@ var staticRenderFns = [];
33107
33119
  }
33108
33120
  });
33109
33121
  this.ckeditor.on('blur', function () {
33110
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33111
- _this.$emit('input', content);
33122
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33123
+ _this2.$emit('input', content);
33112
33124
  });
33113
33125
  this.ckeditor.on('key', function (evt) {
33114
- if (_this.startupMode !== 'source') {
33126
+ if (_this2.startupMode !== 'source') {
33115
33127
  // wysiwyg mode,将nbsp转为ensp、将tab转为4个ensp
33116
33128
  if (evt.data.keyCode === 32) {
33117
- _this.ckeditor.insertHtml('&ensp;');
33129
+ _this2.ckeditor.insertHtml('&ensp;');
33118
33130
  evt.cancel();
33119
33131
  } else if (evt.data.keyCode === 9) {
33120
- _this.ckeditor.insertHtml('&ensp;&ensp;&ensp;&ensp;');
33132
+ _this2.ckeditor.insertHtml('&ensp;&ensp;&ensp;&ensp;');
33121
33133
  evt.cancel();
33122
33134
  }
33123
33135
  }
@@ -33125,9 +33137,73 @@ var staticRenderFns = [];
33125
33137
  },
33126
33138
  beforeDestroy: function beforeDestroy() {
33127
33139
  delete window.isCanRichtextEditor;
33140
+ // 释放只读高度自适应相关资源
33141
+ if (this.fitReadonlyTimer) {
33142
+ clearTimeout(this.fitReadonlyTimer);
33143
+ this.fitReadonlyTimer = null;
33144
+ }
33145
+ if (this.fitResizeObserver) {
33146
+ this.fitResizeObserver.disconnect();
33147
+ this.fitResizeObserver = null;
33148
+ }
33128
33149
  this.ckeditor.destroy();
33129
33150
  },
33130
33151
  methods: {
33152
+ // 只读模式下,内容区高度自适应正文内容高度,确保不出现垂直滚动条
33153
+ fitReadonlyHeight: function fitReadonlyHeight(retry) {
33154
+ var _this3 = this;
33155
+ var editor = this.ckeditor;
33156
+ if (!editor || editor.status !== 'ready' || !editor.window) return;
33157
+ var frame = editor.window.getFrame();
33158
+ var ifrm = frame && frame.$;
33159
+ var contentsEl = editor.ui.space && editor.ui.space('contents');
33160
+ if (!ifrm || !ifrm.contentDocument || !ifrm.contentDocument.body || !contentsEl) {
33161
+ // 内容区尚未就绪,延迟重试
33162
+ if ((retry || 0) < 100) {
33163
+ this.fitReadonlyTimer = setTimeout(function () {
33164
+ return _this3.fitReadonlyHeight((retry || 0) + 1);
33165
+ }, 50);
33166
+ }
33167
+ return;
33168
+ }
33169
+ var doc = ifrm.contentDocument;
33170
+ var body = doc.body;
33171
+
33172
+ // 先压缩内容区与iframe再测量:视口足够大时scrollHeight会返回视口高度,导致测量失真;
33173
+ // 压缩后documentElement.scrollHeight即为包含body上下margin、末段margin折叠溢出在内的真实内容高度
33174
+ // (body.scrollHeight不含这部分,直接用它设置高度后仍会出现垂直滚动条)
33175
+ contentsEl.setStyle('height', '10px');
33176
+ ifrm.style.height = '10px';
33177
+ var fullHeight = Math.ceil(doc.documentElement.scrollHeight);
33178
+ // 恢复iframe跟随内容区高度(压缩时覆盖了其height:100%内联样式)
33179
+ ifrm.style.height = '100%';
33180
+ if (fullHeight > 0 && fullHeight !== this.fitContentHeight) {
33181
+ contentsEl.setStyle('height', fullHeight + 'px');
33182
+ this.fitContentHeight = fullHeight;
33183
+ }
33184
+
33185
+ // 图片异步加载完成后内容高度会变化,绑定加载事件重新自适应
33186
+ body.querySelectorAll('img').forEach(function (img) {
33187
+ if (!img.dataset.fitHeightBound) {
33188
+ img.dataset.fitHeightBound = '1';
33189
+ img.addEventListener('load', function () {
33190
+ clearTimeout(_this3.fitReadonlyTimer);
33191
+ _this3.fitReadonlyTimer = setTimeout(function () {
33192
+ return _this3.fitReadonlyHeight();
33193
+ }, 50);
33194
+ });
33195
+ }
33196
+ });
33197
+
33198
+ // 监听正文body尺寸变化(如字体加载、窗口宽度变化),持续自适应
33199
+ if (window.ResizeObserver) {
33200
+ if (this.fitResizeObserver) this.fitResizeObserver.disconnect();
33201
+ this.fitResizeObserver = new ResizeObserver(function () {
33202
+ _this3.fitReadonlyHeight();
33203
+ });
33204
+ this.fitResizeObserver.observe(body);
33205
+ }
33206
+ },
33131
33207
  initCkeditorToolbar: function initCkeditorToolbar(readOnly) {
33132
33208
  if (this.startupMode === 'source') {
33133
33209
  var richtext = document.querySelector('.richtext');
@@ -33175,9 +33251,9 @@ var staticRenderFns = [];
33175
33251
  });
33176
33252
  ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=script&lang=js
33177
33253
  /* harmony default export */ var RichtextEditor_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
33178
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=0aca4eec&prod&scoped=true&lang=scss
33179
- var srcvue_type_style_index_0_id_0aca4eec_prod_scoped_true_lang_scss = __webpack_require__(77198);
33180
- ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=0aca4eec&prod&scoped=true&lang=scss
33254
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=70fde2ef&prod&scoped=true&lang=scss
33255
+ var srcvue_type_style_index_0_id_70fde2ef_prod_scoped_true_lang_scss = __webpack_require__(73483);
33256
+ ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=70fde2ef&prod&scoped=true&lang=scss
33181
33257
 
33182
33258
  // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
33183
33259
  var componentNormalizer = __webpack_require__(81656);
@@ -33196,7 +33272,7 @@ var component = (0,componentNormalizer/* default */.A)(
33196
33272
  staticRenderFns,
33197
33273
  false,
33198
33274
  null,
33199
- "0aca4eec",
33275
+ "70fde2ef",
33200
33276
  null
33201
33277
 
33202
33278
  )
@@ -169082,7 +169158,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".outter[data-v-0f959ac4]{position:rela
169082
169158
 
169083
169159
  /***/ }),
169084
169160
 
169085
- /***/ 1553:
169161
+ /***/ 76608:
169086
169162
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
169087
169163
 
169088
169164
  "use strict";
@@ -169096,7 +169172,7 @@ __webpack_require__.r(__webpack_exports__);
169096
169172
 
169097
169173
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
169098
169174
  // Module
169099
- ___CSS_LOADER_EXPORT___.push([module.id, ".richtext-container[data-v-0aca4eec]{margin:20px 0 0 0}", ""]);
169175
+ ___CSS_LOADER_EXPORT___.push([module.id, ".richtext-container[data-v-70fde2ef]{margin:20px 0 0 0}", ""]);
169100
169176
  // Exports
169101
169177
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
169102
169178
 
@@ -255613,19 +255689,19 @@ var update = add("38d2fa45", content, true, {"sourceMap":false,"shadowMode":fals
255613
255689
 
255614
255690
  /***/ }),
255615
255691
 
255616
- /***/ 77198:
255692
+ /***/ 73483:
255617
255693
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
255618
255694
 
255619
255695
  // style-loader: Adds some css to the DOM by adding a <style> tag
255620
255696
 
255621
255697
  // load the styles
255622
- var content = __webpack_require__(1553);
255698
+ var content = __webpack_require__(76608);
255623
255699
  if(content.__esModule) content = content.default;
255624
255700
  if(typeof content === 'string') content = [[module.id, content, '']];
255625
255701
  if(content.locals) module.exports = content.locals;
255626
255702
  // add the styles to the DOM
255627
255703
  var add = (__webpack_require__(99548)/* ["default"] */ .A)
255628
- var update = add("0b6a1e38", content, true, {"sourceMap":false,"shadowMode":false});
255704
+ var update = add("6daf6b2a", content, true, {"sourceMap":false,"shadowMode":false});
255629
255705
 
255630
255706
  /***/ }),
255631
255707
 
@@ -280048,7 +280124,7 @@ var asyncComponents = [
280048
280124
  }], ['PdfTools', function () {
280049
280125
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 44568));
280050
280126
  }], ['RichtextEditor', function () {
280051
- return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 56410));
280127
+ return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45219));
280052
280128
  }], ['PDFInjector', function () {
280053
280129
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91895)).then(function (m) {
280054
280130
  return m.PDFInjector;
@@ -280496,7 +280572,7 @@ var PdfToolsModule = function PdfToolsModule() {
280496
280572
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 44568));
280497
280573
  };
280498
280574
  var RichtextEditorModule = function RichtextEditorModule() {
280499
- return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 56410));
280575
+ return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 45219));
280500
280576
  };
280501
280577
  var ModifyFormTraceModule = function ModifyFormTraceModule() {
280502
280578
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 81106));