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.
@@ -32796,7 +32796,7 @@ src.install = function (Vue) {
32796
32796
 
32797
32797
  /***/ }),
32798
32798
 
32799
- /***/ 56504:
32799
+ /***/ 64112:
32800
32800
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32801
32801
 
32802
32802
  "use strict";
@@ -32808,7 +32808,7 @@ __webpack_require__.d(__webpack_exports__, {
32808
32808
  "default": function() { return /* binding */ RichtextEditor; }
32809
32809
  });
32810
32810
 
32811
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
32811
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
32812
32812
  var render = function render() {
32813
32813
  var _vm = this,
32814
32814
  _c = _vm._self._c;
@@ -32907,6 +32907,7 @@ var staticRenderFns = [];
32907
32907
  }
32908
32908
  },
32909
32909
  canEdit: function canEdit() {
32910
+ var _this = this;
32910
32911
  var readOnly = false;
32911
32912
  if (this.canEdit === 0 || this.canEdit === '0') {
32912
32913
  readOnly = true;
@@ -32914,13 +32915,18 @@ var staticRenderFns = [];
32914
32915
  this.ckeditor.destroy();
32915
32916
  this.initCkeditorToolbar(readOnly);
32916
32917
  var timer = window.setInterval(function () {
32917
- var ifrm = document.querySelector('.cke_wysiwyg_frame');
32918
- if (ifrm !== undefined && ifrm.contentDocument.body) {
32918
+ var editor = _this.ckeditor;
32919
+ if (!editor || editor.status !== 'ready' || !editor.window) return;
32920
+ var frame = editor.window.getFrame();
32921
+ var ifrm = frame && frame.$;
32922
+ if (ifrm && ifrm.contentDocument && ifrm.contentDocument.body) {
32919
32923
  window.clearInterval(timer);
32920
32924
  ifrm.contentDocument.body.style.margin = '5px';
32921
32925
  if (readOnly) {
32922
- document.querySelector('.cke_contents').style.height = ifrm.contentDocument.body.clientHeight + 90 + 'px';
32923
- document.querySelector('.cke_top').style.display = 'none';
32926
+ // 隐藏工具栏,内容区高度自适应正文内容高度(避免出现垂直滚动条)
32927
+ var topSpace = editor.ui.space('top');
32928
+ if (topSpace) topSpace.setStyle('display', 'none');
32929
+ _this.fitReadonlyHeight();
32924
32930
  }
32925
32931
  if (document.querySelector('.cke_browser_webkit')) {
32926
32932
  document.querySelector('.cke_browser_webkit').style.border = 0;
@@ -32930,7 +32936,7 @@ var staticRenderFns = [];
32930
32936
  }
32931
32937
  },
32932
32938
  mounted: function mounted() {
32933
- var _this = this;
32939
+ var _this2 = this;
32934
32940
  var toolbarBtns = [['Maximize'],
32935
32941
  // 加粗 斜体, 下划线
32936
32942
  ['Bold', 'Italic', 'Underline'],
@@ -33031,34 +33037,35 @@ var staticRenderFns = [];
33031
33037
  console.log('fileUploadResponse 上传结束.');
33032
33038
  var ifrm = document.querySelector('.cke_wysiwyg_frame');
33033
33039
  if (ifrm) {
33034
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33035
- _this.$emit('input', content);
33036
- _this.$emit('fileUploadResponse', res, content);
33040
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33041
+ _this2.$emit('input', content);
33042
+ _this2.$emit('fileUploadResponse', res, content);
33037
33043
  }
33038
33044
  });
33039
33045
  this.ckeditor.on('instanceReady', function () {
33040
33046
  console.log('instanceReady setData...');
33041
33047
 
33042
33048
  // 设置初始内容
33043
- _this.ckeditor.setData(_this.value);
33049
+ _this2.ckeditor.setData(_this2.value);
33044
33050
  var ifrm = document.querySelector('.cke_wysiwyg_frame');
33045
33051
  if (ifrm) {
33046
33052
  ifrm.contentDocument.body.style.margin = '5px';
33047
33053
  }
33048
- if (_this.startupMode !== 'source') {
33049
- _this.ckeditor.config.filebrowserImageUploadUrl = uploadUrl; // 上传图片的地址
33050
- _this.ckeditor.config.filebrowserImageBrowseUrl = _this.imageBrowseUrl; // 浏览图片的地址
33051
- _this.ckeditor.config.uploadUrl = _this.uploadUrl + '&paste=true'; // 剪贴版粘贴上传图片的地址
33052
- _this.ckeditor.config.filebrowserHtml5videoUploadUrl = uploadUrl; // 上传视频的地址
33053
- _this.ckeditor.config.filebrowserHtml5videoBrowseUrl = _this.videoBrowseUrl; // 浏览视频的地址
33054
- _this.ckeditor.config.filebrowserHtml5audioUploadUrl = uploadUrl; // 上传音频的地址
33055
- _this.ckeditor.config.filebrowserUploadUrl = _this.uploadUrl; // 上传附件的地址
33056
- _this.ckeditor.config.imageWidth = _this.imageWidth; // 图片/多图整体 - 宽度
33054
+ if (_this2.startupMode !== 'source') {
33055
+ _this2.ckeditor.config.filebrowserImageUploadUrl = uploadUrl; // 上传图片的地址
33056
+ _this2.ckeditor.config.filebrowserImageBrowseUrl = _this2.imageBrowseUrl; // 浏览图片的地址
33057
+ _this2.ckeditor.config.uploadUrl = _this2.uploadUrl + '&paste=true'; // 剪贴版粘贴上传图片的地址
33058
+ _this2.ckeditor.config.filebrowserHtml5videoUploadUrl = uploadUrl; // 上传视频的地址
33059
+ _this2.ckeditor.config.filebrowserHtml5videoBrowseUrl = _this2.videoBrowseUrl; // 浏览视频的地址
33060
+ _this2.ckeditor.config.filebrowserHtml5audioUploadUrl = uploadUrl; // 上传音频的地址
33061
+ _this2.ckeditor.config.filebrowserUploadUrl = _this2.uploadUrl; // 上传附件的地址
33062
+ _this2.ckeditor.config.imageWidth = _this2.imageWidth; // 图片/多图整体 - 宽度
33057
33063
 
33058
33064
  if (readOnly) {
33059
- var _ifrm = document.querySelector('.cke_wysiwyg_frame');
33060
- document.querySelector('.cke_contents').style.height = _ifrm.contentDocument.body.clientHeight + 90 + 'px';
33061
- document.querySelector('.cke_top').style.display = 'none';
33065
+ // 隐藏工具栏,内容区高度自适应正文内容高度(避免出现垂直滚动条)
33066
+ var topSpace = _this2.ckeditor.ui.space('top');
33067
+ if (topSpace) topSpace.setStyle('display', 'none');
33068
+ _this2.fitReadonlyHeight();
33062
33069
  }
33063
33070
  if (document.querySelector('.cke_browser_webkit')) {
33064
33071
  document.querySelector('.cke_browser_webkit').style.border = 0;
@@ -33066,21 +33073,26 @@ var staticRenderFns = [];
33066
33073
  }
33067
33074
  });
33068
33075
 
33076
+ // 只读模式下,内容加载完成后(含异步setData)重新自适应内容区高度
33077
+ this.ckeditor.on('dataReady', function () {
33078
+ if (readOnly) _this2.fitReadonlyHeight();
33079
+ });
33080
+
33069
33081
  // 监听数据加载完成事件,用于自动聚焦,光标定位到内容末尾
33070
33082
  if (this.autoFocus && !readOnly) {
33071
33083
  setTimeout(function () {
33072
- var range = _this.ckeditor.createRange();
33073
- range.selectNodeContents(_this.ckeditor.editable());
33084
+ var range = _this2.ckeditor.createRange();
33085
+ range.selectNodeContents(_this2.ckeditor.editable());
33074
33086
  range.shrink(CKEDITOR.SHRINK_ELEMENT, true);
33075
33087
  range.collapse();
33076
- _this.ckeditor.getSelection().selectRanges([range]);
33088
+ _this2.ckeditor.getSelection().selectRanges([range]);
33077
33089
  }, 50);
33078
33090
  }
33079
33091
 
33080
33092
  // 监听内容变更事件
33081
33093
  this.ckeditor.on('change', function () {
33082
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33083
- _this.$emit('input', content);
33094
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33095
+ _this2.$emit('input', content);
33084
33096
 
33085
33097
  // 绑定图片预览
33086
33098
  if (window.richtextEditorImgClick) {
@@ -33089,7 +33101,7 @@ var staticRenderFns = [];
33089
33101
  if (!readOnly) {
33090
33102
  ifrm.contentWindow.isCanRichtextEditor = true;
33091
33103
  }
33092
- _this.$nextTick(function () {
33104
+ _this2.$nextTick(function () {
33093
33105
  imgs.forEach(function (img) {
33094
33106
  img.setAttribute('onclick', 'if(!window.isCanRichtextEditor){window.open(this.src)}');
33095
33107
  });
@@ -33097,17 +33109,17 @@ var staticRenderFns = [];
33097
33109
  }
33098
33110
  });
33099
33111
  this.ckeditor.on('blur', function () {
33100
- var content = _this.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33101
- _this.$emit('input', content);
33112
+ var content = _this2.ckeditor.getData().replace(/<span style="background: url.*?>.*?<\/span>/g, '');
33113
+ _this2.$emit('input', content);
33102
33114
  });
33103
33115
  this.ckeditor.on('key', function (evt) {
33104
- if (_this.startupMode !== 'source') {
33116
+ if (_this2.startupMode !== 'source') {
33105
33117
  // wysiwyg mode,将nbsp转为ensp、将tab转为4个ensp
33106
33118
  if (evt.data.keyCode === 32) {
33107
- _this.ckeditor.insertHtml('&ensp;');
33119
+ _this2.ckeditor.insertHtml('&ensp;');
33108
33120
  evt.cancel();
33109
33121
  } else if (evt.data.keyCode === 9) {
33110
- _this.ckeditor.insertHtml('&ensp;&ensp;&ensp;&ensp;');
33122
+ _this2.ckeditor.insertHtml('&ensp;&ensp;&ensp;&ensp;');
33111
33123
  evt.cancel();
33112
33124
  }
33113
33125
  }
@@ -33115,9 +33127,73 @@ var staticRenderFns = [];
33115
33127
  },
33116
33128
  beforeDestroy: function beforeDestroy() {
33117
33129
  delete window.isCanRichtextEditor;
33130
+ // 释放只读高度自适应相关资源
33131
+ if (this.fitReadonlyTimer) {
33132
+ clearTimeout(this.fitReadonlyTimer);
33133
+ this.fitReadonlyTimer = null;
33134
+ }
33135
+ if (this.fitResizeObserver) {
33136
+ this.fitResizeObserver.disconnect();
33137
+ this.fitResizeObserver = null;
33138
+ }
33118
33139
  this.ckeditor.destroy();
33119
33140
  },
33120
33141
  methods: {
33142
+ // 只读模式下,内容区高度自适应正文内容高度,确保不出现垂直滚动条
33143
+ fitReadonlyHeight: function fitReadonlyHeight(retry) {
33144
+ var _this3 = this;
33145
+ var editor = this.ckeditor;
33146
+ if (!editor || editor.status !== 'ready' || !editor.window) return;
33147
+ var frame = editor.window.getFrame();
33148
+ var ifrm = frame && frame.$;
33149
+ var contentsEl = editor.ui.space && editor.ui.space('contents');
33150
+ if (!ifrm || !ifrm.contentDocument || !ifrm.contentDocument.body || !contentsEl) {
33151
+ // 内容区尚未就绪,延迟重试
33152
+ if ((retry || 0) < 100) {
33153
+ this.fitReadonlyTimer = setTimeout(function () {
33154
+ return _this3.fitReadonlyHeight((retry || 0) + 1);
33155
+ }, 50);
33156
+ }
33157
+ return;
33158
+ }
33159
+ var doc = ifrm.contentDocument;
33160
+ var body = doc.body;
33161
+
33162
+ // 先压缩内容区与iframe再测量:视口足够大时scrollHeight会返回视口高度,导致测量失真;
33163
+ // 压缩后documentElement.scrollHeight即为包含body上下margin、末段margin折叠溢出在内的真实内容高度
33164
+ // (body.scrollHeight不含这部分,直接用它设置高度后仍会出现垂直滚动条)
33165
+ contentsEl.setStyle('height', '10px');
33166
+ ifrm.style.height = '10px';
33167
+ var fullHeight = Math.ceil(doc.documentElement.scrollHeight);
33168
+ // 恢复iframe跟随内容区高度(压缩时覆盖了其height:100%内联样式)
33169
+ ifrm.style.height = '100%';
33170
+ if (fullHeight > 0 && fullHeight !== this.fitContentHeight) {
33171
+ contentsEl.setStyle('height', fullHeight + 'px');
33172
+ this.fitContentHeight = fullHeight;
33173
+ }
33174
+
33175
+ // 图片异步加载完成后内容高度会变化,绑定加载事件重新自适应
33176
+ body.querySelectorAll('img').forEach(function (img) {
33177
+ if (!img.dataset.fitHeightBound) {
33178
+ img.dataset.fitHeightBound = '1';
33179
+ img.addEventListener('load', function () {
33180
+ clearTimeout(_this3.fitReadonlyTimer);
33181
+ _this3.fitReadonlyTimer = setTimeout(function () {
33182
+ return _this3.fitReadonlyHeight();
33183
+ }, 50);
33184
+ });
33185
+ }
33186
+ });
33187
+
33188
+ // 监听正文body尺寸变化(如字体加载、窗口宽度变化),持续自适应
33189
+ if (window.ResizeObserver) {
33190
+ if (this.fitResizeObserver) this.fitResizeObserver.disconnect();
33191
+ this.fitResizeObserver = new ResizeObserver(function () {
33192
+ _this3.fitReadonlyHeight();
33193
+ });
33194
+ this.fitResizeObserver.observe(body);
33195
+ }
33196
+ },
33121
33197
  initCkeditorToolbar: function initCkeditorToolbar(readOnly) {
33122
33198
  if (this.startupMode === 'source') {
33123
33199
  var richtext = document.querySelector('.richtext');
@@ -33165,9 +33241,9 @@ var staticRenderFns = [];
33165
33241
  });
33166
33242
  ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=script&lang=js
33167
33243
  /* harmony default export */ var RichtextEditor_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
33168
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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
33169
- var srcvue_type_style_index_0_id_0aca4eec_prod_scoped_true_lang_scss = __webpack_require__(8157);
33170
- ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=0aca4eec&prod&scoped=true&lang=scss
33244
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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
33245
+ var srcvue_type_style_index_0_id_70fde2ef_prod_scoped_true_lang_scss = __webpack_require__(51684);
33246
+ ;// CONCATENATED MODULE: ./packages/ecwapp/RichtextEditor/src/index.vue?vue&type=style&index=0&id=70fde2ef&prod&scoped=true&lang=scss
33171
33247
 
33172
33248
  // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
33173
33249
  var componentNormalizer = __webpack_require__(81656);
@@ -33186,7 +33262,7 @@ var component = (0,componentNormalizer/* default */.A)(
33186
33262
  staticRenderFns,
33187
33263
  false,
33188
33264
  null,
33189
- "0aca4eec",
33265
+ "70fde2ef",
33190
33266
  null
33191
33267
 
33192
33268
  )
@@ -169072,7 +169148,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".outter[data-v-0f959ac4]{position:rela
169072
169148
 
169073
169149
  /***/ }),
169074
169150
 
169075
- /***/ 54071:
169151
+ /***/ 96678:
169076
169152
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
169077
169153
 
169078
169154
  "use strict";
@@ -169086,7 +169162,7 @@ __webpack_require__.r(__webpack_exports__);
169086
169162
 
169087
169163
  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()));
169088
169164
  // Module
169089
- ___CSS_LOADER_EXPORT___.push([module.id, ".richtext-container[data-v-0aca4eec]{margin:20px 0 0 0}", ""]);
169165
+ ___CSS_LOADER_EXPORT___.push([module.id, ".richtext-container[data-v-70fde2ef]{margin:20px 0 0 0}", ""]);
169090
169166
  // Exports
169091
169167
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
169092
169168
 
@@ -255603,19 +255679,19 @@ var update = add("78ff4c32", content, true, {"sourceMap":false,"shadowMode":fals
255603
255679
 
255604
255680
  /***/ }),
255605
255681
 
255606
- /***/ 8157:
255682
+ /***/ 51684:
255607
255683
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
255608
255684
 
255609
255685
  // style-loader: Adds some css to the DOM by adding a <style> tag
255610
255686
 
255611
255687
  // load the styles
255612
- var content = __webpack_require__(54071);
255688
+ var content = __webpack_require__(96678);
255613
255689
  if(content.__esModule) content = content.default;
255614
255690
  if(typeof content === 'string') content = [[module.id, content, '']];
255615
255691
  if(content.locals) module.exports = content.locals;
255616
255692
  // add the styles to the DOM
255617
255693
  var add = (__webpack_require__(99548)/* ["default"] */ .A)
255618
- var update = add("0e32e1f4", content, true, {"sourceMap":false,"shadowMode":false});
255694
+ var update = add("70782ee6", content, true, {"sourceMap":false,"shadowMode":false});
255619
255695
 
255620
255696
  /***/ }),
255621
255697
 
@@ -280030,7 +280106,7 @@ var asyncComponents = [
280030
280106
  }], ['PdfTools', function () {
280031
280107
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 11289));
280032
280108
  }], ['RichtextEditor', function () {
280033
- return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 56504));
280109
+ return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 64112));
280034
280110
  }], ['PDFInjector', function () {
280035
280111
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 90820)).then(function (m) {
280036
280112
  return m.PDFInjector;
@@ -280478,7 +280554,7 @@ var PdfToolsModule = function PdfToolsModule() {
280478
280554
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 11289));
280479
280555
  };
280480
280556
  var RichtextEditorModule = function RichtextEditorModule() {
280481
- return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 56504));
280557
+ return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 64112));
280482
280558
  };
280483
280559
  var ModifyFormTraceModule = function ModifyFormTraceModule() {
280484
280560
  return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 26022));