ecinc-cloud-yoabase 9.6.274 → 9.6.277

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.
@@ -239946,8 +239946,8 @@ var InlineTextEditor_component = normalizeComponent(
239946
239946
  )
239947
239947
 
239948
239948
  /* harmony default export */ var InlineTextEditor = (InlineTextEditor_component.exports);
239949
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=template&id=5d01eb32&scoped=true
239950
- var PrintFilevue_type_template_id_5d01eb32_scoped_true_render = function render() {
239949
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=template&id=d4b340ae&scoped=true
239950
+ var PrintFilevue_type_template_id_d4b340ae_scoped_true_render = function render() {
239951
239951
  var _vm = this,
239952
239952
  _c = _vm._self._c;
239953
239953
  return _c('div', {
@@ -239987,7 +239987,7 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_render = function render(
239987
239987
  }
239988
239988
  })], 1);
239989
239989
  };
239990
- var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
239990
+ var PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns = [];
239991
239991
 
239992
239992
  ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=script&lang=js
239993
239993
 
@@ -240031,59 +240031,167 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240031
240031
  btnSaveAsDownloadClick: function btnSaveAsDownloadClick() {
240032
240032
  var _this = this;
240033
240033
  var $scope = this.$vnode.context;
240034
- // 返回base64图片地址
240035
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240036
- var formTables = printDiv.querySelectorAll('.print_formtb');
240037
- new Promise(function (resolve) {
240038
- if (formTables.length > 1) {
240039
- printDiv.querySelectorAll('.print_formtb').forEach(function (printtb, i) {
240040
- printtb.style.display = 'none';
240041
- });
240042
- printDiv.querySelectorAll('.print_formtb').forEach(function (printtb, j) {
240043
- if (j !== 0) {
240044
- printDiv.querySelector('.form-header').display = 'none';
240045
- }
240046
- printtb.style.display = '';
240047
- _this.$nextTick(function () {
240048
- _this.saveWebformBase64data($scope, printDiv, j + 1).then(function (rst) {
240049
- printtb.parentElement.removeChild(printtb);
240050
- });
240034
+ //A4纸210mm*297mm,按1英寸=25.41mm、96DPI(每英寸px数)、上下边距20mm计算,打印区域宽度为(210-20*2)/25.41*96=643px,打印区域高度为(297-20*2)/25.41*96=971px,
240035
+ //web表单print:宽度为950px,根据A4打印区域比例转换高度为950/643*971=1434px
240036
+ var pageHeight = 1434; //打印内容高度,根据高度计算分页
240037
+ var blankHeight = 0; //空白高度
240038
+
240039
+ //处理单分页处理
240040
+ var printDiv = ifrmPrint.contentDocument.querySelector('.form-container-print');
240041
+ printDiv.style.paddingTop = '0px';
240042
+ var rows = printDiv.querySelector('tbody').children;
240043
+ var headerHeight = printDiv.querySelector('.form-header').getBoundingClientRect().height; //表单标题栏高度
240044
+ var rowsHeight = 0;
240045
+ var pageSize = 0;
240046
+ var prevPositionY = 0;
240047
+ var _loop = function _loop() {
240048
+ var row = rows[r];
240049
+ rowsHeight = headerHeight + row.offsetTop;
240050
+ //超过一页,计算最后一页内容高度
240051
+ if (pageSize > 0) {
240052
+ rowsHeight -= pageHeight * pageSize;
240053
+ }
240054
+ if (rowsHeight + row.clientHeight > pageHeight) {
240055
+ if (row.querySelectorAll('TR').length > 0 || row.querySelectorAll('.ideaDiv').length > 0) {
240056
+ //内嵌子表
240057
+ var subRows = row.querySelectorAll('TR');
240058
+ if (subRows.length === 0) {
240059
+ //处理意见栏
240060
+ subRows = row.querySelectorAll('.ideaDiv');
240061
+ }
240062
+ subRows.forEach(function (subRow, subIndex) {
240063
+ var subRowsHeight = rowsHeight + subRow.offsetTop;
240064
+ var positionY = headerHeight + row.offsetTop + subRow.offsetTop;
240065
+ if (subRow.tagName === 'TR' && subIndex > 0) {
240066
+ //子表行数据,加上表头高度
240067
+ subRowsHeight += row.querySelector('.el-table__header-wrapper').clientHeight;
240068
+ positionY += row.querySelector('.el-table__header-wrapper').clientHeight;
240069
+ }
240070
+ //超过一页,计算最后一页内容高度
240071
+ if (pageSize > 0) {
240072
+ subRowsHeight -= pageHeight * pageSize;
240073
+ }
240074
+ if (subRowsHeight + subRow.clientHeight >= pageHeight) {
240075
+ pageSize++;
240076
+ subRow.classList.add('print_breakpage');
240077
+ subRow.setAttribute('pageHeight', positionY - prevPositionY);
240078
+ subRow.setAttribute('positionY', positionY);
240079
+ prevPositionY = positionY;
240080
+ }
240051
240081
  });
240052
- });
240053
- var timer = setInterval(function () {
240054
- if (printDiv.querySelectorAll('.print_formtb').length === 0) {
240055
- resolve(true);
240056
- clearInterval(timer);
240082
+ } else if (row.clientHeight > pageHeight && r + 1 < rows.length) {
240083
+ //单行高度超过页面高度,直接按页面高度截取
240084
+ pageSize++;
240085
+ row.classList.add('print_breakpage');
240086
+ row.setAttribute('pageHeight', pageHeight);
240087
+ row.setAttribute('positionY', prevPositionY + pageHeight);
240088
+ prevPositionY = prevPositionY + pageHeight;
240089
+ var remainderHeight = headerHeight + row.offsetTop + row.clientHeight - prevPositionY;
240090
+
240091
+ //剩余部分单独一页
240092
+ row = rows[r + 1];
240093
+ pageSize++;
240094
+ row.classList.add('print_breakpage');
240095
+ row.setAttribute('pageHeight', remainderHeight);
240096
+ row.setAttribute('positionY', headerHeight + row.offsetTop);
240097
+ prevPositionY = headerHeight + row.offsetTop;
240098
+
240099
+ //将剩余部分不足一页空白高度追加到标题栏高度
240100
+ if (pageHeight > remainderHeight) {
240101
+ blankHeight += pageHeight - remainderHeight;
240102
+ headerHeight += pageHeight - remainderHeight;
240057
240103
  }
240058
- }, 1000);
240104
+ } else {
240105
+ pageSize++;
240106
+ row.classList.add('print_breakpage');
240107
+ row.setAttribute('pageHeight', headerHeight + row.offsetTop - prevPositionY);
240108
+ row.setAttribute('positionY', headerHeight + row.offsetTop);
240109
+ prevPositionY = headerHeight + row.offsetTop;
240110
+ }
240111
+ }
240112
+ };
240113
+ for (var r = 0; r < rows.length; r++) {
240114
+ _loop();
240115
+ }
240116
+
240117
+ //附件分页处理
240118
+ var attachTitle = printDiv.querySelector('.sidebar-area-title');
240119
+ rowsHeight = attachTitle.offsetTop + blankHeight;
240120
+ //超过一页,计算最后一页内容高度
240121
+ if (pageSize > 0) {
240122
+ rowsHeight -= pageHeight * pageSize;
240123
+ }
240124
+ if (rowsHeight + attachTitle.getBoundingClientRect().height >= pageHeight) {
240125
+ pageSize++;
240126
+ attachTitle.classList.add('print_breakpage');
240127
+ attachTitle.setAttribute('pageHeight', rowsHeight);
240128
+ attachTitle.setAttribute('positionY', attachTitle.offsetTop);
240129
+ rowsHeight = attachTitle.clientHeight + blankHeight;
240130
+ } else {
240131
+ rowsHeight += attachTitle.clientHeight;
240132
+ }
240133
+ var attachs = printDiv.querySelectorAll('.attach-row');
240134
+ attachs.forEach(function (row, rindex) {
240135
+ if (rowsHeight + row.getBoundingClientRect().height >= pageHeight) {
240136
+ pageSize++;
240137
+ row.classList.add('print_breakpage');
240138
+ row.setAttribute('pageHeight', rowsHeight);
240139
+ row.setAttribute('positionY', row.offsetTop);
240140
+ rowsHeight = row.getBoundingClientRect().height + blankHeight;
240059
240141
  } else {
240060
- _this.saveWebformBase64data($scope, printDiv, 1).then(function (rst) {
240061
- resolve(true);
240062
- });
240142
+ rowsHeight += row.getBoundingClientRect().height;
240143
+ }
240144
+ });
240145
+ if (attachs.length === 0) {
240146
+ rowsHeight += printDiv.querySelector('.sidebar-area-content').getBoundingClientRect().height;
240147
+ }
240148
+ rowsHeight += 15; //sidebar-area-content下边距
240149
+ printDiv.innerHTML += '<span class="print_breakpage" pageHeight=' + rowsHeight + '></span>';
240150
+
240151
+ // 返回base64图片地址
240152
+ var printPages = printDiv.querySelectorAll('.print_breakpage');
240153
+ new Promise(function (resolve) {
240154
+ if (printPages.length === 0) {
240155
+ printPages = [printDiv];
240063
240156
  }
240157
+ //遍历formTables,一次只保存一个分页图片
240158
+ _this.saveWebformBase64data($scope, printPages, 0, 0, resolve);
240064
240159
  }).then(function (rst) {
240065
240160
  _this.$bus.emit('closeDoingDialog');
240066
240161
  if (rst) {
240067
- $scope.isShow = false;
240162
+ //$scope.isShow = false
240068
240163
  var url = "/apigw" + '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/download?module=' + $scope.wfInstance.module + '&busiDataId=' + $scope.wfInstance.busiDataId;
240069
- url += '&pageSize=' + formTables.length;
240164
+ url += '&pageSize=' + printPages.length;
240070
240165
  if ($scope.wfInstance.module !== 'fawen') url += '&doc=true';
240071
240166
  url += '&httpPort=' + location.port;
240072
240167
  window.open(url);
240073
240168
  }
240074
240169
  });
240075
240170
  },
240076
- saveWebformBase64data: function saveWebformBase64data($scope, printDiv, pageNum) {
240171
+ saveWebformBase64data: function saveWebformBase64data($scope, printPages, pageNum, positionY, resolve) {
240077
240172
  var _this2 = this;
240078
- return new Promise(function (resolve) {
240173
+ var printDiv = ifrmPrint.contentDocument.querySelector('.form-container-print');
240174
+ var page = printPages[pageNum++];
240175
+ var pageHeight = 1434;
240176
+ if (page.attributes['pageHeight']) {
240177
+ pageHeight = parseInt(page.attributes['pageHeight'].nodeValue);
240178
+ }
240179
+ if (pageHeight > 0) {
240180
+ this.$bus.emit('showDoingDialog', '共' + printPages.length + '页,正在处理第' + pageNum + '页┉');
240079
240181
  html2canvas_default()(printDiv, {
240080
- dpi: 300,
240081
- scale: 2 // 添加的scale 参数
240182
+ x: 0,
240183
+ y: positionY,
240184
+ width: 950,
240185
+ height: pageHeight,
240186
+ scale: 2,
240187
+ // 增加渲染分辨率
240188
+ dpi: 96,
240189
+ logging: false
240082
240190
  }).then(function (canvas) {
240083
240191
  var dataURL = canvas.toDataURL('image/png');
240084
240192
  _this2.$http({
240085
240193
  method: 'POST',
240086
- url: '/gwgl/webForm/saveWebformBase64data',
240194
+ url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240087
240195
  params: {
240088
240196
  busiDataId: $scope.wfInstance.busiDataId,
240089
240197
  pageNum: pageNum
@@ -240093,7 +240201,16 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240093
240201
  }
240094
240202
  }).then(function (res) {
240095
240203
  if (res.code === 'success') {
240096
- resolve(res);
240204
+ if (printPages.length === pageNum) {
240205
+ resolve(res);
240206
+ } else {
240207
+ if (page.attributes['positionY']) {
240208
+ positionY = parseInt(page.attributes['positionY'].nodeValue);
240209
+ } else {
240210
+ positionY += pageHeight;
240211
+ }
240212
+ _this2.saveWebformBase64data($scope, printPages, pageNum, positionY, resolve);
240213
+ }
240097
240214
  } else {
240098
240215
  _this2.$message({
240099
240216
  message: res.message,
@@ -240104,7 +240221,7 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240104
240221
  _this2.$message.error(err);
240105
240222
  });
240106
240223
  });
240107
- });
240224
+ }
240108
240225
  },
240109
240226
  btnToDuBan: function btnToDuBan($scope) {
240110
240227
  console.log(11, $scope);
@@ -240235,11 +240352,11 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240235
240352
  ;
240236
240353
  var PrintFile_component = normalizeComponent(
240237
240354
  components_PrintFilevue_type_script_lang_js,
240238
- PrintFilevue_type_template_id_5d01eb32_scoped_true_render,
240239
- PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns,
240355
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_render,
240356
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns,
240240
240357
  false,
240241
240358
  null,
240242
- "5d01eb32",
240359
+ "d4b340ae",
240243
240360
  null
240244
240361
 
240245
240362
  )
@@ -239956,8 +239956,8 @@ var InlineTextEditor_component = normalizeComponent(
239956
239956
  )
239957
239957
 
239958
239958
  /* harmony default export */ var InlineTextEditor = (InlineTextEditor_component.exports);
239959
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=template&id=5d01eb32&scoped=true
239960
- var PrintFilevue_type_template_id_5d01eb32_scoped_true_render = function render() {
239959
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=template&id=d4b340ae&scoped=true
239960
+ var PrintFilevue_type_template_id_d4b340ae_scoped_true_render = function render() {
239961
239961
  var _vm = this,
239962
239962
  _c = _vm._self._c;
239963
239963
  return _c('div', {
@@ -239997,7 +239997,7 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_render = function render(
239997
239997
  }
239998
239998
  })], 1);
239999
239999
  };
240000
- var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240000
+ var PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns = [];
240001
240001
 
240002
240002
  ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecyoa/yoabase/src/workflow/wfInstance/mainform/components/PrintFile.vue?vue&type=script&lang=js
240003
240003
 
@@ -240041,59 +240041,167 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240041
240041
  btnSaveAsDownloadClick: function btnSaveAsDownloadClick() {
240042
240042
  var _this = this;
240043
240043
  var $scope = this.$vnode.context;
240044
- // 返回base64图片地址
240045
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240046
- var formTables = printDiv.querySelectorAll('.print_formtb');
240047
- new Promise(function (resolve) {
240048
- if (formTables.length > 1) {
240049
- printDiv.querySelectorAll('.print_formtb').forEach(function (printtb, i) {
240050
- printtb.style.display = 'none';
240051
- });
240052
- printDiv.querySelectorAll('.print_formtb').forEach(function (printtb, j) {
240053
- if (j !== 0) {
240054
- printDiv.querySelector('.form-header').display = 'none';
240055
- }
240056
- printtb.style.display = '';
240057
- _this.$nextTick(function () {
240058
- _this.saveWebformBase64data($scope, printDiv, j + 1).then(function (rst) {
240059
- printtb.parentElement.removeChild(printtb);
240060
- });
240044
+ //A4纸210mm*297mm,按1英寸=25.41mm、96DPI(每英寸px数)、上下边距20mm计算,打印区域宽度为(210-20*2)/25.41*96=643px,打印区域高度为(297-20*2)/25.41*96=971px,
240045
+ //web表单print:宽度为950px,根据A4打印区域比例转换高度为950/643*971=1434px
240046
+ var pageHeight = 1434; //打印内容高度,根据高度计算分页
240047
+ var blankHeight = 0; //空白高度
240048
+
240049
+ //处理单分页处理
240050
+ var printDiv = ifrmPrint.contentDocument.querySelector('.form-container-print');
240051
+ printDiv.style.paddingTop = '0px';
240052
+ var rows = printDiv.querySelector('tbody').children;
240053
+ var headerHeight = printDiv.querySelector('.form-header').getBoundingClientRect().height; //表单标题栏高度
240054
+ var rowsHeight = 0;
240055
+ var pageSize = 0;
240056
+ var prevPositionY = 0;
240057
+ var _loop = function _loop() {
240058
+ var row = rows[r];
240059
+ rowsHeight = headerHeight + row.offsetTop;
240060
+ //超过一页,计算最后一页内容高度
240061
+ if (pageSize > 0) {
240062
+ rowsHeight -= pageHeight * pageSize;
240063
+ }
240064
+ if (rowsHeight + row.clientHeight > pageHeight) {
240065
+ if (row.querySelectorAll('TR').length > 0 || row.querySelectorAll('.ideaDiv').length > 0) {
240066
+ //内嵌子表
240067
+ var subRows = row.querySelectorAll('TR');
240068
+ if (subRows.length === 0) {
240069
+ //处理意见栏
240070
+ subRows = row.querySelectorAll('.ideaDiv');
240071
+ }
240072
+ subRows.forEach(function (subRow, subIndex) {
240073
+ var subRowsHeight = rowsHeight + subRow.offsetTop;
240074
+ var positionY = headerHeight + row.offsetTop + subRow.offsetTop;
240075
+ if (subRow.tagName === 'TR' && subIndex > 0) {
240076
+ //子表行数据,加上表头高度
240077
+ subRowsHeight += row.querySelector('.el-table__header-wrapper').clientHeight;
240078
+ positionY += row.querySelector('.el-table__header-wrapper').clientHeight;
240079
+ }
240080
+ //超过一页,计算最后一页内容高度
240081
+ if (pageSize > 0) {
240082
+ subRowsHeight -= pageHeight * pageSize;
240083
+ }
240084
+ if (subRowsHeight + subRow.clientHeight >= pageHeight) {
240085
+ pageSize++;
240086
+ subRow.classList.add('print_breakpage');
240087
+ subRow.setAttribute('pageHeight', positionY - prevPositionY);
240088
+ subRow.setAttribute('positionY', positionY);
240089
+ prevPositionY = positionY;
240090
+ }
240061
240091
  });
240062
- });
240063
- var timer = setInterval(function () {
240064
- if (printDiv.querySelectorAll('.print_formtb').length === 0) {
240065
- resolve(true);
240066
- clearInterval(timer);
240092
+ } else if (row.clientHeight > pageHeight && r + 1 < rows.length) {
240093
+ //单行高度超过页面高度,直接按页面高度截取
240094
+ pageSize++;
240095
+ row.classList.add('print_breakpage');
240096
+ row.setAttribute('pageHeight', pageHeight);
240097
+ row.setAttribute('positionY', prevPositionY + pageHeight);
240098
+ prevPositionY = prevPositionY + pageHeight;
240099
+ var remainderHeight = headerHeight + row.offsetTop + row.clientHeight - prevPositionY;
240100
+
240101
+ //剩余部分单独一页
240102
+ row = rows[r + 1];
240103
+ pageSize++;
240104
+ row.classList.add('print_breakpage');
240105
+ row.setAttribute('pageHeight', remainderHeight);
240106
+ row.setAttribute('positionY', headerHeight + row.offsetTop);
240107
+ prevPositionY = headerHeight + row.offsetTop;
240108
+
240109
+ //将剩余部分不足一页空白高度追加到标题栏高度
240110
+ if (pageHeight > remainderHeight) {
240111
+ blankHeight += pageHeight - remainderHeight;
240112
+ headerHeight += pageHeight - remainderHeight;
240067
240113
  }
240068
- }, 1000);
240114
+ } else {
240115
+ pageSize++;
240116
+ row.classList.add('print_breakpage');
240117
+ row.setAttribute('pageHeight', headerHeight + row.offsetTop - prevPositionY);
240118
+ row.setAttribute('positionY', headerHeight + row.offsetTop);
240119
+ prevPositionY = headerHeight + row.offsetTop;
240120
+ }
240121
+ }
240122
+ };
240123
+ for (var r = 0; r < rows.length; r++) {
240124
+ _loop();
240125
+ }
240126
+
240127
+ //附件分页处理
240128
+ var attachTitle = printDiv.querySelector('.sidebar-area-title');
240129
+ rowsHeight = attachTitle.offsetTop + blankHeight;
240130
+ //超过一页,计算最后一页内容高度
240131
+ if (pageSize > 0) {
240132
+ rowsHeight -= pageHeight * pageSize;
240133
+ }
240134
+ if (rowsHeight + attachTitle.getBoundingClientRect().height >= pageHeight) {
240135
+ pageSize++;
240136
+ attachTitle.classList.add('print_breakpage');
240137
+ attachTitle.setAttribute('pageHeight', rowsHeight);
240138
+ attachTitle.setAttribute('positionY', attachTitle.offsetTop);
240139
+ rowsHeight = attachTitle.clientHeight + blankHeight;
240140
+ } else {
240141
+ rowsHeight += attachTitle.clientHeight;
240142
+ }
240143
+ var attachs = printDiv.querySelectorAll('.attach-row');
240144
+ attachs.forEach(function (row, rindex) {
240145
+ if (rowsHeight + row.getBoundingClientRect().height >= pageHeight) {
240146
+ pageSize++;
240147
+ row.classList.add('print_breakpage');
240148
+ row.setAttribute('pageHeight', rowsHeight);
240149
+ row.setAttribute('positionY', row.offsetTop);
240150
+ rowsHeight = row.getBoundingClientRect().height + blankHeight;
240069
240151
  } else {
240070
- _this.saveWebformBase64data($scope, printDiv, 1).then(function (rst) {
240071
- resolve(true);
240072
- });
240152
+ rowsHeight += row.getBoundingClientRect().height;
240153
+ }
240154
+ });
240155
+ if (attachs.length === 0) {
240156
+ rowsHeight += printDiv.querySelector('.sidebar-area-content').getBoundingClientRect().height;
240157
+ }
240158
+ rowsHeight += 15; //sidebar-area-content下边距
240159
+ printDiv.innerHTML += '<span class="print_breakpage" pageHeight=' + rowsHeight + '></span>';
240160
+
240161
+ // 返回base64图片地址
240162
+ var printPages = printDiv.querySelectorAll('.print_breakpage');
240163
+ new Promise(function (resolve) {
240164
+ if (printPages.length === 0) {
240165
+ printPages = [printDiv];
240073
240166
  }
240167
+ //遍历formTables,一次只保存一个分页图片
240168
+ _this.saveWebformBase64data($scope, printPages, 0, 0, resolve);
240074
240169
  }).then(function (rst) {
240075
240170
  _this.$bus.emit('closeDoingDialog');
240076
240171
  if (rst) {
240077
- $scope.isShow = false;
240172
+ //$scope.isShow = false
240078
240173
  var url = "/apigw" + '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/download?module=' + $scope.wfInstance.module + '&busiDataId=' + $scope.wfInstance.busiDataId;
240079
- url += '&pageSize=' + formTables.length;
240174
+ url += '&pageSize=' + printPages.length;
240080
240175
  if ($scope.wfInstance.module !== 'fawen') url += '&doc=true';
240081
240176
  url += '&httpPort=' + location.port;
240082
240177
  window.open(url);
240083
240178
  }
240084
240179
  });
240085
240180
  },
240086
- saveWebformBase64data: function saveWebformBase64data($scope, printDiv, pageNum) {
240181
+ saveWebformBase64data: function saveWebformBase64data($scope, printPages, pageNum, positionY, resolve) {
240087
240182
  var _this2 = this;
240088
- return new Promise(function (resolve) {
240183
+ var printDiv = ifrmPrint.contentDocument.querySelector('.form-container-print');
240184
+ var page = printPages[pageNum++];
240185
+ var pageHeight = 1434;
240186
+ if (page.attributes['pageHeight']) {
240187
+ pageHeight = parseInt(page.attributes['pageHeight'].nodeValue);
240188
+ }
240189
+ if (pageHeight > 0) {
240190
+ this.$bus.emit('showDoingDialog', '共' + printPages.length + '页,正在处理第' + pageNum + '页┉');
240089
240191
  html2canvas_default()(printDiv, {
240090
- dpi: 300,
240091
- scale: 2 // 添加的scale 参数
240192
+ x: 0,
240193
+ y: positionY,
240194
+ width: 950,
240195
+ height: pageHeight,
240196
+ scale: 2,
240197
+ // 增加渲染分辨率
240198
+ dpi: 96,
240199
+ logging: false
240092
240200
  }).then(function (canvas) {
240093
240201
  var dataURL = canvas.toDataURL('image/png');
240094
240202
  _this2.$http({
240095
240203
  method: 'POST',
240096
- url: '/gwgl/webForm/saveWebformBase64data',
240204
+ url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240097
240205
  params: {
240098
240206
  busiDataId: $scope.wfInstance.busiDataId,
240099
240207
  pageNum: pageNum
@@ -240103,7 +240211,16 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240103
240211
  }
240104
240212
  }).then(function (res) {
240105
240213
  if (res.code === 'success') {
240106
- resolve(res);
240214
+ if (printPages.length === pageNum) {
240215
+ resolve(res);
240216
+ } else {
240217
+ if (page.attributes['positionY']) {
240218
+ positionY = parseInt(page.attributes['positionY'].nodeValue);
240219
+ } else {
240220
+ positionY += pageHeight;
240221
+ }
240222
+ _this2.saveWebformBase64data($scope, printPages, pageNum, positionY, resolve);
240223
+ }
240107
240224
  } else {
240108
240225
  _this2.$message({
240109
240226
  message: res.message,
@@ -240114,7 +240231,7 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240114
240231
  _this2.$message.error(err);
240115
240232
  });
240116
240233
  });
240117
- });
240234
+ }
240118
240235
  },
240119
240236
  btnToDuBan: function btnToDuBan($scope) {
240120
240237
  console.log(11, $scope);
@@ -240245,11 +240362,11 @@ var PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns = [];
240245
240362
  ;
240246
240363
  var PrintFile_component = normalizeComponent(
240247
240364
  components_PrintFilevue_type_script_lang_js,
240248
- PrintFilevue_type_template_id_5d01eb32_scoped_true_render,
240249
- PrintFilevue_type_template_id_5d01eb32_scoped_true_staticRenderFns,
240365
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_render,
240366
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns,
240250
240367
  false,
240251
240368
  null,
240252
- "5d01eb32",
240369
+ "d4b340ae",
240253
240370
  null
240254
240371
 
240255
240372
  )