gm-printer 10.14.1-alpha.1 → 10.14.1-alpha.4
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 +1 -1
- package/package.json +1 -1
- package/src/common/component.js +1 -1
- package/src/common/editor_customize_config.js +11 -8
- package/src/common/editor_edit_field.js +2 -2
- package/src/common/editor_store.js +46 -26
- package/src/editor/context_menu.js +18 -1
- package/src/printer/printer.js +27 -8
- package/src/printer/store.js +67 -14
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"},{"size":9379,"mtime":1643448762149,"results":"21","hashOfConfig":"22"},{"size":13614,"mtime":1646818931827,"results":"23","hashOfConfig":"22"},{"size":4244,"mtime":1635494969691,"results":"24","hashOfConfig":"22"},{"size":4144,"mtime":1646815943026,"results":"25","hashOfConfig":"22"},{"size":616,"mtime":1621235314060,"results":"26","hashOfConfig":"27"},{"size":9693,"mtime":1621242097206,"results":"28","hashOfConfig":"27"},{"size":7258,"mtime":1639037857730,"results":"29","hashOfConfig":"22"},{"size":9567,"mtime":1646818922036,"results":"30","hashOfConfig":"22"},{"size":3119,"mtime":1634191808754,"results":"31","hashOfConfig":"22"},{"size":1113,"mtime":1635407660514,"results":"32","hashOfConfig":"22"},{"size":4349,"mtime":1646815933499,"results":"33","hashOfConfig":"22"},{"size":861,"mtime":1635246075403,"results":"34","hashOfConfig":"22"},{"size":3260,"mtime":1635334661529,"results":"35","hashOfConfig":"22"},{"size":25789,"mtime":1646816593551,"results":"36","hashOfConfig":"22"},{"size":1907,"mtime":1635492860490,"results":"37","hashOfConfig":"22"},{"size":3548,"mtime":1635409410379,"results":"38","hashOfConfig":"22"},{"size":2989,"mtime":1635495718901,"results":"39","hashOfConfig":"22"},{"size":3399,"mtime":1646816404368,"results":"40","hashOfConfig":"22"},{"size":2456,"mtime":1646721857196,"results":"41","hashOfConfig":"22"},{"size":1215,"mtime":1646815645520,"results":"42","hashOfConfig":"22"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"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},{"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":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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},"/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",["83","84","85"],"/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",["86","87","88","89","90","91","92","93","94","95","96","97","98"],"/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",[],{"ruleId":"99","severity":2,"message":"100","line":10,"column":29,"nodeType":"101","endLine":10,"endColumn":35},{"ruleId":"99","severity":2,"message":"102","line":10,"column":43,"nodeType":"101","endLine":10,"endColumn":51},{"ruleId":"99","severity":2,"message":"102","line":147,"column":63,"nodeType":"101","endLine":147,"endColumn":71},{"ruleId":"99","severity":2,"message":"103","line":47,"column":13,"nodeType":"104","messageId":"105","endLine":47,"endColumn":22},{"ruleId":"99","severity":2,"message":"106","line":48,"column":30,"nodeType":"101","messageId":"105","endLine":48,"endColumn":36},{"ruleId":"99","severity":2,"message":"107","line":49,"column":31,"nodeType":"101","messageId":"105","endLine":49,"endColumn":47},{"ruleId":"99","severity":2,"message":"107","line":50,"column":21,"nodeType":"101","messageId":"105","endLine":50,"endColumn":37},{"ruleId":"99","severity":2,"message":"103","line":56,"column":13,"nodeType":"104","messageId":"105","endLine":56,"endColumn":22},{"ruleId":"99","severity":2,"message":"108","line":59,"column":20,"nodeType":"101","messageId":"105","endLine":59,"endColumn":32},{"ruleId":"99","severity":2,"message":"106","line":61,"column":23,"nodeType":"101","messageId":"105","endLine":61,"endColumn":29},{"ruleId":"99","severity":2,"message":"109","line":61,"column":30,"nodeType":"101","messageId":"105","endLine":61,"endColumn":34},{"ruleId":"99","severity":2,"message":"110","line":63,"column":15,"nodeType":"101","messageId":"105","endLine":63,"endColumn":19},{"ruleId":"99","severity":2,"message":"103","line":67,"column":23,"nodeType":"104","messageId":"105","endLine":67,"endColumn":32},{"ruleId":"99","severity":2,"message":"106","line":70,"column":32,"nodeType":"101","messageId":"105","endLine":70,"endColumn":38},{"ruleId":"99","severity":2,"message":"103","line":78,"column":13,"nodeType":"104","messageId":"105","endLine":78,"endColumn":22},{"ruleId":"99","severity":2,"message":"106","line":84,"column":42,"nodeType":"101","messageId":"105","endLine":84,"endColumn":48},"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"]
|
|
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"},{"size":9379,"mtime":1643448762149,"results":"23","hashOfConfig":"24"},{"size":15108,"mtime":1646982806457,"results":"25","hashOfConfig":"24"},{"size":4244,"mtime":1635494969691,"results":"26","hashOfConfig":"24"},{"size":4501,"mtime":1646970942704,"results":"27","hashOfConfig":"24"},{"size":616,"mtime":1621235314060,"results":"28","hashOfConfig":"29"},{"size":9693,"mtime":1621242097206,"results":"30","hashOfConfig":"29"},{"size":7258,"mtime":1639037857730,"results":"31","hashOfConfig":"24"},{"size":10283,"mtime":1646979851812,"results":"32","hashOfConfig":"24"},{"size":3119,"mtime":1634191808754,"results":"33","hashOfConfig":"24"},{"size":1113,"mtime":1635407660514,"results":"34","hashOfConfig":"24"},{"size":4349,"mtime":1646815933499,"results":"35","hashOfConfig":"24"},{"size":861,"mtime":1635246075403,"results":"36","hashOfConfig":"24"},{"size":3260,"mtime":1635334661529,"results":"37","hashOfConfig":"24"},{"size":26475,"mtime":1646982227981,"results":"38","hashOfConfig":"24"},{"size":1907,"mtime":1635492860490,"results":"39","hashOfConfig":"24"},{"size":3548,"mtime":1635409410379,"results":"40","hashOfConfig":"24"},{"size":2989,"mtime":1635495718901,"results":"41","hashOfConfig":"24"},{"size":3399,"mtime":1646816404368,"results":"42","hashOfConfig":"24"},{"size":2456,"mtime":1646721857196,"results":"43","hashOfConfig":"24"},{"size":1159,"mtime":1646970893747,"results":"44","hashOfConfig":"24"},{"size":13280,"mtime":1646901618757,"results":"45","hashOfConfig":"24"},{"size":14804,"mtime":1646895235712,"results":"46","hashOfConfig":"24"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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},"175njjo",{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"89","messages":"90","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",["91","92","93"],"/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",["94","95","96","97","98","99","100","101","102","103","104","105","106"],"/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",["107","108","109"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js",[],{"ruleId":"110","severity":2,"message":"111","line":10,"column":29,"nodeType":"112","endLine":10,"endColumn":35},{"ruleId":"110","severity":2,"message":"113","line":10,"column":43,"nodeType":"112","endLine":10,"endColumn":51},{"ruleId":"110","severity":2,"message":"113","line":147,"column":63,"nodeType":"112","endLine":147,"endColumn":71},{"ruleId":"110","severity":2,"message":"114","line":47,"column":13,"nodeType":"115","messageId":"116","endLine":47,"endColumn":22},{"ruleId":"110","severity":2,"message":"117","line":48,"column":30,"nodeType":"112","messageId":"116","endLine":48,"endColumn":36},{"ruleId":"110","severity":2,"message":"118","line":49,"column":31,"nodeType":"112","messageId":"116","endLine":49,"endColumn":47},{"ruleId":"110","severity":2,"message":"118","line":50,"column":21,"nodeType":"112","messageId":"116","endLine":50,"endColumn":37},{"ruleId":"110","severity":2,"message":"114","line":56,"column":13,"nodeType":"115","messageId":"116","endLine":56,"endColumn":22},{"ruleId":"110","severity":2,"message":"119","line":59,"column":20,"nodeType":"112","messageId":"116","endLine":59,"endColumn":32},{"ruleId":"110","severity":2,"message":"117","line":61,"column":23,"nodeType":"112","messageId":"116","endLine":61,"endColumn":29},{"ruleId":"110","severity":2,"message":"120","line":61,"column":30,"nodeType":"112","messageId":"116","endLine":61,"endColumn":34},{"ruleId":"110","severity":2,"message":"121","line":63,"column":15,"nodeType":"112","messageId":"116","endLine":63,"endColumn":19},{"ruleId":"110","severity":2,"message":"114","line":67,"column":23,"nodeType":"115","messageId":"116","endLine":67,"endColumn":32},{"ruleId":"110","severity":2,"message":"117","line":70,"column":32,"nodeType":"112","messageId":"116","endLine":70,"endColumn":38},{"ruleId":"110","severity":2,"message":"114","line":78,"column":13,"nodeType":"115","messageId":"116","endLine":78,"endColumn":22},{"ruleId":"110","severity":2,"message":"117","line":84,"column":42,"nodeType":"112","messageId":"116","endLine":84,"endColumn":48},{"ruleId":"122","severity":1,"message":"123","line":265,"column":13,"nodeType":"124","endLine":265,"endColumn":49},{"ruleId":"122","severity":1,"message":"123","line":283,"column":13,"nodeType":"124","endLine":283,"endColumn":56},{"ruleId":"125","severity":2,"message":"126","line":436,"column":22,"nodeType":"127","messageId":"128","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
package/src/common/component.js
CHANGED
|
@@ -13,19 +13,22 @@ class EditorCutomizedConfig extends React.Component {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
render() {
|
|
16
|
-
/** !!!注: 不要删除config, 否则会影响mobx的动态监听(PS: 感觉像是mobx的bug?) */
|
|
17
16
|
const {
|
|
18
17
|
editStore,
|
|
19
18
|
editStore: { isAutoFilling }
|
|
20
19
|
} = this.props
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (editStore.computedRegionIsTable && !specialConfig) {
|
|
20
|
+
// 是table
|
|
21
|
+
if (editStore.computedRegionIsTable) {
|
|
24
22
|
return (
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
<>
|
|
24
|
+
<Flex alignCenter className='gm-padding-top-5'>
|
|
25
|
+
<div>{i18next.t('行数是否自动填充')}:</div>
|
|
26
|
+
<Switch checked={isAutoFilling} onChange={this.handleAutoFilling} />
|
|
27
|
+
</Flex>
|
|
28
|
+
<Flex className='gm-padding-top-5 gm-text-red' column>
|
|
29
|
+
{i18next.t('注意:填充仅支持单栏数据使用')}
|
|
30
|
+
</Flex>
|
|
31
|
+
</>
|
|
29
32
|
)
|
|
30
33
|
} else {
|
|
31
34
|
return null
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
Title,
|
|
16
16
|
TipInfo
|
|
17
17
|
} from '../common/component'
|
|
18
|
-
import { get } from 'mobx'
|
|
18
|
+
import { get, toJS } from 'mobx'
|
|
19
19
|
import PropTypes from 'prop-types'
|
|
20
20
|
|
|
21
21
|
@inject('editStore')
|
|
@@ -184,7 +184,7 @@ class EditorField extends React.Component {
|
|
|
184
184
|
const { specialConfig, subtotal } = editStore.computedTableSpecialConfig
|
|
185
185
|
// 小计样式,specialConfig可能是undefined
|
|
186
186
|
const specialStyle =
|
|
187
|
-
editStore.computedTableSpecialConfig?.specialConfig?.style || {}
|
|
187
|
+
toJS(editStore.computedTableSpecialConfig)?.specialConfig?.style || {}
|
|
188
188
|
// 小计是否大写
|
|
189
189
|
const specialTrNeedUpperCase =
|
|
190
190
|
(specialConfig && specialConfig.needUpperCase) || false
|
|
@@ -5,8 +5,6 @@ import _ from 'lodash'
|
|
|
5
5
|
import { dispatchMsg, getBlockName, exchange } from '../util'
|
|
6
6
|
import React from 'react'
|
|
7
7
|
|
|
8
|
-
/** 默认填充的tr高度为23px */
|
|
9
|
-
const TR_HEIGHT = 23
|
|
10
8
|
class EditorStore {
|
|
11
9
|
@observable
|
|
12
10
|
tableCustomStyle = 'default'
|
|
@@ -110,8 +108,12 @@ class EditorStore {
|
|
|
110
108
|
|
|
111
109
|
@action
|
|
112
110
|
getFilledTableData(tableData) {
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
const { autoFillConfig } = this.config
|
|
112
|
+
if (!this.selectedRegion && !autoFillConfig?.checked) return []
|
|
113
|
+
const tr_count = Math.floor(
|
|
114
|
+
this.remainPageHeihgt / this.computedTableCustomerRowHeight
|
|
115
|
+
)
|
|
116
|
+
|
|
115
117
|
const filledData = {
|
|
116
118
|
_isEmptyData: true // 表示是填充的空白数据
|
|
117
119
|
}
|
|
@@ -123,18 +125,26 @@ class EditorStore {
|
|
|
123
125
|
|
|
124
126
|
@action.bound
|
|
125
127
|
handleChangeTableData(isAutoFilling = false) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
const { autoFillConfig } = this.config
|
|
129
|
+
if (!this.selectedRegion && !autoFillConfig?.checked) return
|
|
130
|
+
const dataKey =
|
|
131
|
+
this.computedTableSpecialConfig?.dataKey || autoFillConfig?.dataKey
|
|
128
132
|
const table = this.mockData._table[dataKey]
|
|
129
133
|
this.setAutoFillingConfig(isAutoFilling)
|
|
134
|
+
|
|
130
135
|
if (isAutoFilling) {
|
|
131
136
|
table.push(...this.getFilledTableData(table))
|
|
132
137
|
} else {
|
|
133
138
|
this.clearExtraTableData(dataKey)
|
|
134
|
-
this.setAutoFillRemainPage({ isAutoFilling: isAutoFilling })
|
|
135
139
|
return
|
|
136
140
|
}
|
|
137
|
-
this.
|
|
141
|
+
set(this.config, {
|
|
142
|
+
autoFillConfig: {
|
|
143
|
+
region: this.selectedRegion,
|
|
144
|
+
dataKey,
|
|
145
|
+
checked: isAutoFilling
|
|
146
|
+
}
|
|
147
|
+
})
|
|
138
148
|
this.mockData._table[dataKey] = table
|
|
139
149
|
}
|
|
140
150
|
|
|
@@ -645,7 +655,7 @@ class EditorStore {
|
|
|
645
655
|
addFieldToTable({ key, value }) {
|
|
646
656
|
if (this.computedRegionIsTable) {
|
|
647
657
|
const arr = this.selectedRegion.split('.')
|
|
648
|
-
const { columns } = this.config.contents[arr[2]]
|
|
658
|
+
const { columns, dataKey } = this.config.contents[arr[2]]
|
|
649
659
|
|
|
650
660
|
columns.push({
|
|
651
661
|
head: key,
|
|
@@ -657,6 +667,9 @@ class EditorStore {
|
|
|
657
667
|
textAlign: 'center'
|
|
658
668
|
}
|
|
659
669
|
})
|
|
670
|
+
|
|
671
|
+
this.clearExtraTableData(dataKey)
|
|
672
|
+
this.setAutoFillingConfig(false)
|
|
660
673
|
}
|
|
661
674
|
}
|
|
662
675
|
|
|
@@ -751,6 +764,7 @@ class EditorStore {
|
|
|
751
764
|
table.dataKey = dataKey
|
|
752
765
|
// 改变dataKey后做副作用action
|
|
753
766
|
this.setTableDataKeyEffect(table, dataKey)
|
|
767
|
+
this.clearAllTableEmptyData()
|
|
754
768
|
}
|
|
755
769
|
}
|
|
756
770
|
|
|
@@ -775,6 +789,7 @@ class EditorStore {
|
|
|
775
789
|
return height === undefined ? 23 : height
|
|
776
790
|
}
|
|
777
791
|
}
|
|
792
|
+
return 23
|
|
778
793
|
}
|
|
779
794
|
|
|
780
795
|
@action.bound
|
|
@@ -786,6 +801,9 @@ class EditorStore {
|
|
|
786
801
|
...this.config.contents[arr[2]],
|
|
787
802
|
customerRowHeight: val
|
|
788
803
|
}
|
|
804
|
+
// // 用于触发printer更新最新的剩余高度
|
|
805
|
+
// this.setLineHeight(val)
|
|
806
|
+
this.setAutoFillingConfig(false)
|
|
789
807
|
}
|
|
790
808
|
}
|
|
791
809
|
}
|
|
@@ -977,20 +995,20 @@ class EditorStore {
|
|
|
977
995
|
}
|
|
978
996
|
|
|
979
997
|
// 设置是否自动填充空白
|
|
980
|
-
@action.bound
|
|
981
|
-
setAutoFillRemainPage(modify) {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
998
|
+
// @action.bound
|
|
999
|
+
// setAutoFillRemainPage(modify) {
|
|
1000
|
+
// if (this.computedRegionIsTable) {
|
|
1001
|
+
// const tableConfig = this.computedTableSpecialConfig
|
|
1002
|
+
// const extraSpecialConfig = tableConfig.extraSpecialConfig
|
|
1003
|
+
// if (extraSpecialConfig) {
|
|
1004
|
+
// set(extraSpecialConfig, modify)
|
|
1005
|
+
// } else {
|
|
1006
|
+
// set(tableConfig, { extraSpecialConfig: { ...modify } })
|
|
1007
|
+
// }
|
|
1008
|
+
// }
|
|
1009
|
+
// // 这么写才会触发子组件的更新
|
|
1010
|
+
// this.config = Object.assign({}, this.config)
|
|
1011
|
+
// }
|
|
994
1012
|
|
|
995
1013
|
@action.bound
|
|
996
1014
|
setSummaryConfig(modify) {
|
|
@@ -1009,15 +1027,17 @@ class EditorStore {
|
|
|
1009
1027
|
}
|
|
1010
1028
|
set(config, { summaryConfig: { ...init, ...modify } })
|
|
1011
1029
|
}
|
|
1012
|
-
|
|
1013
1030
|
if ('pageSummaryShow' in modify || 'totalSummaryShow' in modify) {
|
|
1014
1031
|
// 切换的时候,要把对应table的多余空数据清掉
|
|
1015
1032
|
this.clearExtraTableData(config.dataKey)
|
|
1016
1033
|
}
|
|
1017
|
-
|
|
1018
1034
|
this.config = toJS(this.config)
|
|
1019
1035
|
}
|
|
1020
|
-
|
|
1036
|
+
|
|
1037
|
+
// 如果只是勾选要展示的合计类目的选项,则不需要执行以下操作, 否则会重复清空数据
|
|
1038
|
+
if (!('summaryColumns' in modify && 'style' in modify)) {
|
|
1039
|
+
this.setAutoFillingConfig(false)
|
|
1040
|
+
}
|
|
1021
1041
|
}
|
|
1022
1042
|
}
|
|
1023
1043
|
|
|
@@ -22,6 +22,22 @@ const blockTypeList = [
|
|
|
22
22
|
@inject('editStore')
|
|
23
23
|
@observer
|
|
24
24
|
class ContextMenu extends React.Component {
|
|
25
|
+
componentDidMount() {
|
|
26
|
+
const {
|
|
27
|
+
editStore,
|
|
28
|
+
editStore: {
|
|
29
|
+
config: { autoFillConfig }
|
|
30
|
+
}
|
|
31
|
+
} = this.props
|
|
32
|
+
|
|
33
|
+
if (autoFillConfig?.checked) {
|
|
34
|
+
editStore.handleChangeTableData(
|
|
35
|
+
autoFillConfig?.checked,
|
|
36
|
+
autoFillConfig?.dataKey
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
25
41
|
/**
|
|
26
42
|
* 是否存在每页合计按钮,非异常明细才有按钮
|
|
27
43
|
* @param name => ContextMenu 的 this.state.name
|
|
@@ -127,9 +143,10 @@ class ContextMenu extends React.Component {
|
|
|
127
143
|
selected={editStore.selected}
|
|
128
144
|
selectedRegion={editStore.selectedRegion}
|
|
129
145
|
isAutoFilling={editStore.isAutoFilling}
|
|
146
|
+
lineheight={editStore.computedTableCustomerRowHeight}
|
|
130
147
|
config={editStore.config}
|
|
131
148
|
data={editStore.mockData}
|
|
132
|
-
|
|
149
|
+
getremainpageHeight={editStore.setRemainPageHeight}
|
|
133
150
|
/>
|
|
134
151
|
</CommonContextMenu>
|
|
135
152
|
)
|
package/src/printer/printer.js
CHANGED
|
@@ -76,10 +76,15 @@ class Printer extends React.Component {
|
|
|
76
76
|
await this.props.printerStore.setReady(true)
|
|
77
77
|
await this.props.printerStore.computedPages()
|
|
78
78
|
}
|
|
79
|
+
if (nextProps.lineheight !== this.props.lineheight) {
|
|
80
|
+
await this.props.getremainpageHeight(
|
|
81
|
+
this.props.printerStore.remainPageHeight
|
|
82
|
+
)
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
componentDidMount() {
|
|
82
|
-
const { printerStore, config,
|
|
87
|
+
const { printerStore, config, getremainpageHeight } = this.props
|
|
83
88
|
const batchPrintConfig = config.batchPrintConfig
|
|
84
89
|
// 连续打印不需要计算
|
|
85
90
|
if (batchPrintConfig !== 2) {
|
|
@@ -89,8 +94,15 @@ class Printer extends React.Component {
|
|
|
89
94
|
// 开始计算,获取各种数据
|
|
90
95
|
printerStore.computedPages()
|
|
91
96
|
|
|
97
|
+
if (config.autoFillConfig?.checked) {
|
|
98
|
+
this.props.printerStore.setAutofillConfig(
|
|
99
|
+
config.autoFillConfig?.checked || false
|
|
100
|
+
)
|
|
101
|
+
this.props.printerStore.changeTableData()
|
|
102
|
+
}
|
|
103
|
+
|
|
92
104
|
// 获取剩余空白高度,传到editor
|
|
93
|
-
|
|
105
|
+
getremainpageHeight && getremainpageHeight(printerStore.remainPageHeight)
|
|
94
106
|
}
|
|
95
107
|
// Printer 不是立马就呈现出最终样式,有个过程。这个过程需要时间,什么 ready,不太清楚,估借 setState 来获取过程结束时刻
|
|
96
108
|
this.setState({}, () => {
|
|
@@ -159,18 +171,24 @@ class Printer extends React.Component {
|
|
|
159
171
|
<Header config={config.header} pageIndex={i} />
|
|
160
172
|
|
|
161
173
|
{_.map(page, (panel, ii) => {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
174
|
+
const content = config.contents[panel.index]
|
|
175
|
+
const autoFillConfig = config?.autoFillConfig || {}
|
|
176
|
+
const isAutofillConfig =
|
|
177
|
+
isLastPage &&
|
|
178
|
+
isAutoFilling &&
|
|
179
|
+
panel.end &&
|
|
180
|
+
content?.dataKey === autoFillConfig?.dataKey
|
|
166
181
|
|
|
182
|
+
const end = isAutofillConfig
|
|
183
|
+
? panel.end + Math.floor(remainPageHeight / TR_BASE_HEIGHT)
|
|
184
|
+
: panel.end
|
|
167
185
|
switch (panel.type) {
|
|
168
186
|
case 'table':
|
|
169
187
|
return (
|
|
170
188
|
<Table
|
|
171
189
|
key={`contents.table.${panel.index}.${ii}`}
|
|
172
190
|
name={`contents.table.${panel.index}`}
|
|
173
|
-
config={
|
|
191
|
+
config={content}
|
|
174
192
|
range={{
|
|
175
193
|
begin: panel.begin,
|
|
176
194
|
end: end
|
|
@@ -300,10 +318,11 @@ Printer.propTypes = {
|
|
|
300
318
|
selected: PropTypes.string,
|
|
301
319
|
selectedRegion: PropTypes.string,
|
|
302
320
|
isAutoFilling: PropTypes.bool,
|
|
321
|
+
lineheight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
303
322
|
data: PropTypes.object.isRequired,
|
|
304
323
|
config: PropTypes.object.isRequired,
|
|
305
324
|
onReady: PropTypes.func,
|
|
306
|
-
|
|
325
|
+
getremainpageHeight: PropTypes.func
|
|
307
326
|
}
|
|
308
327
|
|
|
309
328
|
Printer.defaultProps = {
|
package/src/printer/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import i18next from '../../locales'
|
|
2
|
-
import { action, observable } from 'mobx'
|
|
2
|
+
import { action, observable, computed } from 'mobx'
|
|
3
3
|
import {
|
|
4
4
|
getSumTrHeight,
|
|
5
5
|
isMultiTable,
|
|
@@ -44,10 +44,6 @@ class PrinterStore {
|
|
|
44
44
|
@observable
|
|
45
45
|
isAutoFilling = false
|
|
46
46
|
|
|
47
|
-
// 用于缓存更新前后的remainPageHeight,两个长度的数组
|
|
48
|
-
@observable
|
|
49
|
-
remainPageHeightCacheArr = []
|
|
50
|
-
|
|
51
47
|
@action
|
|
52
48
|
init(config, data) {
|
|
53
49
|
this.ready = false
|
|
@@ -90,11 +86,16 @@ class PrinterStore {
|
|
|
90
86
|
this.ready = ready
|
|
91
87
|
}
|
|
92
88
|
|
|
93
|
-
get
|
|
94
|
-
if (!this.selectedRegion) return
|
|
89
|
+
get tableConfig() {
|
|
90
|
+
if (!this.selectedRegion) return {}
|
|
95
91
|
const arr = this.selectedRegion.split('.')
|
|
96
92
|
const tableConfig = this.config.contents[arr[2]]
|
|
97
|
-
|
|
93
|
+
return tableConfig
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
get tableData() {
|
|
97
|
+
if (!this.selectedRegion) return []
|
|
98
|
+
const { dataKey } = this.tableConfig
|
|
98
99
|
|
|
99
100
|
/** 当前数据 */
|
|
100
101
|
return this.data._table[dataKey] || []
|
|
@@ -106,6 +107,21 @@ class PrinterStore {
|
|
|
106
107
|
return filledData.length
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
// 获得表格自定义行高
|
|
111
|
+
@computed
|
|
112
|
+
get computedTableCustomerRowHeight() {
|
|
113
|
+
const _defaultRegion = this.config?.autoFillConfig?.region
|
|
114
|
+
if (this.selectedRegion || _defaultRegion) {
|
|
115
|
+
const _selectedRegion = this.selectedRegion || _defaultRegion
|
|
116
|
+
const arr = _selectedRegion.split('.')
|
|
117
|
+
if (arr.includes('table')) {
|
|
118
|
+
const height = this.config.contents[arr[2]].customerRowHeight
|
|
119
|
+
return height === undefined ? 23 : height
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return 23
|
|
123
|
+
}
|
|
124
|
+
|
|
109
125
|
@action
|
|
110
126
|
setSelected(selected) {
|
|
111
127
|
this.selected = selected || null
|
|
@@ -116,14 +132,20 @@ class PrinterStore {
|
|
|
116
132
|
this.selectedRegion = selected || null
|
|
117
133
|
}
|
|
118
134
|
|
|
119
|
-
getNormalTableBodyHeights(heights) {
|
|
135
|
+
getNormalTableBodyHeights(heights, dataKey) {
|
|
120
136
|
const hasEmptyData = this.tableData.some(x => x._isEmptyData)
|
|
121
|
-
|
|
137
|
+
const isOrderCategroy = dataKey === this.config?.autoFillConfig?.dataKey
|
|
138
|
+
const { customerRowHeight = TR_BASE_HEIGHT } = this.tableConfig
|
|
139
|
+
|
|
140
|
+
if (hasEmptyData && !this.isAutoFilling && isOrderCategroy) {
|
|
122
141
|
// 如果tableData有填充的空数据, 则去掉
|
|
123
142
|
return heights.slice(0, -this.filledTableLen)
|
|
124
|
-
} else if (this.isAutoFilling) {
|
|
143
|
+
} else if (this.isAutoFilling && isOrderCategroy) {
|
|
125
144
|
// 如果没有空数据,且isAutofilling是true,即选择了要填充数据
|
|
126
|
-
return [
|
|
145
|
+
return [
|
|
146
|
+
...heights,
|
|
147
|
+
...Array(this.filledTableLen).fill(_.toNumber(customerRowHeight))
|
|
148
|
+
]
|
|
127
149
|
} else {
|
|
128
150
|
// 正常情况
|
|
129
151
|
return heights
|
|
@@ -220,7 +242,11 @@ class PrinterStore {
|
|
|
220
242
|
.minus(currentPageHeight)
|
|
221
243
|
.toFixed(2)
|
|
222
244
|
|
|
223
|
-
const heights = this.getNormalTableBodyHeights(
|
|
245
|
+
const heights = this.getNormalTableBodyHeights(
|
|
246
|
+
table.body.heights,
|
|
247
|
+
dataKey
|
|
248
|
+
)
|
|
249
|
+
|
|
224
250
|
// 表格行的索引,用于table.slice(begin, end), 分割到不同页面中
|
|
225
251
|
let begin = 0
|
|
226
252
|
let end = 0
|
|
@@ -353,7 +379,6 @@ class PrinterStore {
|
|
|
353
379
|
this.pages.push(page)
|
|
354
380
|
|
|
355
381
|
this.remainPageHeight = +Big(this.pageHeight - currentPageHeight).toFixed(0)
|
|
356
|
-
this.remainPageHeightCacheArr.push(this.remainPageHeight)
|
|
357
382
|
}
|
|
358
383
|
|
|
359
384
|
template(text, pageIndex) {
|
|
@@ -422,6 +447,34 @@ class PrinterStore {
|
|
|
422
447
|
return text
|
|
423
448
|
}
|
|
424
449
|
}
|
|
450
|
+
|
|
451
|
+
// 用于初始化的计算
|
|
452
|
+
getFilledTableData(tableData) {
|
|
453
|
+
const { autoFillConfig } = this.config
|
|
454
|
+
if (!this.selectedRegion && !autoFillConfig?.checked) return []
|
|
455
|
+
const tr_count = Math.floor(
|
|
456
|
+
this.remainPageHeight / this.computedTableCustomerRowHeight
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
const filledData = {
|
|
460
|
+
_isEmptyData: true // 表示是填充的空白数据
|
|
461
|
+
}
|
|
462
|
+
_.map(tableData[0], (val, key) => {
|
|
463
|
+
filledData[key] = ''
|
|
464
|
+
})
|
|
465
|
+
return Array(tr_count).fill(filledData)
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
@action.bound
|
|
469
|
+
changeTableData() {
|
|
470
|
+
const { autoFillConfig } = this.config
|
|
471
|
+
if (!autoFillConfig?.checked) return
|
|
472
|
+
const dataKey = autoFillConfig?.dataKey
|
|
473
|
+
const table = this.data._table[dataKey]
|
|
474
|
+
|
|
475
|
+
table.push(...this.getFilledTableData(table))
|
|
476
|
+
this.data._table[dataKey] = table
|
|
477
|
+
}
|
|
425
478
|
}
|
|
426
479
|
|
|
427
480
|
export default PrinterStore
|