yh-hiprint 2.1.2 → 2.2.1
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/README.md +4 -0
- package/font-size.js +3 -7
- package/hiprintPreview.vue +3 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/font-size.js
CHANGED
|
@@ -14,14 +14,12 @@ export default (function () {
|
|
|
14
14
|
}),
|
|
15
15
|
// 创建 DOM
|
|
16
16
|
(t.prototype.createTarget = function () {
|
|
17
|
-
let list = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
|
|
17
|
+
let list = [4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
|
|
18
18
|
let fontSizeList = '\n <option value="" >默认</option>';
|
|
19
19
|
list.forEach(function (e) {
|
|
20
20
|
fontSizeList += '\n <option value="' + e + '">' + e + "pt</option>";
|
|
21
21
|
});
|
|
22
|
-
this.target = $(
|
|
23
|
-
' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n 字体大小\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit"> </select>\n </div>\n </div>'
|
|
24
|
-
);
|
|
22
|
+
this.target = $(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n 字体大小\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit"> </select>\n </div>\n </div>');
|
|
25
23
|
this.target.find(".auto-submit").append($(fontSizeList));
|
|
26
24
|
return this.target;
|
|
27
25
|
}),
|
|
@@ -32,9 +30,7 @@ export default (function () {
|
|
|
32
30
|
}),
|
|
33
31
|
// 设置值
|
|
34
32
|
(t.prototype.setValue = function (t) {
|
|
35
|
-
t &&
|
|
36
|
-
(this.target.find('option[value="' + t + '"]').length ||
|
|
37
|
-
this.target.find("select").prepend('<option value="' + t + '" >' + t + "</option>"));
|
|
33
|
+
t && (this.target.find('option[value="' + t + '"]').length || this.target.find("select").prepend('<option value="' + t + '" >' + t + "</option>"));
|
|
38
34
|
this.target.find("select").val(t);
|
|
39
35
|
}),
|
|
40
36
|
// 销毁 DOM
|
package/hiprintPreview.vue
CHANGED
|
@@ -47,7 +47,7 @@ let loading = ElLoading.service({
|
|
|
47
47
|
function getData(query) {
|
|
48
48
|
let { code, params, data, isCustom } = query;
|
|
49
49
|
loading.setText("获取打印配置和数据");
|
|
50
|
-
let reqParams = JSON.parse(params)
|
|
50
|
+
let reqParams = params ? JSON.parse(params) : [];
|
|
51
51
|
|
|
52
52
|
axios
|
|
53
53
|
.request({
|
|
@@ -89,9 +89,11 @@ function getData(query) {
|
|
|
89
89
|
if (isCustom === "1") {
|
|
90
90
|
await ElMessageBox.prompt("在下面输入框中输入您给的自定义数据", "自定义数据", {
|
|
91
91
|
inputType: "textarea",
|
|
92
|
+
inputValue: localStorage.hiprintCustomValue || null,
|
|
92
93
|
}).then((e) => {
|
|
93
94
|
try {
|
|
94
95
|
hasData = true;
|
|
96
|
+
localStorage.hiprintCustomValue = e.value;
|
|
95
97
|
list = JSON.parse(e.value);
|
|
96
98
|
} catch (error) {
|
|
97
99
|
try {
|
package/index.js
CHANGED
|
@@ -22,8 +22,8 @@ const hiprint = ({ code, params, data, isCustom }) => {
|
|
|
22
22
|
if (typeof params !== "Array") {
|
|
23
23
|
paramData = [params];
|
|
24
24
|
}
|
|
25
|
-
url = "/hiprint/#/preview?code=" + code;
|
|
26
|
-
if (
|
|
25
|
+
let url = "/hiprint/#/preview?code=" + code;
|
|
26
|
+
if (params) {
|
|
27
27
|
url += `¶ms=${JSON.stringify(paramData)}`;
|
|
28
28
|
}
|
|
29
29
|
if (data) {
|