<%--
設計工具箱
--%>
-
-
- 型版屬性
-
-
-
- 型版名稱:
-
-
-
-
-
- 內容尺寸:{{getParseName(paperSize,"content")}}
-
-
-
-
- 列印尺寸:{{ getParseName(printSize,"print") }}
-
-
-
-
- 列印模式:{{ getParseName(printMode,"mode") }}
-
-
-
-
- 底圖:{{ backendInp }}
-
-
-
-
-
+
+
+ 型版屬性
+
+
+ 型版名稱:
+ 內容尺寸:{{getParseName(paperSize,"content")}}
+ 列印尺寸:{{ getParseName(printSize,"print") }}
+ 列印模式:{{ getParseName(printMode,"mode") }}
+ 底圖:{{ backendInp }}
+
+
+
@@ -390,6 +394,59 @@
+
+
+
+
+
+
+
+
+
+
+ 確定
+ 取消
+
+
+
+
+
+
+
+
+ 確定刪除?
+
+
+ 確定
+ 確定
+ 取消
+
+
+
@@ -440,9 +497,17 @@
},
styleName: "",
showStyleMenu: false,
+ showPaperMenu: false,
styleMenuX: 0,
styleMenuY: 0,
- styleMenuStyle:""
+ styleMenuStyle: "",
+ removeDialog: false,
+ removeTarget: "",
+ removeStyleID: "",
+ removePaperID: "",
+ paperMenuX: 0,
+ paperMenuY: 0,
+ paperDialog:false,
}
},
computed: {
@@ -462,9 +527,7 @@
getParseName(id, classes) {
if (id != null) {
if (classes === "style") {
-
let data = this.allStyle.find(x => x.styleID === id)
-
return data?.name
} else if (classes === "content") {
let data = this.allSize.find(x => x.id === id)
@@ -497,12 +560,22 @@
this.styleMenuX = e.clientX;
this.styleMenuY = e.clientY;
this.styleMenuStyle = `top:${e.clientY}px,left:${e.clientX}px`
- this.styleID=id
-
+ this.styleID = id
+ this.removeStyleID = id
+ //console.log("QQOO_openStyleMenu:",id);
},
closeStyleMenu() {
this.showStyleMenu = false;
},
+ openPaperMenu(e, id) {
+ this.paperMenuX = e.clientX
+ this.paperMenuY = e.clientY
+ this.showPaperMenu = true
+ this.removePaperID=id
+ },
+ closePaperMenu() {
+ this.showPaperMenu = false;
+ },
print() {
let self = this;
let s = this.allStyle.find(x => x.styleID == this.styleID)
@@ -697,11 +770,11 @@
}
}
});
- $("#paperSize").append("
")
+ /*$("#paperSize").append("
")
this.allSize.forEach(x => {
$("#paperSize").append("
")
$("#printSize").append("
");
- })
+ })*/
},
async getElements() {
let self = this
@@ -712,7 +785,6 @@
//if (response.result=="Y") {
if (response.status == "200") {
let data = response.data;
- console.log("data:", data)
if (data.result == "Y") {
data.data.forEach(x => {
self.tabletElements.push(x);
@@ -724,7 +796,7 @@
async getStyles() {
let self = this
self.allSize.length = 0
- $(".style-menu").html("")
+ // $(".style-menu").html("")
await axios
.post(HTTP_HOST + 'api/tablet/GetStyleData', {})
.then(response => {
@@ -734,10 +806,10 @@
if (data.result == "Y") {
data.data.forEach(x => {
self.allStyle.push(x);
- $(".style-menu").append("
" + x.name + "");
+ //$(".style-menu").append("
" + x.name + "");
});
- this.bindDropdown();
+ //this.bindDropdown();
}
}
//}
@@ -774,7 +846,6 @@
let obj = this.elements
let s = this.allStyle.find(x => x.styleID == id)
let size = this.allSize.find(x => x.id == s.paperSize)
- //this.showStyleMenu = true;
this.paper.width = size.width;
this.paper.height = size.height;
this.rosterLimit = s.rosterLimit;
@@ -784,6 +855,7 @@
this.printMode = s.printMode
this.perpage = s.perpage
this.styleID = id
+ this.styleName=s.name
//this.rosterLimit = s.rosterLimit
//$("#paperSize").val(s.paperSize);
@@ -879,9 +951,9 @@
});
}
},
- async removePaper() {
+ async confirmRemovePaper() {
let self = this;
- let paperSize =this.paperSize //$("#paperSize").val()
+ let paperSize = this.removePaperID //$("#paperSize").val()
//console.log("paperSize:",paperSize);
if (paperSize == "newsize" || paperSize == "" || paperSize == null || paperSize == undefined) {
@@ -894,31 +966,34 @@
.post(HTTP_HOST + 'api/tablet/DelPaperSize', ps)
.then(response => {
if (response.status == "200") {
- //if (response.data.result == "Y") {
-
- $("#toast_body").html(`${response.data.message}`)
- self.toast.show();
- //}
+ this.snackbar.text = `${response.data.message}`;
+ this.snackbar.show = true
if (response.data.result == "Y") {
self.getPaperSize()
//$("#paperSize").val("")
- this.paperSize=""
+ this.paperSize = ""
this.changePaper()
}
+ } else {
+ this.snackbar.text = "存檔失敗";
+ this.snackbar.show=true
}
+ this.removeDialog = false;
});
},
- async removeStyle() {
+ async removePaper() {
+ this.removeDialog = true;
+ this.removeTarget = "paper";
+ console.log("QQOO", this.removeStyle)
+ },
+ async confirmRemoveStyle() {
let self = this;
- let sID = this.styleID
+ let sID = this.removeStyleID;
//console.log("styleID:", sID);
if (sID == "000001" || sID == null || sID == undefined) {
-
- //$("#toast_body").html("請選擇要刪除的版型")
- //self.toast.show();
this.snackbar.text = "請選擇要刪除的版型"
- this.snackbar.show=true
+ this.snackbar.show = true
return false
}
let ps = { styleID: sID }
@@ -926,17 +1001,22 @@
.post(HTTP_HOST + 'api/tablet/DelTabletStyle', ps)
.then(response => {
if (response.status == "200") {
- //if (response.data.result == "Y") {
-
$("#toast_body").html(`${response.data.message}`)
self.toast.show();
- //}
if (response.data.result == "Y") {
self.getStyles()
}
}
});
},
+ async removeStyle() {
+ this.removeDialog = true;
+ this.removeTarget = "style";
+ console.log("QQOO",this.removeStyle)
+ },
+ async newPaperSize() {
+ this.paperDialog = true
+ },
async savePaperSize() {
let ps = {
paperName: this.newPaper.paperName, //$("#paperName").val(),
@@ -957,6 +1037,10 @@
//$("#paperSize").val("")
self.paperSize=""
self.changePaper()
+ self.paperDialog = false
+ self.newPaper.paperName = ""
+ self.newPaper.paperWidth = 0
+ self.newPaper.paperHeight =0
}
}
});
@@ -1423,6 +1507,7 @@
$("#toast_body").html(`${"ok!"}`)
self.toast.show();
+ this.getStyles();
}
}
});