單線圖PDF上傳
This commit is contained in:
parent
be00cb0bc9
commit
781bf9e660
@ -812,7 +812,12 @@
|
|||||||
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
||||||
powerStationSingleLineCard.empty();
|
powerStationSingleLineCard.empty();
|
||||||
rel.data.forEach(function (value, index) {
|
rel.data.forEach(function (value, index) {
|
||||||
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
var split = value.image.split(".");
|
||||||
|
if (split[split.length - 1].toLowerCase() == "pdf") {
|
||||||
|
CreatePowerStationSingleLineBoxPDF(powerStationSingleLineCard, value);
|
||||||
|
} else {
|
||||||
|
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -2870,7 +2875,7 @@
|
|||||||
//#region 單線圖 Dropzone
|
//#region 單線圖 Dropzone
|
||||||
var powerStationSingleLineDropzone = new Dropzone("#power-station-single-line-form", {
|
var powerStationSingleLineDropzone = new Dropzone("#power-station-single-line-form", {
|
||||||
url: "/PowerStation/SavePowerStationSingleLine",
|
url: "/PowerStation/SavePowerStationSingleLine",
|
||||||
acceptedFiles: "image/*",
|
acceptedFiles: "image/*,application/pdf",
|
||||||
autoProcessQueue: false,
|
autoProcessQueue: false,
|
||||||
parallelUploads: 5,
|
parallelUploads: 5,
|
||||||
maxFiles: 5,
|
maxFiles: 5,
|
||||||
@ -2914,7 +2919,14 @@
|
|||||||
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
||||||
powerStationSingleLineCard.empty();
|
powerStationSingleLineCard.empty();
|
||||||
rel.data.forEach(function (value, index) {
|
rel.data.forEach(function (value, index) {
|
||||||
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
var split = value.image.split(".");
|
||||||
|
if (split[split.length - 1].toLowerCase() == "pdf") {
|
||||||
|
CreatePowerStationSingleLineBoxPDF(powerStationSingleLineCard, value);
|
||||||
|
} else {
|
||||||
|
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -2937,6 +2949,24 @@
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region 創建單線圖PDFbox
|
||||||
|
function CreatePowerStationSingleLineBoxPDF(dom, value) {
|
||||||
|
var str = '<div class="col-xl" style="max-width: 20%;">' +
|
||||||
|
'<div class="card border m-auto m-lg-0" style="padding: 9.5px;">' +
|
||||||
|
'<a href="' + value.image + '" download>' +
|
||||||
|
'<img src="/img/pdf.png" class="card-img-top " alt="...">' +
|
||||||
|
'</a>'+
|
||||||
|
'<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right del-power-station-single-line-btn" data-id="' + value.id + '">' +
|
||||||
|
'<i class="fal fa-times"></i>' +
|
||||||
|
'</a>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
dom.append(str);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
//#region 刪除單線圖
|
//#region 刪除單線圖
|
||||||
$('#power-station-single-line-card').on("click", "a.del-power-station-single-line-btn", function () {
|
$('#power-station-single-line-card').on("click", "a.del-power-station-single-line-btn", function () {
|
||||||
|
|
||||||
|
|||||||
BIN
SolarPower/wwwroot/img/pdf.png
Normal file
BIN
SolarPower/wwwroot/img/pdf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
Loading…
Reference in New Issue
Block a user