From 9cf929df5fc6ac9254097eca60afcb7f088a6776 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 18 Jun 2021 10:45:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=9B=BB=E7=AB=99=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=B3=87=E6=96=99=E9=87=8D=E6=95=B4=202.=20DBHelper=20Connecti?= =?UTF-8?q?on=20sting=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Helper/DatabaseHelper.cs | 2 +- .../Views/PowerStation/PowerStationAdd.cshtml | 163 ----- .../PowerStation/PowerStationEdit.cshtml | 643 +++++++++--------- 3 files changed, 330 insertions(+), 478 deletions(-) delete mode 100644 SolarPower/Views/PowerStation/PowerStationAdd.cshtml diff --git a/SolarPower/Helper/DatabaseHelper.cs b/SolarPower/Helper/DatabaseHelper.cs index 2e57aa3..b359893 100644 --- a/SolarPower/Helper/DatabaseHelper.cs +++ b/SolarPower/Helper/DatabaseHelper.cs @@ -37,7 +37,7 @@ namespace SolarPower.Helper var passwordStr = ed.DESDecrypt(dbConfig.Password); //var connStr = $"server={serverStr};database={databaseStr};user={rootStr};password={passwordStr};charset=utf8;"; - var connStr = @"server=127.0.0.1;port=3308;database=solar_power;user=root;password=00000000;charset=utf8;"; + var connStr = @"server=127.0.0.1;database=solar_power;user=root;password=000000;charset=utf8;"; this._connectionString = connStr; } diff --git a/SolarPower/Views/PowerStation/PowerStationAdd.cshtml b/SolarPower/Views/PowerStation/PowerStationAdd.cshtml deleted file mode 100644 index 7155fc9..0000000 --- a/SolarPower/Views/PowerStation/PowerStationAdd.cshtml +++ /dev/null @@ -1,163 +0,0 @@ - -
-
-
-
-
-
- -
-
- -
- -
電站基本資料
- -
-
-
-
- - -
-
- - -
-
-

是否為代管:

-

-

- - -
-

-
-
- - -
-
- - -
-
- -
-
- - -
-
- - -
- -
-
- - -
-
- - -
-
- - -
-
- -
-
-
逆變器
-
-
- - -
-
- - -
-
- - -
-
-
-
-
光電板
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- -
-
-
-
-
-
-
-
-
-@section Scripts{ - - -} \ No newline at end of file diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index cb2aebc..a5ea878 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -175,92 +175,93 @@ } } }); - //#endregion + //#endregion + //#region 設備列表 DataTable DeviceTable = $("#Device_table").DataTable({ - "paging": true, - "lengthChange": false, - "searching": false, - "ordering": true, - "info": true, - "autoWidth": false, - "responsive": true, - "order": [[9, "desc"]], - "columns": [{ - "data": "uid" - }, { - "data": "name" - }, { - "data": "typeName" - }, { - "data": "brand" - }, { - "data": "productModel" - }, { - "data": "dbName" - }, { - "data": "tableName" - }, { - "data": "colName" - }, { - "data": "remark" - },{ - "data": "function" - }], - "columnDefs": [{ - 'targets': 1, - 'searchable': false, - 'orderable': false, - 'className': 'dt-body-center' - }], - "language": { - "emptyTable": "無資料...", - "processing": "處理中...", - "loadingRecords": "載入中...", - "lengthMenu": "顯示 _MENU_ 項結果", - "zeroRecords": "沒有符合的結果", - "info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項", - "infoEmpty": "顯示第 0 至 0 項結果,共 0 項", - "infoFiltered": "(從 _MAX_ 項結果中過濾)", - "infoPostFix": "", - "search": "搜尋:", - "paginate": { - "first": "第一頁", - "previous": "上一頁", - "next": "下一頁", - "last": "最後一頁" - }, - "aria": { - "sortAscending": ": 升冪排列", - "sortDescending": ": 降冪排列" - } - }, - 'createdRow': function (row, data, dataIndex) { - $(row).attr('data-id', data.id); - }, - "ajax": { - "url": "/PowerStation/DeviceTable", - "type": "POST", - "data": function (d) { - d.stationId = stationId; - }, - "dataSrc": function (rel) { - if (rel.data.code == "9999") { - toast_error(rel.data.msg); - return; + "paging": true, + "lengthChange": false, + "searching": false, + "ordering": true, + "info": true, + "autoWidth": false, + "responsive": true, + "order": [[9, "desc"]], + "columns": [{ + "data": "uid" + }, { + "data": "name" + }, { + "data": "typeName" + }, { + "data": "brand" + }, { + "data": "productModel" + }, { + "data": "dbName" + }, { + "data": "tableName" + }, { + "data": "colName" + }, { + "data": "remark" + },{ + "data": "function" + }], + "columnDefs": [{ + 'targets': 1, + 'searchable': false, + 'orderable': false, + 'className': 'dt-body-center' + }], + "language": { + "emptyTable": "無資料...", + "processing": "處理中...", + "loadingRecords": "載入中...", + "lengthMenu": "顯示 _MENU_ 項結果", + "zeroRecords": "沒有符合的結果", + "info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項", + "infoEmpty": "顯示第 0 至 0 項結果,共 0 項", + "infoFiltered": "(從 _MAX_ 項結果中過濾)", + "infoPostFix": "", + "search": "搜尋:", + "paginate": { + "first": "第一頁", + "previous": "上一頁", + "next": "下一頁", + "last": "最後一頁" + }, + "aria": { + "sortAscending": ": 升冪排列", + "sortDescending": ": 降冪排列" } + }, + 'createdRow': function (row, data, dataIndex) { + $(row).attr('data-id', data.id); + }, + "ajax": { + "url": "/PowerStation/DeviceTable", + "type": "POST", + "data": function (d) { + d.stationId = stationId; + }, + "dataSrc": function (rel) { + if (rel.data.code == "9999") { + toast_error(rel.data.msg); + return; + } - data = rel.data.data; + data = rel.data.data; - if (data == null || data.length == 0) { - this.data = []; + if (data == null || data.length == 0) { + this.data = []; + } + + return data; } - - return data; } - } - }); - //#endregion + }); + //#endregion //#region 異常設定列表 DataTable ExceptionTable = $("#Exception_table").DataTable({ "paging": true, @@ -341,7 +342,8 @@ } } }); - //#endregion + //#endregion + //#region 電站資料 view 控制 if (stationId == 'new') { //#region 電站基本資料 @@ -378,6 +380,7 @@ $("#land_buildingPart").hide(); $("#tablist").hide(); + $("#tablist").find(".nav-item > a").first().click(); } else { var url = "/PowerStation/GetOnePowerStation" @@ -410,6 +413,7 @@ }, 'json'); } + //#endregion //#region 預先載入運維人員下拉式選單select_option var url_user_select_option = "/PowerStation/GetUserSelectOptionList"; @@ -486,6 +490,8 @@ }); }); //#endregion + + //#region 預先載入設備類型下拉式選單select_option var url_DeviceType = "/PowerStation/GetDeviceTypeSelectOptionList"; $.get(url_DeviceType, function (rel) { if (rel.code != "0000") { @@ -498,11 +504,10 @@ $("#Device_Type_modal").append($("