This commit is contained in:
2026-07-19 19:48:17 +08:00
parent 59bb0ff824
commit 07c5027ad8
+149 -64
View File
@@ -127,8 +127,7 @@
value="內容尺寸"> value="內容尺寸">
<v-card flat> <v-card flat>
<v-card-text> <v-card-text>
<%--<div class="form-floating mb-3">--%>
<div class="form-floating mb-3">
<v-row> <v-row>
<v-col cols="12" class="pa-0"> <v-col cols="12" class="pa-0">
<v-tabs <v-tabs
@@ -137,15 +136,38 @@
color="primary" color="primary"
align-tabs="start" align-tabs="start"
center-active center-active
show-arrows
v-resize="onTabsResize"
> >
<v-tab key="000001" value="000001" class="d-flex flex-column py-2">
<button type="button" class="btn btn-info" @click.prevent="newPaperSize">新增尺寸</button>
</v-tab>
<v-tab v-for="item in allSize" :key="item.id" :value="item.id" class="d-flex flex-column py-2"> <v-tab v-for="item in allSize" :key="item.id" :value="item.id" class="d-flex flex-column py-2">
<button tytpe="button" class="btn btn-info" @click.prevent="changePaper1(item)"><span class=" limit-text mt-1">{{ item.name }}</span></button> <button tytpe="button" class="btn btn-info" @click.prevent="changePaper1(item)"
@contextmenu.prevent="openPaperMenu($event,item.id)"><span class=" limit-text mt-1">{{ item.name }}</span></button>
</v-tab> </v-tab>
</v-tabs> </v-tabs>
</v-col> </v-col>
</v-row> </v-row>
</div> <v-menu
absolute
offset-y
:position-x="paperMenuX"
:position-y="paperMenuY"
v-model="showPaperMenu"
>
<v-list>
<v-list-item
:key="showPaperMenu">
<v-list-item-title>
<button class="btn btn-primary" @click.prevent="removePaper()">刪除</button>
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<%--</div>--%>
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-tab-item> </v-tab-item>
<v-tab-item <v-tab-item
@@ -160,6 +182,8 @@
color="primary" color="primary"
align-tabs="start" align-tabs="start"
center-active center-active
show-arrows
v-resize="onTabsResize"
> >
<v-tab v-for="item in allSize" :key="item.id" :value="item.id" class="d-flex flex-column py-2"> <v-tab v-for="item in allSize" :key="item.id" :value="item.id" class="d-flex flex-column py-2">
<button tytpe="button" class="btn btn-info" @click.prevent="changePrintSize(item.id)"><span class=" limit-text mt-1">{{ item.name }}</span></button> <button tytpe="button" class="btn btn-info" @click.prevent="changePrintSize(item.id)"><span class=" limit-text mt-1">{{ item.name }}</span></button>
@@ -250,7 +274,7 @@
value="存檔"> value="存檔">
<v-card flat> <v-card flat>
<v-card-text> <v-card-text>
<span class="btn btn-sm btn-outline-info w-100 mb-2" onclick="saveStyle()">存檔</span> <span class="btn btn-sm btn-outline-info w-100 mb-2" @click.prevent="saveStyle">存檔</span>
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-tab-item> </v-tab-item>
@@ -259,39 +283,19 @@
<div class="d-flex overflow-hidden" style="height: 1920px"> <div class="d-flex overflow-hidden" style="height: 1920px">
<div class="p-2 text-white floting-box" style="width: 250px; left: 20px; top: 80px;"> <div class="p-2 text-white floting-box" style="width: 250px; left: 20px; top: 80px;">
<%-- <h6 class="border-bottom pb-2">設計工具箱</h6>--%> <%-- <h6 class="border-bottom pb-2">設計工具箱</h6>--%>
<div class="input-group mb-3"> <v-card>
<v-list flat disabled style="width: 250px;"> <v-card-title>
<v-subheader>型版屬性</v-subheader> 型版屬性
<v-list-item-group color="primary"> </v-card-title>
<v-list-item > <v-card-text>
<v-list-item-content> 型版名稱: <v-text-field type="input" v-model="styleName"></v-text-field><br>
<v-list-item-title>型版名稱:</v-list-item-title> 內容尺寸:{{getParseName(paperSize,"content")}}<br>
<input type="text" v-model="styleName" /> 列印尺寸:{{ getParseName(printSize,"print") }}<br>
</v-list-item-content> 列印模式:{{ getParseName(printMode,"mode") }}<br>
</v-list-item> 底圖:{{ backendInp }}
<v-list-item > </v-card-text>
<v-list-item-content> </v-card>
<v-list-item-title>內容尺寸:{{getParseName(paperSize,"content")}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item >
<v-list-item-content>
<v-list-item-title >列印尺寸:{{ getParseName(printSize,"print") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item >
<v-list-item-content>
<v-list-item-title >列印模式:{{ getParseName(printMode,"mode") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item >
<v-list-item-content>
<v-list-item-title> 底圖:{{ backendInp }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</v-list>
</div>
</div> </div>
<div id="printArea" style="width: 100vw; height: 100vh"> <div id="printArea" style="width: 100vw; height: 100vh">
@@ -390,6 +394,59 @@
</v-btn> </v-btn>
</template> </template>
</v-snackbar> </v-snackbar>
<v-dialog
v-model="paperDialog"
width="600" height="800" :z-index="3000"
>
<v-card>
<v-card-text>
<v-text-field v-model="newPaper.paperName" label="尺寸名稱"></v-text-field>
<v-text-field v-model="newPaper.paperWidth" label="寬度(mm)"></v-text-field>
<v-text-field v-model="newPaper.paperHeight" label="高度(mm)"></v-text-field>
</v-card-text>
<v-card-actions>
<v-btn
class="ms-auto"
@click="savePaperSize"
>確定</v-btn>
<v-btn
class="ms-auto"
@click="paperDialog = false"
>取消</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog
v-model="removeDialog"
width="auto"
:z-index="3000"
>
<v-card>
<v-card-text>
確定刪除?
</v-card-text>
<v-card-actions>
<v-btn
class="ms-auto"
v-if="removeTarget=='paper'"
@click="confirmRemovePaper"
>確定</v-btn>
<v-btn
class="ms-auto"
v-if="removeTarget=='style'"
@click="confirmRemoveStyle"
>確定</v-btn>
<v-btn
class="ms-auto"
@click="removeDialog = false"
>取消</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" runat="Server">
</asp:Content> </asp:Content>
@@ -440,9 +497,17 @@
}, },
styleName: "", styleName: "",
showStyleMenu: false, showStyleMenu: false,
showPaperMenu: false,
styleMenuX: 0, styleMenuX: 0,
styleMenuY: 0, styleMenuY: 0,
styleMenuStyle:"" styleMenuStyle: "",
removeDialog: false,
removeTarget: "",
removeStyleID: "",
removePaperID: "",
paperMenuX: 0,
paperMenuY: 0,
paperDialog:false,
} }
}, },
computed: { computed: {
@@ -462,9 +527,7 @@
getParseName(id, classes) { getParseName(id, classes) {
if (id != null) { if (id != null) {
if (classes === "style") { if (classes === "style") {
let data = this.allStyle.find(x => x.styleID === id) let data = this.allStyle.find(x => x.styleID === id)
return data?.name return data?.name
} else if (classes === "content") { } else if (classes === "content") {
let data = this.allSize.find(x => x.id === id) let data = this.allSize.find(x => x.id === id)
@@ -498,11 +561,21 @@
this.styleMenuY = e.clientY; this.styleMenuY = e.clientY;
this.styleMenuStyle = `top:${e.clientY}px,left:${e.clientX}px` 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() { closeStyleMenu() {
this.showStyleMenu = false; 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() { print() {
let self = this; let self = this;
let s = this.allStyle.find(x => x.styleID == this.styleID) let s = this.allStyle.find(x => x.styleID == this.styleID)
@@ -697,11 +770,11 @@
} }
} }
}); });
$("#paperSize").append("<option value='newsize' >新增尺寸</option>") /*$("#paperSize").append("<option value='newsize' >新增尺寸</option>")
this.allSize.forEach(x => { this.allSize.forEach(x => {
$("#paperSize").append("<option value='" + x.id + "'>" + x.name + "(" + x.width + "*" + x.height + ")</option>") $("#paperSize").append("<option value='" + x.id + "'>" + x.name + "(" + x.width + "*" + x.height + ")</option>")
$("#printSize").append("<option value='" + x.id + "'>" + x.name + "(" + x.width + "*" + x.height + ")</option>"); $("#printSize").append("<option value='" + x.id + "'>" + x.name + "(" + x.width + "*" + x.height + ")</option>");
}) })*/
}, },
async getElements() { async getElements() {
let self = this let self = this
@@ -712,7 +785,6 @@
//if (response.result=="Y") { //if (response.result=="Y") {
if (response.status == "200") { if (response.status == "200") {
let data = response.data; let data = response.data;
console.log("data:", data)
if (data.result == "Y") { if (data.result == "Y") {
data.data.forEach(x => { data.data.forEach(x => {
self.tabletElements.push(x); self.tabletElements.push(x);
@@ -724,7 +796,7 @@
async getStyles() { async getStyles() {
let self = this let self = this
self.allSize.length = 0 self.allSize.length = 0
$(".style-menu").html("") // $(".style-menu").html("")
await axios await axios
.post(HTTP_HOST + 'api/tablet/GetStyleData', {}) .post(HTTP_HOST + 'api/tablet/GetStyleData', {})
.then(response => { .then(response => {
@@ -734,10 +806,10 @@
if (data.result == "Y") { if (data.result == "Y") {
data.data.forEach(x => { data.data.forEach(x => {
self.allStyle.push(x); self.allStyle.push(x);
$(".style-menu").append("<li><span class='dropdown-item style-item' data-value='" + x.styleID + "'>" + x.name + "</span></li>"); //$(".style-menu").append("<li><span class='dropdown-item style-item' data-value='" + x.styleID + "'>" + x.name + "</span></li>");
}); });
this.bindDropdown(); //this.bindDropdown();
} }
} }
//} //}
@@ -774,7 +846,6 @@
let obj = this.elements let obj = this.elements
let s = this.allStyle.find(x => x.styleID == id) let s = this.allStyle.find(x => x.styleID == id)
let size = this.allSize.find(x => x.id == s.paperSize) let size = this.allSize.find(x => x.id == s.paperSize)
//this.showStyleMenu = true;
this.paper.width = size.width; this.paper.width = size.width;
this.paper.height = size.height; this.paper.height = size.height;
this.rosterLimit = s.rosterLimit; this.rosterLimit = s.rosterLimit;
@@ -784,6 +855,7 @@
this.printMode = s.printMode this.printMode = s.printMode
this.perpage = s.perpage this.perpage = s.perpage
this.styleID = id this.styleID = id
this.styleName=s.name
//this.rosterLimit = s.rosterLimit //this.rosterLimit = s.rosterLimit
//$("#paperSize").val(s.paperSize); //$("#paperSize").val(s.paperSize);
@@ -879,9 +951,9 @@
}); });
} }
}, },
async removePaper() { async confirmRemovePaper() {
let self = this; let self = this;
let paperSize =this.paperSize //$("#paperSize").val() let paperSize = this.removePaperID //$("#paperSize").val()
//console.log("paperSize:",paperSize); //console.log("paperSize:",paperSize);
if (paperSize == "newsize" || paperSize == "" || paperSize == null || paperSize == undefined) { if (paperSize == "newsize" || paperSize == "" || paperSize == null || paperSize == undefined) {
@@ -894,11 +966,8 @@
.post(HTTP_HOST + 'api/tablet/DelPaperSize', ps) .post(HTTP_HOST + 'api/tablet/DelPaperSize', ps)
.then(response => { .then(response => {
if (response.status == "200") { if (response.status == "200") {
//if (response.data.result == "Y") { this.snackbar.text = `${response.data.message}`;
this.snackbar.show = true
$("#toast_body").html(`${response.data.message}`)
self.toast.show();
//}
if (response.data.result == "Y") { if (response.data.result == "Y") {
self.getPaperSize() self.getPaperSize()
@@ -906,17 +975,23 @@
this.paperSize = "" this.paperSize = ""
this.changePaper() 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 self = this;
let sID = this.styleID let sID = this.removeStyleID;
//console.log("styleID:", sID); //console.log("styleID:", sID);
if (sID == "000001" || sID == null || sID == undefined) { if (sID == "000001" || sID == null || sID == undefined) {
//$("#toast_body").html("請選擇要刪除的版型")
//self.toast.show();
this.snackbar.text = "請選擇要刪除的版型" this.snackbar.text = "請選擇要刪除的版型"
this.snackbar.show = true this.snackbar.show = true
return false return false
@@ -926,17 +1001,22 @@
.post(HTTP_HOST + 'api/tablet/DelTabletStyle', ps) .post(HTTP_HOST + 'api/tablet/DelTabletStyle', ps)
.then(response => { .then(response => {
if (response.status == "200") { if (response.status == "200") {
//if (response.data.result == "Y") {
$("#toast_body").html(`${response.data.message}`) $("#toast_body").html(`${response.data.message}`)
self.toast.show(); self.toast.show();
//}
if (response.data.result == "Y") { if (response.data.result == "Y") {
self.getStyles() self.getStyles()
} }
} }
}); });
}, },
async removeStyle() {
this.removeDialog = true;
this.removeTarget = "style";
console.log("QQOO",this.removeStyle)
},
async newPaperSize() {
this.paperDialog = true
},
async savePaperSize() { async savePaperSize() {
let ps = { let ps = {
paperName: this.newPaper.paperName, //$("#paperName").val(), paperName: this.newPaper.paperName, //$("#paperName").val(),
@@ -957,6 +1037,10 @@
//$("#paperSize").val("") //$("#paperSize").val("")
self.paperSize="" self.paperSize=""
self.changePaper() self.changePaper()
self.paperDialog = false
self.newPaper.paperName = ""
self.newPaper.paperWidth = 0
self.newPaper.paperHeight =0
} }
} }
}); });
@@ -1423,6 +1507,7 @@
$("#toast_body").html(`${"ok"}`) $("#toast_body").html(`${"ok"}`)
self.toast.show(); self.toast.show();
this.getStyles();
} }
} }
}); });