gm-printer 10.14.1-alpha.0 → 10.14.1-alpha.3
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 +47 -27
- package/src/editor/context_menu.js +18 -1
- package/src/printer/printer.js +27 -8
- package/src/printer/store.js +28 -8
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":13543,"mtime":1646816563883,"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":9488,"mtime":1646816037001,"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":13981,"mtime":1646970996345,"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":10228,"mtime":1646970986411,"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":26491,"mtime":1646970904418,"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
|
}
|
|
@@ -122,19 +124,27 @@ class EditorStore {
|
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
@action.bound
|
|
125
|
-
handleChangeTableData(isAutoFilling = false) {
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
handleChangeTableData(isAutoFilling = false, _dataKey = undefined) {
|
|
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
|
@@ -71,14 +71,20 @@ class Printer extends React.Component {
|
|
|
71
71
|
this.props.printerStore.setSelectedRegion(nextProps.selectedRegion)
|
|
72
72
|
}
|
|
73
73
|
if (nextProps.isAutoFilling !== this.props.isAutoFilling) {
|
|
74
|
+
await this.props.printerStore.setAutofillConfig(nextProps.isAutoFilling)
|
|
74
75
|
await this.props.printerStore.setData(nextProps.data)
|
|
75
76
|
await this.props.printerStore.setReady(true)
|
|
76
77
|
await this.props.printerStore.computedPages()
|
|
77
78
|
}
|
|
79
|
+
if (nextProps.lineheight !== this.props.lineheight) {
|
|
80
|
+
await this.props.getremainpageHeight(
|
|
81
|
+
this.props.printerStore.remainPageHeight
|
|
82
|
+
)
|
|
83
|
+
}
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
componentDidMount() {
|
|
81
|
-
const { printerStore, config,
|
|
87
|
+
const { printerStore, config, getremainpageHeight } = this.props
|
|
82
88
|
const batchPrintConfig = config.batchPrintConfig
|
|
83
89
|
// 连续打印不需要计算
|
|
84
90
|
if (batchPrintConfig !== 2) {
|
|
@@ -88,8 +94,14 @@ class Printer extends React.Component {
|
|
|
88
94
|
// 开始计算,获取各种数据
|
|
89
95
|
printerStore.computedPages()
|
|
90
96
|
|
|
97
|
+
if (this.props?.isAutoFilling) {
|
|
98
|
+
this.props.printerStore.setAutofillConfig(
|
|
99
|
+
config.autoFillConfig?.checked || false
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
// 获取剩余空白高度,传到editor
|
|
92
|
-
|
|
104
|
+
getremainpageHeight && getremainpageHeight(printerStore.remainPageHeight)
|
|
93
105
|
}
|
|
94
106
|
// Printer 不是立马就呈现出最终样式,有个过程。这个过程需要时间,什么 ready,不太清楚,估借 setState 来获取过程结束时刻
|
|
95
107
|
this.setState({}, () => {
|
|
@@ -158,18 +170,24 @@ class Printer extends React.Component {
|
|
|
158
170
|
<Header config={config.header} pageIndex={i} />
|
|
159
171
|
|
|
160
172
|
{_.map(page, (panel, ii) => {
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
const content = config.contents[panel.index]
|
|
174
|
+
const autoFillConfig = config?.autoFillConfig || {}
|
|
175
|
+
const isAutofillConfig =
|
|
176
|
+
isLastPage &&
|
|
177
|
+
isAutoFilling &&
|
|
178
|
+
panel.end &&
|
|
179
|
+
content?.dataKey === autoFillConfig?.dataKey
|
|
165
180
|
|
|
181
|
+
const end = isAutofillConfig
|
|
182
|
+
? panel.end + Math.floor(remainPageHeight / TR_BASE_HEIGHT)
|
|
183
|
+
: panel.end
|
|
166
184
|
switch (panel.type) {
|
|
167
185
|
case 'table':
|
|
168
186
|
return (
|
|
169
187
|
<Table
|
|
170
188
|
key={`contents.table.${panel.index}.${ii}`}
|
|
171
189
|
name={`contents.table.${panel.index}`}
|
|
172
|
-
config={
|
|
190
|
+
config={content}
|
|
173
191
|
range={{
|
|
174
192
|
begin: panel.begin,
|
|
175
193
|
end: end
|
|
@@ -299,10 +317,11 @@ Printer.propTypes = {
|
|
|
299
317
|
selected: PropTypes.string,
|
|
300
318
|
selectedRegion: PropTypes.string,
|
|
301
319
|
isAutoFilling: PropTypes.bool,
|
|
320
|
+
lineheight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
302
321
|
data: PropTypes.object.isRequired,
|
|
303
322
|
config: PropTypes.object.isRequired,
|
|
304
323
|
onReady: PropTypes.func,
|
|
305
|
-
|
|
324
|
+
getremainpageHeight: PropTypes.func
|
|
306
325
|
}
|
|
307
326
|
|
|
308
327
|
Printer.defaultProps = {
|
package/src/printer/store.js
CHANGED
|
@@ -60,6 +60,11 @@ class PrinterStore {
|
|
|
60
60
|
this.selected = null
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
@action
|
|
64
|
+
setAutofillConfig(bol) {
|
|
65
|
+
this.isAutoFilling = bol
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
@action
|
|
64
69
|
setData(data) {
|
|
65
70
|
this.data = data
|
|
@@ -85,11 +90,16 @@ class PrinterStore {
|
|
|
85
90
|
this.ready = ready
|
|
86
91
|
}
|
|
87
92
|
|
|
88
|
-
get
|
|
89
|
-
if (!this.selectedRegion) return
|
|
93
|
+
get tableConfig() {
|
|
94
|
+
if (!this.selectedRegion) return {}
|
|
90
95
|
const arr = this.selectedRegion.split('.')
|
|
91
96
|
const tableConfig = this.config.contents[arr[2]]
|
|
92
|
-
|
|
97
|
+
return tableConfig
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get tableData() {
|
|
101
|
+
if (!this.selectedRegion) return []
|
|
102
|
+
const { dataKey } = this.tableConfig
|
|
93
103
|
|
|
94
104
|
/** 当前数据 */
|
|
95
105
|
return this.data._table[dataKey] || []
|
|
@@ -111,14 +121,20 @@ class PrinterStore {
|
|
|
111
121
|
this.selectedRegion = selected || null
|
|
112
122
|
}
|
|
113
123
|
|
|
114
|
-
getNormalTableBodyHeights(heights) {
|
|
124
|
+
getNormalTableBodyHeights(heights, dataKey) {
|
|
115
125
|
const hasEmptyData = this.tableData.some(x => x._isEmptyData)
|
|
116
|
-
|
|
126
|
+
const isOrderCategroy = dataKey === this.config?.autoFillConfig?.dataKey
|
|
127
|
+
const { customerRowHeight = TR_BASE_HEIGHT } = this.tableConfig
|
|
128
|
+
|
|
129
|
+
if (hasEmptyData && !this.isAutoFilling && isOrderCategroy) {
|
|
117
130
|
// 如果tableData有填充的空数据, 则去掉
|
|
118
131
|
return heights.slice(0, -this.filledTableLen)
|
|
119
|
-
} else if (this.isAutoFilling) {
|
|
132
|
+
} else if (this.isAutoFilling && isOrderCategroy) {
|
|
120
133
|
// 如果没有空数据,且isAutofilling是true,即选择了要填充数据
|
|
121
|
-
return [
|
|
134
|
+
return [
|
|
135
|
+
...heights,
|
|
136
|
+
...Array(this.filledTableLen).fill(_.toNumber(customerRowHeight))
|
|
137
|
+
]
|
|
122
138
|
} else {
|
|
123
139
|
// 正常情况
|
|
124
140
|
return heights
|
|
@@ -215,7 +231,11 @@ class PrinterStore {
|
|
|
215
231
|
.minus(currentPageHeight)
|
|
216
232
|
.toFixed(2)
|
|
217
233
|
|
|
218
|
-
const heights = this.getNormalTableBodyHeights(
|
|
234
|
+
const heights = this.getNormalTableBodyHeights(
|
|
235
|
+
table.body.heights,
|
|
236
|
+
dataKey
|
|
237
|
+
)
|
|
238
|
+
|
|
219
239
|
// 表格行的索引,用于table.slice(begin, end), 分割到不同页面中
|
|
220
240
|
let begin = 0
|
|
221
241
|
let end = 0
|