diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index ea46e76..96f7376 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -812,7 +812,12 @@ powerStationSingleLineCard = $("#power-station-single-line-card > .row"); powerStationSingleLineCard.empty(); 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 var powerStationSingleLineDropzone = new Dropzone("#power-station-single-line-form", { url: "/PowerStation/SavePowerStationSingleLine", - acceptedFiles: "image/*", + acceptedFiles: "image/*,application/pdf", autoProcessQueue: false, parallelUploads: 5, maxFiles: 5, @@ -2914,7 +2919,14 @@ powerStationSingleLineCard = $("#power-station-single-line-card > .row"); powerStationSingleLineCard.empty(); 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 + //#region 創建單線圖PDFbox + function CreatePowerStationSingleLineBoxPDF(dom, value) { + var str = '
' +
+ ''+
+ '' +
+ '' +
+ '' +
+ '