+
+
+
+
+
+
@@ -181,10 +181,11 @@
pageAct.selSysSub = null;
pageAct.alr_startdate = null;
pageAct.alr_enddate = null;
+ pageAct.imageFile = [];
first = true;
$(function () {
- $(loadEle).Loading("close");
+ initDropzone();
setReturn(false);
setConfirm(false);
event();
@@ -287,10 +288,15 @@
+ alr_tableData.alarmClass.toString().split('_')[1] + "_" + alr_tableData.buildingFloorName_zh.toString().split('-')[1] + "_" + alr_tableData.sourceName_zh.toString().split('-')[0] + "_"
+ alr_tableData.sourceName_zh.toString().split('-')[1];
- $('#inpFixDoCode').val($(`option[value*=${deviceNumber}]`).val() !== undefined ? $(`option[value*=${deviceNumber}]`).val() : "");
selUser();
selDevice();
selOpeFir();
+
+ $('#inpFixDoCode option[data-sub=' + alr_tableData.alarmClass.toString().split('_')[1] + '][data-main=' + alr_tableData.alarmClass.toString().split('_')[0] + ']').attr('hidden', false);
+ $('#inpFixDoCode option[data-sub!=' + alr_tableData.alarmClass.toString().split('_')[1] + '][data-main!=' + alr_tableData.alarmClass.toString().split('_')[0] + ']').attr('hidden', true);
+
+ let alr_fixDoCode = $($('#inpFixDoCode option[data-sub=' + alr_tableData.alarmClass.toString().split('_')[1] + '][data-main=' + alr_tableData.alarmClass.toString().split('_')[0] + ']')[0]).val();
+ $('#inpFixDoCode').val(alr_fixDoCode);
});
}
@@ -486,7 +492,7 @@
"title": "異常類別",
"data": "alarmClass",
"render": function (data) {
- return data.split('_')[1];
+ return data.split('_')[0] + "-" + data.split('_')[1];
}
},
{
@@ -550,7 +556,7 @@
strHtml = ``;
$("#inpFixDoCode").html();
$.each(res.data, (index, roleObj) => {
- strHtml += `
`;
+ strHtml += `
`;
if (index == 0) {
pageAct.sysMain = roleObj.device_system_tag;
@@ -598,4 +604,49 @@
}
}, null, "POST").send();
}
+
+ //上傳檔案 dropzone
+ function initDropzone() {
+ uploader = $("#alr_dropZone").dropzone({
+ url: baseApiUrl + '/api/Upload',
+ previewsContainer: false,
+ addRemoveLinks: false,
+ dictRemoveFile: `
delete`,
+ dictInvalidFileType: `上傳格式錯誤`,
+ dictCancelUploadConfirmation: `確定要取消上傳此檔案嗎?`,
+ dictCancelUpload: `
cancel`,
+ maxFilesize: 3,
+ filesizeBase: 1024,
+ maxFiles: 50,
+ acceptedFiles: ".pdf, .docx, .doc, .xls, .xlsm, .xlsx, .ppt, .pptx, .gif, .png, .jpg, .jpeg",
+ headers: { "Authorization": 'Bearer ' + localStorage.getItem("JWT-Authorization") },
+ accept: function (file, done) {
+ let fileHelper = new YourTeam.Utility.File();
+ tmpGuidArr = [];
+
+ if (/\.(jpe?g|png|gif)$/i.test(file.name)) {
+ fileHelper.readAndPreviewImages(file, 'alr_forImage', 70, 70, '
', '');
+
+ pageAct.imageFile.map(function (v, i) { tmpGuidArr.push(v.file.guid) });
+ if (jQuery.inArray(file.guid, tmpGuidArr) == -1) { //not in array
+ let fd = new FormData();
+ let f = file;
+ fd.append('file', f);
+ pageAct.imageFile.push({ "ori_file_name": f.name, "save_file_name": f.guid, "file": fd.get("file") });
+ }
+ }
+ else if (/\.(xls?x|doc?x|ptt?x|pdf|zip|rar|7zip|txt|odt|xml|rtf|ods|odp|pps?x)$/i.test(file.name)) {
+ fileHelper.readAndPreviewFiles(file, 'alr_forFile', 70, 70, "
", "
");
+
+ pageAct.imageFile.map(function (v, i) { tmpGuidArr.push(v.file.guid) });
+ if (jQuery.inArray(file.guid, tmpGuidArr) == -1) { //not in array
+ let fd = new FormData();
+ let f = file;
+ fd.append('file', f);
+ pageAct.imageFile.push({ "ori_file_name": f.name, "save_file_name": f.guid, "file": fd.get("file") });
+ }
+ }
+ }
+ });
+ }
\ No newline at end of file
diff --git a/Frontend/_operation.html b/Frontend/_operation.html
index a05db5f..7b6e747 100644
--- a/Frontend/_operation.html
+++ b/Frontend/_operation.html
@@ -7,7 +7,7 @@
@@ -246,9 +246,14 @@