gm-printer 10.13.11 → 10.13.12-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"},{"size":9379,"mtime":1643448762149,"results":"19","hashOfConfig":"20"},{"size":12882,"mtime":1638178010006,"results":"21","hashOfConfig":"20"},{"size":4244,"mtime":1635494969691,"results":"22","hashOfConfig":"20"},{"size":3683,"mtime":1635851060224,"results":"23","hashOfConfig":"20"},{"size":616,"mtime":1621235314060,"results":"24","hashOfConfig":"25"},{"size":9693,"mtime":1621242097206,"results":"26","hashOfConfig":"25"},{"size":7258,"mtime":1639037857730,"results":"27","hashOfConfig":"20"},{"size":8733,"mtime":1635931829112,"results":"28","hashOfConfig":"20"},{"size":3119,"mtime":1634191808754,"results":"29","hashOfConfig":"20"},{"size":1113,"mtime":1635407660514,"results":"30","hashOfConfig":"20"},{"size":3905,"mtime":1635304242763},{"size":861,"mtime":1635246075403,"results":"31","hashOfConfig":"20"},{"size":3260,"mtime":1635334661529,"results":"32","hashOfConfig":"20"},{"size":24504,"mtime":1635908548975,"results":"33","hashOfConfig":"20"},{"size":1907,"mtime":1635492860490,"results":"34","hashOfConfig":"20"},{"size":3548,"mtime":1635409410379,"results":"35","hashOfConfig":"20"},{"size":2989,"mtime":1635495718901,"results":"36","hashOfConfig":"20"},{"size":3465,"mtime":1635495798948,"results":"37","hashOfConfig":"20"},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","errorCount":2,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/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_shadow_dom.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js",["72","73","74","75","76","77","78","79","80","81","82","83","84"],"/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",["85","86"],{"ruleId":"87","severity":2,"message":"88","line":47,"column":13,"nodeType":"89","messageId":"90","endLine":47,"endColumn":22},{"ruleId":"87","severity":2,"message":"91","line":48,"column":30,"nodeType":"92","messageId":"90","endLine":48,"endColumn":36},{"ruleId":"87","severity":2,"message":"93","line":49,"column":31,"nodeType":"92","messageId":"90","endLine":49,"endColumn":47},{"ruleId":"87","severity":2,"message":"93","line":50,"column":21,"nodeType":"92","messageId":"90","endLine":50,"endColumn":37},{"ruleId":"87","severity":2,"message":"88","line":56,"column":13,"nodeType":"89","messageId":"90","endLine":56,"endColumn":22},{"ruleId":"87","severity":2,"message":"94","line":59,"column":20,"nodeType":"92","messageId":"90","endLine":59,"endColumn":32},{"ruleId":"87","severity":2,"message":"91","line":61,"column":23,"nodeType":"92","messageId":"90","endLine":61,"endColumn":29},{"ruleId":"87","severity":2,"message":"95","line":61,"column":30,"nodeType":"92","messageId":"90","endLine":61,"endColumn":34},{"ruleId":"87","severity":2,"message":"96","line":63,"column":15,"nodeType":"92","messageId":"90","endLine":63,"endColumn":19},{"ruleId":"87","severity":2,"message":"88","line":67,"column":23,"nodeType":"89","messageId":"90","endLine":67,"endColumn":32},{"ruleId":"87","severity":2,"message":"91","line":70,"column":32,"nodeType":"92","messageId":"90","endLine":70,"endColumn":38},{"ruleId":"87","severity":2,"message":"88","line":78,"column":13,"nodeType":"89","messageId":"90","endLine":78,"endColumn":22},{"ruleId":"87","severity":2,"message":"91","line":84,"column":42,"nodeType":"92","messageId":"90","endLine":84,"endColumn":48},{"ruleId":"97","severity":2,"message":"98","line":64,"column":11,"nodeType":"92","endLine":64,"endColumn":17},{"ruleId":"97","severity":2,"message":"99","line":102,"column":24,"nodeType":"92","endLine":102,"endColumn":32},"react/prop-types","'editStore' is missing in props validation","Property","missingPropType","'editStore.config' is missing in props validation","Identifier","'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","no-unused-vars","'keyArr' is assigned a value but never used.","'mockData' is assigned a value but never used."]
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"},{"size":7133,"mtime":1638862566087,"results":"42","hashOfConfig":"43"},{"size":291,"mtime":1638935573926,"results":"44","hashOfConfig":"43"},{"size":523,"mtime":1638935549030,"results":"45","hashOfConfig":"43"},{"size":1139,"mtime":1644572548725,"results":"46","hashOfConfig":"47"},{"size":2293,"mtime":1638948548042,"results":"48","hashOfConfig":"43"},{"size":2292,"mtime":1638948522492,"results":"49","hashOfConfig":"43"},{"size":1078,"mtime":1638948543271,"results":"50","hashOfConfig":"43"},{"size":2040,"mtime":1638948515902,"results":"51","hashOfConfig":"43"},{"size":2991,"mtime":1638948535719,"results":"52","hashOfConfig":"43"},{"size":4379,"mtime":1638935458586,"results":"53","hashOfConfig":"43"},{"size":2521,"mtime":1638948507982,"results":"54","hashOfConfig":"43"},{"size":2943,"mtime":1638948502114,"results":"55","hashOfConfig":"43"},{"size":3732,"mtime":1639722598379,"results":"56","hashOfConfig":"43"},{"size":2833,"mtime":1638861837310,"results":"57","hashOfConfig":"43"},{"size":4212,"mtime":1638935746667,"results":"58","hashOfConfig":"43"},{"size":861,"mtime":1638931446915,"results":"59","hashOfConfig":"43"},{"size":178,"mtime":1638931439249,"results":"60","hashOfConfig":"43"},{"size":3272,"mtime":1638931374761,"results":"61","hashOfConfig":"43"},{"size":22984,"mtime":1639993458515,"results":"62","hashOfConfig":"43"},{"size":4898,"mtime":1639992402586,"results":"63","hashOfConfig":"43"},{"size":13268,"mtime":1638930638946,"results":"64","hashOfConfig":"43"},{"size":14787,"mtime":1638948621474,"results":"65","hashOfConfig":"43"},{"size":2165,"mtime":1638949854481,"results":"66","hashOfConfig":"43"},{"size":2165,"mtime":1638949840121,"results":"67","hashOfConfig":"43"},{"size":2223,"mtime":1638949823846,"results":"68","hashOfConfig":"43"},{"size":2226,"mtime":1638949842800,"results":"69","hashOfConfig":"43"},{"size":3367,"mtime":1638949855771,"results":"70","hashOfConfig":"43"},{"size":2305,"mtime":1638949843817,"results":"71","hashOfConfig":"43"},{"size":3294,"mtime":1638949855131,"results":"72","hashOfConfig":"43"},{"size":2850,"mtime":1638949842017,"results":"73","hashOfConfig":"43"},{"size":4157,"mtime":1638949853726,"results":"74","hashOfConfig":"43"},{"size":605,"mtime":1638949882777,"results":"75","hashOfConfig":"43"},{"size":1175,"mtime":1638949720500,"results":"76","hashOfConfig":"43"},{"size":14644,"mtime":1644994596691,"results":"77","hashOfConfig":"47"},{"size":332,"mtime":1644573509040,"results":"78","hashOfConfig":"47"},{"size":3936,"mtime":1644907222767,"results":"79","hashOfConfig":"47"},{"size":8842,"mtime":1646363892377,"results":"80","hashOfConfig":"47"},{"size":4317,"mtime":1646376602197,"results":"81","hashOfConfig":"47"},{"size":9440,"mtime":1644993553716,"results":"82","hashOfConfig":"47"},{"size":724,"mtime":1644808940649,"results":"83","hashOfConfig":"47"},{"size":1763,"mtime":1646363840977,"results":"84","hashOfConfig":"47"},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"jpc0be",{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1qaimc",{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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":2,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"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":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"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":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"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},"/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",["167","168"],"/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",["169","170","171"],"/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",["172"],"/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",[],{"ruleId":"173","severity":2,"message":"174","line":10,"column":29,"nodeType":"175","endLine":10,"endColumn":35},{"ruleId":"173","severity":2,"message":"176","line":145,"column":63,"nodeType":"175","endLine":145,"endColumn":71},{"ruleId":"177","severity":1,"message":"178","line":265,"column":13,"nodeType":"179","endLine":265,"endColumn":49},{"ruleId":"177","severity":1,"message":"178","line":283,"column":13,"nodeType":"179","endLine":283,"endColumn":56},{"ruleId":"180","severity":2,"message":"181","line":436,"column":22,"nodeType":"182","messageId":"183","endLine":436,"endColumn":31},{"ruleId":"180","severity":2,"message":"181","line":120,"column":14,"nodeType":"182","messageId":"183","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"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.13.11",
3
+ "version": "10.13.12-alpha.2",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import Printer from '../finance_printer'
3
+ import _ from 'lodash'
4
+ import PropTypes from 'prop-types'
5
+
6
+ class BatchPrinter extends React.Component {
7
+ constructor(props) {
8
+ super(props)
9
+ this.ready = 0
10
+ }
11
+
12
+ handleReady = () => {
13
+ this.ready++
14
+ if (this.ready === this.props.list.length) {
15
+ this.props.onReady()
16
+ }
17
+ }
18
+
19
+ render() {
20
+ const { list } = this.props
21
+ return _.map(list, ({ config, data }, i) => (
22
+ <Printer key={i} data={data} config={config} onReady={this.handleReady} />
23
+ ))
24
+ }
25
+ }
26
+
27
+ BatchPrinter.propTypes = {
28
+ list: PropTypes.array.isRequired,
29
+ onReady: PropTypes.func
30
+ }
31
+
32
+ BatchPrinter.defaultProps = {
33
+ onReady: _.noop
34
+ }
35
+
36
+ export default BatchPrinter
@@ -0,0 +1,343 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import _ from 'lodash'
4
+ import {
5
+ dispatchMsg,
6
+ getDataKey,
7
+ getHeight,
8
+ getMultiNumber,
9
+ getTableColumnName,
10
+ getWidth,
11
+ isMultiTable
12
+ } from '../../util'
13
+ import { inject, observer } from 'mobx-react'
14
+ import classNames from 'classnames'
15
+ import { MULTI_SUFFIX } from '../../config'
16
+ import SpecialTr from '../../printer/table_special_tr'
17
+ import SubtotalTr from './table_subtotal_tr'
18
+ import PageSummary from '../../printer/page_summary'
19
+
20
+ @inject('printerStore')
21
+ @observer
22
+ class Table extends React.Component {
23
+ constructor(props) {
24
+ super(props)
25
+ this.ref = React.createRef()
26
+ this.state = {
27
+ index: null
28
+ }
29
+ }
30
+
31
+ componentDidMount() {
32
+ const { name, printerStore } = this.props
33
+
34
+ if (!printerStore.ready) {
35
+ const $table = this.ref.current.querySelector('table')
36
+ const tHead = $table.querySelector('thead')
37
+ const ths = tHead.querySelectorAll('th') || []
38
+ const trs = $table.querySelectorAll('tbody tr') || []
39
+ const detailsDiv = $table.querySelectorAll('tr td .b-table-details')
40
+
41
+ printerStore.setHeight(name, getHeight($table))
42
+
43
+ printerStore.setTable(name, {
44
+ head: {
45
+ height: getHeight(tHead),
46
+ widths: _.map(ths, th => getWidth(th))
47
+ },
48
+ body: {
49
+ heights: _.map(trs, tr => getHeight(tr)),
50
+ children: _.map(detailsDiv, div => getHeight(div))
51
+ }
52
+ })
53
+ }
54
+ }
55
+
56
+ handleClick = e => {
57
+ const { name } = this.props
58
+ const { index } = e.target.dataset
59
+
60
+ dispatchMsg('gm-printer-select', {
61
+ selected: getTableColumnName(name, index)
62
+ })
63
+ }
64
+
65
+ handleDragStart = e => {
66
+ const { name } = this.props
67
+ const { index } = e.target.dataset
68
+
69
+ this.setState({
70
+ index
71
+ })
72
+
73
+ dispatchMsg('gm-printer-select', {
74
+ selected: getTableColumnName(name, index)
75
+ })
76
+ }
77
+
78
+ handleSelectedRegion = () => {
79
+ const { name } = this.props
80
+
81
+ dispatchMsg('gm-printer-select-region', { selected: name })
82
+ }
83
+
84
+ handleDrop = e => {
85
+ const { index } = e.target.dataset
86
+
87
+ if (this.state.index !== index) {
88
+ dispatchMsg('gm-printer-table-drag', {
89
+ source: this.state.index,
90
+ target: index
91
+ })
92
+ }
93
+ }
94
+
95
+ handleDragOver = e => {
96
+ e.preventDefault()
97
+ }
98
+
99
+ getColumns = () => {
100
+ const {
101
+ config: { columns, dataKey }
102
+ } = this.props
103
+ const columns1 = columns.map((val, index) => ({ ...val, index }))
104
+ // 如果是多列表格
105
+ if (isMultiTable(dataKey)) {
106
+ // 多栏商品的第二列有点特殊,都带 _MULTI_SUFFIX 后缀
107
+ let res = columns1
108
+ const colNumber = getMultiNumber(dataKey)
109
+ for (let i = 2; i <= colNumber; i++) {
110
+ const colNum = i > 2 ? i : '' // 栏数
111
+ const columnsI = columns.map((val, index) => {
112
+ const data = {
113
+ ...val,
114
+ index,
115
+ text: val.text.replace(
116
+ /{{(price\()?列\.([^{{]+)}}/g,
117
+ (s, s1, s2) => {
118
+ if (s1) {
119
+ // 有price函数插进来
120
+ const mix_suffix = s2.replace(/\*/, () => `${MULTI_SUFFIX}*`)
121
+ return `{{${s1}列.${mix_suffix}${colNum}}}`
122
+ } else {
123
+ return `{{列.${s2}${MULTI_SUFFIX}${colNum}}}`
124
+ }
125
+ }
126
+ ) // {{列.xx}} => {{列.xxMULTI_SUFFIXi}}
127
+ }
128
+ // 多栏商品的明细取 __details_MULTI_SUFFIX
129
+ if (val.specialDetailsKey)
130
+ data.specialDetailsKey =
131
+ val.specialDetailsKey + `${MULTI_SUFFIX}${colNum}`
132
+ return data
133
+ })
134
+ res = res.concat(columnsI)
135
+ }
136
+ return res
137
+ } else {
138
+ return columns1
139
+ }
140
+ }
141
+
142
+ renderDefault() {
143
+ let {
144
+ config,
145
+ config: { dataKey, arrange, customerRowHeight = 23 },
146
+ name,
147
+ range,
148
+ pageIndex,
149
+ printerStore
150
+ } = this.props
151
+
152
+ // 数据
153
+ dataKey = getDataKey(dataKey, arrange)
154
+ const tableData = printerStore.data._table[dataKey] || []
155
+
156
+ // 列
157
+ const columns = this.getColumns()
158
+ // 列宽固定(避免跳页bug)
159
+ const thWidths = printerStore.tablesInfo[name]?.head.widths || []
160
+ // 每页合计在前
161
+ const subtotalTrPageSummary = () => {
162
+ return (
163
+ <>
164
+ <SubtotalTr
165
+ range={range}
166
+ config={config}
167
+ printerStore={printerStore}
168
+ />
169
+ <PageSummary {...this.props} />
170
+ </>
171
+ )
172
+ }
173
+ // 合计在前
174
+ const PageSummarySubtotalTr = () => {
175
+ return (
176
+ <>
177
+ <PageSummary {...this.props} />
178
+ <SubtotalTr
179
+ range={range}
180
+ config={config}
181
+ printerStore={printerStore}
182
+ />
183
+ </>
184
+ )
185
+ }
186
+ const getTdStyle = (index, style = {}) => {
187
+ const width = thWidths[index]
188
+ const { fontSize } = style
189
+ let tdStyle = {}
190
+ let minWidth = 24
191
+
192
+ if (!width) return tdStyle
193
+ if (fontSize) minWidth = _.parseInt(fontSize) * 2
194
+ if (width >= 150) {
195
+ tdStyle = {
196
+ minWidth: width
197
+ }
198
+ } else {
199
+ tdStyle = {
200
+ minWidth,
201
+ width
202
+ }
203
+ }
204
+ return tdStyle
205
+ }
206
+
207
+ return (
208
+ <table>
209
+ <thead>
210
+ <tr style={{ height: `${customerRowHeight}px` }}>
211
+ {_.map(columns, (col, i) => (
212
+ <th
213
+ key={i}
214
+ data-index={col.index}
215
+ data-name={getTableColumnName(name, col.index)}
216
+ draggable
217
+ style={{
218
+ ...getTdStyle(i, col.headStyle),
219
+ ...col.headStyle
220
+ }}
221
+ className={classNames({
222
+ active:
223
+ getTableColumnName(name, col.index) ===
224
+ printerStore.selected
225
+ })}
226
+ onClick={this.handleClick}
227
+ onDragStart={this.handleDragStart}
228
+ onDrop={this.handleDrop}
229
+ onDragOver={this.handleDragOver}
230
+ >
231
+ {col.head}
232
+ </th>
233
+ ))}
234
+ </tr>
235
+ </thead>
236
+ <tbody>
237
+ {_.map(_.range(range.begin, range.end), i => {
238
+ const _special = tableData[i] && tableData[i]._special
239
+ if (_special)
240
+ return <SpecialTr key={i} config={config} data={_special} />
241
+ // 如果项为空对象展现一个占满一行的td
242
+ const isItemNone = !_.keys(tableData[i]).length
243
+
244
+ return (
245
+ <tr style={{ height: `${customerRowHeight}px` }} key={i}>
246
+ {isItemNone ? (
247
+ <td colSpan='99' />
248
+ ) : (
249
+ _.map(columns, (col, j) => {
250
+ return (
251
+ <td
252
+ key={j}
253
+ data-name={getTableColumnName(name, col.index)}
254
+ style={{
255
+ ...getTdStyle(j, col.style),
256
+ ...col.style
257
+ }}
258
+ className={classNames({
259
+ active:
260
+ getTableColumnName(name, col.index) ===
261
+ printerStore.selected
262
+ })}
263
+ dangerouslySetInnerHTML={{
264
+ __html: col.isSpecialColumn
265
+ ? printerStore.templateSpecialDetails(
266
+ col,
267
+ dataKey,
268
+ i
269
+ )
270
+ : printerStore
271
+ .templateFinance(
272
+ col.text,
273
+ dataKey,
274
+ i,
275
+ pageIndex
276
+ )
277
+ .replace(/\(\)/g, '')
278
+ }}
279
+ />
280
+ )
281
+ })
282
+ )}
283
+ </tr>
284
+ )
285
+ })}
286
+ {this.props.config.subtotal.isCommutationPlace
287
+ ? PageSummarySubtotalTr()
288
+ : subtotalTrPageSummary()}
289
+ </tbody>
290
+ </table>
291
+ )
292
+ }
293
+
294
+ renderEmptyTable() {
295
+ return (
296
+ <table>
297
+ <thead />
298
+ <tbody>
299
+ <tr />
300
+ </tbody>
301
+ </table>
302
+ )
303
+ }
304
+
305
+ render() {
306
+ let {
307
+ config: { className, dataKey, arrange },
308
+ name,
309
+ placeholder,
310
+ printerStore
311
+ } = this.props
312
+ dataKey = getDataKey(dataKey, arrange)
313
+ const tableData = printerStore.data._table[dataKey] || []
314
+ const active = printerStore.selectedRegion === name
315
+
316
+ return (
317
+ <div
318
+ ref={this.ref}
319
+ className={classNames(
320
+ 'gm-printer-table',
321
+ 'gm-printer-table-classname-' + (className || 'default'),
322
+ { active }
323
+ )}
324
+ data-name={name}
325
+ data-placeholder={placeholder}
326
+ onClick={this.handleSelectedRegion}
327
+ >
328
+ {tableData.length ? this.renderDefault() : this.renderEmptyTable()}
329
+ </div>
330
+ )
331
+ }
332
+ }
333
+
334
+ Table.propTypes = {
335
+ config: PropTypes.object.isRequired,
336
+ name: PropTypes.string.isRequired,
337
+ range: PropTypes.object.isRequired,
338
+ pageIndex: PropTypes.number.isRequired,
339
+ placeholder: PropTypes.string,
340
+ printerStore: PropTypes.object
341
+ }
342
+
343
+ export default Table
@@ -0,0 +1,147 @@
1
+ import React from 'react'
2
+ import i18next from '../../../locales'
3
+ import PropTypes from 'prop-types'
4
+ import _ from 'lodash'
5
+ import { MULTI_SUFFIX } from '../../config'
6
+ import Big from 'big.js'
7
+ import { coverDigit2Uppercase, getDataKey } from '../../util'
8
+ import { observer } from 'mobx-react'
9
+ import { get } from 'mobx'
10
+
11
+ /**
12
+ * 每页合计组件,分页计算后,根据range来统计每页合计数据
13
+ * @param props
14
+ * @returns {*}
15
+ */
16
+ const SubtotalTr = props => {
17
+ const {
18
+ config: {
19
+ dataKey,
20
+ arrange,
21
+ subtotal,
22
+ subtotal: {
23
+ show,
24
+ isUpperCaseBefore, // 决定小写金额是否在前
25
+ isUpperLowerCaseSeparate, // 决定大小写金额是否分开在两端
26
+ style,
27
+ fields = [
28
+ {
29
+ name: i18next.t('出库金额'),
30
+ valueField: 'real_item_price'
31
+ }
32
+ ],
33
+ displayName = false // 是否展示字段名
34
+ }
35
+ },
36
+ range,
37
+ printerStore: {
38
+ config: {
39
+ financeSpecialConfig: {
40
+ CapitalPrefix = '大写',
41
+ LowercasePrefix = '小写'
42
+ }
43
+ }
44
+ },
45
+ printerStore
46
+ } = props
47
+ const tableData = printerStore.data._table[getDataKey(dataKey, arrange)] || []
48
+ // 计算合计
49
+ const sumData = (list, field) => {
50
+ return _.reduce(
51
+ list,
52
+ (a, b) => {
53
+ let result = a
54
+
55
+ const _origin = b._origin || {}
56
+ const _origin2 = b['_origin' + MULTI_SUFFIX] || {}
57
+
58
+ result = a.plus(_origin[field] || 0)
59
+ if (_origin2[field]) {
60
+ result = result.plus(_origin2[field])
61
+ }
62
+ return result
63
+ },
64
+ Big(0)
65
+ ).toFixed(2)
66
+ }
67
+
68
+ // 每页小计
69
+ // show 是否展示小计,fields<Array> 合计的字段和展现的name,displayName 是否显示名字
70
+ if (show && printerStore.ready) {
71
+ const list = tableData.slice(range.begin, range.end)
72
+
73
+ const sum = {}
74
+
75
+ _.each(fields, v => {
76
+ sum[v.name] = sumData(list, v.valueField)
77
+ })
78
+
79
+ // 定义每页小记的左右两侧内容
80
+ let subtotalLeftContent
81
+ let subtotalRightContent
82
+
83
+ for (const name in sum) {
84
+ const price = sum[name]
85
+ const priceUpperCase = get(subtotal, 'needUpperCase') // needUpperCase在初始模板中undefined,所以必须用这个方法
86
+ ? coverDigit2Uppercase(price)
87
+ : ''
88
+ if (displayName) {
89
+ // 大写金额是否在前
90
+ if (isUpperCaseBefore) {
91
+ subtotalLeftContent = `${name}${priceUpperCase}`
92
+ subtotalRightContent = `(${LowercasePrefix || '小写'}:¥${price})`
93
+ } else {
94
+ subtotalLeftContent = `(${LowercasePrefix || '小写'}:¥${price})`
95
+ subtotalRightContent = `${name} ${priceUpperCase}`
96
+ }
97
+ } else {
98
+ if (isUpperCaseBefore) {
99
+ subtotalLeftContent = `${priceUpperCase}`
100
+ subtotalRightContent = `(${LowercasePrefix || '小写'}:¥${price})`
101
+ } else {
102
+ subtotalLeftContent = `(${LowercasePrefix || '小写'}:¥${price})`
103
+ subtotalRightContent = `${priceUpperCase}`
104
+ }
105
+ }
106
+ }
107
+
108
+ return (
109
+ <tr>
110
+ <td colSpan={99} style={{ ...style, height: '8mm' }}>
111
+ {/* 大写金额和小写金额分开在表格的两侧,通过控制类名实现,添加类名后,覆盖原来的居中、靠右靠左 */}
112
+ <div
113
+ className={
114
+ isUpperLowerCaseSeparate
115
+ ? 'gm-printer-subtotal-UpperLowerCaseSeparate-outer'
116
+ : ''
117
+ }
118
+ style={{ margin: '0 30px' }}
119
+ >
120
+ {i18next.t(`${CapitalPrefix || '大写'}:`)}
121
+ {/* {i18next.t('每页合计')}: */}
122
+ <span
123
+ className={
124
+ isUpperLowerCaseSeparate
125
+ ? 'gm-printer-subtotal-UpperLowerCaseSeparate-inter'
126
+ : ''
127
+ }
128
+ >
129
+ <span>&nbsp;&nbsp;{subtotalLeftContent}&nbsp;&nbsp;</span>
130
+ <span>&nbsp;&nbsp;{subtotalRightContent}&nbsp;&nbsp;</span>
131
+ </span>
132
+ </div>
133
+ </td>
134
+ </tr>
135
+ )
136
+ } else {
137
+ return null
138
+ }
139
+ }
140
+
141
+ SubtotalTr.propTypes = {
142
+ config: PropTypes.object.isRequired,
143
+ range: PropTypes.object.isRequired,
144
+ printStore: PropTypes.object
145
+ }
146
+
147
+ export default observer(SubtotalTr)