_graphManagement.html 檔案上傳 調整中

This commit is contained in:
SinoroWu 2022-11-24 12:05:23 +08:00
parent 64d30addcb
commit edbf57cf79

View File

@ -68,7 +68,7 @@
</div> </div>
<table class="table table-bordered table-striped text-center m-0"> <table class="table table-bordered table-striped text-center m-0">
<!-- <thead class="thead-themed"> <thead class="thead-themed">
<tr> <tr>
<th>圖號</th> <th>圖號</th>
<th>圖名</th> <th>圖名</th>
@ -79,7 +79,7 @@
</thead> </thead>
<tbody> <tbody>
<tr> <!-- <tr>
<td>TEST03</td> <td>TEST03</td>
<td>TEST03</td> <td>TEST03</td>
<td>A-01.dwg</td> <td>A-01.dwg</td>
@ -98,8 +98,8 @@
<a href="#" class="btn btn-info">編輯</a> <a href="#" class="btn btn-info">編輯</a>
<a href="#" class="btn btn-danger">刪除</a> <a href="#" class="btn btn-danger">刪除</a>
</td> </td>
</tr> </tr> -->
</tbody> --> </tbody>
</table> </table>
</div> </div>
@ -135,39 +135,38 @@
<input type="text" id="inpName" name="inpName" class="form-control"> <input type="text" id="inpName" name="inpName" class="form-control">
</div> </div>
</div> </div>
<div class="dropdown col-md-6 mt-3"> <div class="col-md-6 mt-3">
<label>主要類別</label> <div class="form-group">
<button class="btn btn-dark dropdown-toggle col-12" type="button" id="dropdownMenuButton" <label class="form-label" for="example-select">主要類別</label>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <select class="form-control" id="example-select select2bs4">
主要類別 <option>建築</option>
</button> <option>電力控制</option>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <option>水力控制</option>
<a class="dropdown-item" href="#">建築</a> <option>系統控制</option>
<a class="dropdown-item" href="#">電力控制</a> </select>
<a class="dropdown-item" href="#">水力控制</a>
<a class="dropdown-item" href="#">系統控制</a>
</div> </div>
</div> </div>
<div class="dropdown col-md-6 mt-3"> <div class="col-md-6 mt-3">
<label>子類別</label> <div class="form-group">
<button class="btn btn-dark dropdown-toggle col-12" type="button" id="dropdownMenuButton" <label class="form-label" for="example-select">子類別</label>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <select class="form-control" id="example-select select2bs4">
子類別 <option>施工詳圖</option>
</button> <option>設備規範</option>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <option>工程介面圖說</option>
<a class="dropdown-item" href="#">施工詳圖</a> <option>門禁規範</option>
<a class="dropdown-item" href="#">設備規範</a> <option>監控平面圖</option>
<a class="dropdown-item" href="#">工程介面圖說</a> <option>其它</option>
<a class="dropdown-item" href="#">門禁規範</a> </select>
<a class="dropdown-item" href="#">監控平面圖</a>
<a class="dropdown-item" href="#">其它</a>
</div> </div>
</div> </div>
<div class="col-md-12 mt-6"> <div class="col-md-12 mt-6">
<label>原設計</label> <label>原設計</label>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<button type="button" class="btn btn-info">上傳檔案</button> <input id="myFile" type="file" style="display:none" />
<label for="myFile" type="button" class="file-upload btn btn-info"
style="cursor : pointer ">上傳檔案</label>
<div id='forFile' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
</div> </div>
<div class="col-md-12 mt-1"> <div class="col-md-12 mt-1">
<small>欲上傳之檔案名稱</small> <small>欲上傳之檔案名稱</small>
@ -176,7 +175,10 @@
<label>竣工圖</label> <label>竣工圖</label>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<button type="button" class="btn btn-info">上傳檔案</button> <input id="myFile" type="file" style="display:none" />
<label for="myFile" type="button" class="file-upload btn btn-info"
style="cursor : pointer ">上傳檔案</label>
<div id='forFile' class="col-sm-12 forimage mt-2 offset-3 p-0"></div>
</div> </div>
<div class="col-md-12 mt-1"> <div class="col-md-12 mt-1">
<small>欲上傳之檔案名稱</small> <small>欲上傳之檔案名稱</small>
@ -202,77 +204,35 @@
building_tag: pageAct.buiTag building_tag: pageAct.buiTag
} }
objSendData.Data = sendData; objSendData.Data = sendData;
let url = baseApiUrl + "/api/History/GetMainSub"; let url = baseApiUrl + "/GraphManage/GraManList";
console.log(url);
function success(res) { function success(res) {
console.log(res);
let strHtml = ``; let strHtml = ``;
// let sst = ''; $.each(res, function (index, val) {
// let sstn = '';
// let mst = '';
$.each(res.data.history_Main_Systems, function (index, val) { strHtml = `<tr>
<td>${res.code}</td>
strHtml = ` <thead class="thead-themed"> <td>${res.code}</td>
<tr> <td>${res.code}</td>
<th>圖號</th> <td>${res.code}</td>
<th>圖名</th>
<th>原設計</th>
<th>竣工圖</th>
<th>功能</th>
</tr>
</thead>
<tbody>
<tr>
<td>TEST03</td>
<td>TEST03</td>
<td>A-01.dwg</td>
<td></td>
<td> <td>
<a href="#" class="btn btn-info">編輯</a> <a href="#" class="btn btn-info">編輯</a>
<a href="#" class="btn btn-danger">刪除</a> <a href="#" class="btn btn-danger">刪除</a>
</td> </td>
</tr> </tr>`;
<tr>
<td>TEST06</td>
<td>TEST06</td>
<td>A-01.dwg</td>
<td>AS-01.dwg</td>
<td>
<a href="#" class="btn btn-info">編輯</a>
<a href="#" class="btn btn-danger">刪除</a>
</td>
</tr>
</tbody>`;
// strHtml += `<li>
// <a href="#" data-filter-tags="user interface buttons compass action dropdown navigation sidebars" data-maintag="${val.main_system_tag}">
// <span class="nav-link-text">${val.full_name}</span>
// </a>
// <ul style="${index == 0 ? `display:block;` : ``}">`;
// $.each(val.history_Sub_systems, function (index2, val2) {
// strHtml += `<li>
// <a href="#" onClick="getData('${val.main_system_tag}', '${val2.sub_system_tag}', '${val2.full_name}')" data-filter-tags="user interface buttons" data-subtag="${val2.sub_system_tag}">
// <span class="nav-link-text">
// ${val2.full_name} ${val2.sub_system_tag}
// </span>
// </a>
// </li>`;
// if (index == 0 && index2 == 0) {
// sst = val2.sub_system_tag;
// mst = val.main_system_tag;
// sstn = val2.full_name;
// }
// });
// strHtml += `</ul> </li>`;
}); });
$('.table').html(strHtml); $('tbody').html(strHtml);
// $('#js_nested_list').html(strHtml);
// getData(mst, sst, sstn);
} }
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send(); ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
} }
$("#myFile").on("change", function (e) {
let fileHelper = new YourTeam.Utility.File();
if ($('#forFile').length > 0) {
$("#forFile").html("");
}
console.log(this.files);
});
</script> </script>