7320 lines
202 KiB
JavaScript
7320 lines
202 KiB
JavaScript
var markerList = [];
|
||
var markerLayers = null;
|
||
|
||
var marker141List = [];
|
||
var marker141Layers = null;
|
||
var marker141LayersWithoutCluster = null;
|
||
|
||
var keepChartNum = null;
|
||
|
||
const API_ENDPOINT = "https://141.ir/api";
|
||
const MAP_ENDPOINT = "https://testmap.141.ir";
|
||
const MAP_MIN_ZOOM = 3;
|
||
const MAP_MAX_ZOOM = 15;
|
||
|
||
var routeControlsPath = [];
|
||
var popupArraysPath = [];
|
||
var polylinePath = null;
|
||
const windowWidth = $(window).width();
|
||
var frommDate, tooDate;
|
||
var marematDate, marematCity, marematOffice;
|
||
var imagekol
|
||
|
||
// IRAN bounds, by this order:
|
||
// [North, East]
|
||
// [South, West]
|
||
var bounds = [
|
||
[42.9130026312, 75.6166317076],
|
||
[20.5782370061, 30.5092252948],
|
||
];
|
||
var itempoint = null
|
||
// Create leaflet map client
|
||
var map = L.map("map", {
|
||
maxBounds: bounds,
|
||
minZoom: MAP_MIN_ZOOM,
|
||
//maxZoom: MAP_MAX_ZOOM,
|
||
zoomControl: false,
|
||
}).setView([35.5468992, 51.7300532], 8);
|
||
|
||
// Create map tile layer
|
||
L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map);
|
||
|
||
fisheyeMenu({
|
||
growRatio: 1.7,
|
||
verticalLimit: 10,
|
||
horizontalLimit: 1.8,
|
||
});
|
||
|
||
function fisheyeMenu(options) {
|
||
// get all items from fisheye-menu
|
||
var items = Array.prototype.slice.call(
|
||
document.querySelectorAll(".fisheye-menu button.layerButton")
|
||
);
|
||
var item = items[0];
|
||
//get horizontal center point of each item
|
||
var itemsMiddle = items.map(function (item) {
|
||
return item.offsetLeft + item.offsetWidth / 2;
|
||
});
|
||
//get vertical center point of each item
|
||
var itemsVertMiddle = items.map(function (item) {
|
||
return item.offsetTop + item.offsetHeight / 2;
|
||
});
|
||
|
||
var itemWidth = item.offsetWidth;
|
||
// vertical limits of function running
|
||
var topLimit = item.offsetParent.offsetTop - (options.verticalLimit || 10);
|
||
var bottomLimit =
|
||
item.offsetParent.offsetTop +
|
||
item.offsetHeight +
|
||
(options.verticalLimit || 10);
|
||
// ratio of new size to default
|
||
var growRatio = options.growRatio || 1.8;
|
||
// horizontal limit of grow reaction for single item
|
||
var limit = item.offsetWidth * (options.horizontalLimit || 1.5);
|
||
|
||
var sizeDiff = Math.round(itemWidth * (growRatio - 1));
|
||
|
||
var removeGoDown = function (evt) {
|
||
evt.target.parentNode.classList.remove("go-down");
|
||
};
|
||
var setListeners = (function () {
|
||
items.forEach(function (itm, index) {
|
||
itm.addEventListener("transitionend", removeGoDown);
|
||
});
|
||
})();
|
||
|
||
var makeItemBigger = function (x, y) {
|
||
var verticallyCorrect = y > topLimit && y < bottomLimit ? true : false;
|
||
|
||
// if mouse out from vertically cirrect area make items small with transition
|
||
if (!verticallyCorrect && !item.parentNode.classList.contains("go-down")) {
|
||
item.parentNode.classList.add("go-down");
|
||
}
|
||
|
||
// if (verticallyCorrect) {
|
||
// let menuWidth = $('.menu_vertical').css('width');
|
||
// $('.menu_vertical').css('width', 'calc(' + menuWidth + ' + 50px')
|
||
// }
|
||
|
||
items.forEach(function (item, index) {
|
||
var middlePoint = itemsMiddle[index];
|
||
// horizontal distance from center point to cursor
|
||
var dist = Math.abs(x - middlePoint);
|
||
|
||
// if distance is bigger than limit in any direction
|
||
// ratio is equal to 1 (item size not changed)
|
||
var ratio = dist > limit ? 1 : dist / limit;
|
||
|
||
ratio = verticallyCorrect ? ratio : 1;
|
||
|
||
var newSize = itemWidth + (1 - ratio) * sizeDiff;
|
||
// add negative top margin to item equal to half size difference
|
||
// to stay item vertical centered
|
||
var newMarginTop = -((1 - ratio) * (sizeDiff / 2));
|
||
item.style.width = newSize + "px";
|
||
item.style.height = newSize + "px";
|
||
item.style.marginTop = newMarginTop + "px";
|
||
});
|
||
};
|
||
|
||
document.body.addEventListener("mousemove", function (e) {
|
||
// position of cursor
|
||
var pointerX = e.pageX;
|
||
var pointerY = e.pageY;
|
||
makeItemBigger(pointerX, pointerY);
|
||
});
|
||
}
|
||
function showmodalaccvillage() {
|
||
$("#villageacc_modal").modal("show");
|
||
}
|
||
frommDate = $("#datepickfromdate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
frommDate.touched = true;
|
||
|
||
$('#datepicktodate').prop('disabled', '');
|
||
|
||
if (
|
||
frommDate.getState().selected.unixDate >=
|
||
tooDate.getState().selected.unixDate
|
||
) {
|
||
tooDate.setDate(frommDate.getState().selected.unixDate);
|
||
}
|
||
|
||
if (tooDate && tooDate.options && tooDate.options.minDate != unix) {
|
||
let cachedValue = tooDate.getState().selected.unixDate;
|
||
|
||
tooDate.options = { minDate: unix };
|
||
|
||
if (tooDate.touched) {
|
||
tooDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
tooDate = $("#datepicktodate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
tooDate.touched = true;
|
||
|
||
/*if (fromDate && fromDate.options && fromDate.options.maxDate != unix) {
|
||
|
||
let cachedValue = fromDate.getState().selected.unixDate;
|
||
|
||
fromDate.options = { maxDate: unix };
|
||
|
||
if (fromDate.touched) {
|
||
|
||
fromDate.setDate(cachedValue);
|
||
|
||
}
|
||
|
||
}*/
|
||
},
|
||
});
|
||
|
||
$(".right-menu-toggle").on("click", function () {
|
||
if ($(this).css("right") == "0px") {
|
||
$(".right-menu-charts").css("right", "-60px");
|
||
$(this).css("right", "60px");
|
||
$(this).addClass("hide-menu-toggle");
|
||
$(this)
|
||
.find("i")
|
||
.addClass("fa-arrow-alt-circle-left")
|
||
.removeClass("fa-arrow-alt-circle-right");
|
||
} else {
|
||
$(".right-menu-charts").css("right", "30px");
|
||
$(this).css("right", "0px");
|
||
$(this).removeClass("hide-menu-toggle");
|
||
$(this)
|
||
.find("i")
|
||
.addClass("fa-arrow-alt-circle-right")
|
||
.removeClass("fa-arrow-alt-circle-left");
|
||
}
|
||
});
|
||
|
||
$(".item-menu-chart").on("click", function () {
|
||
let num = parseInt($(this).attr("chartId"));
|
||
|
||
keepChartNum = num;
|
||
|
||
if (!$(this).hasClass("item-menu-chart-disabled")) {
|
||
if ($(this).hasClass("item-menu-active")) {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
} else {
|
||
remove141Layer();
|
||
if ($(".item-menu-chart.item-menu-active").length > 0) {
|
||
handleChartButtonClick(0, this);
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(num);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
} else {
|
||
updateChartBox(num);
|
||
handleChartButtonClick(1, this);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
$(".menu-map-toggle").on("click", function () {
|
||
if ($(this).parent().css("width") == "500px") {
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
}
|
||
);
|
||
} else {
|
||
$(this).parent().css("z-index", "15");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "500",
|
||
height: "480",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").addClass("map-svg-box-open");
|
||
$(this).find(".menu-map-close").show();
|
||
}
|
||
);
|
||
}
|
||
});
|
||
|
||
$(".left-menu-map > .menu-map-close").on("click", function () {
|
||
if ($(this).parent().css("width") == "500px") {
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
}
|
||
);
|
||
}
|
||
});
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-sync-icon").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0, $(".item-menu-chart.item-menu-active"));
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(keepChartNum);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-filter-icon").on(
|
||
"click",
|
||
function () {
|
||
$(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).prop("disabled", "disabled");
|
||
$(".left-menu-view-chart > .chart-view-box").fadeOut(300, function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").fadeIn(300);
|
||
});
|
||
|
||
let fromDate, toDate;
|
||
fromDate = $(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterFromDate]"
|
||
).persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
fromDate.touched = true;
|
||
$(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).prop("disabled", "");
|
||
if (
|
||
fromDate.getState().selected.unixDate >=
|
||
toDate.getState().selected.unixDate
|
||
) {
|
||
toDate.setDate(fromDate.getState().selected.unixDate);
|
||
}
|
||
if (toDate && toDate.options && toDate.options.minDate != unix) {
|
||
let cachedValue = toDate.getState().selected.unixDate;
|
||
toDate.options = { minDate: unix };
|
||
if (toDate.touched) {
|
||
toDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
toDate = $(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
toDate.touched = true;
|
||
/*if (fromDate && fromDate.options && fromDate.options.maxDate != unix) {
|
||
let cachedValue = fromDate.getState().selected.unixDate;
|
||
fromDate.options = { maxDate: unix };
|
||
if (fromDate.touched) {
|
||
fromDate.setDate(cachedValue);
|
||
}
|
||
}*/
|
||
},
|
||
});
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .filter-box-submit > .submit-cancel").on(
|
||
"click",
|
||
function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").fadeOut(300, function () {
|
||
$(".left-menu-view-chart > .chart-view-box").fadeIn(300);
|
||
});
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .filter-box-submit > .submit-send").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0, $(".item-menu-chart.item-menu-active"));
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(keepChartNum);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-close-icon").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
}
|
||
);
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-close").on("click", function () {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
$(".item-menu-141.item-141-active").removeClass("item-141-active");
|
||
setAbrarProcess = 0;
|
||
setBokhorProcess = 0;
|
||
});
|
||
|
||
function handleChartButtonClick(openChart = 1, element = null) {
|
||
if (setAbrarProcess || setBokhorProcess) {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
$(".item-menu-141.item-141-active").removeClass("item-141-active");
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
setAbrarProcess = 0;
|
||
setBokhorProcess = 0;
|
||
$(".menu-stat-list > .stat-list").empty();
|
||
handleChartButtonClickAfterAbrar(openChart, element);
|
||
}, 500);
|
||
} else {
|
||
handleChartButtonClickAfterAbrar(openChart, element);
|
||
}
|
||
}
|
||
|
||
function handleChartButtonClickAfterAbrar(openChart = 1, element = null) {
|
||
if (openChart) {
|
||
if ($(".left-menu-map").css("width") == "500px") {
|
||
$(".left-menu-map").animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-view-chart").css("z-index", "16");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
}
|
||
}
|
||
);
|
||
} else {
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-view-chart").css("z-index", "16");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
}
|
||
}
|
||
} else {
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
$(".item-menu-chart.item-menu-active").removeClass("item-menu-active");
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
remove141Layer();
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
keepMapFeatureColor = null;
|
||
map.flyTo([32.62, 53.25], 6);
|
||
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(".left-menu-view-chart").css("z-index", "12");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
$(".item-menu-chart.item-menu-active").removeClass("item-menu-active");
|
||
}
|
||
setTimeout(function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").hide();
|
||
$(".left-menu-view-chart > .chart-view-box").show();
|
||
}, 500);
|
||
}
|
||
}
|
||
|
||
function emptyStatItems() {
|
||
setTimeout(function () {
|
||
$(".menu-stat-list > .stat-list").empty();
|
||
}, 500);
|
||
}
|
||
|
||
$(".left-menu-141 > .item-menu-141").on("click", function () {
|
||
let get141Id = parseInt($(this).attr("id141"));
|
||
|
||
if (get141Id == 20) {
|
||
window.open("/abrar-projects", "_self");
|
||
}
|
||
|
||
if (get141Id < 13) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
show141Layer(get141Id);
|
||
}, 500);
|
||
} else if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
show141Layer(get141Id);
|
||
}, 500);
|
||
} else {
|
||
show141Layer(get141Id);
|
||
}
|
||
} else {
|
||
$(this).removeClass("item-141-active");
|
||
remove141Layer();
|
||
}
|
||
} else if (get141Id === 13) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
showmodalaccvillage();
|
||
}, 500);
|
||
} else if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
showmodalaccvillage();
|
||
}, 500);
|
||
} else {
|
||
showmodalaccvillage();
|
||
}
|
||
} else {
|
||
$(this).removeClass("item-141-active");
|
||
remove141Layer();
|
||
}
|
||
} else if (get141Id === 14) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
setAbrarProcess = 1;
|
||
removeFeaturesFromMap();
|
||
if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
showAbrarChartStat();
|
||
}, 500);
|
||
} else {
|
||
showAbrarChartStat();
|
||
}
|
||
} else {
|
||
setAbrarProcess = 0;
|
||
$(this).removeClass("item-141-active");
|
||
hideAbrarChartStat();
|
||
}
|
||
} else if (get141Id === 15) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
setBokhorProcess = 1;
|
||
removeFeaturesFromMap();
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
showBokhorChartStat();
|
||
}, 500);
|
||
} else {
|
||
showBokhorChartStat();
|
||
}
|
||
} else {
|
||
setBokhorProcess = 0;
|
||
$(this).removeClass("item-141-active");
|
||
hideBokhorChartStat();
|
||
}
|
||
} else if (get141Id === 16) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
fullCityGeoJSONTemp.features = fullCityGeoJSON.features;
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
addCityFeaturesToMap();
|
||
}, 500);
|
||
} else if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
addCityFeaturesToMap();
|
||
}, 500);
|
||
} else {
|
||
addCityFeaturesToMap();
|
||
}
|
||
} else {
|
||
$(this).removeClass("item-141-active");
|
||
removeCityFeaturesFromMap();
|
||
}
|
||
} else {
|
||
//
|
||
}
|
||
});
|
||
|
||
$("#all_village").on("click", function () {
|
||
$("#villageacc_modal").modal("hide");
|
||
showRoadAccidentLayerWithoutCluster();
|
||
});
|
||
|
||
$("#251_village").on("click", function () {
|
||
$("#villageacc_modal").modal("hide");
|
||
showRoadAccidentLayer251();
|
||
});
|
||
|
||
$("#251_village_edit").on("click", function () {
|
||
window.open("/accident-251-points/edit", "_self");
|
||
});
|
||
function clickfindshow(index) {
|
||
itempoint = index + 1
|
||
// console.log("item", itempoint)
|
||
}
|
||
var showFastReactionPoint = false
|
||
$("#chooseclock").on('click', function () {
|
||
// console.log("hiihii", itempoint)
|
||
$("#choosetime").modal('hide')
|
||
|
||
if ($("#datepickfromdate").val() != " " && $("#datepicktodate").val() != " ") {
|
||
|
||
let startDate = moment(
|
||
frommDate.getState().selected.year +
|
||
"/" +
|
||
frommDate.getState().selected.month +
|
||
"/" +
|
||
frommDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDate = moment(
|
||
tooDate.getState().selected.year +
|
||
"/" +
|
||
tooDate.getState().selected.month +
|
||
"/" +
|
||
tooDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
console.log(startDate)
|
||
console.log(endDate)
|
||
|
||
if (showFastReactionPoint) {
|
||
showFastFunction(startDate, endDate)
|
||
} else {
|
||
showLoaderScreen()
|
||
$.ajax({
|
||
url: "/homeprojects/roaditems/points" + "?item=" + itempoint + "&end-date=" + endDate + "&start-date=" + startDate,
|
||
type: 'GET',
|
||
success: function (result) {
|
||
// console.log("resssss", result.data);
|
||
show_point(result.data)
|
||
|
||
// hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
}
|
||
});
|
||
}
|
||
}
|
||
})
|
||
|
||
function show_point(data) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
// console.log("index", index)
|
||
// console.log("data", data)
|
||
|
||
// marker141Layers = L.markerClusterGroup();
|
||
let markerG = [];
|
||
for (let index = 0; index < data.length; index++) {
|
||
let marker = L.circleMarker(
|
||
[data[index].start_lat, data[index].start_lng],
|
||
{
|
||
color: "#007bff",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}
|
||
)
|
||
.on('click', function (e) {
|
||
$("#datepoint").val(data[index].created_at)
|
||
$("#edarepoint").val(data[index].province_name)
|
||
$("#citypoint").val(data[index].city_name)
|
||
headermodal(data[index].item)
|
||
$("#showpoint").modal('show')
|
||
GenerateTable(data[index].sub_items, data[index].sub_items_data, index)
|
||
show_point_photo(data[index].files)
|
||
// console.log(e)
|
||
})
|
||
markerG.push(marker);
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
}
|
||
function headermodal(item) {
|
||
$("#headerid").empty();
|
||
if (item == 1) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> مرمت رویه </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
}
|
||
else if (item == 2) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> پاکسازی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 3) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> علائم </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 4) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> حفاظ </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 5) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> روشنایی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 6) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> خط کشی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 7) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> رنگ آمیزی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 8) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> شستشو </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 9) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> ایمن سازی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 10) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> حریم </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 11) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> پل </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 12) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> تونل و گالری </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 13) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> عملیات زمستانی </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 14) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> ماشین آلات </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 15) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> راهدارخانه </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
else if (item == 16) {
|
||
$("#headerid").append("<h4 class=\"modal-title\"> موارد اضطراری </h4> <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button >")
|
||
|
||
}
|
||
}
|
||
|
||
function show_point_photo(array) {
|
||
$("#showpicture").empty();
|
||
// console.log("array", array)
|
||
if (array.length > 0) {
|
||
array.forEach(element => $("#showpicture").append('<img class="zoom" src ="' + element + '" >'))
|
||
}
|
||
}
|
||
function subshow(index) {
|
||
if (itempoint == 1) {
|
||
// return index
|
||
if (index == 7) {
|
||
return "روکش"
|
||
}
|
||
if (index == 1) {
|
||
return "ترمیم افتادگی لبه آسفالت"
|
||
}
|
||
if (index == 2) {
|
||
return "شانه سازی"
|
||
}
|
||
if (index == 3) {
|
||
return "پر کردن گودافتادگی یا چاله با آسفالت"
|
||
}
|
||
if (index == 4) {
|
||
return "لکه گیری هندسی راه"
|
||
}
|
||
if (index == 5) {
|
||
return "مرمت آبشستگی راه ها و شانه راه ها"
|
||
}
|
||
if (index == 6) {
|
||
return "تنظیم سطح بستر حریم"
|
||
}
|
||
}
|
||
|
||
else if (itempoint == 2) {
|
||
if (index == 1) {
|
||
return "پاک سازی و جاروزنی سطح راه"
|
||
}
|
||
if (index == 2) {
|
||
return "پاک سازی و تنقیه آبروهای کوچک"
|
||
}
|
||
if (index == 3) {
|
||
return "پاک سازی سطح راه از لاشه حیوانات"
|
||
}
|
||
if (index == 4) {
|
||
return "پاک سازی قنوها و آبروهای طولی"
|
||
}
|
||
if (index == 5) {
|
||
return "پاک سازی سطح راه از آثار تصادفات"
|
||
}
|
||
if (index == 6) {
|
||
return "علف کنی و بوته کنی" + "<br>"
|
||
}
|
||
if (index == 7) {
|
||
return "پاک سازی حریم راه از مواد زائد و نخاله های ساختمانی"
|
||
}
|
||
if (index == 8) {
|
||
return "جمع آوری قطعات آسیب دیده حفاظ، علائم و ..."
|
||
}
|
||
}
|
||
else if (itempoint == 3) {
|
||
if (index == 1) {
|
||
return "نصب تابلوهای اخطاری، انتظامی و مسیرنما"
|
||
}
|
||
if (index == 2) {
|
||
return "نصب تابلوهای اطلاعاتی"
|
||
}
|
||
if (index == 3) {
|
||
return "تعویض شبرنگ تابلوهای اطلاعاتی"
|
||
}
|
||
if (index == 4) {
|
||
return "نصب بازتاب بر روی گاردریل و حفاظ های حاشیه راه و چشم گربه ای"
|
||
}
|
||
}
|
||
else if (itempoint == 4) {
|
||
if (index == 1) {
|
||
return "ارتقای حفاظ میانی راه ها"
|
||
}
|
||
if (index == 2) {
|
||
return "ارتقای حفاظ پل ها و پرتگاه ها" + "<br>"
|
||
}
|
||
if (index == 3) {
|
||
return "بهسازی حفاظ های موجود" + "<br>"
|
||
}
|
||
}
|
||
else if (itempoint == 5) {
|
||
if (index == 1) {
|
||
return "روشنایی طولی راه"
|
||
}
|
||
if (index == 2) {
|
||
return "روشنایی نقطه ای پارکینگ در حاشیه راه"
|
||
}
|
||
if (index == 3) {
|
||
return "روشنایی نقطه ای تقاطع در حاشیه راه"
|
||
}
|
||
if (index == 4) {
|
||
return "روشنایی نقطه ای محل نصب دوربین در حاشیه راه"
|
||
}
|
||
if (index == 5) {
|
||
return "روشنایی طولی نواحی یا گردنه های مه گیر"
|
||
}
|
||
if (index == 6) {
|
||
return "روشنایی تونل"
|
||
}
|
||
}
|
||
else if (itempoint == 6) {
|
||
if (index == 1) {
|
||
return "خط کشی با رنگ گرم ترافیکی"
|
||
}
|
||
if (index == 2) {
|
||
return "خط کشی با رنگ سرد ترافیکی"
|
||
}
|
||
if (index == 3) {
|
||
return "ترسیم نقوش، فلش، خط نوشته و ..."
|
||
}
|
||
}
|
||
else if (itempoint == 7) {
|
||
if (index == 1) {
|
||
return "رنگ آمیزی پایه تابلوها"
|
||
}
|
||
if (index == 2) {
|
||
return "رنگ آمیزی پایه چراغ ها"
|
||
}
|
||
if (index == 3) {
|
||
return "رنگ آمیزی پایه های روشنایی"
|
||
}
|
||
if (index == 4) {
|
||
return "رنگ آمیزی پل های عابر پیاده"
|
||
}
|
||
if (index == 5) {
|
||
return "رنگ آمیزی پایه تابلوهای دروازه ای"
|
||
}
|
||
if (index == 6) {
|
||
return "رنگ آمیزی حفاظ ها"
|
||
}
|
||
}
|
||
else if (itempoint == 8) {
|
||
if (index == 1) {
|
||
return "شستشوی علائم ایمنی اخطاری، انتظامی، مسیرنما و ..."
|
||
}
|
||
if (index == 2) {
|
||
return " شستشوی تابلوهای اطلاعاتی"
|
||
}
|
||
if (index == 3) {
|
||
return " شستشوی جداول"
|
||
}
|
||
if (index == 4) {
|
||
return " شستشوی نیوجرسی ها"
|
||
}
|
||
if (index == 5) {
|
||
return " شستشوی گاردریل ها و هندریل ها"
|
||
}
|
||
if (index == 6) {
|
||
return "شستشوی دیواره تونل ها"
|
||
}
|
||
}
|
||
else if (itempoint == 9) {
|
||
if (index == 1) {
|
||
return "ایمن سازی سرگاردریل، موانع صلب، دماغه ها و موانع صلب"
|
||
}
|
||
if (index == 2) {
|
||
return "ایمن سازی شیب شیروانی ها"
|
||
}
|
||
if (index == 3) {
|
||
return "اجرای استراحتگاه"
|
||
}
|
||
if (index == 4) {
|
||
return "نصب و راه اندازی چراغ های آذرخشی و چشمک زن"
|
||
}
|
||
if (index == 5) {
|
||
return "ایجاد شیراهای لرزاننده طولی"
|
||
}
|
||
if (index == 6) {
|
||
return "ضربه گیر استوانه ای"
|
||
}
|
||
if (index == 7) {
|
||
return "نصب سرعت گیر استاندارد پلاستیکی"
|
||
}
|
||
}
|
||
else if (itempoint == 10) {
|
||
if (index == 1) {
|
||
return "ساخت و ساز"
|
||
}
|
||
if (index == 2) {
|
||
return "عبور تاسیسات زیربنایی"
|
||
}
|
||
if (index == 3) {
|
||
return "راه دسترسی اختصاصی"
|
||
}
|
||
if (index == 4) {
|
||
return "راه دسترسی تجمیع شده"
|
||
}
|
||
}
|
||
else if (itempoint == 11) {
|
||
if (index == 1) {
|
||
return "تعمیرات الواسیون"
|
||
}
|
||
if (index == 2) {
|
||
return "دراواسیون و تنظیم بستر پل های بالای 6 متر"
|
||
}
|
||
if (index == 3) {
|
||
return "احداث رادیه و برید"
|
||
}
|
||
if (index == 4) {
|
||
return "مرمت و بازسازی درز انبساط"
|
||
}
|
||
if (index == 5) {
|
||
return "بازسازی نرده پل"
|
||
}
|
||
}
|
||
else if (itempoint == 12) {
|
||
if (index == 1) {
|
||
return "زهکشی طاق تونل"
|
||
}
|
||
if (index == 2) {
|
||
return "مرمت و بازرسی آبروهای هدایت آب"
|
||
}
|
||
if (index == 3) {
|
||
return "لاینینگ"
|
||
}
|
||
if (index == 4) {
|
||
return "تعمیر و بازسازی گالری"
|
||
}
|
||
if (index == 5) {
|
||
return "گاباریت"
|
||
}
|
||
}
|
||
else if (itempoint == 13) {
|
||
if (index == 1) {
|
||
return "عملیات یخ زدایی با شن و نمک پاشی"
|
||
}
|
||
if (index == 2) {
|
||
return "برف روبی با گریدر یا تیغه برف روب"
|
||
}
|
||
if (index == 3) {
|
||
return "برف روبی با بولدوزر و ماشین برف خور"
|
||
}
|
||
if (index == 4) {
|
||
return "برف روبی در شرایط کولاک و عدم دید"
|
||
}
|
||
if (index == 5) {
|
||
return "میزان نمک مصرفی"
|
||
}
|
||
if (index == 6) {
|
||
return "ریزش برداری"
|
||
}
|
||
if (index == 7) {
|
||
return "مسافرین اسکان داده شده"
|
||
}
|
||
if (index == 8) {
|
||
return "کمک رسانی به خودرو رهاشده"
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 14) {
|
||
if (index == 1) {
|
||
return "بنزین مصرفی کل ماشین آلات فعال"
|
||
}
|
||
if (index == 2) {
|
||
return "گازوئیل مصرفی کل ماشین آلات فعال"
|
||
}
|
||
if (index == 3) {
|
||
return "مواد مصرفی نفتی و انواع روغن"
|
||
}
|
||
if (index == 4) {
|
||
return "بازسازی و راه اندازی ماشین آلات"
|
||
}
|
||
if (index == 5) {
|
||
return "خرید ماشین آلات"
|
||
}
|
||
if (index == 6) {
|
||
return "خرید تجهیزآلات مرتبط به ماشین آلات"
|
||
}
|
||
if (index == 7) {
|
||
return "بازدید کارشناسان از ماشین آلات استان"
|
||
}
|
||
}
|
||
else if (itempoint == 15) {
|
||
if (index == 1) {
|
||
return "راهدارخانه های بازسازی شده"
|
||
}
|
||
if (index == 2) {
|
||
return "خرید تجهیزآلات مرتبط با راهدارخانه ها"
|
||
}
|
||
if (index == 3) {
|
||
return "جلسات تشکیل شده در خصوص مدیریت بحران و پدافند غیرعامل"
|
||
}
|
||
}
|
||
else if (itempoint == 16) {
|
||
if (index == 1) {
|
||
return "پاک سازی سطح راه و رفع انسداد ناشی از ریزش کوه و سقوط بهمن" + "<br>"
|
||
}
|
||
if (index == 2) {
|
||
return "برقراری تردد و رفع انسداد ناشی از وقوع تصادف یا واژگونی وسایط نقلیه و پخش محموله در سطح راه" + "<br>"
|
||
}
|
||
if (index == 3) {
|
||
return "برقراری ارتباط و رفع انسداد ناشی از شن های روان" + "<br>"
|
||
}
|
||
if (index == 4) {
|
||
return "برقراری ارتباط در راه هایی که به دلیل آب بردگی دچار قطع ارتباط شده اند" + "<br>"
|
||
}
|
||
if (index == 5) {
|
||
return "برقراری ارتباط موقت در راه هایی که به دلیل شکستگی پل یا ریزش تونل یا ... قطع شده اند" + "<br>"
|
||
}
|
||
if (index == 6) {
|
||
return "بستن راه و هدایت ترافیکی در مواقع اضطراری" + "<br>"
|
||
}
|
||
}
|
||
|
||
|
||
|
||
}
|
||
function showcount(item, data) {
|
||
if (itempoint == 1) {
|
||
let textfile = ""
|
||
|
||
if (item == 7) {
|
||
|
||
|
||
if ((data['reconstruction7-1-1'] != undefined) && (data['reconstruction7-1-2'] != undefined)) {
|
||
textfile += "روکش آسفالت :" + data['reconstruction7-1-1'] + " " + "کیلومتر " + "تناژ" + " " + data['reconstruction7-1-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-1-1'] != undefined) && (data['reconstruction7-1-2'] == undefined)) {
|
||
textfile += "روکش آسفالت :" + data['reconstruction7-1-1'] + " " + "کیلومتر " + " " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-1-1'] == undefined) && (data['reconstruction7-1-2'] != undefined)) {
|
||
textfile += "روکش آسفالت :" + "تناژ" + " " + data['reconstruction7-1-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-2-1'] != undefined) && (data['reconstruction7-2-2'] != undefined)) {
|
||
textfile += "ماسه آسفالت :" + " " + data['reconstruction7-2-1'] + " " + "کیلومتر " + " " + "تناژ" + " " + data['reconstruction7-2-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-2-1'] != undefined) && (data['reconstruction7-2-2'] == undefined)) {
|
||
textfile += "ماسه آسفالت :" + " " + data['reconstruction7-2-1'] + " " + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-2-1'] == undefined) && (data['reconstruction7-2-2'] != undefined)) {
|
||
textfile += "ماسه آسفالت :" + " " + "تناژ" + data['reconstruction7-1-2'] + " " + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-3-1'] != undefined) && (data['reconstruction7-3-2'] != undefined)) {
|
||
textfile += " باریافت سرد/گرم :" + " " + data['reconstruction7-3-1'] + "کیلومتر " + " " + "تناژ" + " " + data['reconstruction7-3-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-3-1'] != undefined) && (data['reconstruction7-3-2'] == undefined)) {
|
||
textfile += " باریافت سرد/گرم :" + data['reconstruction7-3-1'] + " " + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-3-1'] == undefined) && (data['reconstruction7-3-2'] != undefined)) {
|
||
textfile += " باریافت سرد/گرم :" + "تناژ" + data['reconstruction7-3-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-4-1'] != undefined) && (data['reconstruction7-4-2'] != undefined)) {
|
||
textfile += " میکروسرفیسینگ :" + data['reconstruction7-4-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-4-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-4-1'] != undefined) && (data['reconstruction7-4-2'] == undefined)) {
|
||
textfile += " میکروسرفیسینگ :" + data['reconstruction7-4-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-4-1'] == undefined) && (data['reconstruction7-4-2'] != undefined)) {
|
||
textfile += " میکروسرفیسینگ :" + "تناژ" + data['reconstruction7-4-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-5-1'] != undefined) && (data['reconstruction7-5-2'] != undefined)) {
|
||
textfile += " چیپ سیل" + data['reconstruction7-5-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-5-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-5-1'] != undefined) && (data['reconstruction7-5-2'] == undefined)) {
|
||
textfile += " چیپ سیل" + data['reconstruction7-5-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-5-1'] == undefined) && (data['reconstruction7-5-2'] != undefined)) {
|
||
textfile += " چیپ سیل" + "تناژ" + data['reconstruction7-5-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-6-1'] != undefined) && (data['reconstruction7-6-2'] != undefined)) {
|
||
textfile += " اسلاری سیل" + data['reconstruction7-6-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-6-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-6-1'] != undefined) && (data['reconstruction7-6-2'] == undefined)) {
|
||
textfile += " اسلاری سیل" + data['reconstruction7-6-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-6-1'] == undefined) && (data['reconstruction7-6-2'] != undefined)) {
|
||
textfile += " اسلاری سیل" + "تناژ" + data['reconstruction7-6-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-7-1'] != undefined) && (data['reconstruction7-7-2'] != undefined)) {
|
||
textfile += " اسکراب سیل :" + data['reconstruction7-7-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-7-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-7-1'] != undefined) && (data['reconstruction7-7-2'] == undefined)) {
|
||
textfile += " اسکراب سیل :" + data['reconstruction7-7-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-7-1'] == undefined) && (data['reconstruction7-7-2'] != undefined)) {
|
||
textfile += " اسکراب سیل :" + "تناژ" + data['reconstruction7-7-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-8-1'] != undefined) && (data['reconstruction7-8-2'] != undefined)) {
|
||
textfile += " فوگ سیل :" + data['reconstruction7-8-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-8-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-8-1'] != undefined) && (data['reconstruction7-8-2'] == undefined)) {
|
||
textfile += " فوگ سیل :" + data['reconstruction7-8-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-8-1'] == undefined) && (data['reconstruction7-8-2'] != undefined)) {
|
||
textfile += " فوگ سیل :" + "تناژ" + data['reconstruction7-8-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-9-1'] != undefined) && (data['reconstruction7-9-2'] != undefined)) {
|
||
textfile += " سیل کت :" + data['reconstruction7-9-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-9-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-9-1'] != undefined) && (data['reconstruction7-9-2'] == undefined)) {
|
||
textfile += " سیل کت :" + data['reconstruction7-9-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-9-1'] == undefined) && (data['reconstruction7-9-2'] != undefined)) {
|
||
textfile += " سیل کت :" + "تناژ" + data['reconstruction7-9-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-10-1'] != undefined) && (data['reconstruction7-10-2'] != undefined)) {
|
||
textfile += " کیپ سیل :" + data['reconstruction7-10-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-10-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-10-1'] != undefined) && (data['reconstruction7-10-2'] == undefined)) {
|
||
textfile += " کیپ سیل :" + data['reconstruction7-10-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-10-1'] == undefined) && (data['reconstruction7-10-2'] != undefined)) {
|
||
textfile += " کیپ سیل :" + "تناژ" + data['reconstruction7-10-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
if ((data['reconstruction7-11-1'] != undefined) && (data['reconstruction7-11-2'] != undefined)) {
|
||
textfile += " آسفالت سرد/ردمیکس :" + data['reconstruction7-11-1'] + "کیلومتر " + " " + "تناژ" + data['reconstruction7-11-2'] + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-11-1'] != undefined) && (data['reconstruction7-11-2'] == undefined)) {
|
||
textfile += "آسفالت سرد/ردمیکس :" + data['reconstruction7-11-1'] + "کیلومتر " + "<br>"
|
||
|
||
}
|
||
else if ((data['reconstruction7-11-1'] == undefined) && (data['reconstruction7-11-2'] != undefined)) {
|
||
textfile += " آسفالت سرد/ردمیکس :" + "تناژ" + data['reconstruction7-11-2'] + "<br>"
|
||
|
||
}
|
||
|
||
|
||
|
||
return textfile
|
||
}
|
||
if (item == 1) {
|
||
if (data['reconstruction1-1'] != undefined) {
|
||
|
||
textfile = data['reconstruction1-1'] + "کیلومتر " + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['reconstruction2-1'] != undefined) {
|
||
|
||
textfile = data['reconstruction2-1'] + " تن" + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['reconstruction3-1']) {
|
||
|
||
textfile = data['reconstruction3-1'] + " متر مربع" + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['reconstruction4-1'] != undefined) {
|
||
|
||
textfile = data['reconstruction4-1'] + "متر مکعب " + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['reconstruction5-1'] != undefined) {
|
||
|
||
textfile = data['reconstruction5-1'] + "کیلومتر " + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
|
||
if (item == 6) {
|
||
if (data['reconstruction6-1'] != undefined) {
|
||
|
||
textfile = data['reconstruction6-1'] + "کیلومتر " + "<br>"
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
|
||
return textfile
|
||
}
|
||
}
|
||
else if (itempoint == 2) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['cleaning1-1'] != undefined) {
|
||
|
||
textfile += data['cleaning1-1'] + "کیلومتر-باند" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['cleaning2-1'] != undefined) {
|
||
|
||
textfile += data['cleaning2-1'] + "متر مکعب" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['cleaning3-1'] != undefined) {
|
||
|
||
textfile += data['cleaning3-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['cleaning4-1'] != undefined) {
|
||
|
||
textfile += data['cleaning4-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['cleaning5-1'] != undefined) {
|
||
|
||
textfile += data['cleaning5-1'] + "مترطول-باند" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if (data['cleaning6-1'] != undefined) {
|
||
|
||
textfile += data['cleaning6-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 7) {
|
||
if (data['cleaning7-1'] != undefined) {
|
||
|
||
textfile += data['cleaning7-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 8) {
|
||
if (data['cleaning8-1'] != undefined) {
|
||
|
||
textfile += data['cleaning8-1'] + "تن" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
}
|
||
else if (itempoint == 3) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['signs1-1'] != undefined) {
|
||
|
||
textfile += data['signs1-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['signs2-1'] != undefined) {
|
||
|
||
textfile += data['signs2-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['signs3-1'] != undefined) {
|
||
|
||
textfile += data['signs3-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['signs4-1'] != undefined) {
|
||
|
||
textfile += data['signs4-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
}
|
||
else if (itempoint == 4) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if ((data['shield1-1-1'] != undefined) || (data['shield1-1-2'] != undefined) || (data['shield1-1-3'] != undefined) || (data['shield1-1-4'] != undefined)) {
|
||
if (data['shield1-2-1'] != undefined) {
|
||
textfile += data['shield1-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
|
||
}
|
||
else {
|
||
textfile += data['shield1-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
}
|
||
if (value == 2) {
|
||
if ((data['shield2-1-1'] != undefined) || (data['shield2-1-2'] != undefined) || (data['shield2-1-3'] != undefined) || (data['shield2-1-4'] != undefined)) {
|
||
if (data['shield2-2-1'] != undefined) {
|
||
textfile += data['shield2-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['shield2-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
if (value == 3) {
|
||
if ((data['shield3-1-1'] != undefined) || (data['shield3-1-2'] != undefined) || (data['shield3-1-3'] != undefined) || (data['shield3-1-4'] != undefined)) {
|
||
if (data['shield3-2-1'] != undefined) {
|
||
textfile += data['shield3-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['shield3-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
|
||
|
||
|
||
}
|
||
else if (itempoint == 5) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if ((data['lighting1-1-1'] != undefined) || (data['lighting1-1-2'] != undefined) || (data['lighting1-1-3'] != undefined)) {
|
||
if (data['lighting1-2-1'] != undefined) {
|
||
textfile += data['lighting1-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting1-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if ((data['lighting2-1-1'] != undefined) || (data['lighting2-1-2'] != undefined) || (data['lighting2-1-3'] != undefined)) {
|
||
if (data['lighting2-2-1'] != undefined) {
|
||
|
||
textfile += data['lighting2-2-1'] + "موردی" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting2-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
if (item == 3) {
|
||
if ((data['lighting3-1-1'] != undefined) || (data['lighting3-1-2'] != undefined) || (data['lighting3-1-3'] != undefined)) {
|
||
if (data['lighting3-2-1'] != undefined) {
|
||
textfile += data['lighting3-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting3-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
|
||
}
|
||
if (item == 4) {
|
||
if ((data['lighting4-1-1'] != undefined) || (data['lighting4-1-2'] != undefined) || (data['lighting4-1-3'] != undefined)) {
|
||
if (data['lighting4-2-1'] != undefined) {
|
||
textfile += data['lighting4-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting4-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
if (item == 5) {
|
||
if ((data['lighting5-1-1'] != undefined) || (data['lighting5-1-2'] != undefined) || (data['lighting5-1-3'] != undefined)) {
|
||
if (data['lighting5-2-1'] != undefined) {
|
||
textfile += data['lighting5-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting5-2-1'] + "کیلومتر" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
if (item == 6) {
|
||
if ((data['lighting6-1-1'] != undefined) || (data['lighting6-1-2'] != undefined) || (data['lighting6-1-3'] != undefined)) {
|
||
if (data['lighting6-2-1'] != undefined) {
|
||
textfile += data['lighting6-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
}
|
||
else {
|
||
textfile += data['lighting6-2-1'] + "موردی" + "<br>"
|
||
|
||
}
|
||
return textfile
|
||
|
||
}
|
||
|
||
|
||
|
||
}
|
||
else if (itempoint == 6) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['lining1-1'] != undefined) {
|
||
|
||
textfile += data['lining1-1'] + "کیلومتر-رنگ" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['lining2-1'] != undefined) {
|
||
|
||
textfile += data['lining2-1'] + "کیلومتر-رنگ" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['lining3-1']) {
|
||
|
||
textfile += data['lining3-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 7) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['coloring1-1'] != undefined) {
|
||
|
||
textfile += data['coloring1-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['coloring2-1'] != undefined) {
|
||
|
||
textfile += data['coloring2-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['coloring3-1'] != undefined) {
|
||
|
||
textfile += data['coloring3-1'] + "اصله" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['coloring4-1'] != undefined) {
|
||
|
||
textfile += data['coloring4-1'] + "دستگاه" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['coloring5-1'] != undefined) {
|
||
textfile += data['coloring5-1'] + "تعداد" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if (data['coloring6-1'] != undefined) {
|
||
|
||
textfile += data['coloring6-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 8) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['washing1-1'] != undefined) {
|
||
|
||
textfile += data['washing1-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['washing2-1'] != undefined) {
|
||
|
||
textfile += data['washing2-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['washing3-1'] != undefined) {
|
||
|
||
textfile += data['washing3-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['washing4-1'] != undefined) {
|
||
textfile += data['washing4-1'] + "مترمربع" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['washing5-1'] != undefined) {
|
||
|
||
textfile += data['washing5-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if (data['washing6-1'] != undefined) {
|
||
|
||
textfile += data['washing6-1'] + "مترمربع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 9) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['securing1-1'] != undefined) {
|
||
|
||
textfile += data['securing1-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['securing2-1'] != undefined) {
|
||
|
||
textfile += data['securing2-1'] + "کیلومتر" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['securing3-1'] != undefined) {
|
||
|
||
textfile += data['securing3-1'] + "باب" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['securing4-1'] != undefined) {
|
||
|
||
textfile += data['securing4-1'] + "دستگاه" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['securing5-1'] != undefined) {
|
||
|
||
textfile += data['securing5-1'] + "کیلومتر-شیار" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if (data['securing6-1'] != undefined) {
|
||
|
||
textfile += data['securing6-1'] + "تعداد" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 7) {
|
||
if (data['securing7-1'] != undefined) {
|
||
|
||
textfile += data['securing7-1'] + "طول" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
}
|
||
else if (itempoint == 10) {
|
||
return "_"
|
||
}
|
||
else if (itempoint == 11) {
|
||
return "_"
|
||
}
|
||
else if (itempoint == 12) {
|
||
return "_"
|
||
}
|
||
else if (itempoint == 13) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['winterOperation1-1'] != undefined) {
|
||
textfile += data['winterOperation1-1'] + "کیلومتر-باند" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['winterOperation1-2'] != undefined) {
|
||
textfile += data['winterOperation1-2'] + "کیلومتر-باند" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['winterOperation3-1'] != undefined) {
|
||
textfile += data['winterOperation3-1'] + "کیلومتر-باند" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if (data['winterOperation4-1'] != undefined) {
|
||
textfile += data['winterOperation4-1'] + "کیلومتر-باند" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if (data['winterOperation5-1'] != undefined) {
|
||
textfile += data['winterOperation5-1'] + "تن" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if (data['winterOperation6-1'] != undefined) {
|
||
textfile += data['winterOperation6-1'] + "مقطع" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 7) {
|
||
if (data['winterOperation7-1'] != undefined) {
|
||
textfile += data['winterOperation7-1'] + "تعداد" + "<br>"
|
||
|
||
}
|
||
else textfile = "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 8) {
|
||
if (data['winterOperation8-1'] != undefined) {
|
||
textfile += data['winterOperation8-1'] + "تعداد" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
}
|
||
else if (itempoint == 14) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if (data['machinery1-1'] != undefined) {
|
||
textfile += data['machinery1-1'] + "لیتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if (data['machinery2-1'] != undefined) {
|
||
textfile += data['machinery2-1'] + "لیتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['machinery3-1'] != undefined) {
|
||
textfile += data['machinery3-1'] + "لیتر" + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 4) {
|
||
if ((data['machinery4-1'] != undefined) && (data['machinery4-2'] != undefined)) {
|
||
textfile += data['machinery4-1'] + "تعداد دستگاه" + data['machinery4-2'] + "هزینه" + "<br>"
|
||
|
||
}
|
||
else if ((data['machinery4-1'] != undefined) && (data['machinery4-2'] == undefined)) {
|
||
textfile += data['machinery4-1'] + "تعداد دستگاه" + "<br>"
|
||
}
|
||
else if ((data['machinery4-1'] == undefined) && (data['machinery4-2'] != undefined)) {
|
||
textfile += data['machinery4-2'] + "هزینه" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 5) {
|
||
if ((data['machinery5-1'] != undefined) && (data['machinery5-2'] != undefined)) {
|
||
|
||
textfile += data['machinery5-1'] + "تعداد دستگاه" + data['machinery5-2'] + "نوع کاربری" + "<br>"
|
||
}
|
||
else if ((data['machinery5-1'] != undefined) && (data['machinery5-2'] == undefined)) {
|
||
textfile += data['machinery5-1'] + "تعداد دستگاه" + "<br>"
|
||
}
|
||
else if ((data['machinery5-1'] == undefined) && (data['machinery5-2'] != undefined)) {
|
||
textfile += data['machinery5-2'] + "نوع کاربری " + "<br>"
|
||
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 6) {
|
||
if ((data['machinery6-1'] != undefined) && (data['machinery6-2'] != undefined)) {
|
||
|
||
textfile += data['machinery6-1'] + "تعداد دستگاه" + data['machinery6-2'] + "نوع کاربری" + "<br>"
|
||
}
|
||
else if ((data['machinery6-1'] != undefined) && (data['machinery6-2'] == undefined)) {
|
||
textfile += data['machinery6-1'] + "تعداد دستگاه" + "<br>"
|
||
}
|
||
else if ((data['machinery6-1'] == undefined) && (data['machinery6-2'] != undefined)) {
|
||
textfile += data['machinery6-2'] + "نوع کاربری" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 7) {
|
||
if ((data['machinery7-1'] != undefined) && (data['machinery7-2'] != undefined)) {
|
||
|
||
textfile += data['machinery7-1'] + "تعداد دستگاه" + data['machinery7-2'] + "تعداد بازدید " + "<br>"
|
||
}
|
||
else if ((data['machinery7-1'] != undefined) && (data['machinery7-2'] == undefined)) {
|
||
textfile += data['machinery7-1'] + "تعداد دستگاه" + "<br>"
|
||
}
|
||
else if ((data['machinery7-1'] == undefined) && (data['machinery7-2'] != undefined)) {
|
||
textfile += data['machinery7-2'] + "تعداد بازدید " + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 15) {
|
||
let textfile = ""
|
||
if (item == 1) {
|
||
if ((data['tollhouse1-1'] != undefined) && (data['tollhouse1-2'] != undefined)) {
|
||
|
||
textfile += data['tollhouse1-1'] + "باب" + data['tollhouse1-2'] + "هزینه" + "<br>"
|
||
}
|
||
else if ((data['tollhouse1-1'] != undefined) && (data['tollhouse1-2'] == undefined)) {
|
||
textfile += data['tollhouse1-1'] + "باب" + "<br>"
|
||
}
|
||
else if ((data['tollhouse1-1'] == undefined) && (data['tollhouse1-2'] != undefined)) {
|
||
textfile += data['tollhouse1-2'] + "هزینه" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 2) {
|
||
if ((data['tollhouse2-1'] != undefined) && (data['tollhouse2-2'] != undefined)) {
|
||
|
||
textfile += data['tollhouse2-1'] + "تعداد" + data['tollhouse2-2'] + "نوع" + "<br>"
|
||
}
|
||
else if ((data['tollhouse2-1'] != undefined) && (data['tollhouse2-2'] == undefined)) {
|
||
textfile += data['tollhouse2-1'] + "تعداد" + "<br>"
|
||
}
|
||
else if ((data['tollhouse2-1'] == undefined) && (data['tollhouse2-2'] != undefined)) {
|
||
textfile += data['tollhouse2-2'] + "نوع" + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
if (item == 3) {
|
||
if (data['tollhouse3-1'] != undefined) {
|
||
|
||
textfile += data['tollhouse3-1'] + "<br>"
|
||
}
|
||
else textfile += "_" + "<br>"
|
||
return textfile
|
||
}
|
||
|
||
}
|
||
else if (itempoint == 16) {
|
||
return "_"
|
||
}
|
||
|
||
}
|
||
|
||
function GenerateTable(item, dataitem) {
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = []
|
||
}
|
||
|
||
customers.push(["ردیف", "ریزفعالیت ", "مقدار"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
|
||
customers.push([i + 1, subshow(item[i]), showcount(item[i], dataitem)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%")
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtable");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
function showRoadAccidentLayer251() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
$.get("/accident-251-points", function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (roadAccidentPoints[i].progress == "100") {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
|
||
let marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
$("#pointid").val(datatext.id);
|
||
$("#opration").val(datatext.operation); //oparation
|
||
$("#target").val(datatext.target); //target
|
||
$("#action").val(datatext.actions); //action
|
||
$("#ac-point-lat").val(datatext.lat);
|
||
$("#ac-point-lng").val(datatext.lng);
|
||
valueprogress = datatext.progress;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
//$("#cost").attr('min', datatext.cost);//cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
markerG.push(marker);
|
||
} catch (e) {
|
||
//
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function getPopupContentAccident_251(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccident251PointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function getPopupContentRahdar(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showrahdarModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function showRoadAccidentLayerWithoutCluster() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/accident-points",
|
||
type: "GET",
|
||
success: function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
//console.log(roadAccidentPoints);
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
if (
|
||
roadAccidentPoints[i].progress == "100" ||
|
||
(roadAccidentPoints[i].accident251_point &&
|
||
roadAccidentPoints[i].accident251_point.progress == "100")
|
||
) {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = "#28a745";
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = "#dc3545";
|
||
}
|
||
}
|
||
|
||
try {
|
||
let marker = null;
|
||
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
//console.log(this.options.content)
|
||
let valueprogress = "";
|
||
let contentData = this.options.content;
|
||
$("#allpointid").val(contentData.id);
|
||
|
||
$("#allend-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
if (contentData.accident251_point) {
|
||
$("#alloperation").val(
|
||
contentData.accident251_point.operation
|
||
);
|
||
$("#alltarget").val(contentData.accident251_point.target);
|
||
$("#allaction").val(contentData.accident251_point.actions);
|
||
$("#allcost").val(contentData.accident251_point.cost);
|
||
//$("#allcost").attr('min', contentData.accident251_point.cost);
|
||
$("#allend-date").val(contentData.accident251_point.end_date);
|
||
valueprogress = contentData.accident251_point.progress;
|
||
} else {
|
||
$("#alloperation").val("-");
|
||
$("#alltarget").val("-");
|
||
$("#allaction").val("-");
|
||
$("#allcost").val(contentData.cost);
|
||
$("#allcost").val(contentData.cost);
|
||
//$("#allcost").attr('min', contentData.cost);
|
||
$("#allend-date").val("-");
|
||
valueprogress = contentData.progress;
|
||
}
|
||
|
||
$("#allac-point-lat").val(contentData.lat);
|
||
$("#allac-point-lng").val(contentData.lng);
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="allex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#allsliderphysici").empty();
|
||
|
||
$("#allsliderphysici").append(
|
||
'<label class="allslider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#allsliderphysici").append(test);
|
||
|
||
$(".allex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
} else {
|
||
marker = L.circleMarker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
color: setIcon,
|
||
stroke: false,
|
||
radius: 3,
|
||
fillOpacity: 1,
|
||
}
|
||
).bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
}
|
||
|
||
markerG.push(marker);
|
||
} catch (e) {
|
||
console.log(e);
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
$(".chart-province-item").on("click", function () {
|
||
let provinceId = $(this).attr("provinceId");
|
||
|
||
showProvinceChartBox(this, provinceId);
|
||
});
|
||
|
||
function handleTopMenuClick(num) {
|
||
switch (num) {
|
||
case 1: {
|
||
window.open("rmto", "_self");
|
||
break;
|
||
}
|
||
case 2: {
|
||
$("#reportModal").modal("show");
|
||
break;
|
||
}
|
||
case 3: {
|
||
window.open("rmtobi", "_self");
|
||
break;
|
||
}
|
||
case 4: {
|
||
window.open("rmto", "_self");
|
||
break;
|
||
}
|
||
case 5: {
|
||
if ($(".relatedWebsites").css("left") < "0") {
|
||
if (windowWidth <= 768) {
|
||
$(".relatedWebsites").css("left", "5%");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "30px");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".relatedWebsites").css("z-index", "16");
|
||
}
|
||
} else {
|
||
if (windowWidth <= "768") {
|
||
$(".relatedWebsites").css("left", "-95%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "-530px");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
$(".exitewebsites").on("click", function () {
|
||
if ($(".relatedWebsites").css("left") < "0") {
|
||
if (windowWidth <= 768) {
|
||
$(".relatedWebsites").css("left", "5%");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "30px");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".relatedWebsites").css("z-index", "16");
|
||
}
|
||
} else {
|
||
if (windowWidth <= "768") {
|
||
$(".relatedWebsites").css("left", "-95%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
}
|
||
}
|
||
});
|
||
// --------------------------------------------------------------
|
||
|
||
Chart.defaults.global.defaultFontFamily = "IRANSansFaNum";
|
||
|
||
var chartItemCanvas = $("#myChart");
|
||
var chartItem = null;
|
||
var chartProvinceItemsCanvas = [];
|
||
var chartProvinceItems = [];
|
||
var chartColors = [
|
||
"rgba(255, 99, 132, 0.6)",
|
||
"rgba(54, 162, 235, 0.6)",
|
||
"rgba(255, 206, 86, 0.6)",
|
||
"rgba(75, 192, 192, 0.6)",
|
||
"rgba(153, 102, 255, 0.6)",
|
||
"rgba(255, 159, 64, 0.6)",
|
||
"rgba(255, 64, 159, 0.6)",
|
||
"rgba(159, 255, 64, 0.6)",
|
||
"rgba(255, 64, 255, 0.6)",
|
||
"rgba(159, 159, 64, 0.6)",
|
||
];
|
||
|
||
function randomScalingFactor() {
|
||
return Math.round(Math.random() * 100);
|
||
}
|
||
|
||
function changeChartBoxTitle(str, area = "کل کشور", changeTitle = 1) {
|
||
if (changeTitle) {
|
||
$(".chart-title").text(str + " (" + area + ")");
|
||
} else {
|
||
let boxTitle = $(".chart-title").text();
|
||
boxTitle = boxTitle.substr(0, boxTitle.indexOf("("));
|
||
$(".chart-title").text(boxTitle + "(" + area + ")");
|
||
}
|
||
}
|
||
|
||
function makeConfigChart(num, showDetails) {
|
||
let config = null;
|
||
|
||
switch (num) {
|
||
case 1: {
|
||
config = {
|
||
type: "pie",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [randomScalingFactor(), randomScalingFactor()],
|
||
backgroundColor: [chartColors[0], chartColors[1]],
|
||
label: "Dataset 1",
|
||
},
|
||
],
|
||
labels: ["احداث", "نگه داری"],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راه روستایی");
|
||
break;
|
||
}
|
||
case 2: {
|
||
config = {
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
],
|
||
label: "تفکیک پروژه های راه روستایی",
|
||
},
|
||
],
|
||
labels: ["شریانی", "غیرشریانی", "فرعی", "اصلی", "شریانی-اصلی"],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "right",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
scale: {
|
||
ticks: {
|
||
display: showDetails,
|
||
beginAtZero: true,
|
||
},
|
||
reverse: false,
|
||
},
|
||
animation: {
|
||
animateRotate: false,
|
||
animateScale: true,
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راه روستایی");
|
||
break;
|
||
}
|
||
case 3: {
|
||
config = {
|
||
type: "doughnut",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
chartColors[5],
|
||
chartColors[6],
|
||
chartColors[7],
|
||
],
|
||
label: "تفکیک پروژه های راهداری",
|
||
},
|
||
],
|
||
labels: [
|
||
"پاکسازی",
|
||
"علایم",
|
||
"رنگ آمیزی",
|
||
"حریم",
|
||
"ایمن سازی",
|
||
"راهدار خانه",
|
||
"اضطراری",
|
||
"شستشو",
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "left",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راهداری",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راهداری");
|
||
break;
|
||
}
|
||
case 4: {
|
||
config = {
|
||
type: "line",
|
||
data: {
|
||
labels: ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور"],
|
||
datasets: [
|
||
{
|
||
label: "پیشرفت فیزیکی",
|
||
backgroundColor: chartColors[0],
|
||
borderColor: chartColors[0],
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
fill: false,
|
||
},
|
||
{
|
||
label: "پیشرفت ریالی",
|
||
fill: false,
|
||
backgroundColor: chartColors[1],
|
||
borderColor: chartColors[1],
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "نسبت پیشرفت فیزیکی به ریالی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
mode: "index",
|
||
intersect: false,
|
||
},
|
||
hover: {
|
||
mode: "nearest",
|
||
intersect: true,
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: showDetails,
|
||
scaleLabel: {
|
||
display: showDetails,
|
||
labelString: "ماه",
|
||
},
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: showDetails,
|
||
scaleLabel: {
|
||
display: showDetails,
|
||
labelString: "مقدار",
|
||
},
|
||
},
|
||
],
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("نسبت پیشرفت فیزیکی به ریالی");
|
||
break;
|
||
}
|
||
case 5: {
|
||
config = {
|
||
type: "bar",
|
||
data: {
|
||
labels: ["مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"],
|
||
datasets: [
|
||
{
|
||
label: "راه روستایی",
|
||
backgroundColor: chartColors[0],
|
||
borderColor: chartColors[0],
|
||
borderWidth: 1,
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
{
|
||
label: "راهداری",
|
||
backgroundColor: chartColors[1],
|
||
borderColor: chartColors[1],
|
||
borderWidth: 1,
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "top",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های انجام شده تاکنون",
|
||
position: "bottom",
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: showDetails,
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: showDetails,
|
||
},
|
||
],
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های انجام شده تاکنون");
|
||
break;
|
||
}
|
||
case 6: {
|
||
break;
|
||
}
|
||
case 7: {
|
||
break;
|
||
}
|
||
case 8: {
|
||
break;
|
||
}
|
||
case 9: {
|
||
break;
|
||
}
|
||
case 10: {
|
||
break;
|
||
}
|
||
}
|
||
|
||
return config;
|
||
}
|
||
|
||
function updateChartBox(num) {
|
||
if (chartItem) {
|
||
chartItem.destroy();
|
||
}
|
||
|
||
if (num == 2) {
|
||
chartItem = new Chart.PolarArea(
|
||
chartItemCanvas,
|
||
makeConfigChart(num, true)
|
||
);
|
||
} else {
|
||
chartItem = new Chart(chartItemCanvas, makeConfigChart(num, true));
|
||
}
|
||
|
||
for (let i = 1; i <= 36; i++) {
|
||
if (chartProvinceItems[i]) {
|
||
chartProvinceItems[i].destroy();
|
||
}
|
||
|
||
if (num == 2) {
|
||
chartProvinceItems[i] = new Chart.PolarArea(
|
||
chartProvinceItemsCanvas[i],
|
||
makeConfigChart(num, false)
|
||
);
|
||
} else {
|
||
chartProvinceItems[i] = new Chart(
|
||
chartProvinceItemsCanvas[i],
|
||
makeConfigChart(num, false)
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showProvinceChartBox(element, id) {
|
||
let mainChartDataLength = chartItem.data.datasets[0].data.length;
|
||
let provinceChartData = chartProvinceItems[id].data;
|
||
let countDataset = 0;
|
||
|
||
for (let i = 0; i < mainChartDataLength; i++) {
|
||
chartRemoveData(chartItem);
|
||
}
|
||
|
||
provinceChartData.datasets.forEach((dataset) => {
|
||
for (let i = 0; i < dataset.data.length; i++) {
|
||
chartAddData(chartItem, countDataset, dataset.data[i]);
|
||
}
|
||
countDataset++;
|
||
});
|
||
|
||
changeChartBoxTitle(
|
||
"",
|
||
$(element).find(".chart-province-item-title").text(),
|
||
0
|
||
);
|
||
}
|
||
|
||
function chartAddData(chart, count, data, label) {
|
||
//chart.data.labels.push(label);
|
||
chart.data.datasets[count].data.push(data);
|
||
chart.update();
|
||
}
|
||
|
||
function chartRemoveData(chart) {
|
||
//chart.data.labels.pop();
|
||
chart.data.datasets.forEach((dataset) => {
|
||
dataset.data.pop();
|
||
});
|
||
chart.update();
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
for (let i = 1; i <= 36; i++) {
|
||
chartProvinceItemsCanvas[i] = $("#myChart" + i);
|
||
}
|
||
|
||
initIranGeoJson();
|
||
initCityGeoJson();
|
||
|
||
abrarProvinceNameArray.sort(function (itemA, itemB) {
|
||
return itemB.process - itemA.process;
|
||
});
|
||
|
||
bokhorProvinceNameArray.sort(function (itemA, itemB) {
|
||
return itemB.process - itemA.process;
|
||
});
|
||
|
||
$('#show-maintenance-points').on('click', function () {
|
||
getMaintenanceProjects();
|
||
});
|
||
|
||
//getMaintenanceProjects();
|
||
|
||
showFastReactionCounter()
|
||
});
|
||
|
||
// -----------------------------------------
|
||
|
||
function showFastReactionCounter() {
|
||
$.ajax({
|
||
url: '/webapi/fast-reaction/count',
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
if (result.data > 0) {
|
||
$('#fast-counter').text(result.data)
|
||
$('#fast-counter').show()
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log(error)
|
||
},
|
||
});
|
||
}
|
||
|
||
var iranGeoJSON = null;
|
||
var fullCityGeoJSON = null;
|
||
var fullCityGeoJSONTemp = new Object();
|
||
var iranMapGeo = null;
|
||
var iranCityMapGeo = null;
|
||
var setAbrarProcess = 0;
|
||
var setBokhorProcess = 0;
|
||
var iranNameArray = [];
|
||
var abrarProvinceNameArray = [
|
||
{
|
||
row: 1,
|
||
feature: 0,
|
||
name: "آذربايجان شرقی",
|
||
process: 25,
|
||
},
|
||
{
|
||
row: 2,
|
||
feature: 1,
|
||
name: "آذربايجان غربی",
|
||
process: 28,
|
||
},
|
||
{
|
||
row: 3,
|
||
feature: 2,
|
||
name: "اردبيل",
|
||
process: 29.9,
|
||
},
|
||
{
|
||
row: 4,
|
||
feature: 3,
|
||
name: "اصفهان",
|
||
process: 14.1,
|
||
},
|
||
{
|
||
row: 5,
|
||
feature: 4,
|
||
name: "البرز",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 6,
|
||
feature: 5,
|
||
name: "ايرانشهر",
|
||
process: 7.4,
|
||
},
|
||
{
|
||
row: 7,
|
||
feature: 6,
|
||
name: "ايلام",
|
||
process: 42.1,
|
||
},
|
||
{
|
||
row: 8,
|
||
feature: 7,
|
||
name: "بوشهر",
|
||
process: 12.4,
|
||
},
|
||
{
|
||
row: 9,
|
||
feature: 8,
|
||
name: "تهران",
|
||
process: 18.1,
|
||
},
|
||
{
|
||
row: 10,
|
||
feature: 9,
|
||
name: "چهار محال و بختياری",
|
||
process: 57.8,
|
||
},
|
||
{
|
||
row: 11,
|
||
feature: 10,
|
||
name: "خراسان جنوبی",
|
||
process: 20.8,
|
||
},
|
||
{
|
||
row: 12,
|
||
feature: 11,
|
||
name: "خراسان رضوی",
|
||
process: 9.4,
|
||
},
|
||
{
|
||
row: 13,
|
||
feature: 12,
|
||
name: "خراسان شمالی",
|
||
process: 19.5,
|
||
},
|
||
{
|
||
row: 14,
|
||
feature: 13,
|
||
name: "خوزستان",
|
||
process: 33.6,
|
||
},
|
||
{
|
||
row: 15,
|
||
feature: 14,
|
||
name: "زنجان",
|
||
process: 41,
|
||
},
|
||
{
|
||
row: 16,
|
||
feature: 34,
|
||
name: "سمنان شرق",
|
||
process: 32.7,
|
||
},
|
||
{
|
||
row: 17,
|
||
feature: 33,
|
||
name: "سمنان غرب",
|
||
process: 18.3,
|
||
},
|
||
{
|
||
row: 18,
|
||
feature: 18,
|
||
name: "سيستان و بلوچستان",
|
||
process: 25.5,
|
||
},
|
||
{
|
||
row: 19,
|
||
feature: 16,
|
||
name: "فارس",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 20,
|
||
feature: 17,
|
||
name: "قزوين",
|
||
process: 45.5,
|
||
},
|
||
{
|
||
row: 21,
|
||
feature: 18,
|
||
name: "قم",
|
||
process: 4.7,
|
||
},
|
||
{
|
||
row: 22,
|
||
feature: 19,
|
||
name: "كرمان جنوب",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 23,
|
||
feature: 20,
|
||
name: "كردستان",
|
||
process: 43.3,
|
||
},
|
||
{
|
||
row: 24,
|
||
feature: 21,
|
||
name: "كرمان",
|
||
process: 59.5,
|
||
},
|
||
{
|
||
row: 25,
|
||
feature: 22,
|
||
name: "كرمانشاه",
|
||
process: 41.1,
|
||
},
|
||
{
|
||
row: 26,
|
||
feature: 23,
|
||
name: "كهگيلويه و بويراحمد",
|
||
process: 61.4,
|
||
},
|
||
{
|
||
row: 27,
|
||
feature: 24,
|
||
name: "گلستان",
|
||
process: 16.5,
|
||
},
|
||
{
|
||
row: 28,
|
||
feature: 25,
|
||
name: "گيلان",
|
||
process: 18.4,
|
||
},
|
||
{
|
||
row: 29,
|
||
feature: 26,
|
||
name: "لارستان",
|
||
process: 70.2,
|
||
},
|
||
{
|
||
row: 30,
|
||
feature: 27,
|
||
name: "لرستان",
|
||
process: 40,
|
||
},
|
||
{
|
||
row: 31,
|
||
feature: 28,
|
||
name: "مازندران",
|
||
process: 13.4,
|
||
},
|
||
{
|
||
row: 32,
|
||
feature: 29,
|
||
name: "مركزی",
|
||
process: 45.8,
|
||
},
|
||
{
|
||
row: 33,
|
||
feature: 30,
|
||
name: "هرمزگان",
|
||
process: 23.9,
|
||
},
|
||
{
|
||
row: 34,
|
||
feature: 31,
|
||
name: "همدان",
|
||
process: 36.1,
|
||
},
|
||
{
|
||
row: 35,
|
||
feature: 32,
|
||
name: "يزد",
|
||
process: 33,
|
||
},
|
||
];
|
||
var bokhorProvinceNameArray = [
|
||
{
|
||
row: 1,
|
||
feature: 0,
|
||
name: "آذربايجان شرقی",
|
||
process: 56,
|
||
},
|
||
{
|
||
row: 2,
|
||
feature: 1,
|
||
name: "آذربايجان غربی",
|
||
process: 51,
|
||
},
|
||
{
|
||
row: 3,
|
||
feature: 2,
|
||
name: "اردبيل",
|
||
process: 56,
|
||
},
|
||
{
|
||
row: 4,
|
||
feature: 3,
|
||
name: "اصفهان",
|
||
process: 74,
|
||
},
|
||
{
|
||
row: 5,
|
||
feature: 4,
|
||
name: "البرز",
|
||
process: 74,
|
||
},
|
||
{
|
||
row: 6,
|
||
feature: 5,
|
||
name: "ايرانشهر",
|
||
process: 30,
|
||
},
|
||
{
|
||
row: 7,
|
||
feature: 6,
|
||
name: "ايلام",
|
||
process: 78,
|
||
},
|
||
{
|
||
row: 8,
|
||
feature: 7,
|
||
name: "بوشهر",
|
||
process: 87,
|
||
},
|
||
{
|
||
row: 9,
|
||
feature: 8,
|
||
name: "تهران",
|
||
process: 83,
|
||
},
|
||
{
|
||
row: 10,
|
||
feature: 9,
|
||
name: "چهار محال و بختياری",
|
||
process: 65,
|
||
},
|
||
{
|
||
row: 11,
|
||
feature: 10,
|
||
name: "خراسان جنوبی",
|
||
process: 49,
|
||
},
|
||
{
|
||
row: 12,
|
||
feature: 11,
|
||
name: "خراسان رضوی",
|
||
process: 55,
|
||
},
|
||
{
|
||
row: 13,
|
||
feature: 12,
|
||
name: "خراسان شمالی",
|
||
process: 42,
|
||
},
|
||
{
|
||
row: 14,
|
||
feature: 13,
|
||
name: "خوزستان",
|
||
process: 64,
|
||
},
|
||
{
|
||
row: 15,
|
||
feature: 14,
|
||
name: "زنجان",
|
||
process: 69,
|
||
},
|
||
{
|
||
row: 16,
|
||
feature: 34,
|
||
name: "سمنان شرق",
|
||
process: 54,
|
||
},
|
||
{
|
||
row: 17,
|
||
feature: 33,
|
||
name: "سمنان غرب",
|
||
process: 68,
|
||
},
|
||
{
|
||
row: 18,
|
||
feature: 15,
|
||
name: "سيستان و بلوچستان",
|
||
process: 32,
|
||
},
|
||
{
|
||
row: 19,
|
||
feature: 16,
|
||
name: "فارس",
|
||
process: 57,
|
||
},
|
||
{
|
||
row: 20,
|
||
feature: 17,
|
||
name: "قزوين",
|
||
process: 51,
|
||
},
|
||
{
|
||
row: 21,
|
||
feature: 18,
|
||
name: "قم",
|
||
process: 62,
|
||
},
|
||
{
|
||
row: 22,
|
||
feature: 19,
|
||
name: "كرمان جنوب",
|
||
process: 32,
|
||
},
|
||
{
|
||
row: 23,
|
||
feature: 20,
|
||
name: "كردستان",
|
||
process: 46,
|
||
},
|
||
{
|
||
row: 24,
|
||
feature: 21,
|
||
name: "کرمان",
|
||
process: 42,
|
||
},
|
||
{
|
||
row: 25,
|
||
feature: 22,
|
||
name: "كرمانشاه",
|
||
process: 67,
|
||
},
|
||
{
|
||
row: 26,
|
||
feature: 23,
|
||
name: "كهگيلويه و بويراحمد",
|
||
process: 49,
|
||
},
|
||
{
|
||
row: 27,
|
||
feature: 24,
|
||
name: "گلستان",
|
||
process: 68,
|
||
},
|
||
{
|
||
row: 28,
|
||
feature: 25,
|
||
name: "گيلان",
|
||
process: 55,
|
||
},
|
||
{
|
||
row: 29,
|
||
feature: 26,
|
||
name: "لارستان",
|
||
process: 65,
|
||
},
|
||
{
|
||
row: 30,
|
||
feature: 27,
|
||
name: "لرستان",
|
||
process: 52,
|
||
},
|
||
{
|
||
row: 31,
|
||
feature: 28,
|
||
name: "مازندران",
|
||
process: 55,
|
||
},
|
||
{
|
||
row: 32,
|
||
feature: 29,
|
||
name: "مركزی",
|
||
process: 72,
|
||
},
|
||
{
|
||
row: 33,
|
||
feature: 30,
|
||
name: "هرمزگان",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 34,
|
||
feature: 31,
|
||
name: "همدان",
|
||
process: 81,
|
||
},
|
||
{
|
||
row: 35,
|
||
feature: 32,
|
||
name: "يزد",
|
||
process: 38,
|
||
},
|
||
];
|
||
var iranArrayCount = 0;
|
||
var keepMapFeatureColor = null;
|
||
|
||
function getRandomFeatureColor() {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
let randomNum = Math.floor(Math.random() * 101);
|
||
|
||
return randomNum >= 83
|
||
? { num: randomNum, color: "#a366ff" }
|
||
: // randomNum >= 67 ? { num: randomNum, color: '#80b3ff' } :
|
||
randomNum >= 67
|
||
? { num: randomNum, color: "#2e86ab" }
|
||
: randomNum >= 50
|
||
? { num: randomNum, color: "#66cc66" }
|
||
: randomNum >= 31
|
||
? { num: randomNum, color: "#ffeda0" }
|
||
: // { num: randomNum, color: '#ff704d' };
|
||
{ num: randomNum, color: "#ff3f3f" };
|
||
}
|
||
}
|
||
|
||
function getForArrayFeatureColor(arrayNum) {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
return arrayNum >= 83
|
||
? { num: arrayNum, color: "#a366ff" }
|
||
: arrayNum >= 67
|
||
? { num: arrayNum, color: "#80b3ff" }
|
||
: arrayNum >= 50
|
||
? { num: arrayNum, color: "#66cc66" }
|
||
: arrayNum >= 31
|
||
? { num: arrayNum, color: "#ffeda0" }
|
||
: { num: arrayNum, color: "#ff704d" };
|
||
}
|
||
}
|
||
|
||
function initStyleMapFeatures(feature) {
|
||
let getRandom = null;
|
||
|
||
if (setAbrarProcess) {
|
||
getRandom = getForArrayFeatureColor(
|
||
findFeatureInAbrarItems(iranArrayCount).process
|
||
);
|
||
} else if (setBokhorProcess) {
|
||
getRandom = getForArrayFeatureColor(
|
||
findFeatureInBokhorItems(iranArrayCount).process
|
||
);
|
||
} else {
|
||
getRandom = getRandomFeatureColor();
|
||
}
|
||
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.7,
|
||
};
|
||
|
||
if (getRandom.num != -1) {
|
||
if (iranArrayCount == 35) {
|
||
iranArrayCount = 0;
|
||
}
|
||
|
||
iranNameArray[iranArrayCount] = {
|
||
name: feature.properties.province_name,
|
||
feature: feature.properties.feature_id,
|
||
random: getRandom.num,
|
||
};
|
||
|
||
iranNameArray.sort(function (itemA, itemB) {
|
||
return itemB.random - itemA.random;
|
||
});
|
||
|
||
iranArrayCount++;
|
||
}
|
||
|
||
return makeStyle;
|
||
}
|
||
|
||
function initStyleCityMapFeatures(feature) {
|
||
let getRandom = getRandomFeatureColor();
|
||
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.5,
|
||
};
|
||
|
||
return makeStyle;
|
||
}
|
||
|
||
function highlightMapFeature(e) {
|
||
let featureLayer = null;
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
keepMapFeatureColor = featureLayer.options.fillColor;
|
||
|
||
featureLayer.setStyle({
|
||
weight: 4,
|
||
color: "#666",
|
||
fillOpacity: 0.85,
|
||
});
|
||
|
||
if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
|
||
featureLayer.bringToFront();
|
||
}
|
||
}
|
||
|
||
function resetMapFeatureHighlight(e) {
|
||
let featureLayer = null;
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
iranMapGeo.resetStyle(featureLayer);
|
||
keepMapFeatureColor = null;
|
||
}
|
||
|
||
function zoomMapToFeature(e) {
|
||
let featureLayer = null;
|
||
let featuresLayerCity = [];
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
map.flyToBounds(featureLayer.getBounds());
|
||
|
||
showLoaderScreen();
|
||
removeFeaturesFromMap();
|
||
removeCityFeaturesFromMap();
|
||
fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
|
||
$.each(fullCityGeoJSON.features, function (key, value) {
|
||
if (
|
||
value &&
|
||
featureLayer.feature.properties.province_id ===
|
||
value.properties.province_id
|
||
) {
|
||
featuresLayerCity.push(value);
|
||
} else {
|
||
//
|
||
}
|
||
});
|
||
|
||
setTimeout(function () {
|
||
fullCityGeoJSONTemp.features = featuresLayerCity;
|
||
addCityFeaturesToMap();
|
||
}, 1000);
|
||
|
||
setTimeout(function () {
|
||
hideLoaderScreen();
|
||
}, 1500);
|
||
}
|
||
|
||
function onEachFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
click: zoomMapToFeature,
|
||
});
|
||
}
|
||
|
||
function onEachCityFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
//click: zoomMapToFeature
|
||
});
|
||
}
|
||
|
||
function addTopFeatureToStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text("رتبهبندی ادارات کل");
|
||
|
||
if (!setAbrarProcess && !setBokhorProcess && iranNameArray.length > 0) {
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $(
|
||
'<li class="stat-list-li" indexid="' + i + '"></li>'
|
||
);
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
// statItem.append('<span class="item-rate">' + (i + 1) + '</span>');
|
||
statItem.append(
|
||
'<span class="item-title">' + iranNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' + iranNameArray[i].random + "٪" + "</span>"
|
||
);
|
||
if (iranNameArray[i].random >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (iranNameArray[i].random >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (iranNameArray[i].random >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (iranNameArray[i].random >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", iranNameArray[i].random + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomItemProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
} else {
|
||
setTimeout(function () {
|
||
for (let i = 0; i < 35; i++) {
|
||
statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
// statItem.append('<span class="item-rate">' + (i + 1) + '</span>');
|
||
statItem.append(
|
||
'<span class="item-title">' + iranNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' + iranNameArray[i].random + "٪" + "</span>"
|
||
);
|
||
if (iranNameArray[i].random >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (iranNameArray[i].random >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (iranNameArray[i].random >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (iranNameArray[i].random >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", iranNameArray[i].random + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomItemProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
}, 500);
|
||
}
|
||
}
|
||
|
||
function addFeaturesToMap() {
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
remove141Layer();
|
||
keepMapFeatureColor = null;
|
||
|
||
if (!setAbrarProcess && !setBokhorProcess && iranGeoJSON) {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
} else {
|
||
setTimeout(function () {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
}, 500);
|
||
}
|
||
|
||
map.flyTo([32.62, 53.25], 6);
|
||
}
|
||
|
||
function removeFeaturesFromMap() {
|
||
if (iranMapGeo) {
|
||
map.removeLayer(iranMapGeo);
|
||
//iranMapGeo = null;
|
||
}
|
||
}
|
||
|
||
function addCityFeaturesToMap() {
|
||
remove141Layer();
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
keepMapFeatureColor = null;
|
||
|
||
if (fullCityGeoJSONTemp) {
|
||
iranCityMapGeo = L.geoJson(fullCityGeoJSONTemp, {
|
||
style: initStyleCityMapFeatures,
|
||
onEachFeature: onEachCityFeature,
|
||
});
|
||
iranCityMapGeo.addTo(map);
|
||
}
|
||
}
|
||
|
||
function removeCityFeaturesFromMap() {
|
||
if (iranCityMapGeo) {
|
||
map.removeLayer(iranCityMapGeo);
|
||
//iranCityMapGeo = null;
|
||
}
|
||
}
|
||
|
||
function loadIranGeoJson(callback) {
|
||
showLoaderScreen();
|
||
var xobj = new XMLHttpRequest();
|
||
xobj.overrideMimeType("application/json");
|
||
xobj.open("GET", "https://141.ir/api/provinces35geojson", true);
|
||
xobj.onreadystatechange = function () {
|
||
if (xobj.readyState == 4 && xobj.status == "200") {
|
||
//hideLoaderScreen();
|
||
callback(xobj.responseText);
|
||
}
|
||
};
|
||
xobj.send(null);
|
||
}
|
||
|
||
function loadCityGeoJson(callback) {
|
||
//showLoaderScreen();
|
||
var xobj = new XMLHttpRequest();
|
||
xobj.overrideMimeType("application/json");
|
||
xobj.open("GET", "https://141.ir/api/cities430geojson", true);
|
||
xobj.onreadystatechange = function () {
|
||
if (xobj.readyState == 4 && xobj.status == "200") {
|
||
hideLoaderScreen();
|
||
callback(xobj.responseText);
|
||
}
|
||
};
|
||
xobj.send(null);
|
||
}
|
||
|
||
function initIranGeoJson() {
|
||
loadIranGeoJson(function (response) {
|
||
iranGeoJSON = JSON.parse(response);
|
||
});
|
||
}
|
||
|
||
function initCityGeoJson() {
|
||
loadCityGeoJson(function (response) {
|
||
fullCityGeoJSON = JSON.parse(response);
|
||
});
|
||
}
|
||
|
||
// ------------- Ali ------------------------
|
||
|
||
var provinces = [
|
||
{
|
||
id: 1,
|
||
name: "آذربایجان شرقی",
|
||
lat: 37.9211202,
|
||
lng: 46.6821517,
|
||
},
|
||
{
|
||
id: 2,
|
||
name: "آذربایجان غربی",
|
||
lat: 37.7416484,
|
||
lng: 45.0207638,
|
||
},
|
||
{
|
||
id: 3,
|
||
name: "اردبیل",
|
||
lat: 38.4583983,
|
||
lng: 47.9313001,
|
||
},
|
||
{
|
||
id: 4,
|
||
name: "اصفهان",
|
||
lat: 33.196733,
|
||
lng: 50.7884216,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 33.096733,
|
||
lng: 50.7884216,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 33.396733,
|
||
lng: 50.7884216,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 2,
|
||
lat: 33.196733,
|
||
lng: 50.4884216,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 33.196733,
|
||
lng: 50.8884216,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 33.196733,
|
||
lng: 51.1884216,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 33.496733,
|
||
lng: 50.9884216,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 2,
|
||
lat: 33.696733,
|
||
lng: 50.1884216,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 3,
|
||
lat: 33.296733,
|
||
lng: 51.4884216,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 32,
|
||
name: "البرز",
|
||
lat: 35.996,
|
||
lng: 50.9289,
|
||
},
|
||
{
|
||
id: 5,
|
||
name: "ایلام",
|
||
lat: 33.1545696,
|
||
lng: 46.7576343,
|
||
},
|
||
{
|
||
id: 6,
|
||
name: "بوشهر",
|
||
lat: 28.8936645,
|
||
lng: 51.3204877,
|
||
},
|
||
{
|
||
id: 7,
|
||
name: "تهران",
|
||
lat: 35.5021945,
|
||
lng: 51.3269098,
|
||
},
|
||
{
|
||
id: 8,
|
||
name: "چهارمحال و بختیاری",
|
||
lat: 32.0163307,
|
||
lng: 50.685709,
|
||
},
|
||
{
|
||
id: 29,
|
||
name: "خراسان جنوبی",
|
||
lat: 33.0006776,
|
||
lng: 58.3262335,
|
||
},
|
||
{
|
||
id: 30,
|
||
name: "خراسان رضوی",
|
||
lat: 35.756361,
|
||
lng: 59.1280992,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 35.756361,
|
||
lng: 59.1280992,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 36.756361,
|
||
lng: 59.3280992,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 35.456361,
|
||
lng: 60.1280992,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 35.956361,
|
||
lng: 60.5280992,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 34.156361,
|
||
lng: 60.5280992,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 34.756361,
|
||
lng: 59.6280992,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 1,
|
||
lat: 34.156361,
|
||
lng: 58.6280992,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 2,
|
||
lat: 35.156361,
|
||
lng: 58.4280992,
|
||
},
|
||
{
|
||
id: 9,
|
||
type: 2,
|
||
lat: 36.056361,
|
||
lng: 58.1280992,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 31,
|
||
name: "خراسان شمالی",
|
||
lat: 37.5378855,
|
||
lng: 56.9526137,
|
||
},
|
||
{
|
||
id: 10,
|
||
name: "خوزستان",
|
||
lat: 31.5535141,
|
||
lng: 49.0077168,
|
||
},
|
||
{
|
||
id: 11,
|
||
name: "زنجان",
|
||
lat: 36.515854,
|
||
lng: 48.4777616,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 36.515854,
|
||
lng: 48.4777616,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 35.415854,
|
||
lng: 47.5777616,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 2,
|
||
lat: 37.315854,
|
||
lng: 48.3777616,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 4,
|
||
lat: 36.915854,
|
||
lng: 48.5777616,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 2,
|
||
lat: 37.115854,
|
||
lng: 49.4777616,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 12,
|
||
name: "سمنان",
|
||
lat: 35.4380386,
|
||
lng: 54.8626294,
|
||
},
|
||
{
|
||
id: 13,
|
||
name: "سیستان و بلوچستان",
|
||
lat: 28.1292481,
|
||
lng: 60.8236848,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 29.1292481,
|
||
lng: 60.8236848,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 28.1292481,
|
||
lng: 61.8236848,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 27.1292481,
|
||
lng: 61.8236848,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 28.1292481,
|
||
lng: 59.8236848,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 30.1292481,
|
||
lng: 60.4236848,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 31.1292481,
|
||
lng: 61.4236848,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 4,
|
||
lat: 27.7292481,
|
||
lng: 60.8236848,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 2,
|
||
lat: 27.1292481,
|
||
lng: 59.2236848,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 14,
|
||
name: "فارس",
|
||
lat: 29.299051,
|
||
lng: 53.218456,
|
||
},
|
||
{
|
||
id: 28,
|
||
name: "قزوین",
|
||
lat: 36.0156291,
|
||
lng: 49.8398161,
|
||
},
|
||
{
|
||
id: 26,
|
||
name: "قم",
|
||
lat: 34.7191915,
|
||
lng: 51.0122844,
|
||
},
|
||
{
|
||
id: 16,
|
||
name: "کردستان",
|
||
lat: 35.672803,
|
||
lng: 47.0124376,
|
||
},
|
||
{
|
||
id: 15,
|
||
name: "کرمان",
|
||
lat: 29.571858,
|
||
lng: 57.301047,
|
||
},
|
||
{
|
||
id: 17,
|
||
name: "کرمانشاه",
|
||
lat: 34.3789744,
|
||
lng: 46.7010122,
|
||
},
|
||
{
|
||
id: 18,
|
||
name: "کهگیلویه و بویراحمد",
|
||
lat: 30.8143476,
|
||
lng: 50.8661454,
|
||
},
|
||
{
|
||
id: 27,
|
||
name: "گلستان",
|
||
lat: 37.1984436,
|
||
lng: 55.070672,
|
||
},
|
||
{
|
||
id: 19,
|
||
name: "گیلان",
|
||
lat: 37.5115476,
|
||
lng: 49.3554429,
|
||
},
|
||
{
|
||
id: 20,
|
||
name: "لرستان",
|
||
lat: 33.5372643,
|
||
lng: 48.2435197,
|
||
},
|
||
{
|
||
id: 21,
|
||
name: "مازندران",
|
||
lat: 36.3159159,
|
||
lng: 51.8968597,
|
||
},
|
||
{
|
||
id: 22,
|
||
name: "مرکزی",
|
||
lat: 34.5302705,
|
||
lng: 49.7864561,
|
||
},
|
||
{
|
||
id: 23,
|
||
name: "هرمزگان",
|
||
lat: 27.7198095,
|
||
lng: 56.335807,
|
||
},
|
||
{
|
||
id: 24,
|
||
name: "همدان",
|
||
lat: 34.973321,
|
||
lng: 48.6555779,
|
||
},
|
||
{
|
||
id: 25,
|
||
name: "یزد",
|
||
lat: 32.2452686,
|
||
lng: 55.105172,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 32.1452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 31.8452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 31.8452686,
|
||
lng: 55.405172,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 31.6452686,
|
||
lng: 55.605172,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 2,
|
||
lat: 32.3452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 3,
|
||
lat: 32.9452686,
|
||
lng: 55.105172,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 3,
|
||
lat: 33.2452686,
|
||
lng: 55.905172,
|
||
},
|
||
],
|
||
},
|
||
];
|
||
|
||
$("svg #iran polygon").on("click", function () {
|
||
if ($(".left-menu-map").css("width") == "500px") {
|
||
let selectedProvince = provinces.find(
|
||
(entry) => entry.id == parseInt(this.id.substring(3))
|
||
);
|
||
|
||
// areaChart = new Chart(areaChartCanvas, {
|
||
// type: 'line',
|
||
// data: areaChartData2,
|
||
// options: areaChartOptions
|
||
// });
|
||
|
||
// let numberOfProjects = $('.numberOfProjects');
|
||
// let numberOfActiveProjects = $('#numberOfActiveProjects');
|
||
// let numberOfOpenedProjects = $('#numberOfOpenedProjects');
|
||
// let numberOfFinishedProjects = $('#numberOfFinishedProjects');
|
||
// let numberOfStoppedProjects = $('#numberOfStoppedProjects');
|
||
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 700 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 400 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfActiveProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 250 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfOpenedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 100 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfFinishedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 50) }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfStoppedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
|
||
map.removeLayer(markerLayers);
|
||
|
||
map.flyTo([selectedProvince.lat, selectedProvince.lng], 9);
|
||
|
||
for (
|
||
let index = 0;
|
||
index < selectedProvince.projectCoordinates.length;
|
||
index++
|
||
) {
|
||
switch (selectedProvince.projectCoordinates[index].type) {
|
||
case 1: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: blueIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 2: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: greenIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 3: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: yellowIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 4: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: redIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
function showpassmodal() {
|
||
$("#changepass").modal("show");
|
||
}
|
||
|
||
// Project icons
|
||
var rahdariIconY = L.icon({
|
||
iconUrl: "./dist/images/icons/tollHouse_pin.png",
|
||
iconSize: [26, 26],
|
||
});
|
||
var rahdariIconO = L.icon({
|
||
iconUrl: "./dist/images/icons/tollHouseO_pin.png",
|
||
iconSize: [28, 28],
|
||
});
|
||
var blueIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var greenIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var yellowIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-yellow'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var redIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-red'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
|
||
var redIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-red-fix'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
|
||
var greenIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green-fix'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
function getPopupContent(type) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
operationType +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
getProjectStatus(type) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
selectedProvince +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
|
||
function getPopupContentAccident(data, edit_id) {
|
||
let popupTitle251 = "";
|
||
|
||
if (data.accident251_point) {
|
||
popupTitle251 = " (اولویت ۲۵۱ نقطه)";
|
||
}
|
||
|
||
if (edit_id == data.province_id) {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
} else {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
}
|
||
function getProjectStatus(type) {
|
||
switch (type) {
|
||
case 1:
|
||
return "فعال";
|
||
case 2:
|
||
return "افتتاح شده";
|
||
case 3:
|
||
return "خاتمه یافته";
|
||
case 4:
|
||
return "متوقف شده";
|
||
}
|
||
}
|
||
|
||
function getProjectProgress() {
|
||
let percentage = Math.floor(Math.random() * 100) + 1; // returns a random integer from 0 to 99 + 1
|
||
return percentage;
|
||
}
|
||
|
||
function getParameterByName(name) {
|
||
let url = window.location.href;
|
||
name = name.replace(/[\[\]]/g, "\\$&");
|
||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||
results = regex.exec(url);
|
||
if (!results) return null;
|
||
if (!results[2]) return "";
|
||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||
}
|
||
|
||
if (getParameterByName("operationType")) {
|
||
var operationType = getParameterByName("operationType");
|
||
var projectStatus = getParameterByName("projectStatus");
|
||
var selectedProvince = getParameterByName("selectedProvince");
|
||
var selectedTown = getParameterByName("selectedTown");
|
||
var sourceLat = getParameterByName("sourceLat");
|
||
var sourceLng = getParameterByName("sourceLng");
|
||
|
||
L.marker([sourceLat, sourceLng], { icon: greenIcon })
|
||
.bindPopup(getPopupContent(returnOperationType(projectStatus)), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
}
|
||
|
||
function returnOperationType(status) {
|
||
switch (status) {
|
||
case "فعال": {
|
||
return 1;
|
||
}
|
||
case "متوقف": {
|
||
return 4;
|
||
}
|
||
case "خاتمهیافته": {
|
||
return 3;
|
||
}
|
||
}
|
||
}
|
||
|
||
function getCustomPopupContent(data, type) {
|
||
if (type == 1) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
generateRandom(1) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
generateRandom(2) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
returnProvinceString(data.ProvinceID) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
generateRandom(1) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
generateRandom(2) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
data +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function generateRandom(index) {
|
||
switch (index) {
|
||
case 1: {
|
||
// Operation Type
|
||
let randomNumber = Math.floor(Math.random() * 2) + 1; // 1 or 2
|
||
if (randomNumber == 1) return "احداث";
|
||
else return "نگهداری";
|
||
}
|
||
case 2: {
|
||
// Project Status
|
||
let randomNumber = Math.floor(Math.random() * 3) + 1; // 1, 2, or 3
|
||
switch (randomNumber) {
|
||
case 1:
|
||
return "فعال";
|
||
case 2:
|
||
return "متوقف";
|
||
case 3:
|
||
return "خاتمه یافته";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function returnProvinceString(provinceId) {
|
||
switch (provinceId) {
|
||
case "1":
|
||
return "مازندران";
|
||
case "2":
|
||
return "تهران";
|
||
case "3":
|
||
return "فارس";
|
||
case "4":
|
||
return "خراسان رضوی";
|
||
case "5":
|
||
return "آذربایجان غربی";
|
||
case "6":
|
||
return "آذربایجان شرقی";
|
||
case "7":
|
||
return "اردبیل";
|
||
case "8":
|
||
return "گیلان";
|
||
case "9":
|
||
return "زنجان";
|
||
case "10":
|
||
return "کردستان";
|
||
case "11":
|
||
return "کرمانشاه";
|
||
case "12":
|
||
return "همدان";
|
||
case "13":
|
||
return "قزوین";
|
||
case "14":
|
||
return "البرز";
|
||
case "15":
|
||
return "گلستان";
|
||
case "16":
|
||
return "خراسان شمالی";
|
||
case "17":
|
||
return "سمنان";
|
||
case "18":
|
||
return "قم";
|
||
case "19":
|
||
return "مرکزی";
|
||
case "20":
|
||
return "لرستان";
|
||
case "21":
|
||
return "ایلام";
|
||
case "22":
|
||
return "اصفهان";
|
||
case "23":
|
||
return "یزد";
|
||
case "24":
|
||
return "خراسان جنوبی";
|
||
case "25":
|
||
return "چهارمحال و بختیاری";
|
||
case "26":
|
||
return "خوزستان";
|
||
case "27":
|
||
return "کهگیلویه و بویر احمد";
|
||
case "28":
|
||
return "بوشهر";
|
||
case "29":
|
||
return "کرمان";
|
||
case "30":
|
||
return "سیستان و بلوچستان";
|
||
case "31":
|
||
return "هرمزگان";
|
||
}
|
||
}
|
||
function showlayer(index) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
//showLoaderScreen();
|
||
|
||
switch (index) {
|
||
case 0: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
break;
|
||
}
|
||
case 1: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 2: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 3: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 4: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 5: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 6: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 7: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 8: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 9: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 10: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 11: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 12: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 13: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 14: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 15: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 16: {
|
||
$("#choosetime").modal('show')
|
||
clickfindshow(index)
|
||
|
||
break;
|
||
}
|
||
case 17: {
|
||
$("#choosetime").modal('show')
|
||
showFastReactionPoint = true
|
||
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
// function showLayer(index) {
|
||
// if (markerLayers != null) {
|
||
// map.removeLayer(markerLayers);
|
||
// }
|
||
|
||
// switch (index) {
|
||
// case 0: {
|
||
// $("#choosetime").modal('show')
|
||
// break;
|
||
// }
|
||
// case 1: {
|
||
// $.post("https://141.ir/api/roadoperation", function (data) {
|
||
// markerLayers = L.markerClusterGroup({ disableClusteringAtZoom: 5 });
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// break;
|
||
// }
|
||
// case 2: {
|
||
// $.post("https://141.ir/api/roadaccident", function (data) {
|
||
// markerLayers = L.markerClusterGroup({ disableClusteringAtZoom: 5 });
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// break;
|
||
// }
|
||
// case 3: {
|
||
// $.post("https://141.ir/api/weather", function (data) {
|
||
// markerLayers = L.markerClusterGroup();
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// }
|
||
// }
|
||
// }
|
||
|
||
// ------------- Ali End ------------------------
|
||
|
||
function showLoaderScreen() {
|
||
$(".starter-loader-container").css("display", "flex").hide().fadeIn();
|
||
}
|
||
|
||
function hideLoaderScreen() {
|
||
$(".starter-loader-container").fadeOut();
|
||
}
|
||
|
||
function show141Layer(index) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
switch (index) {
|
||
case 0: {
|
||
$.post(API_ENDPOINT + "/camera", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("دوربین: " + data[i].Title);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 1: {
|
||
$.post(API_ENDPOINT + "/otfapi", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("ترددشمار: " + data[i].m_n);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 2: {
|
||
$.post(API_ENDPOINT + "/roadoperation", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("کارگاه: " + data[i].OperationName);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 3: {
|
||
$.post(API_ENDPOINT + "/roadblock", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("انسداد: " + data[i].Title);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 4: {
|
||
$.post(API_ENDPOINT + "/emdad", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.ikco.length; i++) {
|
||
let marker = L.marker([data.ikco[i].lat, data.ikco[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("امداد فنی: " + data.ikco[i].onvan);
|
||
marker141List.push(marker);
|
||
}
|
||
for (let i = 0; i < data.saipa.length; i++) {
|
||
let marker = L.marker([data.saipa[i].lat, data.saipa[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("امداد فنی");
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 5: {
|
||
$.post(API_ENDPOINT + "/weather", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("آب و هوا: " + data[i].Station_Name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 6: {
|
||
$.post(API_ENDPOINT + "/gasstation", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("جایگاه سوخت: " + data[i].station_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 7: {
|
||
$.post(API_ENDPOINT + "/complex", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("خدمات رفاهی: " + data[i].complex_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 8: {
|
||
$.post(API_ENDPOINT + "/mosque", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("نمازخانه: " + data[i].mosque_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 9: {
|
||
$.post(API_ENDPOINT + "/roadaccident", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("تصادفات: " + data[i].CollisionTypeTitle);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 10: {
|
||
$.get("/rahdari-points", function (result) {
|
||
data = result.data;
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (result.edit_id == data[i].province_id) {
|
||
setIcon = rahdariIconO;
|
||
} else {
|
||
setIcon = rahdariIconY;
|
||
}
|
||
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0"
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (result.edit_id == data[i].province_id) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 11: {
|
||
$.post(API_ENDPOINT + "/hospital", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("خدمات درمانی: " + data[i].hos_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 12: {
|
||
$.post(API_ENDPOINT + "/repair", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("تعمیرگاه: " + data[i].repair_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
function remove141Layer() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
}
|
||
|
||
function showAbrarChartStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text(
|
||
"پیشرفت فیزیکی پروژههای طرح ابرار"
|
||
);
|
||
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
statItem.append(
|
||
'<span class="item-title">' + abrarProvinceNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
abrarProvinceNameArray[i].process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (abrarProvinceNameArray[i].process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (abrarProvinceNameArray[i].process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (abrarProvinceNameArray[i].process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (abrarProvinceNameArray[i].process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", abrarProvinceNameArray[i].process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showAbrarProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showAbrarProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomAbrarProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
|
||
handleAbrarButtonClick(1);
|
||
addFeaturesToMap();
|
||
}
|
||
|
||
function hideAbrarChartStat() {
|
||
handleAbrarButtonClick(0);
|
||
}
|
||
|
||
function handleAbrarButtonClick(openStat = 1) {
|
||
if (openStat) {
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-stat-chart-info").css("top", "88px");
|
||
} else {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
removeFeaturesFromMap();
|
||
}
|
||
}
|
||
|
||
function findFeatureInAbrarItems(featureRow) {
|
||
for (let i = 0; i < 35; i++) {
|
||
if (abrarProvinceNameArray[i].feature == featureRow) {
|
||
return abrarProvinceNameArray[i];
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
// -----------------------------------------------------------------------
|
||
|
||
function showBokhorChartStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text(
|
||
"برخورداری راههای روستایی آسفالته کشور"
|
||
);
|
||
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
statItem.append(
|
||
'<span class="item-title">' + bokhorProvinceNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
bokhorProvinceNameArray[i].process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (bokhorProvinceNameArray[i].process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (bokhorProvinceNameArray[i].process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (bokhorProvinceNameArray[i].process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (bokhorProvinceNameArray[i].process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", bokhorProvinceNameArray[i].process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomBokhorProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
|
||
handleBokhorButtonClick(1);
|
||
addFeaturesToMap();
|
||
}
|
||
|
||
function hideBokhorChartStat() {
|
||
handleBokhorButtonClick(0);
|
||
}
|
||
|
||
function handleBokhorButtonClick(openStat = 1) {
|
||
if (openStat) {
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-stat-chart-info").css("top", "88px");
|
||
} else {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
removeFeaturesFromMap();
|
||
}
|
||
}
|
||
|
||
function findFeatureInBokhorItems(featureRow) {
|
||
for (let i = 0; i < 35; i++) {
|
||
if (bokhorProvinceNameArray[i].feature == featureRow) {
|
||
return bokhorProvinceNameArray[i];
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
function showItemProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (iranNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[iranNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
if (featureItem) {
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showAbrarProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (abrarProvinceNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[abrarProvinceNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
$(".menu-stat-info-title").text(abrarProvinceNameArray[index].name);
|
||
$(".menu-stat-info-content").empty();
|
||
$(".menu-stat-info-content").text(abrarProvinceNameArray[index].process);
|
||
if (featureItem) {
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
$(".menu-stat-info-title").text("اطلاعات بیشتر");
|
||
$(".menu-stat-info-content")
|
||
.empty()
|
||
.append(
|
||
"<span>برای نمایش اطلاعات هر بخش بر روی نقشه یا نمودار آماری آن حرکت کنید.</span>"
|
||
);
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showBokhorProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (bokhorProvinceNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[bokhorProvinceNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
$(".menu-stat-info-title").text(bokhorProvinceNameArray[index].name);
|
||
$(".menu-stat-info-content").empty();
|
||
$(".menu-stat-info-content").text(bokhorProvinceNameArray[index].process);
|
||
if (featureItem) {
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
$(".menu-stat-info-title").text("اطلاعات بیشتر");
|
||
$(".menu-stat-info-content")
|
||
.empty()
|
||
.append(
|
||
"<span>برای نمایش اطلاعات هر بخش بر روی نقشه یا نمودار آماری آن حرکت کنید.</span>"
|
||
);
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
|
||
function zoomItemProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (iranNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[iranNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function zoomAbrarProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (abrarProvinceNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[abrarProvinceNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function zoomBokhorProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (bokhorProvinceNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[bokhorProvinceNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function showrahdarModal() {
|
||
$("#rahdaredit").modal("show");
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
|
||
$("#editrahdar").on("click", function () {
|
||
saveRahdariEdited();
|
||
});
|
||
|
||
function showRahdariPoints() {
|
||
remove141Layer();
|
||
//showLoaderScreen();
|
||
|
||
$.get("/rahdari-points", function (result) {
|
||
data = result.data;
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (result.edit_id == data[i].province_id) {
|
||
setIcon = rahdariIconO;
|
||
} else {
|
||
setIcon = rahdariIconY;
|
||
}
|
||
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0"
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (result.edit_id == data[i].province_id) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function showAccidentPointEditModal() {
|
||
$("#allpointedit").modal("show");
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
|
||
function showAccident251PointEditModal() {
|
||
$("#pointedit").modal("show");
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
|
||
$("#alleditpoints").on("click", function () {
|
||
saveAccidentEditedPoint();
|
||
});
|
||
|
||
$("#editpoints").on("click", function () {
|
||
saveEditedPoint();
|
||
});
|
||
|
||
function saveAccidentEditedPointOld() {
|
||
$("#allpointedit").modal("hide");
|
||
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/accident-points/" + $("#allpointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
//data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function saveAccidentEditedPoint() {
|
||
if (accidentEditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("operation", $("#alloperation").val());
|
||
formData.append("target", $("#alltarget").val());
|
||
formData.append("actions", $("#allaction").val());
|
||
formData.append("progress", $(".allex2").slider("getValue"));
|
||
formData.append("cost", $("#allcost").val());
|
||
formData.append("end_date", $("#allend-date").val());
|
||
|
||
let lat = $("#allac-point-lat").val().slice(1, -1);
|
||
let lng = $("#allac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=allmodalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=allmodalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
//if ($('.allex2').slider('getValue') >= $('.allex2').attr('data-slider-value')) {
|
||
$("#allpointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-points/" + $("#allpointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showRoadAccidentLayerWithoutCluster();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
/*} else {
|
||
$('#allsliderphysici').find('.allslider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
||
$('#allsliderphysici').find('.allslider-label').css('color', 'red');
|
||
}*/
|
||
}
|
||
}
|
||
|
||
function accidentEditedPointValidate() {
|
||
let isValidate = true;
|
||
|
||
if (
|
||
!$("#alloperation").val() ||
|
||
!checkPersianWordValidation($("#alloperation").val())
|
||
) {
|
||
$("#alloperation").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alloperation").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#alltarget").val() ||
|
||
!checkPersianWordValidation($("#alltarget").val())
|
||
) {
|
||
$("#alltarget").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alltarget").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#allaction").val() ||
|
||
!checkPersianWordValidation($("#allaction").val())
|
||
) {
|
||
$("#allaction").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allaction").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allcost").val()) {
|
||
$("#allcost").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allcost").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allend-date").val()) {
|
||
$("#allend-date").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allend-date").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lat").val()) {
|
||
$("#allac-point-lat").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lat").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lng").val()) {
|
||
$("#allac-point-lng").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lng").removeClass("is-invalid");
|
||
}
|
||
|
||
return isValidate;
|
||
}
|
||
|
||
function showAccident251Points() {
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
|
||
$.get("/accident-251-points", function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (roadAccidentPoints[i].progress == "100") {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
|
||
let marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
|
||
$("#pointid").val(datatext.id);
|
||
$("#opration").val(datatext.operation); //oparation
|
||
$("#target").val(datatext.target); //target
|
||
$("#action").val(datatext.actions); //action
|
||
$("#ac-point-lat").val(datatext.lat);
|
||
$("#ac-point-lng").val(datatext.lng);
|
||
valueprogress = datatext.progress;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
//$("#cost").attr('min', datatext.cost);//cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
markerG.push(marker);
|
||
} catch (e) { }
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function rahdariEditedValidate() {
|
||
let checkValidation = true;
|
||
|
||
if (!$("#sit").val() || !checkPersianWordValidation($("#sit").val())) {
|
||
$("#sit").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#sit").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#type").val() || !checkPersianWordValidation($("#type").val())) {
|
||
$("#type").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#type").removeClass("is-invalid");
|
||
}
|
||
|
||
if ($("#phone").val()) {
|
||
let reg = /^([0-9]|[۰-۹])+$/;
|
||
|
||
if (!reg.test($("#phone").val())) {
|
||
$("#phone").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#phone").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#masol").val()) {
|
||
if (!checkPersianWordValidation($("#masol").val())) {
|
||
$("#masol").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#masol").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#janeshin").val()) {
|
||
if (!checkPersianWordValidation($("#janeshin").val())) {
|
||
$("#janeshin").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#janeshin").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#masolmobile").val()) {
|
||
let reg = /^09([0-9]){9}$/;
|
||
|
||
if (!reg.test($("#masolmobile").val())) {
|
||
$("#masolmobile").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#masolmobile").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#janeshinmobile").val()) {
|
||
let reg = /^09([0-9]){9}$/;
|
||
|
||
if (!reg.test($("#janeshinmobile").val())) {
|
||
$("#janeshinmobile").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#janeshinmobile").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
return checkValidation;
|
||
}
|
||
|
||
function saveRahdariEdited() {
|
||
if (rahdariEditedValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("status", $("#sit").val());
|
||
formData.append("type", $("#type").val());
|
||
formData.append("phone", $("#phone").val());
|
||
formData.append("team_num", $("#ekipnum").val());
|
||
formData.append("staff_num", $("#personelnum").val());
|
||
formData.append("responsible_name", $("#masol").val());
|
||
formData.append("responsible_mobile", $("#masolmobile").val());
|
||
formData.append("successor_name", $("#janeshin").val());
|
||
formData.append("successor_mobile", $("#janeshinmobile").val());
|
||
formData.append("machines_light", $("#lightmachine").val());
|
||
formData.append("machines_sheavy", $("#meduimachin").val());
|
||
formData.append("machines_heavy", $("#bigmachin").val());
|
||
|
||
let lat = $("#lat-rahdar").val().slice(1, -1);
|
||
let lng = $("#lng-rahdar").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_overview]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"overview_files_" + i,
|
||
$("input[name=modalUpFileRahdari_overview]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_machinery]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"machinery_files_" + i,
|
||
$("input[name=modalUpFileRahdari_machinery]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_store]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"store_files_" + i,
|
||
$("input[name=modalUpFileRahdari_store]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_office]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"office_files_" + i,
|
||
$("input[name=modalUpFileRahdari_office]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_others]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"others_files_" + i,
|
||
$("input[name=modalUpFileRahdari_others]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
$("#rahdaredit").modal("hide");
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/rahdari-points/" + $("#rahdarid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showRahdariPoints();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
}
|
||
|
||
function accident251EditedPointValidate() {
|
||
let isValidate = true;
|
||
|
||
if (!$("#action").val() || !checkPersianWordValidation($("#action").val())) {
|
||
$("#action").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#action").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#cost").val()) {
|
||
$("#cost").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#cost").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#end-date").val()) {
|
||
$("#end-date").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#end-date").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#ac-point-lat").val()) {
|
||
$("#ac-point-lat").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#ac-point-lat").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#ac-point-lng").val()) {
|
||
$("#ac-point-lng").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#ac-point-lng").removeClass("is-invalid");
|
||
}
|
||
|
||
return isValidate;
|
||
}
|
||
|
||
function checkPersianWordValidation(str) {
|
||
let reg = /^[\u0600-\u06FF\s\.]+$/;
|
||
|
||
if (!reg.test(str)) {
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function saveEditedPoint() {
|
||
if (accident251EditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("actions", $("#action").val());
|
||
formData.append("progress", $(".ex2").slider("getValue"));
|
||
formData.append("cost", $("#cost").val());
|
||
formData.append("end_date", $("#end-date").val());
|
||
|
||
let lat = $("#ac-point-lat").val().slice(1, -1);
|
||
let lng = $("#ac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=modalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=modalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
//if ($('.ex2').slider('getValue') >= $('.ex2').attr('data-slider-value')) {
|
||
$("#pointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-251-points/" + $("#pointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showAccident251Points();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
/*} else {
|
||
$('#sliderphysici').find('.slider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
||
$('#sliderphysici').find('.slider-label').css('color', 'red');
|
||
}*/
|
||
}
|
||
}
|
||
|
||
function showChangePasswordModal() {
|
||
$("#changepass").modal({ backdrop: "static", keyboard: false });
|
||
$("#changepass").modal("show");
|
||
}
|
||
|
||
$("#savepass").on("click", function () {
|
||
saveEditedPassword();
|
||
});
|
||
|
||
function saveEditedPassword() {
|
||
formData = new FormData();
|
||
|
||
formData.append("fname", $("#name").val());
|
||
formData.append("lname", $("#familyname").val());
|
||
formData.append("position", $("#postsazman").val());
|
||
formData.append("mobile", $("#sazmanmobile").val());
|
||
formData.append("password", $("#newpass").val());
|
||
formData.append("password_confirmation", $("#repeatpass").val());
|
||
|
||
$.ajax({
|
||
url: "/users/0",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
window.open("/rmto", "_self");
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
if (error.responseJSON.errors) {
|
||
//console.log(error.responseJSON.errors);
|
||
showUserUpdateValidateErrors(error.responseJSON.errors);
|
||
}
|
||
},
|
||
});
|
||
}
|
||
|
||
function showUserUpdateValidateErrors(errors) {
|
||
if (errors.fname) {
|
||
$("#name").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#name").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.lname) {
|
||
$("#familyname").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#familyname").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.position) {
|
||
$("#postsazman").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#postsazman").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.mobile) {
|
||
$("#sazmanmobile").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#sazmanmobile").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.password) {
|
||
$("#newpass").removeClass("is-valid").addClass("is-invalid");
|
||
$("#password-invalid-msg").text(
|
||
"رمز عبور باید حداقل ۸ کاراکتر و شامل حداقل یک حرف بزرگ لاتین یک حرف کوچک لاتین و یک عدد باشد."
|
||
);
|
||
} else {
|
||
$("#newpass").removeClass("is-invalid").addClass("is-valid");
|
||
$("#password-invalid-msg").text("");
|
||
}
|
||
}
|
||
|
||
if (getParameterByName("newAbrarProjectId")) {
|
||
let projectId = getParameterByName("newAbrarProjectId");
|
||
|
||
$.ajax({
|
||
url: "/abrar-projects/" + projectId,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showAbrarProjectOnMap(result.data);
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
},
|
||
});
|
||
}
|
||
|
||
var abrarProjectIcon1 = L.icon({
|
||
iconUrl: "./dist/images/icons/flag-1.png",
|
||
iconSize: [22, 22],
|
||
iconAnchor: [2, 22],
|
||
});
|
||
|
||
var abrarProjectIcon9 = L.icon({
|
||
iconUrl: "./dist/images/icons/flag-9.png",
|
||
iconSize: [22, 22],
|
||
iconAnchor: [2, 22],
|
||
});
|
||
|
||
function showAbrarProjectOnMap(data) {
|
||
if (data.project_start_latlng != null) {
|
||
if (data.project_status < 9) {
|
||
drawStartToEndPath(
|
||
"line",
|
||
data.project_start_latlng,
|
||
data.project_end_latlng,
|
||
"#e6d037"
|
||
);
|
||
|
||
L.marker([data.project_start_latlng[0], data.project_start_latlng[1]], {
|
||
icon: abrarProjectIcon1,
|
||
})
|
||
.bindPopup(getPopupAbrarProjectContent(data), {
|
||
className: "customPopupStyle",
|
||
offset: L.point(0, -15),
|
||
})
|
||
.addTo(map);
|
||
} else {
|
||
drawStartToEndPath(
|
||
"line",
|
||
data.project_start_latlng,
|
||
data.project_end_latlng,
|
||
"#439c0f"
|
||
);
|
||
|
||
L.marker([data.project_start_latlng[0], data.project_start_latlng[1]], {
|
||
icon: abrarProjectIcon9,
|
||
})
|
||
.bindPopup(getPopupAbrarProjectContent(data), {
|
||
className: "customPopupStyle",
|
||
offset: L.point(0, -15),
|
||
})
|
||
.addTo(map);
|
||
}
|
||
|
||
L.circleMarker(
|
||
[data.project_start_latlng[0], data.project_start_latlng[1]],
|
||
{
|
||
color: "#cc7a00",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}
|
||
).addTo(map);
|
||
|
||
L.circleMarker([data.project_end_latlng[0], data.project_end_latlng[1]], {
|
||
color: "#cc7a00",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}).addTo(map);
|
||
}
|
||
}
|
||
|
||
function convertNumtoStrAbrarProjectType(num) {
|
||
switch (num) {
|
||
case "1": {
|
||
return "تعریض";
|
||
}
|
||
case "2": {
|
||
return "ابنیه فنی";
|
||
}
|
||
case "3": {
|
||
return "عملیات خاکی و تثبیت";
|
||
}
|
||
case "4": {
|
||
return "آسفالت";
|
||
}
|
||
}
|
||
}
|
||
|
||
function convertAbrarProjectType(type) {
|
||
let projectType = "";
|
||
|
||
type.forEach(function (value, index) {
|
||
projectType += convertNumtoStrAbrarProjectType(value) + "، ";
|
||
});
|
||
|
||
return projectType.slice(0, -2);
|
||
}
|
||
|
||
function convertAbrarProjectStatus(status) {
|
||
switch (status) {
|
||
case 1: {
|
||
return "در دست بررسیهای مقدماتی";
|
||
}
|
||
case 2: {
|
||
return "در دست مطالعه";
|
||
}
|
||
case 3: {
|
||
return "در دست مناقصه";
|
||
}
|
||
case 4: {
|
||
return "در حال مبادله و انعقاد قرارداد";
|
||
}
|
||
case 5: {
|
||
return "در حال اجرا - فعال";
|
||
}
|
||
case 6: {
|
||
return "در حال اجرا - متوقف";
|
||
}
|
||
case 7: {
|
||
return "در مراحل تکمیل و آمادهسازی افتتاح";
|
||
}
|
||
case 8: {
|
||
return "آماده افتتاح و بهرهبرداری";
|
||
}
|
||
case 9: {
|
||
return "افتتاح شده";
|
||
}
|
||
}
|
||
}
|
||
|
||
function getPopupAbrarProjectContent(data) {
|
||
if (data.project_status == 9) {
|
||
specificStatus = ` (` + data.project_status_date + `)`;
|
||
} else if ([2, 5, 6].includes(data.project_status)) {
|
||
specificStatus = ` (` + data.project_status_progress + ` درصد)`;
|
||
} else {
|
||
specificStatus = ``;
|
||
}
|
||
|
||
return (
|
||
`
|
||
<div class="popup">
|
||
<div class="popupTitle">
|
||
<img width="22px" src="dist/images/layer-141/construction.svg" alt="">
|
||
<span class="popupHeader"> پروژه ساخت راه روستایی </span>
|
||
</div>
|
||
<div class="popupHeaderContent">
|
||
<div class="popUpBanner"> اداره کل: ` +
|
||
data.province_name +
|
||
`، شهرستان: ` +
|
||
data.city_name +
|
||
`</div>
|
||
</div>
|
||
<div class="popupContent">
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> نام پروژه - نام محور </span>
|
||
<div class="popUpBoxContent">` +
|
||
data.axis_name +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> طول محور (کیلومتر) </span>
|
||
<div class="popUpBoxContent">` +
|
||
data.axis_length +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> ماهیت پروژه </span>
|
||
<div class="popUpBoxContent">` +
|
||
convertAbrarProjectType(data.project_type) +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> آخرین وضعیت پروژه </span>
|
||
<div class="popUpBoxContent">` +
|
||
convertAbrarProjectStatus(data.project_status) +
|
||
specificStatus +
|
||
`</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`
|
||
);
|
||
}
|
||
|
||
function drawStartToEndPath(pathType, source, dest, pathColor) {
|
||
if (routeControlsPath.length) {
|
||
$(routeControlsPath).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routeControlsPath.splice(routeControlsPath.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (polylinePath != null) {
|
||
map.removeLayer(polylinePath);
|
||
}
|
||
switch (pathType) {
|
||
case "line": {
|
||
polylinePath = L.polyline(
|
||
[
|
||
[source[0], source[1]],
|
||
[dest[0], dest[1]],
|
||
],
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
}
|
||
).addTo(map);
|
||
break;
|
||
}
|
||
case "axis": {
|
||
$.get(
|
||
`https://testmap.141.ir/route/v1/driving/${source[1]},${source[0]};${dest[1]},${dest[0]}?overview=false&alternatives=true&steps=true`,
|
||
function (data) {
|
||
routeControlsPath.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(parseFloat(source[0]), parseFloat(source[1])),
|
||
L.latLng(parseFloat(dest[0]), parseFloat(dest[1])),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
draggableWaypoints: true,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routesfound", function (e) {
|
||
for (let index = 0; index < popupArraysPath.length; index++) {
|
||
if (popupArraysPath[index] !== null) {
|
||
map.removeLayer(popupArraysPath[index]);
|
||
}
|
||
}
|
||
|
||
/*let popup = new L.Popup({
|
||
'maxWidth': '300',
|
||
'maxHeight': '150',
|
||
'className': 'customRouteEstimate'
|
||
});
|
||
|
||
let popupLocation = new L.LatLng(e.routes[0].coordinates[parseInt(e.routes[0]
|
||
.coordinates
|
||
.length /
|
||
2)].lat,
|
||
e.routes[0].coordinates[parseInt(e.routes[0].coordinates.length / 2)]
|
||
.lng);
|
||
let popupContent = "<span style=\"color:#FF5630 ; font-size:11px\">مسافت : </span>" + parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2) + " کیلومتر";
|
||
popup.setLatLng(popupLocation);
|
||
popup.setContent(popupContent);
|
||
popupArraysPath.push(popup);
|
||
map.addLayer(popup);*/
|
||
})
|
||
.addTo(map)
|
||
);
|
||
}
|
||
);
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
function getMaintenanceProjects() {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/road-maintenance-project/getpoints",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
|
||
let roadMaintenancePoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
try {
|
||
console.log(roadMaintenancePoints[i].physical_progress);
|
||
imagekol = roadMaintenancePoints[i].images
|
||
let setIcon = greenIcon;
|
||
if (roadMaintenancePoints[i].physical_progress < "50")
|
||
setIcon = redIcon;
|
||
|
||
if (roadMaintenancePoints[i].start_latlng != null) {
|
||
let marker = L.marker(roadMaintenancePoints[i].start_latlng, {
|
||
icon: setIcon,
|
||
content: roadMaintenancePoints[i],
|
||
}).bindPopup(getPopupContentMaintenance(roadMaintenancePoints[i]), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on('click', function (e) {
|
||
GenerateTablestart(roadMaintenancePoints[i].id, roadMaintenancePoints[i].project_distance_update)
|
||
});
|
||
markerG.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function getPopupContentMaintenance(data) {
|
||
console.log("data", data)
|
||
var upload =
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/caution.svg" alt="">\
|
||
<span class="popupHeader"> پروژه نگهداری راهها</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province.name +
|
||
"، شهرستان: " +
|
||
showcity(data.cities) +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> نام محور </span><div class="popUpBoxContent">' +
|
||
data.axis_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> نوع محور </span><div class="popUpBoxContent">' +
|
||
showaxistype(data.axis_type) +
|
||
'</div></div> </div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px">\
|
||
<span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
"%" +
|
||
data.physical_progress +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> پیشرفت ریالی (ریالی) </span><div class="popUpBoxContent">' +
|
||
data.credit_progress +
|
||
'</div></div>\
|
||
</div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> پیمانکار </span><div class="popUpBoxContent">' +
|
||
data.contractor_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مشاور </span><div class="popUpBoxContent">' +
|
||
data.consultant_name +
|
||
"" +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تاریخ قراراد </span><div class="popUpBoxContent">' +
|
||
data.contract_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> رقم قرارداد (میلیارد ریال ) </span><div class="popUpBoxContent">' +
|
||
data.contract_credit +
|
||
'</div></div>\
|
||
<div class="popupContent">\
|
||
<div class="popupFooter" ><span> نوع و طول عملیات </span><div class="popUpBoxContent" id="showtabel'+ data.id + '">' +
|
||
|
||
'</div></div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="show_point_photo1(imagekol)">نمایش تصاویر</button>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="upadate()"> بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>'
|
||
// GenerateTable(project_distance)
|
||
return upload
|
||
|
||
}
|
||
function upadate() {
|
||
window.open("https://rms.rmto.ir/road-maintenance-project/create")
|
||
}
|
||
function GenerateTablestart(id, object) {
|
||
console.log("obj", id, object)
|
||
// $("#showtabel").empty()
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = []
|
||
}
|
||
|
||
customers.push([" نوع عملیات ", "کیلومتر", "تناژ"]);
|
||
|
||
// for (var i = 0; i < item.length; i++) {
|
||
|
||
// customers.push([i + 1, subshow(item[i]), showcount(item[i], dataitem)]);
|
||
// }
|
||
$.each(object, function (index, value) {
|
||
customers.push([subshow1(index), showcount1(index, value), showtonazh1(index, value)]);
|
||
});
|
||
// console.log(customers)
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%")
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablepopup");
|
||
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtabel" + id);
|
||
dvTable.innerHTML = "";
|
||
// console.log("dvtt",dvTable)
|
||
dvTable.appendChild(table);
|
||
}
|
||
function subshow1(index) {
|
||
// return index
|
||
if (index == 1) {
|
||
return "روکش آسفالت"
|
||
}
|
||
if (index == 2) {
|
||
return "ماسه آسفالت"
|
||
}
|
||
if (index == 3) {
|
||
return " بازیافت سرد و گرم "
|
||
}
|
||
if (index == 4) {
|
||
return "میکروسرفیسینگ"
|
||
}
|
||
if (index == 5) {
|
||
return " چیپ سیل "
|
||
}
|
||
if (index == 6) {
|
||
return "اسلاری سیل "
|
||
}
|
||
if (index == 7) {
|
||
return "اسکراب سیل "
|
||
}
|
||
if (index == 8) {
|
||
return "فوگ سیل"
|
||
}
|
||
if (index == 9) {
|
||
return " سیل کت "
|
||
}
|
||
if (index == 10) {
|
||
return " کیپ سیل "
|
||
}
|
||
if (index == 11) {
|
||
return " آسفالت سرد / ردمیکس"
|
||
}
|
||
if (index == 12) {
|
||
return " لکه گیری "
|
||
}
|
||
|
||
if (index == 13) {
|
||
return " درز گیری "
|
||
}
|
||
|
||
}
|
||
function showcount1(index, value) {
|
||
let textfile = ""
|
||
if (index == 1) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 2) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 3) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 4) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 5) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 6) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 7) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 8) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 9) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 10) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 11) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
|
||
if (index == 12) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
if (index == 13) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0]
|
||
}
|
||
}
|
||
return textfile
|
||
}
|
||
function showtonazh1(index, value) {
|
||
let textfile = ""
|
||
if (index == 1) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 2) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 3) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 4) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 5) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 6) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 7) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 8) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 9) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 10) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
if (index == 11) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1]
|
||
}
|
||
}
|
||
|
||
if (index == 12) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[2]
|
||
}
|
||
}
|
||
if (index == 13) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = "_"
|
||
}
|
||
}
|
||
return textfile
|
||
}
|
||
function showcity(array) {
|
||
var dataname = ""
|
||
for (let i = 0; i < array.length; i++) {
|
||
dataname += array[i].name + " "
|
||
// console.log(i, array[i].name )
|
||
}
|
||
// console.log(dataname)
|
||
return dataname
|
||
}
|
||
function showaxistype(num) {
|
||
if (num == 1) {
|
||
return "شریانی"
|
||
}
|
||
else if (num == 2) {
|
||
return "اصلی"
|
||
}
|
||
else if (num == 3) {
|
||
return "فرعی"
|
||
}
|
||
else return "روستایی"
|
||
}
|
||
//yasi
|
||
$("#slideroverlay > .camera-overlay").on("click", function () {
|
||
$(this).parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay .close").on("click", function () {
|
||
$(this).parent().parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay #slideshow-slide .prev").on("click", function () {
|
||
layerslidershow((slideIndexlayer -= 1));
|
||
});
|
||
|
||
$("#slideroverlay #slideshow-slide .next").on("click", function () {
|
||
layerslidershow((slideIndexlayer += 1));
|
||
});
|
||
|
||
function show_point_photo1(array) {
|
||
|
||
console.log("array", array)
|
||
var dataLength = array.length;
|
||
if (dataLength != 0) {
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
$(array).each(function (index, item) {
|
||
// console.log(index,item)
|
||
let divSlide =
|
||
'<div class="mySlides"><div class="numbertext">' +
|
||
dataLength +
|
||
" / " +
|
||
(index + 1) +
|
||
'</div><img src="' +
|
||
item + '"><div class="text" style="display:none>' +
|
||
"</div></div>";
|
||
$("#slideshow-slide").append(divSlide);
|
||
$("#slideshow-dot").append(
|
||
'<span class="dot" onclick="currentCameraSlide(' +
|
||
(index + 1) +
|
||
')"></span>'
|
||
);
|
||
});
|
||
if (dataLength > 0) {
|
||
slideindex = 1;
|
||
layerslidershow(slideindex);
|
||
$("#slideroverlay").css("display", "block");
|
||
}
|
||
// console.log(array.length)
|
||
}
|
||
else {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "فایلی جهت نمایش وجود ندارد .",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
}
|
||
// console.log(dataLength)
|
||
|
||
|
||
}
|
||
function layerslidershow(n) {
|
||
let slides = $("#slideroverlay #slideshow-slide .mySlides");
|
||
let dots = $("#slideroverlay #slideshow-dot .dot");
|
||
|
||
if (n > slides.length) {
|
||
slideIndexlayer = 1;
|
||
}
|
||
if (n < 1) {
|
||
slideIndexlayer = slides.length;
|
||
}
|
||
|
||
$(slides).each(function () {
|
||
$(this).css("display", "none");
|
||
});
|
||
$(dots).each(function () {
|
||
$(this).removeClass("active");
|
||
});
|
||
|
||
$(slides[slideIndexlayer - 1]).css("display", "block");
|
||
$(dots[slideIndexlayer - 1]).addClass("active");
|
||
}
|
||
|
||
//yasi
|
||
|
||
$('#all-danger-pointsShow').on('click', function () {
|
||
$('#all_village').click()
|
||
})
|
||
|
||
$('#all251-danger-pointsShow').on('click', function () {
|
||
$('#251_village').click()
|
||
})
|
||
|
||
function getPopupContentFastReaction(data) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="./dist/images/layer-icons/emergency.svg" alt="">\
|
||
<span class="popupHeader">واکنش سریع (کد پیگیری: ' + data.uid + ')</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.ProvinceName + '، شهرستان ' + data.TownName +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> موضوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.Title +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> نوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.EventTypeTitle +
|
||
'</div></div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:266px!important"><span> توضیح شکایت </span><div class="popUpBoxContent">' +
|
||
data.Description +
|
||
'</div></div>\
|
||
</div>'
|
||
);
|
||
}
|
||
|
||
function showFastPoint() {
|
||
$("#choosetime").modal('show')
|
||
}
|
||
|
||
function showFastFunction(startDate, endDate) {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/public/homeprojects/fast/points" + "?end-date=" + endDate + "&start-date=" + startDate,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showFastReactionPoint = false
|
||
|
||
let roadMaintenancePoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
let pos = null;
|
||
|
||
if (roadMaintenancePoints[i].rms_status == 0) {
|
||
setIcon = redIcon;
|
||
pos = [roadMaintenancePoints[i].lat, roadMaintenancePoints[i].lng];
|
||
|
||
} else {
|
||
setIcon = greenIcon;
|
||
pos = roadMaintenancePoints[i].rms_start_latlng;
|
||
}
|
||
|
||
if (pos != null) {
|
||
let marker = L.marker(pos, {
|
||
icon: setIcon,
|
||
content: roadMaintenancePoints[i],
|
||
}).bindPopup(getPopupContentFastReaction(roadMaintenancePoints[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerG.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|