modify
This commit is contained in:
@@ -81,7 +81,38 @@
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
compare(item) {
|
||||
// console.log("compare:", item);
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/activity/ComparePreAndOrder', {num:item.num})
|
||||
.then(response => {
|
||||
if (response.data.result == "N") {
|
||||
this.message_dialog.message = response.data.message;
|
||||
this.message_dialog.show = true;
|
||||
} else if (response.data.result == "Y") {
|
||||
const link = document.createElement('a');
|
||||
link.href = HTTP_HOST + "/" + response.data.filename;
|
||||
link.target = "_blank";
|
||||
|
||||
// 5. Specify the filename for the download
|
||||
//link.setAttribute('download', 'my-downloaded-file.pdf');
|
||||
|
||||
// 6. Append link to the body, click it, and remove it immediately
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
// 7. Free up memory by revoking the object URL
|
||||
//window.URL.revokeObjectURL(blobUrl);
|
||||
//window.open(HTTP_HOST +"/" +response.data.filename, "_blank");
|
||||
}
|
||||
this.isdisabled = false;
|
||||
this.isloading = false;
|
||||
|
||||
})
|
||||
.catch(error => console.log(error))
|
||||
},
|
||||
getDefault(clearpage = false) {
|
||||
const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
const params = {
|
||||
@@ -208,7 +239,11 @@
|
||||
<template #item.slot_btn="{ item }">
|
||||
<a :href="'reg.aspx?num='+item.num" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>編輯</a>
|
||||
<a @click="copyItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>複製</a>
|
||||
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
|
||||
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
|
||||
<% if (IsPreOrder == "true")
|
||||
{ %>
|
||||
<a @click="compare(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>比對</a>
|
||||
<% } %>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-container>
|
||||
|
||||
@@ -14,12 +14,13 @@ using static TreeView;
|
||||
public partial class admin_activity_index : MyWeb.config
|
||||
{
|
||||
private Model.ezEntities _db = new Model.ezEntities();
|
||||
public string IsPreOrder = "false";
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
IsPreOrder = ConfigurationManager.AppSettings["IsPreOrder"];
|
||||
BuildKind();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user