gm-printer 10.14.1 → 10.14.2-alpha.2

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/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js":"1","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js":"2","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js":"3","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js":"4","/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js":"5","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js":"6","/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js":"7","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js":"8","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js":"9","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js":"10","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js":"11","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js":"12","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js":"13","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js":"14","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js":"15","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js":"16","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js":"17","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js":"18","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js":"19","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js":"20","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js":"21","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js":"22","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js":"23"},{"size":9379,"mtime":1643448762149,"results":"24","hashOfConfig":"25"},{"size":15785,"mtime":1647332608072,"results":"26","hashOfConfig":"25"},{"size":4244,"mtime":1635494969691,"results":"27","hashOfConfig":"25"},{"size":4501,"mtime":1646970942704,"results":"28","hashOfConfig":"25"},{"size":616,"mtime":1621235314060,"results":"29","hashOfConfig":"30"},{"size":9693,"mtime":1621242097206,"results":"31","hashOfConfig":"30"},{"size":7258,"mtime":1639037857730,"results":"32","hashOfConfig":"25"},{"size":10283,"mtime":1646979851812,"results":"33","hashOfConfig":"25"},{"size":3119,"mtime":1634191808754,"results":"34","hashOfConfig":"25"},{"size":1113,"mtime":1635407660514,"results":"35","hashOfConfig":"25"},{"size":4349,"mtime":1646815933499,"results":"36","hashOfConfig":"25"},{"size":861,"mtime":1635246075403,"results":"37","hashOfConfig":"25"},{"size":3260,"mtime":1635334661529,"results":"38","hashOfConfig":"25"},{"size":26478,"mtime":1647331538032,"results":"39","hashOfConfig":"25"},{"size":1907,"mtime":1635492860490,"results":"40","hashOfConfig":"25"},{"size":3548,"mtime":1635409410379,"results":"41","hashOfConfig":"25"},{"size":2989,"mtime":1635495718901,"results":"42","hashOfConfig":"25"},{"size":3399,"mtime":1646816404368,"results":"43","hashOfConfig":"25"},{"size":2456,"mtime":1646721857196,"results":"44","hashOfConfig":"25"},{"size":1159,"mtime":1646970893747,"results":"45","hashOfConfig":"25"},{"size":13280,"mtime":1646901618757,"results":"46","hashOfConfig":"25"},{"size":14804,"mtime":1646895235712,"results":"47","hashOfConfig":"25"},{"size":3005,"mtime":1647228414919,"results":"48","hashOfConfig":"25"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js",["95","96","97"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js",["98","99","100","101","102","103","104","105","106","107","108","109","110"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js",["111","112","113"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js",[],{"ruleId":"114","severity":2,"message":"115","line":10,"column":29,"nodeType":"116","endLine":10,"endColumn":35},{"ruleId":"114","severity":2,"message":"117","line":10,"column":43,"nodeType":"116","endLine":10,"endColumn":51},{"ruleId":"114","severity":2,"message":"117","line":147,"column":63,"nodeType":"116","endLine":147,"endColumn":71},{"ruleId":"114","severity":2,"message":"118","line":47,"column":13,"nodeType":"119","messageId":"120","endLine":47,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":48,"column":30,"nodeType":"116","messageId":"120","endLine":48,"endColumn":36},{"ruleId":"114","severity":2,"message":"122","line":49,"column":31,"nodeType":"116","messageId":"120","endLine":49,"endColumn":47},{"ruleId":"114","severity":2,"message":"122","line":50,"column":21,"nodeType":"116","messageId":"120","endLine":50,"endColumn":37},{"ruleId":"114","severity":2,"message":"118","line":56,"column":13,"nodeType":"119","messageId":"120","endLine":56,"endColumn":22},{"ruleId":"114","severity":2,"message":"123","line":59,"column":20,"nodeType":"116","messageId":"120","endLine":59,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":61,"column":23,"nodeType":"116","messageId":"120","endLine":61,"endColumn":29},{"ruleId":"114","severity":2,"message":"124","line":61,"column":30,"nodeType":"116","messageId":"120","endLine":61,"endColumn":34},{"ruleId":"114","severity":2,"message":"125","line":63,"column":15,"nodeType":"116","messageId":"120","endLine":63,"endColumn":19},{"ruleId":"114","severity":2,"message":"118","line":67,"column":23,"nodeType":"119","messageId":"120","endLine":67,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":70,"column":32,"nodeType":"116","messageId":"120","endLine":70,"endColumn":38},{"ruleId":"114","severity":2,"message":"118","line":78,"column":13,"nodeType":"119","messageId":"120","endLine":78,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":84,"column":42,"nodeType":"116","messageId":"120","endLine":84,"endColumn":48},{"ruleId":"126","severity":1,"message":"127","line":265,"column":13,"nodeType":"128","endLine":265,"endColumn":49},{"ruleId":"126","severity":1,"message":"127","line":283,"column":13,"nodeType":"128","endLine":283,"endColumn":56},{"ruleId":"129","severity":2,"message":"130","line":436,"column":22,"nodeType":"131","messageId":"132","endLine":436,"endColumn":31},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","'editStore' is missing in props validation","Property","missingPropType","'editStore.config' is missing in props validation","'editStore.config.batchPrintConfig' is missing in props validation","'editStore.originConfig' is missing in props validation","'editStore.config.name' is missing in props validation","'editStore.init' 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"]
1
+ [{"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js":"1","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js":"2","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js":"3","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js":"4","/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js":"5","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js":"6","/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js":"7","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js":"8","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js":"9","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js":"10","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js":"11","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js":"12","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js":"13","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js":"14","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js":"15","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js":"16","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js":"17","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js":"18","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js":"19","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js":"20","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js":"21","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js":"22","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js":"23"},{"size":9641,"mtime":1649735992171,"results":"24","hashOfConfig":"25"},{"size":17648,"mtime":1649735920137,"results":"26","hashOfConfig":"25"},{"size":4244,"mtime":1635494969691,"results":"27","hashOfConfig":"25"},{"size":4501,"mtime":1646970942704,"results":"28","hashOfConfig":"25"},{"size":616,"mtime":1621235314060,"results":"29","hashOfConfig":"30"},{"size":9693,"mtime":1621242097206,"results":"31","hashOfConfig":"30"},{"size":7258,"mtime":1639037857730,"results":"32","hashOfConfig":"25"},{"size":10283,"mtime":1646979851812,"results":"33","hashOfConfig":"25"},{"size":3119,"mtime":1634191808754,"results":"34","hashOfConfig":"25"},{"size":1113,"mtime":1635407660514,"results":"35","hashOfConfig":"25"},{"size":4349,"mtime":1646815933499,"results":"36","hashOfConfig":"25"},{"size":861,"mtime":1635246075403,"results":"37","hashOfConfig":"25"},{"size":3260,"mtime":1635334661529,"results":"38","hashOfConfig":"25"},{"size":26478,"mtime":1647331538032,"results":"39","hashOfConfig":"25"},{"size":1907,"mtime":1635492860490,"results":"40","hashOfConfig":"25"},{"size":3548,"mtime":1635409410379,"results":"41","hashOfConfig":"25"},{"size":2989,"mtime":1635495718901,"results":"42","hashOfConfig":"25"},{"size":3399,"mtime":1646816404368,"results":"43","hashOfConfig":"25"},{"size":2456,"mtime":1646721857196,"results":"44","hashOfConfig":"25"},{"size":1159,"mtime":1646970893747,"results":"45","hashOfConfig":"25"},{"size":13280,"mtime":1646901618757,"results":"46","hashOfConfig":"25"},{"size":14804,"mtime":1646895235712,"results":"47","hashOfConfig":"25"},{"size":3005,"mtime":1647228414919,"results":"48","hashOfConfig":"25"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js",["95","96","97"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js",["98","99","100","101","102","103","104","105","106","107","108","109","110"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js",["111","112","113"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js",[],{"ruleId":"114","severity":2,"message":"115","line":10,"column":29,"nodeType":"116","endLine":10,"endColumn":35},{"ruleId":"114","severity":2,"message":"117","line":10,"column":43,"nodeType":"116","endLine":10,"endColumn":51},{"ruleId":"114","severity":2,"message":"117","line":147,"column":63,"nodeType":"116","endLine":147,"endColumn":71},{"ruleId":"114","severity":2,"message":"118","line":47,"column":13,"nodeType":"119","messageId":"120","endLine":47,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":48,"column":30,"nodeType":"116","messageId":"120","endLine":48,"endColumn":36},{"ruleId":"114","severity":2,"message":"122","line":49,"column":31,"nodeType":"116","messageId":"120","endLine":49,"endColumn":47},{"ruleId":"114","severity":2,"message":"122","line":50,"column":21,"nodeType":"116","messageId":"120","endLine":50,"endColumn":37},{"ruleId":"114","severity":2,"message":"118","line":56,"column":13,"nodeType":"119","messageId":"120","endLine":56,"endColumn":22},{"ruleId":"114","severity":2,"message":"123","line":59,"column":20,"nodeType":"116","messageId":"120","endLine":59,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":61,"column":23,"nodeType":"116","messageId":"120","endLine":61,"endColumn":29},{"ruleId":"114","severity":2,"message":"124","line":61,"column":30,"nodeType":"116","messageId":"120","endLine":61,"endColumn":34},{"ruleId":"114","severity":2,"message":"125","line":63,"column":15,"nodeType":"116","messageId":"120","endLine":63,"endColumn":19},{"ruleId":"114","severity":2,"message":"118","line":67,"column":23,"nodeType":"119","messageId":"120","endLine":67,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":70,"column":32,"nodeType":"116","messageId":"120","endLine":70,"endColumn":38},{"ruleId":"114","severity":2,"message":"118","line":78,"column":13,"nodeType":"119","messageId":"120","endLine":78,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":84,"column":42,"nodeType":"116","messageId":"120","endLine":84,"endColumn":48},{"ruleId":"126","severity":1,"message":"127","line":265,"column":13,"nodeType":"128","endLine":265,"endColumn":49},{"ruleId":"126","severity":1,"message":"127","line":283,"column":13,"nodeType":"128","endLine":283,"endColumn":56},{"ruleId":"129","severity":2,"message":"130","line":436,"column":22,"nodeType":"131","messageId":"132","endLine":436,"endColumn":31},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","'editStore' is missing in props validation","Property","missingPropType","'editStore.config' is missing in props validation","'editStore.config.batchPrintConfig' is missing in props validation","'editStore.originConfig' is missing in props validation","'editStore.config.name' is missing in props validation","'editStore.init' 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"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.14.1",
3
+ "version": "10.14.2-alpha.2",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -13,7 +13,8 @@ import {
13
13
  ColumnWidth,
14
14
  Textarea,
15
15
  Title,
16
- TipInfo
16
+ TipInfo,
17
+ Text
17
18
  } from '../common/component'
18
19
  import { get, toJS } from 'mobx'
19
20
  import PropTypes from 'prop-types'
@@ -73,6 +74,11 @@ class EditorField extends React.Component {
73
74
  editStore.setSubtotalStyle(value)
74
75
  }
75
76
 
77
+ handleOverallOrderStyleChange = value => {
78
+ const { editStore } = this.props
79
+ editStore.setOverallOrderStyle(value)
80
+ }
81
+
76
82
  renderBlocks() {
77
83
  const { editStore, showNewDate } = this.props
78
84
  const { type, text, style, link } = editStore.computedSelectedInfo
@@ -178,10 +184,15 @@ class EditorField extends React.Component {
178
184
  }
179
185
 
180
186
  renderTable() {
181
- const { tableDataKeyList, editStore } = this.props
187
+ const { tableDataKeyList, editStore, isSomeSubtotalTr } = this.props
182
188
  const { head, headStyle, text, style } = editStore.computedSelectedInfo
183
189
 
184
- const { specialConfig, subtotal } = editStore.computedTableSpecialConfig
190
+ const {
191
+ specialConfig,
192
+ subtotal,
193
+ overallOrder
194
+ } = editStore.computedTableSpecialConfig
195
+
185
196
  // 小计样式,specialConfig可能是undefined
186
197
  const specialStyle =
187
198
  toJS(editStore.computedTableSpecialConfig)?.specialConfig?.style || {}
@@ -195,16 +206,45 @@ class EditorField extends React.Component {
195
206
  (editStore.computedTableSpecialConfig.subtotal &&
196
207
  get(subtotal, 'needUpperCase')) ||
197
208
  false
198
- // 大写的金额是否在前
209
+ // 每页合计大写的金额是否在前
199
210
  const subtotalUpperCaseBefore =
200
211
  (editStore.computedTableSpecialConfig.subtotal &&
201
212
  get(subtotal, 'isUpperCaseBefore')) ||
202
213
  false
203
- // 大写和小写的金额是否分开
214
+ // 每页合计大写和小写的金额是否分开
204
215
  const subtotalUpperLowerCaseSeparate =
205
216
  (editStore.computedTableSpecialConfig.subtotal &&
206
217
  get(subtotal, 'isUpperLowerCaseSeparate')) ||
207
218
  false
219
+ // 每页合计样式
220
+ const overallOrderStyle =
221
+ (overallOrder && overallOrder?.fields[0].style) || {}
222
+ // 每页合计自定义单元格
223
+ const subtotalUpperCustomCell =
224
+ (editStore.computedTableSpecialConfig?.subtotal &&
225
+ get(subtotal, 'isCustomCells')) ||
226
+ false
227
+ // 整单合计是否大写
228
+ const overallOrderNeedUpperCase =
229
+ (editStore.computedTableSpecialConfig?.overallOrder &&
230
+ get(overallOrder, 'needUpperCase')) ||
231
+ false
232
+ // 整单合计大写的金额是否在前
233
+ const overallOrderCaseBefore =
234
+ (editStore.computedTableSpecialConfig?.overallOrder &&
235
+ get(overallOrder, 'isUpperCaseBefore')) ||
236
+ false
237
+ // 整单合计大写和小写的金额是否分开
238
+ const overallOrderUpperLowerCaseSeparate =
239
+ (editStore.computedTableSpecialConfig?.overallOrder &&
240
+ get(overallOrder, 'isUpperLowerCaseSeparate')) ||
241
+ false
242
+ // 整单合计自定义单元格
243
+ const overallOrderUpperCustomCell =
244
+ (editStore.computedTableSpecialConfig?.overallOrder &&
245
+ get(overallOrder, 'isCustomCells')) ||
246
+ false
247
+
208
248
  return (
209
249
  <div>
210
250
  <Title title={i18next.t('编辑字段')} />
@@ -376,18 +416,85 @@ class EditorField extends React.Component {
376
416
  subtotalCheckOnChange={editStore.setSubtotalUpperCase}
377
417
  subtotalCheckText='显示大写金额'
378
418
  />
419
+ {/* 结款单不需要这些配置 */}
420
+ {!isSomeSubtotalTr && (
421
+ <>
422
+ <EditorSubtotalCheck
423
+ subtotalCheckDisabled={subtotalNeedUpperCase}
424
+ subtotalChecked={subtotalUpperCaseBefore}
425
+ subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
426
+ subtotalCheckText='大写金额在前'
427
+ />
428
+ <EditorSubtotalCheck
429
+ subtotalCheckDisabled={subtotalNeedUpperCase}
430
+ subtotalChecked={subtotalUpperLowerCaseSeparate}
431
+ subtotalCheckOnChange={
432
+ editStore.setSubtotalUpperLowerCaseSeparate
433
+ }
434
+ subtotalCheckText='大、小写金额分左右两边展示'
435
+ />
436
+ <EditorSubtotalCheck
437
+ subtotalCheckDisabled
438
+ subtotalChecked={subtotalUpperCustomCell}
439
+ subtotalCheckOnChange={editStore.setSubtotalCustomCells}
440
+ subtotalCheckText='开启自定义单元格'
441
+ />
442
+ <Text
443
+ value={
444
+ subtotal && subtotal?.fields?.[1] ? subtotal.fields[1].name : ''
445
+ }
446
+ onChange={editStore.setSubtotalFields}
447
+ style={{ width: '65px', margin: '5px 0 5px 80px' }}
448
+ />
449
+ </>
450
+ )}
451
+ <Flex>
452
+ <Flex>{i18next.t('整单合计')}:</Flex>
453
+ <Fonter
454
+ style={overallOrderStyle}
455
+ onChange={this.handleOverallOrderStyleChange}
456
+ />
457
+ <Separator />
458
+ <TextAlign
459
+ style={overallOrderStyle}
460
+ onChange={this.handleOverallOrderStyleChange}
461
+ />
462
+ </Flex>
463
+ <EditorSubtotalCheck
464
+ subtotalCheckDisabled
465
+ subtotalChecked={overallOrderNeedUpperCase}
466
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCase}
467
+ subtotalCheckText='显示大写金额'
468
+ />
379
469
  <EditorSubtotalCheck
380
- subtotalCheckDisabled={subtotalNeedUpperCase}
381
- subtotalChecked={subtotalUpperCaseBefore}
382
- subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
470
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
471
+ subtotalChecked={overallOrderCaseBefore}
472
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCaseBefore}
383
473
  subtotalCheckText='大写金额在前'
384
474
  />
385
475
  <EditorSubtotalCheck
386
- subtotalCheckDisabled={subtotalNeedUpperCase}
387
- subtotalChecked={subtotalUpperLowerCaseSeparate}
388
- subtotalCheckOnChange={editStore.setSubtotalUpperLowerCaseSeparate}
476
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
477
+ subtotalChecked={overallOrderUpperLowerCaseSeparate}
478
+ subtotalCheckOnChange={
479
+ editStore.setOverallOrderUpperLowerCaseSeparate
480
+ }
389
481
  subtotalCheckText='大、小写金额分左右两边展示'
390
482
  />
483
+ <EditorSubtotalCheck
484
+ subtotalCheckDisabled
485
+ subtotalChecked={overallOrderUpperCustomCell}
486
+ subtotalCheckOnChange={editStore.setOverallOrderCustomCells}
487
+ subtotalCheckText='开启自定义单元格'
488
+ />
489
+ <Text
490
+ value={
491
+ overallOrder && overallOrder?.fields?.[1]
492
+ ? overallOrder.fields[1].name
493
+ : ''
494
+ }
495
+ onChange={editStore.setOverallOrderFields}
496
+ style={{ width: '65px', margin: '5px 0 5px 80px' }}
497
+ />
391
498
  </div>
392
499
  )
393
500
  }
@@ -408,7 +515,8 @@ class EditorField extends React.Component {
408
515
  EditorField.propTypes = {
409
516
  editStore: PropTypes.object,
410
517
  tableDataKeyList: PropTypes.array,
411
- showNewDate: PropTypes.bool
518
+ showNewDate: PropTypes.bool,
519
+ isSomeSubtotalTr: PropTypes.bool
412
520
  }
413
521
  EditorField.defaultProps = {
414
522
  showNewDate: false
@@ -2,7 +2,7 @@ import i18next from '../../locales'
2
2
  import { action, computed, observable, set, toJS } from 'mobx'
3
3
  import { pageTypeMap } from '../config'
4
4
  import _ from 'lodash'
5
- import { dispatchMsg, getBlockName, exchange } from '../util'
5
+ import { dispatchMsg, getBlockName, exchange, getColSpanLength } from '../util'
6
6
  import React from 'react'
7
7
 
8
8
  class EditorStore {
@@ -61,6 +61,28 @@ class EditorStore {
61
61
  this.isAutoFilling = bol
62
62
  }
63
63
 
64
+ @observable
65
+ overallOrderShow = false
66
+
67
+ // 整单合计自定义合并单元格
68
+ @observable
69
+ overallOrderConfigFields = {
70
+ name: '',
71
+ valueField: '',
72
+ colSpan: 3, // 产品说3个
73
+ style: {
74
+ fontWeight: 'bold'
75
+ }
76
+ }
77
+
78
+ // 每页合计自定义合并单元格
79
+ @observable
80
+ subtotalConfigFields = {
81
+ name: '',
82
+ valueField: '',
83
+ colSpan: 3 // 产品说3个,开启自定义单元格
84
+ }
85
+
64
86
  @computed
65
87
  get computedPrinterKey() {
66
88
  return _.map(this.config, (v, k) => {
@@ -511,11 +533,61 @@ class EditorStore {
511
533
  setSubtotalShow(name) {
512
534
  const arr = name.split('.')
513
535
  const table = this.config.contents[arr[2]]
514
-
536
+ this.overallOrderShow = !this.overallOrderShow
515
537
  // 切换的时候,要把对应table的多余空数据清掉
516
538
  this.clearExtraTableData(table.dataKey)
517
- table.subtotal.show = !table.subtotal.show
539
+
518
540
  this.setAutoFillingConfig(!this.isAutoFilling)
541
+ // 获取td的colSpan
542
+ const colSpanLength = getColSpanLength(table)
543
+ set(table.subtotal, {
544
+ show: !table.subtotal.show
545
+ })
546
+ // 兼容存在后端的模板,subtotal配置没有fields
547
+ if (!table.subtotal?.fields) {
548
+ set(table.subtotal, {
549
+ fields: [
550
+ {
551
+ name: '每页合计:',
552
+ valueField: 'real_item_price',
553
+ colSpan: colSpanLength
554
+ }
555
+ ]
556
+ })
557
+ }
558
+ }
559
+
560
+ @action
561
+ setOverallOrderShow(name) {
562
+ const arr = name.split('.')
563
+ const table = this.config.contents[arr[2]]
564
+ this.overallOrderShow = !this.overallOrderShow
565
+ const colSpanLength = getColSpanLength(table)
566
+ if (table.overallOrder) {
567
+ set(table.overallOrder, {
568
+ show: !table.overallOrder.show
569
+ })
570
+ table.overallOrder.fields[0].colSpan =
571
+ colSpanLength - (table.overallOrder.fields?.[1]?.colSpan ?? 0)
572
+ } else {
573
+ // 兼容已经存在的配送单据,他们的配置存在后端的,没有overallOrder这个配置,给加上
574
+ set(table, {
575
+ overallOrder: {
576
+ show: true,
577
+ fields: [
578
+ {
579
+ name: '整单合计:',
580
+ valueField: '出库金额',
581
+ style: {
582
+ fontWeight: 'bold'
583
+ },
584
+ colSpan: colSpanLength
585
+ }
586
+ ]
587
+ }
588
+ })
589
+ }
590
+ this.config = toJS(this.config)
519
591
  }
520
592
 
521
593
  @action
@@ -530,7 +602,7 @@ class EditorStore {
530
602
  @action
531
603
  changeTableDataKey(name, key) {
532
604
  const arr = name.split('.')
533
- const { dataKey } = this.config.contents[arr[2]]
605
+ const { dataKey, overallOrder, subtotal } = this.config.contents[arr[2]]
534
606
  const keyArr = dataKey.split('_')
535
607
  let newDataKey
536
608
  // 当前有这个key则去掉
@@ -554,6 +626,10 @@ class EditorStore {
554
626
  ])
555
627
 
556
628
  this.config.contents[arr[2]].dataKey = newDataKey.join('_')
629
+ // 整单合计不显示
630
+ if (overallOrder?.show) overallOrder.show = false
631
+ // 每页合计不显示
632
+ if (subtotal?.show) subtotal.show = false
557
633
  }
558
634
 
559
635
  @action
@@ -937,10 +1013,11 @@ class EditorStore {
937
1013
  }
938
1014
  }
939
1015
 
940
- // 设置大写金额
1016
+ // 每页合计设置大写金额
941
1017
  @action.bound
942
1018
  setSubtotalUpperCase() {
943
1019
  if (this.selectedRegion) {
1020
+ this.overallOrderShow = !this.overallOrderShow
944
1021
  const arr = this.selectedRegion.split('.')
945
1022
  const subtotalConfig = this.config.contents[arr[2]].subtotal
946
1023
 
@@ -956,10 +1033,11 @@ class EditorStore {
956
1033
  }
957
1034
  }
958
1035
 
959
- // 设置大写金额在前
1036
+ // 每页合计设置大写金额在前
960
1037
  @action.bound
961
1038
  setSubtotalUpperCaseBefore() {
962
1039
  if (this.selectedRegion) {
1040
+ this.overallOrderShow = !this.overallOrderShow
963
1041
  const arr = this.selectedRegion.split('.')
964
1042
  const subtotalConfig = this.config.contents[arr[2]].subtotal
965
1043
 
@@ -968,10 +1046,11 @@ class EditorStore {
968
1046
  }
969
1047
  }
970
1048
 
971
- // 设置大小写金额分开
1049
+ // 每页合计设置大小写金额分开
972
1050
  @action.bound
973
1051
  setSubtotalUpperLowerCaseSeparate() {
974
1052
  if (this.selectedRegion) {
1053
+ this.overallOrderShow = !this.overallOrderShow
975
1054
  const arr = this.selectedRegion.split('.')
976
1055
  const subtotalConfig = this.config.contents[arr[2]].subtotal
977
1056
 
@@ -982,7 +1061,210 @@ class EditorStore {
982
1061
  }
983
1062
  }
984
1063
 
985
- // 设置交换位置
1064
+ // 每页合计开启自定义单元格
1065
+ @action.bound
1066
+ setSubtotalCustomCells() {
1067
+ if (this.selectedRegion) {
1068
+ // 作用:触发组件的更新
1069
+ this.overallOrderShow = !this.overallOrderShow
1070
+ const arr = this.selectedRegion.split('.')
1071
+ const table = this.config.contents[arr[2]]
1072
+ const subtotalConfig = table?.subtotal
1073
+ // 没有显示每页合计的时候不可以设置自定义单元格
1074
+ if (!subtotalConfig?.show) return
1075
+ // 多栏表格情况,计算colSpan
1076
+ const colSpanLength = getColSpanLength(table)
1077
+ const oldCustomCells = subtotalConfig?.isCustomCells
1078
+
1079
+ set(subtotalConfig, {
1080
+ isCustomCells: !oldCustomCells
1081
+ })
1082
+ // 兼容已经存在后端的模板,每页合计直接是显示的,导致每页合计配置没有fields,isCustomCells,手动添加上
1083
+ if (oldCustomCells === undefined && !subtotalConfig.fields) {
1084
+ set(subtotalConfig, {
1085
+ fields: [
1086
+ {
1087
+ name: '每页合计:',
1088
+ valueField: 'real_item_price',
1089
+ colSpan: colSpanLength
1090
+ }
1091
+ ]
1092
+ })
1093
+ }
1094
+ // 开启自定义单元格
1095
+ if (subtotalConfig?.isCustomCells) {
1096
+ // fields添加自定义单元格
1097
+ subtotalConfig.fields = [
1098
+ subtotalConfig.fields[0],
1099
+ {
1100
+ ...this.subtotalConfigFields
1101
+ }
1102
+ ]
1103
+ // 重新计算合并单元格的个数
1104
+ subtotalConfig.fields[0].colSpan =
1105
+ colSpanLength - subtotalConfig.fields[1].colSpan
1106
+ } else {
1107
+ // 关闭自定义单元格,fields只有一个
1108
+ subtotalConfig.fields = [subtotalConfig.fields[0]]
1109
+ // 重新计算合并单元格的个数
1110
+ subtotalConfig.fields[0].colSpan = colSpanLength
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ // 每页合计自定义单元格文本输入
1116
+ @action.bound
1117
+ setSubtotalFields(value) {
1118
+ if (this.selectedRegion) {
1119
+ const arr = this.selectedRegion.split('.')
1120
+ const table = this.config.contents[arr[2]]
1121
+ const subtotalConfig = table?.subtotal
1122
+
1123
+ if (subtotalConfig.isCustomCells) {
1124
+ const subtotalConfig = table?.subtotal.fields
1125
+ subtotalConfig[1].name = value
1126
+ }
1127
+ }
1128
+ }
1129
+
1130
+ // 整单合计设置大写金额
1131
+ @action.bound
1132
+ setOverallOrderUpperCase() {
1133
+ if (this.selectedRegion) {
1134
+ this.overallOrderShow = !this.overallOrderShow
1135
+ const arr = this.selectedRegion.split('.')
1136
+ const overallOrderConfig = this.config.contents[arr[2]]?.overallOrder
1137
+
1138
+ const oldNeedUpperCase = overallOrderConfig?.needUpperCase
1139
+ this.config.contents[arr[2]]?.overallOrder &&
1140
+ set(overallOrderConfig, { needUpperCase: !oldNeedUpperCase })
1141
+ // 没有大写金额时,将大写在前和大小写分开的多选框设置为false
1142
+ if (
1143
+ this.config.contents[arr[2]]?.overallOrder &&
1144
+ overallOrderConfig.needUpperCase === false
1145
+ ) {
1146
+ overallOrderConfig.isUpperCaseBefore &&
1147
+ set(overallOrderConfig, { isUpperCaseBefore: false })
1148
+ overallOrderConfig.isUpperLowerCaseSeparate &&
1149
+ set(overallOrderConfig, { isUpperLowerCaseSeparate: false })
1150
+ }
1151
+ }
1152
+ }
1153
+
1154
+ // 整单合计设置大写金额在前
1155
+ @action.bound
1156
+ setOverallOrderUpperCaseBefore() {
1157
+ if (this.selectedRegion) {
1158
+ this.overallOrderShow = !this.overallOrderShow
1159
+ const arr = this.selectedRegion.split('.')
1160
+ const overallOrderConfig = this.config.contents[arr[2]]?.overallOrder
1161
+
1162
+ const oldUpperCaseBefore = overallOrderConfig?.isUpperCaseBefore
1163
+ this.config.contents[arr[2]]?.overallOrder &&
1164
+ set(overallOrderConfig, { isUpperCaseBefore: !oldUpperCaseBefore })
1165
+ }
1166
+ }
1167
+
1168
+ // 整单合计设置大小写金额分开
1169
+ @action.bound
1170
+ setOverallOrderUpperLowerCaseSeparate() {
1171
+ if (this.selectedRegion) {
1172
+ this.overallOrderShow = !this.overallOrderShow
1173
+ const arr = this.selectedRegion.split('.')
1174
+ const overallOrderConfig = this.config.contents[arr[2]]?.overallOrder
1175
+
1176
+ const oldUpperLowerCaseSeparate =
1177
+ overallOrderConfig.isUpperLowerCaseSeparate
1178
+ set(overallOrderConfig, {
1179
+ isUpperLowerCaseSeparate: !oldUpperLowerCaseSeparate
1180
+ })
1181
+ }
1182
+ }
1183
+
1184
+ // 整单合计开启自定义单元格
1185
+ @action.bound
1186
+ setOverallOrderCustomCells() {
1187
+ if (this.selectedRegion) {
1188
+ // 作用:触发tableoverallordertr组件的更新
1189
+ this.overallOrderShow = !this.overallOrderShow
1190
+ const arr = this.selectedRegion.split('.')
1191
+ const table = this.config.contents[arr[2]]
1192
+ const overallOrderConfig = table?.overallOrder
1193
+ if (!overallOrderConfig || !overallOrderConfig?.show) return
1194
+ // 多栏表格情况
1195
+ const colSpanLength = getColSpanLength(table)
1196
+ const oldCustomCells = overallOrderConfig?.isCustomCells
1197
+
1198
+ set(overallOrderConfig, {
1199
+ isCustomCells: !oldCustomCells
1200
+ })
1201
+
1202
+ if (overallOrderConfig?.isCustomCells) {
1203
+ // fields添加自定义单元格
1204
+ overallOrderConfig.fields = [
1205
+ overallOrderConfig.fields[0],
1206
+ {
1207
+ ...this.overallOrderConfigFields,
1208
+ // 和之前保持一样的样式
1209
+ style: { ...overallOrderConfig.fields[0].style }
1210
+ }
1211
+ ]
1212
+ // 重新计算合并单元格的个数
1213
+ overallOrderConfig.fields[0].colSpan =
1214
+ colSpanLength - overallOrderConfig.fields[1].colSpan
1215
+ } else {
1216
+ // 关闭自定义单元格
1217
+ overallOrderConfig.fields = [overallOrderConfig.fields[0]]
1218
+ // 重新计算合并单元格的个数
1219
+ overallOrderConfig.fields[0].colSpan = colSpanLength
1220
+ }
1221
+
1222
+ this.config = toJS(this.config)
1223
+ }
1224
+ }
1225
+
1226
+ // 整单合计自定义单元格文本输入
1227
+ @action.bound
1228
+ setOverallOrderFields(value) {
1229
+ if (this.selectedRegion) {
1230
+ const arr = this.selectedRegion.split('.')
1231
+ const table = this.config.contents[arr[2]]
1232
+ const overallOrderConfig = table?.overallOrder
1233
+
1234
+ if (overallOrderConfig.isCustomCells) {
1235
+ const overallOrderConfigFields = table?.overallOrder.fields
1236
+ overallOrderConfigFields[1].name = value
1237
+ }
1238
+ }
1239
+ }
1240
+
1241
+ // 整单合计样式设置
1242
+ @action.bound
1243
+ setOverallOrderStyle(value) {
1244
+ if (this.selectedRegion) {
1245
+ const flexStyle = {
1246
+ left: 'flex-start',
1247
+ center: 'center',
1248
+ right: 'flex-end'
1249
+ }
1250
+ const arr = this.selectedRegion.split('.')
1251
+ const overallOrderConfigFields = this.config.contents[arr[2]]
1252
+ ?.overallOrder.fields
1253
+ _.forEach(overallOrderConfigFields, item => {
1254
+ const oldStyle = item.style || {}
1255
+ set(item, {
1256
+ style: {
1257
+ ...oldStyle,
1258
+ ...value,
1259
+ // 整单合计里使用的flex布局,textAlign不生效
1260
+ 'justify-content': flexStyle[value.textAlign]
1261
+ }
1262
+ })
1263
+ })
1264
+ }
1265
+ }
1266
+
1267
+ // 合计和每页合计设置交换位置
986
1268
  @action.bound
987
1269
  setSubtotalCommutationPlace() {
988
1270
  if (this.selectedRegion) {
@@ -3,63 +3,87 @@ import PropTypes from 'prop-types'
3
3
  import classNames from 'classnames'
4
4
 
5
5
  class Flex extends React.Component {
6
- render () {
6
+ render() {
7
7
  const {
8
8
  flex,
9
9
 
10
- auto, none, width, height,
10
+ auto,
11
+ none,
12
+ width,
13
+ height,
11
14
 
12
- row, column,
15
+ row,
16
+ column,
13
17
 
14
- wrap, nowrap,
18
+ wrap,
19
+ nowrap,
20
+ flexGrow,
15
21
 
16
- justifyStart, justifyEnd, justifyCenter, justifyBetween, justifyAround,
22
+ justifyStart,
23
+ justifyEnd,
24
+ justifyCenter,
25
+ justifyBetween,
26
+ justifyAround,
17
27
 
18
- alignStart, alignEnd, alignCenter, alignBaseline, alignStretch,
28
+ alignStart,
29
+ alignEnd,
30
+ alignCenter,
31
+ alignBaseline,
32
+ alignStretch,
19
33
 
20
- alignContentStart, alignContentEnd, alignContentCenter, alignContentBetween, alignContentAround, alignContentStretch,
34
+ alignContentStart,
35
+ alignContentEnd,
36
+ alignContentCenter,
37
+ alignContentBetween,
38
+ alignContentAround,
39
+ alignContentStretch,
21
40
 
22
- className, style,
41
+ className,
42
+ style,
23
43
 
24
44
  ...rest
25
45
  } = this.props
26
- const cn = classNames({
27
- 'gm-flex': true,
28
-
29
- 'gm-flex-flex': flex,
30
- 'gm-flex-auto': auto,
31
- 'gm-flex-none': none || width || height,
32
-
33
- 'gm-flex-row': row,
34
- 'gm-flex-column': column,
35
-
36
- 'gm-flex-wrap': wrap,
37
- 'gm-flex-nowrap': nowrap,
38
-
39
- 'gm-flex-justify-start': justifyStart,
40
- 'gm-flex-justify-end': justifyEnd,
41
- 'gm-flex-justify-center': justifyCenter,
42
- 'gm-flex-justify-between': justifyBetween,
43
- 'gm-flex-justify-around': justifyAround,
44
-
45
- 'gm-flex-align-start': alignStart,
46
- 'gm-flex-align-end': alignEnd,
47
- 'gm-flex-align-center': alignCenter,
48
- 'gm-flex-align-baseline': alignBaseline,
49
- 'gm-flex-align-stretch': alignStretch,
50
-
51
- 'gm-flex-align-content-start': alignContentStart,
52
- 'gm-flex-align-content-end': alignContentEnd,
53
- 'gm-flex-align-content-center': alignContentCenter,
54
- 'gm-flex-align-content-between': alignContentBetween,
55
- 'gm-flex-align-content-around': alignContentAround,
56
- 'gm-flex-align-content-stretch': alignContentStretch
57
- }, className)
46
+ const cn = classNames(
47
+ {
48
+ 'gm-flex': true,
49
+
50
+ 'gm-flex-grow': flexGrow,
51
+ 'gm-flex-flex': flex,
52
+ 'gm-flex-auto': auto,
53
+ 'gm-flex-none': none || width || height,
54
+
55
+ 'gm-flex-row': row,
56
+ 'gm-flex-column': column,
57
+
58
+ 'gm-flex-wrap': wrap,
59
+ 'gm-flex-nowrap': nowrap,
60
+
61
+ 'gm-flex-justify-start': justifyStart,
62
+ 'gm-flex-justify-end': justifyEnd,
63
+ 'gm-flex-justify-center': justifyCenter,
64
+ 'gm-flex-justify-between': justifyBetween,
65
+ 'gm-flex-justify-around': justifyAround,
66
+
67
+ 'gm-flex-align-start': alignStart,
68
+ 'gm-flex-align-end': alignEnd,
69
+ 'gm-flex-align-center': alignCenter,
70
+ 'gm-flex-align-baseline': alignBaseline,
71
+ 'gm-flex-align-stretch': alignStretch,
72
+
73
+ 'gm-flex-align-content-start': alignContentStart,
74
+ 'gm-flex-align-content-end': alignContentEnd,
75
+ 'gm-flex-align-content-center': alignContentCenter,
76
+ 'gm-flex-align-content-between': alignContentBetween,
77
+ 'gm-flex-align-content-around': alignContentAround,
78
+ 'gm-flex-align-content-stretch': alignContentStretch
79
+ },
80
+ className
81
+ )
58
82
 
59
83
  let s = Object.assign({}, style)
60
84
  if (flex) {
61
- s.flex = (typeof flex === 'boolean') ? 1 : flex
62
- s.WebKitFlex = (typeof flex === 'boolean') ? 1 : flex
85
+ s.flex = typeof flex === 'boolean' ? 1 : flex
86
+ s.WebKitFlex = typeof flex === 'boolean' ? 1 : flex
63
87
  }
64
88
  if (height) {
65
89
  s.height = height
@@ -68,7 +92,11 @@ class Flex extends React.Component {
68
92
  s.width = width
69
93
  }
70
94
 
71
- return <div {...rest} className={cn} style={s}>{this.props.children}</div>
95
+ return (
96
+ <div {...rest} className={cn} style={s}>
97
+ {this.props.children}
98
+ </div>
99
+ )
72
100
  }
73
101
  }
74
102
 
@@ -81,6 +109,7 @@ Flex.propTypes = {
81
109
  row: PropTypes.bool,
82
110
  column: PropTypes.bool,
83
111
  wrap: PropTypes.bool,
112
+ flexGrow: PropTypes.bool,
84
113
  nowrap: PropTypes.bool,
85
114
  justifyStart: PropTypes.bool,
86
115
  justifyEnd: PropTypes.bool,
@@ -19,6 +19,10 @@
19
19
  align-items: stretch;
20
20
  box-sizing: border-box;
21
21
 
22
+ &.gm-flex-grow {
23
+ flex-grow: 1;
24
+ }
25
+
22
26
  &.gm-flex-wrap {
23
27
  flex-wrap: wrap;
24
28
  }
@@ -98,4 +102,4 @@
98
102
  &.gm-flex-align-content-stretch {
99
103
  align-content: stretch;
100
104
  }
101
- }
105
+ }
@@ -61,7 +61,6 @@ class ContextMenu extends React.Component {
61
61
 
62
62
  handleSubtotal = name => {
63
63
  const { editStore } = this.props
64
-
65
64
  editStore.setSubtotalShow(name)
66
65
  }
67
66
 
@@ -70,6 +69,11 @@ class ContextMenu extends React.Component {
70
69
  editStore.handleChangeTableData(isAutoFilling)
71
70
  }
72
71
 
72
+ handleOverallOrder = name => {
73
+ const { editStore } = this.props
74
+ editStore.setOverallOrderShow(name)
75
+ }
76
+
73
77
  renderOrderActionBtn = name => {
74
78
  if (!this.hasSubtotalBtn(name)) {
75
79
  return null
@@ -84,13 +88,18 @@ class ContextMenu extends React.Component {
84
88
  }
85
89
  } = this.props
86
90
  const arr = name.split('.')
87
- const { dataKey, subtotal } = this.props.editStore.config.contents[arr[2]]
91
+ const {
92
+ dataKey,
93
+ subtotal,
94
+ overallOrder
95
+ } = this.props.editStore.config.contents[arr[2]]
88
96
  const keyArr = dataKey.split('_')
89
97
 
90
98
  const isMultiActive = keyArr.includes('multi')
91
99
  const isThreeActive = keyArr.includes('multi3')
92
100
  const isCategoryActive = keyArr.includes('category')
93
101
  const isSubtotalActive = subtotal.show
102
+ const isOverallOrder = overallOrder?.show
94
103
 
95
104
  return (
96
105
  <>
@@ -127,6 +136,12 @@ class ContextMenu extends React.Component {
127
136
  >
128
137
  {i18next.t('行数填充')}
129
138
  </div>
139
+ <div
140
+ onClick={this.handleOverallOrder.bind(this, name)}
141
+ className={isOverallOrder ? 'active' : ''}
142
+ >
143
+ {i18next.t('整单合计')}
144
+ </div>
130
145
  </>
131
146
  )
132
147
  }
@@ -147,6 +162,7 @@ class ContextMenu extends React.Component {
147
162
  config={editStore.config}
148
163
  data={editStore.mockData}
149
164
  getremainpageHeight={editStore.setRemainPageHeight}
165
+ overallorder={editStore.overallOrderShow}
150
166
  />
151
167
  </CommonContextMenu>
152
168
  )
@@ -23,7 +23,7 @@ const tableDataKeyList = [
23
23
  @observer
24
24
  class Editor extends React.Component {
25
25
  render() {
26
- const { onSave, showEditor, addFields } = this.props
26
+ const { onSave, showEditor, addFields, isSomeSubtotalTr } = this.props
27
27
 
28
28
  return (
29
29
  <div className='gm-printer-edit'>
@@ -46,7 +46,10 @@ class Editor extends React.Component {
46
46
  <Gap height='10px' />
47
47
  <EditorSelect />
48
48
  <Gap height='5px' />
49
- <EditorField tableDataKeyList={tableDataKeyList} />
49
+ <EditorField
50
+ tableDataKeyList={tableDataKeyList}
51
+ isSomeSubtotalTr={isSomeSubtotalTr}
52
+ />
50
53
  <Gap height='5px' />
51
54
  <EditorAddField addFields={addFields} />
52
55
 
@@ -69,7 +72,8 @@ Editor.propTypes = {
69
72
  onSave: PropTypes.func,
70
73
  showEditor: PropTypes.bool,
71
74
  mockData: PropTypes.object.isRequired,
72
- addFields: PropTypes.object.isRequired
75
+ addFields: PropTypes.object.isRequired,
76
+ isSomeSubtotalTr: PropTypes.bool
73
77
  }
74
78
 
75
79
  Editor.defaultProps = {
@@ -81,6 +81,9 @@ class Printer extends React.Component {
81
81
  this.props.printerStore.remainPageHeight
82
82
  )
83
83
  }
84
+ if (nextProps.overallorder !== this.props.overallorder) {
85
+ this.props.printerStore.setOverallOrder(nextProps.config)
86
+ }
84
87
  }
85
88
 
86
89
  componentDidMount() {
@@ -324,7 +327,8 @@ Printer.propTypes = {
324
327
  config: PropTypes.object.isRequired,
325
328
  onReady: PropTypes.func,
326
329
  isSomeSubtotalTr: PropTypes.bool,
327
- getremainpageHeight: PropTypes.func
330
+ getremainpageHeight: PropTypes.func,
331
+ overallorder: PropTypes.bool
328
332
  }
329
333
 
330
334
  Printer.defaultProps = {
@@ -4,7 +4,8 @@ import {
4
4
  getSumTrHeight,
5
5
  isMultiTable,
6
6
  caclSingleDetailsPageHeight,
7
- getArrayMid
7
+ getArrayMid,
8
+ getOverallOrderTrHeight
8
9
  } from '../util'
9
10
  import _ from 'lodash'
10
11
  import Big from 'big.js'
@@ -169,6 +170,11 @@ class PrinterStore {
169
170
  }
170
171
  }
171
172
 
173
+ @action
174
+ setOverallOrder(config) {
175
+ this.config = config || {}
176
+ }
177
+
172
178
  @action
173
179
  computedData(dataKey, table, end, currentRemainTableHeight) {
174
180
  /** 当前数据 */
@@ -240,9 +246,13 @@ class PrinterStore {
240
246
  tableCount++
241
247
  // 表格原始的高度和宽度信息
242
248
  const table = this.tablesInfo[`contents.table.${index}`]
243
- const { subtotal, dataKey, summaryConfig } = content
249
+ const { subtotal, dataKey, summaryConfig, overallOrder } = content
244
250
  // 如果显示每页合计,那么table高度多预留一行高度
245
251
  const subtotalTrHeight = subtotal.show ? getSumTrHeight(subtotal) : 0
252
+ // 如果显示整单合计,那么table高度多预留一行高度
253
+ const overallOrderTrHeight = overallOrder?.show
254
+ ? getOverallOrderTrHeight(overallOrder)
255
+ : 0
246
256
  // 如果每页合计(新的),那么table高度多预留一行高度
247
257
  const pageSummaryTrHeight =
248
258
  summaryConfig?.pageSummaryShow && !isMultiTable(dataKey) // 双栏table没有每页合计
@@ -250,7 +260,10 @@ class PrinterStore {
250
260
  : 0
251
261
  // 每个表格都具有的高度
252
262
  const allTableHaveThisHeight =
253
- table.head.height + subtotalTrHeight + pageSummaryTrHeight
263
+ table.head.height +
264
+ subtotalTrHeight +
265
+ pageSummaryTrHeight +
266
+ overallOrderTrHeight
254
267
  /** 当前page页面的最小高度 */
255
268
  const currentPageMinimumHeight =
256
269
  allPagesHaveThisHeight + allTableHaveThisHeight
@@ -166,3 +166,15 @@
166
166
  flex-grow: 1;
167
167
  justify-content: space-between;
168
168
  }
169
+ .gm-printer-subtotal-isUpperCaseBefore-inter{
170
+ order:2;
171
+ }
172
+ .gm-flex-justify-between-page{
173
+ justify-content: space-between;
174
+ }
175
+ .gm-flex-grow-page{
176
+ flex-grow: 1;
177
+ }
178
+ .gm-flex-page{
179
+ display:flex
180
+ }
@@ -16,6 +16,7 @@ import { MULTI_SUFFIX } from '../config'
16
16
  import SpecialTr from './table_special_tr'
17
17
  import SubtotalTr from './table_subtotal_tr'
18
18
  import PageSummary from './page_summary'
19
+ import OverallOrder from './table_overallOrder_tr'
19
20
 
20
21
  @inject('printerStore')
21
22
  @observer
@@ -290,6 +291,11 @@ class Table extends React.Component {
290
291
  {this.props.config.subtotal.isCommutationPlace
291
292
  ? PageSummarySubtotalTr()
292
293
  : subtotalTrPageSummary()}
294
+ <OverallOrder
295
+ range={range}
296
+ config={config}
297
+ printerStore={printerStore}
298
+ />
293
299
  </tbody>
294
300
  </table>
295
301
  )
@@ -0,0 +1,65 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import _ from 'lodash'
4
+ // import Big from 'big.js'
5
+ import { coverDigit2Uppercase } from '../util'
6
+ import { observer } from 'mobx-react'
7
+ import classNames from 'classnames'
8
+
9
+ const OverallOrder = props => {
10
+ const {
11
+ config: { overallOrder },
12
+ printerStore,
13
+ printerStore: {
14
+ data: { common }
15
+ }
16
+ } = props
17
+
18
+ return (
19
+ overallOrder?.show &&
20
+ printerStore?.ready && (
21
+ <tr>
22
+ {_.map(overallOrder.fields, (item, index) => {
23
+ return (
24
+ <td colSpan={item.colSpan} key={index}>
25
+ <div style={{ ...item.style }} className='gm-flex-page'>
26
+ {item.name}
27
+ <div
28
+ className={classNames('gm-flex-page', {
29
+ 'gm-flex-justify-between-page':
30
+ overallOrder?.isUpperLowerCaseSeparate,
31
+ 'gm-flex-grow-page': overallOrder?.isUpperLowerCaseSeparate
32
+ })}
33
+ >
34
+ <span
35
+ className={
36
+ overallOrder?.isUpperCaseBefore
37
+ ? 'gm-printer-subtotal-isUpperCaseBefore-inter'
38
+ : ''
39
+ }
40
+ >
41
+ {common?.[item.valueField] ?? ''}
42
+ </span>
43
+ {overallOrder?.needUpperCase && (
44
+ <span>
45
+ {common?.[item.valueField]
46
+ ? coverDigit2Uppercase(common[item.valueField])
47
+ : ''}
48
+ </span>
49
+ )}
50
+ </div>
51
+ </div>
52
+ </td>
53
+ )
54
+ })}
55
+ </tr>
56
+ )
57
+ )
58
+ }
59
+ OverallOrder.propTypes = {
60
+ config: PropTypes.object.isRequired,
61
+ range: PropTypes.object.isRequired,
62
+ printerStore: PropTypes.object
63
+ }
64
+
65
+ export default observer(OverallOrder)
@@ -7,11 +7,18 @@ import Big from 'big.js'
7
7
  import { coverDigit2Uppercase, getDataKey } from '../util'
8
8
  import { observer } from 'mobx-react'
9
9
  import { get } from 'mobx'
10
+ import classNames from 'classnames'
11
+
10
12
  /**
11
13
  * 每页合计组件,分页计算后,根据range来统计每页合计数据
12
14
  * @param props
13
15
  * @returns {*}
14
16
  */
17
+ const flexStyle = {
18
+ left: 'flex-start',
19
+ center: 'center',
20
+ right: 'flex-end'
21
+ }
15
22
  const SubtotalTr = props => {
16
23
  const {
17
24
  config: {
@@ -25,7 +32,7 @@ const SubtotalTr = props => {
25
32
  style,
26
33
  fields = [
27
34
  {
28
- name: i18next.t('出库金额'),
35
+ name: i18next.t('每页合计:'),
29
36
  valueField: 'real_item_price'
30
37
  }
31
38
  ],
@@ -36,7 +43,6 @@ const SubtotalTr = props => {
36
43
  printerStore,
37
44
  isSomeSubtotalTr
38
45
  } = props
39
-
40
46
  const tableData = printerStore.data._table[getDataKey(dataKey, arrange)] || []
41
47
  // 计算合计
42
48
  const sumData = (list, field) => {
@@ -67,18 +73,14 @@ const SubtotalTr = props => {
67
73
  if (show && printerStore.ready) {
68
74
  const list = tableData.slice(range.begin, range.end)
69
75
 
70
- const sum = {}
71
-
72
- _.each(fields, v => {
73
- sum[v.name] = sumData(list, v.valueField)
74
- })
75
-
76
- // 定义每页小记的左右两侧内容
77
- let subtotalLeftContent
78
- let subtotalRightContent
79
- let subtotalStr = ''
80
- // 结款单
76
+ // 针对结款单的
81
77
  if (isSomeSubtotalTr) {
78
+ const sum = {}
79
+
80
+ _.each(fields, v => {
81
+ sum[v.name] = sumData(list, v.valueField)
82
+ })
83
+ let subtotalStr = ''
82
84
  for (const name in sum) {
83
85
  const price = sum[name]
84
86
  const priceUpperCase = get(subtotal, 'needUpperCase') // needUpperCase在初始模板中undefined,所以必须用这个方法
@@ -103,61 +105,49 @@ const SubtotalTr = props => {
103
105
  </tr>
104
106
  )
105
107
  } else {
106
- for (const name in sum) {
107
- const price = sum[name]
108
- const priceUpperCase = get(subtotal, 'needUpperCase') // needUpperCase在初始模板中undefined,所以必须用这个方法
109
- ? '大写:' + coverDigit2Uppercase(price)
110
- : ''
111
- if (displayName) {
112
- // 大写金额是否在前
113
- if (isUpperCaseBefore) {
114
- subtotalLeftContent = `${name}${priceUpperCase}`
115
- subtotalRightContent = `${price}`
116
- } else {
117
- subtotalLeftContent = `${price}`
118
- subtotalRightContent = `${name} ${priceUpperCase}`
119
- }
120
- } else {
121
- if (isUpperCaseBefore) {
122
- subtotalLeftContent = `${priceUpperCase}`
123
- subtotalRightContent = `${price}`
124
- } else {
125
- subtotalLeftContent = `${price}`
126
- subtotalRightContent = `${priceUpperCase}`
127
- }
128
- }
129
- }
130
-
131
108
  return (
132
109
  <tr>
133
- <td
134
- colSpan={99}
135
- style={{ fontWeight: 'bold', ...style }}
136
- // dangerouslySetInnerHTML={{
137
- // __html: `${i18next.t('每页合计')}:${subtotalStr}`
138
- // }}flex-grow: 1
139
- >
140
- {/* 大写金额和小写金额分开在表格的两侧,通过控制类名实现,添加类名后,覆盖原来的居中、靠右靠左 */}
141
- <div
142
- className={
143
- isUpperLowerCaseSeparate
144
- ? 'gm-printer-subtotal-UpperLowerCaseSeparate-outer'
145
- : ''
146
- }
147
- >
148
- {i18next.t('每页合计')}:
149
- <span
150
- className={
151
- isUpperLowerCaseSeparate
152
- ? 'gm-printer-subtotal-UpperLowerCaseSeparate-inter'
153
- : ''
154
- }
155
- >
156
- <span>&nbsp;&nbsp;{subtotalLeftContent}&nbsp;&nbsp;</span>
157
- <span>&nbsp;&nbsp;{subtotalRightContent}&nbsp;&nbsp;</span>
158
- </span>
159
- </div>
160
- </td>
110
+ {_.map(fields, (item, index) => {
111
+ return (
112
+ <td colSpan={item.colSpan ?? 99} key={index}>
113
+ <div
114
+ style={{
115
+ fontWeight: 'bold',
116
+ 'justify-content': flexStyle[subtotal.style.textAlign], // flex布局中textAlign不生效,改使用justify-content
117
+ ...subtotal.style
118
+ }}
119
+ className='gm-flex-page'
120
+ >
121
+ {item.name}
122
+ <div
123
+ className={classNames('gm-flex-page', {
124
+ 'gm-flex-justify-between-page': isUpperLowerCaseSeparate, // 决定大小写金额是否分开在两端
125
+ 'gm-flex-grow-page': isUpperLowerCaseSeparate
126
+ })}
127
+ >
128
+ <span
129
+ className={
130
+ isUpperCaseBefore // 决定小写金额是否在前
131
+ ? 'gm-printer-subtotal-isUpperCaseBefore-inter'
132
+ : ''
133
+ }
134
+ >
135
+ {/* 这样写是为了支持自定义单元,index = 1时是自定义单元格 */}
136
+ {index === 0 ? sumData(list, item.valueField) : ''}
137
+ </span>
138
+ {subtotal?.needUpperCase && ( // 是否需要大写金额
139
+ <span>
140
+ {index === 0
141
+ ? '大写:' +
142
+ coverDigit2Uppercase(sumData(list, item.valueField))
143
+ : ''}
144
+ </span>
145
+ )}
146
+ </div>
147
+ </div>
148
+ </td>
149
+ )
150
+ })}
161
151
  </tr>
162
152
  )
163
153
  }
package/src/util.js CHANGED
@@ -108,6 +108,14 @@ function getSumTrHeight(SumTr) {
108
108
  return (parseInt(fontSize) - 12) * 1.5 + 26
109
109
  }
110
110
 
111
+ function getOverallOrderTrHeight(overallOrder) {
112
+ const { fields = [] } = overallOrder
113
+ const fontSize = fields?.[0]?.style?.fontSize || '12px'
114
+
115
+ // 12px => 26, 14px => 29, 16px => 33, ...
116
+ return (parseInt(fontSize) - 12) * 1.5 + 26
117
+ }
118
+
111
119
  // eslint-disable-next-line
112
120
  const coverDigit2Uppercase = n => {
113
121
  if (_.isNil(n) || _.isNaN(n)) {
@@ -274,6 +282,17 @@ const getArrayMid = arr => {
274
282
  return majority
275
283
  }
276
284
 
285
+ /**
286
+ * 获取整单合计colSpan合并的个数
287
+ * @param {*} table
288
+ * @returns number
289
+ */
290
+ const getColSpanLength = table => {
291
+ return /multi/.test(table.dataKey)
292
+ ? getMultiNumber(table.dataKey) * table.columns.length
293
+ : table.columns.length
294
+ }
295
+
277
296
  export {
278
297
  getHeight,
279
298
  getWidth,
@@ -291,5 +310,7 @@ export {
291
310
  isMultiTable,
292
311
  getMultiNumber,
293
312
  caclSingleDetailsPageHeight,
294
- getArrayMid
313
+ getArrayMid,
314
+ getColSpanLength,
315
+ getOverallOrderTrHeight
295
316
  }