3148 lines
128 KiB
Plaintext
3148 lines
128 KiB
Plaintext
const API_ENDPOINT = "https://141.ir/api";
|
|
const MAP_ENDPOINT = "https://testmap.141.ir";
|
|
const MAP_MIN_ZOOM = 5;
|
|
const MAP_MAX_ZOOM = 10;
|
|
const API_TEST = "https://rms.rmto.ir";
|
|
|
|
var globalqueryparam = "";
|
|
var frommDate, toDate;
|
|
var mapradar = null;
|
|
var WindowWidth = null;
|
|
|
|
var marker141Layers = null;
|
|
var markersproject = null
|
|
var markerLayers1 = null;
|
|
var markerLayers2 = null;
|
|
var markerLayers3 = null;
|
|
var markerLayers4 = null;
|
|
var markerLayers5 = null;
|
|
|
|
var marker141List = [];
|
|
var projectbamamap = [];
|
|
var rookeshbama = [];
|
|
var hadesemap = [];
|
|
var erteghamap = [];
|
|
var abniemap = [];
|
|
var rahdarmap = [];
|
|
var sharyanimap = [];
|
|
var aslimap = [];
|
|
var faryimap = [];
|
|
var roostayimap = [];
|
|
var darhaltajhiz = [];
|
|
var dardastmonaghsese = [];
|
|
var updateroostayi = [];
|
|
var motale = [];
|
|
var ejrafal = [];
|
|
var ejramotevaghef = [];
|
|
var updatefirst = [];
|
|
var efteteha = [];
|
|
var year1395 = [];
|
|
var secondyear = [];
|
|
var thirsyear = [];
|
|
var fourthyear = [];
|
|
var fifthyear = [];
|
|
|
|
var globalcolor = "";
|
|
var routeControls = [];
|
|
var routecolor = [];
|
|
var routeControlsPath = [];
|
|
var isSetEndAbrarMarker = false;
|
|
var isSetStartAbrarMarker = false;
|
|
var marker141LayersWithoutCluster = null;
|
|
var itempoint = null;
|
|
var provincesArray;
|
|
var citiesArray;
|
|
var iranGeoJSON;
|
|
var iranMapGeo;
|
|
var iranArrayCount = 0;
|
|
var iranCityCount = 0;
|
|
var keepMapFeatureColor = null;
|
|
var fullCityGeoJSONTemp = new Object();
|
|
var fullCityGeoJSON = null;
|
|
var iranCityMapGeo;
|
|
var flagProvince = 0;
|
|
var flagCity = 0;
|
|
var HopeData;
|
|
var statusSet;
|
|
var markerlis1 = [];
|
|
var markerlis2 = [];
|
|
var markerlis3 = [];
|
|
var markerlis4 = [];
|
|
var markerlis5 = [];
|
|
var markerlis6 = [];
|
|
var markerlis7 = [];
|
|
var markerlis8 = [];
|
|
var markerrashtnew = [];
|
|
var markerlisfirooz = [];
|
|
var markerlistamo = [];
|
|
var markerlist;
|
|
var markerchaloos = [];
|
|
var markersemnan = [];
|
|
var markertabriz = [];
|
|
var markerkermanshah = [];
|
|
var firoozlayer = [];
|
|
var amollayer = [];
|
|
var rashtlayer = [];
|
|
var markerfiroozkooh = [];
|
|
var markeramol = [];
|
|
var markerrasht = [];
|
|
var newrashtlayer = [];
|
|
var chalooslayer = [];
|
|
var semnanlayer = [];
|
|
var tabrizlayer = [];
|
|
var kermanlayer = [];
|
|
var ekipmarker = null;
|
|
var issetekipmarker = false;
|
|
var endAbrarMarker = null;
|
|
var isSetEndAbrarMarker = false;
|
|
var smarkerGhRa;
|
|
var emarkerGhRa;
|
|
var smarkerKarCh;
|
|
var emarkerKarCh;
|
|
var smarkerThSe;
|
|
var emarkerThSe;
|
|
var smarkerThKer;
|
|
var emarkerThKer;
|
|
var smarkerfirooz;
|
|
var emarkerfirooz;
|
|
var smarkertabriz;
|
|
var emarkertabriz;
|
|
var tabrizpoly = null;
|
|
var machinarydatavalid = "";
|
|
var ekiplistvalid = "";
|
|
var smarkerrasht;
|
|
var emarkerrasht;
|
|
var rashtpoly = null;
|
|
var startmarkerpin = [];
|
|
var endmarkerpin = [];
|
|
var project_update_list = [];
|
|
var projectarraymachine = [];
|
|
var ekiplist = [];
|
|
var smarkeramol;
|
|
var emarkeramol;
|
|
var amolpoly = null;
|
|
var firstpolyline = null;
|
|
var firoozpoly = null;
|
|
var forthpolyline = null;
|
|
var fifthpolyline = null;
|
|
var seventhpolyline = null;
|
|
var startAbrarMarker = null;
|
|
var isSetStartAbrarMarker = false;
|
|
var routeControls = [];
|
|
var routecolor = [];
|
|
var routeControlsPath = [];
|
|
var routingArray = [];
|
|
var showfastreactionmarker = [];
|
|
var slideIndexlayer = 1;
|
|
|
|
var ppList = [];
|
|
var ptList = [];
|
|
var atList = [];
|
|
var psList = [];
|
|
var pyList = [];
|
|
var priority = [];
|
|
var followup = [];
|
|
|
|
var list_sub;
|
|
|
|
var pprahdar = [];
|
|
var statusrahdar = [];
|
|
var typerahdar = [];
|
|
var pointrahdar = -1;
|
|
|
|
var ppfast = [];
|
|
var featurefast = [];
|
|
var activityfast = [];
|
|
//coridor line
|
|
var selectedCoridor = 0;
|
|
var selectedCoridorArr = [];
|
|
var poly_1 = null;
|
|
var poly_2 = null;
|
|
var poly_3 = null;
|
|
var poly_4 = null;
|
|
var poly_5 = null;
|
|
var poly_6 = null;
|
|
var poly_7 = null;
|
|
var poly_8 = null;
|
|
var layer_1 = [];
|
|
var layer_2 = [];
|
|
var layer_3 = [];
|
|
var layer_4 = [];
|
|
var layer_5 = [];
|
|
var layer_6 = [];
|
|
var layer_7 = [];
|
|
var layer_8 = [];
|
|
var marker_1 = [];
|
|
var marker_2 = [];
|
|
var marker_3 = [];
|
|
var marker_4 = [];
|
|
var marker_5 = [];
|
|
var marker_6 = [];
|
|
var marker_7 = [];
|
|
var marker_8 = [];
|
|
var marker_1_list = [];
|
|
var marker_2_list = [];
|
|
var marker_3_list = [];
|
|
var marker_4_list = [];
|
|
var marker_5_list = [];
|
|
var marker_6_list = [];
|
|
var marker_7_list = [];
|
|
var marker_8_list = [];
|
|
var coridorMarkerArray = [];
|
|
var coridorArray = [];
|
|
var ajaxCheck = false;
|
|
var querylength = 0
|
|
var queryparams = ""
|
|
var urlParams
|
|
var currentFilterQueryfrom
|
|
var currentFilterQueryto
|
|
|
|
|
|
|
|
UncheckAll()
|
|
|
|
var toDatefast, frommDatefast;
|
|
|
|
var startAbrarDivIcon = L.divIcon({
|
|
html: `
|
|
<div id="pin-marker-start" class="pin-marker pin-set">
|
|
<div class="map-pin-marker">
|
|
<div class="pin-main-circle"></div>
|
|
<div class="pin-white-circle"></div>
|
|
<div class="pin-title-circle">
|
|
<span class="title-circle-text">شروع</span>
|
|
</div>
|
|
<div class="pin-main-line"></div>
|
|
</div>
|
|
<div class="pin-main-shadow">
|
|
<div class="shadow-dot">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
iconSize: [55, 75],
|
|
iconAnchor: [33, 64],
|
|
});
|
|
var endAbrarDivIcon = L.divIcon({
|
|
html: `
|
|
<div id="pin-marker-end" class="pin-marker pin-set">
|
|
<div class="map-pin-marker">
|
|
<div class="pin-main-circle"></div>
|
|
<div class="pin-white-circle"></div>
|
|
<div class="pin-title-circle">
|
|
<span class="title-circle-text">پایان</span>
|
|
</div>
|
|
<div class="pin-main-line"></div>
|
|
</div>
|
|
<div class="pin-main-shadow">
|
|
<div class="shadow-dot">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
iconSize: [55, 75],
|
|
iconAnchor: [33, 64],
|
|
});
|
|
var startAbrarDivIconrahdar = L.divIcon({
|
|
html: `
|
|
<div id="pin-marker-startrahdar" class="pin-marker">
|
|
<div class="map-pin-marker">
|
|
<div class="pin-main-circle"></div>
|
|
<div class="pin-white-circle"></div>
|
|
<div class="pin-title-circle">
|
|
<span class="title-circle-text">شروع</span>
|
|
</div>
|
|
<div class="pin-main-line"></div>
|
|
</div>
|
|
<div class="pin-main-shadow">
|
|
<div class="shadow-dot">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
iconSize: [55, 75],
|
|
iconAnchor: [33, 64],
|
|
});
|
|
var endAbrarDivIconrahdar = L.divIcon({
|
|
html: `
|
|
<div id="pin-marker-endrahdar" class="pin-marker">
|
|
<div class="map-pin-marker">
|
|
<div class="pin-main-circle"></div>
|
|
<div class="pin-white-circle"></div>
|
|
<div class="pin-title-circle">
|
|
<span class="title-circle-text">پایان</span>
|
|
</div>
|
|
<div class="pin-main-line"></div>
|
|
</div>
|
|
<div class="pin-main-shadow">
|
|
<div class="shadow-dot">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
iconSize: [55, 75],
|
|
iconAnchor: [33, 64],
|
|
});
|
|
|
|
frommDatefast = $("#fastreact-fromdate").persianDatepicker({
|
|
observer: true,
|
|
format: "YYYY/MM/DD",
|
|
altField: ".observer-example-alt",
|
|
autoClose: true,
|
|
onSelect: function (unix) {
|
|
frommDatefast.touched = true;
|
|
|
|
$("#fastreact-todate").prop("disabled", "");
|
|
|
|
if (
|
|
frommDatefast.getState().selected.unixDate >=
|
|
toDatefast.getState().selected.unixDate
|
|
) {
|
|
toDatefast.setDate(frommDatefast.getState().selected.unixDate);
|
|
}
|
|
if (
|
|
toDatefast &&
|
|
toDatefast.options &&
|
|
toDatefast.options.minDate != unix
|
|
) {
|
|
let cachedValue = toDatefast.getState().selected.unixDate;
|
|
|
|
toDatefast.options = { minDate: unix };
|
|
|
|
if (toDatefast.touched) {
|
|
toDatefast.setDate(cachedValue);
|
|
}
|
|
}
|
|
},
|
|
});
|
|
|
|
toDatefast = $("#fastreact-todate").persianDatepicker({
|
|
format: "YYYY/MM/DD",
|
|
autoClose: true,
|
|
format: "YYYY/MM/DD",
|
|
autoClose: true,
|
|
onSelect: function (unix) {
|
|
toDatefast.touched = true;
|
|
},
|
|
});
|
|
|
|
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=full&alternatives=false`,
|
|
function (data) {
|
|
alert("ppp");
|
|
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]);
|
|
}
|
|
}
|
|
})
|
|
.addTo(map)
|
|
);
|
|
}
|
|
);
|
|
|
|
$(".leaflet-control-container").css("display", "none");
|
|
$(".leaflet-routing-container-hide").css("display", "none");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
function calculateRouteCoridor(first, last, num) {
|
|
let routeArray = [];
|
|
|
|
let result = new Promise(function (resolve, reject) {
|
|
if (num == 0) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;52.8579311,36.4636399?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
}
|
|
if (num == 1) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;52.3499009,36.4718947?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
}
|
|
if (num == 2) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/49.5846102,37.2793607;49.589109420776374,37.01365617294853;49.39663410186768,36.76501688279228;49.41307067871094,36.71865951515749;49.53460693359376,36.618903290216785;49.59546089172364,36.3709172544364;49.81874942779541,36.31037025501364;50.006663,36.2804074?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
}
|
|
if (num == 3) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/50.006663,36.2804074;49.5846102,37.2793607?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
} else if (num == 4) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.0073853,35.8121955;51.4222349,36.6506071?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
} else if (num == 5) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;53.3882906,35.5834074?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
} else if (num == 6) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;46.2961952,38.0739964?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
} else if (num == 7) {
|
|
$.get(
|
|
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;50.21301269531251,35.00862766620555;49.531173706054695,35.12440157992044;48.740158081054695,35.09463077862675;47.0735891,34.3239414?overview=full&alternatives=true&steps=true",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
} else {
|
|
$.get(
|
|
"https://testmap.141.ir" +
|
|
"/route/v1/driving/" +
|
|
first[1] +
|
|
"," +
|
|
first[0] +
|
|
";" +
|
|
last[1] +
|
|
"," +
|
|
last[0] +
|
|
"?overview=full&alternatives=false",
|
|
function (data) {
|
|
resolve(decode(data.routes[0].geometry, 6));
|
|
}
|
|
);
|
|
}
|
|
});
|
|
|
|
result.then((response) => {
|
|
routeArray = response;
|
|
showCoridorLayer(routeArray, num);
|
|
if (num == 0) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
firoozpoly = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
firoozpoly.addTo(map);
|
|
}
|
|
if (num == 1) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
amolpoly = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
amolpoly.addTo(map);
|
|
} else if (num == 2) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
firstpolyline = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
firstpolyline.addTo(map);
|
|
} else if (num == 3) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
rashtpoly = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
rashtpoly.addTo(map);
|
|
} else if (num == 4) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
forthpolyline = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
forthpolyline.addTo(map);
|
|
} else if (num == 5) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
fifthpolyline = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
fifthpolyline.addTo(map);
|
|
} else if (num == 6) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
tabrizpoly = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
tabrizpoly.addTo(map);
|
|
} else if (num == 7) {
|
|
var myarray = [];
|
|
for (i = 0; i < routeArray.length; i++) {
|
|
myarray.push(
|
|
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
|
);
|
|
}
|
|
seventhpolyline = new L.Polyline(myarray, {
|
|
color: "blue",
|
|
weight: 5,
|
|
opacity: 0.5,
|
|
smoothFactor: 1,
|
|
});
|
|
seventhpolyline.addTo(map);
|
|
}
|
|
});
|
|
|
|
if (
|
|
num != 0 &&
|
|
num != 1 &&
|
|
num != 2 &&
|
|
num != 6 &&
|
|
num != 7 &&
|
|
num != 5 &&
|
|
num != 4 &&
|
|
num != 3
|
|
) {
|
|
routeControls.push(
|
|
L.Routing.control({
|
|
routeWhileDragging: true,
|
|
reverseWaypoints: true,
|
|
addWaypoints: false,
|
|
waypoints: [L.latLng(first[0], first[1]), L.latLng(last[0], last[1])],
|
|
lineOptions: {
|
|
styles: [{
|
|
color: "#5789f2",
|
|
opacity: 1,
|
|
weight: 5,
|
|
},],
|
|
},
|
|
createMarker: function (i, wp) {
|
|
if (i == 0) {
|
|
return L.marker(wp.latLng, { icon: startAbrarDivIcon });
|
|
} else {
|
|
return L.marker(wp.latLng, { icon: endAbrarDivIcon });
|
|
}
|
|
},
|
|
}).addTo(map)
|
|
);
|
|
} else if (num == 0) {
|
|
smarkerfirooz = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerfirooz = L.marker([last[0], last[1]], {
|
|
icon: endAbrarDivIcon,
|
|
}).addTo(map);
|
|
} else if (num == 1) {
|
|
smarkeramol = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkeramol = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
|
map
|
|
);
|
|
} else if (num == 2) {
|
|
smarkerGhRa = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerGhRa = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
|
map
|
|
);
|
|
} else if (num == 3) {
|
|
smarkerrasht = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerrasht = L.marker([last[0], last[1]], {
|
|
icon: endAbrarDivIcon,
|
|
}).addTo(map);
|
|
} else if (num == 4) {
|
|
smarkerKarCh = L.marker([35.8121955, 51.0073853], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerKarCh = L.marker([last[0], last[1]], {
|
|
icon: endAbrarDivIcon,
|
|
}).addTo(map);
|
|
} else if (num == 5) {
|
|
smarkerThSe = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerThSe = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
|
map
|
|
);
|
|
} else if (num == 6) {
|
|
smarkertabriz = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkertabriz = L.marker([last[0], last[1]], {
|
|
icon: endAbrarDivIcon,
|
|
}).addTo(map);
|
|
} else if (num == 7) {
|
|
smarkerThKer = L.marker([first[0], first[1]], {
|
|
icon: startAbrarDivIcon,
|
|
}).addTo(map);
|
|
emarkerThKer = L.marker([last[0], last[1]], {
|
|
icon: endAbrarDivIcon,
|
|
}).addTo(map);
|
|
}
|
|
|
|
|
|
for (var i = 0; i < routeControls.length; i++) { }
|
|
if ($(".leaflet-routing-container").length) {
|
|
$(".leaflet-routing-container").remove();
|
|
}
|
|
}
|
|
|
|
function drawPath() {
|
|
if (routeControls.length) {
|
|
$(routeControls).each(function (index, control) {
|
|
mapradar.removeControl(control);
|
|
routeControls.splice(routeControls.indexOf(index), 1);
|
|
});
|
|
}
|
|
routeControls.push(
|
|
L.Routing.control({
|
|
waypoints: [
|
|
L.latLng(
|
|
parseFloat(startAbrarMarker.getLatLng().lat),
|
|
parseFloat(startAbrarMarker.getLatLng().lng)
|
|
),
|
|
L.latLng(
|
|
parseFloat(endAbrarMarker.getLatLng().lat),
|
|
parseFloat(endAbrarMarker.getLatLng().lng)
|
|
),
|
|
],
|
|
fitSelectedRoutes: false,
|
|
|
|
draggableWaypoints: true,
|
|
createMarker: function () {
|
|
return null;
|
|
},
|
|
lineOptions: {
|
|
addWaypoints: false,
|
|
styles: [{
|
|
color: "#28a745",
|
|
opacity: 0.8,
|
|
weight: 5,
|
|
},],
|
|
},
|
|
})
|
|
.on("routingstart ", function (e) { })
|
|
.addTo(mapradar)
|
|
);
|
|
|
|
$(".leaflet-control-container").css("display", "none");
|
|
$(".leaflet-routing-container-hide").css("display", "none");
|
|
}
|
|
|
|
var greenIcon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-greenn'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var redIcon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-redd'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var sBlueIcon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-sBlueIcon'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var purpleIcon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-purple'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var pinkIcon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-pink'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var greenIconFix = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-green-fix'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var yellowicon = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-yellow-fix'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var redIconFix = L.divIcon({
|
|
className: "custom-div-icon",
|
|
html: "<span class='beacon beacon-red-fix'></span>",
|
|
iconSize: [30, 42],
|
|
});
|
|
var rahdariIconO = L.icon({
|
|
iconUrl: "../../dist/images/icons/tollHouseO_pin.png",
|
|
iconSize: [12, 12],
|
|
});
|
|
var rahdariIconY = L.icon({
|
|
iconUrl: "../../dist/images/icons/tollHouse_pin.png",
|
|
iconSize: [10, 10],
|
|
});
|
|
var bounds = [
|
|
[42.9130026312, 75.6166317076],
|
|
[20.5782370061, 30.5092252948],
|
|
];
|
|
var map = L.map("map", {
|
|
maxBounds: bounds,
|
|
minZoom: 6,
|
|
zoomControl: false,
|
|
}).setView([35.5468992, 51.7300532], 7);
|
|
L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map);
|
|
L.PrintPreview().addTo(map);
|
|
|
|
$(document).ready(function () {
|
|
document.location.search.length != 0 ? querylength = 1 : querylength = 0
|
|
urlParams = new URLSearchParams(window.location.search);
|
|
queryparams = window.location.search;
|
|
function onLocationFound(e) {
|
|
var radius = e.accuracy / 2;
|
|
L.circle(e.latlng, radius).addTo(map);
|
|
}
|
|
map.locate({ setView: true, maxZoom: 16 });
|
|
map.on('locationfound', onLocationFound);
|
|
|
|
var urlParams = new URLSearchParams(window.location.search);
|
|
globalqueryparam = urlParams.get("type");
|
|
if (globalqueryparam == "allpoints") {
|
|
$(".guid-custom-box-allpoint").css("display", "block");
|
|
|
|
showallpoint();
|
|
} else if (globalqueryparam == "fastreact") {
|
|
$(".guid-custom-box-fast").css("display", "block");
|
|
|
|
$(".filterTitle").on("click", function () {
|
|
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
|
$(this).parent().children(".filterGroup").show(1000);
|
|
} else {
|
|
$(this).parent().children(".filterGroup").hide(1000);
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/contents/provinces",
|
|
type: "GET",
|
|
success: function (data) {
|
|
var list_rahdar = data.data;
|
|
for (let index = 0; index < list_rahdar.length; index++) {
|
|
$("#all-pro-fast").append(
|
|
"<div class='icheck-primary d-inline ml-2'><label for='ppfast" +
|
|
list_rahdar[index].id +
|
|
"' class='font-check province-label'>" +
|
|
list_rahdar[index].name_fa +
|
|
"</label><input type='checkbox' id='ppfast" +
|
|
list_rahdar[index].id +
|
|
"' name='provinceshowe' value='" +
|
|
index +
|
|
"' class='fastboxpro' /></div></br>"
|
|
);
|
|
}
|
|
showboxfast();
|
|
},
|
|
});
|
|
showfastreaction();
|
|
} else if (globalqueryparam == "pro") {
|
|
$(".guid-custom-box").css("display", "block");
|
|
|
|
$(".filterTitle").on("click", function () {
|
|
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
|
$(this).parent().children(".filterGroup").show(1000);
|
|
} else {
|
|
$(this).parent().children(".filterGroup").hide(1000);
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/contents/provinces",
|
|
type: "GET",
|
|
success: function (data) {
|
|
list_province = data.data;
|
|
for (let index = 0; index < list_province.length; index++) {
|
|
$("#all-pro-pro").append(
|
|
"<div class='icheck-primary d-inline ml-2'><label for='pp" +
|
|
list_province[index].id +
|
|
"' class='font-check province-label'>" +
|
|
list_province[index].name_fa +
|
|
"</label><input type='checkbox' id='pp" +
|
|
list_province[index].id +
|
|
"' name='provinceshowe' value='" +
|
|
index +
|
|
"' class='chBox5' /></div></br>"
|
|
);
|
|
}
|
|
checkboxchecked();
|
|
},
|
|
});
|
|
|
|
$(".chBox1").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
var test = parseInt(this.id.substr(2))
|
|
if (this.checked) {
|
|
ptList.push(parseInt(this.id.substr(2)));
|
|
} else {
|
|
var index = ptList.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
ptList.splice(index, 1);
|
|
}
|
|
}
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
|
|
|
|
});
|
|
});
|
|
|
|
$(".chBox2").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
if (this.checked) {
|
|
atList.push(parseInt(parseInt(this.id.substr(2))));
|
|
} else {
|
|
var index = atList.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
atList.splice(index, 1);
|
|
}
|
|
}
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
});
|
|
});
|
|
|
|
$(".chBox3").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
if (this.checked) {
|
|
psList.push(parseInt(this.id.substr(2)));
|
|
} else {
|
|
var index = psList.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
psList.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
});
|
|
});
|
|
|
|
$(".chBox6").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
if (this.checked) {
|
|
priority.push(parseInt(this.id.substr(2)));
|
|
} else {
|
|
var index = priority.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
priority.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
});
|
|
});
|
|
$(".chBox7").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
if (this.checked) {
|
|
followup.push(parseInt(this.id.substr(2)));
|
|
} else {
|
|
var index = followup.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
followup.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
});
|
|
});
|
|
|
|
$(".chBox4").on("change", function () {
|
|
showLoaderScreen();
|
|
removeProjectLayer();
|
|
if (this.checked) {
|
|
pyList.push(parseInt(this.id.substr(2)));
|
|
|
|
} else {
|
|
var index = pyList.indexOf(parseInt(this.id.substr(2)));
|
|
if (index > -1) {
|
|
pyList.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
var currentDate = {}
|
|
currentFilterYear = parseInt(this.id.substr(2))
|
|
currentDate.from = moment(currentFilterYear, "jYYYY");
|
|
currentFilterQueryfrom = currentDate.from
|
|
.locale("en")
|
|
.format("YYYY-MM-DD");
|
|
currentDate.to = moment(currentFilterYear, "jYYYY");
|
|
currentDate.to.add(1, "year");
|
|
currentFilterQueryto = currentDate.to
|
|
.locale("en")
|
|
.format("YYYY-MM-DD");
|
|
|
|
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
|
province: ppList,
|
|
project_type: ptList,
|
|
axis: atList,
|
|
last_status: psList,
|
|
from_date: currentFilterQueryfrom,
|
|
to_date: currentFilterQueryto,
|
|
priority: priority,
|
|
followup: followup
|
|
}).done(function (data) {
|
|
hideLoaderScreen();
|
|
showPointOnMap(data.data)
|
|
});
|
|
});
|
|
} else if (globalqueryparam == "rahdari") {
|
|
$(".guid-custom-box").css("display", "none");
|
|
$("body").find(".queen-size-nav-rahdari").addClass("stylescroll");
|
|
WindowWidth = $(window).width();
|
|
|
|
$("#select-city").empty();
|
|
$("#select-city").append('<option value="0">انتخاب شهرستان </option>');
|
|
|
|
$("#province-id").on("change", function () {
|
|
init_data_filter();
|
|
if ($("#province-id").val() == 0) {
|
|
$("#select-city").attr("disabled", true);
|
|
} else {
|
|
$("#select-city").attr("disabled", false);
|
|
}
|
|
});
|
|
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/api/get-items-and-subs",
|
|
type: "GET",
|
|
success: function (data) {
|
|
list_sub = data.data;
|
|
},
|
|
});
|
|
|
|
showDailyRahdariActivity();
|
|
} else if (globalqueryparam == "251points") {
|
|
$(".guid-custom-box-251points").css("display", "block");
|
|
showAccident251Points();
|
|
} else if (globalqueryparam == "qarargah") {
|
|
showgharargah();
|
|
} else if (globalqueryparam == "camp") {
|
|
showwintercamp();
|
|
} else if (globalqueryparam == "campNew") {
|
|
$(".guid-custom-boxcamp").css("display", "block");
|
|
|
|
$(".filterTitle").on("click", function () {
|
|
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
|
$(this).parent().children(".filterGroup").show(1000);
|
|
} else {
|
|
$(this).parent().children(".filterGroup").hide(1000);
|
|
}
|
|
});
|
|
showcamp();
|
|
} else if (globalqueryparam == "rahdari") {
|
|
WindowWidth = $(window).width();
|
|
|
|
showDailyRahdariActivity();
|
|
} else if (globalqueryparam == "rahdar") {
|
|
$(".filterTitle").on("click", function () {
|
|
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
|
$(this).parent().children(".filterGroup").show(1000);
|
|
} else {
|
|
$(this).parent().children(".filterGroup").hide(1000);
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/contents/provinces",
|
|
type: "GET",
|
|
success: function (data) {
|
|
var list_rahdar = data.data;
|
|
for (let index = 0; index < list_rahdar.length; index++) {
|
|
$("#all-pro").append(
|
|
"<div class='icheck-primary d-inline ml-2'><label for='pprah" +
|
|
list_rahdar[index].id +
|
|
"' class='font-check province-label'>" +
|
|
list_rahdar[index].name_fa +
|
|
"</label><input type='checkbox' id='pprah" +
|
|
list_rahdar[index].id +
|
|
"' name='provinceshowe' value='" +
|
|
index +
|
|
"' class='checkboxpro' /></div></br>"
|
|
);
|
|
}
|
|
checkboxshowrahdar();
|
|
},
|
|
});
|
|
showrahdarkhane();
|
|
} else if (globalqueryparam == "barkhordari") {
|
|
$(".list-province").removeClass("d-none");
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/contents/provinces",
|
|
type: "GET",
|
|
cache: false,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (result) {
|
|
provincesArray = result.data;
|
|
renderprovince(provincesArray);
|
|
},
|
|
error: function (error) { },
|
|
});
|
|
$.ajax({
|
|
url: "https://141.ir/api/provinces35geojson",
|
|
type: "GET",
|
|
success: function (response) {
|
|
iranGeoJSON = JSON.parse(response);
|
|
},
|
|
});
|
|
$.ajax({
|
|
url: "https://141.ir/api/cities430geojson",
|
|
type: "GET",
|
|
success: function (response) {
|
|
fullCityGeoJSON = JSON.parse(response);
|
|
},
|
|
});
|
|
|
|
function addCityFeaturesToMap() {
|
|
keepMapFeatureColor = null;
|
|
if (fullCityGeoJSONTemp) {
|
|
iranCityMapGeo = L.geoJson(fullCityGeoJSONTemp, {
|
|
style: initStyleCityMapFeatures,
|
|
onEachFeature: onEachCityFeature,
|
|
});
|
|
iranCityMapGeo.addTo(map);
|
|
}
|
|
}
|
|
|
|
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 fillcolorme(featureRow) {
|
|
for (let i = 0; i < provincesArray.length; i++) {
|
|
if (i == featureRow) {
|
|
return provincesArray[i].abrar_process;
|
|
}
|
|
}
|
|
}
|
|
|
|
function initStyleMapFeatures() {
|
|
let getRandom = null;
|
|
getRandom = getForArrayFeatureColor(fillcolorme(iranArrayCount));
|
|
let makeStyle = {
|
|
fillColor: getRandom.color,
|
|
weight: 2,
|
|
opacity: 1,
|
|
color: "white",
|
|
fillOpacity: 0.7,
|
|
};
|
|
if (getRandom.num != -1) {
|
|
if (iranArrayCount == 35) {
|
|
iranArrayCount = 0;
|
|
}
|
|
iranArrayCount++;
|
|
}
|
|
return makeStyle;
|
|
}
|
|
|
|
function highlightMapFeature(e) {
|
|
let targetAtt = e.target.feature.properties;
|
|
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();
|
|
}
|
|
if (e.target) {
|
|
if (flagProvince == 0) {
|
|
let popup = L.popup();
|
|
for (let i = 0; i < provincesArray.length; i++) {
|
|
if (targetAtt.province_id == provincesArray[i].id) {
|
|
popup
|
|
.setLatLng([
|
|
provincesArray[i].center_lat,
|
|
provincesArray[i].center_long,
|
|
])
|
|
.setContent(
|
|
`<div class="parent-popup-enjoyment text-center">
|
|
<div class="d-flex flex-column ">
|
|
<span style="font-size: 10px;" class="font-weight-bold">${provincesArray[i].name_fa}</span>
|
|
<div style="color:rgb(255, 159, 107)" class="d-flex justify-content-center mt-1">
|
|
<span class="ml-1">مقدار</span>
|
|
<span style="font-family:IRANSansFaNum">${provincesArray[i].abrar_process}%</span>
|
|
</div>
|
|
</div>
|
|
<div class="line-popup"></div>
|
|
<a href="${provincesArray[i].abrar_link}" class="btn-download">
|
|
<div class="d-flex flex-column mt-2">
|
|
<i style="color:rgb(255, 159, 107);font-size:15px" class="fa fa-download"></i>
|
|
<span style="font-size: 10px;" class="font-weight-bold">
|
|
دانلود فایل
|
|
</span>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
`
|
|
)
|
|
.openOn(map);
|
|
}
|
|
}
|
|
$(`#target${targetAtt.province_id}`)
|
|
.css("transform", "scale(1.1)")
|
|
.animate({
|
|
marginTop: "10px",
|
|
marginBottom: "10px",
|
|
});
|
|
$("html .list-province")
|
|
.stop()
|
|
.animate({
|
|
scrollTop: $(`#target${targetAtt.province_id}`).offset().top - 380.59,
|
|
});
|
|
}
|
|
|
|
}
|
|
if (targetAtt.city_id) {
|
|
if (flagCity == 0) {
|
|
let popup = L.popup();
|
|
for (let i = 0; i < citiesArray.length; i++) {
|
|
if (targetAtt.city_id == citiesArray[i].id) {
|
|
popup
|
|
.setLatLng(e.latlng)
|
|
.setContent(
|
|
`<div class="parent-popup-enjoyment text-center">
|
|
<div class="d-flex flex-column ">
|
|
<span style="font-size: 10px;" class="font-weight-bold">${citiesArray[i].name_fa}</span>
|
|
<div style="color:rgb(255, 159, 107)" class="d-flex justify-content-center mt-1">
|
|
<span class="ml-1">مقدار</span>
|
|
<span style="font-family:IRANSansFaNum">${citiesArray[i].abrar_process}%</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`
|
|
)
|
|
.openOn(map);
|
|
}
|
|
}
|
|
}
|
|
$(`#target${targetAtt.city_id}`)
|
|
.css("transform", "scale(1.1)")
|
|
.animate({
|
|
marginTop: "10px",
|
|
marginBottom: "10px",
|
|
});
|
|
$("html .list-province")
|
|
.stop()
|
|
.animate({
|
|
scrollTop: $(`#target${targetAtt.city_id}`).offset().top - 380.59,
|
|
});
|
|
}
|
|
}
|
|
|
|
function resetMapFeatureHighlight(e) {
|
|
let targetAtt = e.target.feature.properties;
|
|
let featureLayer = null;
|
|
if (e.target) {
|
|
featureLayer = e.target;
|
|
} else {
|
|
featureLayer = e;
|
|
}
|
|
iranMapGeo.resetStyle(featureLayer);
|
|
keepMapFeatureColor = null;
|
|
$(`#target${targetAtt.province_id}`).css("transform", "").animate({
|
|
marginTop: "",
|
|
marginBottom: "",
|
|
});
|
|
$(`#target${targetAtt.city_id}`).css("transform", "").animate({
|
|
marginTop: "",
|
|
marginBottom: "",
|
|
});
|
|
$("html .list-province").stop().animate({
|
|
scrollTop: 0,
|
|
});
|
|
}
|
|
|
|
function zoomMapToFeature(e) {
|
|
if ($(".backStack").has("d-none")) {
|
|
$(".backStack")
|
|
.removeClass("d-none")
|
|
.addClass("animate__animated animate__backInLeft");
|
|
} else {
|
|
$(".backStack")
|
|
.addClass("d-none")
|
|
.removeClass("animate__animated animate__backInLeft");
|
|
}
|
|
|
|
let IdProvince = e.target.feature.properties.province_id;
|
|
$.ajax({
|
|
url: "https://rms.rmto.ir/public/contents/provinces/" + IdProvince,
|
|
type: "GET",
|
|
cache: false,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (result) {
|
|
citiesArray = result.data;
|
|
},
|
|
error: function (error) { },
|
|
});
|
|
|
|
let featureLayer = null;
|
|
let featuresLayerCity = [];
|
|
|
|
if (e.target) {
|
|
featureLayer = e.target;
|
|
} else {
|
|
featureLayer = e;
|
|
}
|
|
map.flyToBounds(featureLayer.getBounds());
|
|
showLoaderScreen();
|
|
removeFeaturesFromMap();
|
|
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;
|
|
for (let i = 0; i < fullCityGeoJSONTemp.features.length; i++) {
|
|
for (let j = 0; j < citiesArray.length; j++) {
|
|
if (
|
|
fullCityGeoJSONTemp.features[i].properties.city_id ==
|
|
citiesArray[j].id
|
|
) {
|
|
fullCityGeoJSONTemp.features[i].properties["abrar_process"] =
|
|
citiesArray[j].abrar_process;
|
|
}
|
|
}
|
|
}
|
|
statusSet = true;
|
|
renderprovince(fullCityGeoJSONTemp.features, statusSet);
|
|
|
|
addCityFeaturesToMap();
|
|
}, 1000);
|
|
|
|
setTimeout(function () {
|
|
hideLoaderScreen();
|
|
}, 1500);
|
|
flagProvince = 1;
|
|
iranCityCount = 0;
|
|
}
|
|
$(".backStack").on("click", function () {
|
|
removeFeaturesCity();
|
|
});
|
|
|
|
function onEachFeature(feature, featureLayer) {
|
|
featureLayer.on({
|
|
mouseover: highlightMapFeature,
|
|
mouseout: resetMapFeatureHighlight,
|
|
click: zoomMapToFeature,
|
|
});
|
|
}
|
|
|
|
function onEachCityFeature(feature, featureLayer) {
|
|
featureLayer.on({
|
|
mouseover: highlightMapFeature,
|
|
mouseout: resetMapFeatureHighlight,
|
|
});
|
|
}
|
|
|
|
function getRandomFeatureColor(arrayNum) {
|
|
if (keepMapFeatureColor) {
|
|
return { num: -1, color: keepMapFeatureColor };
|
|
} else {
|
|
return arrayNum.abrar_process >= 83 ? { num: arrayNum, color: "#a366ff" } :
|
|
arrayNum.abrar_process >= 67 ? { num: arrayNum, color: "#80b3ff" } :
|
|
arrayNum.abrar_process >= 50 ? { num: arrayNum, color: "#66cc66" } :
|
|
arrayNum.abrar_process >= 31 ? { num: arrayNum, color: "#ffeda0" } : { num: arrayNum, color: "#ff704d" };
|
|
}
|
|
}
|
|
|
|
function fillcolorCity(featureRow) {
|
|
for (let i = 0; i < fullCityGeoJSONTemp.features.length; i++) {
|
|
if (i == featureRow) {
|
|
return fullCityGeoJSONTemp.features[i].properties;
|
|
}
|
|
}
|
|
}
|
|
|
|
function initStyleCityMapFeatures(feature) {
|
|
let getRandom = getRandomFeatureColor(fillcolorCity(iranCityCount));
|
|
let makeStyle = {
|
|
fillColor: getRandom.color,
|
|
weight: 2,
|
|
opacity: 1,
|
|
color: "white",
|
|
fillOpacity: 0.5,
|
|
};
|
|
|
|
if (iranCityCount == fullCityGeoJSONTemp.features.length) {
|
|
iranCityCount = 0;
|
|
}
|
|
iranCityCount++;
|
|
|
|
return makeStyle;
|
|
}
|
|
|
|
function removeFeaturesFromMap() {
|
|
if (iranMapGeo) {
|
|
map.removeLayer(iranMapGeo);
|
|
}
|
|
}
|
|
|
|
function removeFeaturesCity() {
|
|
if (fullCityGeoJSONTemp.features) {
|
|
map.removeLayer(iranCityMapGeo);
|
|
statusSet = false;
|
|
flagProvince = 0;
|
|
}
|
|
setTimeout(() => {
|
|
iranMapGeo = L.geoJson(iranGeoJSON, {
|
|
style: initStyleMapFeatures,
|
|
onEachFeature: onEachFeature,
|
|
});
|
|
iranMapGeo.addTo(map);
|
|
}, 1000);
|
|
renderprovince(provincesArray);
|
|
}
|
|
setTimeout(() => {
|
|
iranMapGeo = L.geoJson(iranGeoJSON, {
|
|
style: initStyleMapFeatures,
|
|
onEachFeature: onEachFeature,
|
|
});
|
|
iranMapGeo.addTo(map);
|
|
}, 1000);
|
|
|
|
function renderprovince(data, ajaze) {
|
|
if ($(".province-data").children().length) {
|
|
$(".province-data").children().remove();
|
|
}
|
|
data.forEach((element) => {
|
|
if (ajaze) {
|
|
$(".province-data").append(`
|
|
<div class="parent-popup" id=target${element.properties.city_id
|
|
} class="mt-3">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="province-title">${element.properties.city_name
|
|
}</div>
|
|
<div class="ml-5"><span style="color:rgb(255, 159, 107);font-family:IRANSansFaNum">${element.properties.abrar_process
|
|
}%</span></div>
|
|
</div>
|
|
<div class="parent-progressBar-province">
|
|
<div class="progressBar-province" style="width:${element.properties.abrar_process == "-"
|
|
? 5
|
|
: element.properties.abrar_process
|
|
}%"><span class="d-none">${element.properties.abrar_process
|
|
}</span></div>
|
|
</div>
|
|
</div>
|
|
`);
|
|
} else {
|
|
$(".province-data").append(`
|
|
<div class="parent-popup" id=target${element.id} class="mt-3">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="province-title">${element.name_fa}</div>
|
|
<div class="ml-5"><span style="color:rgb(255, 159, 107);font-family:IRANSansFaNum">${element.abrar_process
|
|
}%</span></div>
|
|
</div>
|
|
<div class="parent-progressBar-province">
|
|
<div class="progressBar-province" style="width:${element.abrar_process == "-"
|
|
? 0
|
|
: element.abrar_process
|
|
}%"><span class="d-none">${element.abrar_process
|
|
}</span></div>
|
|
</div>
|
|
</div>
|
|
`);
|
|
}
|
|
});
|
|
|
|
$(".progressBar-province span").each(function (index, element) {
|
|
if ($(element).text() >= "83") {
|
|
$(element).parent().css({
|
|
backgroundColor: "#a366ff",
|
|
height: "100%",
|
|
borderRadius: "10px",
|
|
});
|
|
} else if ($(element).text() >= "67") {
|
|
$(element).parent().css({
|
|
backgroundColor: "#80b3ff",
|
|
height: "100%",
|
|
borderRadius: "10px",
|
|
});
|
|
} else if ($(element).text() >= "50") {
|
|
$(element).parent().css({
|
|
backgroundColor: "#66cc66",
|
|
height: "100%",
|
|
borderRadius: "10px",
|
|
});
|
|
} else if ($(element).text() >= "31") {
|
|
$(element).parent().css({
|
|
backgroundColor: "#ffeda0",
|
|
height: "100%",
|
|
borderRadius: "10px",
|
|
});
|
|
} else {
|
|
$(element).parent().css({
|
|
backgroundColor: "#ff704d",
|
|
height: "100%",
|
|
borderRadius: "10px",
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
$(document).mouseup(function (e) {
|
|
var container = $(".left-menu-view-chartt");
|
|
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
|
$(".left-menu-view-chartt").css("left", "-1600px");
|
|
}
|
|
});
|
|
if ($("#pp1").prop("checked") == true) {
|
|
alert("byyyyyy");
|
|
}
|
|
|
|
function showrahdarkhane() {
|
|
$(".guid-custom-box-rahdar").css("display", "block");
|
|
remove141Layer();
|
|
showLoaderScreen();
|
|
$.get(API_TEST + "/rahdari-points", function (result) {
|
|
data = result.data;
|
|
let markerG = [];
|
|
marker141Layers = L.markerClusterGroup();
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
setIcon = rahdariIconY;
|
|
|
|
if (data[i].lat == null) { }
|
|
if (
|
|
data[i].lat == "-" ||
|
|
data[i].lng == "-" ||
|
|
data[i].lat == "0" ||
|
|
data[i].lng == "0" ||
|
|
data[i].lat == null ||
|
|
data[i].lng == null
|
|
) {
|
|
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);
|
|
// }
|
|
}
|
|
marker141Layers.addLayers(marker141List);
|
|
map.addLayer(marker141Layers);
|
|
hideLoaderScreen();
|
|
});
|
|
|
|
$(".status").on("change", function () {
|
|
remove141Layer();
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
|
|
}
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
|
|
if (this.checked) {
|
|
statusrahdar.push(parseInt(this.value));
|
|
} else {
|
|
var index = statusrahdar.indexOf(parseInt(this.value));
|
|
if (index > -1) {
|
|
statusrahdar.splice(index, 1);
|
|
}
|
|
}
|
|
showLoaderScreen()
|
|
|
|
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
|
province_id: pprahdar,
|
|
status: statusrahdar,
|
|
type: typerahdar,
|
|
}).done(function (data) {
|
|
show_filter_rahdar(data.data, pointrahdar);
|
|
});
|
|
});
|
|
$(".type").on("change", function () {
|
|
remove141Layer();
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
|
|
}
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
|
|
if (this.checked) {
|
|
typerahdar.push(parseInt(this.value));
|
|
} else {
|
|
var index = typerahdar.indexOf(parseInt(this.value));
|
|
if (index > -1) {
|
|
typerahdar.splice(index, 1);
|
|
}
|
|
}
|
|
showLoaderScreen()
|
|
|
|
|
|
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
|
province_id: pprahdar,
|
|
status: statusrahdar,
|
|
type: typerahdar,
|
|
}).done(function (data) {
|
|
|
|
show_filter_rahdar(data.data, pointrahdar);
|
|
});
|
|
});
|
|
}
|
|
|
|
function showAccident251Points() {
|
|
remove141Layer();
|
|
showLoaderScreen();
|
|
|
|
$.get(API_TEST + "/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 label-allpoint-style" 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
|
|
$("#end-date").val(datatext.end_date); //end-date
|
|
})
|
|
.bindPopup(
|
|
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id), { className: "customPopupStyle" }
|
|
);
|
|
markerG.push(marker);
|
|
} catch (e) { }
|
|
}
|
|
marker141Layers = L.layerGroup(markerG);
|
|
map.addLayer(marker141Layers);
|
|
hideLoaderScreen();
|
|
});
|
|
}
|
|
|
|
function showfastreaction() {
|
|
|
|
var showFastReactionPoint = true;
|
|
$("#fastreact_search_option").on("click", function () {
|
|
showLoaderScreen();
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
}
|
|
if (
|
|
$("#fastreact-fromdate").val() != " " &&
|
|
$("#fastreact-todate").val() != " "
|
|
) {
|
|
let startDatefast = moment(
|
|
frommDatefast.getState().selected.year +
|
|
"/" +
|
|
frommDatefast.getState().selected.month +
|
|
"/" +
|
|
frommDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
let endDatefast = moment(
|
|
toDatefast.getState().selected.year +
|
|
"/" +
|
|
toDatefast.getState().selected.month +
|
|
"/" +
|
|
toDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
if (showFastReactionPoint) {
|
|
$.get(
|
|
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
|
"?end-date=" +
|
|
endDatefast +
|
|
"&start-date=" +
|
|
startDatefast, {
|
|
ProvinceId: ppfast,
|
|
FeatureType: featurefast,
|
|
Status: activityfast,
|
|
}
|
|
).done(function (data) {
|
|
hideLoaderScreen();
|
|
show_fast_points(data);
|
|
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
url: API_TEST +
|
|
"/public/homeprojects/fast/points" +
|
|
"?end-date=" +
|
|
endDatefast +
|
|
"&start-date=" +
|
|
startDatefast,
|
|
type: "GET",
|
|
success: function (result) {
|
|
hideLoaderScreen();
|
|
show_point(result.data);
|
|
},
|
|
error: function (error) { },
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
$(".FeatureType").on("change", function () {
|
|
showLoaderScreen();
|
|
let startDatefeauture = moment(
|
|
frommDatefast.getState().selected.year +
|
|
"/" +
|
|
frommDatefast.getState().selected.month +
|
|
"/" +
|
|
frommDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
let endDatefeautre = moment(
|
|
toDatefast.getState().selected.year +
|
|
"/" +
|
|
toDatefast.getState().selected.month +
|
|
"/" +
|
|
toDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
remove141Layer();
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
}
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
|
|
if (this.checked) {
|
|
featurefast.push(parseInt(this.value));
|
|
} else {
|
|
var index = featurefast.indexOf(parseInt(this.value));
|
|
if (index > -1) {
|
|
featurefast.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
$.get(
|
|
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
|
"?end-date=" +
|
|
endDatefeautre +
|
|
"&start-date=" +
|
|
startDatefeauture, {
|
|
ProvinceId: ppfast,
|
|
FeatureType: featurefast,
|
|
Status: activityfast,
|
|
}
|
|
).done(function (data) {
|
|
hideLoaderScreen();
|
|
show_fast_points(data);
|
|
|
|
});
|
|
});
|
|
$(".activity").on("change", function () {
|
|
showLoaderScreen();
|
|
let startDateactivity = moment(
|
|
frommDatefast.getState().selected.year +
|
|
"/" +
|
|
frommDatefast.getState().selected.month +
|
|
"/" +
|
|
frommDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
let enddateacitivity = moment(
|
|
toDatefast.getState().selected.year +
|
|
"/" +
|
|
toDatefast.getState().selected.month +
|
|
"/" +
|
|
toDatefast.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
remove141Layer();
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
}
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
|
|
if (this.checked) {
|
|
activityfast.push(parseInt(this.value));
|
|
} else {
|
|
var index = activityfast.indexOf(parseInt(this.value));
|
|
if (index > -1) {
|
|
activityfast.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
$.get(
|
|
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
|
"?end-date=" +
|
|
enddateacitivity +
|
|
"&start-date=" +
|
|
startDateactivity, {
|
|
ProvinceId: ppfast,
|
|
FeatureType: featurefast,
|
|
Status: activityfast,
|
|
}
|
|
).done(function (data) {
|
|
hideLoaderScreen();
|
|
show_fast_points(data);
|
|
|
|
});
|
|
});
|
|
|
|
}
|
|
|
|
function showallpoint() {
|
|
remove141Layer();
|
|
showLoaderScreen();
|
|
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
}
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
$.ajax({
|
|
url: API_TEST + "/accident-points",
|
|
type: "GET",
|
|
success: function (result) {
|
|
let roadAccidentPoints = result.data;
|
|
hideLoaderScreen();
|
|
|
|
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();
|
|
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);
|
|
$("#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);
|
|
$("#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 label-allpoint-style" 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) { }
|
|
}
|
|
marker141Layers = L.layerGroup(markerG);
|
|
map.addLayer(marker141Layers);
|
|
},
|
|
error: function (error) { },
|
|
});
|
|
}
|
|
|
|
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 row col-12">\
|
|
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.operation +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent">\
|
|
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.target +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.actions +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.cost +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point btn btn-danger" 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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
(data.operation ? data.operation : "-") +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
(data.target ? data.target : "-") +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
(data.actions ? data.actions : "-") +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.cost +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
(data.end_date ? data.end_date : "-") +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point btn btn-danger" 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 row col-12">\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> ابتدای محور</span><div class="popUpBoxContent">' +
|
|
data.axis_start +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> انتهای محور</span><div class="popUpBoxContent">' +
|
|
data.axis_end +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
|
data.distance +
|
|
" " +
|
|
"کیلومتر" +
|
|
'</div> </div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
|
data.geometric_desc +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div> </div>\
|
|
<div class="col-4" style="text-align:center"><span class="header-popupcontent-allpoints"> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point btn btn-danger" 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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.operation +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.target +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.actions +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.cost +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
data.accident251_point.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
(data.operation ? data.operation : "-") +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
(data.target ? data.target : "-") +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
(data.actions ? data.actions : "-") +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.cost +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
(data.end_date ? data.end_date : "-") +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </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 row col-12">\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> ابتدای محور</span><div class="popUpBoxContent">' +
|
|
data.axis_start +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> انتهای محور</span><div class="popUpBoxContent">' +
|
|
data.axis_end +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
|
data.distance +
|
|
" " +
|
|
"کیلومتر" +
|
|
'</div> </div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
|
data.geometric_desc +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div> </div>\
|
|
<div class="col-4" style="text-align:center"><span class="header-popupcontent-allpoints"> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
"</div></div>\
|
|
</div>\
|
|
</div>"
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
function showLoaderScreen() {
|
|
$(".divloader").css("display", "flex").hide().fadeIn();
|
|
}
|
|
|
|
function hideLoaderScreen() {
|
|
$(".divloader").fadeOut();
|
|
}
|
|
|
|
function remove141Layer() {
|
|
if (marker141Layers != null) {
|
|
marker141List = [];
|
|
map.removeLayer(marker141Layers);
|
|
}
|
|
|
|
if (marker141LayersWithoutCluster != null) {
|
|
map.removeLayer(marker141LayersWithoutCluster);
|
|
}
|
|
}
|
|
|
|
function getpopcounterrahdari(data, num) {
|
|
var deactive;
|
|
if (data.status == 1) {
|
|
var deactive = '<div class="popUpBoxContent">فعال</div>'
|
|
} else {
|
|
var deactive = '<div class="popUpBoxContent">غیر فعال</div>'
|
|
}
|
|
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>' +
|
|
deactive +
|
|
'</div>\
|
|
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
|
returntype(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="showrahdarModalcoridor(' +
|
|
data.id +
|
|
')">بروزرسانی</button>\
|
|
</div>\
|
|
</div>'
|
|
);
|
|
}
|
|
|
|
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 row col-12">\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
data.operation +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
data.target +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter col-12">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
data.actions +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.cost +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
data.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point btn btn-danger" 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 row col-12">\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
|
data.operation +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
|
data.target +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter col-12">\
|
|
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
|
data.actions +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
|
data.cost +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
|
data.progress +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
|
data.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
"</div></div>\
|
|
</div>"
|
|
);
|
|
}
|
|
}
|
|
|
|
function getPopupContentcampNew(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_fa +
|
|
"، محور: " +
|
|
data.axis_name +
|
|
'</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> نوع محور </span><div class="popUpBoxContent">' +
|
|
data.axis_type_fa +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> علت انسداد </span><div class="popUpBoxContent">' +
|
|
data.blockage_cause_fa +
|
|
'</div></div> </div>\
|
|
<div class="popupFooter col-12">\
|
|
<span class="header-popupcontent-allpoints"> طول راه </span><div class="popUpBoxContent">' +
|
|
data.blockage_length +
|
|
'</div> </div>\
|
|
</div>\
|
|
<div class="popupContent row col-12">\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد عوامل راهدار فعال در محور </span><div class="popUpBoxContent">' +
|
|
data.active_rahdar_count +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد ماشین الات فعال در محور </span><div class="popUpBoxContent">' +
|
|
data.active_cars_count +
|
|
"٪" +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> براورد اولیه خسارت </span><div class="popUpBoxContent">' +
|
|
data.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ انسداد </span><div class="popUpBoxContent">' +
|
|
data.end_date +
|
|
'</div></div>\
|
|
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> پیش بینی تاریخ بازگشایی </span><div class="popUpBoxContent">' +
|
|
data.prediction_time_fa +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ بازگشایی </span><div class="popUpBoxContent">' +
|
|
data.is_open_type_fa +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point btn btn-danger" 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_fa}
|
|
، محور:
|
|
${data.axis_name}
|
|
</div>
|
|
<div class="popupContent row col-12">
|
|
<div class="popUpBox col-5" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> نوع محور </span><div class="popUpBoxContent">
|
|
${data.axis_type_fa}
|
|
</div></div>
|
|
<div class="popUpBox col-5" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> علت انسداد </span><div class="popUpBoxContent">
|
|
${data.blockage_cause_fa}
|
|
</div></div> </div>
|
|
<div class="popupFooter col-12">
|
|
<span class="header-popupcontent-allpoints"> طول راه </span><div class="popUpBoxContent">
|
|
${data.blockage_length}
|
|
</div> </div>
|
|
</div>
|
|
<div class="popupContent row col-12">
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد عوامل راهدار فعال در محور </span><div class="popUpBoxContent">
|
|
${data.active_rahdar_count == undefined ? "" : data.active_rahdar_count
|
|
}
|
|
</div></div>
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد ماشین الات فعال در محور </span><div class="popUpBoxContent">
|
|
% ${data.active_cars_count == undefined
|
|
? ""
|
|
: data.active_cars_count
|
|
}
|
|
|
|
</div></div>
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> براورد اولیه خسارت </span><div class="popUpBoxContent">
|
|
${data.blockage_damage_money == undefined
|
|
? ""
|
|
: data.blockage_damage_money
|
|
}
|
|
</div></div>
|
|
<div class="popUpBox col-5" style="border-left:2px solid #ff5c0f; text-align:center; justify-content: center; border-bottom: 2px solid #ff5c0f; margin-top: 0px;"><span class="header-popupcontent-allpoints"> تاریخ انسداد </span><div class="popUpBoxContent">
|
|
${data.end_date == undefined ? "" : data.end_date}
|
|
</div></div>
|
|
<div class="popUpBox col-5" style="text-align:center; justify-content: center; border-bottom: 2px solid #ff5c0f; margin-top: 0px;"><span class="header-popupcontent-allpoints"> پیش بینی تاریخ بازگشایی </span><div class="popUpBoxContent">
|
|
${data.prediction_time_fa}
|
|
</div></div>
|
|
</div>
|
|
<div class="popupContent popUpBox col-5" style="text-align:center; padding: 2%;"><span class="header-popupcontent-allpoints" style:"color: #0051cd !important; font-size: 9px !important;"> تاریخ بازگشایی </span><div class="popUpBoxContent">
|
|
${data.is_open_type_fa == null ? "" : data.is_open_type_fa}
|
|
</div></div>
|
|
</div>`;
|
|
}
|
|
}
|
|
|
|
function getPopupContentRahdar(data, edit_id) {
|
|
var deactive;
|
|
if (data.status == 1) {
|
|
var deactive = '<div class="popUpBoxContent">فعال</div>'
|
|
} else {
|
|
var deactive = '<div class="popUpBoxContent">غیر فعال</div>'
|
|
}
|
|
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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
|
deactive +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
|
returntype(data.type) +
|
|
'</div></div>\
|
|
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
|
data.phone +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
|
data.team_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
|
data.staff_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
|
data.responsible_name +
|
|
"<br>" +
|
|
data.responsible_mobile +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
|
data.successor_name +
|
|
"<br>" +
|
|
data.successor_mobile +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
|
data.machines_light +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_sheavy +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_heavy +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button" style="display:none">\
|
|
<button class="popup-btn-edit-point btn btn-danger" onclick="showrahdarModal(' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
", " +
|
|
parseFloat(data.l).toFixed(5) +
|
|
')">بروزرسانی</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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
|
deactive +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
|
returntype(data.type) +
|
|
'</div></div>\
|
|
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
|
data.phone +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
|
data.team_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
|
data.staff_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
|
data.responsible_name +
|
|
"<br>" +
|
|
data.responsible_mobile +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
|
data.successor_name +
|
|
"<br>" +
|
|
data.successor_mobile +
|
|
'</div></div>\
|
|
<div class=" col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
|
data.machines_light +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_sheavy +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_heavy +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
"</div></div>\
|
|
</div>\
|
|
</div>"
|
|
);
|
|
}
|
|
}
|
|
// popup coridor
|
|
function getPopupContentCoridor(data) {
|
|
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 row col-12">\
|
|
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
|
data.status +
|
|
'</div></div>\
|
|
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
|
data.type +
|
|
'</div></div>\
|
|
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
|
data.responsible_mobile +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
|
data.team_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
|
data.staff_num +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
|
data.responsible_name +
|
|
"<br>" +
|
|
data.responsible_mobile +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
|
data.successor_name +
|
|
"<br>" +
|
|
data.successor_mobile +
|
|
'</div></div>\
|
|
<div class=" col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
|
data.machines_light +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_sheavy +
|
|
'</div></div>\
|
|
<div class="col-4" style="border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
|
data.machines_heavy +
|
|
'</div></div>\
|
|
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lat).toFixed(5) +
|
|
'</div></div>\
|
|
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
|
parseFloat(data.lng).toFixed(5) +
|
|
'</div></div>\
|
|
</div>\
|
|
<div class="popupContent-button">\
|
|
<button class="popup-btn-edit-point" onclick="showcoridorfinall(' +
|
|
data.id +
|
|
')">بروزرسانی</button>\
|
|
<button class="popup-btn-edit-point" onclick="deletecoridor(' +
|
|
data.id +
|
|
')">حذف</button>\
|
|
</div>\
|
|
</div>'
|
|
);
|
|
|
|
}
|
|
//popup coridor
|
|
|
|
|
|
function showAccidentPointEditModal() {
|
|
$("#allpointedit").modal("show");
|
|
}
|
|
$("#editpoints").on("click", function () {
|
|
saveEditedPoint();
|
|
});
|
|
|
|
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]
|
|
);
|
|
}
|
|
|
|
$("#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) {
|
|
showAccident251Points();
|
|
},
|
|
error: function (error) {
|
|
hideLoaderScreen();
|
|
},
|
|
});
|
|
/*} else {
|
|
$('#sliderphysici').find('.slider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
|
$('#sliderphysici').find('.slider-label').css('color', 'red');
|
|
}*/
|
|
}
|
|
}
|
|
$("#alleditpoints").on("click", function () {
|
|
saveAccidentEditedPoint();
|
|
});
|
|
|
|
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]
|
|
);
|
|
}
|
|
$("#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) {
|
|
showRoadAccidentLayerWithoutCluster();
|
|
},
|
|
error: function (error) {
|
|
hideLoaderScreen();
|
|
},
|
|
});
|
|
}
|
|
}
|
|
|
|
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 showrahdarModal(start, end) {
|
|
$("#deviceImg1Preview").removeAttr("src");
|
|
$("#deviceImg2Preview").removeAttr("src");
|
|
$("#deviceImg3Preview").removeAttr("src");
|
|
$("#deviceImg4Preview").removeAttr("src");
|
|
$("#deviceImg5Preview").removeAttr("src");
|
|
$("#deviceImg1").val("");
|
|
$("#deviceImg2").val("");
|
|
$("#deviceImg3").val("");
|
|
$("#deviceImg4").val("");
|
|
$("#deviceImg5").val("");
|
|
|
|
$("#deviceImg1Title").css("display", "");
|
|
$("#deviceImg2Title").css("display", "");
|
|
$("#deviceImg3Title").css("display", "");
|
|
$("#deviceImg4Title").css("display", "");
|
|
$("#deviceImg5Title").css("display", "");
|
|
|
|
$("#deleteDeviceImg1").prop("disabled", true);
|
|
$("#deleteDeviceImg2").prop("disabled", true);
|
|
$("#deleteDeviceImg3").prop("disabled", true);
|
|
$("#deleteDeviceImg4").prop("disabled", true);
|
|
$("#deleteDeviceImg5").prop("disabled", true);
|
|
$("#houserahdar").prop("disabled", false);
|
|
$(".basic").spectrum({
|
|
color: "#fff",
|
|
change: function (color) {
|
|
$("#basic-log").text("رنگ " + color.toHexString());
|
|
globalcolor = color.toHexString();
|
|
},
|
|
});
|
|
$("#rahdaredit").modal("show");
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#editrahdar").on("click", function () {
|
|
saveRahdariEdited();
|
|
});
|
|
|
|
function saveRahdariEdited() {
|
|
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=modalUpFileRah |