調整 _graphManagement.html

This commit is contained in:
SinoroWu 2022-12-07 15:45:41 +08:00
parent 85ce778003
commit 741deef990

View File

@ -31,44 +31,11 @@
<hr>
</div>
<div class="row bg-dark p-2 mb-5 align-items-center">
<div class="col-auto">
<div class="frame-wrap">
<input id="checkAll" type="checkbox" name="all" onclick="check_all(this,'c')"
style="display:none" />
<label for="checkAll" type="button" class="btn btn-info mr-3">全選</label>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline1">
<label class="custom-control-label" for="defaultInline1">施工詳圖</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline2">
<label class="custom-control-label" for="defaultInline2">設備規範</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline3">
<label class="custom-control-label" for="defaultInline3">工程介面圖說</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline4">
<label class="custom-control-label" for="defaultInline4">門禁規範</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline5">
<label class="custom-control-label" for="defaultInline5">監控平面圖</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline6">
<label class="custom-control-label" for="defaultInline6">其它</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<a href="#" id="upload" class="btn btn-success" data-toggle="modal" data-target="#uploadPicture">+
上傳</a>
<div class="my-2">
<a href="#" id="upload" class="btn btn-success" data-toggle="modal" data-target="#uploadPicture">
+上傳
</a>
</div>
<table class="table table-bordered table-striped text-center m-0">
@ -81,7 +48,6 @@
<th>功能</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
@ -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 = `<tr>
<td>${res.oriOrgName}</td>
<td>${res.donOrgName}</td>
@ -270,7 +236,6 @@
</td>
</tr>`;
});
$('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", "<22>L<EFBFBD>k<EFBFBD>W<EFBFBD><57>", "<22>̦h<CCA6>u<EFBFBD><75>W<EFBFBD><57>" + maxlength + "<22>i<EFBFBD>A<EFBFBD>z<EFBFBD>w<EFBFBD>g<EFBFBD>W<EFBFBD>X<EFBFBD>W<EFBFBD>Ǽƶq<C6B6>C");
$("#upMyDesignDiagram").val("");
return false;
}
}
oriImg = this.files[0];
fileHelper.readAndPreviewImages(this.files, 'upForDesignDiagram', 0, 86, '<div class="file-item">', '<button class="del-small-trash" name="btnDelImg" ><i class="fa fa-times"></i></button></div>');
});
// 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", "<22>L<EFBFBD>k<EFBFBD>W<EFBFBD><57>", "<22>̦h<CCA6>u<EFBFBD><75>W<EFBFBD><57>" + maxlength + "<22>i<EFBFBD>A<EFBFBD>z<EFBFBD>w<EFBFBD>g<EFBFBD>W<EFBFBD>X<EFBFBD>W<EFBFBD>Ǽƶq<C6B6>C");
// $("#upMyAsBuilt").val("");
// return false;
// }
// }
// fileHelper.readAndPreviewImages(this.files, 'upForAsBuilt', 0, 86, '<div class="file-item">', '<button class="del-small-trash" name="btnDelImg" ><i class="fa fa-times"></i></button></div>');
// });
// 取上傳檔名
// $("#upMyDesignDiagram").on("change", function (e) {
// let fileHelper = new YourTeam.Utility.File();
// let fileName = this.files[0].name;
// strHtml = `<small>${fileName}</small>`;
// $('#upDesignDiagram').html(strHtml);
// });
// $("#editMyDesignDiagram").on("change", function (e) {
// let fileHelper = new YourTeam.Utility.File();
// let fileName = this.files[0].name;
// strHtml = `<small>${fileName}</small>`;
// $('#editDesignDiagram').html(strHtml);
// });
// 取上傳檔名
// $("#upMyAsBuilt").on("change", function (e) {
// let fileHelper = new YourTeam.Utility.File();
// let fileName = this.files[0].name;
// strHtml = `<small>${fileName}</small>`;
// $('#upAsBuiltDrawing').html(strHtml);
// });
// $("#editMyAsBuilt").on("change", function (e) {
// let fileHelper = new YourTeam.Utility.File();
// let fileName = this.files[0].name;
// strHtml = `<small>${fileName}</small>`;
// $('#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, '<div class="file-item">', '<button class="del-small-trash" name="btnDelImg" ><i class="fa fa-times"></i></button></div>');
});
// 編輯
$("#edit").click(function () {