gm-printer-label 3.1.0-beta.4 → 3.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/Volumes/gm-project/gm-printer-label/src/index.js":"1","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/edit_modify_filed.js":"2","/Volumes/gm-project/gm-printer-label/src/common/config.js":"3","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/store.js":"4","/Volumes/gm-project/gm-printer-label/src/util.js":"5","/Volumes/gm-project/gm-printer-label/src/printer/printer.js":"6","/Volumes/gm-project/gm-printer-label/src/printer/page.js":"7","/Volumes/gm-project/gm-printer-label/src/printer/block.js":"8","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/edit.js":"9"},{"size":180,"mtime":1658462117054,"results":"10","hashOfConfig":"11"},{"size":4629,"mtime":1658462013375},{"size":1699,"mtime":1658461960259},{"size":7194,"mtime":1658890412916,"results":"12","hashOfConfig":"11"},{"size":1962,"mtime":1660567552794},{"size":1913,"mtime":1660567552793},{"size":411,"mtime":1660567552793},{"size":10502,"mtime":1660726333740},{"size":2958,"mtime":1660567552792},{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"17s6x9q",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/gm-project/gm-printer-label/src/index.js",[],"/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/store.js",[]]
1
+ [{"/Volumes/gm-project/gm-printer-label/src/index.js":"1","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/edit_modify_filed.js":"2","/Volumes/gm-project/gm-printer-label/src/common/config.js":"3","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/store.js":"4","/Volumes/gm-project/gm-printer-label/src/util.js":"5","/Volumes/gm-project/gm-printer-label/src/printer/printer.js":"6","/Volumes/gm-project/gm-printer-label/src/printer/page.js":"7","/Volumes/gm-project/gm-printer-label/src/printer/block.js":"8","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/edit.js":"9"},{"size":180,"mtime":1658462117054,"results":"10","hashOfConfig":"11"},{"size":4629,"mtime":1658462013375},{"size":1699,"mtime":1658461960259},{"size":7194,"mtime":1658890412916,"results":"12","hashOfConfig":"11"},{"size":1962,"mtime":1660567552794},{"size":1913,"mtime":1660567552793},{"size":411,"mtime":1660567552793},{"size":10454,"mtime":1660737942184},{"size":2958,"mtime":1660567552792},{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"17s6x9q",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/gm-project/gm-printer-label/src/index.js",[],"/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/store.js",[]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer-label",
3
- "version": "3.1.0-beta.4",
3
+ "version": "3.1.0-beta.7",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -111,6 +111,7 @@ class Block extends React.Component {
111
111
  } = this.props
112
112
  const { isEdit } = this.state
113
113
  let content = null
114
+
114
115
  if (!type || type === 'text') {
115
116
  if (fieldType === ' ') {
116
117
  // 字段类型为表格
@@ -122,7 +123,14 @@ class Block extends React.Component {
122
123
  />
123
124
  )
124
125
  } else {
125
- content = template(text, data)
126
+ /** html */
127
+ const value = text.split(':')?.[1]
128
+ const isHtml = value && value.indexOf('_html') !== -1
129
+ content = isHtml ? (
130
+ <div dangerouslySetInnerHTML={{ __html: template(value, data) }} />
131
+ ) : (
132
+ template(text, data)
133
+ )
126
134
  }
127
135
  } else if (type === 'line') {
128
136
  content = null
@@ -332,11 +340,8 @@ class Block extends React.Component {
332
340
  />
333
341
  )
334
342
  }
335
- console.log('content', content)
336
- if (content.indexOf('div') != '-1') {
337
- // console.log('content', dangerouslySetInnerHTML={{ __html: content }})
338
- }
339
343
  const active = index === selected
344
+
340
345
  return (
341
346
  <div
342
347
  {...rest}
@@ -356,14 +361,7 @@ class Block extends React.Component {
356
361
  onDoubleClick={this.handleDoubleClick}
357
362
  data-name={index}
358
363
  >
359
- {content.indexOf('div') != '-1' ? (
360
- /** 表单 */
361
- <div
362
- dangerouslySetInnerHTML={{ __html: _.split(content, ':', 2)?.[1] }}
363
- />
364
- ) : (
365
- content
366
- )}
364
+ {content}
367
365
  {(!type || type === 'text') && active && isEdit && (
368
366
  <textarea
369
367
  ref={(ref) => (this.refEdit = ref)}