gm-printer 10.14.4 → 10.14.5

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.4",
3
+ "version": "10.14.5",
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':
package/.eslintcache DELETED
@@ -1 +0,0 @@
1
- [{"/Users/min/Documents/GMFE/gm-util/gm-printer/src/util.js":"1","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/get_css.js":"2","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/barcode.js":"3","/Users/min/Documents/GMFE/gm-util/gm-printer/src/index.js":"4","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/context_menu.js":"5","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/context_menu.js":"6","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/context_menu.js":"7","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/context_menu.js":"8","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/context_menu.js":"9","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor_special_table.js":"10","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/context_menu.js":"11","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/context_menu.js":"12","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/context_menu.js":"13","/Users/min/Documents/GMFE/gm-util/gm-printer/src/config.js":"14","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_store.js":"15","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_shadow_dom.js":"16","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/get_editor_css.js":"17","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_title.js":"18","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_store.js":"19","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_select.js":"20","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_edit_field.js":"21","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/component.js":"22","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/editor.js":"23","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/editor.js":"24","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/editor.js":"25","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/editor.js":"26","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/editor.js":"27","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor.js":"28","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account_statement/editor.js":"29","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/editor.js":"30","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/editor.js":"31","/Users/min/Documents/GMFE/gm-util/gm-printer/src/components/tooltip/index.js":"32","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_special_field.js":"33","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/store.js":"34","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/index.js":"35","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/do_print.js":"36","/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/finance_printer.js":"37","/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/table_subtotal_tr.js":"38","/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/table.js":"39","/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/finance_batch_printer.js":"40","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/page.js":"41","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table_subtotal_tr.js":"42","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table.js":"43","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/printer.js":"44","/Users/min/Documents/GMFE/gm-util/gm-printer/src/components/flex/index.js":"45","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table_overallOrder_tr.js":"46"},{"size":7813,"mtime":1648799098282,"results":"47","hashOfConfig":"48"},{"size":291,"mtime":1638935573926,"results":"49","hashOfConfig":"50"},{"size":523,"mtime":1638935549030,"results":"51","hashOfConfig":"50"},{"size":1139,"mtime":1644572548725,"results":"52","hashOfConfig":"53"},{"size":2293,"mtime":1638948548042,"results":"54","hashOfConfig":"50"},{"size":2292,"mtime":1638948522492,"results":"55","hashOfConfig":"50"},{"size":1078,"mtime":1638948543271,"results":"56","hashOfConfig":"50"},{"size":2067,"mtime":1648466228565,"results":"57","hashOfConfig":"48"},{"size":2991,"mtime":1638948535719,"results":"58","hashOfConfig":"50"},{"size":4379,"mtime":1638935458586,"results":"59","hashOfConfig":"50"},{"size":2428,"mtime":1648466380496,"results":"60","hashOfConfig":"48"},{"size":2955,"mtime":1647850650993,"results":"61","hashOfConfig":"53"},{"size":4170,"mtime":1648640206253,"results":"62","hashOfConfig":"48"},{"size":2833,"mtime":1638861837310,"results":"63","hashOfConfig":"50"},{"size":4212,"mtime":1638935746667,"results":"64","hashOfConfig":"50"},{"size":861,"mtime":1638931446915,"results":"65","hashOfConfig":"50"},{"size":178,"mtime":1638931439249,"results":"66","hashOfConfig":"50"},{"size":3272,"mtime":1648713847909,"results":"67","hashOfConfig":"48"},{"size":35624,"mtime":1650085861287,"results":"68","hashOfConfig":"48"},{"size":4898,"mtime":1639992402586,"results":"69","hashOfConfig":"50"},{"size":17167,"mtime":1650082865251,"results":"70","hashOfConfig":"48"},{"size":14787,"mtime":1638948621474,"results":"71","hashOfConfig":"50"},{"size":2165,"mtime":1638949854481,"results":"72","hashOfConfig":"50"},{"size":2165,"mtime":1638949840121,"results":"73","hashOfConfig":"50"},{"size":2223,"mtime":1638949823846,"results":"74","hashOfConfig":"50"},{"size":2356,"mtime":1650083974574,"results":"75","hashOfConfig":"48"},{"size":3367,"mtime":1638949855771,"results":"76","hashOfConfig":"50"},{"size":2305,"mtime":1638949843817,"results":"77","hashOfConfig":"50"},{"size":3294,"mtime":1638949855131,"results":"78","hashOfConfig":"50"},{"size":2850,"mtime":1638949842017,"results":"79","hashOfConfig":"50"},{"size":4157,"mtime":1638949853726,"results":"80","hashOfConfig":"50"},{"size":605,"mtime":1638949882777,"results":"81","hashOfConfig":"50"},{"size":1175,"mtime":1638949720500,"results":"82","hashOfConfig":"50"},{"size":15067,"mtime":1648801216882,"results":"83","hashOfConfig":"48"},{"size":332,"mtime":1644573509040,"results":"84","hashOfConfig":"53"},{"size":4080,"mtime":1648536160221,"results":"85","hashOfConfig":"48"},{"size":8842,"mtime":1646363892377,"results":"86","hashOfConfig":"53"},{"size":4317,"mtime":1646376602197,"results":"87","hashOfConfig":"53"},{"size":9440,"mtime":1644993553716,"results":"88","hashOfConfig":"53"},{"size":724,"mtime":1644808940649,"results":"89","hashOfConfig":"53"},{"size":1717,"mtime":1648466368772,"results":"90","hashOfConfig":"48"},{"size":5049,"mtime":1650085552191,"results":"91","hashOfConfig":"48"},{"size":9717,"mtime":1648628215217,"results":"92","hashOfConfig":"48"},{"size":9001,"mtime":1648713828033,"results":"93","hashOfConfig":"48"},{"size":3152,"mtime":1648713745966},{"size":1901,"mtime":1650082399244,"results":"94","hashOfConfig":"48"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1h9xfdh",{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"jpc0be",{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1qaimc",{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"121","messages":"122","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","errorCount":2,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"125","messages":"126","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"127","messages":"128","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"129","messages":"130","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"133","messages":"134","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","errorCount":1,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"137","messages":"138","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"143","messages":"144","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"145","messages":"146","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"147","messages":"148","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"151","messages":"152","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"153","messages":"154","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"157","messages":"158","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"163","messages":"164","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"165","messages":"166","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"169","messages":"170","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"171","messages":"172","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"175","messages":"176","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"177","messages":"178","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"179","messages":"180","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"181","messages":"182","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"183","messages":"184","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/min/Documents/GMFE/gm-util/gm-printer/src/util.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/get_css.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/barcode.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/index.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor_special_table.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/config.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_store.js",["185","186"],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/get_editor_css.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_title.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_store.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_select.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_edit_field.js",["187","188","189","190","191"],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/component.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account_statement/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/editor.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/components/tooltip/index.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_special_field.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/store.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/index.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/do_print.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/finance_printer.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/table_subtotal_tr.js",["192"],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/table.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/finance_voucher/components/finance_batch_printer.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/page.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table_subtotal_tr.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/printer.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/table_overallOrder_tr.js",[],{"ruleId":"193","severity":2,"message":"194","line":10,"column":29,"nodeType":"195","endLine":10,"endColumn":35},{"ruleId":"193","severity":2,"message":"196","line":145,"column":63,"nodeType":"195","endLine":145,"endColumn":71},{"ruleId":"197","severity":1,"message":"198","line":305,"column":13,"nodeType":"199","endLine":305,"endColumn":49},{"ruleId":"197","severity":1,"message":"198","line":323,"column":13,"nodeType":"199","endLine":323,"endColumn":56},{"ruleId":"197","severity":1,"message":"198","line":446,"column":15,"nodeType":"199","endLine":446,"endColumn":53},{"ruleId":"197","severity":1,"message":"198","line":495,"column":11,"nodeType":"199","endLine":495,"endColumn":53},{"ruleId":"200","severity":2,"message":"201","line":544,"column":22,"nodeType":"202","messageId":"203","endLine":544,"endColumn":31},{"ruleId":"200","severity":2,"message":"201","line":120,"column":14,"nodeType":"202","messageId":"203","endLine":120,"endColumn":23},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","react/jsx-handler-names","Handler function for onChange prop key must begin with 'handle'","JSXAttribute","gmfe/i18n-check","t函数的key只能为字符串常量(Literal),请使用单引号或双引号包裹","MemberExpression","isVariable"]