客戶端要求-全系統 出現載入顯示

This commit is contained in:
wanling040@gmail.com 2022-07-25 01:35:52 +08:00
parent b5781eb64c
commit 69ebee1e4d
20 changed files with 1071 additions and 133 deletions

View File

@ -4,6 +4,18 @@
ViewData["Title"] = "逆變器交叉分析";
}
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -201,6 +213,16 @@
{ key: "RA5", title: "RA5 (%)", default: false }
]
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#collapse').trigger("click");
@ -425,6 +447,7 @@
});
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/AnalysisInverter/GetInverterCollapse"
var send_data = {
@ -433,6 +456,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -505,7 +529,7 @@
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
@ -552,7 +576,7 @@
}
function GetAnalysisInverter() {
showLoading();
var date;
if (searchType != 1) {
date = $('#DateGet').val();
@ -577,6 +601,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
$("#btn-analysis-inverter").html('查詢').attr("disabled", false);
return;
@ -592,6 +617,7 @@
ReloadHighCharts();
$("#btn-analysis-inverter").html('查詢').attr("disabled", false);
hideLoading();
}, 'json');
}

View File

@ -6,7 +6,17 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
@ -223,6 +233,17 @@
var searchType = 0;//搜尋條件(日,日區間,月,年)
var datepicker;
var timerange;//選取時間
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#collapse').trigger("click");
@ -418,10 +439,11 @@
timerange: timerange,
seacrhType: searchType
}
showLoading();
var Nurl = "/AnalysisStationCombine/GetStationsCard";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -440,6 +462,7 @@
$('#today_carbon').html(toThousands(rel.data.now_Carbon.toFixed(2)));
$('#today_irradiance').html(toThousands(rel.data.now_irradiance.toFixed(2)));
chart();
hideLoading();
})
}
@ -447,6 +470,7 @@
//#region 圖片輪播
function photoshow() {
showLoading();
var url_image = "/PowerStation/GetAllPowerStationsALLImage";
var send_data = {
powerStationId: powerids
@ -454,6 +478,7 @@
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -467,7 +492,7 @@
carouselExampleIndicators.find(".carousel-indicators > li").first().addClass("active");
carouselExampleIndicators.find(".carousel-inner > .carousel-item").first().addClass("active");
hideLoading();
}, 'json');
}
function CreatePowerStationImagecarousel(dom, value, index) {
@ -624,6 +649,7 @@
function GetPowerStationCollapse(filter) {
showLoading();
@*var url = "/StationReport/GetPowerStationNameList"*@
var url = "/AnalysisStationCombine/GetPowerStationCollapse"
@ -633,6 +659,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -692,7 +719,7 @@
}
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
//#endregion

View File

@ -4,6 +4,18 @@
ViewData["Title"] = "電站交叉分析";
}
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -157,6 +169,16 @@
//Dictionary<string, string > sensor_type_detail_dictionary { get; set; };
var sensor_type_detail_dictionary;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#collapse').trigger("click");
@ -457,6 +479,7 @@
});
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/AnalysisStationInfo/GetDeviceCollapse"
var send_data = {
@ -465,6 +488,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -536,7 +560,7 @@
}*@
switch (device.sensorTypeDetailId) {
}
@ -574,7 +598,7 @@
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
@ -582,7 +606,7 @@
//在剛開始就在 sensor_type_detail 資料表中 取得ItemName
//#region
function GetItemInfo(itemId) {
showLoading();
//sensor_type_detail_dictionary = {''}
//my_dict = { 'first_name': 'eddie', 'last_name': 'kao', 'age': 30 }
@ -594,16 +618,19 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
var nowCompare_col = [{ key: rel.data.itemEName, title: rel.data.itemName, default: true }];
PushSpecifyCurrentCompareCol(nowCompare_col);
ChangeCompareSelectOption();
hideLoading();
}, 'json');
}
//#endregion
@ -666,6 +693,7 @@
}
function GetAnalysisStationInfo() {
showLoading();
var date;
if (searchType != 1) {
date = $('#DateGet').val();
@ -690,6 +718,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -706,7 +735,7 @@
ReloadHighCharts()
$("#btn-analysis-stationinfo").html('查詢').attr("disabled", false);
hideLoading();
}, 'json');
}

View File

@ -18,6 +18,19 @@
</h1>
</div>
<!-- Your main content goes below here: -->
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -190,11 +203,23 @@
var companyTable; var companyAuthTable;
var selected_id = 0;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 預先載入公司下拉式選單select_option
showLoading();
var url_company_select_option = "/Company/GetCompanySelectOptionList";
$.get(url_company_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -208,6 +233,7 @@
//預設查詢第一個
$("#company_select").val($("#company_select option:first").val()).trigger('change');
hideLoading();
});
//#endregion
@ -250,9 +276,9 @@
'render': function (data, type, full, meta) {
return '<img src="' + data + '?v=' + Date.now() + '" width="200px" height="40px">';
}
},{
'targets': 8,
'visible': false
}, {
'targets': 8,
'visible': false
}],
"language": {
"emptyTable": "查無資料",
@ -439,7 +465,7 @@
$("#company-modal .modal-title").html("公司基本資料 - 編輯");
selected_id = $(this).parents('tr').attr('data-id');
showLoading();
//取得單一公司基本資料
var url = "/Company/GetOneCompany/";
@ -449,6 +475,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -460,6 +487,7 @@
$("#company_registerUpperLimit_modal").val(rel.data.registerUpperLimit);
$("#company-modal").modal();
hideLoading();
}, 'json');
});
@ -483,6 +511,7 @@
function SaveComapny() {
if ($("#company-form").valid()) {
showLoading();
var url = "/Company/SaveCompany";
var formData = new FormData();
@ -507,10 +536,11 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
toast_ok(rel.msg);
$('#company-modal').modal('hide');
@ -536,6 +566,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
//取得單一系統管理員
var url = "/Company/DeleteOneCompany/";
var send_data = {
@ -543,14 +574,16 @@
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
toast_ok(rel.msg);
companyTable.ajax.reload();
}, 'json');
@ -581,6 +614,7 @@
return $(this).val();
}).get();
showLoading();
var url = "/Company/SaveCompanyAuth";
var send_data = {
@ -590,6 +624,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -598,8 +633,9 @@
$("#company-auth-modal").modal('hide');
companyAuthTable.ajax.reload();
hideLoading();
}, 'json');
}
//#endregion
//#endregion
</script>
}

View File

@ -6,6 +6,18 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -272,6 +284,17 @@
$(this).trigger('change');
});
//#endregion
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 預設初始值
var a = $('#collapse').trigger("click");
@ -349,6 +372,7 @@
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/ElectricitySoldRecord/GetPowerStationCollapse"
var send_data = {
@ -357,6 +381,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -437,7 +462,7 @@
}
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
@ -497,6 +522,7 @@
function SaveSoldMoney()
{
if ($("#Record-form").valid()) {
showLoading();
var url = "/ElectricitySoldRecord/SaveSoldMoney";
var send_data = {
Id: selected_id,
@ -510,6 +536,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -517,6 +544,7 @@
toast_ok(rel.msg);
$('#Record-modal').modal('hide');
RecordTable.ajax.reload();
hideLoading();
return;
}
@ -525,6 +553,7 @@
}
function DataTable() {
showLoading();
RecordTable = $("#RecordTable").DataTable({
"paging": true,
"lengthChange": false,
@ -589,6 +618,7 @@
d.searchType = searchType
},
"dataSrc": function (rel) {
hideLoading();
if (rel.data.code == "9999") {
toast_error(rel.data.msg);
return;
@ -604,6 +634,7 @@
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -630,12 +661,14 @@
selected_id = $(this).parents('tr').attr('data-id');
var powerstationName = $(this).parents('tr').attr('powerstation-Name');
//取得單一售電紀錄基本資料
showLoading();
var url = "/ElectricitySoldRecord/GetOnePowerStation/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -648,6 +681,7 @@
$("#Money_modal").val(rel.data.money);
$("#Month_modal").val(rel.data.month);
$("#Record-modal").modal();
hideLoading();
}, 'json');
});
@ -671,6 +705,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/ElectricitySoldRecord/DeleteRecord/";
var send_data = {
@ -679,11 +714,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
RecordTable.ajax.reload();
hideLoading();
}, 'json');
}
});

View File

@ -12,6 +12,18 @@
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -232,6 +244,16 @@
var AllpoweridsType = true;
var AllidsType = true;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region Date-Picker
@ -264,10 +286,12 @@
//#endregion
showLoading();
//#region 預設載入該使用者可以選擇的電站
var city_url = "/Operation/GetMyCities";
$.post(city_url, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -283,6 +307,7 @@
}
getPowerStationCheckBox();
hideLoading();
}, 'json');
@ -325,6 +350,7 @@
//#endregion
//#region DataTable
showLoading();
ExceptionTable = $("#Exception_Table").DataTable({
"pageLength": 20,
"paging": true,
@ -389,6 +415,7 @@
d.range = $('#date-range').val()
},
"dataSrc": function (rel) {
hideLoading();
if (rel.data.code == "9999") {
toast_error(rel.data.msg);
return;
@ -402,6 +429,7 @@
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -598,10 +626,11 @@
var send_data = {
cityIds: ids
}
showLoading();
var Nurl = "/ExceptionRecord/GetPowerStationByFilter";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -626,6 +655,7 @@
});
ExceptionTable.ajax.reload();
hideLoading();
})
}
@ -644,12 +674,14 @@
$("#error_code_modal_exc").attr("disabled", true);
psids = selected_id = $(this).parents('tr').attr('data-psid');
//#region 維修單運維人員(異常紀錄)
showLoading();
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
send_data = {
PowerStationId: parseInt(psids)
}
$.post(url_power_station_operation_personnel, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -666,6 +698,7 @@
}
}
$("#exception-form-modal").modal();
hideLoading();
});
//#endregion
@ -681,6 +714,7 @@
powerStationData_name = $(this).parents('tr').attr('data-name');
errortoID = $(this).parents('tr').attr('data-error');
//取得單一記錄表單
showLoading();
var url = "/Operation/GetOneOperationRecord/";
var send_data = {
@ -689,6 +723,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -731,6 +766,7 @@
}
$.post(url_power_station_operation_personnel, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -749,7 +785,7 @@
$("#exception-form-modal").modal();
});
//#endregion
hideLoading();
}, 'json');
});
//#endregion
@ -758,6 +794,7 @@
function SaveException() {
if ($("#record-form-exc").valid()) {
showLoading();
var url = "/Operation/SaveOperationRecord";
var formData = new FormData();
@ -782,10 +819,11 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
var myDropzone = Dropzone.forElement("#record-file-form_exc");
if (myDropzone.files.length > 0) {

View File

@ -25,8 +25,21 @@
<!-- icheck bootstrap -->
<link href="~/lib/icheck-bootstrap/icheck-bootstrap.min.css" rel="stylesheet" />
<!-- Theme style -->
<link rel="stylesheet" href="~/css/loading.css" />
</head>
<body>
<div class="loadEffect" id="loading" style="top: 50%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="blankpage-form-field">
<div class="page-logo m-0 w-100 align-items-center justify-content-center rounded border-bottom-left-radius-0 border-bottom-right-radius-0 px-4">
<div class="page-logo-link press-scale-down d-flex align-items-center">
@ -39,31 +52,31 @@
{
<p class="alert alert-danger">@ViewBag.ErrMsg</p>
}
<form id="login-form" asp-action="Index" method="post">
<div class="form-group">
<label class="form-label" for="username">帳號</label>
<input asp-for="Account" type="text" id="account" class="form-control" placeholder="Account">
<span asp-validation-for="Account" class="text-danger"></span>
<span class="help-block">
您的帳號
</span>
<form id="login-form" asp-action="Index" method="post">
<div class="form-group">
<label class="form-label" for="username">帳號</label>
<input asp-for="Account" type="text" id="account" class="form-control" placeholder="Account">
<span asp-validation-for="Account" class="text-danger"></span>
<span class="help-block">
您的帳號
</span>
</div>
<div class="form-group">
<label class="form-label" for="password">密碼</label>
<input asp-for="Password" type="password" id="password" class="form-control" placeholder="Password" autocomplete="off">
<span asp-validation-for="Password" class="text-danger"></span>
<span class="help-block">
您的密碼
</span>
</div>
<div class="form-group text-left">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="rememberme">
<label class="custom-control-label" for="rememberme"> 記住我</label>
</div>
<div class="form-group">
<label class="form-label" for="password">密碼</label>
<input asp-for="Password" type="password" id="password" class="form-control" placeholder="Password" autocomplete="off">
<span asp-validation-for="Password" class="text-danger"></span>
<span class="help-block">
您的密碼
</span>
</div>
<div class="form-group text-left">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="rememberme">
<label class="custom-control-label" for="rememberme"> 記住我</label>
</div>
</div>
<button type="submit" class="btn btn-default float-right">登入</button>
</form>
</div>
<button type="submit" class="btn btn-default float-right" id="login">登入</button>
</form>
</div>
<div class="blankpage-footer text-center">
<a asp-controller="Login" asp-action="ForgotPassword"><strong>忘記密碼</strong></a>
@ -170,6 +183,16 @@
}
});
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$("#rememberme").click(function () {
if (remember) {
localStorage.setItem('solar-t', 'false');
@ -184,6 +207,10 @@
}
});
$("#login").click(function () {
showLoading();
});
$("#account").change(function () {
if (remember) {
localStorage.setItem('solar-a', btoa($("#account").val()));

View File

@ -11,6 +11,18 @@
<!-- Your main content goes below here: -->
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row mb-5">
<div class="card-columns">
<div class="card">
@ -219,8 +231,18 @@
var mapOverview;
var locations = [];
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
showLoading();
//#region 公司管理列表 DataTable
capacityTable = $("#capacity-Table").DataTable({
"paging": true,
@ -279,6 +301,7 @@
var url = "/MapOverview/GetMapOverview";
$.post(url, null, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -311,6 +334,7 @@
//#region google map
initMap();
hideLoading();
//#endregion
});
});

View File

@ -6,6 +6,18 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -267,6 +279,17 @@
var CheckType = 0;//0:全部 1:成功 2:失敗
var NoticeDataTable;
var info;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 預設初始值
var a = $('#collapse').trigger("click");
@ -449,6 +472,7 @@
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/StationReport/GetPowerStationCollapse"
var send_data = {
@ -457,6 +481,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -534,7 +559,7 @@
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
//#endregion
@ -569,6 +594,7 @@
checkType : CheckType,
powerstationIds: selecterd_station
};
showLoading();
NoticeDataTable = $("#NoticeTable").DataTable({
"pageLength": 10,
"paging": true,
@ -626,6 +652,7 @@
d.info = info
},
"dataSrc": function (rel) {
hideLoading();
if (rel.data.code == "9999") {
toast_error(rel.data.msg);
return;
@ -638,6 +665,7 @@
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});

View File

@ -6,6 +6,17 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<ol class="breadcrumb page-breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">系統管理</a></li>
@ -57,7 +68,7 @@
</div>
<div class="col-11">
<div class="row frame-wrap" id="CheckPowerStation">
</div>
</div>
</div>
@ -241,12 +252,24 @@
};
//#endregion
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 載入縣市
showLoading();
var city_url = "/Operation/GetMyCities";
$.post(city_url, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -264,6 +287,7 @@
$('#Allcity').trigger("click");
getPowerStationCheckBox();
hideLoading();
}, 'json');
@*var Nurl = "/PowerStation/GetSolarCitySummary";
@ -541,10 +565,11 @@
var send_data = {
cityIds: ids
}
showLoading();
var Nurl = "/Operation/GetPowerStationByFilter";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -572,8 +597,9 @@
}
Allpowerids.push(String(val.id));
});
OperationPlanTable.ajax.reload();
hideLoading();
})
}
@ -641,6 +667,7 @@
//#region 儲存定時計畫資料
function SaveOperationPlan() {
showLoading();
var url = "/Operation/SaveOperationPlan";
var send_data = {
@ -658,12 +685,14 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
OperationPlanTable.ajax.reload();
$('#Operation-modal').modal('hide');
hideLoading();
}, 'json');
}
//#endregion
@ -684,17 +713,20 @@
}).then(function (result) {
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/Operation/DeleteOneOperationPlan/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
OperationPlanTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -708,6 +740,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一異常設定資料
showLoading();
var url = "/Operation/GetOneOperationPlan/";
var send_data = {
@ -717,6 +750,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -736,6 +770,7 @@
//document.getElementById("operation_endTime_modal").innerHTML = day[0];
$("#Operation-modal").modal();
hideLoading();
}, 'json');
});
@ -743,7 +778,7 @@
//#region 儲存Excel
function saveToExcel() {
showLoading();
var url = "/Operation/OperationPlanTable";
var send_data = {
id: powerids,
@ -751,6 +786,7 @@
};
$.post(url, send_data, function (rel) {
if (rel.data.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -777,6 +813,7 @@
//檔案字尾名
fileext: ".xlsx",
});
hideLoading();
}, 'json');

View File

@ -17,6 +17,18 @@
</h1>
</div>
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<!-- Your main content goes below here: -->
<div id="panel-5" class="panel">
<div class="panel-container show">
@ -296,6 +308,16 @@
};
//#endregion
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region Date-Picker
@ -320,9 +342,11 @@
//#endregion
//#region 預設載入該使用者可以選擇的電站
showLoading();
var city_url = "/Operation/GetMyCities";
$.post(city_url, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -343,6 +367,7 @@
var Nurl = "/Operation/GetPowerStationByFilter";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -361,6 +386,7 @@
$('#Allcity').trigger("click");
getPowerStationCheckBox();
hideLoading();
}, 'json');
@ -425,6 +451,7 @@
$("#power_station_select_modal").change(function () {
//查詢該電站的運維人員
showLoading();
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
send_data = {
@ -433,6 +460,7 @@
$.post(url_power_station_operation_personnel, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -451,14 +479,16 @@
$("#work_person_select_modal").select2({ dropdownParent: $('#record-form-modal') });
hideLoading();
});
//查詢該電站的廠商
showLoading();
var url_power_station_firm = "/PowerStation/GetFirmSelectOptionList";
$.post(url_power_station_firm, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -476,6 +506,7 @@
if (record != undefined && record != null) {
$("#fix_firm_select_modal").val(record.fixFirm)
}
hideLoading();
});
});
//#endregion
@ -624,10 +655,11 @@
var send_data = {
cityIds: ids
}
showLoading();
var Nurl = "/Operation/GetPowerStationByFilter";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -659,6 +691,7 @@
operationRecordTable.column(10).visible(false);
}
operationRecordTable.ajax.reload();
hideLoading();
})
}
@ -1073,6 +1106,7 @@
// 鎖定按鈕
$("#save-record-btn").attr('disabled', true);
showLoading();
var url = "/Operation/SaveOperationRecord";
var formData = new FormData();
@ -1109,10 +1143,11 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
var myDropzone = Dropzone.forElement("#record-file-form");
if (myDropzone.files.length > 0) {
@ -1167,7 +1202,7 @@
{
$("#work_time_modal-error").show();
}
}
}
//#endregion
@ -1188,20 +1223,24 @@
}).then(function (result) {
if (result.value) {
//刪除單一運維紀錄
showLoading();
var url = "/Operation/DeleteOneOperationRecord/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
toast_ok(rel.msg);
if (status == 2) {
operationRecordTable.column(10).visible(true);
@ -1232,20 +1271,24 @@
}).then(function (result) {
if (result.value) {
//還原單一運維紀錄
showLoading();
var url = "/Operation/ReductionOneOperationRecord/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
hideLoading();
toast_ok(rel.msg);
if (status == 2) {
operationRecordTable.column(10).visible(true);
@ -1262,9 +1305,11 @@
//#region 取得電站選單資料 (未使用)
function GetPowerStation() {
showLoading();
var url_power_station_select_option = "/Operation/GetPowerStationSelectOption";
$.get(url_power_station_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1277,6 +1322,7 @@
//預設查詢第一個
$("#power_station_select_modal").val($("#power_station_select_modal option:first").val()).trigger('change');
hideLoading();
});
}
//#endregion
@ -1382,6 +1428,7 @@
//#region 匯出excel
function ExportExcel() {
showLoading();
var url = "/Operation/ExportOperationRecordExcel";
var send_data = {
CityIds: [3],
@ -1389,6 +1436,7 @@
};
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1435,6 +1483,7 @@
//檔案字尾名
fileext: ".xls",
});
hideLoading();
}, 'json');
}
//#endregion

View File

@ -6,6 +6,18 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -296,6 +308,17 @@
var selecterd_powerstationId = [];
var searchType;
var chart;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#collapse').trigger("click");
$('#firstclick').trigger("click");
@ -363,6 +386,7 @@
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/PowerGeneration/GetPowerStationCollapse"
var send_data = {
@ -371,6 +395,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -452,7 +477,7 @@
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
//#endregion
@ -510,6 +535,7 @@
function Search() {
showLoading();
var url = "/PowerGeneration/GetGenerationList"
var send_data = {
PowerstationId: nowpowerstation,
@ -518,6 +544,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -667,7 +694,7 @@
});
hideLoading();
});
}

View File

@ -6,6 +6,18 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<ol class="breadcrumb page-breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">總覽</a></li>
<li class="breadcrumb-item active">@ViewData["Title"]</li>
@ -220,6 +232,17 @@
var ids = new Array(0);
var localurl = this.location.href;
var index = 0;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#collapse').trigger("click");
Cityes();
@ -232,9 +255,11 @@
});
function Cityes() {
showLoading();
var url = "/PowerStation/GetSolarCitySummary";
$.post(url, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -292,6 +317,7 @@
$("#areaTab").find(".nav-item > a").first().click();
$('#tab-' + index + '-collapse').trigger("click");
hideLoading();
return;
}
}, 'json');
@ -306,7 +332,7 @@
function addPowerStationCard(ids) {
showLoading();
//alert(ids);
var url = "/PowerStation/GetSolarByCity";
var send_data = {
@ -314,6 +340,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -365,13 +392,14 @@
'</tr>');
});
$('.nav-tabs a[href="#' + tablocation + '"]').tab('show');
hideLoading();
return;
}
}, 'json');
}
$(document).on("click", "button.status-btnto", function () {
showLoading();
var selected_id = $(this).parents('tr').attr('data-id');
var url = "/PowerStation/CheckStationStatus";
@ -381,6 +409,7 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -405,11 +434,12 @@
}
}
hideLoading();
}, 'json');
});
$(document).on("click", "button.unstatus-btnto", function () {
showLoading();
var selected_id = $(this).parents('tr').attr('data-id');
var url = "/PowerStation/StationUnStatus";
@ -419,6 +449,7 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -428,6 +459,7 @@
}
Cityes();
}
hideLoading();
}, 'json');
});
@ -441,13 +473,14 @@
$(document).on("click", "button.del-btnto", function () {
var selected_id = $(this).parents('tr').attr('data-id');
var selected_cityid = $(this).parents('tr').attr('datacity-id');
showLoading();
var url = "/PowerStation/GetShareDevicePowerstationName";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -493,7 +526,7 @@
}
});
hideLoading();
return;
}

View File

@ -15,6 +15,19 @@
</ol>
<!-- Your main content goes below here: -->
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -102,6 +115,17 @@
var upper = 0;
var stationDB = "";
var station_infocreate = false;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
$('#power_station_operation_personnel-error').hide();
$('#coordinate_text-error').hide();
@ -109,9 +133,11 @@
stationId = url.searchParams.get('stationId');
//#region 預先載入公司下拉式選單select_option
showLoading();
var url_company_select_option = "/PowerStation/GetCompanySelectOptionList";
$.get(url_company_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -129,6 +155,7 @@
else {
$("#select_power_station_company").val(powerStationData.companyId).trigger('change');
}
hideLoading();
});
//#endregion
@ -200,6 +227,7 @@
$("#tablist").find(".nav-item > a").first().click();
} else {
showLoading();
var url = "/PowerStation/GetOnePowerStation"
var send_data = {
@ -208,6 +236,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -231,10 +260,11 @@
ChangeMode("land_building_info", "view");
SetLandBuildingInfo();
//#endregion
hideLoading();
}, 'json');
//#region 控制器列表 DataTable
showLoading();
DeviceControllerTable = $("#Controller_table").DataTable({
"pageLength": 5,
"paging": true,
@ -282,6 +312,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -300,17 +331,19 @@
$.each(data, function (index, val) {
$("#Device_Controller_modal").append($("<option />").val(val.id).text(val.controllerId));
});
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 逆變器列表 DataTable
showLoading();
InverterTable = $("#Inverter_table").DataTable({
"pageLength": 5,
"paging": true,
@ -376,6 +409,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -391,17 +425,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 運維列表 DataTable
showLoading();
OperationTable = $("#Operation_table").DataTable({
"paging": true,
"lengthChange": false,
@ -461,6 +497,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -470,17 +507,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 裝置列表 DataTable
showLoading();
DeviceTable = $("#Device_table").DataTable({
"paging": true,
"lengthChange": false,
@ -560,6 +599,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -574,17 +614,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 共享裝置列表 DataTable
showLoading();
ShareDeviceTable = $("#ShareDevice_table").DataTable({
"paging": true,
"lengthChange": false,
@ -664,6 +706,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -677,17 +720,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 異常設定列表 DataTable
showLoading();
ExceptionTable = $("#Exception_table").DataTable({
"paging": true,
"lengthChange": false,
@ -748,6 +793,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -757,11 +803,12 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
@ -769,6 +816,7 @@
//#endregion
//#region 載入上傳資料 - 電站圖片
showLoading();
var url_image = "/PowerStation/GetAllPowerStationImage";
var send_data = {
powerStationId: stationId
@ -776,6 +824,7 @@
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -789,11 +838,12 @@
rel.data.forEach(function (value, index) {
CreatePowerStationImageBox(powerStationSingleLineCard, value);
});
hideLoading();
}, 'json');
//#endregion
//#region 載入上傳資料 - 單線圖
showLoading();
var url_image = "/PowerStation/GetAllPowerStationSingleLine";
var send_data = {
powerStationId: stationId
@ -801,6 +851,7 @@
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -821,19 +872,21 @@
});
hideLoading();
}, 'json');
//#endregion
}
//#endregion
//#region 預先載入運維人員下拉式選單select_option
showLoading();
var url_user_select_option = "/PowerStation/GetUserSelectOptionList";
var send_data = {
powerStationId: stationId
}
$.get(url_user_select_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -852,12 +905,14 @@
if (powerStationData) {
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds);
}
hideLoading();
});
$('.js-example-basic-multiple').select2();
//#endregion
//#region 預先載入其餘電站下拉式選單select_option
showLoading();
var url_powerstation_option = "/PowerStation/GetPowerstationOption";
var send_data = {
stationId: stationId
@ -865,6 +920,7 @@
if (stationId != "new") {
$.get(url_powerstation_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -885,6 +941,7 @@
$("#ShareDevice_PowerStationId_modal").attr('disabled', true);
$("#ShareDevice-modal").find('.btn-primary').attr('disabled', true);
}
hideLoading();
});
}
@ -896,9 +953,11 @@
});
//#region 預先載入縣市下拉式選單select_option
showLoading();
var url_city_select_option = "/PowerStation/GetCitySelectOptionList";
$.get(url_city_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -909,18 +968,20 @@
$("#select_city").append($("<option />").val(val.value).text(val.text));
});
if (powerStationData == undefined || powerStationData == null) {
if (powerStationData == undefined || powerStationData == null) {
//預設查詢第一個
$("#select_city").val($("#select_city option:first").val()).trigger("change");
}
else {
$("#select_city").val(powerStationData.cityId).trigger("change");
}
hideLoading();
});
//#endregion
//#region 縣市選擇後取得地區下拉式選單select_option
$("#select_city").change(function () {
showLoading();
var url_area_select_option = "/PowerStation/GetAreaSelectOptionList";
var send_data = {
@ -929,6 +990,7 @@
$.post(url_area_select_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -946,14 +1008,17 @@
else {
$("#select_area").val(powerStationData.areaId);
}
hideLoading();
});
});
//#endregion
//#region 預先載入設備類型下拉式選單select_option
showLoading();
var url_DeviceType = "/PowerStation/GetDeviceTypeSelectOptionList";
$.get(url_DeviceType, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -962,6 +1027,7 @@
$.each(rel.data, function (index, val) {
$("#Device_Type_modal").append($("<option />").val(val.value).text(val.text));
});
hideLoading();
});
//#endregion
@ -983,12 +1049,14 @@
//#region 預先載入裝置下拉式選單select_option
function DeviceUIDList(powerstationid)
{
showLoading();
var url_powerstation_option = "/PowerStation/GetDeviceUIDList";
var send_data = {
stationId: powerstationid
}
$.get(url_powerstation_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1005,19 +1073,21 @@
}
hideLoading();
});
}
//#endregion
//#region 預先載入日照計下拉式選單select_option
function PyrheliometerList(powerstationid) {
showLoading();
var url_powerstation_option = "/PowerStation/GetPyrheliometerList";
var send_data = {
stationId: powerstationid
}
$.get(url_powerstation_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1033,7 +1103,7 @@
});
}
hideLoading();
});
}
//#endregion
@ -1098,6 +1168,7 @@
//#endregion
function PostPowerStationData() {
showLoading();
var url = "/PowerStation/SavePowerStationInfo";
var send_data = {
@ -1129,6 +1200,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1143,11 +1215,13 @@
SetStationInfo();
ChangeMode("station_info", "view");
}
hideLoading();
}, 'json');
}
//#region 儲存能源局台電資料資訊
function SaveBoETPCInfo() {
showLoading();
var url = "/PowerStation/SaveBoETPCInfo";
var formData = new FormData();
@ -1183,6 +1257,7 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1194,6 +1269,7 @@
//回填資料
SetBoETPCInfo();
ChangeMode("BOE_TPC", "view");
hideLoading();
}
});
}
@ -1201,6 +1277,7 @@
//#region 儲存土地房屋資訊
function SaveLandBuildingInfo() {
showLoading();
var url = "/PowerStation/SaveLandBuildingInfo";
var send_data = {
@ -1217,6 +1294,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1225,7 +1303,7 @@
powerStationData = rel.data;
SetLandBuildingInfo();
hideLoading();
}, 'json');
}
//#endregion
@ -2051,6 +2129,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteLandBuildingInfo";
var send_data = {
SelectedId: selectedLandBuildingId,
@ -2058,12 +2137,14 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
powerStationData = rel.data;
SetLandBuildingInfo();
hideLoading();
}, 'json');
}
});
@ -2103,6 +2184,7 @@
//#region 儲存運維資料
function SaveOperation() {
if ($("#Operation-form").valid()) {
showLoading();
var url = "/PowerStation/SaveOperation";
var send_data = {
Id: selected_id,
@ -2118,6 +2200,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2126,6 +2209,7 @@
toast_ok(rel.msg);
$('#Operation-modal').modal('hide');
OperationTable.ajax.reload();
hideLoading();
return;
}
@ -2137,6 +2221,7 @@
//#region 儲存共享設備
function SaveShareDevice() {
if ($("#Operation-form").valid()) {
showLoading();
var url = "/PowerStation/SaveShareDevice";
var send_data = {
Id: selected_id,
@ -2146,6 +2231,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2153,6 +2239,7 @@
toast_ok(rel.msg);
$('#ShareDevice-modal').modal('hide');
ShareDeviceTable.ajax.reload();
hideLoading();
return;
}
@ -2168,6 +2255,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一運維基本資料
showLoading();
var url = "/PowerStation/GetOneOperation/";
var send_data = {
@ -2177,6 +2265,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2190,6 +2279,7 @@
$("#Operation_remark_modal").val(rel.data.remark);
$("#Operation-modal").modal();
hideLoading();
}, 'json');
});
@ -2209,6 +2299,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneOperation/";
var send_data = {
@ -2218,11 +2309,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
OperationTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2287,6 +2380,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneShareDevice/";
var send_data = {
@ -2296,11 +2390,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
ShareDeviceTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2309,6 +2405,7 @@
//#region 儲存控制器資料
function SaveController() {
showLoading();
var url = "/PowerStation/SaveController";
if ($("#Controller-form").valid()) {
var send_data = {
@ -2318,6 +2415,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2325,6 +2423,7 @@
toast_ok(rel.msg);
$('#Controller-modal').modal('hide');
DeviceControllerTable.ajax.reload();
hideLoading();
return;
}
}, 'json');
@ -2346,6 +2445,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneDeviceController/";
var send_data = {
@ -2355,11 +2455,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
DeviceControllerTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2380,6 +2482,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneInverter/";
var send_data = {
@ -2389,11 +2492,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
InverterTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2402,7 +2507,7 @@
//#region 儲存逆變器資料
function SaveInverter() {
showLoading();
var url = "/PowerStation/SaveInverter";
if ($("#Inverter-form").valid()) {
var send_data = {
@ -2422,6 +2527,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2429,6 +2535,7 @@
toast_ok(rel.msg);
$('#Inverter-modal').modal('hide');
InverterTable.ajax.reload();
hideLoading();
return;
}
}, 'json');
@ -2440,6 +2547,7 @@
function SaveDevice() {
if ($("#Device-form").valid()) {
showLoading();
var url = "/PowerStation/SaveDevice";
var a = padLeft($("#Device_ColName_modal").val(), 2);
var send_data = {
@ -2462,6 +2570,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2469,6 +2578,7 @@
toast_ok(rel.msg);
$('#Device-modal').modal('hide');
DeviceTable.ajax.reload();
hideLoading();
return;
}
@ -2485,6 +2595,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一運維基本資料
showLoading();
var url = "/PowerStation/GetOneDevice/";
var send_data = {
@ -2495,6 +2606,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2524,6 +2636,7 @@
$("#Device-modal").modal();
hideLoading();
}, 'json');
});
@ -2534,6 +2647,7 @@
$("#Inverter-modal .modal-title").html("逆變器 - 編輯");
document.getElementById('Inverter_Status_modal').disabled = true;
selected_id = $(this).parents('tr').attr('data-id');
showLoading();
var url = "/PowerStation/GetOneInverter/";
var send_data = {
@ -2544,6 +2658,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2568,6 +2683,7 @@
$("#Inverter-modal").modal();
hideLoading();
}, 'json');
});
@ -2587,6 +2703,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneDevice/";
var send_data = {
SelectedId: selected_id,
@ -2594,11 +2711,13 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
DeviceTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2620,7 +2739,7 @@
if ($("#Exception-form").valid()) {
showLoading();
var url = "/PowerStation/SaveException";
var send_data = {
Id: selected_id,
@ -2632,6 +2751,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2639,6 +2759,7 @@
toast_ok(rel.msg);
$('#Exception-modal').modal('hide');
ExceptionTable.ajax.reload();
hideLoading();
return;
}
}, 'json');
@ -2652,6 +2773,7 @@
var tyname = $(this).parents('tr').attr('data-typename');
selected_id = $(this).parents('tr').attr('data-id');
//取得單一異常設定資料
showLoading();
var url = "/PowerStation/GetOneException/";
var send_data = {
SelectedId: selected_id,
@ -2659,6 +2781,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2670,6 +2793,7 @@
$("#Exception_LowerLimit_modal").val(rel.data.lowerLimit);
$("#Exception-modal").modal();
hideLoading();
}, 'json');
});
@ -2690,6 +2814,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeleteOneException/";
var send_data = {
SelectedId: selected_id,
@ -2697,11 +2822,13 @@
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
ExceptionTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -2731,7 +2858,7 @@
myDropzone.processQueue();
});
myDropzone.on("sendingmultiple", function (file, xhr, data) {
temp_count = countPowerStationImage + myDropzone.files.length;
if (temp_count > 5) {
@ -2813,7 +2940,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeletePowerStationImage";
var send_data = {
@ -2823,6 +2950,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2830,6 +2958,7 @@
toast_ok(rel.msg);
countPowerStationImage -= 1;
div.remove();
hideLoading();
}, 'json');
}
});
@ -2853,7 +2982,7 @@
this.checked = true;
return;
}
showLoading();
var url = "/PowerStation/ChangeMainDisplay";
var send_data = {
@ -2863,11 +2992,13 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
hideLoading();
}, 'json');
});
//#endregion
@ -2926,7 +3057,7 @@
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
}
});
});
@ -2983,7 +3114,7 @@
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
showLoading();
var url = "/PowerStation/DeletePowerStationSingleLine";
var send_data = {
@ -2993,6 +3124,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -3000,6 +3132,7 @@
toast_ok(rel.msg);
countPowerStationSingleLine -= 1;
div.remove();
hideLoading();
}, 'json');
}
});
@ -3164,12 +3297,14 @@
function urlApicallItem()
{
showLoading();
var urlApicallItem = "/PowerStation/GetApicallItemList";
var send_data = {
powerStationId: stationId
}
$.post(urlApicallItem, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -3187,7 +3322,7 @@
$("#Exception_Type_modal").attr('disabled', true);
$("#savebtn").attr('disabled', true);
}
hideLoading();
});
}

View File

@ -18,6 +18,19 @@
</h1>
</div>
<!-- Your main content goes below here: -->
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -227,8 +240,19 @@
}
//#endregion
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 裝置類型列表 DataTable
showLoading();
SensorTypeDeviceTable = $("#SensorType_table").DataTable({
"paging": true,
"lengthChange": false,
@ -288,6 +312,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -297,11 +322,12 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -310,6 +336,7 @@
//#region 儲存裝置類型資料
function SaveSensorType() {
showLoading();
var url = "/SensorType/SaveSensorType";
if ($("#SensorType-form").valid()) {
var send_data = {
@ -320,10 +347,12 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
else {
hideLoading();
toast_ok(rel.msg);
$('#SensorType-modal').modal('hide');
SensorTypeDeviceTable.ajax.reload();
@ -349,12 +378,14 @@
}).then(function (result) {
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/SensorType/DeleteOneSensorType/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -363,6 +394,7 @@
SensorTypeDeviceTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -377,6 +409,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一裝置
showLoading();
var url = "/SensorType/GetOneSensorType/";
var send_data = {
@ -385,10 +418,12 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -398,6 +433,7 @@
$("#SensorType_Enabled_modal").val(rel.data.enabled);
$("#SensorType-modal").modal();
hideLoading();
}, 'json');
});
@ -410,9 +446,10 @@
document.getElementById('SensorDetail_SensorType_modal').disabled = true;
selected_id = 0;
selected_type_id = $(this).parents('tr').attr('data-id');
//取得單一裝置
showLoading();
var url = "/SensorType/GetOneSensorType/";
var send_data = {
@ -421,10 +458,12 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -433,12 +472,14 @@
$("#SensorDetail_SensorType_modal").val(rel.data.sensorName);
$("#SensorDetail-modal").modal();
hideLoading();
}, 'json');
});
//#endregion
//#region 儲存裝置細項資料
function SaveSensorDetail() {
showLoading();
var url = "/SensorType/SaveSensorDetail";
if ($("#SensorDetail-form").valid()) {
var send_data = {
@ -455,6 +496,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -462,6 +504,7 @@
toast_ok(rel.msg);
$('#SensorDetail-modal').modal('hide');
SensorTypeDeviceTable.ajax.reload();
hideLoading();
return;
}
}, 'json');
@ -474,17 +517,18 @@
var send_data = {
Id: id
}
showLoading();
var url_sensorType_info = "/SensorType/GetOneSensorType";
$.post(url_sensorType_info, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
$("#sensor-detail-modal .modal-title").html(rel.data.sensorName + "- 細項");
hideLoading();
}, 'json');
UpdateSensorDetailTable(id, function (returnData) {
@ -496,6 +540,7 @@
//#endregion
function UpdateSensorDetailTable(sensorType_id, callback) {
showLoading();
var url = "/SensorType/GetSensorDetail";
var send_data = {
Id: sensorType_id
@ -503,6 +548,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
callback(false);
}
@ -527,8 +573,9 @@
});
SensorTypeDeviceTable.ajax.reload();
callback(true);
hideLoading();
}, 'json');
}
@ -548,12 +595,14 @@
}).then(function (result) {
if (result.value) {
//取得單一裝置細項
showLoading();
var url = "/SensorType/DeleteOneSensorDetail/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -561,6 +610,7 @@
del_btn.parents("tr").remove();
toast_ok(rel.msg);
sensorDetailTable.ajax.reload();
hideLoading();
}, 'json');
}
});

View File

@ -11,6 +11,19 @@
</ol>
<!-- Your main content goes below here: -->
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -194,7 +207,7 @@
<p>裝置容量</p>
<p><span class="color-primary-400" id="Capacity">0.00</span> kWp</p>
</div>
<div class="d-flex justify-content-end" style="width:40%">
<div class="d-flex justify-content-end" style="width:40%">
<p><span class="color-primary-400" id="stationtype">65</span></p>
</div>
</div>
@ -304,12 +317,23 @@
var AllidsType = true;
var StatusType = true;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
status123 = [];
showLoading();
var city_url = "/StationOverview/GetMyCities";
$.post(city_url, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -325,6 +349,7 @@
}
getStation(ids);
hideLoading();
}, 'json');
});
@ -390,9 +415,11 @@
$("#update_at").html(0);
}
else {
showLoading();
var Nurl = "/StationOverview/GetPowerStationByFilter";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -476,6 +503,7 @@
'</tr>');
});
GetStationCard(rel.data);
hideLoading();
}, 'json');
}

View File

@ -13,6 +13,18 @@
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>*@
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -172,6 +184,16 @@
var HeapMapXAxis = [];
var countOperationRecordFile = 0;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
var url = new URL(location.href);
@ -193,7 +215,7 @@
opens: 'left'
}, function (start, end, label) {
});
$('#date-range-history').on('apply.daterangepicker', function (ev, picker) {
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' ~ ' + picker.endDate.format('YYYY-MM-DD'));
$(this).trigger('change');
@ -221,9 +243,11 @@
//#endregion
//#region 預先載入公司下拉式選單select_option
showLoading();
var url_company_select_option = "/Company/GetCompanySelectOptionList";
$.get(url_company_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -236,16 +260,19 @@
//預設查詢自己的公司
$("#select_power_station_company").val(@ViewBag.myUser.CompanyId).trigger('change');
hideLoading();
});
//#endregion
//#region 即時資訊tab
showLoading();
var url = "/StationOverview/GetOneStationUpToDateInfo";
var send_data = {
ids: [stationId]
};
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -303,10 +330,11 @@
$("#money-card-subtitle-total").html("總省電費用");
$("#money-card-subtitle-avg").html("今日省電費用");
}
hideLoading();
}, 'json');
//#region 載入電站圖片
showLoading();
var url_image = "/PowerStation/GetAllPowerStationsALLImage";
var send_data = {
powerStationId: stationId
@ -314,6 +342,7 @@
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -327,17 +356,19 @@
carouselExampleIndicators.find(".carousel-indicators > li").first().addClass("active");
carouselExampleIndicators.find(".carousel-inner > .carousel-item").first().addClass("active");
hideLoading();
}, 'json');
//#endregion
//#region 載入圖表資料
showLoading();
var url = "/StationOverview/GetChartUpToDate";
var send_data = {
id: stationId
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -714,6 +745,7 @@
}
});
//#endregion
hideLoading();
}, 'json');
//#endregion
@ -728,12 +760,14 @@
//#endregion
//#region 基本資料tab
showLoading();
var url = "/PowerStation/GetOnePowerStation"
var send_data = {
id: stationId
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -757,10 +791,11 @@
$("#power_station_select_modal").append($("<option />").val(stationId).text(powerStationData.name));
$("#power_station_select_modal").val($("#power_station_select_modal option:first").val()).trigger('change');
hideLoading();
}, 'json');
//#region 載入單線圖
showLoading();
var url_image = "/PowerStation/GetAllPowerStationSingleLine";
var send_data = {
powerStationId: stationId
@ -768,6 +803,7 @@
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -783,11 +819,12 @@
});
hideLoading();
}, 'json');
//#endregion
//#region 預先載入運維人員下拉式選單select_option
showLoading();
var url_user_select_option = "/PowerStation/GetUserSelectOptionList";
var send_data = {
@ -796,6 +833,7 @@
$.get(url_user_select_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -809,6 +847,7 @@
if (powerStationData) {
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds);
}
hideLoading();
});
$('.js-example-basic-multiple').select2();
@ -857,6 +896,7 @@
//#region 運維作業記錄 DataTable
powerids.push(stationId);
showLoading();
operationRecordTable = $("#operation_record_table").DataTable({
"pageLength": 20,
"paging": true,
@ -940,6 +980,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -950,10 +991,12 @@
this.data = [];
}
$('#operation_record_table_wrapper').show();
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -963,6 +1006,7 @@
$("#power_station_select_modal").change(function () {
//查詢該電站的運維人員
showLoading();
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
send_data = {
@ -971,6 +1015,7 @@
$.post(url_power_station_operation_personnel, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -989,13 +1034,16 @@
}
$("#work_person_select_modal").select2({ dropdownParent: $('#record-form-modal') });
hideLoading();
});
//查詢該電站的廠商
showLoading();
var url_power_station_firm = "/PowerStation/GetFirmSelectOptionList";
$.post(url_power_station_firm, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1013,6 +1061,7 @@
if (record != undefined && record != null) {
$("#fix_firm_select_modal").val(record.fixFirm)
}
hideLoading();
});
});
//#endregion
@ -1026,12 +1075,14 @@
LoadInvertAnalysiskwhBar();
//#region 載入電站逆變器資料
showLoading();
var url = "/StationOverview/GetInverterCheckBox";
var send_data = {
id: stationId
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1046,19 +1097,21 @@
});
SelectAllInvert();
hideLoading();
}, 'json');
//#endregion
//#endregion
//#region 維修單運維人員(異常紀錄)
showLoading();
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
send_data = {
PowerStationId: stationId
}
$.post(url_power_station_operation_personnel, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1074,10 +1127,12 @@
$("#work_person_select_modal_exc").val(record.workPersonId);
}
}
hideLoading();
});
//#endregion
//#region 異常table
showLoading();
ExceptionTable = $("#Exception_Table").DataTable({
"pageLength": 20,
"paging": true,
@ -1141,6 +1196,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -1149,10 +1205,12 @@
this.data = [];
}
$("#Exception_Table_wrapper").show();
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -1190,6 +1248,7 @@
//#endregion
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/StationOverview/GetPowerStationCollapse"
var send_data = {
@ -1198,6 +1257,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -1240,7 +1300,7 @@
$('#js_list_accordion').append(str);
$('#js_list_accordion').find('.card').first().addClass(" border-top-left-radius-0 border-top-right-radius-0");
hideLoading();
}, 'json');
}
@ -1283,6 +1343,7 @@
//#region 匯出excel(異常)
function ExportExcelToExc() {
showLoading();
var url = "/StationOverview/GetExceptionTable";
var send_data = {
id: stationId,
@ -1291,6 +1352,7 @@
};
$.post(url, send_data, function (rel) {
if (rel.data.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -1321,6 +1383,7 @@
//檔案字尾名
fileext: ".xls",
});
hideLoading();
}, 'json');
}
//#endregion
@ -1331,6 +1394,7 @@
selected_id = $(this).parents('tr').attr('data-id');
errortoID = $(this).parents('tr').attr('data-error');
//取得單一記錄表單
showLoading();
var url = "/Operation/GetOneOperationRecord/";
var send_data = {
@ -1339,6 +1403,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1376,6 +1441,7 @@
});
$("#exception-form-modal").modal();
hideLoading();
}, 'json');
});
//#endregion
@ -1417,6 +1483,7 @@
function SaveException() {
if ($("#record-form-exc").valid()) {
showLoading();
var url = "/Operation/SaveOperationRecord";
var formData = new FormData();
@ -1441,6 +1508,7 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1453,6 +1521,7 @@
myDropzone.on("successmultiple", function (file, rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1469,6 +1538,7 @@
ExceptionTable.ajax.reload();
}
hideLoading();
}
});
}
@ -1523,7 +1593,7 @@
document.getElementById(name).setAttribute("class", "btn btn-success waves-effect waves-themed");
document.getElementById(name2).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
ExceptionTable.ajax.reload();
}
//#endregion
@ -1547,6 +1617,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一記錄表單
showLoading();
var url = "/Operation/GetOneOperationRecord/";
var send_data = {
@ -1555,6 +1626,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1597,6 +1669,7 @@
});
$("#EmailcheckBox").prop("checked", false);
$("#record-form-modal").modal();
hideLoading();
}, 'json');
});
//#endregion
@ -1673,12 +1746,13 @@
//#region 儲存表單資料(運維)
function SaveRecord() {
if ($('#work_person_select_modal').val().length > 0 && $("#work_time_modal").val() != "")
{
if ($("#record-form").valid()) {
// 鎖定按鈕
$("#save-record-op-btn").attr('disabled', true);
showLoading();
var url = "/Operation/SaveOperationRecord";
var formData = new FormData();
@ -1702,7 +1776,7 @@
else {
formData.append("Emailcheck", 0);
}
$.ajax({
type: "POST",
url: url,
@ -1712,6 +1786,7 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1724,6 +1799,7 @@
myDropzone.on("successmultiple", function (file, rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1744,8 +1820,9 @@
toast_ok("修改完成");
// 取消鎖定按鈕
$("#save-record-op-btn").attr('disabled', false);
hideLoading();
}
});
});
}
}
else {
@ -1756,7 +1833,7 @@
$("#work_time_modal-error").show();
}
}
}
//#endregion
@ -1769,6 +1846,7 @@
//#region 匯出excel(運維)
function ExportExcel() {
showLoading();
var url = "/Operation/ExportOperationRecordExcel";
var send_data = {
WorkType: Type,
@ -1776,6 +1854,7 @@
};
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1824,6 +1903,7 @@
//檔案字尾名
fileext: ".xls",
});
hideLoading();
}, 'json');
}
//#endregion
@ -2093,6 +2173,7 @@
}).get();
//#region HeatMap
showLoading();
var url = "/StationOverview/GetInverterHeatMapAnalysis";
var send_data = {
PowerStationId: stationId,
@ -2100,6 +2181,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2176,6 +2258,7 @@
});
$('#InverterResult').removeAttr("style", "display:none !important;");
hideLoading();
}, 'json');
//#endregion
@ -2256,6 +2339,7 @@
$('#inverter-kWh-convas-div').hide();
var url = "/StationOverview/GetInverterkwhBarAnalysis";
showLoading();
var send_data = {
PowerStationId: stationId,
SelectedType: selectInverterkwhBarType,
@ -2264,6 +2348,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2282,8 +2367,7 @@
data: kwhBar.datasets[key],
backgroundColor: bgColorlist[index],
}
return dataset;
hideLoading();
});
$('#inverter-kWh-convas-div').empty();
@ -2318,7 +2402,7 @@
//#endregion
$('#inverter-kWh-convas-div').show();
hideLoading();
}, 'json');
}
@ -2423,7 +2507,7 @@
if (post == 0) { //今天
var today = new Date();
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "-");
//$('#DateGet').val(today_format);
//$('#DateGet').val(today_format);
$('#date-range-history').val(today_format + ' - ' + today_format);
groupType = 0;
}
@ -2478,7 +2562,7 @@
//#endregion
//console.log("date-range-history = " + $('#date-range-history').val());
function Historyclick() {
function Historyclick() {
switch (groupType) {
case 0:
timeAll = $('#date-range-history').val().split('~');
@ -2490,7 +2574,7 @@
groupType = 4; // 採用 月報格式
// alert("groupType = " + groupType);
}
break;
break;
case 1: historyRange = $('#MonthGet').val(); break;
case 2: historyRange = $('#YearGet').val(); break;
case 4: timeAll = $('#date-range-history').val().split('~');
@ -2504,7 +2588,7 @@
}
getTable();
}
//$('#DateGet').on('change', function () {
// console.log(" in onChange event");
// historyRange = $('#DateGet').val();
@ -2532,7 +2616,7 @@
//historyRange = $('#DateGet').val();
$('#date-range-history').val(today_format + ' - ' + today_format);
historyRange = $('#date-range-history').val();
}
}
var send_data = {
GroupType: groupType,
@ -2540,9 +2624,11 @@
PowerstationId: stationId
}
//0:日 1:月 2:年 3:歷年 4:dateRange 選擇不同天(採用月的方式顯示)
showLoading();
var Nurl = "/StationOverview/GetTotalTableToHistory";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2551,7 +2637,7 @@
var TimestampALL;
var kwhALL = 0;
var diffSOLARHOURALL = 0;
var irradianceALL = 0;
var irradianceALL = 0;
var pr = 0;
var avgPR = 0;
var irr_day = 0;
@ -2575,26 +2661,26 @@
$.each(rel.data, function (index, val) {
// console.log('回傳 = ' + val);
TimestampALL = val.totaltime;
kwhALL += val.kwh;
//diffSOLARHOURALL += val.diffSOLARHOUR;
irradianceALL += val.irradiance;
irr_day = val.irrDay;
avgIrr_day += val.irrDay; // 累計日照
pr = val.pr;
avgPR += val.pr;
//rowCT++;
//console.log('avgPR = ' + avgPR) + ' rowCT = ' + rowCT;;
//if (typeof (val) == 'object') {
//if (typeof (val) == 'object') {
//if (val && typeof (val) != "undefined") {
// alert('val.PR = ' + val.pr);
// avgPR += val.pr;
// rowCT++;
//}
//}
tempALL += val.temp;
//暫時先執行到這--->取kwhkwp
if (val.length != 0) {
@ -2658,7 +2744,7 @@
listsolarhour.push(parseFloat(val.solarhour.toFixed(2)));
listpr.push(parseFloat(val.pr.toFixed(2)));
listkwhkwp.push(parseFloat(val.kwhkwp.toFixed(2)));
}
}
}
})
@ -2790,6 +2876,7 @@
'</tr>');
}
$('#all').show();
hideLoading();
})
}
@ -2798,6 +2885,7 @@
function GetInverterCard(stationId) {
showLoading();
var url = "/PowerStation/GetOnePowerStation/";
var send_data = {
@ -2805,6 +2893,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -2880,11 +2969,13 @@
stationDB = rel.data.siteDB;
InverterInfoList();
hideLoading();
}, 'json');
};
function InverterInfoList() {
showLoading();
var url = "/PowerStation/GetInverterInfoList/";
var send_data = {
id: stationId,
@ -2892,10 +2983,12 @@
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
if (rel.code == "0001") {
hideLoading();
toast_warning(rel.msg);
return;
}
@ -3020,10 +3113,12 @@
}
};
hideLoading();
});
}
function InverterInfoDetail(id,time,db,table) {
function InverterInfoDetail(id, time, db, table) {
showLoading();
var url = "/PowerStation/GetInverterInfoModal/";
var send_data = {
Id: id,
@ -3033,6 +3128,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -3089,7 +3185,7 @@
$("#inverterdetailmodal").modal();
hideLoading();
})

View File

@ -6,6 +6,18 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100 overflow-auto">
@ -313,6 +325,17 @@
var nowform;
var xxx;
var button;
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
//#region 預設初始值
$('#collapse').trigger("click");
@ -593,6 +616,7 @@
function GetPowerStationCollapse(filter) {
showLoading();
var url = "/StationReport/GetPowerStationCollapse"
var send_data = {
@ -601,6 +625,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -682,7 +707,7 @@
});
$("#js_list_accordion .collapse").collapse('show');
hideLoading();
}, 'json');
}
//#endregion
@ -727,9 +752,11 @@
break;
}
showLoading();
var url = "/StationReport/GetTableHead";
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_warning(rel.msg);
switch (form) {
@ -842,6 +869,7 @@
//綜合報表
maxtableinfobody(rel.data.showMoney);
}
hideLoading();
}, 'json');
}
@ -870,6 +898,7 @@
FormType: form,
PowerStation: nowpowerstation
}
showLoading();
var url = "/StationReport/GetForm";
$.post(url, send_data, function (rel) {
@ -905,6 +934,7 @@
}
if (rel.code != "0000") {
hideLoading();
if (rel.code == "9985") {
toast_warning(rel.msg);
} else {
@ -1090,6 +1120,7 @@
var posturl = "/StationReport/GetHireInfo";
$.post(posturl, dataTosent, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -1210,6 +1241,7 @@
var posturl = "/StationReport/GetHireInfo";
$.post(posturl, dataTosent, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -1240,6 +1272,7 @@
$('#all').show();
nowform = form;
hideLoading();
}, 'json');
}
@ -1252,12 +1285,14 @@
PowerStation: selecterd_invert
}
if (send_data.FormType != null && send_data.PowerStation.length != 0 && send_data.FormType != 2) {
showLoading();
$.post("/StationReport/CheckExcel", send_data, function (rel) {
if (rel.code == "0000") {
//window.location = "/StationReport/ExportExcel?post=" + JSON.stringify(send_data);
$("#post").val(JSON.stringify(send_data));
document.report.action = "StationReport/ExportExcel";
document.report.submit();
hideLoading();
return;
}
else
@ -1271,7 +1306,8 @@
title: "Excel匯出失敗",
icon: 'warning',
html: text,
});
});
hideLoading();
}
}, 'json');
}
@ -1296,6 +1332,7 @@
FormType: 2,
PowerStation: selecterd_invert
}
showLoading();
var url = "/StationReport/GetMaxForm";
var StrInfoBody = "";
var CityArray = [];
@ -1306,6 +1343,7 @@
var kwp = 0;
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_warning(rel.msg);
return;
}
@ -1437,6 +1475,7 @@
nowform = 2;
$('#all').show();
hideLoading();
})
}
@ -1448,6 +1487,7 @@
Sitedb: db,
PowerstationId: id
}
showLoading();
var posturl = "/StationReport/GetHireInfo";
$.ajax({
url: posturl,
@ -1460,6 +1500,7 @@
$.each(response.data, function (index, value) {
hirerate += Number(value.leaseRate);
})
hideLoading();
}
});
return hirerate;

View File

@ -11,6 +11,18 @@
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>
<link rel="stylesheet" href="~/css/loading.css" />
<div class="loadEffect" id="loading" style="top: 10%;">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
@ -50,13 +62,26 @@
var userTable; var roleTable; var roleAuthTable; var roleAuthNotJoinTable;
var selected_id = 0, selected_role_id = 0, selected_company_id = 0;
var selected_tab = "";
function showLoading() {
var i = document.getElementById("loading");
i.style.display = "block";
}
function hideLoading() {
var i = document.getElementById("loading");
i.style.display = "none";
}
$(function () {
selected_tab = $('#tabs').find("li a.active").attr("href"); // 當前tab
//#region 預先載入公司下拉式選單select_option
showLoading();
var url_company_select_option = "/Company/GetCompanySelectOptionList";
$.get(url_company_select_option, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -69,7 +94,7 @@
//預設查詢第一個
$(".select_user_company").val($(".select_user_company option:first").val()).trigger('change');
hideLoading();
});
//#endregion
@ -101,6 +126,7 @@
}
//查詢該公司的基本資料
showLoading();
var url_company_info = "/Company/GetOneCompany"
var send_data = {
@ -109,6 +135,7 @@
$.post(url_company_info, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -117,6 +144,7 @@
$("#company-name").html(rel.data.name);
$("#company-modal").modal();
hideLoading();
}, 'json');
//更新當前剩餘可註冊使用者人數
@ -125,7 +153,7 @@
//查詢該公司的角色
UpdateCompanyRoleSelectOption($(this).val());
});
//#endregion
@ -148,6 +176,7 @@
//#endregion
//#region 使用者列表 DataTable
showLoading();
userTable = $("#user_table").DataTable({
"paging": true,
"lengthChange": false,
@ -223,6 +252,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -232,17 +262,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 角色管理列表 DataTable
showLoading();
roleTable = $("#role_table").DataTable({
"paging": true,
"lengthChange": false,
@ -301,6 +333,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -310,17 +343,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 角色權限列表 DataTable
showLoading();
roleAuthTable = $("#roleAuth_table").DataTable({
"paging": true,
"lengthChange": false,
@ -402,6 +437,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -411,17 +447,19 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
//#endregion
//#region 角色未加入權限列表 DataTable
showLoading();
roleAuthNotJoinTable = $("#roleAuth_NotJoin_table").DataTable({
"paging": true,
"lengthChange": false,
@ -489,6 +527,7 @@
},
"dataSrc": function (rel) {
if (rel.data.code == "9999") {
hideLoading();
toast_error(rel.data.msg);
return;
}
@ -498,11 +537,12 @@
if (data == null || data.length == 0) {
this.data = [];
}
hideLoading();
return data;
}
},
"error": function (xhr, error, thrown) {
hideLoading();
console.log(xhr);
}
});
@ -574,6 +614,7 @@
selected_id = $(this).parents('tr').attr('data-id');
//取得單一使用者管理員
showLoading();
var url = "/User/GetOneUser/";
var send_data = {
@ -582,10 +623,12 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -605,6 +648,7 @@
$(".user-password-div").hide();
$("#user-modal").modal();
hideLoading();
}, 'json');
});
@ -631,6 +675,7 @@
function SaveUser() {
if ($("#user-form").valid()) {
showLoading();
var url = "/User/SaveUser";
@*var send_data = {
@ -681,6 +726,7 @@
processData: false,
success: function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -692,6 +738,7 @@
UpdateRegisterNumber($("#user_companyId_modal").val());
userTable.ajax.reload();
hideLoading();
}
});
}
@ -713,12 +760,14 @@
}).then(function (result) {
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/User/DeleteOneUser/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -729,6 +778,7 @@
UpdateRegisterNumber($("#select_user_company_userManager_tab").val());
userTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -737,7 +787,7 @@
//#region 更新公司當前剩餘註冊數量
function UpdateRegisterNumber(companyId) {
showLoading();
var url = "/Company/GetRemainingRegisterNumber"
var send_data = {
@ -746,6 +796,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -756,6 +807,7 @@
} else {
$("#addUser-btn").show();
}
hideLoading();
}, 'json');
}
//#endregion
@ -765,17 +817,18 @@
var send_data = {
Id: id
}
showLoading();
var url_user_info = "/User/GetOneUser";
$.post(url_user_info, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
$("#user-power-station-modal .modal-title").html(rel.data.companyName + "" + rel.data.name);
hideLoading();
}, 'json');
UpdateUserPowerStationTable(id, function (returnData) {
@ -804,12 +857,14 @@
}).then(function (result) {
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/User/DeleteOneUserPowerStation/";
var send_data = {
Id: selected_id
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -817,11 +872,12 @@
del_btn.parents("tr").remove();
toast_ok(rel.msg);
userTable.ajax.reload();
hideLoading();
}, 'json');
}
});
});
//#endregion
$("#user-power-station-table").on("click", "input.custom-control-input", function () {
@ -844,7 +900,7 @@
check = 0;
}
showLoading();
var url = "/User/DeleteOneGetEmail/";
var send_data = {
Id: selected_id,
@ -853,11 +909,12 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
hideLoading();
}, 'json');
})
@ -866,7 +923,7 @@
function AddUserPowerStation(e) {
var user_id = $(e).attr("data-user-id");
showLoading();
var url = "/User/GetUserCompanyPowerStation";
var send_data = {
Id: user_id
@ -874,6 +931,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -895,6 +953,7 @@
$("#add-user-manager-station-modal").modal();
userTable.ajax.reload();
hideLoading();
}, 'json');
}
@ -907,6 +966,7 @@
var save_btn = $(this);
//取得單一系統管理員
showLoading();
var url = "/User/SaveUserPowerStation/";
var send_data = {
PowerStationId: selected_power_station_id,
@ -914,6 +974,7 @@
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -922,11 +983,13 @@
toast_ok(rel.msg);
UpdateUserPowerStationTable(selected_user_id);
hideLoading();
}, 'json');
});
function UpdateUserPowerStationTable(user_id, callback) {
showLoading();
var url = "/User/GetUserPowerStation";
var send_data = {
Id: user_id
@ -934,6 +997,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
callback(false);
}
@ -979,6 +1043,7 @@
userPowerStationTable.append(str);
});
hideLoading();
userTable.ajax.reload();
callback(true);
}, 'json');
@ -1015,6 +1080,7 @@
selected_role_id = $(this).parents('tr').attr('data-id');
//取得單一公司角色資料
showLoading();
var url = "/Role/GetOneRole/";
var send_data = {
@ -1023,10 +1089,12 @@
$.post(url, send_data, function (rel) {
if (rel.code == "9999") {
hideLoading();
toast_error(rel.msg);
return;
}
else if (rel.code == "9998") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1036,6 +1104,7 @@
$("#role_name_modal").val(rel.data.name);
$("#role-modal").modal();
hideLoading();
}, 'json');
});
@ -1058,6 +1127,7 @@
function SaveRole() {
if ($("#role-form").valid()) {
showLoading();
var url = "/Role/SaveRole";
var send_data = {
@ -1068,6 +1138,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1077,6 +1148,7 @@
UpdateCompanyRoleSelectOption($("#role_companyId_modal").val())
roleTable.ajax.reload();
hideLoading();
}, 'json');
}
}
@ -1098,6 +1170,7 @@
}).then(function (result) {
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/Role/DeleteOneRole/";
var send_data = {
@ -1106,12 +1179,14 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
roleTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -1150,6 +1225,7 @@
return $(this).val();
}).get();
showLoading();
var url = "/Role/SaveRoleAuth";
var send_data = {
@ -1159,6 +1235,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1167,6 +1244,7 @@
$("#role-auth-modal").modal('hide');
roleAuthTable.ajax.reload();
hideLoading();
}, 'json');
}
//#endregion
@ -1190,6 +1268,7 @@
{
if (result.value) {
//取得單一系統管理員
showLoading();
var url = "/Role/DeleteOneRoleAuth/";
var send_data = {
@ -1199,12 +1278,14 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
roleAuthTable.ajax.reload();
hideLoading();
}, 'json');
}
});
@ -1214,6 +1295,7 @@
//#endregion
function UpdateCompanyRoleSelectOption(companyId) {
showLoading();
var url_company_role_select_option = "/Role/GetRoleSelectOptionList";
send_data = {
@ -1222,6 +1304,7 @@
$.get(url_company_role_select_option, send_data, function (rel) {
if (rel.code != "0000") {
hideLoading();
toast_error(rel.msg);
return;
}
@ -1295,6 +1378,7 @@
if (selected_tab == "#tab-role-manager") {
roleTable.ajax.reload();
}
hideLoading();
});
}

View File

@ -0,0 +1,86 @@
.loadEffect {
z-index: 9999;
left: 50%;
transform: translate(-50%,-50%);
width: 100px;
height: 100px;
position: absolute;
margin: 0 auto;
margin-top: 100px;
display: none;
}
.loadEffect span {
display: inline-block;
width: 13px;
height: 13px;
border-radius: 50%;
background: black;
position: absolute;
-webkit-animation: load 1.04s ease infinite;
}
@-webkit-keyframes load {
0% {
opacity: 1;
}
100% {
opacity: 0.2;
}
}
.loadEffect span:nth-child(1) {
left: 0;
top: 50%;
margin-top: -8px;
-webkit-animation-delay: 0.13s;
}
.loadEffect span:nth-child(2) {
left: 14px;
top: 14px;
-webkit-animation-delay: 0.26s;
}
.loadEffect span:nth-child(3) {
left: 50%;
top: 0;
margin-left: -8px;
-webkit-animation-delay: 0.39s;
}
.loadEffect span:nth-child(4) {
top: 14px;
right: 14px;
-webkit-animation-delay: 0.52s;
}
.loadEffect span:nth-child(5) {
right: 0;
top: 50%;
margin-top: -8px;
-webkit-animation-delay: 0.65s;
}
.loadEffect span:nth-child(6) {
right: 14px;
bottom: 14px;
-webkit-animation-delay: 0.78s;
}
.loadEffect span:nth-child(7) {
bottom: 0;
left: 50%;
margin-left: -8px;
-webkit-animation-delay: 0.91s;
}
.loadEffect span:nth-child(8) {
bottom: 14px;
left: 14px;
-webkit-animation-delay: 1.04s;
}