調整
This commit is contained in:
@@ -317,13 +317,13 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input type="number" id="xPosition" class="form-control form-control-sm mb-2" onchange="changePosition()">
|
||||
<input type="number" id="xPosition" class="form-control form-control-sm mb-2" @change.prevent="changePosition">
|
||||
<label class="small" for="xPosition">X</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input type="number" id="yPosition" class="form-control form-control-sm mb-2" onchange="changePosition()">
|
||||
<input type="number" id="yPosition" class="form-control form-control-sm mb-2" @change.prevent="changePosition">
|
||||
<label class="small" for="yPosition">Y</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -518,7 +518,7 @@
|
||||
},
|
||||
methods: {
|
||||
onTabsResize(e) {
|
||||
console.log(e)
|
||||
//console.log(e)
|
||||
// 當畫面變動時,呼叫 Vuetify 內部的呼叫方法重新計算寬度
|
||||
//if (this.$refs.myTabs) {
|
||||
// this.$refs.myTabs.onResize();
|
||||
@@ -781,7 +781,7 @@
|
||||
await axios
|
||||
.post(HTTP_HOST + 'api/tablet/GetTabletElement', {})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
//console.log(response)
|
||||
//if (response.result=="Y") {
|
||||
if (response.status == "200") {
|
||||
let data = response.data;
|
||||
@@ -932,7 +932,7 @@
|
||||
changePaper1(val) {
|
||||
//$("#paperSize").val(val)
|
||||
this.paperSize = val.id
|
||||
console.log("changePaper1:",val)
|
||||
//console.log("changePaper1:",val)
|
||||
this.changePaper()
|
||||
},
|
||||
changePaper() {
|
||||
@@ -985,7 +985,7 @@
|
||||
async removePaper() {
|
||||
this.removeDialog = true;
|
||||
this.removeTarget = "paper";
|
||||
console.log("QQOO", this.removeStyle)
|
||||
//console.log("QQOO", this.removeStyle)
|
||||
},
|
||||
async confirmRemoveStyle() {
|
||||
let self = this;
|
||||
@@ -1012,7 +1012,7 @@
|
||||
async removeStyle() {
|
||||
this.removeDialog = true;
|
||||
this.removeTarget = "style";
|
||||
console.log("QQOO",this.removeStyle)
|
||||
//console.log("QQOO",this.removeStyle)
|
||||
},
|
||||
async newPaperSize() {
|
||||
this.paperDialog = true
|
||||
@@ -1049,8 +1049,8 @@
|
||||
changeRosterLimit() {
|
||||
//this.rosterLimit = parseInt(this.rosterLimit) //parseInt($("#rosterLimit").val());
|
||||
},
|
||||
changePrintMode() {
|
||||
|
||||
changePrintMode(printMode) {
|
||||
this.printMode = printMode
|
||||
},
|
||||
bindEvents() {
|
||||
// 文字變更連動渲染
|
||||
@@ -1123,9 +1123,18 @@
|
||||
|
||||
createEl(el, slice) {
|
||||
let html = '';
|
||||
let fontSize = el.style.fontSize;
|
||||
// 1. 智慧名單渲染
|
||||
if (el.type === 'roster') {
|
||||
html = this.renderRoster(slice, el);
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(slice.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
let fontSize = Math.floor(rowWidth / 2);
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
html = this.renderRoster(slice, el, rowWidth);
|
||||
}
|
||||
// 2. 正名合併置中
|
||||
else if (el.type === 'combined-center') {
|
||||
@@ -1140,24 +1149,43 @@
|
||||
html = el.text.replace(/(\d+)/g, '<span class="tate-chu-yoko">$1</span>');
|
||||
}
|
||||
else if (el.id === 'title1') {
|
||||
html = this.renderNameList(slice, el);
|
||||
//要先去算出需要縮到多小字,根據總寬度跟行數,這樣才會在正中間
|
||||
//字體大小*2如果大於行數就要縮字體
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(slice.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
fontSize = Math.floor(rowWidth / 2);
|
||||
//console.log(el.height, el.textHeight, perRow, rows, rowWidth, fontSize)
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
html = this.renderNameList(slice, el, rowWidth);
|
||||
}
|
||||
else if (el.id === 'alive') {
|
||||
console.log("createEl:", slice, el)
|
||||
html = this.renderLiveList(slice, el);
|
||||
//console.log("createEl:", slice, el)
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(slice.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
fontSize = Math.floor(rowWidth / 2);
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
html = this.renderLiveList(slice, el, rowWidth);
|
||||
}
|
||||
else {
|
||||
html = el.text;
|
||||
}
|
||||
|
||||
//el.style.fontSize
|
||||
return $(`<div class="tablet-element vertical-text ${this.activeId === el.id ? 'selected' : ''}" id="${el.id}"></div>`)
|
||||
.css({
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
//position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: el.fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.isActive
|
||||
})
|
||||
.html(html);
|
||||
},
|
||||
renderNameList(names, el) {
|
||||
renderNameList(names, el,rowWidth) {
|
||||
let $namelist = $(`<div class='nameList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
display: "flex",
|
||||
@@ -1177,16 +1205,16 @@
|
||||
//"row-gap": "1px",
|
||||
let self = this;
|
||||
names.forEach(n => {
|
||||
$namelist.append(self.renderNameSpan(n, el))
|
||||
$namelist.append(self.renderNameSpan(n, el, rowWidth))
|
||||
})
|
||||
return $namelist;
|
||||
},
|
||||
renderNameSpan(name, el) {
|
||||
renderNameSpan(name, el, rowWidth) {
|
||||
return $(`<span>${name}</span>`).css({
|
||||
display: "block",
|
||||
"min-height": `${el.textHeight}px`,
|
||||
"max-height": `${el.height}px`,
|
||||
width: `${el.textWidth}px`,
|
||||
width: `${rowWidth}px`,
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
|
||||
@@ -1194,8 +1222,8 @@
|
||||
"text-justify": "inter-character",
|
||||
});// "margin-bottom": `${el.textSpan}px`,
|
||||
},
|
||||
renderLiveList(names, el) {
|
||||
console.log("renderLiveList:", names);
|
||||
renderLiveList(names, el, rowWidth) {
|
||||
//console.log("renderLiveList:", names);
|
||||
//$("#imp-text").updateActive("text",names)
|
||||
let $namelist = $(`<div class='liveList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
@@ -1216,18 +1244,17 @@
|
||||
//"row-gap": "1px",
|
||||
let self = this;
|
||||
names.forEach(n => {
|
||||
$namelist.append(self.renderLiveSpan(n, el))
|
||||
$namelist.append(self.renderLiveSpan(n, el, rowWidth))
|
||||
})
|
||||
return $namelist;
|
||||
},
|
||||
renderLiveSpan(name, el) {
|
||||
console.log("renderLiveSpan:", name, el
|
||||
);
|
||||
renderLiveSpan(name, el, rowWidth) {
|
||||
//console.log("renderLiveSpan:", name, el );
|
||||
return $(`<span>${name}</span>`).css({
|
||||
display: "block",
|
||||
"min-height": `${el.textHeight}px`,
|
||||
"max-height": `${el.height}px`,
|
||||
width: `${el.textWidth}px`,
|
||||
width: `${rowWidth}px`,
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
|
||||
@@ -1236,7 +1263,7 @@
|
||||
});//"margin-bottom": `${el.textSpan}px`,
|
||||
},
|
||||
// 品字佈局邏輯:一上二下
|
||||
renderRoster(names, el) {
|
||||
renderRoster(names, el,rowWidth) {
|
||||
if (!names.length) return '';
|
||||
const mid = names.length === 1 ? 1 : Math.floor(names.length / 2);
|
||||
const top = names.slice(0, mid);
|
||||
@@ -1297,9 +1324,9 @@
|
||||
},
|
||||
|
||||
select(id) {
|
||||
console.log("QQ:", id);
|
||||
//console.log("QQ:", id);
|
||||
this.activeId = id;
|
||||
console.log("QQ:", this.elements);
|
||||
//console.log("QQ:", this.elements);
|
||||
const el = this.elements.find(x => x.id === id);
|
||||
const el1 = this.elements.find(x => x.id === "titletriangle");
|
||||
$('#attr-box').removeClass('d-none');
|
||||
@@ -1321,7 +1348,7 @@
|
||||
},
|
||||
|
||||
updateActive(key, val) {
|
||||
console.log("updateActive:", key, val)
|
||||
//console.log("updateActive:", key, val)
|
||||
const el = this.elements.find(x => x.id === this.activeId);
|
||||
|
||||
if (key === 'fontSize') el.style.fontSize = parseFloat(val);
|
||||
@@ -1334,12 +1361,19 @@
|
||||
else el[key] = val;
|
||||
if (el.type == "roster") {
|
||||
const names = el.text.split('\n').filter(s => s.trim());
|
||||
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(names.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
let fontSize = Math.floor(rowWidth / 2);
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
$(`.tablet-element[id="${this.activeId}"]`).css({
|
||||
position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.style.isActive
|
||||
}).html(this.renderRoster(names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit), el));
|
||||
position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.style.isActive
|
||||
}).html(this.renderRoster(names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit), el, rowWidth));
|
||||
} else if (el.type == "combined-center") {
|
||||
console.log("combined-center");
|
||||
//console.log("combined-center");
|
||||
|
||||
const parts = el.text.split('\n');
|
||||
html = `<div class="ancestor-wrapper" style='width:${el.width}px !important;height:${el.height}px !important' >
|
||||
@@ -1353,18 +1387,37 @@
|
||||
|
||||
}).html(html);
|
||||
} else if (this.activeId === "title1") {
|
||||
|
||||
let names = el.text.split('\n').filter(s => s.trim());
|
||||
let slice = names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit);
|
||||
html = this.renderNameList(slice, el);
|
||||
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(slice.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
let fontSize = Math.floor(rowWidth / 2);
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
//console.log(el.height, el.textHeight, perRow, rows, rowWidth, fontSize)
|
||||
html = this.renderNameList(slice, el, rowWidth);//el.style.fontSize
|
||||
$(`.tablet-element[id="${this.activeId}"]`).css({
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
}).html(html);
|
||||
} else if (this.activeId === "alive") {
|
||||
let names = el.text.split('\n').filter(s => s.trim());
|
||||
let slice = names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit);
|
||||
html = this.renderLiveList(slice, el);
|
||||
let perRow = Math.floor(Number(el.height) / Number(el.textHeight));
|
||||
let rows = Math.ceil(Number(slice.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(el.width) / rows);
|
||||
let fontSize = Math.floor(rowWidth / 2);
|
||||
if (fontSize > el.style.fontSize) {
|
||||
fontSize = el.style.fontSize;
|
||||
rowWidth = fontSize * 2;
|
||||
}
|
||||
html = this.renderLiveList(slice, el, rowWidth);
|
||||
$(`.tablet-element[id="${this.activeId}"]`).css({
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
|
||||
}).html(html);
|
||||
} else if (this.activeId === "righttitle") {
|
||||
$(`.tablet-element[id="${this.activeId}"]`).css({
|
||||
@@ -1392,11 +1445,11 @@
|
||||
//this.render();
|
||||
},
|
||||
displayItem(id) {
|
||||
console.log("displayItem:", this.elements, id);
|
||||
//console.log("displayItem:", this.elements, id);
|
||||
let el = this.elements.find(x => x.id === id);
|
||||
el.style.visibility = el.style.visibility === "hidden" ? "" : "hidden";
|
||||
//要判斷如果所在位置超出範圍,要拉回來放
|
||||
console.log("displayItem:", this.paper, el)
|
||||
//console.log("displayItem:", this.paper, el)
|
||||
if (el.x > this.paper.width) {
|
||||
el.x = this.paper.width / 2
|
||||
}
|
||||
@@ -1494,7 +1547,7 @@
|
||||
orientation:"", printPageCount:this.perPage, rosterLimit: 8,
|
||||
detail: detail
|
||||
}
|
||||
console.log(master);
|
||||
//console.log(master);
|
||||
let path = "SavDegignerData";
|
||||
if (this.styleID != null && this.styleID != "") {
|
||||
path = "UpdateDegignerData"
|
||||
|
||||
@@ -368,12 +368,20 @@
|
||||
details.forEach(d => {
|
||||
if (d.isActive != "hidden") {
|
||||
let newFontSize = self.scaleFontSize(mid, d.fontSize, d.width);
|
||||
|
||||
|
||||
let html = "";
|
||||
let alive = "";
|
||||
let yang = "";
|
||||
let bi = "";
|
||||
if (d.elementID === 'title1') {
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(mid.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
newFontSize = Math.floor(rowWidth / 2);
|
||||
if (newFontSize > d.fontSize) {
|
||||
newFontSize = d.fontSize;
|
||||
rowWidth = newFontSize * 2;
|
||||
}
|
||||
let $namelist = $(`<div class='nameList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
display: "flex",
|
||||
@@ -396,14 +404,14 @@
|
||||
let info = self.getTextInfo(z, newFontSize);
|
||||
let spanWidth = mid.length > 1 ? newFontSize : d.width
|
||||
let height = d.textHeight;
|
||||
if (info.width >= d.textHeight) {
|
||||
if (info.height >= d.textHeight) {//width
|
||||
height = d.height;
|
||||
}
|
||||
let $span = $(`<span class="nameSpan">${z}</span>`).css({
|
||||
display: "block",
|
||||
"min-height": `${height}px`,
|
||||
"max-height": `${d.height}px`,
|
||||
"max-width": `${spanWidth}px`,
|
||||
"max-width": `${rowWidth}px`,
|
||||
//width: `${newFontSize}px`,
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
@@ -418,9 +426,18 @@
|
||||
|
||||
html = $namelist;
|
||||
} else if (d.elementID === "alive") {
|
||||
html = self.renderLiveList(left, d);
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(left.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
newFontSize = Math.floor(rowWidth / 2);
|
||||
if (newFontSize > d.fontSize) {
|
||||
newFontSize = d.fontSize;
|
||||
rowWidth = newFontSize * 2;
|
||||
}
|
||||
console.log(d.height,d.width,d.textHeight,perRow,rows,rowWidth,newFontSize,d)
|
||||
html = self.renderLiveList(left, d, rowWidth);
|
||||
|
||||
newFontSize = d.fontSize;
|
||||
//newFontSize = d.fontSize;
|
||||
} else if (d.elementID === "titletriangle") {
|
||||
html = self.renderRoster(mid, d)
|
||||
} else if (d.elementID === "combined") {
|
||||
@@ -798,7 +815,7 @@
|
||||
fix2(val) {
|
||||
return Number.parseFloat(val).toFixed(2);
|
||||
},
|
||||
renderLiveList(names, el) {
|
||||
renderLiveList(names, el,rowWidth) {
|
||||
let $namelist = $(`<div class='liveList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
display: "flex",
|
||||
@@ -817,17 +834,17 @@
|
||||
});
|
||||
let self = this;
|
||||
names.forEach(n => {
|
||||
$namelist.append(self.renderLiveSpan(n, el))
|
||||
$namelist.append(self.renderLiveSpan(n, el,rowWidth))
|
||||
})
|
||||
return $namelist;
|
||||
},
|
||||
renderLiveSpan(name, el) {
|
||||
renderLiveSpan(name, el,rowWidth) {
|
||||
return $(`<span class="liveSpan">${name}</span>`).css({
|
||||
display: "block",
|
||||
"min-height": `${el.textHeight}px`,
|
||||
"max-height": `${el.height}px`,
|
||||
width: `${el.textWidth}px`,
|
||||
height: `${el.textHeight}px`,
|
||||
width: `${rowWidth}px`,
|
||||
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
"margin-bottom": "10px",
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
this.defaultStyle = response.data.data.defaultStyle;
|
||||
this.selected.style = response.data.data.defaultStyle;
|
||||
this.selectStyle.style = response.data.data.defaultStyle;
|
||||
console.log("GetActItem:",this.defaultStyle)
|
||||
//console.log("GetActItem:",this.defaultStyle)
|
||||
$("#styleSel").val(this.defaultStyle);
|
||||
|
||||
//this.getStyle();
|
||||
@@ -334,7 +334,7 @@
|
||||
if (response.status == 200) {
|
||||
self.printData = response.data;
|
||||
self.printData.forEach(x => {
|
||||
console.log("GetDetailToPrint:",x.style);
|
||||
//console.log("GetDetailToPrint:",x.style);
|
||||
if (x.style != null && x.style != undefined) {
|
||||
self.selectStyle.style = x.style;
|
||||
self.selected.style = x.style;
|
||||
@@ -460,15 +460,33 @@
|
||||
if (mid.length == 0) {
|
||||
mid.push("請選擇")
|
||||
}
|
||||
html = self.renderNameList(mid, d, newFontSize, style);
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(mid.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
newFontSize = Math.floor(rowWidth / 2);
|
||||
if (newFontSize > d.fontSize) {
|
||||
newFontSize = d.fontSize;
|
||||
rowWidth = newFontSize * 2;
|
||||
}
|
||||
//console.log(perRow, rows, rowWidth, newFontSize)
|
||||
html = self.renderNameList(mid, d, newFontSize, style, rowWidth);
|
||||
} else if (d.elementID === "alive") {
|
||||
self.tabletType = "B";
|
||||
if (left.length == 0) {
|
||||
left.push("請選擇");
|
||||
}
|
||||
newFontSize = self.scaleFontSize(left, d.fontSize, d.Width);
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(left.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
newFontSize = Math.floor(rowWidth / 2);
|
||||
if (newFontSize > d.fontSize) {
|
||||
newFontSize = d.fontSize;
|
||||
rowWidth = newFontSize * 2;
|
||||
}
|
||||
//console.log(perRow, rows, rowWidth, newFontSize)
|
||||
//newFontSize = d.fontSize;
|
||||
html = self.renderLiveList(left, d);
|
||||
html = self.renderLiveList(left, d, rowWidth);
|
||||
|
||||
} else if (d.elementID === "titletriangle") {
|
||||
if (mid.length == 0) {
|
||||
@@ -748,7 +766,7 @@
|
||||
});
|
||||
|
||||
} else if (element.hasClass("address")) {//地址
|
||||
console.log(self.address);
|
||||
//console.log(self.address);
|
||||
$(".selectedItem").append(`<li><span style="opacity:0.5">卍</span>
|
||||
<span class="selected">${self.address==undefined?"":self.address}</span>
|
||||
<span class="itemRemove" style="float:right ;margin-left:2rem;cursor:pointer;" >−</span>`);
|
||||
@@ -866,7 +884,7 @@
|
||||
self.bindEvent();
|
||||
},
|
||||
async addNewItem() {//已選輸入框按加號
|
||||
console.log("addNewItem:",$("#custom_txt").val())
|
||||
//console.log("addNewItem:",$("#custom_txt").val())
|
||||
if ($("#custom_txt").val()=="") {
|
||||
|
||||
alert("名稱不可空白")
|
||||
@@ -1246,8 +1264,16 @@
|
||||
let left = []
|
||||
Object.assign(left, self.alive);
|
||||
//this.printData.forEach(x => {
|
||||
|
||||
let d = details.find(y => y.elementID == "alive");
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(left.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
let newFontSize = Math.floor(rowWidth / 2);
|
||||
if (newFontSize > d.fontSize) {
|
||||
newFontSize = d.fontSize;
|
||||
rowWidth = newFontSize * 2;
|
||||
}
|
||||
self.selectedElement.css("font-size", newFontSize+"px");
|
||||
let html = self.renderLiveList(left, d);
|
||||
$(self.selectedElement).append(html);
|
||||
} else if ($(self.selectedElement).children().first().hasClass("lefttitle") ||
|
||||
@@ -1284,11 +1310,21 @@
|
||||
$(self.selectedElement).empty();
|
||||
let d = details.find(y => y.elementID == "title1");
|
||||
let newfontSize = self.scaleFontSize(mid, d.fontSize, d.textWidth)
|
||||
let perRow = Math.floor(Number(d.height) / Number(d.textHeight));
|
||||
let rows = Math.ceil(Number(mid.length) / Number(perRow));//總行數
|
||||
let rowWidth = Math.floor(Number(d.width) / rows);
|
||||
newfontSize = Math.floor(rowWidth / 2);
|
||||
if (newfontSize > d.fontSize) {
|
||||
newfontSize = d.fontSize;
|
||||
rowWidth = newfontSize * 2;
|
||||
}
|
||||
if (newfontSize < 10) {
|
||||
newfontSize = 10;
|
||||
}
|
||||
$(self.selectedElement).css("font-size", newfontSize);
|
||||
let html = self.renderNameList(mid, d, style.fontSize, style);
|
||||
//console.log(self.selectedElement,perRow, rows, rowWidth, newfontSize)
|
||||
|
||||
self.selectedElement.css("font-size", newfontSize+"px");
|
||||
let html = self.renderNameList(mid, d, style.fontSize, style,rowWidth);
|
||||
$(self.selectedElement).append(html);
|
||||
} else if ($(self.selectedElement).children().first().hasClass("rosterList")) {
|
||||
$(self.selectedElement).empty();
|
||||
@@ -1297,7 +1333,7 @@
|
||||
if (newfontSize < 10) {
|
||||
newfontSize = 10;
|
||||
}
|
||||
$(self.selectedElement).css("font-size", newfontSize);
|
||||
self.selectedElement.css("font-size", newfontSize+"px");
|
||||
let html = self.renderRoster(mid, d);
|
||||
$(self.selectedElement).append(html);
|
||||
} else if ($(self.selectedElement).children().first().hasClass("ancestor-wrapper")) {
|
||||
@@ -1307,7 +1343,7 @@
|
||||
if (newfontSize < 10) {
|
||||
newfontSize = 10;
|
||||
}
|
||||
$(self.selectedElement).css("font-size", newfontSize);
|
||||
self.selectedElement.css("font-size", newfontSize+"px");
|
||||
let html = self.renderCombined(mid, d);
|
||||
$(self.selectedElement).append(html);
|
||||
}
|
||||
@@ -1365,7 +1401,7 @@
|
||||
});
|
||||
return txt;
|
||||
},
|
||||
renderNameList(mid, d, newFontSize, style) {
|
||||
renderNameList(mid, d, newFontSize, style,rowWidth) {
|
||||
let self = this;
|
||||
let $namelist = $(`<div class='nameList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
@@ -1396,7 +1432,7 @@
|
||||
display: "block",
|
||||
"min-height": `${height}px`,
|
||||
"max-height": `${d.height}px`,
|
||||
"max-width": `${spanWidth}px`,
|
||||
"max-width": `${rowWidth}px`,
|
||||
//width: `${newFontSize}px`,
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
@@ -1410,7 +1446,7 @@
|
||||
});
|
||||
return $namelist;
|
||||
},
|
||||
renderLiveList(names, el) {
|
||||
renderLiveList(names, el,rowWidth) {
|
||||
let $namelist = $(`<div class='liveList'></div>`).css({
|
||||
"writing-mode": "vertical rl",
|
||||
display: "flex",
|
||||
@@ -1429,16 +1465,16 @@
|
||||
});
|
||||
let self = this;
|
||||
names.forEach(n => {
|
||||
$namelist.append(self.renderLiveSpan(n, el))
|
||||
$namelist.append(self.renderLiveSpan(n, el,rowWidth))
|
||||
})
|
||||
return $namelist;
|
||||
},
|
||||
renderLiveSpan(name, el) {
|
||||
renderLiveSpan(name, el,rowWidth) {
|
||||
return $(`<span class="liveSpan">${name}</span>`).css({
|
||||
display: "block",
|
||||
"min-height": `${el.textHeight}px`,
|
||||
"max-height": `${el.height}px`,
|
||||
width: `${el.textWidth}px`,
|
||||
width: `${rowWidth}px`,
|
||||
height: `${el.textHeight}px`,
|
||||
"text-align": "justify",
|
||||
"text-align-last": "justify",
|
||||
@@ -1559,7 +1595,7 @@
|
||||
async saveFamily() {
|
||||
let self = this;
|
||||
if (this.follower_id == "") {
|
||||
console.log("follower_id:", this.follower_id);
|
||||
//console.log("follower_id:", this.follower_id);
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1611,7 +1647,7 @@
|
||||
event.preventDefault()
|
||||
//console.log("tabletItem:", designer.tabletItem);
|
||||
//拚牌位的內容
|
||||
console.log("AA")
|
||||
//console.log("AA")
|
||||
let self = this;
|
||||
let tablet = {
|
||||
mid_items: designer.family_deceased_N_selected,
|
||||
@@ -1621,7 +1657,7 @@
|
||||
mid_right: designer.family_right_title,
|
||||
addr_items: designer.family_address
|
||||
}
|
||||
console.log("BB")
|
||||
//console.log("BB")
|
||||
var pro_order_detail =
|
||||
{
|
||||
num: designer.tabletItem.num <= 0 ? null : designer.tabletItem.num,
|
||||
@@ -1647,7 +1683,7 @@
|
||||
customize_data: designer.tabletItem.customize_data,
|
||||
style: designer.selectStyle.style
|
||||
}
|
||||
console.log("CC")
|
||||
//console.log("CC")
|
||||
await axios
|
||||
.post('/api/order/SaveDetailData', pro_order_detail)
|
||||
.then(response => {
|
||||
@@ -1742,7 +1778,7 @@
|
||||
//designer.toast.show();
|
||||
//designer.reset();
|
||||
let e = event.originalEvent;
|
||||
console.log("QOO");
|
||||
//console.log("QOO");
|
||||
if (e.origin === window.parent.location.origin) {
|
||||
//console.log('editor.html - origin check passed');
|
||||
//console.log('editor.html - received data:', event.data);
|
||||
@@ -1753,7 +1789,7 @@
|
||||
designer.family_right_title = [];
|
||||
designer.http_host = receivedData.host;
|
||||
designer.follower_id = receivedData.follower_id;
|
||||
console.log("三小:", receivedData.tabletItem)
|
||||
//console.log("三小:", receivedData.tabletItem)
|
||||
if (receivedData.tabletItem) {
|
||||
//console.log('editor.html - updating tabletItem:', receivedData.tabletItem);
|
||||
designer.tabletItem = receivedData.tabletItem;
|
||||
@@ -1824,7 +1860,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
console.log(e.origin, window.parent.location.origin)
|
||||
//console.log(e.origin, window.parent.location.origin)
|
||||
})
|
||||
);
|
||||
function delay(ms) {
|
||||
|
||||
Reference in New Issue
Block a user