Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
3080cb64d2
@ -123,10 +123,9 @@ namespace SolarPower.Models
|
|||||||
public string EndTime { get; set; }
|
public string EndTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OperationRecord : Created
|
public class OperationRecord : UserInfo
|
||||||
{
|
{
|
||||||
private string startTime, endTime, finishTime, workTime;
|
private string startTime, endTime, finishTime, workTime;
|
||||||
public int Id { get; set; }
|
|
||||||
public string FormId { get; set; }
|
public string FormId { get; set; }
|
||||||
public string SerialNumber { get; set; }
|
public string SerialNumber { get; set; }
|
||||||
public int PowerStationId { get; set; }
|
public int PowerStationId { get; set; }
|
||||||
|
|||||||
@ -20,14 +20,16 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
private readonly IUserRepository userRepository;
|
private readonly IUserRepository userRepository;
|
||||||
private readonly INoticeScheduleRepository noticeScheduleRepository;
|
private readonly INoticeScheduleRepository noticeScheduleRepository;
|
||||||
private readonly IStationReportRepository stationReportRepository;
|
private readonly IStationReportRepository stationReportRepository;
|
||||||
|
private readonly IOperationRepository operationRepository;
|
||||||
|
|
||||||
public CalcAvgPowerStationJob(ILogger<CalcAvgPowerStationJob> logger, IPowerStationRepository powerStationRepository, IUserRepository userRepository, INoticeScheduleRepository noticeScheduleRepository, IStationReportRepository stationReportRepository)
|
public CalcAvgPowerStationJob(ILogger<CalcAvgPowerStationJob> logger, IPowerStationRepository powerStationRepository, IUserRepository userRepository, INoticeScheduleRepository noticeScheduleRepository, IStationReportRepository stationReportRepository,IOperationRepository operationRepository)
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.powerStationRepository = powerStationRepository;
|
this.powerStationRepository = powerStationRepository;
|
||||||
this.userRepository = userRepository;
|
this.userRepository = userRepository;
|
||||||
this.noticeScheduleRepository = noticeScheduleRepository;
|
this.noticeScheduleRepository = noticeScheduleRepository;
|
||||||
this.stationReportRepository = stationReportRepository;
|
this.stationReportRepository = stationReportRepository;
|
||||||
|
this.operationRepository = operationRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Execute(IJobExecutionContext context)
|
public async Task Execute(IJobExecutionContext context)
|
||||||
@ -309,6 +311,17 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
};
|
};
|
||||||
await powerStationRepository.AddWeatherForecast(weatherForecasts, weather_forecast_properties);
|
await powerStationRepository.AddWeatherForecast(weatherForecasts, weather_forecast_properties);
|
||||||
|
|
||||||
|
var OperationDeletes = await powerStationRepository.GetAllDataList<OperationRecord>("operation_record", "Deleted = 1");
|
||||||
|
List<int> deleteoperations = new List<int>();
|
||||||
|
foreach(var deletes in OperationDeletes)
|
||||||
|
{
|
||||||
|
if(DateTime.Now.AddDays(-60) > Convert.ToDateTime(deletes.UpdatedAt))
|
||||||
|
{
|
||||||
|
deleteoperations.Add(deletes.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await operationRepository.DeleteRecord(deleteoperations);
|
||||||
|
|
||||||
#region step2. 歸檔電站的每日資訊
|
#region step2. 歸檔電站的每日資訊
|
||||||
foreach (var powerStation in powerStations)
|
foreach (var powerStation in powerStations)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -734,5 +734,34 @@ namespace SolarPower.Repository.Implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task DeleteRecord(List<int> operations)
|
||||||
|
{
|
||||||
|
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
using (var trans = conn.BeginTransaction())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sql = $"UPDATE operation_record SET Deleted = 2 WHERE Id IN @Ids";
|
||||||
|
|
||||||
|
await conn.ExecuteAsync(sql, new { Ids = operations }, trans);
|
||||||
|
|
||||||
|
trans.Commit();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
trans.Rollback();
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,6 +88,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
LEFT JOIN city c ON ps.CityId = c.Id
|
LEFT JOIN city c ON ps.CityId = c.Id
|
||||||
WHERE ps.Id IN @PowerStationIds
|
WHERE ps.Id IN @PowerStationIds
|
||||||
GROUP BY ps.CityId
|
GROUP BY ps.CityId
|
||||||
|
ORDER BY c.Priority
|
||||||
";
|
";
|
||||||
|
|
||||||
result = (await conn.QueryAsync<CapacityDataTable>(sql, new { PowerStationIds = powerStationIds })).ToList();
|
result = (await conn.QueryAsync<CapacityDataTable>(sql, new { PowerStationIds = powerStationIds })).ToList();
|
||||||
|
|||||||
@ -4448,8 +4448,8 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps
|
var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,c.Name AS CityName FROM {tableName} ps
|
||||||
LEFT JOIN city ON city.Id = ps.CityId";
|
LEFT JOIN city c ON c.Id = ps.CityId";
|
||||||
|
|
||||||
if (myUser.Role.Layer == 2)
|
if (myUser.Role.Layer == 2)
|
||||||
{
|
{
|
||||||
@ -4465,6 +4465,8 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql += " ORDER BY c.Priority";
|
||||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
|
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
@ -4482,14 +4484,16 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var sql = @$"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps
|
var sql = @$"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,c.Name AS CityName FROM {tableName} ps
|
||||||
LEFT JOIN city ON city.Id = ps.CityId WHERE ps.Deleted = 0";
|
LEFT JOIN city c ON c.Id = ps.CityId WHERE ps.Deleted = 0 ";
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter))
|
if (!string.IsNullOrEmpty(filter))
|
||||||
{
|
{
|
||||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql += " ORDER BY c.Priority";
|
||||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { Filter = filter })).ToList();
|
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { Filter = filter })).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
@ -5188,6 +5192,8 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql += @" ORDER BY city.Priority";
|
||||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { Filter = filter })).ToList();
|
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { Filter = filter })).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
@ -5222,6 +5228,8 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql += @" ORDER BY city.Priority";
|
||||||
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
|
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
|
|||||||
@ -659,5 +659,34 @@ namespace SolarPower.Repository.Implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 取條件 的所有資料
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tableName"></param>
|
||||||
|
/// <param name="where"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<A>> GetAllDataList<A>(string tableName, string where)
|
||||||
|
{
|
||||||
|
List<A> result;
|
||||||
|
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sql = @$"SELECT Id FROM {tableName} WHERE {where}";
|
||||||
|
|
||||||
|
result = (await conn.QueryAsync<A>(sql)).ToList();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,6 +81,8 @@ namespace SolarPower.Repository.Interface
|
|||||||
Task<List<int>> GetOperationRecordPersonnelIdsByOperationRecordId(int operationRecordId);
|
Task<List<int>> GetOperationRecordPersonnelIdsByOperationRecordId(int operationRecordId);
|
||||||
|
|
||||||
Task DeleteOperationRecordPersonnel(List<OperationRecordPersonnel> operationRecordPersonnels);
|
Task DeleteOperationRecordPersonnel(List<OperationRecordPersonnel> operationRecordPersonnels);
|
||||||
|
|
||||||
|
Task DeleteRecord(List<int> operations);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,5 +113,7 @@ namespace SolarPower.Repository.Interface
|
|||||||
Task PurgeOneByIdWithCustomDBNameAndTable(int id, string db_name, string table_name);
|
Task PurgeOneByIdWithCustomDBNameAndTable(int id, string db_name, string table_name);
|
||||||
|
|
||||||
Task AddAnyThing<A>(A result, List<string> properties, string tableName);
|
Task AddAnyThing<A>(A result, List<string> properties, string tableName);
|
||||||
|
|
||||||
|
Task<List<A>> GetAllDataList<A>(string tableName, string where);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -466,8 +466,8 @@
|
|||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" >' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" >' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<a href="javascript:;" class="" data-toggle="collapse" data-target="#cp-' + index1 + '-' + index2 + ' > .card-body" aria-expanded="true">' +
|
'<a href="javascript:;" class="" data-toggle="collapse" data-target="#cp-' + index1 + '-' + index2 + ' > .card-body" aria-expanded="true">' +
|
||||||
'<span class="collapsed-hidden"><h5 class="font-weight-bold mb-0"><i class="fal fa-charging-station"></i>' + powerStationkey + '<i class="fal fa-chevron-down fs-xl ml-2"></i></h5></span>' +
|
'<span class="collapsed-hidden"><h5 class="font-weight-bold mb-0">' + powerStationkey + '<i class="fal fa-chevron-down fs-xl ml-2"></i></h5></span>' +
|
||||||
'<span class="collapsed-reveal"><h5 class="font-weight-bold mb-0"><i class="fal fa-charging-station"></i>' + powerStationkey + '<i class="fal fa-chevron-up fs-xl ml-2"></i></h5></span>' +
|
'<span class="collapsed-reveal"><h5 class="font-weight-bold mb-0">' + powerStationkey + '<i class="fal fa-chevron-up fs-xl ml-2"></i></h5></span>' +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="card-body p-0">' +
|
'<div class="card-body p-0">' +
|
||||||
|
|||||||
@ -661,7 +661,7 @@
|
|||||||
'<div class="">' +
|
'<div class="">' +
|
||||||
'<input type="checkbox" class="mr-2" name="selectedPowerStationLayer2[]" value="' + powerStation.powerStationId + '" valueName ="' + powerStation.powerStationName + '">' +
|
'<input type="checkbox" class="mr-2" name="selectedPowerStationLayer2[]" value="' + powerStation.powerStationId + '" valueName ="' + powerStation.powerStationName + '">' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + powerStation.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + powerStation.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
});
|
});
|
||||||
|
|||||||
@ -481,8 +481,8 @@
|
|||||||
'<input type="checkbox" class="" name="selectedDeviceLayer2[]" >' +
|
'<input type="checkbox" class="" name="selectedDeviceLayer2[]" >' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<a href="javascript:;" class="" data-toggle="collapse" data-target="#cp-' + index1 + '-' + index2 + ' > .card-body" aria-expanded="true">' +
|
'<a href="javascript:;" class="" data-toggle="collapse" data-target="#cp-' + index1 + '-' + index2 + ' > .card-body" aria-expanded="true">' +
|
||||||
'<span class="collapsed-hidden"><h5 class="font-weight-bold mb-0"><i class="fal fa-charging-station"></i>' + powerStationkey + '<i class="fal fa-chevron-down fs-xl ml-2"></i></h5></span>' +
|
'<span class="collapsed-hidden"><h5 class="font-weight-bold mb-0">' + powerStationkey + '<i class="fal fa-chevron-down fs-xl ml-2"></i></h5></span>' +
|
||||||
'<span class="collapsed-reveal"><h5 class="font-weight-bold mb-0"><i class="fal fa-charging-station"></i>' + powerStationkey + '<i class="fal fa-chevron-up fs-xl ml-2"></i></h5></span>' +
|
'<span class="collapsed-reveal"><h5 class="font-weight-bold mb-0">' + powerStationkey + '<i class="fal fa-chevron-up fs-xl ml-2"></i></h5></span>' +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="card-body p-0">' +
|
'<div class="card-body p-0">' +
|
||||||
|
|||||||
@ -398,7 +398,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -502,7 +502,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
@ -512,7 +512,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,7 @@
|
|||||||
<th>檔案</th>
|
<th>檔案</th>
|
||||||
<th>完成時間</th>
|
<th>完成時間</th>
|
||||||
<th>創建時間</th>
|
<th>創建時間</th>
|
||||||
|
<th>刪除時間</th>
|
||||||
@if (ViewBag.myUser.Role.Layer != (int)RoleLayerEnum.CompanyUser)
|
@if (ViewBag.myUser.Role.Layer != (int)RoleLayerEnum.CompanyUser)
|
||||||
{
|
{
|
||||||
<th>功能</th>
|
<th>功能</th>
|
||||||
@ -277,6 +278,7 @@
|
|||||||
var AllidsType = true;
|
var AllidsType = true;
|
||||||
var status = 0; //1:完成 0:未完成
|
var status = 0; //1:完成 0:未完成
|
||||||
var Searchtype = false;
|
var Searchtype = false;
|
||||||
|
var Deleteshow = false;
|
||||||
|
|
||||||
//#region Array.Remove
|
//#region Array.Remove
|
||||||
Array.prototype.remove = function (val) {
|
Array.prototype.remove = function (val) {
|
||||||
@ -355,6 +357,12 @@
|
|||||||
$("#power_station_select_modal").val($("#power_station_select_modal option:first").val()).trigger('change');
|
$("#power_station_select_modal").val($("#power_station_select_modal option:first").val()).trigger('change');
|
||||||
|
|
||||||
$('#Allcity').trigger("click");
|
$('#Allcity').trigger("click");
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -452,8 +460,10 @@
|
|||||||
},{
|
},{
|
||||||
"data": "createdAt"
|
"data": "createdAt"
|
||||||
}, {
|
}, {
|
||||||
"data": "function",
|
"data": "updatedAt",
|
||||||
//"defaultContent": '<button class="btn btn-danger del-btn">刪除</button>'
|
//"defaultContent": '<button class="btn btn-danger del-btn">刪除</button>'
|
||||||
|
}, {
|
||||||
|
"data": "function"
|
||||||
}],
|
}],
|
||||||
"columnDefs": [{
|
"columnDefs": [{
|
||||||
'targets': 7,
|
'targets': 7,
|
||||||
@ -553,6 +563,12 @@
|
|||||||
document.getElementById(name).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
|
document.getElementById(name).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
|
||||||
}
|
}
|
||||||
document.getElementById("button" + type).setAttribute("class", "btn btn-success waves-effect waves-themed");
|
document.getElementById("button" + type).setAttribute("class", "btn btn-success waves-effect waves-themed");
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -560,6 +576,12 @@
|
|||||||
|
|
||||||
//#region 改變日期
|
//#region 改變日期
|
||||||
$('#date-range').on('change', function () {
|
$('#date-range').on('change', function () {
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -629,6 +651,12 @@
|
|||||||
powerids = [];
|
powerids = [];
|
||||||
powerids = Newpowerids;
|
powerids = Newpowerids;
|
||||||
})
|
})
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -699,6 +727,12 @@
|
|||||||
powerids = [];
|
powerids = [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -722,6 +756,12 @@
|
|||||||
powerids = [];
|
powerids = [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -772,6 +812,12 @@
|
|||||||
powerids = [];
|
powerids = [];
|
||||||
powerids = Newpowerids;
|
powerids = Newpowerids;
|
||||||
})
|
})
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
})
|
})
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -787,6 +833,12 @@
|
|||||||
else {
|
else {
|
||||||
powerids.remove(classid[1]);
|
powerids.remove(classid[1]);
|
||||||
}
|
}
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -945,13 +997,23 @@
|
|||||||
toast_ok(rel.msg);
|
toast_ok(rel.msg);
|
||||||
$('#record-form-modal').modal('hide');
|
$('#record-form-modal').modal('hide');
|
||||||
recordFileDropzone.removeAllFiles();
|
recordFileDropzone.removeAllFiles();
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$('#record-form-modal').modal('hide');
|
$('#record-form-modal').modal('hide');
|
||||||
myDropzone.removeAllFiles();
|
myDropzone.removeAllFiles();
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -999,6 +1061,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
toast_ok(rel.msg);
|
toast_ok(rel.msg);
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}, 'json');
|
}, 'json');
|
||||||
}
|
}
|
||||||
@ -1037,6 +1105,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
toast_ok(rel.msg);
|
toast_ok(rel.msg);
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}, 'json');
|
}, 'json');
|
||||||
}
|
}
|
||||||
@ -1246,6 +1320,12 @@
|
|||||||
$(".status-type").removeClass("btn-success").addClass("btn-secondary");
|
$(".status-type").removeClass("btn-success").addClass("btn-secondary");
|
||||||
}
|
}
|
||||||
$(e).removeClass("btn-secondary").addClass("btn-success");
|
$(e).removeClass("btn-secondary").addClass("btn-success");
|
||||||
|
if (status == 2) {
|
||||||
|
operationRecordTable.column(10).visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
operationRecordTable.column(10).visible(false);
|
||||||
|
}
|
||||||
operationRecordTable.ajax.reload();
|
operationRecordTable.ajax.reload();
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@ -420,7 +420,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -614,7 +614,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
@ -624,7 +624,7 @@
|
|||||||
'<div class="mr-2">' +
|
'<div class="mr-2">' +
|
||||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
'<h5 class="font-weight-bold">' + inverter.powerStationName + '</h5>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user