diff --git a/src/assets/code.png b/src/assets/code.png new file mode 100644 index 0000000..bfe59cc Binary files /dev/null and b/src/assets/code.png differ diff --git a/src/assets/css/index.scss b/src/assets/css/index.scss index 037e81b..ffa1c94 100644 --- a/src/assets/css/index.scss +++ b/src/assets/css/index.scss @@ -37,6 +37,7 @@ html { body { margin: 0; + overflow: hidden; } h1 { @@ -545,3 +546,32 @@ img { display: flex; justify-content: center; } + + +.print-images { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + width: 420px; + max-height: 400px; + padding: 0 10px; + overflow-y: auto; + + img { + width: 180px; + margin-bottom: 10px; + cursor: pointer; + } + + p { + width: 100%; + line-height: 1.3; + margin-bottom: 10px; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + cursor: pointer; + } +} diff --git a/src/assets/images/avatar.png b/src/assets/images/avatar.png new file mode 100644 index 0000000..6ffa77f Binary files /dev/null and b/src/assets/images/avatar.png differ diff --git a/src/assets/images/triman1.png b/src/assets/images/triman1.png new file mode 100644 index 0000000..6ebaf44 Binary files /dev/null and b/src/assets/images/triman1.png differ diff --git a/src/assets/tab_middle.png b/src/assets/tab_middle.png new file mode 100644 index 0000000..210b801 Binary files /dev/null and b/src/assets/tab_middle.png differ diff --git a/src/components/LablesMember.vue b/src/components/LablesMember.vue new file mode 100644 index 0000000..14a9b2c --- /dev/null +++ b/src/components/LablesMember.vue @@ -0,0 +1,343 @@ + + + + + diff --git a/src/components/print/Print.vue b/src/components/print/Print.vue index c9e723f..0761b1a 100644 --- a/src/components/print/Print.vue +++ b/src/components/print/Print.vue @@ -17,10 +17,6 @@  表格 -
-  - html -
辅助元素
@@ -44,6 +40,38 @@
常用元素
+
+ 素材 + 添加 +
+
+ +
+
图片素材
+
+ +
+ +
+
文字素材
+
+ +
+
动态数据(如日期) 添加 @@ -259,32 +287,14 @@ this.isShowDynamicForm = true }, - addItemToCanvas(name) { - this.panel.addPrintText({ + addImage(src) { + this.panel.addPrintImage({ options: { - field: name, - testData: name, title: '', left: 70.5, top: 58.5, - height: 18, - width: 116, - coordinateSync: false, - widthHeightSync: false, - hideTitle: true, - fontFamily: 'Microsoft YaHei', - fontWeight: '700', - textContentVerticalAlign: 'middle', - contentPaddingLeft: 5.25, - qrCodeLevel: 0, - right: 186.5, - bottom: 73.5, - vCenter: 128.5, - hCenter: 64.5 - }, - printElementType: { - title: '文本', - type: 'text' + src: src, + widthHeightSync: true } }) const el = this.hiprintTemplate.printPanels[0].printElements.at(-1) @@ -293,6 +303,33 @@ el.design(void 0, designPaper) }, + addText(text) { + this.panel.addPrintText({ + options: { + field: text || '', + testData: text || '', + title: '', + left: 70.5, + top: 58.5, + width: 140, + height: 20, + coordinateSync: true, + widthHeightSync: true, + hideTitle: true, + fontFamily: 'Microsoft YaHei', + fontWeight: '700' + } + }) + const el = this.hiprintTemplate.printPanels[0].printElements.at(-1) + const designPaper = this.hiprintTemplate.printPanels[0].designPaper + this.hiprintTemplate.printPanels[0].appendDesignPrintElement(designPaper, el, true) + el.design(void 0, designPaper) + }, + + addItemToCanvas(name) { + this.addText(name) + }, + onConfirm() { this.$refs.form.validate((valid) => { if (valid) { @@ -341,11 +378,11 @@ this.$nextTick(() => { - !this.isPrint && this.hiprintTemplate.design('#hiprint-printTemplate', { + this.hiprintTemplate.design('#hiprint-printTemplate', { grid: true }) - // this.panel = this.hiprintTemplate.printPanels[0] + this.panel = this.hiprintTemplate.printPanels[0] }) }, @@ -413,6 +450,7 @@ } } +