优化调整bug与加密

This commit is contained in:
24kycj
2026-01-11 01:06:02 +08:00
parent f4aef8abaa
commit c26c4fa66e
19 changed files with 124 additions and 966 deletions
+5 -4
View File
@@ -54,7 +54,7 @@ window.display_func = function display_func(img1, img2, img3) {
$("#component_type").text(language_str("bg"));//"背景"
canvas1.discardActiveObject().renderAll();
canvas2.discardActiveObject().renderAll();
// 保存所有对象的 selectable 和 evented 状态,确保预览后能恢复
const objStates1 = [];
const objStates2 = [];
@@ -74,7 +74,7 @@ window.display_func = function display_func(img1, img2, img3) {
};
}
});
// 过滤掉辅助线
let _objs1 = canvas1.getObjects().filter(obj => !obj.isGuideLine);
let g1 = [];
@@ -399,7 +399,7 @@ window.display_func = function display_func(img1, img2, img3) {
// 只处理打印
printJS({ printable: printPath, type: 'image', style: 'img { width: 100%; height: auto; }' })
},
end: function() {
end: function () {
// 预览窗口关闭后,恢复所有对象的 selectable 和 evented 状态
canvas1.getObjects().forEach((obj, index) => {
if (!obj.isGuideLine && objStates1[index]) {
@@ -1033,7 +1033,8 @@ window.regenerateQrCodesAndBarcodes = function regenerateQrCodesAndBarcodes(canv
margin: 0,
lineColor: objMeta.color || '#000000',
fontSize: objMeta.fontSize || 18,
font: objMeta.font || 'Arial'
font: objMeta.font || 'Arial',
displayValue: !objMeta.show
});
const barcode = document.getElementById('barcode');
const bar = barcode.toDataURL("image/png");
+7 -4
View File
@@ -1603,7 +1603,7 @@ $("#qrcode_color").bind('input propertychange', function () {
window.recordState();
});
});
$("#qrcode_val").bind('change', function () {
$("#qrcode_val").bind('input propertychange', function () {
let val = $(this).val() ? $(this).val() : 'https://www.cardsoon.com'
let item = canvas.getActiveObject();
let qr = jrQrcode.getQrBase64(val, { padding: 0, foreground: $("#qrcode_color").val() });
@@ -1877,14 +1877,17 @@ $("#barcode_val").bind('input propertychange', function () {
$("#barcode_show").click(function () {
let item = canvas.getActiveObject();
let idx = getIndex(canvas.getActiveObject());
let val = $("#barcode_size").val()
let val = $("#barcode_size").val();
let displayValue = true;
if ($(this).prop("checked")) {
objs[idx - 1].show = true;
val = 0
displayValue = false;
} else {
objs[idx - 1].show = false;
displayValue = true;
}
JsBarcode("#barcode", objs[idx - 1].val, { margin: 0, lineColor: objs[idx - 1].color, fontSize: val * dpi / 72, font: objs[idx - 1].font });
//val = 0; // Remove this hack
JsBarcode("#barcode", objs[idx - 1].val, { margin: 0, lineColor: objs[idx - 1].color, fontSize: val * dpi / 72, font: objs[idx - 1].font, displayValue: displayValue });
let barcode = document.getElementById('barcode');
let bar = barcode.toDataURL("image/png");
item.setSrc(bar, function (img) {