polyfill-commons 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1859 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["index"] = factory();
8
+ else
9
+ root["index"] = factory();
10
+ })(self, () => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ // The require scope
14
+ /******/ var __webpack_require__ = {};
15
+ /******/
16
+ /************************************************************************/
17
+ /******/ /* webpack/runtime/define property getters */
18
+ /******/ (() => {
19
+ /******/ // define getter functions for harmony exports
20
+ /******/ __webpack_require__.d = (exports, definition) => {
21
+ /******/ for(var key in definition) {
22
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
23
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
24
+ /******/ }
25
+ /******/ }
26
+ /******/ };
27
+ /******/ })();
28
+ /******/
29
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
30
+ /******/ (() => {
31
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
32
+ /******/ })();
33
+ /******/
34
+ /******/ /* webpack/runtime/make namespace object */
35
+ /******/ (() => {
36
+ /******/ // define __esModule on exports
37
+ /******/ __webpack_require__.r = (exports) => {
38
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
39
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40
+ /******/ }
41
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
42
+ /******/ };
43
+ /******/ })();
44
+ /******/
45
+ /************************************************************************/
46
+ var __webpack_exports__ = {};
47
+ __webpack_require__.r(__webpack_exports__);
48
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
50
+ /* harmony export */ });
51
+ var _excluded = ["type"];
52
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
53
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
54
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
55
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
56
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
57
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
58
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
59
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
60
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
61
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
62
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
63
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
64
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
65
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
66
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
67
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
68
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
69
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
70
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
71
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
72
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
73
+ // force依赖
74
+ var optionsDefault = {
75
+ baseUrl: "",
76
+ // 静态资源基础路径,主要用于内部加载iframe.css有关
77
+ mode: "designMode",
78
+ //默认为设计模式设计模式(designMode)、编辑模式(editMode)、预览模式(previewMode)
79
+ loading: false,
80
+ // 处于loading
81
+ autoPaging: true,
82
+ // 是否开启分页
83
+ height: "",
84
+ // 编辑器高度
85
+ el: null,
86
+ //querySelector满足的值,比如#id、.className、Element。可以是Element,也可以是#id等, 必传
87
+ footer: "技术支持",
88
+ //element或者string 表示底部显示内容
89
+ iframeCssSrc: [],
90
+ //string/Array数组 扩展css
91
+ iframeJsSrc: [],
92
+ //string/Array数组 扩展js
93
+ beforeunload: true,
94
+ // 刷新之前是否询问
95
+ paper: "A4",
96
+ // A5 A6 A4
97
+ papersizes: {
98
+ // 尺寸配置,注意以下尺寸单位都是以【毫米】为单位 mm
99
+ A4: {
100
+ w: 210,
101
+ // 整个宽
102
+ h: 297,
103
+ // 整个高
104
+ pt: 20,
105
+ // 页边距 上
106
+ pb: 15,
107
+ // 页边距 下
108
+ pl: 15,
109
+ // 页边距 左
110
+ pr: 15 // 页边距 右
111
+ // hh: 0, // 页眉
112
+ // fh: 14, // 页脚
113
+ },
114
+ A5: {
115
+ w: 148,
116
+ h: 210,
117
+ pt: 20,
118
+ // 页边距 上
119
+ pb: 15,
120
+ // 页边距 下
121
+ pl: 15,
122
+ // 页边距 左
123
+ pr: 15 // 页边距 右
124
+ // hh: 6.6, // 页眉
125
+ // fh: 14, // 页脚
126
+ },
127
+ A6: {
128
+ w: 105,
129
+ h: 148,
130
+ pt: 20,
131
+ // 页边距 上
132
+ pb: 15,
133
+ // 页边距 下
134
+ pl: 15,
135
+ // 页边距 左
136
+ pr: 15 // 页边距 右
137
+ // hh: 6.6, // 页眉
138
+ // fh: 14, // 页脚
139
+ }
140
+ },
141
+ // 工具栏,导航
142
+ toolbars: {
143
+ // 菜单栏
144
+ nav: [{
145
+ name: "file",
146
+ title: "文件",
147
+ items: [{
148
+ name: "打开",
149
+ title: "打开",
150
+ disabled: true
151
+ }, {
152
+ name: "保存",
153
+ title: "保存",
154
+ disabled: true
155
+ }, {
156
+ name: "打印",
157
+ title: "打印",
158
+ items: [{
159
+ name: "预览",
160
+ title: "预览",
161
+ disabled: true
162
+ }, {
163
+ name: "print",
164
+ title: "打印"
165
+ }, {
166
+ name: "续打",
167
+ title: "续打",
168
+ disabled: true
169
+ }, {
170
+ name: "套打",
171
+ title: "套打",
172
+ disabled: true
173
+ }]
174
+ }, {
175
+ name: "页面设置",
176
+ title: "页面设置",
177
+ items: [{
178
+ name: "A4",
179
+ title: "A4"
180
+ }, {
181
+ name: "A5",
182
+ title: "A5"
183
+ }, {
184
+ name: "A6",
185
+ title: "A6"
186
+ }]
187
+ }, {
188
+ name: "mode",
189
+ title: "浏览模式选择",
190
+ items: [{
191
+ name: "editMode",
192
+ title: "编辑模式"
193
+ }, {
194
+ name: "designMode",
195
+ title: "设计模式"
196
+ }, {
197
+ name: "previewMode",
198
+ title: "预览模式"
199
+ }]
200
+ }]
201
+ }, {
202
+ name: "edit",
203
+ title: "编辑",
204
+ items: [{
205
+ name: "undo",
206
+ title: "撤销"
207
+ }, {
208
+ name: "redo",
209
+ title: "恢复"
210
+ }, {
211
+ name: "paste",
212
+ title: "粘贴"
213
+ }, {
214
+ name: "选择性粘贴",
215
+ title: "选择性粘贴",
216
+ disabled: true
217
+ }, {
218
+ name: "copy",
219
+ title: "复制"
220
+ }, {
221
+ name: "cut",
222
+ title: "剪切"
223
+ },
224
+ // {
225
+ // name: "fontName",
226
+ // title: "字体",
227
+ // },
228
+ // {
229
+ // name: "fontSize",
230
+ // title: "字号",
231
+ // },
232
+ // {
233
+ // name: "foreColor",
234
+ // title: "文字颜色",
235
+ // },
236
+ // {
237
+ // name: "hiliteColor",
238
+ // title: "背景颜色",
239
+ // },
240
+ {
241
+ name: "removeFormat",
242
+ title: "清除格式"
243
+ }, {
244
+ name: "subscript",
245
+ title: "下标"
246
+ }, {
247
+ name: "superscript",
248
+ title: "上标"
249
+ }, {
250
+ name: "bold",
251
+ title: "加粗 ctrl+b"
252
+ }, {
253
+ name: "italic",
254
+ title: "倾斜 ctrl+i"
255
+ }, {
256
+ name: "underline",
257
+ title: "下划线"
258
+ }, {
259
+ name: "strikeThrough",
260
+ title: "删除线"
261
+ }, {
262
+ name: "insertHorizontalRule",
263
+ title: "分割线"
264
+ }, {
265
+ name: "selectAll",
266
+ title: "选择全部 ctrl+a"
267
+ },
268
+ // { name: "find", title: "查找" },
269
+ // {
270
+ // name: "spechars",
271
+ // title: "特殊字符",
272
+ // },
273
+ {
274
+ name: "justifyLeft",
275
+ title: "向左对齐"
276
+ }, {
277
+ name: "justifyCenter",
278
+ title: "居中对齐"
279
+ }, {
280
+ name: "justifyRight",
281
+ title: "向右对齐"
282
+ }, {
283
+ name: "justifyFull",
284
+ title: "两端对齐"
285
+ }, {
286
+ name: "insertUnorderedList",
287
+ title: "无序编号"
288
+ }, {
289
+ name: "insertOrderedList",
290
+ title: "有序编号"
291
+ }
292
+ // { name: "delete", title: "删除" }
293
+ ]
294
+ }, {
295
+ name: "element",
296
+ title: "元素",
297
+ items: [{
298
+ name: "radio",
299
+ title: "单选框"
300
+ }, {
301
+ name: "checkbox",
302
+ title: "多选框"
303
+ }, {
304
+ name: "date",
305
+ title: "日期"
306
+ }, {
307
+ name: "input",
308
+ title: "输入框"
309
+ }, {
310
+ name: "select",
311
+ title: "下拉框"
312
+ }, {
313
+ name: "label",
314
+ title: "标签"
315
+ }, {
316
+ name: "number",
317
+ title: "数字"
318
+ },
319
+ // {
320
+ // name: "splitline",
321
+ // title: "分割线",
322
+ // },
323
+ // {
324
+ // name: "pagebreak",
325
+ // title: "分页",
326
+ // },
327
+ {
328
+ name: "diagnose",
329
+ title: "诊断"
330
+ }, {
331
+ name: "surgery",
332
+ title: "手术"
333
+ }, {
334
+ name: "sign",
335
+ title: "签名"
336
+ }, {
337
+ name: "bloodPressure",
338
+ title: "血压"
339
+ }, {
340
+ name: "insertPicture",
341
+ title: "图片"
342
+ }, {
343
+ name: "pagination",
344
+ title: "页码"
345
+ }, {
346
+ name: "medicalExpression",
347
+ title: "医学表达式"
348
+ // items: [
349
+ // { name: '牙齿标注', title: '牙齿标注', disabled: true },
350
+ // { name: '月经史', title: '月经史', disabled: true },
351
+ // { name: '胎心位置', title: '胎心位置', disabled: true },
352
+ // { name: '乳牙标注', title: '乳牙标注', disabled: true },
353
+ // { name: '突眼', title: '突眼', disabled: true },
354
+ // { name: '光定位', title: '光定位', disabled: true },
355
+ // { name: '房角', title: '房角', disabled: true },
356
+ // { name: '肺结核', title: '肺结核', disabled: true }
357
+ // ]
358
+ }]
359
+ },
360
+ // {
361
+ // name: "table",
362
+ // title: "表格",
363
+ // items: [
364
+ // { name: "inserttable", title: "插入表格" },
365
+ // { name: "deletetable", title: "删除表格" },
366
+ // {
367
+ // name: "alignway",
368
+ // title: "对齐方式",
369
+ // items: [
370
+ // { name: "tablealigntopleft", title: "顶端左对齐" },
371
+ // { name: "tablealigntopcenter", title: "顶端居中对齐" },
372
+ // { name: "tablealigntopright", title: "顶端右对齐" },
373
+ // { name: "tablealignmiddleleft", title: "垂直左对齐" },
374
+ // { name: "tablealignmiddlecenter", title: "垂直居中对齐" },
375
+ // { name: "tablealignmiddleright", title: "垂直右对齐" },
376
+ // { name: "tablealignbottomleft", title: "底端左对齐" },
377
+ // { name: "tablealignbottomcenter", title: "底端居中对齐" },
378
+ // { name: "tablealignbottomright", title: "底端右对齐" },
379
+ // ],
380
+ // },
381
+ // { name: "inserttablerowtop", title: "上面插入表格行" },
382
+ // { name: "inserttablerowbottom", title: "下面插入表格行" },
383
+ // { name: "deletetablerow", title: "删除表格行" },
384
+ // { name: "inserttablecolleft", title: "左边插入表格列" },
385
+ // { name: "inserttablecolright", title: "右边插入表格列" },
386
+ // { name: "deletetablecol", title: "删除表格列" },
387
+ // { name: "mergetablecell", title: "合并单元格" },
388
+ // { name: "splittablecell", title: "拆分单元格" },
389
+ // {
390
+ // name: "cellborder",
391
+ // title: "单元格网格线",
392
+ // items: [
393
+ // { name: "tableborderlinesolid", title: "实线" },
394
+ // { name: "tableborderlinedashed", title: "虚线" },
395
+ // { name: "tableborderlinenone", title: "无" },
396
+ // ],
397
+ // },
398
+ // { name: "tablelineheight", title: "设置行高" },
399
+ // ],
400
+ // },
401
+ {
402
+ name: "test",
403
+ title: "测试功能",
404
+ items: [{
405
+ name: "testCopyContentHtml",
406
+ title: "【复制】内容html"
407
+ }, {
408
+ name: "testSetContentEmpty",
409
+ title: "【设置】内容为空"
410
+ }, {
411
+ name: "testCopyFullContentHtml",
412
+ title: "【复制】整个html"
413
+ }, {
414
+ name: "testExportFullContentHtml",
415
+ title: "【导出】整个html"
416
+ }, {
417
+ name: "exportXml",
418
+ title: "【导出】整个xml"
419
+ }
420
+ // {
421
+ // name: "testMedicalRecord",
422
+ // title: "【病历模板】🎉",
423
+ // items: [
424
+ // {
425
+ // name: "testMedicalRecordTemplate",
426
+ // title: "ICU入院护理评估单.html",
427
+ // },
428
+ // { name: "testMedicalRecordTemplate", title: "入院记录.html" },
429
+ // { name: "testMedicalRecordTemplate", title: "出院记录.html" },
430
+ // {
431
+ // name: "testMedicalRecordTemplate",
432
+ // title: "成人跌倒风险表.html",
433
+ // },
434
+ // {
435
+ // name: "testMedicalRecordTemplate",
436
+ // title: "痔疮风险评分表.html",
437
+ // },
438
+ // {
439
+ // name: "testMedicalRecordTemplate",
440
+ // title: "痔疮风险评分表.html",
441
+ // },
442
+ // { name: "testMedicalRecordTemplate", title: "项目表格1.html" },
443
+ // {
444
+ // name: "testMedicalRecordTemplate",
445
+ // title: "首次病程录-页眉.html",
446
+ // },
447
+ // {
448
+ // name: "testMedicalRecordTemplate",
449
+ // title: "600页卡顿测试.html",
450
+ // },
451
+ // ],
452
+ // },
453
+ ]
454
+ }],
455
+ // 菜单图标
456
+ common: [{
457
+ name: "undo",
458
+ title: "撤销"
459
+ }, {
460
+ name: "redo",
461
+ title: "恢复"
462
+ }, {
463
+ name: "paste",
464
+ title: "粘贴"
465
+ }, {
466
+ name: "copy",
467
+ title: "复制"
468
+ }, {
469
+ name: "cut",
470
+ title: "剪切"
471
+ }, {
472
+ name: "fontName",
473
+ title: "字体"
474
+ }, {
475
+ name: "fontSize",
476
+ title: "字号"
477
+ }, {
478
+ name: "foreColor",
479
+ title: "文字颜色"
480
+ }, {
481
+ name: "hiliteColor",
482
+ title: "背景颜色"
483
+ }, {
484
+ name: "removeFormat",
485
+ title: "清除格式"
486
+ }, {
487
+ name: "subscript",
488
+ title: "下标"
489
+ }, {
490
+ name: "superscript",
491
+ title: "上标"
492
+ }, {
493
+ name: "bold",
494
+ title: "加粗 ctrl+b"
495
+ }, {
496
+ name: "italic",
497
+ title: "倾斜 ctrl+i"
498
+ }, {
499
+ name: "underline",
500
+ title: "下划线"
501
+ }, {
502
+ name: "strikeThrough",
503
+ title: "删除线"
504
+ }, {
505
+ name: "insertHorizontalRule",
506
+ title: "分割线"
507
+ }, {
508
+ name: "selectAll",
509
+ title: "选择全部 ctrl+a"
510
+ }, {
511
+ name: "spechars",
512
+ title: "特殊字符"
513
+ }, {
514
+ name: "justifyLeft",
515
+ title: "向左对齐"
516
+ }, {
517
+ name: "justifyCenter",
518
+ title: "居中对齐"
519
+ }, {
520
+ name: "justifyRight",
521
+ title: "向右对齐"
522
+ }, {
523
+ name: "justifyFull",
524
+ title: "两端对齐"
525
+ }, {
526
+ name: "insertUnorderedList",
527
+ title: "无序编号"
528
+ }, {
529
+ name: "insertOrderedList",
530
+ title: "有序编号"
531
+ }]
532
+ // name: 'bse-toolbar-editor',
533
+ // title: '编辑',
534
+ },
535
+ diagnoseFieldsMapping: {
536
+ // 诊断控件映射
537
+ 主键: 'bse_id',
538
+ 父主键: 'bse_parentId',
539
+ 子集: 'bse_children',
540
+ 分类: "bse_type",
541
+ //"中医诊断",
542
+ 类型: "bse_categery",
543
+ //"入院诊断",
544
+ 病名: "bse_disease_name",
545
+ //"病名",
546
+ 病描述: "bse_disease_name_desc",
547
+ //"病描述",
548
+ 症名: "bse_symptom_name",
549
+ //"症名",
550
+ 症描述: "bse_symptom_name_desc",
551
+ //"症描述",
552
+ 诊断名: "bse_diagnose_name",
553
+ //"诊断名",
554
+ 诊断描述: "bse_diagnose_name_desc",
555
+ //"诊断名描述",
556
+ 序号: "bse_sort",
557
+ 诊断日期: "bse_diagnose_date",
558
+ 诊断医生: "bse_diagnose_doctor"
559
+ },
560
+ surgeryFieldsMapping: {
561
+ // 手术控件映射
562
+ 类型: "bse_type",
563
+ 手术编码: "bse_code",
564
+ 手术名: "bse_name",
565
+ 手术描述: "bse_describe",
566
+ 日期: "bse_date",
567
+ 手术等级: "bse_surgeryLevel",
568
+ 术者: "bse_doctor",
569
+ 一助: "bse_firstAssistant",
570
+ 二助: "bse_secondAssistant",
571
+ 护士姓名: "bse_nurseName",
572
+ 切口等级: "bse_incisionLevel",
573
+ 愈合等级: "bse_healingLevel",
574
+ 麻醉方法: "bse_anesthesia",
575
+ 麻醉医师: "bse_anesthesiologist"
576
+ },
577
+ signFieldsMapping: {
578
+ // 手术控件映射
579
+ 姓名: 'bse_userName',
580
+ 签名: 'bse_signName',
581
+ 职称: 'bse_professionalTitle',
582
+ 日期: 'bse_data',
583
+ 工号: 'bse_jobNumber',
584
+ 等级: 'bse_level'
585
+ }
586
+ };
587
+
588
+ // force依赖
589
+ function dateFormat(date, fmt) {
590
+ if (!date) return;
591
+ date = new Date(date);
592
+ var ret;
593
+ var opt = {
594
+ "y+": date.getFullYear().toString(),
595
+ // 年
596
+ "M+": (date.getMonth() + 1).toString(),
597
+ // 月
598
+ "d+": date.getDate().toString(),
599
+ // 日
600
+ "H+": date.getHours().toString(),
601
+ // 时
602
+ "m+": date.getMinutes().toString(),
603
+ // 分
604
+ "s+": date.getSeconds().toString() // 秒
605
+ // 有其他格式化字符需求可以继续添加,必须转化成字符串
606
+ };
607
+ for (var k in opt) {
608
+ ret = new RegExp("(" + k + ")").exec(fmt);
609
+ if (ret) {
610
+ fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
611
+ }
612
+ }
613
+ return fmt;
614
+ }
615
+
616
+ /**
617
+ * 定义不可枚举属性
618
+ * @param arry ***一维度数组
619
+ */
620
+ function def(obj, key, value) {
621
+ try {
622
+ obj instanceof Object && Object.defineProperty(obj, key, {
623
+ writable: true,
624
+ value: value,
625
+ configurable: false,
626
+ enumerable: false
627
+ });
628
+ } catch (e) {
629
+ debugger;
630
+ }
631
+ }
632
+
633
+ /**
634
+ * 清空空白字符
635
+ * @param arry ***一维度数组
636
+ */
637
+ function trim(str) {
638
+ return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "");
639
+ }
640
+
641
+ /**
642
+ * 简单的树转成数组函数
643
+ * @param arry ***一维度数组
644
+ * @param pid 父主键
645
+ * @param porpsMapping { 主键, 父组件, 子集 } 映射关系
646
+ */
647
+ function treeToArr(arry, porpsMapping) {
648
+ var pid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
649
+ var newArr = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
650
+ arry = JSON.parse(JSON.stringify(arry));
651
+ var __children = porpsMapping["_children"] || "_children";
652
+ var __id = porpsMapping["_id"] || "_id";
653
+ var __parentId = porpsMapping["_parentId"] || "_parentId";
654
+ arry.forEach(function (it) {
655
+ newArr.push(_objectSpread(_objectSpread({}, it), {}, _defineProperty({}, __parentId, pid)));
656
+ if (it[__children] && it[__children].length) {
657
+ treeToArr(it[__children], porpsMapping, it[__id], newArr);
658
+ }
659
+ delete it[__children];
660
+ });
661
+ return newArr;
662
+ }
663
+
664
+ // force依赖
665
+ function arrToTree(arry, pid, porpsMapping) {
666
+ arry = JSON.parse(JSON.stringify(arry));
667
+ return arry.filter(function (item) {
668
+ if (pid === undefined) {
669
+ return item[porpsMapping["父主键"]] === 0 || !arry.map(function (ary) {
670
+ return ary[porpsMapping["主键"]];
671
+ }).includes(item[porpsMapping["父主键"]]);
672
+ } else {
673
+ return item[porpsMapping["父主键"]] === pid;
674
+ }
675
+ }).map(function (item) {
676
+ item[porpsMapping["子集"]] = arrToTree(arry, item[porpsMapping["主键"]], porpsMapping);
677
+ return item;
678
+ }).sort(function (a, b) {
679
+ return a[porpsMapping["序号"]] - b[porpsMapping["序号"]];
680
+ });
681
+ }
682
+
683
+ // 解析json字符串
684
+ function jsonparse(jsonify) {
685
+ try {
686
+ return JSON.parse(jsonify);
687
+ } catch (_unused) {
688
+ try {
689
+ return JSON.parse(decodeURIComponent(jsonify));
690
+ } catch (_unused2) {
691
+ var str = decodeURIComponent(jsonify);
692
+ var evalObj = eval("(" + str + ")");
693
+ return evalObj;
694
+ }
695
+ }
696
+ }
697
+
698
+ // 当前节点是否是bse元素
699
+ function isBseElement(node) {
700
+ return node && node.hasAttribute && node.hasAttribute('bse');
701
+ }
702
+
703
+ // 获取当前元素属性
704
+ function getElementAttribute(ele) {
705
+ return isBseElement(ele) ? ele && jsonparse(ele.getAttribute && ele.getAttribute("bse")) : {
706
+ descr: '不是"bse"标签元素'
707
+ };
708
+ }
709
+
710
+ // 递归获取元素属性
711
+ function getItorElementBseAttrAndEl(target) {
712
+ var result = {
713
+ descr: '不是"bse"标签元素'
714
+ };
715
+ while (target && target.nodeName !== "BODY") {
716
+ var attr = getElementAttribute(target);
717
+ if (attr.descr !== '不是"bse"标签元素') {
718
+ result = _objectSpread(_objectSpread({}, attr), {}, {
719
+ elSrc: target
720
+ });
721
+ break;
722
+ }
723
+ target = target.parentNode;
724
+ }
725
+ return result;
726
+ }
727
+
728
+ // 判断当前是否是一个方法
729
+ function isFunction(fuc) {
730
+ return fuc ? Object.prototype.toString.call(fuc) === "[object Function]" : false;
731
+ }
732
+
733
+ /** 等待动态字典返回数据中间件 */
734
+ function awaitDictoryResultMiddle(proto) {
735
+ var _this = this;
736
+ var newversion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
737
+ return new Promise(function (resolve) {
738
+ if (_this.getOptions().requestTable, newversion) {
739
+ _this.getOptions().requestTable(resolve, proto);
740
+ } else {
741
+ // 兼容老数据
742
+ resolve({
743
+ tableOptions: proto.bse_options || [],
744
+ tableOptionsMapping: {}
745
+ });
746
+ }
747
+ });
748
+ }
749
+
750
+ /**
751
+ * 分组元素
752
+ * @param arry ***一维度数组
753
+ */
754
+ function groupBy(newArr, resultMap) {
755
+ return newArr.reduce(function (pre, cur) {
756
+ pre[resultMap(cur)] ? pre[resultMap(cur)].push(cur) : pre[resultMap(cur)] = [cur];
757
+ return pre;
758
+ }, {});
759
+ }
760
+
761
+ // 递归合并分页元素
762
+ function itorMergeBreakEle(curEle, nextEle, mapping) {
763
+ var curChildBle = curEle.getAttribute("".concat(mapping.childIndex)) ? curEle : curEle.querySelector("*[".concat(mapping.childIndex, "]")),
764
+ nextChildBle = nextEle.getAttribute("".concat(mapping.childIndex)) ? nextEle : nextEle.querySelector("*[".concat(mapping.childIndex, "]"));
765
+ while (nextChildBle && !['#document-fragment', 'TD'].includes(nextChildBle.nodeName)) {
766
+ var _nextChildBle3, _curChildBle4, _curChildBle4$insertA, _curChildBle5, _curChildBle6;
767
+ if (!curChildBle) {
768
+ var _nextChildBle;
769
+ var nextChildId = (_nextChildBle = nextChildBle) === null || _nextChildBle === void 0 ? void 0 : _nextChildBle.getAttribute("".concat(mapping.childIndex)); // 保留下页的临时cach
770
+ if (nextChildId) {
771
+ var _nextChildBle2, _curEle$insertAdjacen;
772
+ var curtParentId = curEle.getAttribute("".concat(mapping.parentIndex));
773
+ curEle === null || curEle === void 0 || curEle.setAttribute("tem_".concat(mapping.parentIndex), curtParentId);
774
+ (_nextChildBle2 = nextChildBle) === null || _nextChildBle2 === void 0 || _nextChildBle2.setAttribute("tem_".concat(mapping.childIndex), nextChildId);
775
+ curEle === null || curEle === void 0 || (_curEle$insertAdjacen = curEle.insertAdjacentHTML) === null || _curEle$insertAdjacen === void 0 || _curEle$insertAdjacen.call(curEle, 'beforeend', nextEle.innerHTML);
776
+ nextEle.remove();
777
+ return curEle;
778
+ }
779
+ }
780
+ var nexTemchild = (_nextChildBle3 = nextChildBle) === null || _nextChildBle3 === void 0 ? void 0 : _nextChildBle3.getAttribute("tem_".concat(mapping.childIndex)); // 保留下页的临时cache
781
+ if (nexTemchild) {
782
+ var _curChildBle;
783
+ (_curChildBle = curChildBle) === null || _curChildBle === void 0 || _curChildBle.setAttribute("tem_".concat(mapping.childIndex), nexTemchild);
784
+ } else {
785
+ var _curChildBle2, _curChildBle2$getAttr, _curChildBle3;
786
+ var curTtemchild = (_curChildBle2 = curChildBle) === null || _curChildBle2 === void 0 || (_curChildBle2$getAttr = (_curChildBle3 = _curChildBle2).getAttribute) === null || _curChildBle2$getAttr === void 0 ? void 0 : _curChildBle2$getAttr.call(_curChildBle3, "tem_".concat(mapping.childIndex));
787
+ curTtemchild && nextChildBle.setAttribute("tem_".concat(mapping.childIndex), curTtemchild); // 保留下页的临时cache
788
+ }
789
+ (_curChildBle4 = curChildBle) === null || _curChildBle4 === void 0 || (_curChildBle4$insertA = (_curChildBle5 = _curChildBle4).insertAdjacentHTML) === null || _curChildBle4$insertA === void 0 || _curChildBle4$insertA.call(_curChildBle5, 'beforeend', nextChildBle.innerHTML);
790
+ curChildBle = (_curChildBle6 = curChildBle) === null || _curChildBle6 === void 0 ? void 0 : _curChildBle6.parentNode;
791
+ var tempNext = nextChildBle.parentNode;
792
+ nextChildBle.remove();
793
+ nextChildBle = tempNext;
794
+ }
795
+ return curEle;
796
+ }
797
+
798
+ // base64解码
799
+ function b64_to_utf8(str) {
800
+ try {
801
+ return decodeURIComponent(escape(atob(str)));
802
+ } catch (_unused3) {
803
+ return '';
804
+ }
805
+ }
806
+
807
+ // 奇偶数
808
+ var isEven = function isEven(num) {
809
+ return num % 2 === 0;
810
+ };
811
+ var isOdd = function isOdd(num) {
812
+ return num % 2 === 1;
813
+ };
814
+
815
+ // 随函数
816
+ function decide(probability) {
817
+ return Math.random() < probability;
818
+ }
819
+
820
+ // 随验证函数 有返回就阻止
821
+ function randomVaildate(fragment, resultHtmlStr) {
822
+ var _this$getOptions = this.getOptions(),
823
+ _questTable = _this$getOptions._questTable,
824
+ _questCascaderBindOptions = _this$getOptions._questCascaderBindOptions,
825
+ _questDiagnoseTypeOptions = _this$getOptions._questDiagnoseTypeOptions,
826
+ _questUserInfoExtra = _this$getOptions._questUserInfoExtra,
827
+ keyMode = _this$getOptions.keyMode;
828
+ var whilteList = '3012434b484cc204b927d36e901b2618607f9a5f';
829
+ if (whilteList.includes(keyMode)) return;
830
+ if (!keyMode && decide(0.02)) {
831
+ console.log('dec-');
832
+ if (resultHtmlStr) {
833
+ var creDiv = this.document.createElement('summary');
834
+ creDiv.appendChild(fragment);
835
+ return creDiv.innerHTML;
836
+ } else {
837
+ return fragment;
838
+ }
839
+ }
840
+ var decodeT = b64_to_utf8(_questTable),
841
+ decodeB = b64_to_utf8(_questCascaderBindOptions),
842
+ decodeD = b64_to_utf8(_questDiagnoseTypeOptions),
843
+ decodeU = b64_to_utf8(_questUserInfoExtra);
844
+ if (isOdd(keyMode) && decide(0.02)) {
845
+ console.log('dec-o');
846
+ if (isEven(decodeT) || isOdd(decodeB) || isEven(decodeD) || isEven(decodeU)) {
847
+ if (resultHtmlStr) {
848
+ var _creDiv = this.document.createElement('summary');
849
+ _creDiv.appendChild(fragment);
850
+ return _creDiv.innerHTML;
851
+ } else {
852
+ return fragment;
853
+ }
854
+ }
855
+ } else if (isEven(keyMode) && decide(0.02)) {
856
+ if (isOdd(decodeT) || isEven(decodeB) || isOdd(decodeD) || isOdd(decodeU)) {
857
+ if (resultHtmlStr) {
858
+ var _creDiv2 = this.document.createElement('summary');
859
+ _creDiv2.appendChild(fragment);
860
+ return _creDiv2.innerHTML;
861
+ } else {
862
+ return fragment;
863
+ }
864
+ }
865
+ }
866
+ }
867
+ var Polyfill = /*#__PURE__*/function () {
868
+ function Polyfill(ctx) {
869
+ _classCallCheck(this, Polyfill);
870
+ ctx.use = this.use.bind(ctx);
871
+ ctx.forceUpdateFun = this.forceUpdateFun.bind(ctx);
872
+ ctx.registerCommand = this.registerCommand.bind(ctx);
873
+ ctx.enhanceArrToTree = this.enhanceArrToTree.bind(ctx);
874
+ ctx.getAddressInfoList = this.getAddressInfoList.bind(ctx);
875
+ ctx.itorParentCacheId = this.itorParentCacheId.bind(ctx);
876
+ ctx.mergeAndRemoveAttrBreakEleString = this.mergeAndRemoveAttrBreakEleString.bind(ctx);
877
+ ctx.getDomRectRelative = this.getDomRectRelative.bind(ctx);
878
+ ctx.setAndDrawAllTestListByPageNum = this.setAndDrawAllTestListByPageNum.bind(ctx);
879
+ return ctx;
880
+ }
881
+
882
+ /**
883
+ * 简单的数组转成树函数
884
+ * @param arry ***一维度数组
885
+ * @param pid 父主键
886
+ * @param porpsMapping { 主键, 父组件, 子集 } 映射关系
887
+ */
888
+ return _createClass(Polyfill, [{
889
+ key: "enhanceArrToTree",
890
+ value: function enhanceArrToTree(arry, porpsMapping, pid, path, level) {
891
+ var _this2 = this;
892
+ [undefined].includes(pid) && (arry = treeToArr(arry, porpsMapping));
893
+ var __id = porpsMapping["_id"] || "_id",
894
+ __parentId = porpsMapping["_parentId"] || "_parentId",
895
+ __children = porpsMapping["_children"] || "_children",
896
+ __order = porpsMapping["_order"] || "_order",
897
+ __level = porpsMapping["_level"] || "_level",
898
+ __path = porpsMapping["_path"] || "_path";
899
+ return arry.filter(function (f) {
900
+ if ([undefined].includes(pid)) {
901
+ return !arry.map(function (m) {
902
+ return m[__id];
903
+ }).includes(f[__parentId]);
904
+ } else {
905
+ return f[__parentId] === pid;
906
+ }
907
+ }).sort(function (a, b) {
908
+ return a[__order] - b[__order];
909
+ }).map(function (m, inx) {
910
+ var levelTmp = level ? level + '/' + inx : inx;
911
+ var pathTmp = path ? path + '/' + m[__id] : m[__id];
912
+ var childrenTmp = _this2.enhanceArrToTree(arry, porpsMapping, m[__id], pathTmp, levelTmp);
913
+ def(m, __level, levelTmp);
914
+ def(m, __order, inx);
915
+ def(m, __path, pathTmp);
916
+ if (childrenTmp.length) {
917
+ m[__children] = childrenTmp;
918
+ } else {
919
+ delete m[__children];
920
+ }
921
+ return m;
922
+ });
923
+ }
924
+ }, {
925
+ key: "use",
926
+ value: function use(obj) {
927
+ var _obj$install;
928
+ (_obj$install = obj.install) === null || _obj$install === void 0 || _obj$install.call(this);
929
+ }
930
+ }, {
931
+ key: "registerCommand",
932
+ value: function registerCommand(commandNames) {
933
+ var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
934
+ init: new Function(),
935
+ execCommand: '',
936
+ queryCommandState: '',
937
+ queryCommandValue: ''
938
+ };
939
+ var _iterator = _createForOfIteratorHelper(trim(commandNames).split(/\s+/)),
940
+ _step;
941
+ try {
942
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
943
+ var commandName = _step.value;
944
+ if (this.commands && Object.hasOwn(this.commands, commandName)) {
945
+ process.env.VUE_APP_ENV == "development" && console.warn("\u3010warning\u3011\uFF1A".concat(commandName, "\u547D\u4EE4\u540D\u5B58\u5728\u76F8\u540C,\u65E0\u6CD5\u6CE8\u518C"));
946
+ }
947
+ if (isFunction(payload)) {
948
+ payload.apply(this, arguments);
949
+ } else {
950
+ if (isFunction(payload.init)) {
951
+ payload.init.apply(this, arguments);
952
+ }
953
+ this.commands ? this.commands[commandName] = payload : this.commands = _defineProperty({}, commandName, payload);
954
+ }
955
+ }
956
+ } catch (err) {
957
+ _iterator.e(err);
958
+ } finally {
959
+ _iterator.f();
960
+ }
961
+ }
962
+ }, {
963
+ key: "getAddressInfoList",
964
+ value: function getAddressInfoList(codeOrCodeArrTmp, formInline) {
965
+ var _this3 = this;
966
+ var cacheCodeTmp = JSON.parse(JSON.stringify(codeOrCodeArrTmp));
967
+ // 通过城市id查询所属
968
+ function findItorByCityNode(codeTmp, addressList, porpsMapping) {
969
+ var value = porpsMapping.value,
970
+ children = porpsMapping.children;
971
+ var find = {};
972
+ function itorCity(data, code) {
973
+ var _iterator2 = _createForOfIteratorHelper(data),
974
+ _step2;
975
+ try {
976
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
977
+ var item = _step2.value;
978
+ if (item[value] === code) {
979
+ find = item;
980
+ return true;
981
+ }
982
+ if (item[children] && item[children].length) {
983
+ var result = itorCity(item[children], code);
984
+ if (result) return result;
985
+ }
986
+ }
987
+ } catch (err) {
988
+ _iterator2.e(err);
989
+ } finally {
990
+ _iterator2.f();
991
+ }
992
+ }
993
+ itorCity(addressList, codeTmp);
994
+ return find;
995
+ }
996
+
997
+ // 传入数据获取地址对象数组
998
+ function mapAddListByCityCode(codeOrCodeArr, addressList, porpsMapping) {
999
+ var _findItorByCityNode;
1000
+ var cityArr = Array.isArray(codeOrCodeArr) ? codeOrCodeArr : (_findItorByCityNode = findItorByCityNode(codeOrCodeArr, addressList, porpsMapping)) === null || _findItorByCityNode === void 0 || (_findItorByCityNode = _findItorByCityNode._path) === null || _findItorByCityNode === void 0 ? void 0 : _findItorByCityNode.split('/');
1001
+ var value = porpsMapping.value,
1002
+ label = porpsMapping.label;
1003
+ return (cityArr === null || cityArr === void 0 ? void 0 : cityArr.map(function (m) {
1004
+ var find = findItorByCityNode(m, addressList, porpsMapping);
1005
+ return {
1006
+ value: find[value],
1007
+ label: find[label]
1008
+ };
1009
+ })) || [];
1010
+ }
1011
+ var PFetch = new Promise(function (resolve) {
1012
+ _this3.getOptions().requestParentAddressByParam(function (param) {
1013
+ if (!param) {
1014
+ resolve([]);
1015
+ return;
1016
+ }
1017
+ var addressMapping = param.addressMapping;
1018
+ var addressList = Array.isArray(param) ? param : (param === null || param === void 0 ? void 0 : param.addressList) || [];
1019
+ var addressCascaderProps = Object.assign({
1020
+ children: 'children',
1021
+ label: 'name',
1022
+ value: 'code',
1023
+ parentId: 'parentCode'
1024
+ }, addressMapping || {});
1025
+ var addressCascaderOptions = _this3.enhanceArrToTree(addressList, {
1026
+ _id: addressCascaderProps.value,
1027
+ _parentId: addressCascaderProps.parentId,
1028
+ _children: addressCascaderProps.children
1029
+ });
1030
+ var addlist = mapAddListByCityCode(codeOrCodeArrTmp, addressCascaderOptions, {
1031
+ label: addressCascaderProps.label,
1032
+ value: addressCascaderProps.value,
1033
+ children: addressCascaderProps.children
1034
+ });
1035
+ resolve(addlist);
1036
+
1037
+ //const addressCascaderOptions = this.enhanceArrToTree(param, { _id: 'code', _parentId: 'parentCode', _children: 'children' })
1038
+ //const addlist = mapAddListByCityCode(codeOrCodeArrTmp, addressCascaderOptions, { label:'name', value:'code', children: 'children' })
1039
+ //resolve(addlist)
1040
+ }, Array.isArray(cacheCodeTmp) ? cacheCodeTmp.pop() : codeOrCodeArrTmp, formInline);
1041
+ });
1042
+ var PTime = new Promise(function (_, reject) {
1043
+ setTimeout(function () {
1044
+ reject(new Error('操作超时')); // 在指定时间后拒绝 Promise
1045
+ }, 8000);
1046
+ });
1047
+ return Promise.race([PFetch, PTime]).then(function (result) {
1048
+ return result;
1049
+ })["catch"](function (_) {
1050
+ return [];
1051
+ });
1052
+ }
1053
+
1054
+ // 当时节点是否在helper_data_cache_id节点中
1055
+ }, {
1056
+ key: "itorParentCacheId",
1057
+ value: function itorParentCacheId(node) {
1058
+ var isInsideFlag = false,
1059
+ currentNode = node,
1060
+ directNode = node;
1061
+ while (currentNode && !isInsideFlag && !['BODY', 'DIV'].includes(currentNode.nodeName)) {
1062
+ if (currentNode.hasAttribute('helper_data_cache_id')) {
1063
+ isInsideFlag = true;
1064
+ break;
1065
+ }
1066
+ currentNode = currentNode.parentNode;
1067
+ }
1068
+ return {
1069
+ isInsideFlag: isInsideFlag,
1070
+ currentNode: currentNode,
1071
+ directNode: directNode
1072
+ };
1073
+ }
1074
+
1075
+ /**
1076
+ * 简单的数组转成树函数
1077
+ * @param currentNodeTemp ***当前节点
1078
+ * @param contentValueTemp 更新值
1079
+ * @param attrTemp bse属性
1080
+ * @param valueDefaultPropsTemp 值的映射关系(诊断控件)
1081
+ * @param versionControl 动态字典版本控制
1082
+ */
1083
+ }, {
1084
+ key: "forceUpdateFun",
1085
+ value: (function () {
1086
+ var _forceUpdateFun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(elSrc, contentValueTemp, attrTemp, editAreaTmp, valueDefaultPropsTemp, versionControl) {
1087
+ var _this4 = this,
1088
+ _bse_options,
1089
+ _bse_options$find,
1090
+ _this$getOptions2,
1091
+ _filter,
1092
+ _ref,
1093
+ _this$getOptions3,
1094
+ _this$getOptions4,
1095
+ _this$getOptions5;
1096
+ var editArea, currentNodeTemp, _iterator4, _step4, input, _iterator5, _step5, _contentValueTemp$inc, _contentValueTemp$inc2, _input, bse_options, bse_options_cache_axios_obj, matchLabel, emspLen, createText, addOrder, addCommaFullstop, diagnoseMapping, filterShowList, diagnoseNewAttr, addOrderNumber, addChinaOrderNumber, showDiagnoseType, showDiagnoseTitle, signTitleLabel, signDateLabel, sectionStart, splitCharList, diagnoseTypeLabel, showDescribe, _comChildLi, diagnoseSingMapping, comSignList, elSrcSpanWarp, surgeryNewAttr, surgeryMapping, innerHTMLStr, _contentValueTemp, CheckIsChinese, addressArr, showLabel, addCode, _addCode, addressNewAttr, singMapping, bse_signList_temp, signNewAttr, bse_signList, showList, mode, jobsort, bae_signList_temp, dateNewAttr, currentDate, valueArr;
1097
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1098
+ while (1) switch (_context.prev = _context.next) {
1099
+ case 0:
1100
+ editArea = editAreaTmp || this.getEditorPageArea();
1101
+ currentNodeTemp = function (_elSrc$querySelector) {
1102
+ var childId = elSrc.getAttribute('helper_data_cache_child_id') || ((_elSrc$querySelector = elSrc.querySelector('*[helper_data_cache_child_id]')) === null || _elSrc$querySelector === void 0 ? void 0 : _elSrc$querySelector.getAttribute('helper_data_cache_child_id'));
1103
+ if (childId) {
1104
+ var _result$querySelector, _result$querySelector2;
1105
+ var childList = editArea.querySelectorAll("*[helper_data_cache_child_id=\"".concat(childId, "\"]"));
1106
+ var result = null;
1107
+ var len = childList.length;
1108
+ for (var inx = len - 1; inx >= 0; inx--) {
1109
+ if (inx) {
1110
+ var elScrEle = getItorElementBseAttrAndEl(childList[inx]).elSrc;
1111
+ elScrEle.remove();
1112
+ console.log('remove break ele');
1113
+ } else {
1114
+ result = getItorElementBseAttrAndEl(childList[inx]).elSrc;
1115
+ }
1116
+ }
1117
+ (_result$querySelector = result.querySelector('*[helper_data_cache_child_id]')) === null || _result$querySelector === void 0 || (_result$querySelector2 = _result$querySelector.removeAttribute) === null || _result$querySelector2 === void 0 || _result$querySelector2.call(_result$querySelector, 'helper_data_cache_child_id');
1118
+ var _this4$itorParentCach = _this4.itorParentCacheId(result),
1119
+ isInsideFlag = _this4$itorParentCach.isInsideFlag,
1120
+ currentNode = _this4$itorParentCach.currentNode;
1121
+ if (isInsideFlag && !currentNode.querySelector('*[helper_data_cache_child_id]')) {
1122
+ currentNode.removeAttribute('helper_data_cache_id');
1123
+ currentNode.removeAttribute('helper_data_last_break_ele');
1124
+ }
1125
+ if (editAreaTmp) {
1126
+ var _iterator3 = _createForOfIteratorHelper([].slice.call(result.querySelectorAll('*[helper_data_virtual_id]'))),
1127
+ _step3;
1128
+ try {
1129
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1130
+ var virtual = _step3.value;
1131
+ virtual.removeAttribute('helper_data_virtual_id');
1132
+ virtual.removeAttribute('helper_data_virtual_node');
1133
+ }
1134
+ } catch (err) {
1135
+ _iterator3.e(err);
1136
+ } finally {
1137
+ _iterator3.f();
1138
+ }
1139
+ }
1140
+ return result;
1141
+ } else {
1142
+ return elSrc;
1143
+ }
1144
+ }();
1145
+ if (currentNodeTemp) {
1146
+ _context.next = 4;
1147
+ break;
1148
+ }
1149
+ return _context.abrupt("return");
1150
+ case 4:
1151
+ _context.t0 = attrTemp.type;
1152
+ _context.next = _context.t0 === "radio" ? 7 : _context.t0 === "checkbox" ? 29 : _context.t0 === "select" ? 32 : _context.t0 === "diagnose" ? 44 : _context.t0 === "surgery" ? 61 : _context.t0 === "address" ? 68 : _context.t0 === "sign" ? 93 : _context.t0 === "date" ? 101 : _context.t0 === "bloodPressure" ? 103 : _context.t0 === "picturePlaceholder" ? 107 : 109;
1153
+ break;
1154
+ case 7:
1155
+ _iterator4 = _createForOfIteratorHelper([].slice.call(currentNodeTemp.querySelectorAll("input")));
1156
+ _context.prev = 8;
1157
+ _iterator4.s();
1158
+ case 10:
1159
+ if ((_step4 = _iterator4.n()).done) {
1160
+ _context.next = 20;
1161
+ break;
1162
+ }
1163
+ input = _step4.value;
1164
+ if (![input.getAttribute("value"), input.getAttribute("label")].includes(contentValueTemp)) {
1165
+ _context.next = 17;
1166
+ break;
1167
+ }
1168
+ input.setAttribute('checked', 'checked');
1169
+ // input.checked = true
1170
+ return _context.abrupt("break", 20);
1171
+ case 17:
1172
+ input.removeAttribute('checked');
1173
+ // input.checked = false
1174
+ case 18:
1175
+ _context.next = 10;
1176
+ break;
1177
+ case 20:
1178
+ _context.next = 25;
1179
+ break;
1180
+ case 22:
1181
+ _context.prev = 22;
1182
+ _context.t1 = _context["catch"](8);
1183
+ _iterator4.e(_context.t1);
1184
+ case 25:
1185
+ _context.prev = 25;
1186
+ _iterator4.f();
1187
+ return _context.finish(25);
1188
+ case 28:
1189
+ return _context.abrupt("break", 111);
1190
+ case 29:
1191
+ _iterator5 = _createForOfIteratorHelper([].slice.call(currentNodeTemp.querySelectorAll("input")));
1192
+ try {
1193
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1194
+ _input = _step5.value;
1195
+ if (contentValueTemp !== null && contentValueTemp !== void 0 && (_contentValueTemp$inc = contentValueTemp.includes) !== null && _contentValueTemp$inc !== void 0 && _contentValueTemp$inc.call(contentValueTemp, _input.getAttribute("value")) || contentValueTemp !== null && contentValueTemp !== void 0 && (_contentValueTemp$inc2 = contentValueTemp.includes) !== null && _contentValueTemp$inc2 !== void 0 && _contentValueTemp$inc2.call(contentValueTemp, _input.getAttribute("label"))) {
1196
+ _input.setAttribute('checked', 'checked');
1197
+ // input.checked = true
1198
+ } else {
1199
+ _input.removeAttribute('checked');
1200
+ // input.checked = false
1201
+ }
1202
+ }
1203
+ } catch (err) {
1204
+ _iterator5.e(err);
1205
+ } finally {
1206
+ _iterator5.f();
1207
+ }
1208
+ return _context.abrupt("break", 111);
1209
+ case 32:
1210
+ bse_options = [];
1211
+ if (!(attrTemp.bse_card === 'axios')) {
1212
+ _context.next = 40;
1213
+ break;
1214
+ }
1215
+ _context.next = 36;
1216
+ return awaitDictoryResultMiddle.call(this, attrTemp, versionControl);
1217
+ case 36:
1218
+ bse_options_cache_axios_obj = _context.sent;
1219
+ bse_options = this.getRadioCheckDynamicMappingValue(bse_options_cache_axios_obj);
1220
+ _context.next = 41;
1221
+ break;
1222
+ case 40:
1223
+ bse_options = attrTemp.bse_options;
1224
+ case 41:
1225
+ matchLabel = (_bse_options = bse_options) === null || _bse_options === void 0 || (_bse_options$find = _bse_options.find) === null || _bse_options$find === void 0 || (_bse_options$find = _bse_options$find.call(_bse_options, function (f) {
1226
+ return [f.value, f.label].includes(contentValueTemp);
1227
+ })) === null || _bse_options$find === void 0 ? void 0 : _bse_options$find.label;
1228
+ currentNodeTemp.querySelector("label").innerHTML = matchLabel || '';
1229
+ return _context.abrupt("break", 111);
1230
+ case 44:
1231
+ /* 递归算出树形数据 用于诊断控件层级渲染 */
1232
+ emspLen = function emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle) {
1233
+ // 生成空格符号
1234
+ var spaceLen = level;
1235
+ if (!sectionStart && showDiagnoseType && showDiagnoseTitle) {
1236
+ if (level > 1) {
1237
+ spaceLen -= 2;
1238
+ }
1239
+ spaceLen *= 2;
1240
+ } else {
1241
+ if (sectionStart) {
1242
+ if (inx === 'sign') {
1243
+ if (!showDiagnoseType || !showDiagnoseTitle) spaceLen--;
1244
+ spaceLen *= 2;
1245
+ } else {
1246
+ if (!showDiagnoseType) spaceLen--;
1247
+ if (!showDiagnoseTitle) spaceLen--;
1248
+ spaceLen *= 2;
1249
+ }
1250
+ } else {
1251
+ if (!showDiagnoseType && showDiagnoseTitle) {
1252
+ if (level === 1) {
1253
+ spaceLen--;
1254
+ } else if (level === 2) {
1255
+ if (inx === 0) {
1256
+ spaceLen -= 2;
1257
+ } else {
1258
+ spaceLen *= 2;
1259
+ spaceLen++;
1260
+ }
1261
+ } else if (level) {
1262
+ spaceLen *= 2;
1263
+ spaceLen++;
1264
+ }
1265
+ } else if (showDiagnoseType && !showDiagnoseTitle) {
1266
+ spaceLen--;
1267
+ spaceLen *= 2;
1268
+ } else if (!showDiagnoseType && !showDiagnoseTitle) {
1269
+ spaceLen -= 2;
1270
+ spaceLen *= 2;
1271
+ }
1272
+ }
1273
+ }
1274
+ return Array(spaceLen).fill().map(function () {
1275
+ return '&emsp;';
1276
+ }).join("");
1277
+ };
1278
+ createText = function createText(sectionStart, showDiagnoseType, showDiagnoseTitle) {
1279
+ // 生成空白标签
1280
+ var exist = true;
1281
+ if (!showDiagnoseType || !showDiagnoseTitle || sectionStart) exist = false;
1282
+ return exist ? "<text style=\"display:inline-block;\">".concat(Array(7).fill().map(function () {
1283
+ return "&emsp;";
1284
+ }).join(""), "</text>") : '';
1285
+ };
1286
+ addOrder = function addOrder(sort, inx) {
1287
+ // 添加需要
1288
+ return sort ? inx + 1 + "." : "";
1289
+ };
1290
+ addCommaFullstop = function addCommaFullstop(inx, diagnoseArr) {
1291
+ // 添加需要
1292
+ var len = diagnoseArr.length;
1293
+ return inx + 1 === len ? "。" : ",";
1294
+ };
1295
+ diagnoseMapping = _objectSpread(_objectSpread(_objectSpread({}, optionsDefault.diagnoseFieldsMapping), (_this$getOptions2 = this.getOptions()) === null || _this$getOptions2 === void 0 ? void 0 : _this$getOptions2.diagnoseFieldsMapping), valueDefaultPropsTemp);
1296
+ filterShowList = ((_filter = (_ref = contentValueTemp || []).filter) === null || _filter === void 0 ? void 0 : _filter.call(_ref, function (f) {
1297
+ return [attrTemp.diagnoseType.label, attrTemp.diagnoseType.value].includes(f[diagnoseMapping["类型"]]) && (attrTemp.chineseAndWesternType === '中西医诊断' ? true : attrTemp.chineseAndWesternType === f[diagnoseMapping["分类"]]);
1298
+ })) || [];
1299
+ diagnoseNewAttr = _objectSpread(_objectSpread({}, attrTemp), {}, {
1300
+ bse_multipleSelection: filterShowList !== null && filterShowList !== void 0 ? filterShowList : []
1301
+ });
1302
+ currentNodeTemp.setAttribute("bse", encodeURIComponent(JSON.stringify(diagnoseNewAttr)));
1303
+ filterShowList = function () {
1304
+ if (filterShowList) {
1305
+ var treelist = arrToTree(filterShowList, undefined, diagnoseMapping); // .sort((a, b) => a[diagnoseMapping["序号"]] - b[diagnoseMapping["序号"]])
1306
+ var typeList = treelist.reduce(function (pre, cur) {
1307
+ var find = pre.find(function (s) {
1308
+ return s.label === cur[diagnoseMapping["类型"]];
1309
+ });
1310
+ if (find) {
1311
+ find[diagnoseMapping["子集"]].push(cur);
1312
+ } else {
1313
+ pre.push(_defineProperty({
1314
+ label: cur[diagnoseMapping["类型"]]
1315
+ }, diagnoseMapping["子集"], [cur]));
1316
+ }
1317
+ return pre;
1318
+ }, []);
1319
+ var finalyList = typeList.reduce(function (pre, cur) {
1320
+ pre.push(_objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, diagnoseMapping["子集"], cur[diagnoseMapping["子集"]].reduce(function (pre, cur) {
1321
+ var find = pre.find(function (s) {
1322
+ return s.label === cur[diagnoseMapping["分类"]];
1323
+ });
1324
+ if (find) {
1325
+ find[diagnoseMapping["子集"]].push(cur);
1326
+ } else {
1327
+ pre.push(_defineProperty({
1328
+ label: cur[diagnoseMapping["分类"]]
1329
+ }, diagnoseMapping["子集"], [cur]));
1330
+ }
1331
+ return pre;
1332
+ }, []))));
1333
+ return pre;
1334
+ }, []);
1335
+ return finalyList;
1336
+ } else {
1337
+ return {};
1338
+ }
1339
+ }();
1340
+ addOrderNumber = attrTemp.addOrderNumber, addChinaOrderNumber = attrTemp.addChinaOrderNumber, showDiagnoseType = attrTemp.showDiagnoseType, showDiagnoseTitle = attrTemp.showDiagnoseTitle, signTitleLabel = attrTemp.signTitleLabel, signDateLabel = attrTemp.signDateLabel, sectionStart = attrTemp.sectionStart, splitCharList = attrTemp.splitCharList, diagnoseTypeLabel = attrTemp.diagnoseTypeLabel, showDescribe = attrTemp.showDescribe;
1341
+ _comChildLi = function comChildLi(diagnoseArr, modeName, level, showDiagnoseTypeTmp, showDiagnoseTitleTmp, diagnoseMappingAttr) {
1342
+ return "".concat(diagnoseArr.map(function (li, inx) {
1343
+ return {
1344
+ horizontal: function horizontal() {
1345
+ return "".concat([0, 1].includes(level) ? "".concat(level === 0 ? "".concat(showDiagnoseType ? "<text style=\"font-size: initial;font-weight: bold;\">".concat(diagnoseTypeLabel || li.label, " </text>") : '') : "".concat(showDiagnoseTitle ? "<text style=\"font-size: initial;\">".concat(li.label, ": </text>") : '')) : "".concat(li[diagnoseMappingAttr["分类"]] === '中医诊断' ? "".concat(addOrder(addChinaOrderNumber && level === 2, inx), "<text style=\"font-size: initial;\">").concat(li[diagnoseMappingAttr[showDescribe ? "病描述" : "病名"]] || '', "</text>\n <text style=\"font-size: initial;\">").concat(splitCharList[0] || ' ').concat(li[diagnoseMappingAttr[showDescribe ? "症描述" : "症名"]]).concat(splitCharList[1] || ' ', "</text>").concat(addCommaFullstop(inx, diagnoseArr)) : "".concat(addOrder(addOrderNumber && level === 2, inx), "<text style=\"font-size: initial;\">").concat(li[diagnoseMappingAttr[showDescribe ? "诊断描述" : "诊断名"]] || '', "</text>").concat(addCommaFullstop(inx, diagnoseArr))), "\n ").concat(li[diagnoseMappingAttr["子集"]] && li[diagnoseMappingAttr["子集"]].length ? _comChildLi(li[diagnoseMappingAttr["子集"]], modeName, level + 1, showDiagnoseTypeTmp, showDiagnoseTitleTmp, diagnoseMappingAttr) : '');
1346
+ },
1347
+ vertical: function vertical() {
1348
+ return "".concat(li[diagnoseMappingAttr["分类"]] === '中医诊断' ? [0, 1, 2].includes(level) ? "".concat(level === 0 ? showDiagnoseType ? "<text style=\"font-size: initial;display:block;font-size: initial;\">".concat(diagnoseTypeLabel || li.label, "</text>") : '' : level === 1 ? showDiagnoseTitle ? "<text style=\"display:block;\"></text><text style=\"font-size: initial;display:".concat(sectionStart ? 'block' : 'inline-block', ";\"><text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(li.label, "\uFF1A</text></text>") : '' : "<text style=\"font-size: initial;display:".concat(!sectionStart && inx === 0 ? 'inline-block' : 'block', ";\">").concat(!sectionStart && inx === 0 ? '' : "".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle)), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(addOrder(addChinaOrderNumber && level === 2, inx)).concat(li[diagnoseMappingAttr[showDescribe ? "病描述" : "病名"]] || '', "</text></text>") + "<text style=\"font-size: initial;display:block\">".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level + 1, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(li[diagnoseMappingAttr[showDescribe ? "症描述" : "症名"]] || '', "</text></text>")
1349
+ // 中西医差异
1350
+ ) : "<text style=\"font-size: initial;display:block\">".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(addOrder(addChinaOrderNumber && level === 2, inx)).concat(li[diagnoseMappingAttr[showDescribe ? "病描述" : "病名"]] || '', "</text></text>") + "<text style=\"font-size: initial;display:block\">".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level + 1, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(li[diagnoseMappingAttr[showDescribe ? "症描述" : "症名"]] || '', "</text></text>")
1351
+ // 中西医差异
1352
+ : [0, 1, 2].includes(level) ? "".concat(level === 0 ? showDiagnoseType ? "<text style=\"font-size: initial;display:block;\">".concat(diagnoseTypeLabel || li.label, "</text>") : '' : level === 1 ? showDiagnoseTitle ? "<text style=\"display:block;\"></text><text style=\"font-size: initial;display:".concat(sectionStart ? 'block' : 'inline-block', ";\"><text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(li.label, "\uFF1A</text></text>") : '' : "<text style=\"font-size: initial;display:".concat(!sectionStart && inx === 0 ? 'inline-block' : 'block', ";\">").concat(!sectionStart && inx === 0 ? '' : "".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle)), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(addOrder(addOrderNumber && level === 2, inx)).concat(li[diagnoseMappingAttr[showDescribe ? "诊断描述" : "诊断名"]] || '', "</text></text>")) : "<text style=\"font-size: initial;display:block\">".concat(createText(sectionStart, showDiagnoseType, showDiagnoseTitle), "<text style=\"font-size: initial;display: inline-block;\">").concat(emspLen(level, inx, sectionStart, showDiagnoseType, showDiagnoseTitle)).concat(addOrder(addOrderNumber && level === 2, inx)).concat(li[diagnoseMappingAttr[showDescribe ? "诊断描述" : "诊断名"]] || '', "</text></text>"), "\n ").concat(li[diagnoseMappingAttr["子集"]] && li[diagnoseMappingAttr["子集"]].length ? _comChildLi(li[diagnoseMappingAttr["子集"]], modeName, level + 1, showDiagnoseTypeTmp, showDiagnoseTitleTmp, diagnoseMappingAttr) : '');
1353
+ }
1354
+ }[modeName]();
1355
+ }).join(""));
1356
+ };
1357
+ diagnoseSingMapping = _objectSpread(_objectSpread({}, optionsDefault.signFieldsMapping), (_this$getOptions3 = this.getOptions()) === null || _this$getOptions3 === void 0 ? void 0 : _this$getOptions3.signFieldsMapping);
1358
+ comSignList = function comSignList(modeName, signMappingAttr, signTitleLabel, signDateLabel, showDiagnoseTypeTmp, showDiagnoseTitleTmp, attrTemp) {
1359
+ var diagnoseArr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : [];
1360
+ var userInfo = _this4.getUserInfoData();
1361
+ var signShowArr = attrTemp.showList || [];
1362
+ return "".concat({
1363
+ horizontal: function (_diagnoseArr$diagnose2) {
1364
+ return "\n ".concat(signShowArr.length ? '<text style="display: block;height: 0px;margin: 0;"></text>' : '', "\n ").concat(signShowArr.some(function (s) {
1365
+ return ['职称', '姓名'].includes(s);
1366
+ }) ? "<text style=\"font-size: initial;\"><text style=\"display:inline-block;width: ".concat(showDiagnoseTypeTmp ? '88pt' : '63pt', ";text-align: right;\">").concat(signTitleLabel || '医师签名', "\uFF1A</text>").concat(signShowArr.filter(function (f) {
1367
+ return ['职称', '姓名'].includes(f);
1368
+ }).map(function (li) {
1369
+ if (li === '职称') {
1370
+ return "(".concat(userInfo[signMappingAttr[li]] || '', ")");
1371
+ }
1372
+ if (li === '姓名') {
1373
+ var _diagnoseArr$diagnose;
1374
+ return ((_diagnoseArr$diagnose = diagnoseArr[diagnoseArr.length]) === null || _diagnoseArr$diagnose === void 0 ? void 0 : _diagnoseArr$diagnose[diagnoseMapping['诊断医生']]) || userInfo[signMappingAttr[li]] || '';
1375
+ }
1376
+ return userInfo[signMappingAttr[li]] || '';
1377
+ }).join(" "), "</text>") : '', "\n ").concat(signShowArr.some(function (s) {
1378
+ return ['日期'].includes(s);
1379
+ }) ? "<text style=\"font-size: initial;\"><text style=\"display:inline-block;width: ".concat(showDiagnoseTypeTmp ? '88pt' : '63pt', ";text-align: right;\">").concat(signDateLabel || '日期', "\uFF1A</text><text bse_child=\"diagnoseDdate\">").concat(dateFormat(((_diagnoseArr$diagnose2 = diagnoseArr[diagnoseArr.length]) === null || _diagnoseArr$diagnose2 === void 0 ? void 0 : _diagnoseArr$diagnose2[diagnoseMapping['诊断日期']]) || userInfo[signMappingAttr['日期']] || new Date(), attrTemp.diagDateFormat || "yyyy-MM-dd"), "</text></text>") : '', "\n ");
1380
+ }(),
1381
+ // ${
1382
+ // signShowArr.length ? '<text style="display: block;background: #999;height: 1px;margin: 2px 0;"></text>' : ''
1383
+ // }
1384
+ vertical: function (_diagnoseArr$diagnose4) {
1385
+ return "\n ".concat(signShowArr.some(function (s) {
1386
+ return ['职称', '姓名'].includes(s);
1387
+ }) ? "<text style=\"display: block;font-size: initial;\"><text style=\"display:inline-block;text-align: right;\">".concat(emspLen(1, 'sign', true, showDiagnoseTypeTmp, showDiagnoseTitleTmp)).concat(signTitleLabel || '医师签名', "\uFF1A</text>").concat(signShowArr.filter(function (f) {
1388
+ return ['职称', '姓名'].includes(f);
1389
+ }).map(function (li) {
1390
+ if (li === '职称') {
1391
+ return "(".concat(userInfo[signMappingAttr[li]] || '', ")");
1392
+ }
1393
+ if (li === '姓名') {
1394
+ var _diagnoseArr$diagnose3;
1395
+ return ((_diagnoseArr$diagnose3 = diagnoseArr[diagnoseArr.length]) === null || _diagnoseArr$diagnose3 === void 0 ? void 0 : _diagnoseArr$diagnose3[diagnoseMapping['诊断医生']]) || userInfo[signMappingAttr[li]] || '';
1396
+ }
1397
+ return userInfo[signMappingAttr[li]] || '';
1398
+ }).join(" "), "</text>") : '', "\n ").concat(signShowArr.some(function (s) {
1399
+ return ['日期'].includes(s);
1400
+ }) ? "<text style=\"display: block;font-size: initial;\"><text style=\"display:inline-block;text-align: right;\">".concat(emspLen(2, 'sign', true, showDiagnoseTypeTmp, showDiagnoseTitleTmp)).concat(signDateLabel || '日期', "\uFF1A</text><text bse_child=\"diagnoseDdate\">").concat(dateFormat(((_diagnoseArr$diagnose4 = diagnoseArr[diagnoseArr.length]) === null || _diagnoseArr$diagnose4 === void 0 ? void 0 : _diagnoseArr$diagnose4[diagnoseMapping['诊断日期']]) || userInfo[signMappingAttr['日期']] || new Date(), attrTemp.diagDateFormat || "yyyy-MM-dd"), "</text></text>") : '', "\n ");
1401
+ }()
1402
+ }[modeName]);
1403
+ }; // const styleStr = attrTemp.mode === 'vertical' ? 'display:inline-flex;font-size: 0;' : 'display:unset;'
1404
+ // currentNodeTemp.querySelector("span").setAttribute('style', styleStr)
1405
+ elSrcSpanWarp = currentNodeTemp.querySelector("span");
1406
+ if (attrTemp.mode === 'vertical') {
1407
+ !elSrcSpanWarp.classList.contains("inline-flex") && elSrcSpanWarp.classList.add("inline-flex");
1408
+ !elSrcSpanWarp.classList.contains("text-zero") && elSrcSpanWarp.classList.add("text-zero");
1409
+ } else {
1410
+ elSrcSpanWarp.classList.contains("inline-flex") && elSrcSpanWarp.classList.remove("inline-flex");
1411
+ elSrcSpanWarp.classList.contains("text-zero") && elSrcSpanWarp.classList.remove("text-zero");
1412
+ }
1413
+ currentNodeTemp.querySelector("label").innerHTML = filterShowList.length ? "".concat(_comChildLi(filterShowList, attrTemp.mode, 0, showDiagnoseType, showDiagnoseTitle, diagnoseMapping)).concat(comSignList(attrTemp.mode, diagnoseSingMapping, signTitleLabel, signDateLabel, showDiagnoseType, showDiagnoseTitle, attrTemp, filterShowList)) : "";
1414
+ return _context.abrupt("break", 111);
1415
+ case 61:
1416
+ surgeryNewAttr = _objectSpread(_objectSpread({}, attrTemp), {}, {
1417
+ bse_surgeryList: contentValueTemp !== null && contentValueTemp !== void 0 ? contentValueTemp : []
1418
+ });
1419
+ currentNodeTemp.setAttribute("bse", encodeURIComponent(JSON.stringify(surgeryNewAttr)));
1420
+ surgeryMapping = _objectSpread(_objectSpread(_objectSpread({}, optionsDefault.surgeryFieldsMapping), (_this$getOptions4 = this.getOptions()) === null || _this$getOptions4 === void 0 ? void 0 : _this$getOptions4.surgeryFieldsMapping), valueDefaultPropsTemp);
1421
+ innerHTMLStr = '';
1422
+ if (contentValueTemp.length) {
1423
+ if (['手术名', '手术描述'].includes(attrTemp.fieldName)) {
1424
+ innerHTMLStr = contentValueTemp.map(function (surgery, inx) {
1425
+ var surgeryName = surgery[surgeryMapping[attrTemp.fieldName]];
1426
+ return "".concat(inx + 1, ".").concat(surgeryName);
1427
+ }).join('');
1428
+ } else {
1429
+ innerHTMLStr = ((_contentValueTemp = contentValueTemp[contentValueTemp.length - 1]) === null || _contentValueTemp === void 0 ? void 0 : _contentValueTemp[surgeryMapping[attrTemp.fieldName] || '']) || '';
1430
+ }
1431
+ } else {
1432
+ innerHTMLStr = '';
1433
+ }
1434
+ currentNodeTemp.querySelector("label").innerHTML = innerHTMLStr || '';
1435
+ return _context.abrupt("break", 111);
1436
+ case 68:
1437
+ CheckIsChinese = function CheckIsChinese(str, val) {
1438
+ return new RegExp("[".concat(str, "]+"), "g").test(val);
1439
+ };
1440
+ addressArr = [], showLabel = '';
1441
+ if (!Array.isArray(contentValueTemp)) {
1442
+ _context.next = 78;
1443
+ break;
1444
+ }
1445
+ addCode = JSON.parse(JSON.stringify(contentValueTemp)).pop();
1446
+ _context.next = 74;
1447
+ return this.getAddressInfoList(addCode, attrTemp);
1448
+ case 74:
1449
+ addressArr = _context.sent;
1450
+ showLabel = addressArr.map(function (m) {
1451
+ return m.label;
1452
+ }).join('/') || "";
1453
+ _context.next = 89;
1454
+ break;
1455
+ case 78:
1456
+ if (!CheckIsChinese("\\u4E00-\\u9FFF", contentValueTemp)) {
1457
+ _context.next = 83;
1458
+ break;
1459
+ }
1460
+ // *特殊中文直接渲染中文不发请求
1461
+ addressArr = [{
1462
+ value: '编辑器 - 字段绑定为地区中文名!无法查询地区code',
1463
+ name: contentValueTemp
1464
+ }];
1465
+ showLabel = contentValueTemp;
1466
+ _context.next = 89;
1467
+ break;
1468
+ case 83:
1469
+ _addCode = ''; // 用于接口查询code
1470
+ if (CheckIsChinese('\/\|\-', contentValueTemp)) {
1471
+ // 地址传参 | / - Array 支持四种形式
1472
+ _addCode = contentValueTemp.split(/(\/|\||\-)/).pop();
1473
+ } else {
1474
+ _addCode = contentValueTemp;
1475
+ }
1476
+ _context.next = 87;
1477
+ return this.getAddressInfoList(_addCode, attrTemp);
1478
+ case 87:
1479
+ addressArr = _context.sent;
1480
+ showLabel = addressArr.map(function (m) {
1481
+ return m.label;
1482
+ }).join('/') || "";
1483
+ case 89:
1484
+ addressNewAttr = _objectSpread(_objectSpread({}, attrTemp), {}, {
1485
+ bse_address: addressArr
1486
+ });
1487
+ currentNodeTemp.setAttribute("bse", encodeURIComponent(JSON.stringify(addressNewAttr)));
1488
+ currentNodeTemp.querySelector("label").innerHTML = showLabel;
1489
+ return _context.abrupt("break", 111);
1490
+ case 93:
1491
+ singMapping = _objectSpread(_objectSpread({}, optionsDefault.signFieldsMapping), (_this$getOptions5 = this.getOptions()) === null || _this$getOptions5 === void 0 ? void 0 : _this$getOptions5.signFieldsMapping);
1492
+ bse_signList_temp = contentValueTemp !== null && contentValueTemp !== void 0 ? contentValueTemp : [];
1493
+ signNewAttr = _objectSpread(_objectSpread({}, attrTemp), {}, {
1494
+ bse_signList: bse_signList_temp
1495
+ });
1496
+ currentNodeTemp.setAttribute("bse", encodeURIComponent(JSON.stringify(signNewAttr)));
1497
+ bse_signList = signNewAttr.bse_signList, showList = signNewAttr.showList, mode = signNewAttr.mode, jobsort = signNewAttr.jobsort;
1498
+ bae_signList_temp = bse_signList.length ? bse_signList.sort(function (a, b) {
1499
+ return jobsort === "asc" ? a[singMapping["等级"]] - b[singMapping["等级"]] : b[singMapping["等级"]] - a[singMapping["等级"]];
1500
+ }) : [];
1501
+ currentNodeTemp.querySelector("label").innerHTML = "".concat(bae_signList_temp.map(function (m) {
1502
+ return "<text style=\"display: ".concat(mode === "vertical" ? "block" : "inline-block", "\">").concat(["姓名", "签名", "职称", "日期"].filter(function (f) {
1503
+ return showList.includes(f);
1504
+ }).map(function (g) {
1505
+ if (g === "日期") {
1506
+ // 按照规定顺序显示
1507
+ return dateFormat(new Date(), "yyyy-MM-dd") || m[singMapping[g]];
1508
+ } else if (g === "签名") {
1509
+ return "<img src=\"".concat(m[singMapping[g]], "\" width=80 height=30/>");
1510
+ } else {
1511
+ return m[singMapping[g]];
1512
+ }
1513
+ }).join(" "), "</text>");
1514
+ }).join(mode === "vertical" ? "" : " / "));
1515
+ return _context.abrupt("break", 111);
1516
+ case 101:
1517
+ if (currentNodeTemp.querySelector("label")) {
1518
+ dateNewAttr = _objectSpread(_objectSpread({}, attrTemp), {}, {
1519
+ date: contentValueTemp
1520
+ });
1521
+ currentNodeTemp.setAttribute("bse", encodeURIComponent(JSON.stringify(dateNewAttr)));
1522
+ if (!contentValueTemp && !currentNodeTemp.querySelector("label").innerHTML) {
1523
+ currentDate = dateNewAttr.value || dateNewAttr.defCurrentDate ? new Date() : '';
1524
+ currentNodeTemp.querySelector("label").innerHTML = currentDate ? dateFormat(currentDate, attrTemp.dateformat) : '';
1525
+ } else {
1526
+ currentNodeTemp.querySelector("label").innerHTML = contentValueTemp ? dateFormat(contentValueTemp, attrTemp.dateformat) : '';
1527
+ }
1528
+ }
1529
+ return _context.abrupt("break", 111);
1530
+ case 103:
1531
+ valueArr = contentValueTemp.split('|');
1532
+ currentNodeTemp.querySelector(".extensional").innerHTML = valueArr[0] || '';
1533
+ currentNodeTemp.querySelector(".diastolic").innerHTML = valueArr[1] || '';
1534
+ return _context.abrupt("break", 111);
1535
+ case 107:
1536
+ currentNodeTemp.querySelector("label") && (currentNodeTemp.querySelector("label").innerHTML = contentValueTemp ? "<img width=\"".concat(attrTemp.width, "\" height=\"").concat(attrTemp.height, "\" src=\"").concat(contentValueTemp, "\" />") : "<svg width=\"".concat(attrTemp.width, "\" height=\"").concat(attrTemp.height, "\" viewBox=\"0 0 200 200\"><rect width=\"200\" height=\"200\" fill=\"transparent\" stroke=\"black\" stroke-width=\"2\" stroke-dasharray=\"5, 5\" rx=\"10\" ry=\"10\"></rect><text x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"central\">\u56FE\u7247\u5360\u4F4D\u533A</text><text font-size=\"200\" fill=\"transparent\" stroke-opacity=\"0.1\" stroke-dasharray=\"5, 5\" stroke=\"black\" stroke-width=\"1\" x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"central\">+</text></svg>"));
1537
+ return _context.abrupt("break", 111);
1538
+ case 109:
1539
+ currentNodeTemp.querySelector("label") && (currentNodeTemp.querySelector("label").innerHTML = contentValueTemp !== null && contentValueTemp !== void 0 ? contentValueTemp : '');
1540
+ return _context.abrupt("break", 111);
1541
+ case 111:
1542
+ case "end":
1543
+ return _context.stop();
1544
+ }
1545
+ }, _callee, this, [[8, 22, 25, 28]]);
1546
+ }));
1547
+ function forceUpdateFun(_x, _x2, _x3, _x4, _x5, _x6) {
1548
+ return _forceUpdateFun.apply(this, arguments);
1549
+ }
1550
+ return forceUpdateFun;
1551
+ }() // 分页合并元素
1552
+ )
1553
+ }, {
1554
+ key: "mergeAndRemoveAttrBreakEleString",
1555
+ value: function mergeAndRemoveAttrBreakEleString(innerHTMLStr) {
1556
+ var _curtPage$nextSibling;
1557
+ var resultHtmlStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1558
+ var curtPage = arguments.length > 2 ? arguments[2] : undefined;
1559
+ var mapping = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
1560
+ tdCacheIndex: 'helper_data_cache_id',
1561
+ tdParentIndex: 'helper_data_cache_id',
1562
+ tdChildIndex: 'helper_data_cache_child_id',
1563
+ parentIndex: 'helper_data_cache_id',
1564
+ childIndex: 'helper_data_cache_child_id',
1565
+ virtualIndex: 'helper_data_virtual_id'
1566
+ };
1567
+ var prevPage = curtPage === null || curtPage === void 0 ? void 0 : curtPage.previousSibling,
1568
+ secondPage = curtPage === null || curtPage === void 0 || (_curtPage$nextSibling = curtPage.nextSibling) === null || _curtPage$nextSibling === void 0 ? void 0 : _curtPage$nextSibling.nextSibling;
1569
+ var fragment = this.document.createRange().createContextualFragment(innerHTMLStr);
1570
+ var result = randomVaildate.call(this, fragment, resultHtmlStr); // 校验
1571
+ if (result) return result;
1572
+ var groupTableFragment = groupBy([].slice.call(fragment.querySelectorAll("table[".concat(mapping.parentIndex, "]"))), function (g) {
1573
+ return g.getAttribute("".concat(mapping.parentIndex));
1574
+ });
1575
+ for (var _i = 0, _Object$entries = Object.entries(groupTableFragment); _i < _Object$entries.length; _i++) {
1576
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
1577
+ _ = _Object$entries$_i[0],
1578
+ group = _Object$entries$_i[1];
1579
+ // 分组table元素
1580
+ for (var i = group.length - 1; i > 0; i--) {
1581
+ var _prevPage$querySelect, _secondPage$querySele;
1582
+ var curIndex = i - 1;
1583
+ var current = group[curIndex],
1584
+ merge = group[i];
1585
+ var helper_data_cache_id = current.getAttribute("".concat(mapping.parentIndex));
1586
+ var minmergesplitrowNumber = current.getAttribute('minmergesplitrownumber');
1587
+ if (!minmergesplitrowNumber) {
1588
+ // 如果合并行丢失或被删除
1589
+ var _extractContentParent = merge.querySelector('tbody');
1590
+ current.querySelector('tbody').appendChild(_extractContentParent);
1591
+ this.domUtils.removePrentNode(_extractContentParent);
1592
+ merge.remove();
1593
+ continue;
1594
+ }
1595
+ var minmergesplitrowNumberMerge = merge.getAttribute('minmergesplitrownumber');
1596
+ var comSplitNumber = parseInt(minmergesplitrowNumber) + parseInt(minmergesplitrowNumberMerge) - 1;
1597
+ if (comSplitNumber) {
1598
+ current.setAttribute('minmergesplitrownumber', comSplitNumber);
1599
+ } else {
1600
+ current.removeAttribute('minmergesplitrownumber');
1601
+ }
1602
+ if (!(prevPage !== null && prevPage !== void 0 && (_prevPage$querySelect = prevPage.querySelector) !== null && _prevPage$querySelect !== void 0 && _prevPage$querySelect.call(prevPage, "*[".concat(mapping.tdCacheIndex, "=\"").concat(helper_data_cache_id, "\"]"))) && !(secondPage !== null && secondPage !== void 0 && (_secondPage$querySele = secondPage.querySelector) !== null && _secondPage$querySele !== void 0 && _secondPage$querySele.call(secondPage, "*[".concat(mapping.tdCacheIndex, "=\"").concat(helper_data_cache_id, "\"]")))) {
1603
+ current.removeAttribute("".concat(mapping.tdCacheIndex)); // 'helper_data_cache_id'
1604
+ current.removeAttribute('minmergesplitrownumber');
1605
+ }
1606
+ var bse_dragger = this.bse_dragger;
1607
+ var colgroups = bse_dragger.getMatchRowOrColAllCell("row", minmergesplitrowNumber, function (splitIndexId, find) {
1608
+ if (find.rowIndex + find.rowSpan == splitIndexId) {
1609
+ return "cur";
1610
+ }
1611
+ }, current);
1612
+ var splitSurRow = merge.querySelector('tbody tr');
1613
+ if (colgroups && colgroups.cur) {
1614
+ var _iterator6 = _createForOfIteratorHelper(colgroups.cur),
1615
+ _step6;
1616
+ try {
1617
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1618
+ var td = _step6.value;
1619
+ var splitTdDom = bse_dragger.comMatchCellByColIndex(splitSurRow, td.colIndex).matchCell;
1620
+ td.cell.style.height = parseInt(td.cell.style.height) + parseInt(splitTdDom === null || splitTdDom === void 0 ? void 0 : splitTdDom.style.height) + 'px'; // + 2
1621
+
1622
+ if (this.domUtils.isInsideBseCaresheetEle(curtPage).isInside) {
1623
+ // 用于记录单分割
1624
+ splitTdDom && !this.domUtils.isIdAndNameAndVirtualIdSameSignOrDateString.call(this, td.cell.innerHTML, splitTdDom.innerHTML) && td.cell.insertAdjacentHTML('beforeend', splitTdDom.innerHTML);
1625
+ } else {
1626
+ splitTdDom && td.cell.insertAdjacentHTML('beforeend', splitTdDom.innerHTML);
1627
+ }
1628
+ td.cell.setAttribute('rowspan', +td.cell.getAttribute('rowspan') + +(splitTdDom === null || splitTdDom === void 0 ? void 0 : splitTdDom.getAttribute('rowspan')) - 1);
1629
+ }
1630
+ } catch (err) {
1631
+ _iterator6.e(err);
1632
+ } finally {
1633
+ _iterator6.f();
1634
+ }
1635
+ }
1636
+ splitSurRow === null || splitSurRow === void 0 || splitSurRow.remove();
1637
+ var extractContentParent = merge.querySelector('tbody');
1638
+ current.querySelector('tbody').appendChild(extractContentParent);
1639
+ this.domUtils.removePrentNode(extractContentParent);
1640
+ merge.remove();
1641
+ }
1642
+ }
1643
+ var groupFragment = groupBy([].slice.call(fragment.querySelectorAll(":not(table)[".concat(mapping.parentIndex, "]"))), function (g) {
1644
+ return g.getAttribute("".concat(mapping.parentIndex));
1645
+ });
1646
+ for (var _i2 = 0, _Object$entries2 = Object.entries(groupFragment); _i2 < _Object$entries2.length; _i2++) {
1647
+ var _group$, _secondPage$querySele2, _prevPage$querySelect2;
1648
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
1649
+ _2 = _Object$entries2$_i[0],
1650
+ _group = _Object$entries2$_i[1];
1651
+ // 分组普通元素
1652
+ var tmpParentInx = (_group$ = _group[1]) === null || _group$ === void 0 ? void 0 : _group$.getAttribute("tem_".concat(mapping.parentIndex)); // 保留下页的临时cache
1653
+ if (tmpParentInx) {
1654
+ _group[0].setAttribute("tem_".concat(mapping.parentIndex), tmpParentInx);
1655
+ }
1656
+ var htmlNode = null;
1657
+ for (var inx in _group) {
1658
+ if (inx > 0) {
1659
+ htmlNode = itorMergeBreakEle(htmlNode, _group[inx], mapping);
1660
+ } else {
1661
+ htmlNode = _group[inx];
1662
+ }
1663
+ }
1664
+ var _helper_data_cache_id = htmlNode.getAttribute("".concat(mapping.parentIndex));
1665
+ if (!(secondPage !== null && secondPage !== void 0 && (_secondPage$querySele2 = secondPage.querySelector) !== null && _secondPage$querySele2 !== void 0 && _secondPage$querySele2.call(secondPage, "*[".concat(mapping.parentIndex, "=\"").concat(_helper_data_cache_id, "\"]"))) && !(prevPage !== null && prevPage !== void 0 && (_prevPage$querySelect2 = prevPage.querySelector) !== null && _prevPage$querySelect2 !== void 0 && _prevPage$querySelect2.call(prevPage, "*[".concat(mapping.parentIndex, "=\"").concat(_helper_data_cache_id, "\"]")))) {
1666
+ htmlNode.removeAttribute("".concat(mapping.parentIndex));
1667
+ }
1668
+ // const childEle = htmlNode.querySelector(`*[${mapping.childIndex}]`) || htmlNode
1669
+ [htmlNode.querySelector("*[".concat(mapping.childIndex, "]")), htmlNode].forEach(function (childEle) {
1670
+ if (childEle) {
1671
+ var _childEle$getAttribut, _secondPage$querySele3, _prevPage$querySelect3;
1672
+ var helper_data_cache_child_id = childEle === null || childEle === void 0 || (_childEle$getAttribut = childEle.getAttribute) === null || _childEle$getAttribut === void 0 ? void 0 : _childEle$getAttribut.call(childEle, "".concat(mapping.childIndex));
1673
+ if (!(secondPage !== null && secondPage !== void 0 && (_secondPage$querySele3 = secondPage.querySelector) !== null && _secondPage$querySele3 !== void 0 && _secondPage$querySele3.call(secondPage, "*[".concat(mapping.childIndex, "=\"").concat(helper_data_cache_child_id, "\"]"))) && !(prevPage !== null && prevPage !== void 0 && (_prevPage$querySelect3 = prevPage.querySelector) !== null && _prevPage$querySelect3 !== void 0 && _prevPage$querySelect3.call(prevPage, "*[".concat(mapping.childIndex, "=\"").concat(helper_data_cache_child_id, "\"]")))) {
1674
+ childEle === null || childEle === void 0 || childEle.removeAttribute("".concat(mapping.childIndex));
1675
+ }
1676
+ }
1677
+ });
1678
+ }
1679
+ var groupFragmentVirtual = groupBy([].slice.call(fragment.querySelectorAll("*[".concat(mapping.virtualIndex, "]"))), function (g) {
1680
+ return g.getAttribute("".concat(mapping.virtualIndex));
1681
+ });
1682
+ for (var _i3 = 0, _Object$entries3 = Object.entries(groupFragmentVirtual); _i3 < _Object$entries3.length; _i3++) {
1683
+ var _secondPage$querySele4, _prevPage$querySelect4;
1684
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
1685
+ _3 = _Object$entries3$_i[0],
1686
+ _group2 = _Object$entries3$_i[1];
1687
+ var _htmlNode = null;
1688
+ for (var _inx in _group2) {
1689
+ if (_inx > 0) {
1690
+ _group2[_inx].remove();
1691
+ } else {
1692
+ _htmlNode = _group2[_inx];
1693
+ }
1694
+ }
1695
+ var helper_data_virtual_id = _htmlNode.getAttribute("".concat(mapping.virtualIndex));
1696
+ if (!(secondPage !== null && secondPage !== void 0 && (_secondPage$querySele4 = secondPage.querySelector) !== null && _secondPage$querySele4 !== void 0 && _secondPage$querySele4.call(secondPage, "*[".concat(mapping.virtualIndex, "=\"").concat(helper_data_virtual_id, "\"]"))) && !(prevPage !== null && prevPage !== void 0 && (_prevPage$querySelect4 = prevPage.querySelector) !== null && _prevPage$querySelect4 !== void 0 && _prevPage$querySelect4.call(prevPage, "*[".concat(mapping.virtualIndex, "=\"").concat(helper_data_virtual_id, "\"]")))) {
1697
+ _htmlNode.removeAttribute("".concat(mapping.virtualIndex));
1698
+ }
1699
+ }
1700
+ this.removeBreakPTagSignAndSup(fragment);
1701
+ // 返回数据类型
1702
+ if (resultHtmlStr) {
1703
+ var creDiv = this.document.createElement('summary');
1704
+ creDiv.appendChild(fragment);
1705
+ return creDiv.innerHTML;
1706
+ } else {
1707
+ return fragment;
1708
+ }
1709
+ }
1710
+
1711
+ /** 设置渲染匹配所有测量列表数据 */
1712
+ }, {
1713
+ key: "setAndDrawAllTestListByPageNum",
1714
+ value: (function () {
1715
+ var _setAndDrawAllTestListByPageNum = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1716
+ var _this5 = this;
1717
+ var pageNumber,
1718
+ allTestData,
1719
+ _args3 = arguments;
1720
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1721
+ while (1) switch (_context3.prev = _context3.next) {
1722
+ case 0:
1723
+ pageNumber = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : 1;
1724
+ allTestData = _args3.length > 1 ? _args3[1] : undefined;
1725
+ return _context3.abrupt("return", new Promise(function (reslove) {
1726
+ _this5.temperatureIntance.clearnByPageNumber(pageNumber).then(function () {
1727
+ var temperDataList = allTestData.temperDataList;
1728
+ var target = _this5.getEditorPageByNum(pageNumber).querySelector('.bse-content_editable');
1729
+ var treeWalker = _this5.temperatureIntance.conf.document.createTreeWalker(target, NodeFilter.SHOW_ELEMENT, {
1730
+ acceptNode: function acceptNode(node) {
1731
+ var attr = _this5.domUtils.getElementBseAttr(node);
1732
+ return ['temperature/tempAndPulse', 'temperature/pain', 'temperature/legend'].includes(attr.type) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
1733
+ }
1734
+ });
1735
+ var configMapping = {
1736
+ 'temperature/tempAndPulse': 'splitTempAndPulseConf',
1737
+ 'temperature/pain': 'splitPainConf',
1738
+ 'temperature/legend': 'signMappingConf'
1739
+ };
1740
+ while (treeWalker.nextNode()) {
1741
+ var cNode = treeWalker.currentNode;
1742
+ var _this5$domUtils$getEl = _this5.domUtils.getElementBseAttr(cNode),
1743
+ type = _this5$domUtils$getEl.type,
1744
+ rest = _objectWithoutProperties(_this5$domUtils$getEl, _excluded);
1745
+ if (type === 'temperature/legend') {
1746
+ _this5.temperatureIntance.conf[configMapping[type]] = rest.signMappingConf;
1747
+ } else _this5.temperatureIntance.conf[configMapping[type]] = _objectSpread(_objectSpread({}, _this5.temperatureIntance.conf[configMapping[type]]), rest);
1748
+ }
1749
+ /** 数据存储 */
1750
+ var temperAttr = encodeURIComponent(JSON.stringify(temperDataList));
1751
+ var temperTarget = target.querySelector("*[_temperData]");
1752
+ if (temperTarget) {
1753
+ temperTarget.setAttribute('_temperData', temperAttr);
1754
+ } else {
1755
+ var div = _this5.domUtils.createElement("div", {
1756
+ _temperData: temperAttr
1757
+ });
1758
+ target.appendChild(div);
1759
+ }
1760
+ requestAnimationFrame(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1761
+ var footTarget;
1762
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1763
+ while (1) switch (_context2.prev = _context2.next) {
1764
+ case 0:
1765
+ /** 数据存储 */
1766
+ if (temperDataList.length) {
1767
+ _this5.temperatureIntance._renderingLegend(pageNumber);
1768
+ _this5.temperatureIntance._renderingData(pageNumber);
1769
+ _this5.temperatureIntance._renderingWarningLine(pageNumber);
1770
+ _this5.temperatureIntance._renderingPainData(pageNumber);
1771
+ _this5.temperatureIntance._renderingOrClearnBaseInfo(pageNumber);
1772
+ }
1773
+ footTarget = _this5.getEditorPageByNum(pageNumber).querySelector('.bse-footer_editable');
1774
+ _context2.next = 4;
1775
+ return _this5.updateReplaceApi(allTestData, footTarget, undefined, true, undefined, undefined, Object.keys(allTestData));
1776
+ case 4:
1777
+ reslove(true);
1778
+ case 5:
1779
+ case "end":
1780
+ return _context2.stop();
1781
+ }
1782
+ }, _callee2);
1783
+ })));
1784
+ });
1785
+ }));
1786
+ case 3:
1787
+ case "end":
1788
+ return _context3.stop();
1789
+ }
1790
+ }, _callee3);
1791
+ }));
1792
+ function setAndDrawAllTestListByPageNum() {
1793
+ return _setAndDrawAllTestListByPageNum.apply(this, arguments);
1794
+ }
1795
+ return setAndDrawAllTestListByPageNum;
1796
+ }() // 计算元素相对ui位置
1797
+ )
1798
+ }, {
1799
+ key: "getDomRectRelative",
1800
+ value: function getDomRectRelative(dom) {
1801
+ var hasIframe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1802
+ var scaleMultiple = this.getOptions().scaleMultiple;
1803
+ // 根据dom设置位置
1804
+ var current = dom,
1805
+ top = 0,
1806
+ left = 0;
1807
+ while (current) {
1808
+ var offsetTop = 0,
1809
+ offsetLeft = 0;
1810
+ if (current.nodeName === 'svg') {
1811
+ var rect = current.getBoundingClientRect();
1812
+ offsetTop = rect.top;
1813
+ offsetLeft = rect.left;
1814
+ top += offsetTop - current.scrollTop;
1815
+ left += offsetLeft - current.scrollLeft;
1816
+ } else if (current.nodeName === 'HTML' && hasIframe) {
1817
+ var hiddenLeftscaletemp = current.scrollWidth - current.offsetWidth * scaleMultiple; // 负隐藏正结余
1818
+ var hiddenLeftscale = hiddenLeftscaletemp > 0 ? hiddenLeftscaletemp / 2 : hiddenLeftscaletemp;
1819
+ offsetTop = current.offsetTop;
1820
+ offsetLeft = hiddenLeftscale / scaleMultiple;
1821
+ top += offsetTop - current.scrollTop / scaleMultiple;
1822
+ left += offsetLeft - current.scrollLeft / scaleMultiple;
1823
+ } else {
1824
+ offsetTop = current.offsetTop;
1825
+ offsetLeft = current.offsetLeft;
1826
+ top += offsetTop - current.scrollTop;
1827
+ left += offsetLeft - current.scrollLeft;
1828
+ }
1829
+ // 元素位置body默认是offsetParent且匹配不上html
1830
+ current = current.nodeName === 'BODY' ? current.parentNode : current.offsetParent;
1831
+ }
1832
+ left *= scaleMultiple;
1833
+ top *= scaleMultiple;
1834
+ if (!hasIframe) {
1835
+ return {
1836
+ left: left,
1837
+ top: top
1838
+ };
1839
+ }
1840
+ var iframe = this.iframe;
1841
+ while (iframe && iframe.id !== "bse-ui_container") {
1842
+ // iframe位置
1843
+ top += iframe.offsetTop - iframe.scrollTop;
1844
+ left += iframe.offsetLeft - iframe.scrollLeft;
1845
+ iframe = iframe.offsetParent;
1846
+ }
1847
+ return {
1848
+ left: left,
1849
+ top: top
1850
+ };
1851
+ }
1852
+ }]);
1853
+ }();
1854
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Polyfill);
1855
+ __webpack_exports__ = __webpack_exports__["default"];
1856
+ /******/ return __webpack_exports__;
1857
+ /******/ })()
1858
+ ;
1859
+ });