diff --git a/Frontend/_graphManagement.html b/Frontend/_graphManagement.html index 2b250c5..135df17 100644 --- a/Frontend/_graphManagement.html +++ b/Frontend/_graphManagement.html @@ -31,44 +31,11 @@
-
-
-
- - -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
- + - 上傳 + @@ -81,7 +48,6 @@ -
功能
@@ -253,12 +219,12 @@ building_tag: pageAct.buiTag } objSendData.Data = sendData; - let url = baseApiUrl + "/GraphManage/GraManList"; + // console.log("查看pageAct", pageAct); + let url = baseApiUrl + "/GraphManage/GraManRead"; function success(res) { console.log("查看", res); let strHtml = ``; $.each(res, function (index, val) { - strHtml = ` ${res.oriOrgName} ${res.donOrgName} @@ -270,7 +236,6 @@ `; }); - $('tbody').html(strHtml); } ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send(); @@ -278,21 +243,17 @@ // 新增資料 onEvent('click', '#close', function () { + let url = baseApiUrl + "/GraphManage/SaveGraMan"; let fd = new FormData(); - fd.append("main_system_tag", $("#upSelMain").val()); fd.append("sub_system_tag", $("#upSelSub").val()); fd.append("name", $("#upPicName").val()); fd.append("oriOrgName", $("#upMyDesignDiagram").val()); fd.append("donOrgName", $("#upMyAsBuilt").val()); - // fd.append("oriFile", $("#upMyAsBuilt").val()); - // fd.append("donFile", $("#upMyAsBuilt").val()); - fd.append("oriFile", this.files); - // fd.append("donFile", fileHelper2); - // fd.append("product[photos][]", e.target.files[i]); - console.log("查看", fd); + fd.append("oriFile", oriImg); + fd.append("donFile", donImg); $.ajax({ url: url, @@ -307,114 +268,26 @@ if (!res || res.code != "0000" || !res.data) { } else { - console.log("error"); + console.log("ERROR: POST fd"); } } }); - - // let url = baseApiUrl + "/GraphManage/SaveGraMan"; - // pageAct.opeFirmId = $(this).parent().data('id') - // objSendData.Data = { id: pageAct.opeFirmId }; - // ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { - // if (!res || res.code != "0000" || !res.data) { - - // } else { - // pageAct.opeFirmAct = 'edit'; - // selSysMain(res.data.device_system_category_layer2); - // $('#uploadForm input[id=picNum]').val(res.data.name); - // $('#uploadForm input[id=picName]').val(res.data.contact_person); - // $('#uploadForm select[id=selMain]').val(res.data.device_system_category_layer2).change(); - // $('#uploadForm select[id=selSub]').val(res.data.device_system_category_layer3).change(); - // $('#uploadForm input[id=myDesignDiagram]').val(res.data.phone); - // $('#uploadForm input[id=myAsBuilt]').val(res.data.email); - // } - // }, null, "POST").send() }); // 上傳檔案 - var imageUploadFormOS = 0; + let oriImg; $("#upMyDesignDiagram").on("change", function (e) { let fileHelper = new YourTeam.Utility.File(); - - if ($('#upForDesignDiagram p').length > 0) { - $("#upForDesignDiagram").html(""); - } - console.log(this.files); - imageUploadFormOS = this.files.length; - - let maxlength = $("#upForDesignDiagram").data("maxlength"); - if (maxlength) { - if (imageUploadFormOS + $('#upForDesignDiagram img').length > maxlength) { - ShowModal("error", "uplImgOverLen", "�L�k�W��", "�̦h�u��W��" + maxlength + "�i�A�z�w�g�W�X�W�Ǽƶq�C"); - $("#upMyDesignDiagram").val(""); - return false; - } - } + oriImg = this.files[0]; fileHelper.readAndPreviewImages(this.files, 'upForDesignDiagram', 0, 86, '
', '
'); - }); - // var imageUploadFormOS = 0; - // $("#upMyAsBuilt").on("change", function (e) { - // let fileHelper = new YourTeam.Utility.File(); - - // if ($('#upForAsBuilt p').length > 0) { - // $("#upForAsBuilt").html(""); - // } - // console.log(this.files); - // imageUploadFormOS = this.files.length; - - // let maxlength = $("#upForAsBuilt").data("maxlength"); - // if (maxlength) { - // if (imageUploadFormOS + $('#upForAsBuilt img').length > maxlength) { - // ShowModal("error", "uplImgOverLen", "�L�k�W��", "�̦h�u��W��" + maxlength + "�i�A�z�w�g�W�X�W�Ǽƶq�C"); - // $("#upMyAsBuilt").val(""); - // return false; - // } - // } - // fileHelper.readAndPreviewImages(this.files, 'upForAsBuilt', 0, 86, '
', '
'); - - // }); - - // 取上傳檔名 - // $("#upMyDesignDiagram").on("change", function (e) { - // let fileHelper = new YourTeam.Utility.File(); - // let fileName = this.files[0].name; - - // strHtml = `${fileName}`; - // $('#upDesignDiagram').html(strHtml); - // }); - - // $("#editMyDesignDiagram").on("change", function (e) { - // let fileHelper = new YourTeam.Utility.File(); - // let fileName = this.files[0].name; - - // strHtml = `${fileName}`; - // $('#editDesignDiagram').html(strHtml); - // }); - - // 取上傳檔名 - // $("#upMyAsBuilt").on("change", function (e) { - // let fileHelper = new YourTeam.Utility.File(); - // let fileName = this.files[0].name; - - // strHtml = `${fileName}`; - // $('#upAsBuiltDrawing').html(strHtml); - // }); - - // $("#editMyAsBuilt").on("change", function (e) { - // let fileHelper = new YourTeam.Utility.File(); - // let fileName = this.files[0].name; - - // strHtml = `${fileName}`; - // $('#editAsBuiltDrawing').html(strHtml); - // }); - - // 全選功能 - function check_all(obj, cName) { - var checkboxs = document.getElementsByName(cName); - for (var i = 0; i < checkboxs.length; i++) { checkboxs[i].checked = obj.checked; } - } + let donImg; + $("#upMyAsBuilt").on("change", function (e) { + let fileHelper = new YourTeam.Utility.File(); + donImg = this.files[0]; + fileHelper.readAndPreviewImages(this.files, 'upForAsBuilt', 0, 86, '
', '
'); + }); // 編輯 $("#edit").click(function () {