ecinc-cloud-yoabase 9.6.276 → 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=30ef3fd2&scoped=true
239950
- var PrintFilevue_type_template_id_30ef3fd2_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_30ef3fd2_scoped_true_render = function render(
239987
239987
  }
239988
239988
  })], 1);
239989
239989
  };
239990
- var PrintFilevue_type_template_id_30ef3fd2_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,73 +240031,197 @@ var PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns = [];
240031
240031
  btnSaveAsDownloadClick: function btnSaveAsDownloadClick() {
240032
240032
  var _this = this;
240033
240033
  var $scope = this.$vnode.context;
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
+ }
240081
+ });
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;
240103
+ }
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;
240141
+ } else {
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
+
240034
240151
  // 返回base64图片地址
240035
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240036
- var formTables = printDiv.querySelectorAll('.print_formtb');
240152
+ var printPages = printDiv.querySelectorAll('.print_breakpage');
240037
240153
  new Promise(function (resolve) {
240038
- formTables.forEach(function (printtb, i) {
240039
- printtb.style.display = 'none';
240040
- });
240041
- printDiv.querySelectorAll('.page-splice').forEach(function (ps) {
240042
- ps.style.display = 'none';
240043
- });
240044
-
240154
+ if (printPages.length === 0) {
240155
+ printPages = [printDiv];
240156
+ }
240045
240157
  //遍历formTables,一次只保存一个分页图片
240046
- _this.saveWebformBase64data($scope, formTables, 0, resolve);
240158
+ _this.saveWebformBase64data($scope, printPages, 0, 0, resolve);
240047
240159
  }).then(function (rst) {
240048
240160
  _this.$bus.emit('closeDoingDialog');
240049
240161
  if (rst) {
240050
- $scope.isShow = false;
240162
+ //$scope.isShow = false
240051
240163
  var url = "/apigw" + '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/download?module=' + $scope.wfInstance.module + '&busiDataId=' + $scope.wfInstance.busiDataId;
240052
- url += '&pageSize=' + formTables.length;
240164
+ url += '&pageSize=' + printPages.length;
240053
240165
  if ($scope.wfInstance.module !== 'fawen') url += '&doc=true';
240054
240166
  url += '&httpPort=' + location.port;
240055
240167
  window.open(url);
240056
240168
  }
240057
240169
  });
240058
240170
  },
240059
- saveWebformBase64data: function saveWebformBase64data($scope, formTables, pageNum, resolve) {
240171
+ saveWebformBase64data: function saveWebformBase64data($scope, printPages, pageNum, positionY, resolve) {
240060
240172
  var _this2 = this;
240061
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240062
- var printtb = formTables[pageNum++];
240063
- //只有第一页显示标题
240064
- if (pageNum !== 1) {
240065
- printDiv.querySelector('.form-header').style.display = 'none';
240066
- }
240067
- printtb.style.display = '';
240068
- html2canvas_default()(printDiv, {
240069
- dpi: 150,
240070
- scale: 1 // 添加的scale 参数
240071
- }).then(function (canvas) {
240072
- var dataURL = canvas.toDataURL('image/png');
240073
- printtb.style.display = 'none';
240074
- _this2.$http({
240075
- method: 'POST',
240076
- url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240077
- params: {
240078
- busiDataId: $scope.wfInstance.busiDataId,
240079
- pageNum: pageNum
240080
- },
240081
- data: {
240082
- formBase64data: dataURL
240083
- }
240084
- }).then(function (res) {
240085
- if (res.code === 'success') {
240086
- if (formTables.length === pageNum) {
240087
- resolve(res);
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 + '页┉');
240181
+ html2canvas_default()(printDiv, {
240182
+ x: 0,
240183
+ y: positionY,
240184
+ width: 950,
240185
+ height: pageHeight,
240186
+ scale: 2,
240187
+ // 增加渲染分辨率
240188
+ dpi: 96,
240189
+ logging: false
240190
+ }).then(function (canvas) {
240191
+ var dataURL = canvas.toDataURL('image/png');
240192
+ _this2.$http({
240193
+ method: 'POST',
240194
+ url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240195
+ params: {
240196
+ busiDataId: $scope.wfInstance.busiDataId,
240197
+ pageNum: pageNum
240198
+ },
240199
+ data: {
240200
+ formBase64data: dataURL
240201
+ }
240202
+ }).then(function (res) {
240203
+ if (res.code === 'success') {
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
+ }
240088
240214
  } else {
240089
- _this2.saveWebformBase64data($scope, formTables, pageNum, resolve);
240215
+ _this2.$message({
240216
+ message: res.message,
240217
+ type: 'warning'
240218
+ });
240090
240219
  }
240091
- } else {
240092
- _this2.$message({
240093
- message: res.message,
240094
- type: 'warning'
240095
- });
240096
- }
240097
- }, function (err) {
240098
- _this2.$message.error(err);
240220
+ }, function (err) {
240221
+ _this2.$message.error(err);
240222
+ });
240099
240223
  });
240100
- });
240224
+ }
240101
240225
  },
240102
240226
  btnToDuBan: function btnToDuBan($scope) {
240103
240227
  console.log(11, $scope);
@@ -240228,11 +240352,11 @@ var PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns = [];
240228
240352
  ;
240229
240353
  var PrintFile_component = normalizeComponent(
240230
240354
  components_PrintFilevue_type_script_lang_js,
240231
- PrintFilevue_type_template_id_30ef3fd2_scoped_true_render,
240232
- PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns,
240355
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_render,
240356
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns,
240233
240357
  false,
240234
240358
  null,
240235
- "30ef3fd2",
240359
+ "d4b340ae",
240236
240360
  null
240237
240361
 
240238
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=30ef3fd2&scoped=true
239960
- var PrintFilevue_type_template_id_30ef3fd2_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_30ef3fd2_scoped_true_render = function render(
239997
239997
  }
239998
239998
  })], 1);
239999
239999
  };
240000
- var PrintFilevue_type_template_id_30ef3fd2_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,73 +240041,197 @@ var PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns = [];
240041
240041
  btnSaveAsDownloadClick: function btnSaveAsDownloadClick() {
240042
240042
  var _this = this;
240043
240043
  var $scope = this.$vnode.context;
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
+ }
240091
+ });
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;
240113
+ }
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;
240151
+ } else {
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
+
240044
240161
  // 返回base64图片地址
240045
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240046
- var formTables = printDiv.querySelectorAll('.print_formtb');
240162
+ var printPages = printDiv.querySelectorAll('.print_breakpage');
240047
240163
  new Promise(function (resolve) {
240048
- formTables.forEach(function (printtb, i) {
240049
- printtb.style.display = 'none';
240050
- });
240051
- printDiv.querySelectorAll('.page-splice').forEach(function (ps) {
240052
- ps.style.display = 'none';
240053
- });
240054
-
240164
+ if (printPages.length === 0) {
240165
+ printPages = [printDiv];
240166
+ }
240055
240167
  //遍历formTables,一次只保存一个分页图片
240056
- _this.saveWebformBase64data($scope, formTables, 0, resolve);
240168
+ _this.saveWebformBase64data($scope, printPages, 0, 0, resolve);
240057
240169
  }).then(function (rst) {
240058
240170
  _this.$bus.emit('closeDoingDialog');
240059
240171
  if (rst) {
240060
- $scope.isShow = false;
240172
+ //$scope.isShow = false
240061
240173
  var url = "/apigw" + '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/download?module=' + $scope.wfInstance.module + '&busiDataId=' + $scope.wfInstance.busiDataId;
240062
- url += '&pageSize=' + formTables.length;
240174
+ url += '&pageSize=' + printPages.length;
240063
240175
  if ($scope.wfInstance.module !== 'fawen') url += '&doc=true';
240064
240176
  url += '&httpPort=' + location.port;
240065
240177
  window.open(url);
240066
240178
  }
240067
240179
  });
240068
240180
  },
240069
- saveWebformBase64data: function saveWebformBase64data($scope, formTables, pageNum, resolve) {
240181
+ saveWebformBase64data: function saveWebformBase64data($scope, printPages, pageNum, positionY, resolve) {
240070
240182
  var _this2 = this;
240071
- var printDiv = ifrmPrint.contentDocument.querySelector('#print');
240072
- var printtb = formTables[pageNum++];
240073
- //只有第一页显示标题
240074
- if (pageNum !== 1) {
240075
- printDiv.querySelector('.form-header').style.display = 'none';
240076
- }
240077
- printtb.style.display = '';
240078
- html2canvas_default()(printDiv, {
240079
- dpi: 150,
240080
- scale: 1 // 添加的scale 参数
240081
- }).then(function (canvas) {
240082
- var dataURL = canvas.toDataURL('image/png');
240083
- printtb.style.display = 'none';
240084
- _this2.$http({
240085
- method: 'POST',
240086
- url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240087
- params: {
240088
- busiDataId: $scope.wfInstance.busiDataId,
240089
- pageNum: pageNum
240090
- },
240091
- data: {
240092
- formBase64data: dataURL
240093
- }
240094
- }).then(function (res) {
240095
- if (res.code === 'success') {
240096
- if (formTables.length === pageNum) {
240097
- resolve(res);
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 + '页┉');
240191
+ html2canvas_default()(printDiv, {
240192
+ x: 0,
240193
+ y: positionY,
240194
+ width: 950,
240195
+ height: pageHeight,
240196
+ scale: 2,
240197
+ // 增加渲染分辨率
240198
+ dpi: 96,
240199
+ logging: false
240200
+ }).then(function (canvas) {
240201
+ var dataURL = canvas.toDataURL('image/png');
240202
+ _this2.$http({
240203
+ method: 'POST',
240204
+ url: '/' + $scope.wfEngineUrl.split('/')[0] + '/webForm/saveWebformBase64data',
240205
+ params: {
240206
+ busiDataId: $scope.wfInstance.busiDataId,
240207
+ pageNum: pageNum
240208
+ },
240209
+ data: {
240210
+ formBase64data: dataURL
240211
+ }
240212
+ }).then(function (res) {
240213
+ if (res.code === 'success') {
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
+ }
240098
240224
  } else {
240099
- _this2.saveWebformBase64data($scope, formTables, pageNum, resolve);
240225
+ _this2.$message({
240226
+ message: res.message,
240227
+ type: 'warning'
240228
+ });
240100
240229
  }
240101
- } else {
240102
- _this2.$message({
240103
- message: res.message,
240104
- type: 'warning'
240105
- });
240106
- }
240107
- }, function (err) {
240108
- _this2.$message.error(err);
240230
+ }, function (err) {
240231
+ _this2.$message.error(err);
240232
+ });
240109
240233
  });
240110
- });
240234
+ }
240111
240235
  },
240112
240236
  btnToDuBan: function btnToDuBan($scope) {
240113
240237
  console.log(11, $scope);
@@ -240238,11 +240362,11 @@ var PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns = [];
240238
240362
  ;
240239
240363
  var PrintFile_component = normalizeComponent(
240240
240364
  components_PrintFilevue_type_script_lang_js,
240241
- PrintFilevue_type_template_id_30ef3fd2_scoped_true_render,
240242
- PrintFilevue_type_template_id_30ef3fd2_scoped_true_staticRenderFns,
240365
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_render,
240366
+ PrintFilevue_type_template_id_d4b340ae_scoped_true_staticRenderFns,
240243
240367
  false,
240244
240368
  null,
240245
- "30ef3fd2",
240369
+ "d4b340ae",
240246
240370
  null
240247
240371
 
240248
240372
  )