label-designer-vue 0.1.0 → 0.1.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/dist/label-designer.es.js +688 -476
- package/dist/label-designer.umd.js +7 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { ref as M, computed as
|
|
2
|
-
import { ElButton as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return String(
|
|
1
|
+
import { ref as M, computed as F, onMounted as We, onBeforeUnmount as Oe, watch as $e, openBlock as u, createElementBlock as c, createElementVNode as s, Fragment as k, renderList as H, toDisplayString as L, normalizeClass as I, createVNode as a, unref as d, withModifiers as N, withCtx as D, createTextVNode as K, createCommentVNode as z, normalizeStyle as G, pushScopeId as Pe, popScopeId as Xe } from "vue";
|
|
2
|
+
import { ElButton as J, ElSelect as ce, ElOption as Q, ElSwitch as Z, ElInput as S, ElInputNumber as $, ElColorPicker as ne } from "element-plus";
|
|
3
|
+
import Ce from "jsbarcode";
|
|
4
|
+
import je from "qrcode";
|
|
5
|
+
const Ke = 25.4 / 72;
|
|
6
|
+
function B(n) {
|
|
7
|
+
return String(n ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
9
|
+
function Se(n, m = {}) {
|
|
10
|
+
const h = n.fieldName ? m == null ? void 0 : m[n.fieldName] : void 0;
|
|
11
|
+
return h != null && String(h) !== "" ? String(h) : String(n.testData ?? "");
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return
|
|
13
|
+
function W(n, m = {}) {
|
|
14
|
+
const h = n.fieldName ? m == null ? void 0 : m[n.fieldName] : void 0;
|
|
15
|
+
return h != null && String(h) !== "" ? String(h) : String(n.content ?? "");
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
17
|
+
function Ue(n, m, h, g = !0) {
|
|
18
|
+
const f = String(n ?? "").trim();
|
|
19
|
+
if (!f || !(m > 0) || !(h > 0)) return "";
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const p = document.createElement("canvas");
|
|
22
|
+
if (Ce(p, f, {
|
|
23
23
|
format: "CODE128",
|
|
24
24
|
width: 1,
|
|
25
25
|
height: 60,
|
|
26
|
-
displayValue:
|
|
26
|
+
displayValue: g !== !1,
|
|
27
27
|
fontSize: 12,
|
|
28
28
|
textMargin: 1,
|
|
29
29
|
margin: 0
|
|
30
|
-
}), !
|
|
31
|
-
const
|
|
32
|
-
return
|
|
30
|
+
}), !p.width || !p.height) return "";
|
|
31
|
+
const O = Math.max(1, p.width), oe = Math.max(0.1, m / h * p.height / O), v = document.createElement("canvas");
|
|
32
|
+
return Ce(v, f, {
|
|
33
33
|
format: "CODE128",
|
|
34
|
-
width:
|
|
34
|
+
width: oe,
|
|
35
35
|
height: 60,
|
|
36
|
-
displayValue:
|
|
36
|
+
displayValue: g !== !1,
|
|
37
37
|
fontSize: 12,
|
|
38
38
|
textMargin: 1,
|
|
39
39
|
margin: 0
|
|
40
|
-
}),
|
|
40
|
+
}), v.toDataURL("image/png");
|
|
41
41
|
} catch {
|
|
42
42
|
return "";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
async function
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
45
|
+
async function Ee(n) {
|
|
46
|
+
const m = String(n ?? "").trim();
|
|
47
|
+
if (!m) return "";
|
|
48
48
|
try {
|
|
49
|
-
return await
|
|
49
|
+
return await je.toDataURL(m, {
|
|
50
50
|
width: 240,
|
|
51
51
|
margin: 1,
|
|
52
52
|
errorCorrectionLevel: "M",
|
|
@@ -56,66 +56,83 @@ async function Ve(s) {
|
|
|
56
56
|
return "";
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ge(n) {
|
|
60
60
|
return [
|
|
61
|
-
`left:${
|
|
62
|
-
`top:${
|
|
63
|
-
`width:${
|
|
64
|
-
`height:${
|
|
65
|
-
|
|
61
|
+
`left:${n.x}mm`,
|
|
62
|
+
`top:${n.y}mm`,
|
|
63
|
+
`width:${n.width}mm`,
|
|
64
|
+
`height:${n.height}mm`,
|
|
65
|
+
n.rotation ? `transform:rotate(${n.rotation}deg)` : ""
|
|
66
66
|
].filter(Boolean).join(";");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Je(n) {
|
|
69
|
+
const m = String(n || "Microsoft YaHei").replace(/'/g, "");
|
|
70
|
+
return m.includes(" ") ? `'${m}'` : m;
|
|
71
|
+
}
|
|
72
|
+
function Me(n) {
|
|
69
73
|
return [
|
|
70
|
-
`font-
|
|
71
|
-
`font-
|
|
72
|
-
`
|
|
73
|
-
`
|
|
74
|
+
`font-family:${Je(n.fontFamily)},sans-serif`,
|
|
75
|
+
`font-size:${n.fontSize || 9}pt`,
|
|
76
|
+
`font-weight:${n.bold ? "700" : "400"}`,
|
|
77
|
+
`text-align:${n.align || "left"}`,
|
|
78
|
+
`color:${n.color || "#000000"}`,
|
|
74
79
|
"line-height:1.15",
|
|
75
80
|
"white-space:pre-wrap",
|
|
76
81
|
"word-break:break-all",
|
|
77
82
|
"overflow:hidden"
|
|
78
83
|
].join(";");
|
|
79
84
|
}
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return `<div class="ld-print-item ld-print-text" style="${
|
|
84
|
-
|
|
85
|
-
)}">${
|
|
86
|
-
if (
|
|
87
|
-
return `<div class="ld-print-item ld-print-text" style="${
|
|
88
|
-
|
|
89
|
-
)}">${
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
return
|
|
85
|
+
function Qe(n, m, h) {
|
|
86
|
+
const g = Ge(n);
|
|
87
|
+
if (n.type === "text")
|
|
88
|
+
return `<div class="ld-print-item ld-print-text" style="${g};${Me(
|
|
89
|
+
n
|
|
90
|
+
)}">${B(n.text)}</div>`;
|
|
91
|
+
if (n.type === "value")
|
|
92
|
+
return `<div class="ld-print-item ld-print-text" style="${g};${Me(
|
|
93
|
+
n
|
|
94
|
+
)}">${B(Se(n, h))}</div>`;
|
|
95
|
+
if (n.type === "image") {
|
|
96
|
+
const f = B(W(n, h));
|
|
97
|
+
return f ? `<div class="ld-print-item" style="${g}"><img class="ld-print-img is-fill" src="${f}" alt="" /></div>` : `<div class="ld-print-item" style="${g}"></div>`;
|
|
98
|
+
}
|
|
99
|
+
if (n.type === "line") {
|
|
100
|
+
const f = `${n.lineWidth || 1}px`, p = B(n.lineColor || "#000000"), O = n.width >= n.height ? `position:absolute;top:calc(50% - ${f}/2);left:0;right:0;height:${f};background:${p}` : `position:absolute;left:calc(50% - ${f}/2);top:0;bottom:0;width:${f};background:${p}`;
|
|
101
|
+
return `<div class="ld-print-item" style="${g}"><div style="${O}"></div></div>`;
|
|
102
|
+
}
|
|
103
|
+
if (n.type === "rect" || n.type === "ellipse") {
|
|
104
|
+
const f = n.type === "ellipse" ? "50%" : `${n.radius || 0}px`, p = `width:100%;height:100%;box-sizing:border-box;border:${n.borderWidth || 0}px solid ${B(n.borderColor || "#000000")};background:${B(n.fillColor || "#ffffff")};border-radius:${f}`;
|
|
105
|
+
return `<div class="ld-print-item" style="${g}"><div style="${p}"></div></div>`;
|
|
106
|
+
}
|
|
107
|
+
if (n.type === "barcode" || n.type === "qrcode") {
|
|
108
|
+
const f = m[n.id] || "", p = n.type === "barcode" ? "fill" : "contain";
|
|
109
|
+
return f ? `<div class="ld-print-item" style="${g}"><img class="ld-print-img is-${p}" src="${f}" alt="" /></div>` : `<div class="ld-print-item" style="${g}"></div>`;
|
|
93
110
|
}
|
|
94
111
|
return "";
|
|
95
112
|
}
|
|
96
|
-
async function
|
|
97
|
-
const
|
|
98
|
-
for (const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
) :
|
|
105
|
-
const
|
|
113
|
+
async function Ze(n, m = {}) {
|
|
114
|
+
const h = n.items || [], g = {};
|
|
115
|
+
for (const p of h)
|
|
116
|
+
p.type === "barcode" ? g[p.id] = Ue(
|
|
117
|
+
W(p, m),
|
|
118
|
+
p.width,
|
|
119
|
+
p.height,
|
|
120
|
+
p.showValue !== !1
|
|
121
|
+
) : p.type === "qrcode" && (g[p.id] = await Ee(W(p, m)));
|
|
122
|
+
const f = h.map((p) => Qe(p, g, m)).join("");
|
|
106
123
|
return `<!DOCTYPE html>
|
|
107
124
|
<html>
|
|
108
125
|
<head>
|
|
109
126
|
<meta charset="utf-8" />
|
|
110
|
-
<title>${
|
|
127
|
+
<title>${B(n.name || "标签打印")}</title>
|
|
111
128
|
<style>
|
|
112
|
-
@page { size: ${
|
|
129
|
+
@page { size: ${n.width}mm ${n.height}mm; margin: 0; }
|
|
113
130
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
114
131
|
body { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; }
|
|
115
132
|
.ld-print-canvas {
|
|
116
133
|
position: relative;
|
|
117
|
-
width: ${
|
|
118
|
-
height: ${
|
|
134
|
+
width: ${n.width}mm;
|
|
135
|
+
height: ${n.height}mm;
|
|
119
136
|
overflow: hidden;
|
|
120
137
|
background: #fff;
|
|
121
138
|
}
|
|
@@ -127,43 +144,61 @@ async function Xe(s, u = {}) {
|
|
|
127
144
|
</style>
|
|
128
145
|
</head>
|
|
129
146
|
<body>
|
|
130
|
-
<div class="ld-print-canvas">${
|
|
147
|
+
<div class="ld-print-canvas">${f}</div>
|
|
131
148
|
</body>
|
|
132
149
|
</html>`;
|
|
133
150
|
}
|
|
134
|
-
async function
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
|
|
151
|
+
async function os(n, m = {}) {
|
|
152
|
+
const h = await Ze(n, m), g = window.open("", "_blank");
|
|
153
|
+
return g ? (g.document.write(h), g.document.close(), g.addEventListener("load", () => {
|
|
154
|
+
g.focus(), g.print();
|
|
138
155
|
}), !0) : !1;
|
|
139
156
|
}
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
for (const [
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
}, r = (
|
|
157
|
+
const el = (n, m) => {
|
|
158
|
+
const h = n.__vccOpts || n;
|
|
159
|
+
for (const [g, f] of m)
|
|
160
|
+
h[g] = f;
|
|
161
|
+
return h;
|
|
162
|
+
}, r = (n) => (Pe("data-v-8646f5dc"), n = n(), Xe(), n), ll = { class: "ldesign" }, tl = { class: "ldesign-pane ldesign-left" }, sl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-pane-title" }, "素材库", -1)), nl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-pane-tip" }, "拖到画布上,或点击添加", -1)), ol = { class: "ldesign-palette" }, il = ["onDragstart", "onClick"], al = ["innerHTML"], dl = { class: "ldesign-palette-name" }, rl = { class: "ldesign-palette-desc" }, ul = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-pane-title" }, "元素图层", -1)), cl = { class: "ldesign-layers" }, ml = ["onClick"], hl = { class: "ldesign-layer-name" }, pl = { class: "ldesign-layer-ops" }, vl = {
|
|
146
163
|
key: 0,
|
|
147
164
|
class: "ldesign-empty"
|
|
148
|
-
},
|
|
149
|
-
key:
|
|
165
|
+
}, gl = { class: "ldesign-center" }, fl = { class: "ldesign-canvas-bar" }, yl = { class: "ldesign-canvas-bar-left" }, wl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("span", { class: "ldesign-bar-label" }, "缩放", -1)), xl = { class: "ldesign-bar-switch" }, _l = /* @__PURE__ */ r(() => /* @__PURE__ */ s("span", null, "网格", -1)), bl = { class: "ldesign-bar-switch" }, Vl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("span", null, "对齐网格", -1)), kl = { class: "ldesign-bar-switch" }, $l = /* @__PURE__ */ r(() => /* @__PURE__ */ s("span", null, "预览模拟数据", -1)), Cl = { class: "ldesign-canvas-bar-right" }, Ml = { class: "ldesign-bar-size" }, zl = { class: "ldesign-stage" }, Sl = ["onMousedown"], Ul = ["src"], El = {
|
|
166
|
+
key: 2,
|
|
150
167
|
class: "ldesign-item-placeholder"
|
|
151
|
-
},
|
|
152
|
-
key:
|
|
168
|
+
}, Ll = ["src"], Nl = ["src"], Dl = {
|
|
169
|
+
key: 7,
|
|
153
170
|
class: "ldesign-item-placeholder"
|
|
154
|
-
},
|
|
155
|
-
key:
|
|
171
|
+
}, Tl = {
|
|
172
|
+
key: 8,
|
|
173
|
+
class: "ldesign-item-placeholder"
|
|
174
|
+
}, Il = {
|
|
175
|
+
key: 9,
|
|
156
176
|
class: "ldesign-item-badge"
|
|
157
|
-
},
|
|
177
|
+
}, Bl = ["onMousedown"], Yl = {
|
|
178
|
+
key: 0,
|
|
179
|
+
class: "ldesign-guide is-v"
|
|
180
|
+
}, Rl = {
|
|
181
|
+
key: 1,
|
|
182
|
+
class: "ldesign-guide is-h"
|
|
183
|
+
}, ql = { class: "ldesign-pane ldesign-right" }, Al = { class: "ldesign-pane-title" }, Fl = { class: "ldesign-props" }, Hl = { class: "ldesign-prop-row" }, Wl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "名称", -1)), Ol = {
|
|
158
184
|
key: 0,
|
|
159
185
|
class: "ldesign-prop-row"
|
|
160
|
-
},
|
|
186
|
+
}, Pl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "文本内容", -1)), Xl = { class: "ldesign-prop-row" }, jl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "字段名", -1)), Kl = { class: "ldesign-prop-row" }, Gl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "测试数据", -1)), Jl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-prop-hint" }, " 画布默认显示测试数据;开启「预览模拟数据」或打印时,优先取模拟数据里该字段的值 ", -1)), Ql = { class: "ldesign-prop-row" }, Zl = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "图片地址", -1)), et = { class: "ldesign-prop-row" }, lt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "字段名(可选)", -1)), tt = { class: "ldesign-prop-row" }, st = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "码内容", -1)), nt = { class: "ldesign-prop-row" }, ot = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "字段名(可选)", -1)), it = {
|
|
161
187
|
key: 0,
|
|
162
188
|
class: "ldesign-prop-row"
|
|
163
|
-
},
|
|
164
|
-
key:
|
|
189
|
+
}, at = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "显示条码值", -1)), dt = {
|
|
190
|
+
key: 4,
|
|
191
|
+
class: "ldesign-grid2"
|
|
192
|
+
}, rt = { class: "ldesign-prop-cell" }, ut = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "线宽(px)", -1)), ct = { class: "ldesign-prop-cell" }, mt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "线条颜色", -1)), ht = {
|
|
193
|
+
key: 5,
|
|
194
|
+
class: "ldesign-grid2"
|
|
195
|
+
}, pt = { class: "ldesign-prop-cell" }, vt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "边框宽度(px)", -1)), gt = { class: "ldesign-prop-cell" }, ft = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "边框颜色", -1)), yt = { class: "ldesign-prop-cell" }, wt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "填充颜色", -1)), xt = {
|
|
196
|
+
key: 0,
|
|
197
|
+
class: "ldesign-prop-cell"
|
|
198
|
+
}, _t = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "圆角(px)", -1)), bt = {
|
|
199
|
+
key: 6,
|
|
165
200
|
class: "ldesign-grid2"
|
|
166
|
-
},
|
|
201
|
+
}, Vt = { class: "ldesign-prop-cell" }, kt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "字体", -1)), $t = { class: "ldesign-prop-cell" }, Ct = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "字号(pt)", -1)), Mt = { class: "ldesign-prop-cell" }, zt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "加粗", -1)), St = { class: "ldesign-prop-cell" }, Ut = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "对齐", -1)), Et = { class: "ldesign-prop-cell" }, Lt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "文字颜色", -1)), Nt = { class: "ldesign-grid2" }, Dt = { class: "ldesign-prop-cell" }, Tt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "位置 X(mm)", -1)), It = { class: "ldesign-prop-cell" }, Bt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "位置 Y(mm)", -1)), Yt = { class: "ldesign-prop-cell" }, Rt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "宽(mm)", -1)), qt = { class: "ldesign-prop-cell" }, At = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "高(mm)", -1)), Ft = { class: "ldesign-prop-cell" }, Ht = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "旋转(度)", -1)), Wt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-pane-title" }, "画布设置", -1)), Ot = { class: "ldesign-props" }, Pt = { class: "ldesign-prop-row" }, Xt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "画布名称", -1)), jt = { class: "ldesign-grid2" }, Kt = { class: "ldesign-prop-cell" }, Gt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "宽(mm)", -1)), Jt = { class: "ldesign-prop-cell" }, Qt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("label", null, "高(mm)", -1)), Zt = /* @__PURE__ */ r(() => /* @__PURE__ */ s("div", { class: "ldesign-prop-hint" }, " 画布尺寸即实际标签纸大小(毫米),打印时按此尺寸出纸;点击画布空白处或「画布设置」返回本面板 ", -1)), ze = 0.6, es = {
|
|
167
202
|
__name: "label-designer",
|
|
168
203
|
props: {
|
|
169
204
|
/** 当前编辑的画布对象(页面持有的设计数据,直接在其上编辑) */
|
|
@@ -171,23 +206,45 @@ const He = (s, u) => {
|
|
|
171
206
|
/** 模拟数据(按字段名取值) */
|
|
172
207
|
mockData: { type: Object, default: () => ({}) }
|
|
173
208
|
},
|
|
174
|
-
setup(
|
|
175
|
-
const
|
|
209
|
+
setup(n) {
|
|
210
|
+
const m = {
|
|
176
211
|
text: "文字",
|
|
177
212
|
value: "动态数据",
|
|
178
213
|
barcode: "条形码",
|
|
179
|
-
qrcode: "二维码"
|
|
180
|
-
|
|
214
|
+
qrcode: "二维码",
|
|
215
|
+
image: "图片",
|
|
216
|
+
line: "线条",
|
|
217
|
+
rect: "矩形框",
|
|
218
|
+
ellipse: "圆形"
|
|
219
|
+
}, h = {
|
|
181
220
|
text: { w: 4, h: 2 },
|
|
182
221
|
value: { w: 4, h: 2 },
|
|
183
222
|
barcode: { w: 10, h: 5 },
|
|
184
|
-
qrcode: { w: 5, h: 5 }
|
|
185
|
-
|
|
223
|
+
qrcode: { w: 5, h: 5 },
|
|
224
|
+
image: { w: 8, h: 6 },
|
|
225
|
+
line: { w: 4, h: 1 },
|
|
226
|
+
rect: { w: 5, h: 5 },
|
|
227
|
+
ellipse: { w: 5, h: 5 }
|
|
228
|
+
}, g = [
|
|
229
|
+
"Microsoft YaHei",
|
|
230
|
+
"SimSun",
|
|
231
|
+
"SimHei",
|
|
232
|
+
"KaiTi",
|
|
233
|
+
"FangSong",
|
|
234
|
+
"Arial",
|
|
235
|
+
"Times New Roman",
|
|
236
|
+
"Verdana",
|
|
237
|
+
"Tahoma",
|
|
238
|
+
"Consolas",
|
|
239
|
+
"Courier New",
|
|
240
|
+
"Impact"
|
|
241
|
+
], f = {
|
|
186
242
|
text: {
|
|
187
243
|
width: 20,
|
|
188
244
|
height: 5,
|
|
189
245
|
text: "文字内容",
|
|
190
246
|
fontSize: 9,
|
|
247
|
+
fontFamily: "Microsoft YaHei",
|
|
191
248
|
bold: !1,
|
|
192
249
|
align: "left",
|
|
193
250
|
color: "#000000"
|
|
@@ -198,6 +255,7 @@ const He = (s, u) => {
|
|
|
198
255
|
fieldName: "",
|
|
199
256
|
testData: "测试数据",
|
|
200
257
|
fontSize: 9,
|
|
258
|
+
fontFamily: "Microsoft YaHei",
|
|
201
259
|
bold: !1,
|
|
202
260
|
align: "left",
|
|
203
261
|
color: "#000000"
|
|
@@ -214,8 +272,35 @@ const He = (s, u) => {
|
|
|
214
272
|
height: 10,
|
|
215
273
|
content: "https://example.com",
|
|
216
274
|
fieldName: ""
|
|
275
|
+
},
|
|
276
|
+
image: {
|
|
277
|
+
width: 16,
|
|
278
|
+
height: 12,
|
|
279
|
+
content: "",
|
|
280
|
+
fieldName: ""
|
|
281
|
+
},
|
|
282
|
+
line: {
|
|
283
|
+
width: 20,
|
|
284
|
+
height: 1,
|
|
285
|
+
lineWidth: 1,
|
|
286
|
+
lineColor: "#000000"
|
|
287
|
+
},
|
|
288
|
+
rect: {
|
|
289
|
+
width: 16,
|
|
290
|
+
height: 10,
|
|
291
|
+
borderWidth: 1,
|
|
292
|
+
borderColor: "#000000",
|
|
293
|
+
fillColor: "#ffffff",
|
|
294
|
+
radius: 0
|
|
295
|
+
},
|
|
296
|
+
ellipse: {
|
|
297
|
+
width: 10,
|
|
298
|
+
height: 10,
|
|
299
|
+
borderWidth: 1,
|
|
300
|
+
borderColor: "#000000",
|
|
301
|
+
fillColor: "#ffffff"
|
|
217
302
|
}
|
|
218
|
-
},
|
|
303
|
+
}, p = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], O = [50, 60, 80, 100, 120, 150], oe = [
|
|
219
304
|
{
|
|
220
305
|
type: "text",
|
|
221
306
|
label: "文字",
|
|
@@ -239,261 +324,315 @@ const He = (s, u) => {
|
|
|
239
324
|
label: "二维码",
|
|
240
325
|
desc: "内容 / 字段",
|
|
241
326
|
thumb: '<svg viewBox="0 0 20 20" fill="currentColor"><rect x="2" y="2" width="6" height="6" fill="none" stroke="currentColor" stroke-width="1.6"/><rect x="4" y="4" width="2" height="2"/><rect x="12" y="2" width="6" height="6" fill="none" stroke="currentColor" stroke-width="1.6"/><rect x="14" y="4" width="2" height="2"/><rect x="2" y="12" width="6" height="6" fill="none" stroke="currentColor" stroke-width="1.6"/><rect x="4" y="14" width="2" height="2"/><rect x="12" y="12" width="2" height="2"/><rect x="16" y="12" width="2" height="2"/><rect x="14" y="14" width="2" height="2"/><rect x="12" y="16" width="2" height="2"/><rect x="16" y="16" width="2" height="2"/></svg>'
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
type: "image",
|
|
330
|
+
label: "图片",
|
|
331
|
+
desc: "Logo / 图片",
|
|
332
|
+
thumb: '<svg viewBox="0 0 32 20" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="26" height="14" rx="2"/><circle cx="10" cy="8" r="2"/><path d="M5 16l7-6 5 4 4-3 6 5"/></svg>'
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
type: "line",
|
|
336
|
+
label: "线条",
|
|
337
|
+
desc: "分隔线",
|
|
338
|
+
thumb: '<svg viewBox="0 0 32 20"><path d="M3 10h26" stroke="currentColor" stroke-width="2"/></svg>'
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
type: "rect",
|
|
342
|
+
label: "矩形框",
|
|
343
|
+
desc: "边框 / 底色",
|
|
344
|
+
thumb: '<svg viewBox="0 0 32 20" fill="none" stroke="currentColor" stroke-width="2"><rect x="4" y="3" width="24" height="14" rx="2"/></svg>'
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
type: "ellipse",
|
|
348
|
+
label: "圆形",
|
|
349
|
+
desc: "圆框 / 底色",
|
|
350
|
+
thumb: '<svg viewBox="0 0 32 20" fill="none" stroke="currentColor" stroke-width="2"><ellipse cx="16" cy="10" rx="10" ry="7"/></svg>'
|
|
242
351
|
}
|
|
243
|
-
],
|
|
244
|
-
let
|
|
245
|
-
const
|
|
246
|
-
() =>
|
|
247
|
-
),
|
|
248
|
-
() => x.value &&
|
|
352
|
+
], v = n, _ = M(""), ie = M(100), ae = M(!0), de = M(!0), T = M(!1), me = M(null), U = M({ v: !1, h: !1 }), re = M({}), ue = M({}), he = {}, pe = {};
|
|
353
|
+
let ve = 0;
|
|
354
|
+
const Y = F(() => v.canvas), i = F(() => x.value), b = F(() => ie.value / 10), x = F(
|
|
355
|
+
() => v.canvas.items.find((t) => t.id === _.value) || null
|
|
356
|
+
), ge = F(
|
|
357
|
+
() => x.value && h[x.value.type] || {
|
|
249
358
|
w: 2,
|
|
250
359
|
h: 2
|
|
251
360
|
}
|
|
252
|
-
),
|
|
253
|
-
width: `${
|
|
254
|
-
height: `${
|
|
255
|
-
"--ld-mm": `${
|
|
361
|
+
), Le = F(() => ({
|
|
362
|
+
width: `${v.canvas.width * b.value}px`,
|
|
363
|
+
height: `${v.canvas.height * b.value}px`,
|
|
364
|
+
"--ld-mm": `${b.value}px`
|
|
256
365
|
}));
|
|
257
|
-
function
|
|
258
|
-
return
|
|
366
|
+
function fe() {
|
|
367
|
+
return ve += 1, `it_${Date.now().toString(36)}${ve}${Math.random().toString(36).slice(2, 6)}`;
|
|
259
368
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
369
|
+
function ye(t) {
|
|
370
|
+
return m[t] || t;
|
|
262
371
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
372
|
+
function V(t) {
|
|
373
|
+
return de.value ? Math.round(t * 2) / 2 : Math.round(t * 100) / 100;
|
|
265
374
|
}
|
|
266
|
-
function
|
|
267
|
-
const e = Math.max(0,
|
|
268
|
-
return Math.min(Math.max(
|
|
375
|
+
function ee(t, l) {
|
|
376
|
+
const e = Math.max(0, v.canvas.width - l.width);
|
|
377
|
+
return Math.min(Math.max(t, 0), e);
|
|
269
378
|
}
|
|
270
|
-
function
|
|
271
|
-
const e = Math.max(0,
|
|
272
|
-
return Math.min(Math.max(
|
|
379
|
+
function le(t, l) {
|
|
380
|
+
const e = Math.max(0, v.canvas.height - l.height);
|
|
381
|
+
return Math.min(Math.max(t, 0), e);
|
|
273
382
|
}
|
|
274
|
-
function
|
|
275
|
-
const e =
|
|
383
|
+
function we(t, l = null) {
|
|
384
|
+
const e = f[t];
|
|
276
385
|
if (!e) return;
|
|
277
|
-
const o =
|
|
278
|
-
id:
|
|
279
|
-
type:
|
|
280
|
-
name: `${
|
|
386
|
+
const o = v.canvas.items, y = o.length + 1, w = {
|
|
387
|
+
id: fe(),
|
|
388
|
+
type: t,
|
|
389
|
+
name: `${m[t]}${y}`,
|
|
281
390
|
x: 0,
|
|
282
391
|
y: 0,
|
|
283
392
|
rotation: 0,
|
|
284
393
|
...e
|
|
285
394
|
};
|
|
286
|
-
|
|
395
|
+
t === "value" && !w.fieldName && (w.fieldName = `field${y}`), l ? (w.x = l.x, w.y = l.y) : (w.x = 2 + (y - 1) * 1.5 % Math.max(1, v.canvas.width - e.width), w.y = 2 + (y - 1) * 1.5 % Math.max(1, v.canvas.height - e.height)), w.x = ee(V(w.x), w), w.y = le(V(w.y), w), o.push(w), _.value = w.id;
|
|
287
396
|
}
|
|
288
|
-
function
|
|
289
|
-
const
|
|
290
|
-
e >= 0 &&
|
|
397
|
+
function xe(t) {
|
|
398
|
+
const l = v.canvas.items, e = l.indexOf(t);
|
|
399
|
+
e >= 0 && l.splice(e, 1), _.value === t.id && (_.value = "");
|
|
291
400
|
}
|
|
292
|
-
function
|
|
293
|
-
const l =
|
|
401
|
+
function Ne(t = x.value) {
|
|
402
|
+
const l = t;
|
|
294
403
|
if (!l) return;
|
|
295
|
-
const
|
|
296
|
-
|
|
404
|
+
const e = { ...l, id: fe(), name: `${l.name}-副本` };
|
|
405
|
+
e.x = ee(V(l.x + 1.5), e), e.y = le(V(l.y + 1.5), e), v.canvas.items.push(e), _.value = e.id;
|
|
297
406
|
}
|
|
298
|
-
function
|
|
299
|
-
const e =
|
|
300
|
-
o < 0 ||
|
|
407
|
+
function _e(t, l) {
|
|
408
|
+
const e = v.canvas.items, o = e.indexOf(t), y = o + l;
|
|
409
|
+
o < 0 || y < 0 || y >= e.length || (e.splice(o, 1), e.splice(y, 0, t));
|
|
301
410
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
411
|
+
function De(t, l) {
|
|
412
|
+
l.dataTransfer.effectAllowed = "copy", l.dataTransfer.setData("text/plain", t);
|
|
304
413
|
}
|
|
305
|
-
function
|
|
306
|
-
var
|
|
307
|
-
const
|
|
308
|
-
if (!
|
|
309
|
-
const e = (
|
|
414
|
+
function Te(t) {
|
|
415
|
+
var y;
|
|
416
|
+
const l = t.dataTransfer.getData("text/plain");
|
|
417
|
+
if (!f[l]) return;
|
|
418
|
+
const e = (y = me.value) == null ? void 0 : y.getBoundingClientRect();
|
|
310
419
|
if (!e) return;
|
|
311
|
-
const o =
|
|
312
|
-
|
|
313
|
-
x: (
|
|
314
|
-
y: (
|
|
420
|
+
const o = f[l];
|
|
421
|
+
we(l, {
|
|
422
|
+
x: (t.clientX - e.left) / b.value - o.width / 2,
|
|
423
|
+
y: (t.clientY - e.top) / b.value - o.height / 2
|
|
315
424
|
});
|
|
316
425
|
}
|
|
317
|
-
function
|
|
318
|
-
|
|
319
|
-
const e =
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
426
|
+
function Ie(t, l) {
|
|
427
|
+
_.value = t.id;
|
|
428
|
+
const e = l.clientX, o = l.clientY, y = t.x, w = t.y, R = (X) => {
|
|
429
|
+
const te = (X.clientX - e) / b.value, E = (X.clientY - o) / b.value;
|
|
430
|
+
let C = V(y + te), q = V(w + E);
|
|
431
|
+
const A = v.canvas.width / 2, j = v.canvas.height / 2, se = Math.abs(C + t.width / 2 - A) <= ze, ke = Math.abs(q + t.height / 2 - j) <= ze;
|
|
432
|
+
se && (C = A - t.width / 2), ke && (q = j - t.height / 2), t.x = ee(C, t), t.y = le(q, t), U.value.v = se && Math.abs(t.x + t.width / 2 - A) < 0.01, U.value.h = ke && Math.abs(t.y + t.height / 2 - j) < 0.01;
|
|
433
|
+
}, P = () => {
|
|
434
|
+
U.value.v = !1, U.value.h = !1, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", P);
|
|
324
435
|
};
|
|
325
|
-
document.addEventListener("mousemove",
|
|
436
|
+
document.addEventListener("mousemove", R), document.addEventListener("mouseup", P);
|
|
326
437
|
}
|
|
327
|
-
function
|
|
438
|
+
function Be(t, l, e) {
|
|
328
439
|
const o = {
|
|
329
440
|
mx: e.clientX,
|
|
330
441
|
my: e.clientY,
|
|
331
|
-
x:
|
|
332
|
-
y:
|
|
333
|
-
w:
|
|
334
|
-
h:
|
|
335
|
-
},
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
document.removeEventListener("mousemove",
|
|
442
|
+
x: t.x,
|
|
443
|
+
y: t.y,
|
|
444
|
+
w: t.width,
|
|
445
|
+
h: t.height
|
|
446
|
+
}, y = h[t.type] || { w: 2, h: 2 }, w = (P) => {
|
|
447
|
+
const X = (P.clientX - o.mx) / b.value, te = (P.clientY - o.my) / b.value;
|
|
448
|
+
let E = o.w, C = o.h, q = o.x, A = o.y;
|
|
449
|
+
l.includes("e") && (E = o.w + X), l.includes("s") && (C = o.h + te), l.includes("w") && (E = o.w - X), l.includes("n") && (C = o.h - te);
|
|
450
|
+
const j = l.includes("w") ? o.x + o.w : v.canvas.width - o.x, se = l.includes("n") ? o.y + o.h : v.canvas.height - o.y;
|
|
451
|
+
E = Math.max(y.w, Math.min(V(E), j)), C = Math.max(y.h, Math.min(V(C), se)), l.includes("w") && (q = Math.max(0, o.x + o.w - E)), l.includes("n") && (A = Math.max(0, o.y + o.h - C)), t.x = V(q), t.y = V(A), t.width = V(E), t.height = V(C);
|
|
452
|
+
}, R = () => {
|
|
453
|
+
document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", R);
|
|
343
454
|
};
|
|
344
|
-
document.addEventListener("mousemove",
|
|
455
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", R);
|
|
345
456
|
}
|
|
346
|
-
function
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
457
|
+
function be(t) {
|
|
458
|
+
const l = document.activeElement;
|
|
459
|
+
if (l && (l.tagName === "INPUT" || l.tagName === "TEXTAREA" || l.tagName === "SELECT" || l.isContentEditable))
|
|
349
460
|
return;
|
|
350
461
|
const e = x.value;
|
|
351
462
|
if (!e) return;
|
|
352
|
-
const o =
|
|
463
|
+
const o = t.shiftKey ? 2 : 0.5, y = {
|
|
353
464
|
ArrowLeft: [-o, 0],
|
|
354
465
|
ArrowRight: [o, 0],
|
|
355
466
|
ArrowUp: [0, -o],
|
|
356
467
|
ArrowDown: [0, o]
|
|
357
468
|
};
|
|
358
|
-
|
|
469
|
+
y[t.key] ? (t.preventDefault(), e.x = ee(V(e.x + y[t.key][0]), e), e.y = le(V(e.y + y[t.key][1]), e)) : t.key === "Delete" || t.key === "Backspace" ? (t.preventDefault(), xe(e)) : t.key === "Escape" && (_.value = "");
|
|
359
470
|
}
|
|
360
|
-
|
|
361
|
-
document.addEventListener("keydown",
|
|
362
|
-
}),
|
|
363
|
-
document.removeEventListener("keydown",
|
|
364
|
-
}),
|
|
365
|
-
() =>
|
|
471
|
+
We(() => {
|
|
472
|
+
document.addEventListener("keydown", be);
|
|
473
|
+
}), Oe(() => {
|
|
474
|
+
document.removeEventListener("keydown", be);
|
|
475
|
+
}), $e(
|
|
476
|
+
() => v.canvas,
|
|
366
477
|
() => {
|
|
367
|
-
|
|
478
|
+
_.value = "", U.value.v = !1, U.value.h = !1;
|
|
368
479
|
}
|
|
369
480
|
);
|
|
370
|
-
function
|
|
371
|
-
for (const
|
|
372
|
-
if (
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
481
|
+
function Ye() {
|
|
482
|
+
for (const t of v.canvas.items)
|
|
483
|
+
if (t.type === "barcode") {
|
|
484
|
+
const l = T.value ? W(t, v.mockData) : t.content, e = [
|
|
485
|
+
t.id,
|
|
486
|
+
l,
|
|
487
|
+
t.width,
|
|
488
|
+
t.height,
|
|
489
|
+
t.showValue ? 1 : 0
|
|
379
490
|
].join("|");
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
491
|
+
he[t.id] !== e && (he[t.id] = e, re.value[t.id] = Ue(
|
|
492
|
+
l,
|
|
493
|
+
t.width,
|
|
494
|
+
t.height,
|
|
495
|
+
t.showValue !== !1
|
|
385
496
|
));
|
|
386
|
-
} else if (
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
497
|
+
} else if (t.type === "qrcode") {
|
|
498
|
+
const l = T.value ? W(t, v.mockData) : t.content, e = `${t.id}|${l}`;
|
|
499
|
+
pe[t.id] !== e && (pe[t.id] = e, Ee(l).then((o) => {
|
|
500
|
+
ue.value[t.id] = o;
|
|
390
501
|
}));
|
|
391
502
|
}
|
|
392
503
|
}
|
|
393
|
-
|
|
394
|
-
[() =>
|
|
395
|
-
|
|
504
|
+
$e(
|
|
505
|
+
[() => v.canvas.items, T, () => v.mockData],
|
|
506
|
+
Ye,
|
|
396
507
|
{ deep: !0, immediate: !0 }
|
|
397
508
|
);
|
|
398
|
-
function
|
|
509
|
+
function Re(t) {
|
|
399
510
|
return {
|
|
400
|
-
left: `${
|
|
401
|
-
top: `${
|
|
402
|
-
width: `${
|
|
403
|
-
height: `${
|
|
404
|
-
transform:
|
|
511
|
+
left: `${t.x * b.value}px`,
|
|
512
|
+
top: `${t.y * b.value}px`,
|
|
513
|
+
width: `${t.width * b.value}px`,
|
|
514
|
+
height: `${t.height * b.value}px`,
|
|
515
|
+
transform: t.rotation ? `rotate(${t.rotation}deg)` : void 0
|
|
405
516
|
};
|
|
406
517
|
}
|
|
407
|
-
function
|
|
518
|
+
function qe(t) {
|
|
408
519
|
return {
|
|
409
|
-
fontSize: `${((
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
520
|
+
fontSize: `${((t.fontSize || 9) * Ke * b.value).toFixed(2)}px`,
|
|
521
|
+
fontFamily: t.fontFamily || "Microsoft YaHei",
|
|
522
|
+
fontWeight: t.bold ? "700" : "400",
|
|
523
|
+
textAlign: t.align || "left",
|
|
524
|
+
color: t.color || "#000000"
|
|
413
525
|
};
|
|
414
526
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
527
|
+
function Ae(t) {
|
|
528
|
+
return t.type === "value" ? T.value ? Se(t, v.mockData) : String(t.testData ?? "") : String(t.text ?? "");
|
|
529
|
+
}
|
|
530
|
+
function Ve(t) {
|
|
531
|
+
return T.value && t.fieldName ? W(t, v.mockData) : String(t.content ?? "");
|
|
532
|
+
}
|
|
533
|
+
function Fe(t) {
|
|
534
|
+
return {
|
|
535
|
+
"--ld-line-w": `${t.lineWidth || 1}px`,
|
|
536
|
+
"--ld-line-c": t.lineColor || "#000000"
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function He(t) {
|
|
540
|
+
return {
|
|
541
|
+
border: `${t.borderWidth || 0}px solid ${t.borderColor || "#000000"}`,
|
|
542
|
+
background: t.fillColor || "#ffffff",
|
|
543
|
+
borderRadius: t.type === "ellipse" ? "50%" : `${t.radius || 0}px`
|
|
544
|
+
};
|
|
417
545
|
}
|
|
418
|
-
return (
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
(
|
|
546
|
+
return (t, l) => (u(), c("div", ll, [
|
|
547
|
+
s("aside", tl, [
|
|
548
|
+
sl,
|
|
549
|
+
nl,
|
|
550
|
+
s("div", ol, [
|
|
551
|
+
(u(), c(k, null, H(oe, (e) => s("div", {
|
|
424
552
|
key: e.type,
|
|
425
553
|
class: "ldesign-palette-item",
|
|
426
554
|
draggable: "true",
|
|
427
|
-
onDragstart: (o) =>
|
|
428
|
-
onClick: (o) =>
|
|
555
|
+
onDragstart: (o) => De(e.type, o),
|
|
556
|
+
onClick: (o) => we(e.type)
|
|
429
557
|
}, [
|
|
430
|
-
|
|
558
|
+
s("span", {
|
|
431
559
|
class: "ldesign-palette-thumb",
|
|
432
560
|
innerHTML: e.thumb
|
|
433
|
-
}, null, 8,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
], 40,
|
|
561
|
+
}, null, 8, al),
|
|
562
|
+
s("span", dl, L(e.label), 1),
|
|
563
|
+
s("span", rl, L(e.desc), 1)
|
|
564
|
+
], 40, il)), 64))
|
|
437
565
|
]),
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
(
|
|
566
|
+
ul,
|
|
567
|
+
s("div", cl, [
|
|
568
|
+
(u(!0), c(k, null, H(n.canvas.items, (e) => (u(), c("div", {
|
|
441
569
|
key: e.id,
|
|
442
|
-
class:
|
|
443
|
-
onClick: (o) =>
|
|
570
|
+
class: I(["ldesign-layer", { "is-active": e.id === _.value }]),
|
|
571
|
+
onClick: (o) => _.value = e.id
|
|
444
572
|
}, [
|
|
445
|
-
|
|
446
|
-
class:
|
|
447
|
-
},
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
573
|
+
s("span", {
|
|
574
|
+
class: I(["ldesign-layer-tag", `is-${e.type}`])
|
|
575
|
+
}, L(ye(e.type)), 3),
|
|
576
|
+
s("span", hl, L(e.name), 1),
|
|
577
|
+
s("span", pl, [
|
|
578
|
+
a(d(J), {
|
|
451
579
|
size: "small",
|
|
452
580
|
circle: "",
|
|
453
|
-
|
|
581
|
+
title: "复制元素",
|
|
582
|
+
onClick: N((o) => Ne(e), ["stop"])
|
|
454
583
|
}, {
|
|
455
|
-
default:
|
|
456
|
-
|
|
584
|
+
default: D(() => [
|
|
585
|
+
K("复")
|
|
457
586
|
]),
|
|
458
587
|
_: 2
|
|
459
588
|
}, 1032, ["onClick"]),
|
|
460
|
-
|
|
589
|
+
a(d(J), {
|
|
461
590
|
size: "small",
|
|
462
591
|
circle: "",
|
|
463
|
-
onClick:
|
|
592
|
+
onClick: N((o) => _e(e, -1), ["stop"])
|
|
464
593
|
}, {
|
|
465
|
-
default:
|
|
466
|
-
|
|
594
|
+
default: D(() => [
|
|
595
|
+
K("↑")
|
|
467
596
|
]),
|
|
468
597
|
_: 2
|
|
469
598
|
}, 1032, ["onClick"]),
|
|
470
|
-
|
|
599
|
+
a(d(J), {
|
|
471
600
|
size: "small",
|
|
472
601
|
circle: "",
|
|
473
|
-
onClick:
|
|
602
|
+
onClick: N((o) => _e(e, 1), ["stop"])
|
|
474
603
|
}, {
|
|
475
|
-
default:
|
|
476
|
-
|
|
604
|
+
default: D(() => [
|
|
605
|
+
K("↓")
|
|
606
|
+
]),
|
|
607
|
+
_: 2
|
|
608
|
+
}, 1032, ["onClick"]),
|
|
609
|
+
a(d(J), {
|
|
610
|
+
size: "small",
|
|
611
|
+
circle: "",
|
|
612
|
+
onClick: N((o) => xe(e), ["stop"])
|
|
613
|
+
}, {
|
|
614
|
+
default: D(() => [
|
|
615
|
+
K("×")
|
|
477
616
|
]),
|
|
478
617
|
_: 2
|
|
479
618
|
}, 1032, ["onClick"])
|
|
480
619
|
])
|
|
481
|
-
], 10,
|
|
482
|
-
|
|
620
|
+
], 10, ml))), 128)),
|
|
621
|
+
n.canvas.items.length ? z("", !0) : (u(), c("div", vl, "暂无元素"))
|
|
483
622
|
])
|
|
484
623
|
]),
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
modelValue:
|
|
491
|
-
"onUpdate:modelValue":
|
|
624
|
+
s("section", gl, [
|
|
625
|
+
s("div", fl, [
|
|
626
|
+
s("div", yl, [
|
|
627
|
+
wl,
|
|
628
|
+
a(d(ce), {
|
|
629
|
+
modelValue: ie.value,
|
|
630
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => ie.value = e),
|
|
492
631
|
size: "small",
|
|
493
632
|
class: "ldesign-zoom-select"
|
|
494
633
|
}, {
|
|
495
|
-
default:
|
|
496
|
-
(
|
|
634
|
+
default: D(() => [
|
|
635
|
+
(u(), c(k, null, H(O, (e) => a(d(Q), {
|
|
497
636
|
key: e,
|
|
498
637
|
label: `${e}%`,
|
|
499
638
|
value: e
|
|
@@ -501,162 +640,275 @@ const He = (s, u) => {
|
|
|
501
640
|
]),
|
|
502
641
|
_: 1
|
|
503
642
|
}, 8, ["modelValue"]),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
modelValue:
|
|
507
|
-
"onUpdate:modelValue":
|
|
643
|
+
s("span", xl, [
|
|
644
|
+
a(d(Z), {
|
|
645
|
+
modelValue: ae.value,
|
|
646
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => ae.value = e),
|
|
508
647
|
size: "small"
|
|
509
648
|
}, null, 8, ["modelValue"]),
|
|
510
|
-
|
|
649
|
+
_l
|
|
511
650
|
]),
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
modelValue:
|
|
515
|
-
"onUpdate:modelValue":
|
|
651
|
+
s("span", bl, [
|
|
652
|
+
a(d(Z), {
|
|
653
|
+
modelValue: de.value,
|
|
654
|
+
"onUpdate:modelValue": l[2] || (l[2] = (e) => de.value = e),
|
|
516
655
|
size: "small"
|
|
517
656
|
}, null, 8, ["modelValue"]),
|
|
518
|
-
|
|
657
|
+
Vl
|
|
519
658
|
]),
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
modelValue:
|
|
523
|
-
"onUpdate:modelValue":
|
|
659
|
+
s("span", kl, [
|
|
660
|
+
a(d(Z), {
|
|
661
|
+
modelValue: T.value,
|
|
662
|
+
"onUpdate:modelValue": l[3] || (l[3] = (e) => T.value = e),
|
|
524
663
|
size: "small"
|
|
525
664
|
}, null, 8, ["modelValue"]),
|
|
526
|
-
|
|
665
|
+
$l
|
|
527
666
|
])
|
|
528
667
|
]),
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
668
|
+
s("div", Cl, [
|
|
669
|
+
s("span", Ml, L(n.canvas.width) + " × " + L(n.canvas.height) + " mm", 1),
|
|
670
|
+
a(d(J), {
|
|
532
671
|
size: "small",
|
|
533
|
-
onClick:
|
|
672
|
+
onClick: l[4] || (l[4] = (e) => _.value = "")
|
|
534
673
|
}, {
|
|
535
|
-
default:
|
|
536
|
-
|
|
674
|
+
default: D(() => [
|
|
675
|
+
K("画布设置")
|
|
537
676
|
]),
|
|
538
677
|
_: 1
|
|
539
678
|
})
|
|
540
679
|
])
|
|
541
680
|
]),
|
|
542
|
-
|
|
543
|
-
|
|
681
|
+
s("div", zl, [
|
|
682
|
+
s("div", {
|
|
544
683
|
ref_key: "paperRef",
|
|
545
|
-
ref:
|
|
546
|
-
class:
|
|
547
|
-
style:
|
|
548
|
-
onDragover:
|
|
684
|
+
ref: me,
|
|
685
|
+
class: I(["ldesign-paper", { "is-grid": ae.value }]),
|
|
686
|
+
style: G(Le.value),
|
|
687
|
+
onDragover: l[5] || (l[5] = N(() => {
|
|
549
688
|
}, ["prevent"])),
|
|
550
|
-
onDrop:
|
|
551
|
-
onMousedown:
|
|
689
|
+
onDrop: Te,
|
|
690
|
+
onMousedown: l[6] || (l[6] = N((e) => _.value = "", ["self"]))
|
|
552
691
|
}, [
|
|
553
|
-
(
|
|
692
|
+
(u(!0), c(k, null, H(n.canvas.items, (e) => (u(), c("div", {
|
|
554
693
|
key: e.id,
|
|
555
|
-
class:
|
|
556
|
-
style:
|
|
557
|
-
onMousedown:
|
|
694
|
+
class: I(["ldesign-item", [`is-${e.type}`, { "is-selected": e.id === _.value }]]),
|
|
695
|
+
style: G(Re(e)),
|
|
696
|
+
onMousedown: N((o) => Ie(e, o), ["stop", "prevent"])
|
|
558
697
|
}, [
|
|
559
|
-
e.type === "text" || e.type === "value" ? (
|
|
698
|
+
e.type === "text" || e.type === "value" ? (u(), c("div", {
|
|
560
699
|
key: 0,
|
|
561
700
|
class: "ldesign-item-text",
|
|
562
|
-
style:
|
|
563
|
-
},
|
|
701
|
+
style: G(qe(e))
|
|
702
|
+
}, L(Ae(e)), 5)) : e.type === "image" && Ve(e) ? (u(), c("img", {
|
|
564
703
|
key: 1,
|
|
565
704
|
class: "ldesign-item-img is-fill",
|
|
566
|
-
src:
|
|
705
|
+
src: Ve(e),
|
|
706
|
+
alt: "图片",
|
|
707
|
+
draggable: "false"
|
|
708
|
+
}, null, 8, Ul)) : e.type === "image" ? (u(), c("div", El, " 图片 ")) : e.type === "line" ? (u(), c("div", {
|
|
709
|
+
key: 3,
|
|
710
|
+
class: I(["ldesign-item-line", { "is-v": e.width < e.height }]),
|
|
711
|
+
style: G(Fe(e))
|
|
712
|
+
}, null, 6)) : e.type === "rect" || e.type === "ellipse" ? (u(), c("div", {
|
|
713
|
+
key: 4,
|
|
714
|
+
class: I(["ldesign-item-rect", { "is-ellipse": e.type === "ellipse" }]),
|
|
715
|
+
style: G(He(e))
|
|
716
|
+
}, null, 6)) : e.type === "barcode" && re.value[e.id] ? (u(), c("img", {
|
|
717
|
+
key: 5,
|
|
718
|
+
class: "ldesign-item-img is-fill",
|
|
719
|
+
src: re.value[e.id],
|
|
567
720
|
alt: "条形码",
|
|
568
721
|
draggable: "false"
|
|
569
|
-
}, null, 8,
|
|
570
|
-
key:
|
|
722
|
+
}, null, 8, Ll)) : e.type === "qrcode" && ue.value[e.id] ? (u(), c("img", {
|
|
723
|
+
key: 6,
|
|
571
724
|
class: "ldesign-item-img is-contain",
|
|
572
|
-
src:
|
|
725
|
+
src: ue.value[e.id],
|
|
573
726
|
alt: "二维码",
|
|
574
727
|
draggable: "false"
|
|
575
|
-
}, null, 8,
|
|
576
|
-
e.type === "value" ? (
|
|
577
|
-
e.id ===
|
|
728
|
+
}, null, 8, Nl)) : e.type === "barcode" ? (u(), c("div", Dl, " 条形码内容无效 ")) : e.type === "qrcode" ? (u(), c("div", Tl, " 二维码内容无效 ")) : z("", !0),
|
|
729
|
+
e.type === "value" ? (u(), c("span", Il, "动态")) : z("", !0),
|
|
730
|
+
e.id === _.value ? (u(), c(k, { key: 10 }, H(p, (o) => s("span", {
|
|
578
731
|
key: o,
|
|
579
|
-
class:
|
|
580
|
-
onMousedown:
|
|
581
|
-
}, null, 42,
|
|
582
|
-
], 46,
|
|
732
|
+
class: I(["ldesign-handle", `is-${o}`]),
|
|
733
|
+
onMousedown: N((y) => Be(e, o, y), ["stop", "prevent"])
|
|
734
|
+
}, null, 42, Bl)), 64)) : z("", !0)
|
|
735
|
+
], 46, Sl))), 128)),
|
|
736
|
+
U.value.v ? (u(), c("div", Yl)) : z("", !0),
|
|
737
|
+
U.value.h ? (u(), c("div", Rl)) : z("", !0)
|
|
583
738
|
], 38)
|
|
584
|
-
])
|
|
585
|
-
St
|
|
739
|
+
])
|
|
586
740
|
]),
|
|
587
|
-
|
|
588
|
-
x.value ? (
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
modelValue:
|
|
595
|
-
"onUpdate:modelValue":
|
|
741
|
+
s("aside", ql, [
|
|
742
|
+
x.value ? (u(), c(k, { key: 0 }, [
|
|
743
|
+
s("div", Al, " 元素设置 · " + L(ye(x.value.type)), 1),
|
|
744
|
+
s("div", Fl, [
|
|
745
|
+
s("div", Hl, [
|
|
746
|
+
Wl,
|
|
747
|
+
a(d(S), {
|
|
748
|
+
modelValue: i.value.name,
|
|
749
|
+
"onUpdate:modelValue": l[7] || (l[7] = (e) => i.value.name = e),
|
|
596
750
|
size: "small"
|
|
597
751
|
}, null, 8, ["modelValue"])
|
|
598
752
|
]),
|
|
599
|
-
x.value.type === "text" ? (
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
modelValue:
|
|
603
|
-
"onUpdate:modelValue":
|
|
753
|
+
x.value.type === "text" ? (u(), c("div", Ol, [
|
|
754
|
+
Pl,
|
|
755
|
+
a(d(S), {
|
|
756
|
+
modelValue: i.value.text,
|
|
757
|
+
"onUpdate:modelValue": l[8] || (l[8] = (e) => i.value.text = e),
|
|
604
758
|
type: "textarea",
|
|
605
759
|
rows: 2,
|
|
606
760
|
size: "small"
|
|
607
761
|
}, null, 8, ["modelValue"])
|
|
608
|
-
])) : x.value.type === "value" ? (
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
modelValue:
|
|
613
|
-
"onUpdate:modelValue":
|
|
762
|
+
])) : x.value.type === "value" ? (u(), c(k, { key: 1 }, [
|
|
763
|
+
s("div", Xl, [
|
|
764
|
+
jl,
|
|
765
|
+
a(d(S), {
|
|
766
|
+
modelValue: i.value.fieldName,
|
|
767
|
+
"onUpdate:modelValue": l[9] || (l[9] = (e) => i.value.fieldName = e),
|
|
614
768
|
size: "small",
|
|
615
769
|
placeholder: "数据里的字段标识,如 subjectName"
|
|
616
770
|
}, null, 8, ["modelValue"])
|
|
617
771
|
]),
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
modelValue:
|
|
622
|
-
"onUpdate:modelValue":
|
|
772
|
+
s("div", Kl, [
|
|
773
|
+
Gl,
|
|
774
|
+
a(d(S), {
|
|
775
|
+
modelValue: i.value.testData,
|
|
776
|
+
"onUpdate:modelValue": l[10] || (l[10] = (e) => i.value.testData = e),
|
|
623
777
|
size: "small",
|
|
624
778
|
placeholder: "画布上直接显示的文字"
|
|
625
779
|
}, null, 8, ["modelValue"])
|
|
626
780
|
]),
|
|
627
|
-
|
|
628
|
-
], 64)) : (
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
modelValue:
|
|
633
|
-
"onUpdate:modelValue":
|
|
781
|
+
Jl
|
|
782
|
+
], 64)) : x.value.type === "image" ? (u(), c(k, { key: 2 }, [
|
|
783
|
+
s("div", Ql, [
|
|
784
|
+
Zl,
|
|
785
|
+
a(d(S), {
|
|
786
|
+
modelValue: i.value.content,
|
|
787
|
+
"onUpdate:modelValue": l[11] || (l[11] = (e) => i.value.content = e),
|
|
788
|
+
size: "small",
|
|
789
|
+
placeholder: "图片链接或 dataURL"
|
|
790
|
+
}, null, 8, ["modelValue"])
|
|
791
|
+
]),
|
|
792
|
+
s("div", et, [
|
|
793
|
+
lt,
|
|
794
|
+
a(d(S), {
|
|
795
|
+
modelValue: i.value.fieldName,
|
|
796
|
+
"onUpdate:modelValue": l[12] || (l[12] = (e) => i.value.fieldName = e),
|
|
797
|
+
size: "small",
|
|
798
|
+
placeholder: "填了字段名,打印时优先取模拟数据"
|
|
799
|
+
}, null, 8, ["modelValue"])
|
|
800
|
+
])
|
|
801
|
+
], 64)) : x.value.type === "barcode" || x.value.type === "qrcode" ? (u(), c(k, { key: 3 }, [
|
|
802
|
+
s("div", tt, [
|
|
803
|
+
st,
|
|
804
|
+
a(d(S), {
|
|
805
|
+
modelValue: i.value.content,
|
|
806
|
+
"onUpdate:modelValue": l[13] || (l[13] = (e) => i.value.content = e),
|
|
634
807
|
size: "small"
|
|
635
808
|
}, null, 8, ["modelValue"])
|
|
636
809
|
]),
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
modelValue:
|
|
641
|
-
"onUpdate:modelValue":
|
|
810
|
+
s("div", nt, [
|
|
811
|
+
ot,
|
|
812
|
+
a(d(S), {
|
|
813
|
+
modelValue: i.value.fieldName,
|
|
814
|
+
"onUpdate:modelValue": l[14] || (l[14] = (e) => i.value.fieldName = e),
|
|
642
815
|
size: "small",
|
|
643
816
|
placeholder: "填了字段名,打印时优先取模拟数据"
|
|
644
817
|
}, null, 8, ["modelValue"])
|
|
645
818
|
]),
|
|
646
|
-
x.value.type === "barcode" ? (
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
modelValue:
|
|
650
|
-
"onUpdate:modelValue":
|
|
819
|
+
x.value.type === "barcode" ? (u(), c("div", it, [
|
|
820
|
+
at,
|
|
821
|
+
a(d(Z), {
|
|
822
|
+
modelValue: i.value.showValue,
|
|
823
|
+
"onUpdate:modelValue": l[15] || (l[15] = (e) => i.value.showValue = e)
|
|
824
|
+
}, null, 8, ["modelValue"])
|
|
825
|
+
])) : z("", !0)
|
|
826
|
+
], 64)) : x.value.type === "line" ? (u(), c("div", dt, [
|
|
827
|
+
s("div", rt, [
|
|
828
|
+
ut,
|
|
829
|
+
a(d($), {
|
|
830
|
+
modelValue: i.value.lineWidth,
|
|
831
|
+
"onUpdate:modelValue": l[16] || (l[16] = (e) => i.value.lineWidth = e),
|
|
832
|
+
min: 0.5,
|
|
833
|
+
max: 10,
|
|
834
|
+
step: 0.5,
|
|
835
|
+
size: "small",
|
|
836
|
+
style: { width: "100%" }
|
|
837
|
+
}, null, 8, ["modelValue"])
|
|
838
|
+
]),
|
|
839
|
+
s("div", ct, [
|
|
840
|
+
mt,
|
|
841
|
+
a(d(ne), {
|
|
842
|
+
modelValue: i.value.lineColor,
|
|
843
|
+
"onUpdate:modelValue": l[17] || (l[17] = (e) => i.value.lineColor = e),
|
|
844
|
+
size: "small"
|
|
651
845
|
}, null, 8, ["modelValue"])
|
|
652
|
-
])
|
|
653
|
-
]
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
modelValue:
|
|
659
|
-
|
|
846
|
+
])
|
|
847
|
+
])) : (u(), c("div", ht, [
|
|
848
|
+
s("div", pt, [
|
|
849
|
+
vt,
|
|
850
|
+
a(d($), {
|
|
851
|
+
modelValue: i.value.borderWidth,
|
|
852
|
+
"onUpdate:modelValue": l[18] || (l[18] = (e) => i.value.borderWidth = e),
|
|
853
|
+
min: 0,
|
|
854
|
+
max: 10,
|
|
855
|
+
step: 0.5,
|
|
856
|
+
size: "small",
|
|
857
|
+
style: { width: "100%" }
|
|
858
|
+
}, null, 8, ["modelValue"])
|
|
859
|
+
]),
|
|
860
|
+
s("div", gt, [
|
|
861
|
+
ft,
|
|
862
|
+
a(d(ne), {
|
|
863
|
+
modelValue: i.value.borderColor,
|
|
864
|
+
"onUpdate:modelValue": l[19] || (l[19] = (e) => i.value.borderColor = e),
|
|
865
|
+
size: "small"
|
|
866
|
+
}, null, 8, ["modelValue"])
|
|
867
|
+
]),
|
|
868
|
+
s("div", yt, [
|
|
869
|
+
wt,
|
|
870
|
+
a(d(ne), {
|
|
871
|
+
modelValue: i.value.fillColor,
|
|
872
|
+
"onUpdate:modelValue": l[20] || (l[20] = (e) => i.value.fillColor = e),
|
|
873
|
+
size: "small"
|
|
874
|
+
}, null, 8, ["modelValue"])
|
|
875
|
+
]),
|
|
876
|
+
x.value.type === "rect" ? (u(), c("div", xt, [
|
|
877
|
+
_t,
|
|
878
|
+
a(d($), {
|
|
879
|
+
modelValue: i.value.radius,
|
|
880
|
+
"onUpdate:modelValue": l[21] || (l[21] = (e) => i.value.radius = e),
|
|
881
|
+
min: 0,
|
|
882
|
+
max: 30,
|
|
883
|
+
step: 1,
|
|
884
|
+
size: "small",
|
|
885
|
+
style: { width: "100%" }
|
|
886
|
+
}, null, 8, ["modelValue"])
|
|
887
|
+
])) : z("", !0)
|
|
888
|
+
])),
|
|
889
|
+
x.value.type === "text" || x.value.type === "value" ? (u(), c("div", bt, [
|
|
890
|
+
s("div", Vt, [
|
|
891
|
+
kt,
|
|
892
|
+
a(d(ce), {
|
|
893
|
+
modelValue: i.value.fontFamily,
|
|
894
|
+
"onUpdate:modelValue": l[22] || (l[22] = (e) => i.value.fontFamily = e),
|
|
895
|
+
size: "small"
|
|
896
|
+
}, {
|
|
897
|
+
default: D(() => [
|
|
898
|
+
(u(), c(k, null, H(g, (e) => a(d(Q), {
|
|
899
|
+
key: e,
|
|
900
|
+
label: e,
|
|
901
|
+
value: e
|
|
902
|
+
}, null, 8, ["label", "value"])), 64))
|
|
903
|
+
]),
|
|
904
|
+
_: 1
|
|
905
|
+
}, 8, ["modelValue"])
|
|
906
|
+
]),
|
|
907
|
+
s("div", $t, [
|
|
908
|
+
Ct,
|
|
909
|
+
a(d($), {
|
|
910
|
+
modelValue: i.value.fontSize,
|
|
911
|
+
"onUpdate:modelValue": l[23] || (l[23] = (e) => i.value.fontSize = e),
|
|
660
912
|
min: 4,
|
|
661
913
|
max: 72,
|
|
662
914
|
step: 0.5,
|
|
@@ -664,30 +916,30 @@ const He = (s, u) => {
|
|
|
664
916
|
style: { width: "100%" }
|
|
665
917
|
}, null, 8, ["modelValue"])
|
|
666
918
|
]),
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
modelValue:
|
|
671
|
-
"onUpdate:modelValue":
|
|
919
|
+
s("div", Mt, [
|
|
920
|
+
zt,
|
|
921
|
+
a(d(Z), {
|
|
922
|
+
modelValue: i.value.bold,
|
|
923
|
+
"onUpdate:modelValue": l[24] || (l[24] = (e) => i.value.bold = e)
|
|
672
924
|
}, null, 8, ["modelValue"])
|
|
673
925
|
]),
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
modelValue:
|
|
678
|
-
"onUpdate:modelValue":
|
|
926
|
+
s("div", St, [
|
|
927
|
+
Ut,
|
|
928
|
+
a(d(ce), {
|
|
929
|
+
modelValue: i.value.align,
|
|
930
|
+
"onUpdate:modelValue": l[25] || (l[25] = (e) => i.value.align = e),
|
|
679
931
|
size: "small"
|
|
680
932
|
}, {
|
|
681
|
-
default:
|
|
682
|
-
|
|
933
|
+
default: D(() => [
|
|
934
|
+
a(d(Q), {
|
|
683
935
|
label: "左对齐",
|
|
684
936
|
value: "left"
|
|
685
937
|
}),
|
|
686
|
-
|
|
938
|
+
a(d(Q), {
|
|
687
939
|
label: "居中",
|
|
688
940
|
value: "center"
|
|
689
941
|
}),
|
|
690
|
-
|
|
942
|
+
a(d(Q), {
|
|
691
943
|
label: "右对齐",
|
|
692
944
|
value: "right"
|
|
693
945
|
})
|
|
@@ -695,65 +947,65 @@ const He = (s, u) => {
|
|
|
695
947
|
_: 1
|
|
696
948
|
}, 8, ["modelValue"])
|
|
697
949
|
]),
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
modelValue:
|
|
702
|
-
"onUpdate:modelValue":
|
|
950
|
+
s("div", Et, [
|
|
951
|
+
Lt,
|
|
952
|
+
a(d(ne), {
|
|
953
|
+
modelValue: i.value.color,
|
|
954
|
+
"onUpdate:modelValue": l[26] || (l[26] = (e) => i.value.color = e),
|
|
703
955
|
size: "small"
|
|
704
956
|
}, null, 8, ["modelValue"])
|
|
705
957
|
])
|
|
706
|
-
])) :
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
modelValue:
|
|
712
|
-
"onUpdate:modelValue":
|
|
958
|
+
])) : z("", !0),
|
|
959
|
+
s("div", Nt, [
|
|
960
|
+
s("div", Dt, [
|
|
961
|
+
Tt,
|
|
962
|
+
a(d($), {
|
|
963
|
+
modelValue: i.value.x,
|
|
964
|
+
"onUpdate:modelValue": l[27] || (l[27] = (e) => i.value.x = e),
|
|
713
965
|
min: 0,
|
|
714
966
|
step: 0.5,
|
|
715
967
|
size: "small",
|
|
716
968
|
style: { width: "100%" }
|
|
717
969
|
}, null, 8, ["modelValue"])
|
|
718
970
|
]),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
modelValue:
|
|
723
|
-
"onUpdate:modelValue":
|
|
971
|
+
s("div", It, [
|
|
972
|
+
Bt,
|
|
973
|
+
a(d($), {
|
|
974
|
+
modelValue: i.value.y,
|
|
975
|
+
"onUpdate:modelValue": l[28] || (l[28] = (e) => i.value.y = e),
|
|
724
976
|
min: 0,
|
|
725
977
|
step: 0.5,
|
|
726
978
|
size: "small",
|
|
727
979
|
style: { width: "100%" }
|
|
728
980
|
}, null, 8, ["modelValue"])
|
|
729
981
|
]),
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
modelValue:
|
|
734
|
-
"onUpdate:modelValue":
|
|
735
|
-
min:
|
|
982
|
+
s("div", Yt, [
|
|
983
|
+
Rt,
|
|
984
|
+
a(d($), {
|
|
985
|
+
modelValue: i.value.width,
|
|
986
|
+
"onUpdate:modelValue": l[29] || (l[29] = (e) => i.value.width = e),
|
|
987
|
+
min: ge.value.w,
|
|
736
988
|
step: 0.5,
|
|
737
989
|
size: "small",
|
|
738
990
|
style: { width: "100%" }
|
|
739
991
|
}, null, 8, ["modelValue", "min"])
|
|
740
992
|
]),
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
modelValue:
|
|
745
|
-
"onUpdate:modelValue":
|
|
746
|
-
min:
|
|
993
|
+
s("div", qt, [
|
|
994
|
+
At,
|
|
995
|
+
a(d($), {
|
|
996
|
+
modelValue: i.value.height,
|
|
997
|
+
"onUpdate:modelValue": l[30] || (l[30] = (e) => i.value.height = e),
|
|
998
|
+
min: ge.value.h,
|
|
747
999
|
step: 0.5,
|
|
748
1000
|
size: "small",
|
|
749
1001
|
style: { width: "100%" }
|
|
750
1002
|
}, null, 8, ["modelValue", "min"])
|
|
751
1003
|
]),
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
modelValue:
|
|
756
|
-
"onUpdate:modelValue":
|
|
1004
|
+
s("div", Ft, [
|
|
1005
|
+
Ht,
|
|
1006
|
+
a(d($), {
|
|
1007
|
+
modelValue: i.value.rotation,
|
|
1008
|
+
"onUpdate:modelValue": l[31] || (l[31] = (e) => i.value.rotation = e),
|
|
757
1009
|
min: 0,
|
|
758
1010
|
max: 359,
|
|
759
1011
|
step: 15,
|
|
@@ -761,76 +1013,36 @@ const He = (s, u) => {
|
|
|
761
1013
|
style: { width: "100%" }
|
|
762
1014
|
}, null, 8, ["modelValue"])
|
|
763
1015
|
])
|
|
764
|
-
]),
|
|
765
|
-
n("div", hl, [
|
|
766
|
-
i(a(E), {
|
|
767
|
-
size: "small",
|
|
768
|
-
onClick: $e
|
|
769
|
-
}, {
|
|
770
|
-
default: k(() => [
|
|
771
|
-
C("复制")
|
|
772
|
-
]),
|
|
773
|
-
_: 1
|
|
774
|
-
}),
|
|
775
|
-
i(a(E), {
|
|
776
|
-
size: "small",
|
|
777
|
-
onClick: t[23] || (t[23] = (e) => F(x.value, -1))
|
|
778
|
-
}, {
|
|
779
|
-
default: k(() => [
|
|
780
|
-
C("上移图层")
|
|
781
|
-
]),
|
|
782
|
-
_: 1
|
|
783
|
-
}),
|
|
784
|
-
i(a(E), {
|
|
785
|
-
size: "small",
|
|
786
|
-
onClick: t[24] || (t[24] = (e) => F(x.value, 1))
|
|
787
|
-
}, {
|
|
788
|
-
default: k(() => [
|
|
789
|
-
C("下移图层")
|
|
790
|
-
]),
|
|
791
|
-
_: 1
|
|
792
|
-
}),
|
|
793
|
-
i(a(E), {
|
|
794
|
-
size: "small",
|
|
795
|
-
type: "danger",
|
|
796
|
-
plain: "",
|
|
797
|
-
onClick: t[25] || (t[25] = (e) => ne(x.value))
|
|
798
|
-
}, {
|
|
799
|
-
default: k(() => [
|
|
800
|
-
C("删除")
|
|
801
|
-
]),
|
|
802
|
-
_: 1
|
|
803
|
-
})
|
|
804
1016
|
])
|
|
805
1017
|
])
|
|
806
|
-
], 64)) : (
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
modelValue:
|
|
813
|
-
"onUpdate:modelValue":
|
|
1018
|
+
], 64)) : (u(), c(k, { key: 1 }, [
|
|
1019
|
+
Wt,
|
|
1020
|
+
s("div", Ot, [
|
|
1021
|
+
s("div", Pt, [
|
|
1022
|
+
Xt,
|
|
1023
|
+
a(d(S), {
|
|
1024
|
+
modelValue: Y.value.name,
|
|
1025
|
+
"onUpdate:modelValue": l[32] || (l[32] = (e) => Y.value.name = e),
|
|
814
1026
|
size: "small"
|
|
815
1027
|
}, null, 8, ["modelValue"])
|
|
816
1028
|
]),
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
modelValue:
|
|
822
|
-
"onUpdate:modelValue":
|
|
1029
|
+
s("div", jt, [
|
|
1030
|
+
s("div", Kt, [
|
|
1031
|
+
Gt,
|
|
1032
|
+
a(d($), {
|
|
1033
|
+
modelValue: Y.value.width,
|
|
1034
|
+
"onUpdate:modelValue": l[33] || (l[33] = (e) => Y.value.width = e),
|
|
823
1035
|
min: 5,
|
|
824
1036
|
max: 500,
|
|
825
1037
|
size: "small",
|
|
826
1038
|
style: { width: "100%" }
|
|
827
1039
|
}, null, 8, ["modelValue"])
|
|
828
1040
|
]),
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
modelValue:
|
|
833
|
-
"onUpdate:modelValue":
|
|
1041
|
+
s("div", Jt, [
|
|
1042
|
+
Qt,
|
|
1043
|
+
a(d($), {
|
|
1044
|
+
modelValue: Y.value.height,
|
|
1045
|
+
"onUpdate:modelValue": l[34] || (l[34] = (e) => Y.value.height = e),
|
|
834
1046
|
min: 5,
|
|
835
1047
|
max: 500,
|
|
836
1048
|
size: "small",
|
|
@@ -838,20 +1050,20 @@ const He = (s, u) => {
|
|
|
838
1050
|
}, null, 8, ["modelValue"])
|
|
839
1051
|
])
|
|
840
1052
|
]),
|
|
841
|
-
|
|
1053
|
+
Zt
|
|
842
1054
|
])
|
|
843
1055
|
], 64))
|
|
844
1056
|
])
|
|
845
1057
|
]));
|
|
846
1058
|
}
|
|
847
|
-
},
|
|
1059
|
+
}, is = /* @__PURE__ */ el(es, [["__scopeId", "data-v-8646f5dc"]]);
|
|
848
1060
|
export {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1061
|
+
is as LabelDesigner,
|
|
1062
|
+
Ke as PT2MM,
|
|
1063
|
+
Ue as barcodeDataURL,
|
|
1064
|
+
Ze as buildPrintHTML,
|
|
1065
|
+
os as printCanvas,
|
|
1066
|
+
Ee as qrDataURL,
|
|
1067
|
+
W as resolveContent,
|
|
1068
|
+
Se as resolveValue
|
|
857
1069
|
};
|