1. 重突 bug fix

This commit is contained in:
Kai 2021-07-08 18:53:51 +08:00
parent a1beee85fe
commit 86a0f6f11a

View File

@ -102,9 +102,9 @@
var stationId; var stationId;
var powerStationData; var powerStationData;
var stationOverview; var stationOverview;
var recode; var recode;
var selected_work_type = -1; var selected_work_type = -1;
$(function () { $(function () {
var url = new URL(location.href); var url = new URL(location.href);
stationId = url.searchParams.get('stationId'); stationId = url.searchParams.get('stationId');
@ -423,7 +423,57 @@
}, 'json'); }, 'json');
//#region Date Picker //#region 載入單線圖
var url_image = "/PowerStation/GetAllPowerStationSingleLine";
var send_data = {
powerStationId: stationId
};
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
var powerStationSingleLines = rel.data;
countPowerStationSingleLine = powerStationSingleLines.length;
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
powerStationSingleLineCard.empty();
rel.data.forEach(function (value, index) {
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
});
}, 'json');
//#endregion
//#region 預先載入運維人員下拉式選單select_option
var url_user_select_option = "/PowerStation/GetUserSelectOptionList";
$.get(url_user_select_option, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$("#power_station_operation_personnel").empty();
$.each(rel.data, function (index, val) {
$("#power_station_operation_personnel").append($("<option />").val(val.value).text(val.text));
});
if (powerStationData) {
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds);
}
});
$('.js-example-basic-multiple').select2();
//#endregion
//#endregion
//#region Date Picker
datepicker = $('#date-range-record').daterangepicker({ datepicker = $('#date-range-record').daterangepicker({
autoUpdateInput: false, autoUpdateInput: false,
locale: { format: 'YYYY/MM/DD' }, locale: { format: 'YYYY/MM/DD' },
@ -441,7 +491,6 @@
$(this).val(''); $(this).val('');
$(this).trigger('change'); $(this).trigger('change');
}); });
//#endregion //#endregion
//#region 運維作業記錄 DataTable //#region 運維作業記錄 DataTable
@ -540,7 +589,7 @@
} }
} }
}); });
//#endregion //#endregion
//#region 切換電站時,載入該電站運維人員 //#region 切換電站時,載入該電站運維人員
$("#power_station_select_modal").change(function () { $("#power_station_select_modal").change(function () {
@ -866,57 +915,6 @@
} }
//#endregion //#endregion
//#region 載入上傳資料 - 單線圖
var url_image = "/PowerStation/GetAllPowerStationSingleLine";
var send_data = {
powerStationId: stationId
};
$.post(url_image, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
var powerStationSingleLines = rel.data;
countPowerStationSingleLine = powerStationSingleLines.length;
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
powerStationSingleLineCard.empty();
rel.data.forEach(function (value, index) {
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
});
}, 'json');
//#endregion
//#region 預先載入運維人員下拉式選單select_option
var url_user_select_option = "/PowerStation/GetUserSelectOptionList";
$.get(url_user_select_option, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$("#power_station_operation_personnel").empty();
$.each(rel.data, function (index, val) {
$("#power_station_operation_personnel").append($("<option />").val(val.value).text(val.text));
});
if (powerStationData) {
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds);
}
});
$('.js-example-basic-multiple').select2();
//#endregion
//#endregion
})
//#region 設定電站基本資料 //#region 設定電站基本資料
function SetStationInfo() { function SetStationInfo() {
@ -1100,6 +1098,5 @@
dom.find(".carousel-inner").append(carousel_item); dom.find(".carousel-inner").append(carousel_item);
} }
//#endregion //#endregion
})
</script> </script>
} }