[Frontend][圖資管理] 檔案上傳格式調整

This commit is contained in:
dev01 2023-01-31 10:17:59 +08:00
parent c42708f30a
commit 569deab3f7

View File

@ -76,7 +76,7 @@
</div> </div>
<h3>選擇一個文件或拖放到這裡</h3> <h3>選擇一個文件或拖放到這裡</h3>
<p class="mb-0 col-grey"> <p class="mb-0 col-grey">
DWG檔案不超過 10MB (圖片檔, 文字檔, word, ppt, excel, pdf)檔案不超過 10MB
</p> </p>
</div> </div>
<div class="fallback"> <div class="fallback">
@ -207,11 +207,12 @@
dictCancelUploadConfirmation: `確定要取消上傳此檔案嗎?`, dictCancelUploadConfirmation: `確定要取消上傳此檔案嗎?`,
dictCancelUpload: `<span class="material-icons mi-cancel">cancel</span>`, dictCancelUpload: `<span class="material-icons mi-cancel">cancel</span>`,
dictMaxFilesExceeded: "已超過上傳限制數量", dictMaxFilesExceeded: "已超過上傳限制數量",
dictFileTooBig:"已超出上傳限制,最大{{maxFilesize}}MB而您的檔案{{filesize}}MB。",
maxFilesize: 10, maxFilesize: 10,
filesizeBase: 1024, filesizeBase: 1024,
maxFiles: 1, maxFiles: 1,
autoProcessQueue: false, autoProcessQueue: false,
acceptedFiles: ".dwg", acceptedFiles: ".dwg,.jpeg,.jpg,.png,.gif,.doc,.docx,.ppt,.pptx,.xlsx,.xls,.opt,.pdf,.txt",
init: function () { init: function () {
this.on("addedfile", function (file) { this.on("addedfile", function (file) {
$(this.previewsContainer).find('.dz-progress').addClass('d-none'); $(this.previewsContainer).find('.dz-progress').addClass('d-none');
@ -236,25 +237,16 @@
}; };
uploader.graMyDesignDiagram = $("#graMyDesignDiagram").dropzone(option); uploader.graMyDesignDiagram = $("#graMyDesignDiagram").dropzone(option);
/*uploader.graMyAsBuilt = $("#graMyAsBuilt").dropzone(option);*/
uploader["graMyDesignDiagram"][0].dropzone.on("addedfile", file => { uploader["graMyDesignDiagram"][0].dropzone.on("addedfile", file => {
uploadFiles["graMyDesignDiagram"] = file; uploadFiles["graMyDesignDiagram"] = file;
}) })
//uploader["graMyAsBuilt"][0].dropzone.on("addedfile", file => {
// uploadFiles["graMyAsBuilt"] = file;
//})
uploader["graMyDesignDiagram"][0].dropzone.on("removedfile", file => { uploader["graMyDesignDiagram"][0].dropzone.on("removedfile", file => {
uploadFiles["graMyDesignDiagram"] = {}; uploadFiles["graMyDesignDiagram"] = {};
file.previewElement.remove(); file.previewElement.remove();
}) })
//uploader["graMyAsBuilt"][0].dropzone.on("removedfile", file => {
// uploadFiles["graMyAsBuilt"] = {};
// file.previewElement.remove();
//})
} }
// 新增資料 // 新增資料
@ -288,7 +280,7 @@
let dowLoaEle = YT.Alert.Tip("準備下載中...", "show", true); let dowLoaEle = YT.Alert.Tip("準備下載中...", "show", true);
let rowData = graTable.row($(this).closest("tr")).data(); let rowData = graTable.row($(this).closest("tr")).data();
let apiUrl = baseApiUrl + `/File/Download?type=graph&savename=${rowData.donSavName}&oriname=${rowData.donOrgName}`; let apiUrl = baseApiUrl + `/File/Download?type=graph&savename=${rowData.donSavName}&oriname=${rowData.donOrgName}`;
let extname = rowData.donOrgName?.split(".").slice(-1) || "dwg"; let extname = rowData.donOrgName?.split(".").slice(-1);
download(token, apiUrl, rowData.name + "_竣工圖" + "." + extname, function () { download(token, apiUrl, rowData.name + "_竣工圖" + "." + extname, function () {
$(dowLoaEle.ele).YTAlert().hide(); $(dowLoaEle.ele).YTAlert().hide();
}); });