From 8dd4bcc9f81a399a47cce76fe91e34bebd04e952 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Sat, 26 Jun 2021 16:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E4=B8=8A=E5=82=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/PowerStationRepository.cs | 6 +- .../PowerStation/PowerStationEdit.cshtml | 33 +++ .../Views/PowerStation/_DeviceSetting.cshtml | 247 ++++++++++++++++-- 3 files changed, 256 insertions(+), 30 deletions(-) diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 9b50761..19b2222 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -193,10 +193,8 @@ namespace SolarPower.Repository.Implement { var db_name = result.SiteDB; - - var sql_operation_personnel = @$"SELECT UserId FROM {db_name}.power_station_operation_personnel op WHERE Deleted = 0 AND op.PowerStationId = @PowerStationId"; + var sql_operation_personnel = @$"SELECT UserId FROM power_station_operation_personnel op WHERE Deleted = 0 AND op.PowerStationId = @PowerStationId"; result.OperationPersonnelIds = (await conn.QueryAsync(sql_operation_personnel, new { PowerStationId = result.Id })).ToList(); - var sql_land_building = @$"SELECT lb.*, u.Name AS CreatorName FROM {db_name}.land_building lb LEFT JOIN user u ON lb.CreatedBy = u.Id WHERE lb.Deleted = 0 AND PowerStationId = @PowerStationId"; @@ -931,7 +929,7 @@ namespace SolarPower.Repository.Implement conn.Open(); try { - string sql = GenerateInsertQueryWithCustomDBNameAndTable(properties, db_name, "power_station_operation_personnel"); + string sql = GenerateInsertQueryWithCustomTable(properties, "power_station_operation_personnel"); count = await conn.ExecuteAsync(sql, entity); } diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index 54dbe6f..c27e117 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -1485,6 +1485,24 @@ }); //#endregion + //#region 新增控制器資料 + function AddController() { + selected_id = 0; + $("#Controller-modal .modal-title").html("控制器資料 - 新增"); + $("#Controller-form").trigger("reset"); + $("#Controller-modal").modal(); + } + //#endregion + + //#region 新增逆變器資料 + function AddInverter() { + selected_id = 0; + $("#Inverter-modal .modal-title").html("逆變器資料 - 新增"); + $("#Inverter-form").trigger("reset"); + $("#Inverter-modal").modal(); + } + //#endregion + //#region 新增裝置資料 function AddDevice() { selected_id = 0; @@ -1494,6 +1512,21 @@ } //#endregion + //#region 新增共用裝置資料 + function AddShareDevice() { + selected_id = 0; + $("#ShareDevice-modal .modal-title").html("共用裝置資料 - 新增"); + $("#ShareDevice-form").trigger("reset"); + $("#ShareDevice-modal").modal(); + } + //#endregion + + //#region 儲存控制器資料 + function SaveController() { + + } + //#endregion + //#region 儲存裝置資料 function SaveDevice() { diff --git a/SolarPower/Views/PowerStation/_DeviceSetting.cshtml b/SolarPower/Views/PowerStation/_DeviceSetting.cshtml index 8f58788..e35ba31 100644 --- a/SolarPower/Views/PowerStation/_DeviceSetting.cshtml +++ b/SolarPower/Views/PowerStation/_DeviceSetting.cshtml @@ -1,29 +1,188 @@ 
-

裝置設定

-
- - 新增 - +
+
+ +
控制器
+ +
+
+
+ + + + + + + + + + + +
控制器編號建立時間建立人功能
+
+
-
- - - - - - - - - - - - - - - - - -
設備ID裝置名稱裝置類型廠牌型號DBNametableNamecolumnName備註功能
+ +
+
+ +
逆變器
+ +
+
+
+ + + + + + + + + + + + +
控制器編號逆變器編號建立時間建立人功能
+
+
+
+ +
+
+ +
裝置設定
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
電站編號控制器編號設備編號裝置類型廠牌型號DBNametableNamecolumnName備註功能
+
+
+
+ +
+
+ +
共用裝置
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
電站編號控制器編號設備編號裝置類型廠牌型號DBNametableNamecolumnName備註功能
+
+
+
+
+ + + + @@ -43,8 +202,9 @@
- - + +
@@ -92,4 +252,39 @@
+
+ + \ No newline at end of file