From 781bf9e6600f66b81004d9e50296260663238c3f Mon Sep 17 00:00:00 2001 From: b110212000 Date: Wed, 13 Oct 2021 14:07:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=96=AE=E7=B7=9A=E5=9C=96PDF=E4=B8=8A?= =?UTF-8?q?=E5=82=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PowerStation/PowerStationEdit.cshtml | 36 ++++++++++++++++-- SolarPower/wwwroot/img/pdf.png | Bin 0 -> 8183 bytes 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 SolarPower/wwwroot/img/pdf.png 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 = '
' + + '
' + + '' + + '...' + + ''+ + '' + + '' + + '' + + '
' + + '
'; + + dom.append(str); + } + //#endregion + + //#region 刪除單線圖 $('#power-station-single-line-card').on("click", "a.del-power-station-single-line-btn", function () { diff --git a/SolarPower/wwwroot/img/pdf.png b/SolarPower/wwwroot/img/pdf.png new file mode 100644 index 0000000000000000000000000000000000000000..5196ca4687953f37eacf7ccc2ab0aed13ed1ce13 GIT binary patch literal 8183 zcmd6Mdpy+JyZ@RoF}Z|PgwPe`nvh(}ElJpvg(?d%t5?{fzP1_sKwd3pFc+TXn+;vZN*mfT*8=&PDT}!Nrli&rkTH z>sIVK(LY*>el-4G8Ew5k6WMD2;8$DTV~>%KC2TLN?N5+MzI|YY_n`brT?G5Z{hVT_ zS>q%5BiVwa#C*bstE8e4>uLFT^R?KfI=JePx|G8bVUoahV|$~Kwup{5kUPu{e|?glKG4#h|7@|hW&N4c zg8aeeG$F4_Y3FO{r{Fx`Yw2v@No8;2vaAG8rjv)l!DbA2qXQD^k9BQxV2=)r#&1t9 zwgfmA)ih7Cx8GSC^k-vC&Gg%N?ni<$zZGNRklhOu|A`?7J{T{6zb@rxRJ5$8PKn~L zmd&IfBLNR6sNEnbZsjp$ud?U>BrZ&ffj9KRyhIJ9u>LW;oGVJ9xsv1fPgWKxcrA z2<`$vBs981*@b`|o;vi%1Xy79NMxmvH1F^u$D#Y##D-`^%U`r0NvmV{yPAe%bZT$Mq zjPnwtKCb!~dC$C~JGPEj?%A^o-|Xq?5;5DN{eOUpW92^pLtYBUE2}F17*LZuz%Gwn z3iw0n=;v4R(p$6;u0Nz&%6Z5BgK4fD_KJVUR5;;5d)j8#cR|=OEdZtrLu_#;qYw36 zd^S&*HZC~orJ9jNf#sd#sTZ_YWzh{wBzh(089_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