Skip to content

Commit

Permalink
Merge pull request #85 from tuohuang/main
Browse files Browse the repository at this point in the history
1:修复选择图片后refresh方法参数real属性无效,以及回调函数可能不会执行的问题
2:使用updateOption方法更新元素样式后,同时更新右侧设置面板对应的样式
  • Loading branch information
CcSimple committed Dec 30, 2023
2 parents 287fff3 + 2701a76 commit fa48ff2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/hiprint/hiprint.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import vImg from "./css/image/v_img.svg";
import {jsPDF} from "jspdf";
import html2canvas from "html2canvas";
// 数字转中文,大写,金额
import Nzh from "nzh/dist/nzh.min.js"
import Nzh from "nzh/dist/nzh.min.js";
// 解析svg 到 canvas, 二维码条形码需要
import Canvg from 'canvg';
// 默认自定义拖拽列表
Expand Down Expand Up @@ -881,6 +881,14 @@ var hiprint = function (t) {
hinnn.event.trigger("hiprintTemplateDataChanged_" + this.templateId, "参数修改");
}
}
this._printElementOptionTabs.forEach(tab=>{
tab.list.forEach(item=>{
if(item.name === o){
item.target.find('select')?.val(v.toString())
item.target.find('input')?.val(v.toString())
}
})
});
} catch (e) {
console.log('updateOption error', e)
}
Expand Down Expand Up @@ -3460,7 +3468,7 @@ var hiprint = function (t) {
}, t.prototype.updateEl = function (width, height, opt, cb) {
if (opt) {
var ratio, w, h;
if (opt || opt.auto) {
if (opt && opt.auto) {
if (width >= height) {
opt.width = true;
} else {
Expand Down Expand Up @@ -3488,9 +3496,8 @@ var hiprint = function (t) {
this.el.designTarget.css('height', h + "pt");
}
this.el.designTarget.children('.resize-panel').trigger($.Event('click'));
} else {
cb && cb(this.el, width, height);
}
cb && cb(this.el, width, height);
}, t.prototype.destroy = function () {
this.target.remove();
}, t;
Expand Down

0 comments on commit fa48ff2

Please sign in to comment.