gm-printer 10.14.3 → 10.14.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.14.3",
3
+ "version": "10.14.4-alpha.0",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -156,14 +156,19 @@ class EditorStore {
156
156
 
157
157
  set(this.config, {
158
158
  autoFillConfig: {
159
- region: this.selectedRegion,
159
+ region: this.selectedRegion || autoFillConfig?.region,
160
160
  dataKey,
161
161
  checked: isAutoFilling
162
162
  }
163
163
  })
164
- if (isAutoFilling) {
164
+
165
+ const hasHadEmptyData = _.some(table, data => data?._isEmptyData)
166
+
167
+ // 开关打开,且之前数组不包含空数据,再进行填充
168
+ if (isAutoFilling && !hasHadEmptyData) {
165
169
  table.push(...this.getFilledTableData(table))
166
- } else {
170
+ }
171
+ if (!isAutoFilling) {
167
172
  this.clearExtraTableData(dataKey)
168
173
  return
169
174
  }
@@ -861,14 +866,17 @@ class EditorStore {
861
866
  // 获得表格自定义行高
862
867
  @computed
863
868
  get computedTableCustomerRowHeight() {
864
- if (this.selectedRegion) {
865
- const arr = this.selectedRegion.split('.')
869
+ const _defaultRegion = this.config?.autoFillConfig?.region
870
+ let resHeight = 23
871
+ if (this.selectedRegion || _defaultRegion) {
872
+ const _selectedRegion = this.selectedRegion || _defaultRegion
873
+ const arr = _selectedRegion.split('.')
866
874
  if (arr.includes('table')) {
867
875
  const height = this.config.contents[arr[2]].customerRowHeight
868
- return height === undefined ? 23 : height
876
+ resHeight = height === undefined ? 23 : height
869
877
  }
870
878
  }
871
- return 23
879
+ return resHeight
872
880
  }
873
881
 
874
882
  @action.bound
@@ -183,7 +183,11 @@ class Printer extends React.Component {
183
183
  content?.dataKey === autoFillConfig?.dataKey
184
184
 
185
185
  const end = isAutofillConfig
186
- ? panel.end + Math.floor(remainPageHeight / TR_BASE_HEIGHT)
186
+ ? panel.end +
187
+ Math.floor(
188
+ remainPageHeight /
189
+ printerStore.computedTableCustomerRowHeight
190
+ )
187
191
  : panel.end
188
192
  switch (panel.type) {
189
193
  case 'table':