2022-11-22 12:09:35 +08:00
|
|
|
|
<main id="js-page-content" role="main" class="page-content">
|
2022-11-21 23:43:22 +08:00
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-12 col-xl-12">
|
|
|
|
|
|
|
|
|
|
<h1 class="p-2 mb-0">圖資管理</h1>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="row bg-dark p-2">
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="btn-group">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" key="建築">
|
|
|
|
|
建築</button>
|
|
|
|
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" key="電力管線">
|
|
|
|
|
電力管線</button>
|
|
|
|
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" ket="水力管線">
|
|
|
|
|
水力管線</button>
|
|
|
|
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" key="控制系統">
|
|
|
|
|
控制系統</button>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<input type="text" id="simpleinput" class="form-control" placeholder="關鍵字">
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<a href="#" class="btn btn-info">查詢</a>
|
|
|
|
|
</div>
|
|
|
|
|
<hr>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row bg-dark p-2 mb-5 align-items-center">
|
|
|
|
|
<div class="col-auto">
|
|
|
|
|
<div class="frame-wrap">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<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>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline1">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline1">施工詳圖</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline2">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline2">設備規範</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline3">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline3">工程介面圖說</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline4">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline4">門禁規範</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline5">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline5">監控平面圖</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<input type="checkbox" name="c" class="custom-control-input" id="defaultInline6">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<label class="custom-control-label" for="defaultInline6">其它</label>
|
|
|
|
|
</div>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="mb-3">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<a href="#" id="upload" class="btn btn-success" data-toggle="modal" data-target="#uploadPicture">+
|
|
|
|
|
上傳</a>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<table class="table table-bordered table-striped text-center m-0">
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<thead class="thead-themed">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<tr>
|
|
|
|
|
<th>圖號</th>
|
|
|
|
|
<th>圖名</th>
|
|
|
|
|
<th>原設計</th>
|
|
|
|
|
<th>竣工圖</th>
|
|
|
|
|
<th>功能</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
|
2022-11-24 14:47:44 +08:00
|
|
|
|
<tbody></tbody>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</table>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</main>
|
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<!-- upload modal -->
|
2022-11-22 17:18:39 +08:00
|
|
|
|
<div class="modal fade" id="uploadPicture" tabindex="-1" role="dialog" aria-hidden="true">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h4 class="modal-title">
|
2022-11-22 17:18:39 +08:00
|
|
|
|
圖資上傳
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</h4>
|
|
|
|
|
</div>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
<form id="uploadForm">
|
2022-11-21 23:43:22 +08:00
|
|
|
|
<div class="modal-body">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<label class="form-label" for="upPicNum">圖號</label>
|
|
|
|
|
<input type="text" id="upPicNum" name="upPicNum" class="form-control">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<label class="form-label" for="upPicName">圖名</label>
|
|
|
|
|
<input type="text" id="upPicName" name="upPicName" class="form-control">
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<div class="col-md-6 mt-3">
|
|
|
|
|
<div class="form-group">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<label class="form-label" for="upSelMain">主要類別</label>
|
|
|
|
|
<select class="form-control" id="upSelMain">
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<option>建築</option>
|
|
|
|
|
<option>電力控制</option>
|
|
|
|
|
<option>水力控制</option>
|
|
|
|
|
<option>系統控制</option>
|
|
|
|
|
</select>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<div class="col-md-6 mt-3">
|
|
|
|
|
<div class="form-group">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<label class="form-label" for="upSelSub">子類別</label>
|
|
|
|
|
<select class="form-control" id="upSelSub">
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<option>施工詳圖</option>
|
|
|
|
|
<option>設備規範</option>
|
|
|
|
|
<option>工程介面圖說</option>
|
|
|
|
|
<option>門禁規範</option>
|
|
|
|
|
<option>監控平面圖</option>
|
|
|
|
|
<option>其它</option>
|
|
|
|
|
</select>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-22 18:34:55 +08:00
|
|
|
|
<div class="col-md-12 mt-6">
|
2022-11-22 18:09:04 +08:00
|
|
|
|
<label>原設計</label>
|
|
|
|
|
</div>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
<div class="col-md-12">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<input id="upMyDesignDiagram" type="file" style="display:none" />
|
|
|
|
|
<label for="upMyDesignDiagram" type="button" class="file-upload btn btn-info"
|
2022-11-24 12:05:23 +08:00
|
|
|
|
style="cursor : pointer ">上傳檔案</label>
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<div id='upForDesignDiagram' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
|
2022-11-22 18:09:04 +08:00
|
|
|
|
</div>
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<div id="upDesignDiagram" class="col-md-12 ml-3"></div>
|
2022-11-22 18:09:04 +08:00
|
|
|
|
<div class="col-md-12 mt-3">
|
|
|
|
|
<label>竣工圖</label>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-12">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<input id="upMyAsBuilt" type="file" style="display:none" />
|
|
|
|
|
<label for="upMyAsBuilt" type="button" class="file-upload btn btn-info"
|
2022-11-24 12:05:23 +08:00
|
|
|
|
style="cursor : pointer ">上傳檔案</label>
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<div id='upForAsBuilt' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
|
2022-11-22 17:18:39 +08:00
|
|
|
|
</div>
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<div id="upAsBuiltDrawing" class="col-md-12 ml-3"></div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</div>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<button type="submit" class="btn btn-primary" id="accManSendBtn">儲存</button>
|
|
|
|
|
<button type="button" class="btn btn-danger" id="close" data-dismiss="modal">取消</button>
|
2022-11-21 23:43:22 +08:00
|
|
|
|
</div>
|
2022-11-22 12:09:35 +08:00
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-11-24 09:29:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<!-- edit modal -->
|
|
|
|
|
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h4 class="modal-title">
|
|
|
|
|
編輯
|
|
|
|
|
</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<form id="editForm">
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="form-label" for="editPicNum">圖號</label>
|
|
|
|
|
<input type="text" id="editPicNum" name="editPicNum" class="form-control">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="form-label" for="editPicName">圖名</label>
|
|
|
|
|
<input type="text" id="editPicName" name="editPicName" class="form-control">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-12 mt-6">
|
|
|
|
|
<label>原設計</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<input id="editMyDesignDiagram" type="file" style="display:none" />
|
|
|
|
|
<label for="editMyDesignDiagram" type="button" class="file-upload btn btn-info"
|
|
|
|
|
style="cursor : pointer ">上傳檔案</label>
|
|
|
|
|
<div id='editForDesignDiagram' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="editDesignDiagram" class="col-md-12 ml-3"></div>
|
|
|
|
|
<div class="col-md-12 mt-3">
|
|
|
|
|
<label>竣工圖</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<input id="editMyAsBuilt" type="file" style="display:none" />
|
|
|
|
|
<label for="editMyAsBuilt" type="button" class="file-upload btn btn-info"
|
|
|
|
|
style="cursor : pointer ">上傳檔案</label>
|
|
|
|
|
<div id='editForAsBuilt' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="editAsBuiltDrawing" class="col-md-12 ml-3"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="submit" class="btn btn-primary" id="accManSendBtn">儲存</button>
|
|
|
|
|
<button type="button" class="btn btn-danger" id="close" data-dismiss="modal">取消</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- delete modal -->
|
|
|
|
|
<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<h4 class="mr-auto">確定刪除?</h4>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="confirmDelBtn" aria-label="OK" e-prevent>
|
|
|
|
|
確定
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="No">
|
|
|
|
|
取消
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-11-24 09:29:51 +08:00
|
|
|
|
<script>
|
2022-11-24 14:47:44 +08:00
|
|
|
|
|
2022-11-24 09:29:51 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
initList();
|
|
|
|
|
})
|
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
// 讀取列表資料
|
2022-11-24 09:29:51 +08:00
|
|
|
|
function initList() {
|
|
|
|
|
let sendData = {
|
|
|
|
|
building_tag: pageAct.buiTag
|
|
|
|
|
}
|
|
|
|
|
objSendData.Data = sendData;
|
2022-12-07 09:07:59 +08:00
|
|
|
|
let url = baseApiUrl + "/GraphManage/GraManList";
|
2022-11-24 09:29:51 +08:00
|
|
|
|
function success(res) {
|
2022-12-05 15:22:41 +08:00
|
|
|
|
console.log("查看", res);
|
2022-11-24 09:29:51 +08:00
|
|
|
|
let strHtml = ``;
|
2022-11-24 12:05:23 +08:00
|
|
|
|
$.each(res, function (index, val) {
|
|
|
|
|
|
|
|
|
|
strHtml = `<tr>
|
2022-12-07 09:07:59 +08:00
|
|
|
|
<td>${res.oriOrgName}</td>
|
|
|
|
|
<td>${res.donOrgName}</td>
|
2022-11-24 12:05:23 +08:00
|
|
|
|
<td>${res.code}</td>
|
|
|
|
|
<td>${res.code}</td>
|
|
|
|
|
<td>
|
2022-12-05 15:22:41 +08:00
|
|
|
|
<a href="#" class="btn btn-primary mr-2" id="edit" data-toggle="modal" data-target="#editModal">編輯</a>
|
|
|
|
|
<a href="#" class="btn btn-danger" id="del" data-toggle="modal" data-target="#delModal">刪除</a>
|
2022-11-24 12:05:23 +08:00
|
|
|
|
</td>
|
|
|
|
|
</tr>`;
|
2022-11-24 09:29:51 +08:00
|
|
|
|
});
|
|
|
|
|
|
2022-11-24 12:05:23 +08:00
|
|
|
|
$('tbody').html(strHtml);
|
2022-11-24 09:29:51 +08:00
|
|
|
|
}
|
|
|
|
|
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
|
|
|
|
}
|
2022-11-24 12:05:23 +08:00
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
// 新增資料
|
2022-12-07 09:07:59 +08:00
|
|
|
|
onEvent('click', '#close', function () {
|
2022-12-05 15:22:41 +08:00
|
|
|
|
let url = baseApiUrl + "/GraphManage/SaveGraMan";
|
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: fd,
|
|
|
|
|
async: false,
|
|
|
|
|
cache: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
processData: false,
|
|
|
|
|
beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', "Bearer " + localStorage.getItem("JWT-Authorization")) },
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (!res || res.code != "0000" || !res.data) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
console.log("error");
|
|
|
|
|
}
|
2022-12-05 15:22:41 +08:00
|
|
|
|
}
|
2022-12-07 09:07:59 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 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()
|
2022-12-05 15:22:41 +08:00
|
|
|
|
});
|
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// 上傳檔案
|
|
|
|
|
var imageUploadFormOS = 0;
|
2022-12-05 15:22:41 +08:00
|
|
|
|
$("#upMyDesignDiagram").on("change", function (e) {
|
2022-11-24 12:05:23 +08:00
|
|
|
|
let fileHelper = new YourTeam.Utility.File();
|
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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>');
|
|
|
|
|
|
2022-11-24 14:47:44 +08:00
|
|
|
|
});
|
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// var imageUploadFormOS = 0;
|
|
|
|
|
// $("#upMyAsBuilt").on("change", function (e) {
|
|
|
|
|
// let fileHelper = new YourTeam.Utility.File();
|
2022-12-06 09:59:33 +08:00
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// 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>');
|
|
|
|
|
|
|
|
|
|
// });
|
2022-12-06 09:59:33 +08:00
|
|
|
|
|
2022-11-24 14:47:44 +08:00
|
|
|
|
// 取上傳檔名
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// $("#upMyDesignDiagram").on("change", function (e) {
|
|
|
|
|
// let fileHelper = new YourTeam.Utility.File();
|
|
|
|
|
// let fileName = this.files[0].name;
|
2022-11-24 14:47:44 +08:00
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// strHtml = `<small>${fileName}</small>`;
|
|
|
|
|
// $('#upDesignDiagram').html(strHtml);
|
|
|
|
|
// });
|
2022-11-24 14:47:44 +08:00
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// $("#editMyDesignDiagram").on("change", function (e) {
|
|
|
|
|
// let fileHelper = new YourTeam.Utility.File();
|
|
|
|
|
// let fileName = this.files[0].name;
|
2022-12-05 15:22:41 +08:00
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// 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);
|
|
|
|
|
// });
|
2022-12-05 15:22:41 +08:00
|
|
|
|
|
2022-11-24 14:47:44 +08:00
|
|
|
|
// 全選功能
|
|
|
|
|
function check_all(obj, cName) {
|
|
|
|
|
var checkboxs = document.getElementsByName(cName);
|
|
|
|
|
for (var i = 0; i < checkboxs.length; i++) { checkboxs[i].checked = obj.checked; }
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
// 編輯
|
|
|
|
|
$("#edit").click(function () {
|
|
|
|
|
$("#editPicNum").val() = $("#upPicNum").data();
|
|
|
|
|
console.log($("#editPicNum").val());
|
|
|
|
|
});
|
|
|
|
|
|
2022-12-07 09:07:59 +08:00
|
|
|
|
// 關閉 modal
|
|
|
|
|
$('#uploadPicture').on('hidden.bs.modal', function (e) {
|
|
|
|
|
console.log("123456789");
|
|
|
|
|
});
|
|
|
|
|
$('#colorModal').on('hidden.bs.modal', function () {
|
|
|
|
|
// # 可以设置下拉框为初始值
|
|
|
|
|
$("#colorCodeSelect").val(-1);
|
|
|
|
|
// # 清空表单校验信息
|
|
|
|
|
$("#add").Validform().resetForm();
|
|
|
|
|
$(".Validform_checktip").html("");
|
|
|
|
|
});
|
|
|
|
|
|
2022-12-05 15:22:41 +08:00
|
|
|
|
// 刪除資料
|
|
|
|
|
onEvent('click', '#del', function () {
|
|
|
|
|
pageAct.opeRecId = null;
|
|
|
|
|
pageAct.opeFirmId = $(this).parent().data('id');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onEvent('click', '#del', function () {
|
|
|
|
|
objSendData.Data = { id: pageAct.opeFirmId ?? pageAct.opeRecId };
|
|
|
|
|
let url = baseApiUrl + "/operation/" + (pageAct.work_type == null ? "DelOpeFirm" : "DelOpeRecord");
|
|
|
|
|
|
|
|
|
|
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
|
|
|
|
|
if (!res || res.code != "0000" || !res.data) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//toast_ok(common.AddSuc);
|
|
|
|
|
//$("#delModal").modal("hide");
|
|
|
|
|
$("#confirmDelCanBtn").click();
|
|
|
|
|
// refTable();
|
|
|
|
|
}
|
|
|
|
|
}, null, "DELETE").send();
|
|
|
|
|
});
|
|
|
|
|
|
2022-11-24 09:29:51 +08:00
|
|
|
|
</script>
|