gm-printer 10.14.1-alpha.1 → 10.14.1-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 +1 -1
- package/package.json +1 -1
- package/src/common/component.js +1 -1
- package/src/common/editor_customize_config.js +11 -6
- package/src/common/editor_edit_field.js +2 -2
- package/src/common/editor_store.js +32 -23
- package/src/editor/context_menu.js +2 -1
- package/src/printer/printer.js +10 -3
- package/src/printer/store.js +23 -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":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":13982,"mtime":1646901703877,"results":"25","hashOfConfig":"24"},{"size":4244,"mtime":1635494969691,"results":"26","hashOfConfig":"24"},{"size":4208,"mtime":1646901683615,"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":9854,"mtime":1646901455835,"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":26134,"mtime":1646901675308,"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":1408,"mtime":1646884084630,"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
|
@@ -18,14 +18,19 @@ class EditorCutomizedConfig extends React.Component {
|
|
|
18
18
|
editStore,
|
|
19
19
|
editStore: { isAutoFilling }
|
|
20
20
|
} = this.props
|
|
21
|
-
const {
|
|
21
|
+
const { dataKey } = editStore.computedTableSpecialConfig
|
|
22
22
|
// 是table且具有specialConfig的附属table
|
|
23
|
-
if (editStore.computedRegionIsTable &&
|
|
23
|
+
if (editStore.computedRegionIsTable && dataKey === 'orders_category') {
|
|
24
24
|
return (
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
<>
|
|
26
|
+
<Flex alignCenter className='gm-padding-top-5'>
|
|
27
|
+
<div>{i18next.t('行数是否自动填充')}:</div>
|
|
28
|
+
<Switch checked={isAutoFilling} onChange={this.handleAutoFilling} />
|
|
29
|
+
</Flex>
|
|
30
|
+
<Flex className='gm-padding-top-5 gm-text-red' column>
|
|
31
|
+
{i18next.t('注意:填充仅支持单栏数据使用')}
|
|
32
|
+
</Flex>
|
|
33
|
+
</>
|
|
29
34
|
)
|
|
30
35
|
} else {
|
|
31
36
|
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'
|
|
@@ -111,7 +109,10 @@ class EditorStore {
|
|
|
111
109
|
@action
|
|
112
110
|
getFilledTableData(tableData) {
|
|
113
111
|
if (!this.selectedRegion) return []
|
|
114
|
-
const tr_count = Math.floor(
|
|
112
|
+
const tr_count = Math.floor(
|
|
113
|
+
this.remainPageHeihgt / this.computedTableCustomerRowHeight
|
|
114
|
+
)
|
|
115
|
+
|
|
115
116
|
const filledData = {
|
|
116
117
|
_isEmptyData: true // 表示是填充的空白数据
|
|
117
118
|
}
|
|
@@ -127,14 +128,13 @@ class EditorStore {
|
|
|
127
128
|
const { dataKey } = this.computedTableSpecialConfig
|
|
128
129
|
const table = this.mockData._table[dataKey]
|
|
129
130
|
this.setAutoFillingConfig(isAutoFilling)
|
|
131
|
+
|
|
130
132
|
if (isAutoFilling) {
|
|
131
133
|
table.push(...this.getFilledTableData(table))
|
|
132
134
|
} else {
|
|
133
135
|
this.clearExtraTableData(dataKey)
|
|
134
|
-
this.setAutoFillRemainPage({ isAutoFilling: isAutoFilling })
|
|
135
136
|
return
|
|
136
137
|
}
|
|
137
|
-
this.setAutoFillRemainPage({ isAutoFilling: isAutoFilling })
|
|
138
138
|
this.mockData._table[dataKey] = table
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -645,7 +645,7 @@ class EditorStore {
|
|
|
645
645
|
addFieldToTable({ key, value }) {
|
|
646
646
|
if (this.computedRegionIsTable) {
|
|
647
647
|
const arr = this.selectedRegion.split('.')
|
|
648
|
-
const { columns } = this.config.contents[arr[2]]
|
|
648
|
+
const { columns, dataKey } = this.config.contents[arr[2]]
|
|
649
649
|
|
|
650
650
|
columns.push({
|
|
651
651
|
head: key,
|
|
@@ -657,6 +657,9 @@ class EditorStore {
|
|
|
657
657
|
textAlign: 'center'
|
|
658
658
|
}
|
|
659
659
|
})
|
|
660
|
+
|
|
661
|
+
this.clearExtraTableData(dataKey)
|
|
662
|
+
this.setAutoFillingConfig(false)
|
|
660
663
|
}
|
|
661
664
|
}
|
|
662
665
|
|
|
@@ -751,6 +754,7 @@ class EditorStore {
|
|
|
751
754
|
table.dataKey = dataKey
|
|
752
755
|
// 改变dataKey后做副作用action
|
|
753
756
|
this.setTableDataKeyEffect(table, dataKey)
|
|
757
|
+
this.clearAllTableEmptyData()
|
|
754
758
|
}
|
|
755
759
|
}
|
|
756
760
|
|
|
@@ -786,6 +790,9 @@ class EditorStore {
|
|
|
786
790
|
...this.config.contents[arr[2]],
|
|
787
791
|
customerRowHeight: val
|
|
788
792
|
}
|
|
793
|
+
// // 用于触发printer更新最新的剩余高度
|
|
794
|
+
// this.setLineHeight(val)
|
|
795
|
+
this.setAutoFillingConfig(false)
|
|
789
796
|
}
|
|
790
797
|
}
|
|
791
798
|
}
|
|
@@ -977,20 +984,20 @@ class EditorStore {
|
|
|
977
984
|
}
|
|
978
985
|
|
|
979
986
|
// 设置是否自动填充空白
|
|
980
|
-
@action.bound
|
|
981
|
-
setAutoFillRemainPage(modify) {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
987
|
+
// @action.bound
|
|
988
|
+
// setAutoFillRemainPage(modify) {
|
|
989
|
+
// if (this.computedRegionIsTable) {
|
|
990
|
+
// const tableConfig = this.computedTableSpecialConfig
|
|
991
|
+
// const extraSpecialConfig = tableConfig.extraSpecialConfig
|
|
992
|
+
// if (extraSpecialConfig) {
|
|
993
|
+
// set(extraSpecialConfig, modify)
|
|
994
|
+
// } else {
|
|
995
|
+
// set(tableConfig, { extraSpecialConfig: { ...modify } })
|
|
996
|
+
// }
|
|
997
|
+
// }
|
|
998
|
+
// // 这么写才会触发子组件的更新
|
|
999
|
+
// this.config = Object.assign({}, this.config)
|
|
1000
|
+
// }
|
|
994
1001
|
|
|
995
1002
|
@action.bound
|
|
996
1003
|
setSummaryConfig(modify) {
|
|
@@ -1009,15 +1016,17 @@ class EditorStore {
|
|
|
1009
1016
|
}
|
|
1010
1017
|
set(config, { summaryConfig: { ...init, ...modify } })
|
|
1011
1018
|
}
|
|
1012
|
-
|
|
1013
1019
|
if ('pageSummaryShow' in modify || 'totalSummaryShow' in modify) {
|
|
1014
1020
|
// 切换的时候,要把对应table的多余空数据清掉
|
|
1015
1021
|
this.clearExtraTableData(config.dataKey)
|
|
1016
1022
|
}
|
|
1017
|
-
|
|
1018
1023
|
this.config = toJS(this.config)
|
|
1019
1024
|
}
|
|
1020
|
-
|
|
1025
|
+
|
|
1026
|
+
// 如果只是勾选要展示的合计类目的选项,则不需要执行以下操作, 否则会重复清空数据
|
|
1027
|
+
if (!('summaryColumns' in modify && 'style' in modify)) {
|
|
1028
|
+
this.setAutoFillingConfig(false)
|
|
1029
|
+
}
|
|
1021
1030
|
}
|
|
1022
1031
|
}
|
|
1023
1032
|
|
|
@@ -127,9 +127,10 @@ class ContextMenu extends React.Component {
|
|
|
127
127
|
selected={editStore.selected}
|
|
128
128
|
selectedRegion={editStore.selectedRegion}
|
|
129
129
|
isAutoFilling={editStore.isAutoFilling}
|
|
130
|
+
lineheight={editStore.computedTableCustomerRowHeight}
|
|
130
131
|
config={editStore.config}
|
|
131
132
|
data={editStore.mockData}
|
|
132
|
-
|
|
133
|
+
getremainpageHeight={editStore.setRemainPageHeight}
|
|
133
134
|
/>
|
|
134
135
|
</CommonContextMenu>
|
|
135
136
|
)
|
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) {
|
|
@@ -90,7 +95,7 @@ class Printer extends React.Component {
|
|
|
90
95
|
printerStore.computedPages()
|
|
91
96
|
|
|
92
97
|
// 获取剩余空白高度,传到editor
|
|
93
|
-
|
|
98
|
+
getremainpageHeight && getremainpageHeight(printerStore.remainPageHeight)
|
|
94
99
|
}
|
|
95
100
|
// Printer 不是立马就呈现出最终样式,有个过程。这个过程需要时间,什么 ready,不太清楚,估借 setState 来获取过程结束时刻
|
|
96
101
|
this.setState({}, () => {
|
|
@@ -300,10 +305,11 @@ Printer.propTypes = {
|
|
|
300
305
|
selected: PropTypes.string,
|
|
301
306
|
selectedRegion: PropTypes.string,
|
|
302
307
|
isAutoFilling: PropTypes.bool,
|
|
308
|
+
lineheight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
303
309
|
data: PropTypes.object.isRequired,
|
|
304
310
|
config: PropTypes.object.isRequired,
|
|
305
311
|
onReady: PropTypes.func,
|
|
306
|
-
|
|
312
|
+
getremainpageHeight: PropTypes.func
|
|
307
313
|
}
|
|
308
314
|
|
|
309
315
|
Printer.defaultProps = {
|
|
@@ -317,6 +323,7 @@ class WithStorePrinter extends React.Component {
|
|
|
317
323
|
}
|
|
318
324
|
|
|
319
325
|
render() {
|
|
326
|
+
console.log('this.props', { ...this.props })
|
|
320
327
|
return (
|
|
321
328
|
<Provider printerStore={this.printerStore}>
|
|
322
329
|
<Printer {...this.props} />
|
package/src/printer/store.js
CHANGED
|
@@ -90,11 +90,16 @@ class PrinterStore {
|
|
|
90
90
|
this.ready = ready
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
get
|
|
94
|
-
if (!this.selectedRegion) return
|
|
93
|
+
get tableConfig() {
|
|
94
|
+
if (!this.selectedRegion) return {}
|
|
95
95
|
const arr = this.selectedRegion.split('.')
|
|
96
96
|
const tableConfig = this.config.contents[arr[2]]
|
|
97
|
-
|
|
97
|
+
return tableConfig
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get tableData() {
|
|
101
|
+
if (!this.selectedRegion) return []
|
|
102
|
+
const { dataKey } = this.tableConfig
|
|
98
103
|
|
|
99
104
|
/** 当前数据 */
|
|
100
105
|
return this.data._table[dataKey] || []
|
|
@@ -116,14 +121,20 @@ class PrinterStore {
|
|
|
116
121
|
this.selectedRegion = selected || null
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
getNormalTableBodyHeights(heights) {
|
|
124
|
+
getNormalTableBodyHeights(heights, dataKey = 'orders_category') {
|
|
120
125
|
const hasEmptyData = this.tableData.some(x => x._isEmptyData)
|
|
121
|
-
|
|
126
|
+
const isOrderCategroy = dataKey === 'orders_category'
|
|
127
|
+
const { customerRowHeight = TR_BASE_HEIGHT } = this.tableConfig
|
|
128
|
+
|
|
129
|
+
if (hasEmptyData && !this.isAutoFilling && isOrderCategroy) {
|
|
122
130
|
// 如果tableData有填充的空数据, 则去掉
|
|
123
131
|
return heights.slice(0, -this.filledTableLen)
|
|
124
|
-
} else if (this.isAutoFilling) {
|
|
132
|
+
} else if (this.isAutoFilling && isOrderCategroy) {
|
|
125
133
|
// 如果没有空数据,且isAutofilling是true,即选择了要填充数据
|
|
126
|
-
return [
|
|
134
|
+
return [
|
|
135
|
+
...heights,
|
|
136
|
+
...Array(this.filledTableLen).fill(_.toNumber(customerRowHeight))
|
|
137
|
+
]
|
|
127
138
|
} else {
|
|
128
139
|
// 正常情况
|
|
129
140
|
return heights
|
|
@@ -220,7 +231,11 @@ class PrinterStore {
|
|
|
220
231
|
.minus(currentPageHeight)
|
|
221
232
|
.toFixed(2)
|
|
222
233
|
|
|
223
|
-
const heights = this.getNormalTableBodyHeights(
|
|
234
|
+
const heights = this.getNormalTableBodyHeights(
|
|
235
|
+
table.body.heights,
|
|
236
|
+
dataKey
|
|
237
|
+
)
|
|
238
|
+
|
|
224
239
|
// 表格行的索引,用于table.slice(begin, end), 分割到不同页面中
|
|
225
240
|
let begin = 0
|
|
226
241
|
let end = 0
|