|
@@ -48,6 +48,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
missionschedule_planpoint_clusterLayer = null;
|
|
|
regionid = "";
|
|
|
regionname = "";
|
|
|
+ realName = "";
|
|
|
|
|
|
copyPopup = null;
|
|
|
devices_selected = [];
|
|
@@ -55,6 +56,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
currentRegionPolygon = null;
|
|
|
drawToolbar = null;
|
|
|
dataTable_r = null;
|
|
|
+ dataTable_User = null;
|
|
|
dataTable_current = null;
|
|
|
dataTable_current_list = {};
|
|
|
objectIdsStr = {};
|
|
@@ -416,6 +418,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
maxHeight:200,
|
|
|
inheritClass: false
|
|
|
}).multiselect("enable");
|
|
|
+ this.domObj.find(".xunjianUser").attr("disabled",false)
|
|
|
|
|
|
}else{
|
|
|
|
|
@@ -426,6 +429,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
maxHeight:200,
|
|
|
inheritClass: false
|
|
|
}).multiselect("disable");
|
|
|
+ this.domObj.find(".xunjianUser").attr("disabled",true)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -698,10 +702,10 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.map.removeLayer(this.missionschedule_planpoint_clusterLayer);
|
|
|
this.missionschedule_planpoint_clusterLayer = null;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
this.domObj.find('.btn_search').off("click").on("click", function () {
|
|
|
-
|
|
|
+ this.getAllUserList();
|
|
|
}.bind(this));
|
|
|
|
|
|
this.domObj.find('.btn_previous_step').off("click").on("click", function () {
|
|
@@ -720,6 +724,11 @@ class MissionSchedule extends BaseWidget {
|
|
|
}
|
|
|
var that = this;
|
|
|
this.domObj.find('.widget-planregion_deviceselect .btn_search').hide();
|
|
|
+ if(this.xunjianSelectVal != "巡检区域"){
|
|
|
+ this.domObj.find('.btn_removeall').hide();
|
|
|
+ this.domObj.find('.btn_select').hide();
|
|
|
+ this.domObj.find('.btn_part_removeall').hide();
|
|
|
+ }
|
|
|
this.addData.objectIds = undefined;
|
|
|
this.addData.gisUrl = undefined;
|
|
|
this.addData.gisInfo = undefined;
|
|
@@ -857,9 +866,11 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.addData.gisInfo = xjlist;
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.regionid == "") {
|
|
|
- this.toast.Show("请选择片区!");
|
|
|
- return;
|
|
|
+ if (this.regionid == "" && this.xunjianSelectVal == "巡检区域") {
|
|
|
+
|
|
|
+ this.toast.Show("请选择片区!");
|
|
|
+ return;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
if (this.addData && this.objectids.length == 0 && this.addData.objectIds == "") {
|
|
@@ -1332,7 +1343,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.objectIdsStr = {};
|
|
|
this.gisUrlList = {};
|
|
|
}
|
|
|
- if(this.xunjianSelectVal = "巡检片区"){
|
|
|
+ if(this.xunjianSelectVal == "巡检区域"){
|
|
|
this.domObj.empty().append(this.template.split('$$')[2]);
|
|
|
this.initEvent3();
|
|
|
}else{
|
|
@@ -2584,7 +2595,248 @@ class MissionSchedule extends BaseWidget {
|
|
|
],
|
|
|
});
|
|
|
}
|
|
|
+ getAllUserList(){
|
|
|
+
|
|
|
+ this.loadWait.show("正在查询人员,请等待...", this.domObj);
|
|
|
+ let that = this;
|
|
|
+ if (that.dataTable_User) {
|
|
|
+ that.dataTable_User.destroy();
|
|
|
+ }
|
|
|
+ that.dataTable_User = $(that.domObj.find("#planuserlist_table")[0]).DataTable({
|
|
|
+ dom: 't' +
|
|
|
+ ' <"row"' +
|
|
|
+ ' <" information"ri>' +
|
|
|
+ ' <" length-changing"l>' +
|
|
|
+ ' <" pull-right pagination"p>' +
|
|
|
+ ' <" turnToolbar">' +
|
|
|
+ ' >',
|
|
|
+ language: {
|
|
|
+ "lengthMenu": "每页_MENU_条",
|
|
|
+ "zeroRecords": "未查询到任何记录",
|
|
|
+ "info": "共 _TOTAL_ 条",
|
|
|
+ "infoEmpty": "",
|
|
|
+ "infoFiltered": "",
|
|
|
+ "processing": "查询中,请稍等...",
|
|
|
+ "paginate": {
|
|
|
+ "first": "首页",
|
|
|
+ "last": "尾页",
|
|
|
+ "next": ">",
|
|
|
+ "previous": "<"
|
|
|
+ },
|
|
|
+ "search": "搜索: ",
|
|
|
+ },
|
|
|
+ pagingType: "simple",
|
|
|
+ paging: true,
|
|
|
+ scrollCollapse: false,
|
|
|
+ processing: true,
|
|
|
+ scrollX: true,
|
|
|
+ scrollY: "calc(100% - 50px)",
|
|
|
+ ordering: false,
|
|
|
+ lengthMenu: [10, 20, 50],
|
|
|
+ drawCallback: function (settings) {
|
|
|
+ $(settings.nTable).find("tbody tr").off().click(function (e) {
|
|
|
+ that.devices_selected = [];
|
|
|
+ that.devices_selected_layers.clear();
|
|
|
+ let dom = $(e.currentTarget).find(".getInfo");
|
|
|
+ if (dom.data("realname") == null) {
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ that.realName = dom.data("realname");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ that.serachEquipmentByUser(that.addData.deviceTypeIds,that.realName)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $(settings.nTable).find("tbody").on("mouseover","tr",function(e){
|
|
|
+ $(settings.nTable).find("tbody tr.active").removeClass("active");
|
|
|
+ $(e.currentTarget).addClass("active");
|
|
|
+ });
|
|
|
+
|
|
|
+ let dom = $(settings.nTableWrapper);
|
|
|
+ let pageInfo = that.dataTable_User.page.info();
|
|
|
+ let addPosi = dom.find(".previous");
|
|
|
+ let pagehtml = '<li class="addPageInfo"><span>第' + (parseInt(pageInfo.page) + 1) + '页/共' + pageInfo.pages + '页</span></li>';
|
|
|
+ addPosi.after(pagehtml);
|
|
|
+
|
|
|
+ let turnAddPosi = dom.find('.turnToolbar');
|
|
|
+ let turnpagehtml = '<input type="number" class="addPageIndexInput" value="' + (parseInt(pageInfo.page) + 1) + '" /> <button type="button" class="btn btn-sm btn-default addPageIndexButton">跳转</button>'
|
|
|
+ turnAddPosi.empty().append(turnpagehtml);
|
|
|
+ turnAddPosi.find('.addPageIndexButton').off().click(e => {
|
|
|
+ let pageIndex = (turnAddPosi.find('.addPageIndexInput').val());
|
|
|
+ if (pageIndex > 0 && pageIndex <= pageInfo.pages) {
|
|
|
+ that.dataTable_User.deafultPageIndex = pageIndex;
|
|
|
+ that.dataTable_User.ajax.reload();
|
|
|
+ } else {
|
|
|
+ that.dataTable_User.deafultPageIndex = -10;
|
|
|
+ that.toast.show("跳转页数超过查询范围请重新设置!");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.bind(that),
|
|
|
+ serverSide: true,
|
|
|
+ ajax: {
|
|
|
+ headers: that.header,
|
|
|
+ type: "GET",
|
|
|
+ data: function (e) {
|
|
|
+ let start = (e['start'] / e['length']) + 1;
|
|
|
+ if (that.dataTable_User && that.dataTable_User.deafultPageIndex && that.dataTable_User.deafultPageIndex != -10) {
|
|
|
+ start = parseInt(that.dataTable_User.deafultPageIndex);
|
|
|
+ that.dataTable_User.context[0]._iDisplayStart = (start - 1) * that.dataTable_User.context[0]._iDisplayLength
|
|
|
+ that.dataTable_User.deafultPageIndex = -10;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ "current": start || that.config.pagenumber,
|
|
|
+ "size": e['length'] || that.config.pagesize,
|
|
|
+ "realName": that.domObj.find(".serchcontent").val(),
|
|
|
+ }
|
|
|
+ },
|
|
|
+ url: that.apiRoot + that.config.getAllUserList,
|
|
|
+ dataType: "json",
|
|
|
+ async: true,
|
|
|
+ error: function (e) {
|
|
|
+ that.loadWait.hide();
|
|
|
+ that.toast.show("人员查询失败");
|
|
|
+ console.error(e);
|
|
|
+ },
|
|
|
+ dataSrc: function (results) {
|
|
|
+ if (results.code == 1) {
|
|
|
+ var value = results;
|
|
|
+ results = {};
|
|
|
+
|
|
|
+ value.recordsFiltered = value.result.total;
|
|
|
+ results.data = [];
|
|
|
+ if (value.result.records.length == 0) {
|
|
|
+
|
|
|
+ that.loadWait.hide();
|
|
|
+ return results.data;
|
|
|
+ };
|
|
|
+ $.each(value.result.records, function (i, item) {
|
|
|
+ results.data.push({
|
|
|
+ realName: "<span class='getInfo' data-user_id='" + that.ajaxSend.setNullAndUndefined(item.id)
|
|
|
+ + "' data-realName='" + that.ajaxSend.setNullAndUndefined(item.realName)
|
|
|
+ + "' title='" + that.ajaxSend.setNullAndUndefined(item.realName) + "'>" + that.ajaxSend.setNullAndUndefined(item.realName) + "</span>",
|
|
|
+ roleName: "<span title='" + that.ajaxSend.setNullAndUndefined(item.roleName) + "'>" + that.ajaxSend.setNullAndUndefined(item.roleName) + "</span>",
|
|
|
+ lockFlagName: "<span title='" + that.ajaxSend.setNullAndUndefined(item.lockFlagName) + "'>" + that.ajaxSend.setNullAndUndefined(item.lockFlagName) + "</span>",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ that.loadWait.hide();
|
|
|
+ return results.data;
|
|
|
+ } else {
|
|
|
+ that.toast.show(results.message);
|
|
|
+ console.error(results.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ { "data": "realName" },
|
|
|
+ { "data": "roleName" },
|
|
|
+ { "data": "lockFlagName" },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ serachEquipmentByUser(device_type_id,userName){
|
|
|
+ var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
|
|
|
+ var devicetype = this.getDeviceType(device_type_id);
|
|
|
+ var fields = this.getLayerShowFieldNames(devicetype.cnContactLayerName);
|
|
|
+ if (devicetype == null) return;
|
|
|
+ this.loadWait.show("正在检查信息,请等待...", this.domObj);
|
|
|
+ var where = "PROCENSOR like '%"+userName+"%'";
|
|
|
+ if (devicetype.sqlfilter != null && devicetype.sqlfilter.length > 0)
|
|
|
+ where += " and " + devicetype.sqlfilter;
|
|
|
+ var param = { "where": where, "spatialRel": "esriSpatialRelIntersects", "returnGeometry": false,"returnIdsOnly": true, "f": "json" };
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: url + "/" + devicetype.contactLayerId + "/query",
|
|
|
+ cache: false,
|
|
|
+ data: param,
|
|
|
+ dataType: "json",
|
|
|
+ success: function (response) {
|
|
|
+ if (response.error !== undefined) {
|
|
|
+ this.AppX.runtimeConfig.toast.Show("查询失败,请联系管理员");
|
|
|
+ this.loadWait.hide();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let outfields = fields.map(e => { return e.name })
|
|
|
+ if (!response.objectIds) {
|
|
|
+ this.loadWait.hide();
|
|
|
+ this.AppX.runtimeConfig.toast.Show("查询无果,该巡检人员没有绑定的设备");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.getPlanDeviceList();
|
|
|
+ this.gp = new Geoprocessor(this.analyzeUrl);
|
|
|
+ let data = _.union(response.objectIds, this.objectids);
|
|
|
+ this.objectids = data;
|
|
|
+ this.addData.objectIds = _.join(this.objectids, ",");
|
|
|
+ let layerName = "";
|
|
|
+ layerName = devicetype.cnContactLayerName;
|
|
|
+ var options = {
|
|
|
+ "layername": layerName,
|
|
|
+ "objectids": this.objectids.join(","),
|
|
|
+ "outfields": outfields.join(","),
|
|
|
+ usertoken: this.AppX.appConfig.gisToken
|
|
|
+ };
|
|
|
+ var delayResult = this.gp.submitJob(
|
|
|
+ options,
|
|
|
+ function (jobinfo) {
|
|
|
+ if (this.dynamicMapServer) {
|
|
|
+ this.map.removeLayer(this.dynamicMapServer);
|
|
|
+ this.dynamicMapServer = null;
|
|
|
+ }
|
|
|
+ let mapServerUrl = this.mapServerUrl + "/jobs/" + jobinfo.jobId;
|
|
|
+ this.addData.gisUrl = url + "/" + devicetype.contactLayerId + "/query";
|
|
|
+ $.ajax({
|
|
|
+ type: "get",
|
|
|
+ dataType: "json",
|
|
|
+ url: this.analyzeUrl + "/jobs/" + jobinfo.jobId + "/" + jobinfo.results.summary.paramUrl + "?f=pjson",
|
|
|
+ success: function (result) {
|
|
|
+ this.domObj.find(".pipeTypeLength").text(result.value.result.summary.layersummary[0].length);
|
|
|
+ }.bind(this)
|
|
|
+ })
|
|
|
+ this.dynamicMapServer = new ArcGISDynamicMapServiceLayer(mapServerUrl);
|
|
|
+ this.dynamicMapServer.id = this.preLayerId + "dynamicMapServer";
|
|
|
+ this.map.addLayer(this.dynamicMapServer);
|
|
|
+ this.addSelectItems(this);
|
|
|
+ this.loadWait.hide();
|
|
|
+ }.bind(this),
|
|
|
+ function (jobinfo) {
|
|
|
+ this.jobid = jobinfo.jobId;
|
|
|
+ }.bind(this),
|
|
|
+ function (jobinfo) {
|
|
|
+ this.AppX.runtimeConfig.toast.show("分析失败,请联系管理员");
|
|
|
+ this.loadWait.hide();
|
|
|
+ console.error(jobinfo);
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.bind(this),
|
|
|
+ error: function (results) {
|
|
|
+ this.loadWait.hide();
|
|
|
+ this.toast.Show("查询巡检信息出错!");
|
|
|
+ }.bind(this)
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
* @function 获取存在该类型的片区,加载到地图上
|
|
|
*/
|