hoeditor-web 3.1.77 → 3.1.79

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.
@@ -15853,7 +15853,7 @@ var component = (0,componentNormalizer/* default */.Z)(
15853
15853
 
15854
15854
  /***/ }),
15855
15855
 
15856
- /***/ 24193:
15856
+ /***/ 8494:
15857
15857
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
15858
15858
 
15859
15859
  "use strict";
@@ -15869,7 +15869,7 @@ __webpack_require__.d(__webpack_exports__, {
15869
15869
  var es_function_name = __webpack_require__(68309);
15870
15870
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
15871
15871
  var es_array_concat = __webpack_require__(92222);
15872
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/sign/Sign.vue?vue&type=template&id=034775ac&
15872
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/sign/Sign.vue?vue&type=template&id=9c073ac8&
15873
15873
 
15874
15874
 
15875
15875
  var render = function render() {
@@ -15953,7 +15953,7 @@ var render = function render() {
15953
15953
  attrs: {
15954
15954
  "value": 4
15955
15955
  }
15956
- }, [_vm._v("自定义多人签名")])], 1)], 1)]), _vm.signType == 2 ? _c('li', {
15956
+ }, [_vm._v("自定义多人签名(自定义签名格式)")])], 1)], 1)]), _vm.signType == 2 ? _c('li', {
15957
15957
  staticClass: "control-item"
15958
15958
  }, [_c('span', {
15959
15959
  staticClass: "label"
@@ -16256,7 +16256,19 @@ var render = function render() {
16256
16256
  "value": dateTime.dataId
16257
16257
  }
16258
16258
  }, [_vm._v(_vm._s("".concat(dateTime.name, "(").concat(dateTime.dataId, ")")))]);
16259
- }), 1)], 1)] : _vm._e()], 2), _vm.signType >= 9 ? _c('div', {
16259
+ }), 1)], 1)] : _vm._e(), _vm.signType !== 1 ? _c('li', {
16260
+ staticClass: "control-item"
16261
+ }, [_c('span', {
16262
+ staticClass: "label"
16263
+ }, [_vm._v("上级医师签名")]), _c('a-checkbox', {
16264
+ model: {
16265
+ value: _vm.isHigher,
16266
+ callback: function callback($$v) {
16267
+ _vm.isHigher = $$v;
16268
+ },
16269
+ expression: "isHigher"
16270
+ }
16271
+ })], 1) : _vm._e()], 2), _vm.signType >= 9 ? _c('div', {
16260
16272
  staticClass: "section-right"
16261
16273
  }, [_c('div', {
16262
16274
  staticClass: "custom-format-tool-box"
@@ -16358,7 +16370,7 @@ var render = function render() {
16358
16370
  };
16359
16371
  var staticRenderFns = [];
16360
16372
 
16361
- ;// CONCATENATED MODULE: ./src/components/controls/sign/Sign.vue?vue&type=template&id=034775ac&
16373
+ ;// CONCATENATED MODULE: ./src/components/controls/sign/Sign.vue?vue&type=template&id=9c073ac8&
16362
16374
 
16363
16375
  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
16364
16376
  var objectSpread2 = __webpack_require__(63442);
@@ -16388,6 +16400,8 @@ var es_array_filter = __webpack_require__(57327);
16388
16400
  var es_string_includes = __webpack_require__(32023);
16389
16401
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
16390
16402
  var es_array_slice = __webpack_require__(47042);
16403
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
16404
+ var es_object_keys = __webpack_require__(47941);
16391
16405
  // EXTERNAL MODULE: ./src/HOEditorFactorys.ts
16392
16406
  var HOEditorFactorys = __webpack_require__(74089);
16393
16407
  // EXTERNAL MODULE: ./src/editor/dom/treeNode/SignNode.ts
@@ -16411,6 +16425,7 @@ var SignNode = __webpack_require__(24701);
16411
16425
 
16412
16426
 
16413
16427
 
16428
+
16414
16429
  /* harmony default export */ var Signvue_type_script_lang_js_ = ({
16415
16430
  name: 'Sign',
16416
16431
  props: {
@@ -16427,7 +16442,6 @@ var SignNode = __webpack_require__(24701);
16427
16442
  inject: ['getCustomProperty'],
16428
16443
  data: function data() {
16429
16444
  return {
16430
- height: 20,
16431
16445
  name: '',
16432
16446
  signType: 0,
16433
16447
  signFormat: '<医师姓名>',
@@ -16441,10 +16455,14 @@ var SignNode = __webpack_require__(24701);
16441
16455
  defaultFormatList: ['<医师姓名>', '<医师姓名>(<医师职称>)', '<医师姓名>:<医师职称>', '<医师姓名>:<医师职称>\n<签名时间>'],
16442
16456
  animationClassNames: 'control-modal-contents sign-modal animation-in',
16443
16457
  isDisplayTitle: false,
16458
+ isHigher: false,
16444
16459
  isDisplayTime: false,
16445
16460
  timePosition: '0',
16446
16461
  dateTimeList: [],
16447
- associatedElement: ''
16462
+ associatedElement: '',
16463
+ modifyProps: {},
16464
+ unwatchProps: [],
16465
+ watchProps: ['name', 'signType', 'signFormat', 'connectMode', 'connectChar', 'isFront', 'signTimeFormat', 'customFormatContent', 'isDisplayTitle', 'isDisplayTime', 'timePosition', 'associatedElement', 'isHigher']
16448
16466
  };
16449
16467
  },
16450
16468
  mounted: function mounted() {
@@ -16462,7 +16480,7 @@ var SignNode = __webpack_require__(24701);
16462
16480
  if (this.controlStatus === 'update') {
16463
16481
  var node = this.getCurrentSelectNode();
16464
16482
  if (node) {
16465
- var _node$otherProperties, _node$otherProperties2, _node$otherProperties3, _node$otherProperties4, _node$otherProperties5;
16483
+ var _node$otherProperties, _node$otherProperties2, _node$otherProperties3, _node$otherProperties4, _node$otherProperties5, _node$otherProperties6, _node$otherProperties7;
16466
16484
  this.name = node.name;
16467
16485
  if (node.attribute == 2) {
16468
16486
  this.signType = 2; // 自定义多人签名(带职称)
@@ -16486,10 +16504,11 @@ var SignNode = __webpack_require__(24701);
16486
16504
  this.isFront = node.isFront === true || node.isFront === 'true' ? true : false;
16487
16505
  this.signTimeFormat = node.signTimeFormat;
16488
16506
  this.customFormatContent = node.customFormatContent ? node.customFormatContent : '';
16489
- this.customSignFormatList = node.customSignFormatList ? node.customSignFormatList : [];
16507
+ // this.customSignFormatList = node.customSignFormatList ? node.customSignFormatList : [];
16490
16508
  this.isDisplayTitle = ((_node$otherProperties = node.otherProperties) === null || _node$otherProperties === void 0 ? void 0 : _node$otherProperties.isDisplayTitle) === 'true' | ((_node$otherProperties2 = node.otherProperties) === null || _node$otherProperties2 === void 0 ? void 0 : _node$otherProperties2.isDisplayTitle) === true ? true : false;
16491
- this.isDisplayTime = ((_node$otherProperties3 = node.otherProperties) === null || _node$otherProperties3 === void 0 ? void 0 : _node$otherProperties3.isDisplayTime) === 'true' | ((_node$otherProperties4 = node.otherProperties) === null || _node$otherProperties4 === void 0 ? void 0 : _node$otherProperties4.isDisplayTime) === true ? true : false;
16492
- this.timePosition = ((_node$otherProperties5 = node.otherProperties) === null || _node$otherProperties5 === void 0 ? void 0 : _node$otherProperties5.timePosition) == '1' ? '1' : '0';
16509
+ this.isHigher = ((_node$otherProperties3 = node.otherProperties) === null || _node$otherProperties3 === void 0 ? void 0 : _node$otherProperties3.isHigher) === 'true' | ((_node$otherProperties4 = node.otherProperties) === null || _node$otherProperties4 === void 0 ? void 0 : _node$otherProperties4.isHigher) === true ? true : false;
16510
+ this.isDisplayTime = ((_node$otherProperties5 = node.otherProperties) === null || _node$otherProperties5 === void 0 ? void 0 : _node$otherProperties5.isDisplayTime) === 'true' | ((_node$otherProperties6 = node.otherProperties) === null || _node$otherProperties6 === void 0 ? void 0 : _node$otherProperties6.isDisplayTime) === true ? true : false;
16511
+ this.timePosition = ((_node$otherProperties7 = node.otherProperties) === null || _node$otherProperties7 === void 0 ? void 0 : _node$otherProperties7.timePosition) == '1' ? '1' : '0';
16493
16512
  this.associatedElement = node.associatedElement ? node.associatedElement : '';
16494
16513
  list.forEach(function (v) {
16495
16514
  if (v.nodeType == 8 && (!associatedElementList.includes(v.dataId) || node.associatedElement == v.dataId)) {
@@ -16497,6 +16516,7 @@ var SignNode = __webpack_require__(24701);
16497
16516
  _this.dateTimeList.push(v);
16498
16517
  }
16499
16518
  });
16519
+ this.setWatchProps();
16500
16520
  }
16501
16521
  } else {
16502
16522
  list.forEach(function (v) {
@@ -16508,6 +16528,19 @@ var SignNode = __webpack_require__(24701);
16508
16528
  }
16509
16529
  },
16510
16530
  methods: {
16531
+ setWatchProps: function setWatchProps() {
16532
+ var _this2 = this;
16533
+ this.watchProps.forEach(function (key) {
16534
+ _this2.unwatchProps.push(_this2.$watch("".concat(key), function (newValue, oldValue) {
16535
+ this.modifyProps[key] = newValue;
16536
+ }));
16537
+ });
16538
+ },
16539
+ clearWatchProps: function clearWatchProps() {
16540
+ this.unwatchProps.forEach(function (func) {
16541
+ func && func();
16542
+ });
16543
+ },
16511
16544
  getCurrentSelectNode: function getCurrentSelectNode() {
16512
16545
  var _hoEditorFactory$vueC;
16513
16546
  var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this.hoEditorFactoryId);
@@ -16574,32 +16607,56 @@ var SignNode = __webpack_require__(24701);
16574
16607
  }
16575
16608
  if (this.controlStatus === 'add') {
16576
16609
  if (this.signType === 9) {
16577
- // 自定义多人签名
16578
- this.vueController.insertEmptySignNode(this.name ? this.name : '自定义医生签名', 1, this.signFormat, this.signTimeFormat, customProperty, this.connectMode, this.isFront, this.allowEditSignTime, 0, '', {}, this.associatedElement);
16610
+ // 自定义医生签名
16611
+ this.vueController.insertEmptySignNode(this.name ? this.name : '自定义医生签名', 1, this.signFormat, this.signTimeFormat, customProperty, this.connectMode, this.isFront, this.allowEditSignTime, 0, '', {
16612
+ isHigher: this.isHigher
16613
+ }, this.associatedElement);
16579
16614
  } else if (this.signType === 2) {
16580
- // 自定义多人签名
16581
- this.vueController.insertEmptySignNode(this.name ? this.name : '自定义多人签名(默认带出职称)', 0, '', '', customProperty, '', undefined, undefined, this.signType, this.connectChar, {}, this.associatedElement);
16615
+ // 多人签名(默认带职称)
16616
+ this.vueController.insertEmptySignNode(this.name ? this.name : '自定义多人签名(默认带出职称)', 0, '', '', customProperty, '', undefined, undefined, this.signType, this.connectChar, {
16617
+ isHigher: this.isHigher
16618
+ }, this.associatedElement);
16582
16619
  } else if (this.signType === 3) {
16583
- // 自定义多人签名
16584
- this.vueController.insertEmptySignNode(this.name ? this.name : '自定义多人签名(默认带出职称和日期)', 0, '', '', customProperty, '', undefined, undefined, this.signType, this.connectChar, {}, this.associatedElement);
16620
+ // 自定义多人签名(默认带出职称和日期)
16621
+ this.vueController.insertEmptySignNode(this.name ? this.name : '自定义多人签名(默认带出职称和日期)', 0, '', '', customProperty, '', undefined, undefined, this.signType, this.connectChar, {
16622
+ isHigher: this.isHigher
16623
+ }, this.associatedElement);
16585
16624
  } else if (this.signType === 4) {
16586
- // 自定义多人签名
16625
+ // 自定义多人签名(职称,连接符可选)
16587
16626
  this.vueController.insertEmptySignNode(this.name ? this.name : '自定义多人签名(职称,连接符可选)', 0, '', this.signTimeFormat, customProperty, this.connectMode, undefined, undefined, this.signType, this.connectChar, (0,objectSpread2/* default */.Z)({
16588
- isDisplayTitle: this.isDisplayTitle
16627
+ isDisplayTitle: this.isDisplayTitle,
16628
+ isHigher: this.isHigher
16589
16629
  }, otherProperty), this.associatedElement);
16590
16630
  } else {
16591
16631
  var name = this.name ? this.name : this.signType == 1 ? '患者签名' : '医生签名';
16592
- this.vueController.insertEmptySignNode(name, 0, '', '', customProperty, '', undefined, undefined, this.signType, '', {});
16632
+ var otherProperties = {
16633
+ isHigher: this.isHigher
16634
+ };
16635
+ if (this.signType == 1) {
16636
+ otherProperties = {};
16637
+ }
16638
+ this.vueController.insertEmptySignNode(name, 0, '', '', customProperty, '', undefined, undefined, this.signType, '', otherProperties, this.associatedElement);
16593
16639
  }
16594
16640
  } else if (this.controlStatus === 'update') {
16641
+ this.clearWatchProps();
16595
16642
  var node = this.getCurrentSelectNode();
16596
16643
  var _name = this.name ? this.name : node.name;
16597
16644
  var attribute = this.signType === 9 ? 0 : this.signType;
16598
16645
  var signType = this.signType == 9 ? 1 : 0; // 自定义签名的signType=1 其他签名 signType=0
16599
- var otherProperties = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, node.otherProperties), {}, {
16600
- isDisplayTitle: this.isDisplayTitle
16646
+ var _otherProperties = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, node.otherProperties), {}, {
16647
+ isDisplayTitle: this.isDisplayTitle,
16648
+ isHigher: this.isHigher
16601
16649
  }, otherProperty);
16602
- this.vueController.updateEmptySignNode(node, _name, attribute, this.connectChar, signType, this.signFormat, this.signor, '', this.signTimeFormat, this.connectMode, otherProperties, this.isFront, this.associatedElement);
16650
+ if (Object.keys(this.modifyProps).length) {
16651
+ var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this.hoEditorFactoryId);
16652
+ var record = hoEditorFactory.docTree.elementChangeRecords.get('|' + node.dataId);
16653
+ if (!record || record.indexOf('add') < 0) {
16654
+ hoEditorFactory.docTree.elementChangeRecords.set('|' + node.dataId, ['update', {
16655
+ nodeTypes: 'sign'
16656
+ }]);
16657
+ }
16658
+ }
16659
+ this.vueController.updateEmptySignNode(node, _name, attribute, this.connectChar, signType, this.signFormat, this.signor, '', this.signTimeFormat, this.connectMode, _otherProperties, this.isFront, this.associatedElement);
16603
16660
  }
16604
16661
  this.handleClose();
16605
16662
  },
@@ -16611,10 +16668,10 @@ var SignNode = __webpack_require__(24701);
16611
16668
  });
16612
16669
  ;// CONCATENATED MODULE: ./src/components/controls/sign/Sign.vue?vue&type=script&lang=js&
16613
16670
  /* harmony default export */ var sign_Signvue_type_script_lang_js_ = (Signvue_type_script_lang_js_);
16614
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/sign/Sign.vue?vue&type=style&index=0&id=034775ac&prod&lang=less&
16671
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/sign/Sign.vue?vue&type=style&index=0&id=9c073ac8&prod&lang=less&
16615
16672
  // extracted by mini-css-extract-plugin
16616
16673
 
16617
- ;// CONCATENATED MODULE: ./src/components/controls/sign/Sign.vue?vue&type=style&index=0&id=034775ac&prod&lang=less&
16674
+ ;// CONCATENATED MODULE: ./src/components/controls/sign/Sign.vue?vue&type=style&index=0&id=9c073ac8&prod&lang=less&
16618
16675
 
16619
16676
  // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
16620
16677
  var componentNormalizer = __webpack_require__(70713);
@@ -166383,7 +166440,7 @@ var map = {
166383
166440
  "./qrCode/QrCode.vue": 59805,
166384
166441
  "./radioCheckBox/RadioCheckbox.vue": 22876,
166385
166442
  "./selectDialog/SelectDialog.vue": 32497,
166386
- "./sign/Sign.vue": 24193,
166443
+ "./sign/Sign.vue": 8494,
166387
166444
  "./table/TableCellPoper.vue": 97628,
166388
166445
  "./table/TableCellPoper1.vue": 44645,
166389
166446
  "./table/TableCellProperty.vue": 63689,
@@ -203831,8 +203888,8 @@ var es_string_match = __webpack_require__(4723);
203831
203888
  var es_number_constructor = __webpack_require__(9653);
203832
203889
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
203833
203890
  var es_json_stringify = __webpack_require__(38862);
203834
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=c9703c12&
203835
- var HoDocvue_type_template_id_c9703c12_render = function render() {
203891
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=3e304215&
203892
+ var HoDocvue_type_template_id_3e304215_render = function render() {
203836
203893
  var _vm = this,
203837
203894
  _c = _vm._self._c;
203838
203895
  return _c('div', {
@@ -204033,7 +204090,7 @@ var HoDocvue_type_template_id_c9703c12_render = function render() {
204033
204090
  }
204034
204091
  }, [_vm._v("v " + _vm._s(_vm.version))])])])], 1);
204035
204092
  };
204036
- var HoDocvue_type_template_id_c9703c12_staticRenderFns = [];
204093
+ var HoDocvue_type_template_id_3e304215_staticRenderFns = [];
204037
204094
 
204038
204095
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
204039
204096
  var es_array_filter = __webpack_require__(57327);
@@ -207024,7 +207081,7 @@ var TextNode = __webpack_require__(27198);
207024
207081
  // EXTERNAL MODULE: ./src/editor/dom/treeNode/ParagraphNode.ts
207025
207082
  var ParagraphNode = __webpack_require__(67945);
207026
207083
  ;// CONCATENATED MODULE: ./src/components/version.ts
207027
- /* harmony default export */ var version = ('3.1.77');
207084
+ /* harmony default export */ var version = ('3.1.79');
207028
207085
  // EXTERNAL MODULE: ./src/components/controls/poperTipText/PoperTipText.vue + 5 modules
207029
207086
  var PoperTipText = __webpack_require__(50987);
207030
207087
  ;// CONCATENATED MODULE: ./src/components/controls/poperTipText/index.ts
@@ -207472,7 +207529,10 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207472
207529
  if (type !== 'dblclick') return false;
207473
207530
  var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this.hoEditorProvider.activeDocId);
207474
207531
  var paintStatus = hoEditorFactory.drawTree.paintStatus;
207475
- if (paintStatus === 5 || paintStatus == 2) {
207532
+ if (paintStatus == DrawTree/* PaintState */.Dh.psPreview) {
207533
+ return false;
207534
+ }
207535
+ if (paintStatus === DrawTree/* PaintState */.Dh.psReadOnly) {
207476
207536
  return false;
207477
207537
  }
207478
207538
  this.domRange = {
@@ -207483,12 +207543,12 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207483
207543
  _hoEditorFactory$vueC3 = (0,esm_slicedToArray/* default */.Z)(_hoEditorFactory$vueC2, 2),
207484
207544
  isInTable = _hoEditorFactory$vueC3[0],
207485
207545
  tableNode = _hoEditorFactory$vueC3[1];
207486
- if (paintStatus == 1 && isInTable) {
207546
+ if (paintStatus == DrawTree/* PaintState */.Dh.psEdit && isInTable) {
207487
207547
  var result = hoEditorFactory.editController.canIsEdit(hoEditorFactory);
207488
207548
  if (!result) return;
207489
207549
  }
207490
207550
  if (node instanceof SignNode/* SignNode */.N) {
207491
- if (paintStatus === 0 && !node.imgSrc && !node.fingerPrintSrc) {
207551
+ if (paintStatus === DrawTree/* PaintState */.Dh.psDesign && !node.imgSrc && !node.fingerPrintSrc) {
207492
207552
  this.hoEditorProvider.setControlProperty('sign', 'update', '');
207493
207553
  return;
207494
207554
  }
@@ -207503,7 +207563,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207503
207563
  this.poperType = '';
207504
207564
  return;
207505
207565
  } else {
207506
- if (paintStatus === 4) {
207566
+ if (paintStatus === DrawTree/* PaintState */.Dh.psReview) {
207507
207567
  if ((node instanceof TextNode/* TextNode */.R || node instanceof MarkNode/* MarkNode */.j) && node.parentNode instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
207508
207568
  var parentNode = node.parentNode;
207509
207569
  if (Number(parentNode.inputFieldType) === 0) {
@@ -207521,7 +207581,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207521
207581
  return false;
207522
207582
  }
207523
207583
  if (node instanceof DateTimeNode/* DateTimeNode */.Z) {
207524
- if (paintStatus === 0) {
207584
+ if (paintStatus === DrawTree/* PaintState */.Dh.psDesign) {
207525
207585
  this.hoEditorProvider.setControlProperty('date', 'update', '');
207526
207586
  this.hoEditorProvider.setUpdateNodeValue(node);
207527
207587
  return;
@@ -207559,7 +207619,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207559
207619
  return false;
207560
207620
  }
207561
207621
  if (Number(_parentNode.inputFieldType) === 2) {
207562
- if (paintStatus === 0) {
207622
+ if (paintStatus === DrawTree/* PaintState */.Dh.psDesign) {
207563
207623
  this.hoEditorProvider.setControlProperty('date', 'update', '');
207564
207624
  return;
207565
207625
  }
@@ -207965,10 +208025,10 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207965
208025
  });
207966
208026
  ;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=script&lang=js&
207967
208027
  /* harmony default export */ var components_HoDocvue_type_script_lang_js_ = (HoDocvue_type_script_lang_js_);
207968
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=c9703c12&prod&lang=less&
208028
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=3e304215&prod&lang=less&
207969
208029
  // extracted by mini-css-extract-plugin
207970
208030
 
207971
- ;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=c9703c12&prod&lang=less&
208031
+ ;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=3e304215&prod&lang=less&
207972
208032
 
207973
208033
  ;// CONCATENATED MODULE: ./src/components/HoDoc.vue
207974
208034
 
@@ -207981,8 +208041,8 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
207981
208041
 
207982
208042
  var HoDoc_component = (0,componentNormalizer/* default */.Z)(
207983
208043
  components_HoDocvue_type_script_lang_js_,
207984
- HoDocvue_type_template_id_c9703c12_render,
207985
- HoDocvue_type_template_id_c9703c12_staticRenderFns,
208044
+ HoDocvue_type_template_id_3e304215_render,
208045
+ HoDocvue_type_template_id_3e304215_staticRenderFns,
207986
208046
  false,
207987
208047
  null,
207988
208048
  null,
@@ -212424,15 +212484,31 @@ var StructureConvert = /*#__PURE__*/function () {
212424
212484
  if (pageSettings) {
212425
212485
  // const pageProperty = new PageProperty(this._hoEditorFactory);
212426
212486
  var pageProperty = hoEditorFactory.pageProperty;
212427
- pageProperty.printDirection = Number(pageSettings.printDirection);
212428
212487
  pageProperty.borderColor = pageSettings.borderColor;
212429
212488
  pageProperty.isPaintBorder = pageSettings.isPaintBorder == 'true' ? true : false;
212430
212489
  pageProperty.paintRowLine = Number(pageSettings.paintRowLine);
212431
- pageProperty.pageSize = pageSettings.pageSize;
212432
212490
  // pageProperty.commentWidthMm = Number(pageSettings.commentWidthMm);
212433
212491
  // pageProperty.commentWidthMm = pageProperty.commentWidthMm;
212434
- pageProperty.widthMm = Number(pageSettings.widthMm);
212435
- pageProperty.heightMm = Number(pageSettings.heightMm);
212492
+ var widthMm = Number(pageSettings.widthMm);
212493
+ var heightMm = Number(pageSettings.heightMm);
212494
+ var isA5 = hoEditorFactory.vueController.isA5(widthMm, heightMm);
212495
+ if (isA5) {
212496
+ pageProperty.pageSize = 'A5';
212497
+ if (widthMm > heightMm) {
212498
+ pageProperty.widthMm = 210;
212499
+ pageProperty.heightMm = 148;
212500
+ pageProperty.printDirection = 1;
212501
+ } else {
212502
+ pageProperty.widthMm = 148;
212503
+ pageProperty.heightMm = 210;
212504
+ pageProperty.printDirection = 0;
212505
+ }
212506
+ } else {
212507
+ pageProperty.widthMm = widthMm;
212508
+ pageProperty.heightMm = heightMm;
212509
+ pageProperty.printDirection = Number(pageSettings.printDirection);
212510
+ pageProperty.pageSize = pageSettings.pageSize;
212511
+ }
212436
212512
  pageProperty.source = pageSettings.source;
212437
212513
  pageProperty.topMarginMm = Number(pageSettings.topMarginMm);
212438
212514
  pageProperty.bottomMarginMm = Number(pageSettings.bottomMarginMm);
@@ -213745,6 +213821,9 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213745
213821
  this.convert.set(BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntLabel], function (val) {
213746
213822
  return _this.TransText(val);
213747
213823
  });
213824
+ this.convert.set(BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntSign], function (val) {
213825
+ return _this.TransText(val);
213826
+ });
213748
213827
  // this.convert.set(NodeType[NodeType.ntControl], (val: Record<string, any>) => {
213749
213828
  // return this.TransText(val);
213750
213829
  // });
@@ -213868,6 +213947,14 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213868
213947
  if (jnode.nodeType == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntControl]) {
213869
213948
  str += jnode.text;
213870
213949
  }
213950
+ if (jnode.nodeType == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntSign]) {
213951
+ if (jnode.type == "2") {
213952
+ str += jnode.imgSrc;
213953
+ }
213954
+ if (jnode.type == "1") {
213955
+ return this.TransImg(jnode);
213956
+ }
213957
+ }
213871
213958
  return "<span style=\"".concat(style, "\">").concat(str, "</span>");
213872
213959
  }
213873
213960
  }, {
@@ -213880,9 +213967,15 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213880
213967
  }, {
213881
213968
  key: "TransImg",
213882
213969
  value: function TransImg(jnode) {
213883
- var style = this.ToHTMLStyle(jnode);
213884
- var img = jnode.imageDataBase64String;
213885
- return "<img id=\"".concat(jnode.id, "\" style=\"").concat(style, "\" src=\"").concat(img, "\"/>");
213970
+ var style = "";
213971
+ if (jnode.nodeType == "ntSign") {
213972
+ var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this._hoEditorFactoryID);
213973
+ style = "height:" + hoEditorFactory.signHeight + "px;";
213974
+ } else {
213975
+ style = this.ToHTMLStyle(jnode);
213976
+ }
213977
+ var img = jnode.imageDataBase64String || jnode.imgSrc;
213978
+ return "<img id=\"".concat(jnode.id ? jnode.id : jnode.dataId, "\" style=\"").concat(style, "\" src=\"").concat(img, "\"/>");
213886
213979
  }
213887
213980
  }, {
213888
213981
  key: "TransPara",
@@ -213947,7 +214040,7 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213947
214040
  var content = "";
213948
214041
  for (var n = 0; n < jnode.childNodes.item.length; n++) {
213949
214042
  //这里只分析Cell
213950
-
214043
+ //console.log(n);
213951
214044
  var item = this.iterator.next();
213952
214045
  if (item.done) break;
213953
214046
  item.value["style"] = jnode.colInfos.item[n];
@@ -213980,7 +214073,7 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213980
214073
  if (node['nodeType'] == 'ntRow') {
213981
214074
  //TODO:row属性CSS
213982
214075
  rtnText += "margin: 0;";
213983
- var hp = style['rowHeight'] ? "height:".concat(style.rowHeight, "px;") : '';
214076
+ var hp = style['rowHeight'] ? "height:".concat(style.rowHeight, "pt;") : '';
213984
214077
  if (style['rowProperty']) {
213985
214078
  hp = style.rowProperty['rowHeight'] && style.rowProperty['rowHeight'] != 0 ? "height:".concat(style.rowProperty.rowHeight, "cm;") : hp;
213986
214079
  }
@@ -213988,7 +214081,7 @@ var TOHTMLConverter = /*#__PURE__*/function () {
213988
214081
  } else if (node['nodeType'] == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntCell]) {
213989
214082
  //TODO:col属性CSS
213990
214083
  rtnText += "margin: 0;";
213991
- rtnText += style['colWidth'] ? "width:".concat(style.colWidth, "px;") : '';
214084
+ rtnText += style['colWidth'] ? "width:".concat(style.colWidth, "pt;") : '';
213992
214085
  if (style['crossLineType']) {
213993
214086
  switch (style.crossLineType) {
213994
214087
  case CellNode/* CrossLineType */.v[CellNode/* CrossLineType */.v.ct02]:
@@ -214027,19 +214120,27 @@ var TOHTMLConverter = /*#__PURE__*/function () {
214027
214120
  rtnText += "margin-top:".concat(topMarginPx, "px;");
214028
214121
  rtnText += "margin-bottom:".concat(bottomMarginPx, "px;");
214029
214122
  }
214123
+ var unit = 'pt';
214124
+ if (node['nodeType'] == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntImage]) {
214125
+ unit = 'px';
214126
+ }
214030
214127
  if (node["width"]) {
214031
- rtnText += "width:".concat(node.width, "px;");
214128
+ rtnText += "width:".concat(node.width).concat(unit, ";");
214032
214129
  }
214033
214130
  if (node["height"]) {
214034
- rtnText += "height:".concat(node.height, "px;");
214131
+ rtnText += "height:".concat(node.height).concat(unit, ";");
214035
214132
  }
214036
214133
  } else {
214037
214134
  //其他什么只要是需要放到属性里都放这
214135
+ var _unit = 'pt';
214136
+ if (node['nodeType'] == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntImage]) {
214137
+ _unit = 'px';
214138
+ }
214038
214139
  if (node["width"]) {
214039
- rtnText += "width:".concat(node.width, "px;");
214140
+ rtnText += "width:".concat(node.width).concat(_unit, ";");
214040
214141
  }
214041
214142
  if (node["height"]) {
214042
- rtnText += "height:".concat(node.height, "px;");
214143
+ rtnText += "height:".concat(node.height).concat(_unit, ";");
214043
214144
  }
214044
214145
  if (node['nodeType'] == BaseNode/* NodeType */.Jq[BaseNode/* NodeType */.Jq.ntTable]) {
214045
214146
  rtnText += 'border-collapse: collapse;';
@@ -214053,7 +214154,7 @@ var TOHTMLConverter = /*#__PURE__*/function () {
214053
214154
  key: "CombineStyleToHTMLStyle",
214054
214155
  value: function CombineStyleToHTMLStyle(val) {
214055
214156
  var spanText = "";
214056
- spanText += "font-size:" + val.size + "px;";
214157
+ spanText += "font-size:" + val.size + "pt;";
214057
214158
  spanText += "font-family:" + val.font + ";";
214058
214159
  spanText += val.bold ? "font-weight:bold;" : "";
214059
214160
  spanText += val.italic ? "font-style:italic;" : "";
@@ -220740,19 +220841,18 @@ var VueController = /*#__PURE__*/function () {
220740
220841
  hoEditorFactory.docTree.curDomRange = newRange;
220741
220842
  hoEditorFactory.drawTree.moveCaretToPath(curDomRange.startPath);
220742
220843
  }
220743
- /**
220744
- * 查询光标所在位置之前的文本内容
220745
- */
220746
220844
  }, {
220747
- key: "getCaretPreviousTextNode",
220748
- value: function getCaretPreviousTextNode() {
220749
- var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this._hoEditorFactoryID);
220750
- var curDomRange = hoEditorFactory.docTree.curDomRange.normalize();
220751
- var node = curDomRange.npEnd.node;
220845
+ key: "getCaretPreviousNode",
220846
+ value: function getCaretPreviousNode(node) {
220847
+ if (!node) {
220848
+ return "";
220849
+ }
220752
220850
  var text = '';
220753
220851
  var getText = function getText(previousNode) {
220754
220852
  if (previousNode instanceof TextNode/* TextNode */.R || previousNode instanceof LabelNode/* LabelNode */.P || previousNode instanceof DownListNode/* DownListNode */.yF) {
220755
220853
  return previousNode.text;
220854
+ } else if (node instanceof MarkNode/* MarkNode */.j) {
220855
+ return "";
220756
220856
  } else if ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.parentNode) instanceof TextInputFieldNode/* TextInputFieldNode */.re && (previousNode === null || previousNode === void 0 ? void 0 : previousNode.parentNode.inputFieldType) === TextInputFieldNode/* InputFieldType */.Zi.dropDownList) {
220757
220857
  return previousNode === null || previousNode === void 0 ? void 0 : previousNode.parentNode.text;
220758
220858
  }
@@ -220764,16 +220864,17 @@ var VueController = /*#__PURE__*/function () {
220764
220864
  text = getText(node.previousLeaf());
220765
220865
  }
220766
220866
  } else if (node instanceof SignNode/* SignNode */.N && node.type !== 3 || node instanceof ParagraphNode/* ParagraphNode */.C) {
220767
- text = getText(node.previousLeaf());
220867
+ text = "";
220768
220868
  } else if (node instanceof LabelNode/* LabelNode */.P) {
220769
220869
  text = node.text;
220870
+ } else if (node instanceof MarkNode/* MarkNode */.j) {
220871
+ text = "";
220770
220872
  } else if ((node === null || node === void 0 ? void 0 : node.parentNode) instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
220771
- text = getText(node.parentNode.previousLeaf());
220873
+ text = node.text;
220772
220874
  if (!text) {
220773
- text = getText(node.previousLeaf());
220875
+ text = getText(node.parentNode.previousLeaf());
220774
220876
  }
220775
- }
220776
- if (!text && (node === null || node === void 0 ? void 0 : node.parentNode) instanceof CellNode/* CellNode */.D) {
220877
+ } else if (!text && (node === null || node === void 0 ? void 0 : node.parentNode) instanceof CellNode/* CellNode */.D) {
220777
220878
  var cellNode = node === null || node === void 0 ? void 0 : node.parentNode;
220778
220879
  var colNo = cellNode.row.indexOf(cellNode);
220779
220880
  if (colNo != 0) {
@@ -220791,9 +220892,45 @@ var VueController = /*#__PURE__*/function () {
220791
220892
  }
220792
220893
  }
220793
220894
  }
220794
- text = text.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
220795
- if (text && text.length > 5) {
220796
- text = text.substring(text.length - 5, text.length);
220895
+ if (text) {
220896
+ text = text.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
220897
+ if (text.length > 8) {
220898
+ text = text.substring(text.length - 8, text.length);
220899
+ }
220900
+ }
220901
+ return text;
220902
+ }
220903
+ /**
220904
+ * 查询光标所在位置之前的文本内容
220905
+ */
220906
+ }, {
220907
+ key: "getCaretPreviousTextNode",
220908
+ value: function getCaretPreviousTextNode() {
220909
+ var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this._hoEditorFactoryID);
220910
+ var curDomRange = hoEditorFactory.docTree.curDomRange.normalize();
220911
+ var node = curDomRange.npEnd.node;
220912
+ var count = 0;
220913
+ var text = "";
220914
+ var whileText = "";
220915
+ while (node && text.length < 3 && count < 12) {
220916
+ var _node5;
220917
+ count++;
220918
+ if (node instanceof SignNode/* SignNode */.N || node instanceof MarkNode/* MarkNode */.j || node instanceof TextNode/* TextNode */.R || node instanceof LabelNode/* LabelNode */.P || node instanceof DownListNode/* DownListNode */.yF) {
220919
+ node = node.previousLeaf();
220920
+ } else if (((_node5 = node) === null || _node5 === void 0 ? void 0 : _node5.parentNode) instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
220921
+ node = node.parentNode.previousLeaf();
220922
+ } else {
220923
+ node = node.previousLeaf();
220924
+ }
220925
+ whileText = this.getCaretPreviousNode(node);
220926
+ if (whileText) {
220927
+ text = whileText + text;
220928
+ } else {
220929
+ text = "";
220930
+ }
220931
+ }
220932
+ if (text.length < 3) {
220933
+ console.error("\u7B7E\u540D\u5143\u7D20\u524D\u6587\u672C\u5173\u952E\u5B57\u3010".concat(text, "\u3011,\u67E5\u8BE2\u8282\u70B9\u6B21\u6570\u3010").concat(count, "\u3011"));
220797
220934
  }
220798
220935
  return text ? text : '';
220799
220936
  }
@@ -220991,42 +221128,42 @@ var VueController = /*#__PURE__*/function () {
220991
221128
  var downNames = [];
220992
221129
  hoEditorFactory.docTree.curDomRange = new DomRange/* DomRange */.a(this._hoEditorFactoryID, curDomRange.startPath, curDomRange.startPath);
220993
221130
  for (var i = 0; i < nodes.length; i++) {
220994
- var _node5 = nodes[i];
220995
- if (_node5 instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
220996
- if (fieldNames.indexOf(_node5.name) === -1) {
220997
- fieldNames.push(_node5.name);
220998
- var sameNameEles = this.getNodesByName('all', true, _node5.name);
221131
+ var _node6 = nodes[i];
221132
+ if (_node6 instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
221133
+ if (fieldNames.indexOf(_node6.name) === -1) {
221134
+ fieldNames.push(_node6.name);
221135
+ var sameNameEles = this.getNodesByName('all', true, _node6.name);
220999
221136
  for (var j = 0; j < sameNameEles.length; j++) {
221000
221137
  var ele = sameNameEles[j];
221001
221138
  if (nodes.indexOf(ele) >= 0) continue;
221002
221139
  if (ele instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
221003
- ele.setFieldText(_node5.text);
221140
+ ele.setFieldText(_node6.text);
221004
221141
  }
221005
221142
  }
221006
221143
  }
221007
221144
  }
221008
- if (_node5 instanceof DateTimeNode/* DateTimeNode */.Z) {
221009
- if (dateNames.indexOf(_node5.name) === -1) {
221010
- dateNames.push(_node5.name);
221011
- var _sameNameEles = this.getNodesByName('all', true, _node5.name);
221145
+ if (_node6 instanceof DateTimeNode/* DateTimeNode */.Z) {
221146
+ if (dateNames.indexOf(_node6.name) === -1) {
221147
+ dateNames.push(_node6.name);
221148
+ var _sameNameEles = this.getNodesByName('all', true, _node6.name);
221012
221149
  for (var _j = 0; _j < _sameNameEles.length; _j++) {
221013
221150
  var _ele = _sameNameEles[_j];
221014
221151
  if (nodes.indexOf(_ele) >= 0) continue;
221015
221152
  if (_ele instanceof DateTimeNode/* DateTimeNode */.Z) {
221016
- _ele.setDateTimeText(_node5.text);
221153
+ _ele.setDateTimeText(_node6.text);
221017
221154
  }
221018
221155
  }
221019
221156
  }
221020
221157
  }
221021
- if (_node5 instanceof DownListNode/* DownListNode */.yF) {
221022
- if (downNames.indexOf(_node5.name) === -1) {
221023
- downNames.push(_node5.name);
221024
- var _sameNameEles2 = this.getNodesByName('all', true, _node5.name);
221158
+ if (_node6 instanceof DownListNode/* DownListNode */.yF) {
221159
+ if (downNames.indexOf(_node6.name) === -1) {
221160
+ downNames.push(_node6.name);
221161
+ var _sameNameEles2 = this.getNodesByName('all', true, _node6.name);
221025
221162
  for (var _j2 = 0; _j2 < _sameNameEles2.length; _j2++) {
221026
221163
  var _ele2 = _sameNameEles2[_j2];
221027
221164
  if (nodes.indexOf(_ele2) >= 0) continue;
221028
221165
  if (_ele2 instanceof DownListNode/* DownListNode */.yF) {
221029
- _ele2.setDownListText(_node5.text);
221166
+ _ele2.setDownListText(_node6.text);
221030
221167
  }
221031
221168
  }
221032
221169
  }
@@ -221157,29 +221294,29 @@ var VueController = /*#__PURE__*/function () {
221157
221294
  var hasEmptyDoctorSign = false;
221158
221295
  var getAllNodes = function getAllNodes(nodes) {
221159
221296
  for (var i = 0; i < nodes.length; i++) {
221160
- var _node6 = nodes[i];
221161
- if (_node6 instanceof SignNode/* SignNode */.N) {
221297
+ var _node7 = nodes[i];
221298
+ if (_node7 instanceof SignNode/* SignNode */.N) {
221162
221299
  // 有值的患者签名
221163
- if (attribute == 1 && _node6.attribute === 1) {
221300
+ if (attribute == 1 && _node7.attribute === 1) {
221164
221301
  patientSignCount++;
221165
221302
  }
221166
- if (attribute == 1 && _node6.attribute === 1 && (_node6.imgSrc !== '' || _node6.fingerPrintSrc !== '')) {
221303
+ if (attribute == 1 && _node7.attribute === 1 && (_node7.imgSrc !== '' || _node7.fingerPrintSrc !== '')) {
221167
221304
  hasEmptyPatientSign = true;
221168
221305
  break;
221169
221306
  }
221170
221307
  // 空的医生签名
221171
- if (attribute != 1 && _node6.attribute != 1 && _node6.imgSrc === '') {
221308
+ if (attribute != 1 && _node7.attribute != 1 && _node7.imgSrc === '') {
221172
221309
  hasEmptyDoctorSign = true;
221173
221310
  break;
221174
221311
  }
221175
221312
  }
221176
- if (_node6 instanceof BaseCombineNode/* BaseCombineNode */.V && attribute === 1 && hasEmptyPatientSign) {
221313
+ if (_node7 instanceof BaseCombineNode/* BaseCombineNode */.V && attribute === 1 && hasEmptyPatientSign) {
221177
221314
  // 患者签名已存在的情况不在深层调用深层遍历
221178
- getAllNodes(_node6.childNodes);
221315
+ getAllNodes(_node7.childNodes);
221179
221316
  }
221180
- if (_node6 instanceof BaseCombineNode/* BaseCombineNode */.V && attribute != 1 && !hasEmptyDoctorSign) {
221317
+ if (_node7 instanceof BaseCombineNode/* BaseCombineNode */.V && attribute != 1 && !hasEmptyDoctorSign) {
221181
221318
  // 医生签名不存在的情况不在深层调用深层遍历
221182
- getAllNodes(_node6.childNodes);
221319
+ getAllNodes(_node7.childNodes);
221183
221320
  }
221184
221321
  }
221185
221322
  };
@@ -221395,28 +221532,28 @@ var VueController = /*#__PURE__*/function () {
221395
221532
  var signList = [];
221396
221533
  var getAllNodes = function getAllNodes(nodes) {
221397
221534
  for (var i = 0; i < nodes.length; i++) {
221398
- var _node7 = nodes[i];
221399
- if (_node7 instanceof SignNode/* SignNode */.N) {
221535
+ var _node8 = nodes[i];
221536
+ if (_node8 instanceof SignNode/* SignNode */.N) {
221400
221537
  // 空的医生签名
221401
- if (_node7.attribute != 1) {
221538
+ if (_node8.attribute != 1) {
221402
221539
  var sign = {
221403
221540
  type: 'sign',
221404
221541
  signed: false,
221405
- isTemplate: _node7.isTemplate,
221406
- number: _node7.number,
221407
- isVerify: _node7.otherProperties && _node7.otherProperties.isVerify ? true : false,
221408
- customProperty: _node7.customProperty,
221542
+ isTemplate: _node8.isTemplate,
221543
+ number: _node8.number,
221544
+ isVerify: _node8.otherProperties && _node8.otherProperties.isVerify ? true : false,
221545
+ customProperty: _node8.customProperty,
221409
221546
  previousText: '',
221410
- dataId: _node7.dataId,
221411
- name: _node7.name
221547
+ dataId: _node8.dataId,
221548
+ name: _node8.name
221412
221549
  };
221413
- sign.previousText = _this8.getPreviousText(_node7);
221550
+ sign.previousText = _this8.getPreviousText(_node8);
221414
221551
  signList.push(sign);
221415
221552
  }
221416
221553
  }
221417
- if (_node7 instanceof BaseCombineNode/* BaseCombineNode */.V) {
221554
+ if (_node8 instanceof BaseCombineNode/* BaseCombineNode */.V) {
221418
221555
  // 医生签名不存在的情况不在深层调用深层遍历
221419
- getAllNodes(_node7.childNodes);
221556
+ getAllNodes(_node8.childNodes);
221420
221557
  }
221421
221558
  }
221422
221559
  };
@@ -221434,23 +221571,23 @@ var VueController = /*#__PURE__*/function () {
221434
221571
  var arr = [];
221435
221572
  var getAllNodes = function getAllNodes(nodes) {
221436
221573
  for (var i = 0; i < nodes.length; i++) {
221437
- var _node8 = nodes[i];
221438
- if (_node8 instanceof SignNode/* SignNode */.N) {
221574
+ var _node9 = nodes[i];
221575
+ if (_node9 instanceof SignNode/* SignNode */.N) {
221439
221576
  // 空的医生签名
221440
221577
  // if (node.attribute != 1) {
221441
221578
  var sign = {
221442
221579
  type: 'sign',
221443
221580
  signed: false,
221444
- isTemplate: _node8.isTemplate,
221445
- number: _node8.number,
221446
- isVerify: _node8.otherProperties && _node8.otherProperties.isVerify ? true : false,
221447
- customProperty: _node8.customProperty,
221581
+ isTemplate: _node9.isTemplate,
221582
+ number: _node9.number,
221583
+ isVerify: _node9.otherProperties && _node9.otherProperties.isVerify ? true : false,
221584
+ customProperty: _node9.customProperty,
221448
221585
  previousText: '',
221449
- dataId: _node8.dataId,
221450
- name: _node8.name,
221451
- node: _node8
221586
+ dataId: _node9.dataId,
221587
+ name: _node9.name,
221588
+ node: _node9
221452
221589
  };
221453
- sign.previousText = _this9.getPreviousText(_node8);
221590
+ sign.previousText = _this9.getPreviousText(_node9);
221454
221591
  if (sign.number == 0 || sign.number == 1) {
221455
221592
  if (arr.length > 0) {
221456
221593
  signList.push(arr);
@@ -221464,9 +221601,9 @@ var VueController = /*#__PURE__*/function () {
221464
221601
  // }
221465
221602
  }
221466
221603
 
221467
- if (_node8 instanceof BaseCombineNode/* BaseCombineNode */.V) {
221604
+ if (_node9 instanceof BaseCombineNode/* BaseCombineNode */.V) {
221468
221605
  // 医生签名不存在的情况不在深层调用深层遍历
221469
- getAllNodes(_node8.childNodes);
221606
+ getAllNodes(_node9.childNodes);
221470
221607
  }
221471
221608
  }
221472
221609
  };
@@ -221498,15 +221635,15 @@ var VueController = /*#__PURE__*/function () {
221498
221635
  var isHasDoctorSign = false;
221499
221636
  var getAllNodes = function getAllNodes(nodes) {
221500
221637
  for (var i = 0; i < nodes.length; i++) {
221501
- var _node9 = nodes[i];
221502
- if (_node9 instanceof SignNode/* SignNode */.N && _node9.type !== 3 && _node9.imgSrc) {
221638
+ var _node10 = nodes[i];
221639
+ if (_node10 instanceof SignNode/* SignNode */.N && _node10.type !== 3 && _node10.imgSrc) {
221503
221640
  isHasDoctorSign = true;
221504
221641
  break; // 医生签名已存在的情况中断当前层的遍历
221505
221642
  }
221506
221643
 
221507
- if (_node9 instanceof BaseCombineNode/* BaseCombineNode */.V && !isHasDoctorSign) {
221644
+ if (_node10 instanceof BaseCombineNode/* BaseCombineNode */.V && !isHasDoctorSign) {
221508
221645
  // 医生签名已存在的情况不在深层调用深层遍历
221509
- getAllNodes(_node9.childNodes);
221646
+ getAllNodes(_node10.childNodes);
221510
221647
  }
221511
221648
  }
221512
221649
  };
@@ -221961,9 +222098,9 @@ var VueController = /*#__PURE__*/function () {
221961
222098
  var xmlRoot = '<?xml version="1.0" encoding="utf-8"?>';
221962
222099
  var doc2XmlJson = function doc2XmlJson(nodes) {
221963
222100
  for (var _i9 = 0; _i9 < nodes.length; _i9++) {
221964
- var _node10 = nodes[_i9];
221965
- if (_node10 instanceof TextNode/* TextNode */.R || _node10 instanceof ParagraphNode/* ParagraphNode */.C || _node10 instanceof TableNode/* TableNode */.Fh || _node10 instanceof ImageNode/* ImageNode */.H) {
221966
- var nodeJson = node2Json(_node10);
222101
+ var _node11 = nodes[_i9];
222102
+ if (_node11 instanceof TextNode/* TextNode */.R || _node11 instanceof ParagraphNode/* ParagraphNode */.C || _node11 instanceof TableNode/* TableNode */.Fh || _node11 instanceof ImageNode/* ImageNode */.H) {
222103
+ var nodeJson = node2Json(_node11);
221967
222104
  xmlRoot += x2js.js2xml(nodeJson);
221968
222105
  }
221969
222106
  }
@@ -222191,9 +222328,9 @@ var VueController = /*#__PURE__*/function () {
222191
222328
  paragraphRecordId: recordId
222192
222329
  });
222193
222330
  }
222194
- var _node11 = hoEditorFactory.structureConvert.convertNode(temp, hoEditorFactory.docTree.mainNodes, null);
222195
- if (_node11) {
222196
- nodes.push(_node11);
222331
+ var _node12 = hoEditorFactory.structureConvert.convertNode(temp, hoEditorFactory.docTree.mainNodes, null);
222332
+ if (_node12) {
222333
+ nodes.push(_node12);
222197
222334
  }
222198
222335
  }
222199
222336
  if (nodes.length > 0) {
@@ -222293,12 +222430,12 @@ var VueController = /*#__PURE__*/function () {
222293
222430
  var ret = [];
222294
222431
  var getAllNodes = function getAllNodes(nodes) {
222295
222432
  for (var i = 0; i < nodes.length; i++) {
222296
- var _node12 = nodes[i];
222297
- if (_node12 instanceof QrcodeNode/* QrcodeNode */.d) {
222298
- ret.push(_node12);
222433
+ var _node13 = nodes[i];
222434
+ if (_node13 instanceof QrcodeNode/* QrcodeNode */.d) {
222435
+ ret.push(_node13);
222299
222436
  }
222300
- if (_node12 instanceof BaseCombineNode/* BaseCombineNode */.V) {
222301
- getAllNodes(_node12.childNodes);
222437
+ if (_node13 instanceof BaseCombineNode/* BaseCombineNode */.V) {
222438
+ getAllNodes(_node13.childNodes);
222302
222439
  }
222303
222440
  }
222304
222441
  };
@@ -222330,12 +222467,12 @@ var VueController = /*#__PURE__*/function () {
222330
222467
  var ret = [];
222331
222468
  var getAllNodes = function getAllNodes(nodes) {
222332
222469
  for (var i = 0; i < nodes.length; i++) {
222333
- var _node13 = nodes[i];
222334
- if (_node13 instanceof QrcodeNode/* QrcodeNode */.d) {
222335
- ret.push(_node13);
222470
+ var _node14 = nodes[i];
222471
+ if (_node14 instanceof QrcodeNode/* QrcodeNode */.d) {
222472
+ ret.push(_node14);
222336
222473
  }
222337
- if (_node13 instanceof BaseCombineNode/* BaseCombineNode */.V) {
222338
- getAllNodes(_node13.childNodes);
222474
+ if (_node14 instanceof BaseCombineNode/* BaseCombineNode */.V) {
222475
+ getAllNodes(_node14.childNodes);
222339
222476
  }
222340
222477
  }
222341
222478
  };
@@ -222677,11 +222814,11 @@ var VueController = /*#__PURE__*/function () {
222677
222814
  var table = null;
222678
222815
  var i = 0;
222679
222816
  for (var k = 0; k < hoEditorFactory.docTree.mainNodes.length; k++) {
222680
- var _node14 = hoEditorFactory.docTree.mainNodes[k];
222681
- if (_node14 instanceof TableNode/* TableNode */.Fh) {
222817
+ var _node15 = hoEditorFactory.docTree.mainNodes[k];
222818
+ if (_node15 instanceof TableNode/* TableNode */.Fh) {
222682
222819
  i++;
222683
222820
  if (i === index) {
222684
- table = _node14;
222821
+ table = _node15;
222685
222822
  break;
222686
222823
  }
222687
222824
  }
@@ -222842,18 +222979,36 @@ var VueController = /*#__PURE__*/function () {
222842
222979
  downLists: value[1].downLists
222843
222980
  });
222844
222981
  }
222845
- obj = {
222846
- "type": value[0],
222847
- "id": key.split("|")[0],
222848
- "dataid": key.split("|")[1],
222849
- "record": value[1]
222850
- };
222851
- recordArr.push(obj);
222982
+ if (value[1].nodeTypes == 'sign') {
222983
+ var _node16 = _this13.getNodeByDataID('main', key.replace('|', ''));
222984
+ if (_node16 instanceof SignNode/* SignNode */.N) {
222985
+ var signJsons = _node16.node2Json();
222986
+ var signXml = x2js.js2xml(signJsons);
222987
+ obj = {
222988
+ "type": value[0],
222989
+ "id": '',
222990
+ "dataid": key.split("|")[1],
222991
+ "record": {
222992
+ nodeTypes: 'sign',
222993
+ content: signXml
222994
+ }
222995
+ };
222996
+ recordArr.push(obj);
222997
+ }
222998
+ } else {
222999
+ obj = {
223000
+ "type": value[0],
223001
+ "id": key.split("|")[0],
223002
+ "dataid": key.split("|")[1],
223003
+ "record": value[1]
223004
+ };
223005
+ recordArr.push(obj);
223006
+ }
222852
223007
  }
222853
223008
  }
222854
223009
  } else {
222855
223010
  var id = key.split("|")[0];
222856
- var _node15 = _this13.getNodeByID('all', id);
223011
+ var _node17 = _this13.getNodeByID('all', id);
222857
223012
  }
222858
223013
  });
222859
223014
  return recordArr;
@@ -222901,6 +223056,43 @@ var VueController = /*#__PURE__*/function () {
222901
223056
  var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this._hoEditorFactoryID);
222902
223057
  return hoEditorFactory.docTree.mainNodes;
222903
223058
  }
223059
+ }, {
223060
+ key: "getFileHtml",
223061
+ value: function getFileHtml() {
223062
+ var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this._hoEditorFactoryID);
223063
+ var firstHead = hoEditorFactory.subDocManger.getHeaderPageNodes()[0];
223064
+ var headerEnd = hoEditorFactory.docTree.getNodeLastPath(firstHead[firstHead.length - 1]);
223065
+ var headerRange = new DomRange/* DomRange */.a(this._hoEditorFactoryID, 'header/0/0', headerEnd);
223066
+ hoEditorFactory.structureNode.Copy(headerRange, null);
223067
+ var headHtml = hoEditorFactory.structureNode.htmldata;
223068
+ var mainNodes = hoEditorFactory.docTree.mainNodes;
223069
+ var mainEnd = hoEditorFactory.docTree.getNodeLastPath(mainNodes[mainNodes.length - 1]);
223070
+ var mainRange = new DomRange/* DomRange */.a(this._hoEditorFactoryID, 'main/0', mainEnd);
223071
+ hoEditorFactory.structureNode.Copy(mainRange, null);
223072
+ var mainHtml = hoEditorFactory.structureNode.htmldata;
223073
+ var padding = "".concat(hoEditorFactory.pageProperty.headerYPixes, "px ").concat(hoEditorFactory.pageProperty.rightMarginPixes, "px ").concat(hoEditorFactory.pageProperty.bottomMarginPixes, "px ").concat(hoEditorFactory.pageProperty.leftMarginPixes, "px");
223074
+ var content = "";
223075
+ var head = headHtml.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/);
223076
+ var main = mainHtml.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/);
223077
+ if (head && head[1]) {
223078
+ content += head[1];
223079
+ }
223080
+ if (main && main[1]) {
223081
+ content += main[1];
223082
+ }
223083
+ return "\n <html>\n <head>\n <style>\n html, body {\n padding: 0;\n margin: 0;\n background: #f2f4f7;\n }\n #hoEmrContent {\n margin: 20px auto;\n background: #fff;\n box-shadow: 0px 2px 12px 0px #c7cacf;\n }\n </style>\n </head>\n <body>\n <div id=\"hoEmrContent\" style='width: ".concat(hoEditorFactory.pageProperty.widthPixes, "px; padding: ").concat(padding, ";'>\n ").concat(content, "\n </div>\n </body>\n </html>");
223084
+ }
223085
+ }, {
223086
+ key: "isA5",
223087
+ value: function isA5(widthMm, heightMm) {
223088
+ var A5_WIDTH = 210;
223089
+ var A5_HEIGHT = 148;
223090
+ var TOLERANCE = 5; // 误差值
223091
+ // 检查宽度和高度是否在允许的误差范围内
223092
+ var isWidthValid = Math.abs(widthMm - A5_WIDTH) <= TOLERANCE || Math.abs(widthMm - A5_HEIGHT) <= TOLERANCE;
223093
+ var isHeightValid = Math.abs(heightMm - A5_HEIGHT) <= TOLERANCE || Math.abs(heightMm - A5_WIDTH) <= TOLERANCE;
223094
+ return isWidthValid && isHeightValid;
223095
+ }
222904
223096
  }]);
222905
223097
  return VueController;
222906
223098
  }();
@@ -228443,7 +228635,7 @@ function unzipSync(data) {
228443
228635
  /** @license
228444
228636
  *
228445
228637
  * jsPDF - PDF Document creation from JavaScript
228446
- * Version 2.4.0 Built on 2021-09-14T10:30:30.230Z
228638
+ * Version 2.5.1 Built on 2021-09-14T10:30:30.230Z
228447
228639
  * CommitID 00000000
228448
228640
  *
228449
228641
  * Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
@@ -228832,7 +229024,7 @@ objectNumber=0;contentLength=0;content=[];offsets=[];additionalObjects=[];rootDi
228832
229024
  * @memberof jsPDF#
228833
229025
  * @name getR2L
228834
229026
  */API.__private__.getR2L=API.getR2L=function(){return R2L;};var zoomMode;// default: 1;
228835
- var setZoomMode=API.__private__.setZoomMode=function(zoom){var validZoomModes=[undefined,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*%$/.test(zoom)){zoomMode=zoom;}else if(!isNaN(zoom)){zoomMode=parseInt(zoom,10);}else if(validZoomModes.indexOf(zoom)!==-1){zoomMode=zoom;}else{throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+zoom+'" is not recognized.');}};API.__private__.getZoomMode=function(){return zoomMode;};var pageMode;// default: 'UseOutlines';
229027
+ var setZoomMode=API.__private__.setZoomMode=function(zoom){var validZoomModes=[undefined,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(zoom)){zoomMode=zoom;}else if(!isNaN(zoom)){zoomMode=parseInt(zoom,10);}else if(validZoomModes.indexOf(zoom)!==-1){zoomMode=zoom;}else{throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+zoom+'" is not recognized.');}};API.__private__.getZoomMode=function(){return zoomMode;};var pageMode;// default: 'UseOutlines';
228836
229028
  var setPageMode=API.__private__.setPageMode=function(pmode){var validPageModes=[undefined,null,"UseNone","UseOutlines","UseThumbs","FullScreen"];if(validPageModes.indexOf(pmode)==-1){throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+pmode+'" is not recognized.');}pageMode=pmode;};API.__private__.getPageMode=function(){return pageMode;};var layoutMode;// default: 'continuous';
228837
229029
  var setLayoutMode=API.__private__.setLayoutMode=function(layout){var validLayoutModes=[undefined,null,"continuous","single","twoleft","tworight","two"];if(validLayoutModes.indexOf(layout)==-1){throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+layout+'" is not recognized.');}layoutMode=layout;};API.__private__.getLayoutMode=function(){return layoutMode;};/**
228838
229030
  * Set the display mode options of the page like zoom and layout.
@@ -229166,7 +229358,7 @@ if(bch>>8){/* something left after dividing by 256 second time */throw new Error
229166
229358
  */return to8bitStream(text,flags).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)");};var beginPage=API.__private__.beginPage=function(format){pages[++page]=[];pagesContext[page]={objId:0,contentsObjId:0,userUnit:Number(userUnit),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(format[0]),topRightY:Number(format[1])}};_setPage(page);setOutputDestination(pages[currentPage]);};var _addPage=function _addPage(parmFormat,parmOrientation){var dimensions,width,height;orientation=parmOrientation||orientation;if(typeof parmFormat==="string"){dimensions=getPageFormat(parmFormat.toLowerCase());if(Array.isArray(dimensions)){width=dimensions[0];height=dimensions[1];}}if(Array.isArray(parmFormat)){width=parmFormat[0]*scaleFactor;height=parmFormat[1]*scaleFactor;}if(isNaN(width)){width=format[0];height=format[1];}if(width>14400||height>14400){jspdf_console.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400");width=Math.min(14400,width);height=Math.min(14400,height);}format=[width,height];switch(orientation.substr(0,1)){case"l":if(height>width){format=[height,width];}break;case"p":if(width>height){format=[height,width];}break;}beginPage(format);// Set line width
229167
229359
  setLineWidth(lineWidth);// Set draw color
229168
229360
  out(strokeColor);// resurrecting non-default line caps, joins
229169
- if(lineCapID!==0){out(lineCapID+" J");}if(lineJoinID!==0){out(lineJoinID+" j");}events.publish("addPage",{pageNumber:page});};var _deletePage=function _deletePage(n){if(n>0&&n<=page){pages.splice(n,1);pagesContext.splice(n,1);page--;if(currentPage>page){currentPage=page;}jspdf_console.log(page,'delete page');this.setPage(currentPage);}};var _setPage=function _setPage(n){if(n>0&&n<=page){currentPage=n;}};var getNumberOfPages=API.__private__.getNumberOfPages=API.getNumberOfPages=function(){return pages.length-1;};/**
229361
+ if(lineCapID!==0){out(lineCapID+" J");}if(lineJoinID!==0){out(lineJoinID+" j");}events.publish("addPage",{pageNumber:page});};var _deletePage=function _deletePage(n){if(n>0&&n<=page){pages.splice(n,1);pagesContext.splice(n,1);page--;if(currentPage>page){currentPage=page;}this.setPage(currentPage);}};var _setPage=function _setPage(n){if(n>0&&n<=page){currentPage=n;}};var getNumberOfPages=API.__private__.getNumberOfPages=API.getNumberOfPages=function(){return pages.length-1;};/**
229170
229362
  * Returns a document-specific font key - a label assigned to a
229171
229363
  * font name + font type combination at the time the font was added
229172
229364
  * to the font inventory.
@@ -229187,7 +229379,10 @@ if(!zoomMode)zoomMode="fullwidth";switch(zoomMode){case"fullwidth":out("/OpenAct
229187
229379
  * UseThumbs : Thumbnail images visible
229188
229380
  * FullScreen : Full-screen mode, with no menu bar, window controls, or any other window visible
229189
229381
  */out("/PageMode /"+pageMode);}events.publish("putCatalog");out(">>");out("endobj");};var putTrailer=API.__private__.putTrailer=function(){out("trailer");out("<<");out("/Size "+(objectNumber+1));// Root and Info must be the last and second last objects written respectively
229190
- out("/Root "+objectNumber+" 0 R");out("/Info "+(objectNumber-1)+" 0 R");if(encryptionOptions!==null){out("/Encrypt "+encryption.oid+" 0 R");}out("/ID [ <"+fileId+"> <"+fileId+"> ]");out(">>");};var putHeader=API.__private__.putHeader=function(){out("%PDF-"+pdfVersion);out("%\xBA\xDF\xAC\xE0");};var putXRef=API.__private__.putXRef=function(){var p="0000000000";out("xref");out("0 "+(objectNumber+1));out("0000000000 65535 f ");for(var i=1;i<=objectNumber;i++){var offset=offsets[i];if(typeof offset==="function"){out((p+offsets[i]()).slice(-10)+" 00000 n ");}else{if(typeof offsets[i]!=="undefined"){out((p+offsets[i]).slice(-10)+" 00000 n ");}else{out("0000000000 00000 n ");}}}};var buildDocument=API.__private__.buildDocument=function(){resetDocument();setOutputDestination(content);events.publish("buildDocument");putHeader();putPages();putAdditionalObjects();putResources();if(encryptionOptions!==null)putEncryptionDict();putInfo();putCatalog();var offsetOfXRef=contentLength;putXRef();putTrailer();out("startxref");out(""+offsetOfXRef);out("%%EOF");setOutputDestination(pages[currentPage]);return content.join("\n");};var getBlob=API.__private__.getBlob=function(data){return new Blob([getArrayBuffer(data)],{type:"application/pdf"});};/**
229382
+ out("/Root "+objectNumber+" 0 R");out("/Info "+(objectNumber-1)+" 0 R");if(encryptionOptions!==null){out("/Encrypt "+encryption.oid+" 0 R");}out("/ID [ <"+fileId+"> <"+fileId+"> ]");out(">>");};var putHeader=API.__private__.putHeader=function(){out("%PDF-"+pdfVersion);out("%\xBA\xDF\xAC\xE0");};var putXRef=API.__private__.putXRef=function(){var p="0000000000";out("xref");out("0 "+(objectNumber+1));out("0000000000 65535 f ");for(var i=1;i<=objectNumber;i++){var offset=offsets[i];if(typeof offset==="function"){out((p+offsets[i]()).slice(-10)+" 00000 n ");}else{if(typeof offsets[i]!=="undefined"){out((p+offsets[i]).slice(-10)+" 00000 n ");}else{out("0000000000 00000 n ");}}}};var buildDocument=API.__private__.buildDocument=function(){resetDocument();setOutputDestination(content);events.publish("buildDocument");putHeader();putPages();putAdditionalObjects();putResources();if(encryptionOptions!==null)putEncryptionDict();putInfo();putCatalog();var offsetOfXRef=contentLength;putXRef();putTrailer();out("startxref");out(""+offsetOfXRef);out("%%EOF");setOutputDestination(pages[currentPage]);// var contentString = content.join("\n");
229383
+ // content = 0;
229384
+ // return contentString;
229385
+ return content.join("\n");};var getBlob=API.__private__.getBlob=function(data){return new Blob([getArrayBuffer(data)],{type:"application/pdf"});};/**
229191
229386
  * Generates the PDF document.
229192
229387
  *
229193
229388
  * If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
@@ -229215,7 +229410,7 @@ if(typeof globalObject.URL!=="undefined"&&typeof globalObject.URL.createObjectUR
229215
229410
  * Used to see if a supplied hotfix was requested when the pdf instance was created.
229216
229411
  * @param {string} hotfixName - The name of the hotfix to check.
229217
229412
  * @returns {boolean}
229218
- */var hasHotfix=function hasHotfix(hotfixName){return Array.isArray(hotfixes)===true&&hotfixes.indexOf(hotfixName)>-1;};switch(unit){case"pt":scaleFactor=1;break;case"mm":scaleFactor=72/25.4;break;case"cm":scaleFactor=72/2.54;break;case"in":scaleFactor=72;break;case"px":if(hasHotfix("px_scaling")==true){scaleFactor=72/96;}else{scaleFactor=96/72;}break;case"pc":scaleFactor=12;break;case"em":scaleFactor=12;break;case"ex":scaleFactor=6;break;default:throw new Error("Invalid unit: "+unit);}var encryption=null;setCreationDate();setFileId();var getEncryptor=function getEncryptor(objectId){if(encryptionOptions!==null){return encryption.encryptor(objectId,0);}return function(data){return data;};};//---------------------------------------
229413
+ */var hasHotfix=function hasHotfix(hotfixName){return Array.isArray(hotfixes)===true&&hotfixes.indexOf(hotfixName)>-1;};switch(unit){case"pt":scaleFactor=1;break;case"mm":scaleFactor=72/25.4;break;case"cm":scaleFactor=72/2.54;break;case"in":scaleFactor=72;break;case"px":if(hasHotfix("px_scaling")==true){scaleFactor=72/96;}else{scaleFactor=96/72;}break;case"pc":scaleFactor=12;break;case"em":scaleFactor=12;break;case"ex":scaleFactor=6;break;default:if(typeof unit==="number"){scaleFactor=unit;}else{throw new Error("Invalid unit: "+unit);}}var encryption=null;setCreationDate();setFileId();var getEncryptor=function getEncryptor(objectId){if(encryptionOptions!==null){return encryption.encryptor(objectId,0);}return function(data){return data;};};//---------------------------------------
229219
229414
  // Public API
229220
229415
  var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberOneBased){if(isNaN(pageNumberOneBased)||pageNumberOneBased%1!==0){throw new Error("Invalid argument passed to jsPDF.getPageInfo");}var objId=pagesContext[pageNumberOneBased].objId;return{objId:objId,pageNumber:pageNumberOneBased,pageContext:pagesContext[pageNumberOneBased]};};var getPageInfoByObjId=API.__private__.getPageInfoByObjId=function(objId){if(isNaN(objId)||objId%1!==0){throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");}for(var pageNumber in pagesContext){if(pagesContext[pageNumber].objId===objId){break;}}return getPageInfo(pageNumber);};var getCurrentPageInfo=API.__private__.getCurrentPageInfo=API.getCurrentPageInfo=function(){return{objId:pagesContext[currentPage].objId,pageNumber:currentPage,pageContext:pagesContext[currentPage]};};/**
229221
229416
  * Adds (and transfers the focus to) new page to the PDF document.
@@ -229282,6 +229477,7 @@ var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberO
229282
229477
  * @param {number|Matrix} [options.angle=0] - Rotate the text clockwise or counterclockwise. Expects the angle in degree.
229283
229478
  * @param {number} [options.rotationDirection=1] - Direction of the rotation. 0 = clockwise, 1 = counterclockwise.
229284
229479
  * @param {number} [options.charSpace=0] - The space between each letter.
229480
+ * @param {number} [options.horizontalScale=1] - Horizontal scale of the text as a factor of the regular size.
229285
229481
  * @param {number} [options.lineHeightFactor=1.15] - The lineheight of each line.
229286
229482
  * @param {Object} [options.flags] - Flags for to8bitStream.
229287
229483
  * @param {boolean} [options.flags.noBOM=true] - Don't add BOM to Unicode-text.
@@ -229313,7 +229509,7 @@ var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberO
229313
229509
  * T* (line two) Tj
229314
229510
  * T* (line three) Tj
229315
229511
  * ET
229316
- */options=options||{};var scope=options.scope||this;var payload,da,angle,align,charSpace,maxWidth,flags;// Pre-August-2012 the order of arguments was function(x, y, text, flags)
229512
+ */options=options||{};var scope=options.scope||this;var payload,da,angle,align,charSpace,maxWidth,flags,horizontalScale;// Pre-August-2012 the order of arguments was function(x, y, text, flags)
229317
229513
  // in effort to make all calls have similar signature like
229318
229514
  // function(data, coordinates... , miscellaneous)
229319
229515
  // this method had its args flipped.
@@ -229336,11 +229532,12 @@ while(len--){curDa=sa.shift();if(typeof curDa!=="string"||Array.isArray(curDa)&&
229336
229532
  //later code.
229337
229533
  if(typeof text==="string"){if(text.match(/[\r?\n]/)){text=[text.replace(/\r\n|\r|\n/g,'')];// 自定义修改 处理打印回车的问题
229338
229534
  }else{text=[text];}}//baseline
229339
- var height=activeFontSize/scope.internal.scaleFactor;var descent=height*(lineHeightFactor-1);switch(options.baseline){case"bottom":y-=descent;break;case"top":y+=height-descent;break;case"hanging":y+=height-2*descent;break;case"middle":y+=height/2-descent;break;}//multiline
229535
+ var height=activeFontSize/scope.internal.scaleFactor;// var descent = height * (lineHeightFactor - 1);
229536
+ var descent=height*(lineHeight-1);switch(options.baseline){case"bottom":y-=descent;break;case"top":y+=height-descent;break;case"hanging":y+=height-2*descent;break;case"middle":y+=height/2-descent;break;}//multiline
229340
229537
  maxWidth=options.maxWidth||0;if(maxWidth>0){if(typeof text==="string"){text=scope.splitTextToSize(text,maxWidth);}else if(Object.prototype.toString.call(text)==="[object Array]"){text=text.reduce(function(acc,textLine){return acc.concat(scope.splitTextToSize(textLine,maxWidth));},[]);}}//creating Payload-Object to make text byRef
229341
229538
  payload={text:text,x:x,y:y,options:options,mutex:{pdfEscape:pdfEscape,activeFontKey:activeFontKey,fonts:fonts,activeFontSize:activeFontSize}};events.publish("preProcessText",payload);text=payload.text;options=payload.options;//angle
229342
229539
  angle=options.angle;if(transformationMatrix instanceof Matrix===false&&angle&&typeof angle==="number"){angle*=Math.PI/180;if(options.rotationDirection===0){angle=-angle;}if(apiMode===ApiMode.ADVANCED){angle=-angle;}var c=Math.cos(angle);var s=Math.sin(angle);transformationMatrix=new Matrix(c,s,-s,c,0,0);}else if(angle&&angle instanceof Matrix){transformationMatrix=angle;}if(apiMode===ApiMode.ADVANCED&&!transformationMatrix){transformationMatrix=identityMatrix;}//charSpace
229343
- charSpace=options.charSpace||activeCharSpace;if(typeof charSpace!=="undefined"){xtra+=hpf(scale(charSpace))+" Tc\n";this.setCharSpace(this.getCharSpace()||0);}//lang
229540
+ charSpace=options.charSpace||activeCharSpace;if(typeof charSpace!=="undefined"){xtra+=hpf(scale(charSpace))+" Tc\n";this.setCharSpace(this.getCharSpace()||0);}horizontalScale=options.horizontalScale;if(typeof horizontalScale!=="undefined"){xtra+=hpf(horizontalScale*100)+" Tz\n";}//lang
229344
229541
  var lang=options.lang;var renderingMode=-1;var parmRenderingMode=typeof options.renderingMode!=="undefined"?options.renderingMode:options.stroke;var pageContext=scope.internal.getCurrentPageInfo().pageContext;switch(parmRenderingMode){case 0:case false:case"fill":renderingMode=0;break;case 1:case true:case"stroke":renderingMode=1;break;case 2:case"fillThenStroke":renderingMode=2;break;case 3:case"invisible":renderingMode=3;break;case 4:case"fillAndAddForClipping":renderingMode=4;break;case 5:case"strokeAndAddPathForClipping":renderingMode=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":renderingMode=6;break;case 7:case"addToPathForClipping":renderingMode=7;break;}var usedRenderingMode=typeof pageContext.usedRenderingMode!=="undefined"?pageContext.usedRenderingMode:-1;//if the coder wrote it explicitly to use a specific
229345
229542
  //renderingMode, then use it
229346
229543
  if(renderingMode!==-1){xtra+=renderingMode+" Tr\n";//otherwise check if we used the rendering Mode already
@@ -229736,6 +229933,14 @@ curveTo(x2,y2,x3,y3,x4,y4);}}if(closed){close();}putStyle(style);return this;};/
229736
229933
  */API.addFont=function(postScriptName,fontName,fontStyle,fontWeight,encoding){var encodingOptions=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];if(arguments[3]&&encodingOptions.indexOf(arguments[3])!==-1){//IE 11 fix
229737
229934
  encoding=arguments[3];}else if(arguments[3]&&encodingOptions.indexOf(arguments[3])==-1){fontStyle=combineFontStyleAndFontWeight(fontStyle,fontWeight);}encoding=encoding||"Identity-H";return addFont.call(this,postScriptName,fontName,fontStyle,encoding);};var lineWidth=options.lineWidth||0.200025;// 2mm
229738
229935
  /**
229936
+ * Gets the line width, default: 0.200025.
229937
+ *
229938
+ * @function
229939
+ * @instance
229940
+ * @returns {number} lineWidth
229941
+ * @memberof jsPDF#
229942
+ * @name getLineWidth
229943
+ */var getLineWidth=API.__private__.getLineWidth=API.getLineWidth=function(){return lineWidth;};/**
229739
229944
  * Sets line width for upcoming lines.
229740
229945
  *
229741
229946
  * @param {number} width Line width (in units declared at inception of PDF document).
@@ -229744,7 +229949,7 @@ encoding=arguments[3];}else if(arguments[3]&&encodingOptions.indexOf(arguments[3
229744
229949
  * @returns {jsPDF}
229745
229950
  * @memberof jsPDF#
229746
229951
  * @name setLineWidth
229747
- */var setLineWidth=API.__private__.setLineWidth=API.setLineWidth=function(width){out(hpf(scale(width))+" w");return this;};/**
229952
+ */var setLineWidth=API.__private__.setLineWidth=API.setLineWidth=function(width){lineWidth=width;out(hpf(scale(width))+" w");return this;};/**
229748
229953
  * Sets the dash pattern for upcoming lines.
229749
229954
  *
229750
229955
  * To reset the settings simply call the method without any parameters.
@@ -230115,7 +230320,7 @@ eventname=newEvents[i][0];handler_and_args=newEvents[i][1];events.subscribe.appl
230115
230320
  * Object exposing internal API to plugins
230116
230321
  * @public
230117
230322
  * @ignore
230118
- */API.internal={pdfEscape:pdfEscape,getStyle:getStyle,getFont:getFontEntry,getFontSize:getFontSize,getCharSpace:getCharSpace,getTextColor:getTextColor,getLineHeight:getLineHeight,getLineHeightFactor:getLineHeightFactor,write:write,getHorizontalCoordinate:getHorizontalCoordinate,getVerticalCoordinate:getVerticalCoordinate,getCoordinateString:getHorizontalCoordinateString,getVerticalCoordinateString:getVerticalCoordinateString,collections:{},newObject:newObject,newAdditionalObject:newAdditionalObject,newObjectDeferred:newObjectDeferred,newObjectDeferredBegin:newObjectDeferredBegin,getFilters:getFilters,putStream:putStream,events:events,scaleFactor:scaleFactor,pageSize:{getWidth:function getWidth(){return getPageWidth(currentPage);},setWidth:function setWidth(value){setPageWidth(currentPage,value);},getHeight:function getHeight(){return getPageHeight(currentPage);},setHeight:function setHeight(value){setPageHeight(currentPage,value);}},encryptionOptions:encryptionOptions,encryption:encryption,getEncryptor:getEncryptor,output:output,getNumberOfPages:getNumberOfPages,pages:pages,out:out,f2:f2,f3:f3,getPageInfo:getPageInfo,getPageInfoByObjId:getPageInfoByObjId,getCurrentPageInfo:getCurrentPageInfo,getPDFVersion:getPdfVersion,Point:Point,Rectangle:Rectangle,Matrix:Matrix,hasHotfix:hasHotfix//Expose the hasHotfix check so plugins can also check them.
230323
+ */API.internal={pdfEscape:pdfEscape,getStyle:getStyle,getFont:getFontEntry,getFontSize:getFontSize,getCharSpace:getCharSpace,getTextColor:getTextColor,getLineHeight:getLineHeight,getLineHeightFactor:getLineHeightFactor,getLineWidth:getLineWidth,write:write,getHorizontalCoordinate:getHorizontalCoordinate,getVerticalCoordinate:getVerticalCoordinate,getCoordinateString:getHorizontalCoordinateString,getVerticalCoordinateString:getVerticalCoordinateString,collections:{},newObject:newObject,newAdditionalObject:newAdditionalObject,newObjectDeferred:newObjectDeferred,newObjectDeferredBegin:newObjectDeferredBegin,getFilters:getFilters,putStream:putStream,events:events,scaleFactor:scaleFactor,pageSize:{getWidth:function getWidth(){return getPageWidth(currentPage);},setWidth:function setWidth(value){setPageWidth(currentPage,value);},getHeight:function getHeight(){return getPageHeight(currentPage);},setHeight:function setHeight(value){setPageHeight(currentPage,value);}},encryptionOptions:encryptionOptions,encryption:encryption,getEncryptor:getEncryptor,output:output,getNumberOfPages:getNumberOfPages,pages:pages,out:out,f2:f2,f3:f3,getPageInfo:getPageInfo,getPageInfoByObjId:getPageInfoByObjId,getCurrentPageInfo:getCurrentPageInfo,getPDFVersion:getPdfVersion,Point:Point,Rectangle:Rectangle,Matrix:Matrix,hasHotfix:hasHotfix//Expose the hasHotfix check so plugins can also check them.
230119
230324
  };Object.defineProperty(API.internal.pageSize,"width",{get:function get(){return getPageWidth(currentPage);},set:function set(value){setPageWidth(currentPage,value);},enumerable:true,configurable:true});Object.defineProperty(API.internal.pageSize,"height",{get:function get(){return getPageHeight(currentPage);},set:function set(value){setPageHeight(currentPage,value);},enumerable:true,configurable:true});//////////////////////////////////////////////////////
230120
230325
  // continuing initialization of jsPDF Document object
230121
230326
  //////////////////////////////////////////////////////
@@ -230147,7 +230352,7 @@ addFonts.call(API,standardFonts);activeFontKey="F1";_addPage(format,orientation)
230147
230352
  * @name version
230148
230353
  * @type {string}
230149
230354
  * @memberof jsPDF#
230150
- */jsPDF.version="2.4.0";var jsPDFAPI=jsPDF.API;var scaleFactor=1;var pdfEscape=function pdfEscape(value){return value.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)");};var pdfUnescape=function pdfUnescape(value){return value.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")");};var f2=function f2(number){return number.toFixed(2);// Ie, %.2f
230355
+ */jsPDF.version="2.5.1";var jsPDFAPI=jsPDF.API;var scaleFactor=1;var pdfEscape=function pdfEscape(value){return value.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)");};var pdfUnescape=function pdfUnescape(value){return value.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")");};var f2=function f2(number){return number.toFixed(2);// Ie, %.2f
230151
230356
  };var f5=function f5(number){return number.toFixed(5);// Ie, %.2f
230152
230357
  };jsPDFAPI.__acroform__={};var inherit=function inherit(child,parent){child.prototype=Object.create(parent.prototype);child.prototype.constructor=child;};var scale=function scale(x){return x*scaleFactor;};var createFormXObject=function createFormXObject(formObject){var xobj=new AcroFormXObject();var height=AcroFormAppearance.internal.getHeight(formObject)||0;var width=AcroFormAppearance.internal.getWidth(formObject)||0;xobj.BBox=[0,0,Number(f2(width)),Number(f2(height))];return xobj;};/**
230153
230358
  * Bit-Operations
@@ -230804,7 +231009,8 @@ var imageData,format,x,y,w,h,alias,compression,rotation,posX,posY;imageData=argu
230804
231009
  var filter=this.internal.getFilters();if(compression===undefined&&filter.indexOf("FlateEncode")!==-1){compression="SLOW";}// 自定义修改 调整 addImage 方法的 compression值压缩图片
230805
231010
  compression='SLOW';if(isNaN(x)||isNaN(y)){throw new Error("Invalid coordinates passed to jsPDF.addImage");}// if(posX) x += posX;
230806
231011
  // if(posY) y += posY;
230807
- initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString;var exifdata=imageData.exifdata;if(typeof imageData==="string"&&getImageFileTypeByImageData(imageData)===UNKNOWN){imageData=unescape(imageData);var tmpImageData=convertBase64ToBinaryString(imageData,false);if(tmpImageData!==""){imageData=tmpImageData;}else{tmpImageData=jsPDFAPI.loadFile(imageData,true);if(tmpImageData!==undefined){imageData=tmpImageData;}}}if(isDOMElement(imageData)){imageData=getImageDataFromElement(imageData,format);}format=getImageFileTypeByImageData(imageData,format);if(!isImageTypeSupported(format)){throw new Error("addImage does not support files of type '"+format+"', please ensure that a plugin for '"+format+"' support is added.");}// now do the heavy lifting
231012
+ initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString;// 自定义修改 处理图片自带的exif信息(旋转角度)
231013
+ var exifdata=imageData.exifdata;if(typeof imageData==="string"&&getImageFileTypeByImageData(imageData)===UNKNOWN){imageData=unescape(imageData);var tmpImageData=convertBase64ToBinaryString(imageData,false);if(tmpImageData!==""){imageData=tmpImageData;}else{tmpImageData=jsPDFAPI.loadFile(imageData,true);if(tmpImageData!==undefined){imageData=tmpImageData;}}}if(isDOMElement(imageData)){imageData=getImageDataFromElement(imageData,format);}format=getImageFileTypeByImageData(imageData,format);if(!isImageTypeSupported(format)){throw new Error("addImage does not support files of type '"+format+"', please ensure that a plugin for '"+format+"' support is added.");}// now do the heavy lifting
230808
231014
  if(notDefined(alias)){alias=generateAliasFromImageData(imageData);}result=checkImagesForAlias.call(this,alias);if(!result){if(supportsArrayBuffer()){// no need to convert if imageData is already uint8array
230809
231015
  if(!(imageData instanceof Uint8Array)&&format!=="RGBA"){dataAsBinaryString=imageData;imageData=binaryStringToUint8Array(imageData);}}result=this["process"+format.toUpperCase()](imageData,getImageIndex.call(this),alias,checkCompressValue(compression),dataAsBinaryString);}if(!result){throw new Error("An unknown error occurred whilst processing the image.");}result.exifdata=exifdata;return result;};/**
230810
231016
  * @name convertBase64ToBinaryString
@@ -231417,7 +231623,9 @@ Context2D.prototype.arcTo=function(x1,y1,x2,y2,radius){throw new Error("arcTo no
231417
231623
  * @param w {Number} The width of the rectangle, in pixels
231418
231624
  * @param h {Number} The height of the rectangle, in pixels
231419
231625
  * @description The rect() method creates a rectangle.
231420
- */Context2D.prototype.rect=function(x,y,w,h){if(isNaN(x)||isNaN(y)||isNaN(w)||isNaN(h)){jspdf_console.error("jsPDF.context2d.rect: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.rect");}this.moveTo(x,y);this.lineTo(x+w,y);this.lineTo(x+w,y+h);this.lineTo(x,y+h);this.lineTo(x,y);this.lineTo(x+w,y);this.lineTo(x,y);};/**
231626
+ */Context2D.prototype.rect=function(x,y,w,h){if(isNaN(x)||isNaN(y)||isNaN(w)||isNaN(h)){jspdf_console.error("jsPDF.context2d.rect: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.rect");}this.moveTo(x,y);this.lineTo(x+w,y);this.lineTo(x+w,y+h);this.lineTo(x,y+h);this.lineTo(x,y);// this.lineTo(x + w, y);
231627
+ // this.lineTo(x, y);
231628
+ };/**
231421
231629
  * Draws a "filled" rectangle
231422
231630
  *
231423
231631
  * @name fillRect
@@ -231555,26 +231763,7 @@ putText.call(this,{text:text,x:x,y:y,scale:scale,renderingMode:"stroke",angle:de
231555
231763
  * @param e {Number} Horizontal moving
231556
231764
  * @param f {Number} Vertical moving
231557
231765
  * @description Each object on the canvas has a current transformation matrix.<br /><br />The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:<br /><br /><br /><br />a c e<br /><br />b d f<br /><br />0 0 1<br /><br />In other words, the transform() method lets you scale, rotate, move, and skew the current context.
231558
- */Context2D.prototype.transform=function(a,b,c,d,e,f){if(isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||isNaN(e)||isNaN(f)){jspdf_console.error("jsPDF.context2d.transform: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.transform");}// console.log("开始变换",a,b,c,d,e,f);
231559
- // if (isNaN(a)){
231560
- // a=0;
231561
- // }
231562
- // if (isNaN(b)){
231563
- // b=0;
231564
- // }
231565
- // if (isNaN(c)){
231566
- // d=0;
231567
- // }
231568
- // if (isNaN(d)){
231569
- // d=0;
231570
- // }
231571
- // if (isNaN(e)){
231572
- // e=0;
231573
- // }
231574
- // if (isNaN(f)){
231575
- // f=0;
231576
- // }
231577
- // 自定义修改 处理打印图片报错
231766
+ */Context2D.prototype.transform=function(a,b,c,d,e,f){if(isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||isNaN(e)||isNaN(f)){jspdf_console.error("jsPDF.context2d.transform: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.transform");}// 自定义修改 处理打印图片报错
231578
231767
  a=isNaN(a)?1:a;b=isNaN(b)?0:b;c=isNaN(c)?0:c;d=isNaN(d)?1:d;e=isNaN(e)?0:e;f=isNaN(f)?0:f;var matrix=new Matrix(a,b,c,d,e,f);this.ctx.transform=this.ctx.transform.multiply(matrix);// console.log("this.transform值",this.ctx.transform);
231579
231768
  };/**
231580
231769
  * Resets the current transform to the identity matrix. Then runs transform()
@@ -231601,7 +231790,8 @@ a=isNaN(a)?1:a;b=isNaN(b)?0:b;c=isNaN(c)?0:c;d=isNaN(d)?1:d;e=isNaN(e)?0:e;f=isN
231601
231790
  * @param y {Number} The y coordinate where to place the image on the canvas
231602
231791
  * @param width {Number} Optional. The width of the image to use (stretch or reduce the image)
231603
231792
  * @param height {Number} Optional. The height of the image to use (stretch or reduce the image)
231604
- */Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img);if(img.exifdata){imageProperties.exifdata=img.exifdata;}var factorX=1;var factorY=1;var clipFactorX=1;var clipFactorY=1;if(typeof swidth!=="undefined"&&typeof width!=="undefined"){clipFactorX=width/swidth;clipFactorY=height/sheight;factorX=imageProperties.width/swidth*width/swidth;factorY=imageProperties.height/sheight*height/sheight;}//is sx and sy are set and x and y not, set x and y with values of sx and sy
231793
+ */Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img);// 自定义修改 设置exif信息
231794
+ if(img.exifdata){imageProperties.exifdata=img.exifdata;}var factorX=1;var factorY=1;var clipFactorX=1;var clipFactorY=1;if(typeof swidth!=="undefined"&&typeof width!=="undefined"){clipFactorX=width/swidth;clipFactorY=height/sheight;factorX=imageProperties.width/swidth*width/swidth;factorY=imageProperties.height/sheight*height/sheight;}//is sx and sy are set and x and y not, set x and y with values of sx and sy
231605
231795
  if(typeof x==="undefined"){x=sx;y=sy;sx=0;sy=0;}if(typeof swidth!=="undefined"&&typeof width==="undefined"){width=swidth;height=sheight;}if(typeof swidth==="undefined"&&typeof width==="undefined"){width=imageProperties.width;height=imageProperties.height;}var decomposedTransformationMatrix=this.ctx.transform.decompose();// console.log("transform.decompose",decomposedTransformationMatrix.scale);
231606
231796
  // 自定义修改 修复图片旋转角度错误问题
231607
231797
  var angle=rad2deg(decomposedTransformationMatrix.rotate.rotation);var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);if(!swidth){swidth=width;}if(!sheight){sheight=height;}var xRect;// 自定义修改 处理签名图片打印和普通图片打印
@@ -231616,7 +231806,15 @@ this.pdf.addImage(img,"JPEG",xRect.x+this.posX,xRect.y+this.posY,xRect.w,xRect.h
231616
231806
  * @private
231617
231807
  * @ignore
231618
231808
  */var drawPaths=function drawPaths(rule,isClip){if(rule==="stroke"&&!isClip&&isStrokeTransparent.call(this)){return;}if(rule!=="stroke"&&!isClip&&isFillTransparent.call(this)){return;}var moves=[];//var alpha = (this.ctx.fillOpacity < 1) ? this.ctx.fillOpacity : this.ctx.globalAlpha;
231619
- var delta;var xPath=this.path;for(var i=0;i<xPath.length;i++){var pt=xPath[i];switch(pt.type){case"begin":moves.push({begin:true});break;case"close":moves.push({close:true});break;case"mt":moves.push({start:pt,deltas:[],abs:[]});break;case"lt":var iii=moves.length;if(!isNaN(xPath[i-1].x)){delta=[pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];if(iii>0){for(iii;iii>=0;iii--){if(moves[iii-1].close!==true&&moves[iii-1].begin!==true){moves[iii-1].deltas.push(delta);moves[iii-1].abs.push(pt);break;}}}}break;case"bct":delta=[pt.x1-xPath[i-1].x,pt.y1-xPath[i-1].y,pt.x2-xPath[i-1].x,pt.y2-xPath[i-1].y,pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"qct":var x1=xPath[i-1].x+2.0/3.0*(pt.x1-xPath[i-1].x);var y1=xPath[i-1].y+2.0/3.0*(pt.y1-xPath[i-1].y);var x2=pt.x+2.0/3.0*(pt.x1-pt.x);var y2=pt.y+2.0/3.0*(pt.y1-pt.y);var x3=pt.x;var y3=pt.y;delta=[x1-xPath[i-1].x,y1-xPath[i-1].y,x2-xPath[i-1].x,y2-xPath[i-1].y,x3-xPath[i-1].x,y3-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"arc":moves.push({deltas:[],abs:[],arc:true});if(Array.isArray(moves[moves.length-1].abs)){moves[moves.length-1].abs.push(pt);}break;}}var style;if(!isClip){if(rule==="stroke"){style="stroke";}else{style="fill";}}else{style=null;}for(var k=0;k<moves.length;k++){if(moves[k].arc){var arcs=moves[k].abs;for(var ii=0;ii<arcs.length;ii++){var arc=arcs[ii];if(arc.type==="arc"){drawArc.call(this,arc.x,arc.y,arc.radius,arc.startAngle,arc.endAngle,arc.counterclockwise,undefined,isClip);}else{drawLine.call(this,arc.x,arc.y);}}putStyle.call(this,style);this.pdf.internal.out("h");}if(!moves[k].arc){if(moves[k].close!==true&&moves[k].begin!==true){var x=moves[k].start.x;var y=moves[k].start.y;drawLines.call(this,moves[k].deltas,x,y);}}}if(style){putStyle.call(this,style);}if(isClip){doClip.call(this);}};var getBaseline=function getBaseline(y){var height=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor;var descent=height*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return y-descent;case"top":return y+height-descent;case"hanging":return y+height-2*descent;case"middle":return y+height/2-descent;case"ideographic":// TODO not implemented
231809
+ var delta;var xPath=this.path;for(var i=0;i<xPath.length;i++){var pt=xPath[i];switch(pt.type){case"begin":moves.push({begin:true});break;case"close":moves.push({close:true});break;case"mt":moves.push({start:pt,deltas:[],abs:[]});break;case"lt":var iii=moves.length;if(xPath[i-1]&&!isNaN(xPath[i-1].x)){delta=[pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];if(iii>0){for(iii;iii>=0;iii--){if(moves[iii-1].close!==true&&moves[iii-1].begin!==true){moves[iii-1].deltas.push(delta);moves[iii-1].abs.push(pt);break;}}}}break;case"bct":delta=[pt.x1-xPath[i-1].x,pt.y1-xPath[i-1].y,pt.x2-xPath[i-1].x,pt.y2-xPath[i-1].y,pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"qct":var x1=xPath[i-1].x+2.0/3.0*(pt.x1-xPath[i-1].x);var y1=xPath[i-1].y+2.0/3.0*(pt.y1-xPath[i-1].y);var x2=pt.x+2.0/3.0*(pt.x1-pt.x);var y2=pt.y+2.0/3.0*(pt.y1-pt.y);var x3=pt.x;var y3=pt.y;delta=[x1-xPath[i-1].x,y1-xPath[i-1].y,x2-xPath[i-1].x,y2-xPath[i-1].y,x3-xPath[i-1].x,y3-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"arc":moves.push({deltas:[],abs:[],arc:true});if(Array.isArray(moves[moves.length-1].abs)){moves[moves.length-1].abs.push(pt);}break;}}var style;if(!isClip){if(rule==="stroke"){style="stroke";}else{style="fill";}}else{style=null;}var began=false;for(var k=0;k<moves.length;k++){if(moves[k].arc){var arcs=moves[k].abs;for(var ii=0;ii<arcs.length;ii++){var arc=arcs[ii];if(arc.type==="arc"){drawArc.call(this,arc.x,arc.y,arc.radius,arc.startAngle,arc.endAngle,arc.counterclockwise,undefined,isClip,!began);}else{drawLine.call(this,arc.x,arc.y);}}// putStyle.call(this, style);
231810
+ began=true;}else if(moves[k].close===true){this.pdf.internal.out("h");began=false;}else if(moves[k].begin!==true){var x=moves[k].start.x;var y=moves[k].start.y;drawLines.call(this,moves[k].deltas,x,y);began=true;}// if (!moves[k].arc) {
231811
+ // if (moves[k].close !== true && moves[k].begin !== true) {
231812
+ // var x = moves[k].start.x;
231813
+ // var y = moves[k].start.y;
231814
+ // drawLines.call(this, moves[k].deltas, x, y);
231815
+ // }
231816
+ // }
231817
+ }if(style){putStyle.call(this,style);}if(isClip){doClip.call(this);}};var getBaseline=function getBaseline(y){var height=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor;var descent=height*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return y-descent;case"top":return y+height-descent;case"hanging":return y+height-2*descent;case"middle":return y+height/2-descent;case"ideographic":// TODO not implemented
231620
231818
  return y;case"alphabetic":default:return y;}};var getTextBottom=function getTextBottom(yBaseLine){var height=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor;var descent=height*(this.pdf.internal.getLineHeightFactor()-1);return yBaseLine+descent;};Context2D.prototype.createLinearGradient=function createLinearGradient(){var canvasGradient=function canvasGradient(){};canvasGradient.colorStops=[];canvasGradient.addColorStop=function(offset,color){this.colorStops.push([offset,color]);};canvasGradient.getColor=function(){if(this.colorStops.length===0){return"#000000";}return this.colorStops[0][1];};canvasGradient.isCanvasGradient=true;return canvasGradient;};Context2D.prototype.createPattern=function createPattern(){return this.createLinearGradient();};Context2D.prototype.createRadialGradient=function createRadialGradient(){return this.createLinearGradient();};/**
231621
231819
  *
231622
231820
  * @param x Edge point X
@@ -231627,7 +231825,9 @@ return y;case"alphabetic":default:return y;}};var getTextBottom=function getText
231627
231825
  * @param counterclockwise
231628
231826
  * @param style
231629
231827
  * @param isClip
231630
- */var drawArc=function drawArc(x,y,r,a1,a2,counterclockwise,style,isClip){var curves=createArc.call(this,r,a1,a2,counterclockwise);for(var i=0;i<curves.length;i++){var curve=curves[i];if(i===0){doMove.call(this,curve.x1+x,curve.y1+y);}drawCurve.call(this,x,y,curve.x2,curve.y2,curve.x3,curve.y3,curve.x4,curve.y4);}if(!isClip){putStyle.call(this,style);}else{doClip.call(this);}};var putStyle=function putStyle(style){switch(style){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f");break;}};var doClip=function doClip(){this.pdf.clip();this.pdf.discardPath();};var doMove=function doMove(x,y){this.pdf.internal.out(getHorizontalCoordinateString(x)+" "+getVerticalCoordinateString(y)+" m");};var putText=function putText(options){var textAlign;switch(options.align){case"right":case"end":textAlign="right";break;case"center":textAlign="center";break;case"left":case"start":default:textAlign="left";break;}var textDimensions=this.pdf.getTextDimensions(options.text);var yBaseLine=getBaseline.call(this,options.y);var yBottom=getTextBottom.call(this,yBaseLine);var yTop=yBottom-textDimensions.h;var pt=this.ctx.transform.applyToPoint(new Point(options.x,yBaseLine));var decomposedTransformationMatrix=this.ctx.transform.decompose();var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);var baselineRect=this.ctx.transform.applyToRectangle(new Rectangle(options.x,yBaseLine,textDimensions.w,textDimensions.h));var textBounds=matrix.applyToRectangle(new Rectangle(options.x,yTop,textDimensions.w,textDimensions.h));var pageArray=getPagesByPath.call(this,textBounds);var pages=[];for(var ii=0;ii<pageArray.length;ii+=1){if(pages.indexOf(pageArray[ii])===-1){pages.push(pageArray[ii]);}}sortPages(pages);var clipPath,oldSize,oldLineWidth;options.text=options.text.replace(/[\t]/g,' ');// 自定义修改 修复打印不了tab键的问题
231828
+ */var drawArc=function drawArc(x,y,r,a1,a2,counterclockwise,style,isClip,includeMove){// http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html
231829
+ var curves=createArc.call(this,r,a1,a2,counterclockwise);for(var i=0;i<curves.length;i++){var curve=curves[i];if(i===0){// doMove.call(this, curve.x1 + x, curve.y1 + y);
231830
+ if(includeMove){doMove.call(this,curve.x1+x,curve.y1+y);}else{drawLine.call(this,curve.x1+x,curve.y1+y);}}drawCurve.call(this,x,y,curve.x2,curve.y2,curve.x3,curve.y3,curve.x4,curve.y4);}if(!isClip){putStyle.call(this,style);}else{doClip.call(this);}};var putStyle=function putStyle(style){switch(style){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f");break;}};var doClip=function doClip(){this.pdf.clip();this.pdf.discardPath();};var doMove=function doMove(x,y){this.pdf.internal.out(getHorizontalCoordinateString(x)+" "+getVerticalCoordinateString(y)+" m");};var putText=function putText(options){var textAlign;switch(options.align){case"right":case"end":textAlign="right";break;case"center":textAlign="center";break;case"left":case"start":default:textAlign="left";break;}var textDimensions=this.pdf.getTextDimensions(options.text);var yBaseLine=getBaseline.call(this,options.y);var yBottom=getTextBottom.call(this,yBaseLine);var yTop=yBottom-textDimensions.h;var pt=this.ctx.transform.applyToPoint(new Point(options.x,yBaseLine));var decomposedTransformationMatrix=this.ctx.transform.decompose();var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);var baselineRect=this.ctx.transform.applyToRectangle(new Rectangle(options.x,yBaseLine,textDimensions.w,textDimensions.h));var textBounds=matrix.applyToRectangle(new Rectangle(options.x,yTop,textDimensions.w,textDimensions.h));var pageArray=getPagesByPath.call(this,textBounds);var pages=[];for(var ii=0;ii<pageArray.length;ii+=1){if(pages.indexOf(pageArray[ii])===-1){pages.push(pageArray[ii]);}}sortPages(pages);var clipPath,oldSize,oldLineWidth;options.text=options.text.replace(/[\t]/g,' ');// 自定义修改 修复打印不了tab键的问题
231631
231831
  if(this.autoPaging){var min=pages[0];var max=pages[pages.length-1];for(var i=min;i<max+1;i++){this.pdf.setPage(i);var topMargin=i===1?this.posY+this.margin[0]:this.margin[0];var firstPageHeight=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2];var pageHeightMinusBottomMargin=this.pdf.internal.pageSize.height-this.margin[2];var pageHeightMinusMargins=pageHeightMinusBottomMargin-this.margin[0];var pageWidthMinusRightMargin=this.pdf.internal.pageSize.width-this.margin[1];var pageWidthMinusMargins=pageWidthMinusRightMargin-this.margin[3];var previousPageHeightSum=i===1?0:firstPageHeight+(i-2)*pageHeightMinusMargins;var acharSpace=options.charSpace?parseFloat(options.charSpace):0.0;//自定义修改
231632
231832
  if(this.ctx.clip_path.length!==0){var tmpPaths=this.path;clipPath=JSON.parse(JSON.stringify(this.ctx.clip_path));this.path=pathPositionRedo(clipPath,this.posX+this.margin[3],-1*previousPageHeightSum+topMargin);drawPaths.call(this,"fill",true);this.path=tmpPaths;}var textBoundsOnPage=pathPositionRedo([JSON.parse(JSON.stringify(textBounds))],this.posX+this.margin[3],-previousPageHeightSum+topMargin+this.ctx.prevPageLastElemOffset)[0];if(options.scale>=0.01){oldSize=this.pdf.internal.getFontSize();this.pdf.setFontSize(oldSize*options.scale);oldLineWidth=this.lineWidth;this.lineWidth=oldLineWidth*options.scale;}var doSlice=this.autoPaging!=="text";if(doSlice||textBoundsOnPage.y+textBoundsOnPage.h<=pageHeightMinusBottomMargin){if(doSlice||textBoundsOnPage.y>=topMargin&&textBoundsOnPage.x<=pageWidthMinusRightMargin){var croppedText=doSlice?options.text:this.pdf.splitTextToSize(options.text,options.maxWidth||pageWidthMinusRightMargin-textBoundsOnPage.x)[0];var baseLineRectOnPage=pathPositionRedo([JSON.parse(JSON.stringify(baselineRect))],this.posX+this.margin[3],-previousPageHeightSum+topMargin+this.ctx.prevPageLastElemOffset)[0];var needsClipping=doSlice&&(i>min||i<max)&&hasMargins.call(this);if(needsClipping){this.pdf.saveGraphicsState();this.pdf.rect(this.margin[3],this.margin[0],pageWidthMinusMargins,pageHeightMinusMargins,null).clip().discardPath();}this.pdf.text(croppedText,baseLineRectOnPage.x,baseLineRectOnPage.y,{angle:options.angle,align:textAlign,renderingMode:options.renderingMode,charSpace:acharSpace// 自定义修改
231633
231833
  });if(needsClipping){this.pdf.restoreGraphicsState();}}}else{// This text is the last element of the page, but it got cut off due to the margin
@@ -231800,7 +232000,7 @@ var options=Object.assign({},this.opt.html2canvas);delete options.onrendered;ret
231800
232000
  var onRendered=this.opt.html2canvas.onrendered||function(){};onRendered(canvas);this.prop.canvas=canvas;document.body.removeChild(this.prop.overlay);});};Worker.prototype.toContext2d=function toContext2d(){// Set up function prerequisites.
231801
232001
  var prereqs=[function checkContainer(){return document.body.contains(this.prop.container)||this.toContainer();}];// Fulfill prereqs then create the canvas.
231802
232002
  return this.thenList(prereqs).then(loadHtml2Canvas).then(function toContext2d_main(html2canvas){// Handle old-fashioned 'onrendered' argument.
231803
- var pdf=this.opt.jsPDF;var fontFaces=this.opt.fontFaces;var scale=typeof this.opt.width==="number"&&!isNaN(this.opt.width)&&typeof this.opt.windowWidth==="number"&&!isNaN(this.opt.windowWidth)?this.opt.width/this.opt.windowWidth:1;var options=Object.assign({async:true,allowTaint:true,scale:scale,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15000,logging:true,proxy:null,removeContainer:true,foreignObjectRendering:false,useCORS:false},this.opt.html2canvas);delete options.onrendered;pdf.context2d.autoPaging=typeof this.opt.autoPaging==="undefined"?true:this.opt.autoPaging;pdf.context2d.posX=this.opt.x;pdf.context2d.posY=this.opt.y;pdf.context2d.margin=this.opt.margin;pdf.context2d.fontFaces=fontFaces;if(fontFaces){for(var i=0;i<fontFaces.length;++i){var font=fontFaces[i];var src=font.src.find(function(src){return src.format==="truetype";});if(src){pdf.addFont(src.url,font.ref.name,font.ref.style);}}}options.windowHeight=options.windowHeight||0;options.windowHeight=options.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):options.windowHeight;return html2canvas(this.prop.container,options);}).then(function toContext2d_post(canvas){// Handle old-fashioned 'onrendered' argument.
232003
+ var pdf=this.opt.jsPDF;var fontFaces=this.opt.fontFaces;var scale=typeof this.opt.width==="number"&&!isNaN(this.opt.width)&&typeof this.opt.windowWidth==="number"&&!isNaN(this.opt.windowWidth)?this.opt.width/this.opt.windowWidth:1;var options=Object.assign({async:true,allowTaint:true,scale:scale,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15000,logging:true,proxy:null,removeContainer:true,foreignObjectRendering:false,useCORS:false},this.opt.html2canvas);delete options.onrendered;pdf.context2d.autoPaging=typeof this.opt.autoPaging==="undefined"?true:this.opt.autoPaging;pdf.context2d.posX=this.opt.x;pdf.context2d.posY=this.opt.y;pdf.context2d.margin=this.opt.margin;pdf.context2d.fontFaces=fontFaces;if(fontFaces){for(var i=0;i<fontFaces.length;++i){var font=fontFaces[i];var src=font.src.find(function(src){return src.format==="truetype";});if(src){pdf.addFont(src.url,font.ref.name,font.ref.style);}}}options.windowHeight=options.windowHeight||0;options.windowHeight=options.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):options.windowHeight;return html2canvas(this.prop.container,options);}).then(function toContext2d_post(canvas){this.opt.jsPDF.context2d.restore(true);// Handle old-fashioned 'onrendered' argument.
231804
232004
  var onRendered=this.opt.html2canvas.onrendered||function(){};onRendered(canvas);this.prop.canvas=canvas;document.body.removeChild(this.prop.overlay);});};Worker.prototype.toImg=function toImg(){// Set up function prerequisites.
231805
232005
  var prereqs=[function checkCanvas(){return this.prop.canvas||this.toCanvas();}];// Fulfill prereqs then create the image.
231806
232006
  return this.thenList(prereqs).then(function toImg_main(){var imgData=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img");this.prop.img.src=imgData;});};Worker.prototype.toPdf=function toPdf(){// Set up function prerequisites.
@@ -232543,7 +232743,8 @@ var rgbOut=new Uint8Array(length/4*3);var alphaOut=new Uint8Array(length/4);var
232543
232743
  * @param {Object} options
232544
232744
  * @returns {Array}
232545
232745
  */var getCharWidthsArray=API.getCharWidthsArray=function(text,options){options=options||{};var activeFont=options.font||this.internal.getFont();var fontSize=options.fontSize||this.internal.getFontSize();var charSpace=options.charSpace||this.internal.getCharSpace();var widths=options.widths?options.widths:activeFont.metadata.Unicode.widths;var widthsFractionOf=widths.fof?widths.fof:1;var kerning=options.kerning?options.kerning:activeFont.metadata.Unicode.kerning;var kerningFractionOf=kerning.fof?kerning.fof:1;var doKerning=options.doKerning===false?false:true;var kerningValue=0;var i;var length=text.length;var char_code;var prior_char_code=0;//for kerning
232546
- var default_char_width=widths[0]||widthsFractionOf;var output=[];for(i=0;i<length;i++){char_code=text.charCodeAt(i);if(typeof activeFont.metadata.widthOfString==="function"){output.push((activeFont.metadata.widthOfGlyph(activeFont.metadata.characterToGlyph(char_code))+charSpace*(1000/fontSize)||0)/1000);}else{if(doKerning&&(0,esm_typeof/* default */.Z)(kerning[char_code])==="object"&&!isNaN(parseInt(kerning[char_code][prior_char_code],10))){kerningValue=kerning[char_code][prior_char_code]/kerningFractionOf;}else{kerningValue=0;}output.push((widths[char_code]||default_char_width)/widthsFractionOf+kerningValue);}prior_char_code=char_code;}return output;};/**
232746
+ var default_char_width=widths[0]||widthsFractionOf;var output=[];for(i=0;i<length;i++){char_code=text.charCodeAt(i);if(typeof activeFont.metadata.widthOfString==="function"){output.push((activeFont.metadata.widthOfGlyph(activeFont.metadata.characterToGlyph(char_code))+charSpace*(1000/fontSize)||0)/1000);}else{if(doKerning&&(0,esm_typeof/* default */.Z)(kerning[char_code])==="object"&&!isNaN(parseInt(kerning[char_code][prior_char_code],10))){kerningValue=kerning[char_code][prior_char_code]/kerningFractionOf;}else{kerningValue=0;}var charSpacewidth=(charSpace*(1000/fontSize)||0)/1000*this.internal.scaleFactor;var currentCharWidth=(widths[char_code]||default_char_width)/widthsFractionOf+kerningValue;output.push(currentCharWidth+charSpacewidth);// output.push((widths[char_code] || default_char_width) / widthsFractionOf + kerningValue);
232747
+ }prior_char_code=char_code;}return output;};/**
232547
232748
  * Returns a widths of string in a given font, if the font size is set as 1 point.
232548
232749
  *
232549
232750
  * In other words, this is "proportional" value. For 1 unit of font size, the length
@@ -232895,7 +233096,8 @@ ctx.fillRect(0,0,canvas.width,canvas.height);var options={ignoreMouse:true,ignor
232895
233096
  return ar.join("");}else{t=t.toString(16);ar.push(padz[4-t.length],t);}}return ar.join("");};var toUnicodeCmap=function toUnicodeCmap(map){var code,codes,range,unicode,unicodeMap,_i,_len;unicodeMap="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange";codes=Object.keys(map).sort(function(a,b){return a-b;});range=[];for(_i=0,_len=codes.length;_i<_len;_i++){code=codes[_i];if(range.length>=100){unicodeMap+="\n"+range.length+" beginbfchar\n"+range.join("\n")+"\nendbfchar";range=[];}if(map[code]!==undefined&&map[code]!==null&&typeof map[code].toString==="function"){unicode=("0000"+map[code].toString(16)).slice(-4);code=("0000"+(+code).toString(16)).slice(-4);range.push("<"+code+"><"+unicode+">");}}if(range.length){unicodeMap+="\n"+range.length+" beginbfchar\n"+range.join("\n")+"\nendbfchar\n";}unicodeMap+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";return unicodeMap;};var identityHFunction=function identityHFunction(options){var font=options.font;var out=options.out;var newObject=options.newObject;var putStream=options.putStream;if(font.metadata instanceof jsPDF.API.TTFFont&&font.encoding==="Identity-H"){//Tag with Identity-H
232896
233097
  var widths=font.metadata.Unicode.widths;var data=font.metadata.subset.encode(font.metadata.glyIdsUsed,1);var pdfOutput=data;var pdfOutput2="";for(var i=0;i<pdfOutput.length;i++){pdfOutput2+=String.fromCharCode(pdfOutput[i]);}var fontTable=newObject();putStream({data:pdfOutput2,addLength1:true,objectId:fontTable});out("endobj");var cmap=newObject();var cmapData=toUnicodeCmap(font.metadata.toUnicode);putStream({data:cmapData,addLength1:true,objectId:cmap});out("endobj");var fontDescriptor=newObject();out("<<");out("/Type /FontDescriptor");out("/FontName /"+toPDFName(font.fontName));out("/FontFile2 "+fontTable+" 0 R");out("/FontBBox "+jsPDF.API.PDFObject.convert(font.metadata.bbox));out("/Flags "+font.metadata.flags);out("/StemV "+font.metadata.stemV);out("/ItalicAngle "+font.metadata.italicAngle);out("/Ascent "+font.metadata.ascender);out("/Descent "+font.metadata.decender);out("/CapHeight "+font.metadata.capHeight);out(">>");out("endobj");var DescendantFont=newObject();out("<<");out("/Type /Font");out("/BaseFont /"+toPDFName(font.fontName));out("/FontDescriptor "+fontDescriptor+" 0 R");out("/W "+jsPDF.API.PDFObject.convert(widths));out("/CIDToGIDMap /Identity");out("/DW 1000");out("/Subtype /CIDFontType2");out("/CIDSystemInfo");out("<<");out("/Supplement 0");out("/Registry (Adobe)");out("/Ordering ("+font.encoding+")");out(">>");out(">>");out("endobj");font.objectNumber=newObject();out("<<");out("/Type /Font");out("/Subtype /Type0");out("/ToUnicode "+cmap+" 0 R");out("/BaseFont /"+toPDFName(font.fontName));out("/Encoding /"+font.encoding);out("/DescendantFonts ["+DescendantFont+" 0 R]");out(">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){identityHFunction(args);}]);var winAnsiEncodingFunction=function winAnsiEncodingFunction(options){var font=options.font;var out=options.out;var newObject=options.newObject;var putStream=options.putStream;if(font.metadata instanceof jsPDF.API.TTFFont&&font.encoding==="WinAnsiEncoding"){//Tag with WinAnsi encoding
232897
233098
  var data=font.metadata.rawData;var pdfOutput=data;var pdfOutput2="";for(var i=0;i<pdfOutput.length;i++){pdfOutput2+=String.fromCharCode(pdfOutput[i]);}var fontTable=newObject();putStream({data:pdfOutput2,addLength1:true,objectId:fontTable});out("endobj");var cmap=newObject();var cmapData=toUnicodeCmap(font.metadata.toUnicode);putStream({data:cmapData,addLength1:true,objectId:cmap});out("endobj");var fontDescriptor=newObject();out("<<");out("/Descent "+font.metadata.decender);out("/CapHeight "+font.metadata.capHeight);out("/StemV "+font.metadata.stemV);out("/Type /FontDescriptor");out("/FontFile2 "+fontTable+" 0 R");out("/Flags 96");out("/FontBBox "+jsPDF.API.PDFObject.convert(font.metadata.bbox));out("/FontName /"+toPDFName(font.fontName));out("/ItalicAngle "+font.metadata.italicAngle);out("/Ascent "+font.metadata.ascender);out(">>");out("endobj");font.objectNumber=newObject();for(var j=0;j<font.metadata.hmtx.widths.length;j++){font.metadata.hmtx.widths[j]=parseInt(font.metadata.hmtx.widths[j]*(1000/font.metadata.head.unitsPerEm));//Change the width of Em units to Point units.
232898
- }out("<</Subtype/TrueType/Type/Font/ToUnicode "+cmap+" 0 R/BaseFont/"+toPDFName(font.fontName)+"/FontDescriptor "+fontDescriptor+" 0 R"+"/Encoding/"+font.encoding+" /FirstChar 29 /LastChar 255 /Widths "+jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths)+">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){winAnsiEncodingFunction(args);}]);var utf8TextFunction=function utf8TextFunction(args){var text=args.text||"";var x=args.x;var y=args.y;var options=args.options||{};var mutex=args.mutex||{};var pdfEscape=mutex.pdfEscape;var activeFontKey=mutex.activeFontKey;var fonts=mutex.fonts;var key=activeFontKey;var str="",s=0,cmapConfirm;var strText="";var encoding=fonts[key].encoding;if(fonts[key].encoding!=="Identity-H"){return{text:text,x:x,y:y,options:options,mutex:mutex};}strText=text;key=activeFontKey;if(Array.isArray(text)){strText=text[0];}var textArr=(0,esm_toConsumableArray/* default */.Z)(strText);for(s=0;s<textArr.length;s+=1){if(fonts[key].metadata.hasOwnProperty("cmap")){cmapConfirm=fonts[key].metadata.cmap.unicode.codeMap[textArr[s].codePointAt()];/*
233099
+ }out("<</Subtype/TrueType/Type/Font/ToUnicode "+cmap+" 0 R/BaseFont/"+toPDFName(font.fontName)+"/FontDescriptor "+fontDescriptor+" 0 R"+"/Encoding/"+font.encoding+" /FirstChar 29 /LastChar 255 /Widths "+jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths)+">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){winAnsiEncodingFunction(args);}]);var utf8TextFunction=function utf8TextFunction(args){var text=args.text||"";var x=args.x;var y=args.y;var options=args.options||{};var mutex=args.mutex||{};var pdfEscape=mutex.pdfEscape;var activeFontKey=mutex.activeFontKey;var fonts=mutex.fonts;var key=activeFontKey;var str="",s=0,cmapConfirm;var strText="";var encoding=fonts[key].encoding;if(fonts[key].encoding!=="Identity-H"){return{text:text,x:x,y:y,options:options,mutex:mutex};}strText=text;key=activeFontKey;if(Array.isArray(text)){strText=text[0];}// 自定义修改 处理带生僻字的字符串解构
233100
+ var textArr=(0,esm_toConsumableArray/* default */.Z)(strText);for(s=0;s<textArr.length;s+=1){if(fonts[key].metadata.hasOwnProperty("cmap")){cmapConfirm=fonts[key].metadata.cmap.unicode.codeMap[textArr[s].codePointAt()];/*
232899
233101
  if (Object.prototype.toString.call(text) === '[object Array]') {
232900
233102
  var i = 0;
232901
233103
  // for (i = 0; i < text.length; i += 1) {
@@ -239411,8 +239613,8 @@ var UpdateDocument_component = (0,componentNormalizer/* default */.Z)(
239411
239613
  )
239412
239614
 
239413
239615
  /* harmony default export */ var UpdateDocument = (UpdateDocument_component.exports);
239414
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=template&id=a218f044&
239415
- var PageSettingvue_type_template_id_a218f044_render = function render() {
239616
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=template&id=43e8d8c6&
239617
+ var PageSettingvue_type_template_id_43e8d8c6_render = function render() {
239416
239618
  var _vm = this,
239417
239619
  _c = _vm._self._c;
239418
239620
  return _c('div', {
@@ -239654,35 +239856,6 @@ var PageSettingvue_type_template_id_a218f044_render = function render() {
239654
239856
  }
239655
239857
  }, [_vm._v(_vm._s(style[0]))]);
239656
239858
  }), 1)], 1), _c('li', {
239657
- staticClass: "control-item"
239658
- }, [_c('span', {
239659
- staticClass: "label",
239660
- staticStyle: {
239661
- "width": "64px"
239662
- }
239663
- }, [_vm._v("来源(S)")]), _c('a-select', {
239664
- staticStyle: {
239665
- "width": "100%"
239666
- },
239667
- attrs: {
239668
- "getPopupContainer": function getPopupContainer(triggerNode) {
239669
- return triggerNode.parentNode;
239670
- },
239671
- "size": "small",
239672
- "placeholder": "请选择来源"
239673
- },
239674
- model: {
239675
- value: _vm.property.source,
239676
- callback: function callback($$v) {
239677
- _vm.$set(_vm.property, "source", $$v);
239678
- },
239679
- expression: "property.source"
239680
- }
239681
- }, [_c('a-select-option', {
239682
- attrs: {
239683
- "value": "0"
239684
- }
239685
- }, [_vm._v("自动选择")])], 1)], 1), _c('li', {
239686
239859
  staticClass: "control-item paper-item"
239687
239860
  }, [_c('span', {
239688
239861
  staticClass: "label",
@@ -239917,7 +240090,7 @@ var PageSettingvue_type_template_id_a218f044_render = function render() {
239917
240090
  }
239918
240091
  }, [_vm._v("取消")])], 1)])]);
239919
240092
  };
239920
- var PageSettingvue_type_template_id_a218f044_staticRenderFns = [];
240093
+ var PageSettingvue_type_template_id_43e8d8c6_staticRenderFns = [];
239921
240094
 
239922
240095
  // EXTERNAL MODULE: ./src/components/mixins/appendToBody.ts
239923
240096
  var appendToBody = __webpack_require__(95677);
@@ -240065,10 +240238,10 @@ var HoColorPicker = __webpack_require__(10306);
240065
240238
  });
240066
240239
  ;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=script&lang=js&
240067
240240
  /* harmony default export */ var toolbar_PageSettingvue_type_script_lang_js_ = (PageSettingvue_type_script_lang_js_);
240068
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=a218f044&prod&lang=less&
240241
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=43e8d8c6&prod&lang=less&
240069
240242
  // extracted by mini-css-extract-plugin
240070
240243
 
240071
- ;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=a218f044&prod&lang=less&
240244
+ ;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=43e8d8c6&prod&lang=less&
240072
240245
 
240073
240246
  ;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue
240074
240247
 
@@ -240081,8 +240254,8 @@ var HoColorPicker = __webpack_require__(10306);
240081
240254
 
240082
240255
  var PageSetting_component = (0,componentNormalizer/* default */.Z)(
240083
240256
  toolbar_PageSettingvue_type_script_lang_js_,
240084
- PageSettingvue_type_template_id_a218f044_render,
240085
- PageSettingvue_type_template_id_a218f044_staticRenderFns,
240257
+ PageSettingvue_type_template_id_43e8d8c6_render,
240258
+ PageSettingvue_type_template_id_43e8d8c6_staticRenderFns,
240086
240259
  false,
240087
240260
  null,
240088
240261
  null,