|
@@ -67,7 +67,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
dataTable_all_searchInfo = {};
|
|
|
addData = {
|
|
|
companyid: undefined,
|
|
|
- deviceTypeId: undefined,
|
|
|
+ deviceTypeIds: undefined,
|
|
|
intervalDays: undefined,
|
|
|
periodId: undefined,
|
|
|
planBegindate: undefined,
|
|
@@ -76,10 +76,14 @@ class MissionSchedule extends BaseWidget {
|
|
|
pointInfo: undefined,
|
|
|
regionId: undefined,
|
|
|
userId: undefined,
|
|
|
+ synergyUserIds:undefined,
|
|
|
description: undefined,
|
|
|
planRate: undefined,
|
|
|
geoType: undefined,
|
|
|
gisInfo: undefined,
|
|
|
+ gisInfoList:[
|
|
|
+
|
|
|
+ ],
|
|
|
gisUrl: undefined,
|
|
|
objectIds: undefined
|
|
|
}
|
|
@@ -301,7 +305,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
addDataReset() {
|
|
|
this.addData = {
|
|
|
companyid: undefined,
|
|
|
- deviceTypeId: undefined,
|
|
|
+ deviceTypeIds: undefined,
|
|
|
intervalDays: undefined,
|
|
|
periodId: undefined,
|
|
|
planBegindate: undefined,
|
|
@@ -310,10 +314,12 @@ class MissionSchedule extends BaseWidget {
|
|
|
pointInfo: undefined,
|
|
|
regionId: undefined,
|
|
|
userId: undefined,
|
|
|
+ synergyUserIds:undefined,
|
|
|
description: undefined,
|
|
|
planRate: undefined,
|
|
|
geoType: undefined,
|
|
|
gisInfo: undefined,
|
|
|
+ gisInfoList:[],
|
|
|
gisUrl: undefined,
|
|
|
objectIds: undefined
|
|
|
}
|
|
@@ -345,16 +351,60 @@ class MissionSchedule extends BaseWidget {
|
|
|
|
|
|
this.domObj.find('.department').off("change").on("change", function () {
|
|
|
this.getUser(selectType.single, this.domObj.find(".department").val());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $('option', $('.subUsers')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
}.bind(this));
|
|
|
- this.domObj.find('.plantype').off("change").on("change", function () {
|
|
|
- var pointType = this.domObj.find(".plantype option:selected").attr("data-type");
|
|
|
- var pointTxt = this.domObj.find(".plantype option:selected").html();
|
|
|
- if(pointType == "0" && pointTxt != "巡检点"){
|
|
|
- this.domObj.find(".users").attr("multiple","multiple");
|
|
|
+ this.domObj.find(".users").off("change").on("change",function () {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var selectedUserVal = this.domObj.find(".users option:selected").val();
|
|
|
+ var subUsersOptions = this.domObj.find(".subUsers option");
|
|
|
+ for(var i=0;i<subUsersOptions.length;i++){
|
|
|
+ if($(subUsersOptions[i]).val() == selectedUserVal){
|
|
|
+ subUsersOptions[i].disabled = true;
|
|
|
+ }else{
|
|
|
+ subUsersOptions[i].disabled = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var selectedTypeVal = this.domObj.find(".planpointtype option:selected").val();
|
|
|
+
|
|
|
+ if(selectedTypeVal == "1"){
|
|
|
+ this.domObj.find(".subUsers").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("disable");
|
|
|
+ }else{
|
|
|
+ this.domObj.find(".subUsers").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.bind(this))
|
|
|
+ this.domObj.find('.planpointtype').off("change").on("change", function () {
|
|
|
+ var pointType = this.domObj.find(".planpointtype option:selected").attr("data-type");
|
|
|
+ var pointVal = this.domObj.find(".planpointtype option:selected").val();
|
|
|
+ if(pointType == "0" && pointVal != "1" && pointVal != "2"){
|
|
|
+
|
|
|
+ this.domObj.find(".subUsers").multiselect("enable");
|
|
|
}else{
|
|
|
- this.domObj.find(".users").removeAttr("multiple");
|
|
|
+
|
|
|
+ this.domObj.find(".subUsers").multiselect("disable");
|
|
|
}
|
|
|
- $('option', $('.users')).each(function(element) {
|
|
|
+ $('option', $('.subUsers')).each(function(element) {
|
|
|
$(this).removeAttr('selected').prop('selected', false);
|
|
|
});
|
|
|
|
|
@@ -363,6 +413,70 @@ class MissionSchedule extends BaseWidget {
|
|
|
inheritClass: false
|
|
|
});
|
|
|
}.bind(this));
|
|
|
+ this.domObj.find('.planlinetype').off("change").on("change", function () {
|
|
|
+
|
|
|
+
|
|
|
+ this.domObj.find(".subUsers").multiselect("disable");
|
|
|
+ $('option', $('.users')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.bind(this));
|
|
|
+ this.domObj.find('input[type=radio][name=typeSelect]').off("change").on("change",function () {
|
|
|
+ if($("input:radio[name='typeSelect']:checked").val() =="0"){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $('option', $('.subUsers')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ $('option', $('.planpointtype')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ $('option', $('.planlinetype')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ this.domObj.find(".planpointtype").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("enable");
|
|
|
+ this.domObj.find(".planlinetype").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("disable");
|
|
|
+ }else if($("input:radio[name='typeSelect']:checked").val() =="1"){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $('option', $('.planpointtype')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ $('option', $('.planlinetype')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ this.domObj.find(".planlinetype").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("enable");
|
|
|
+ this.domObj.find(".planpointtype").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("disable");
|
|
|
+ this.domObj.find(".subUsers").multiselect("disable");
|
|
|
+ $('option', $('.subUsers')).each(function(element) {
|
|
|
+ $(this).removeAttr('selected').prop('selected', false);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }.bind(this))
|
|
|
|
|
|
if (this.addData.planBegindate) {
|
|
|
this.domObj.find('.plan_begindate').val(this.addData.planBegindate.split(" ")[0]);
|
|
@@ -398,8 +512,27 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.domObj.find('.btn_next_step').off("click").on("click", function () {
|
|
|
|
|
|
|
|
|
+ var pointAndLineId = [];
|
|
|
this.addData.companyid = parseInt(this.domObj.find('.department option:selected').val());
|
|
|
- this.addData.deviceTypeId = parseInt(this.domObj.find('.plantype option:selected').data("device_type_id"));
|
|
|
+ if($("input:radio[name='typeSelect']:checked").val() =="0"){
|
|
|
+
|
|
|
+ var brands = $('.planpointtype option:selected');
|
|
|
+ $(brands).each(function(index, brand){
|
|
|
+ pointAndLineId.push(Number(($(brand).attr("data-device_type_id"))));
|
|
|
+ this.addData.geoType = $(brand).attr("data-type");
|
|
|
+ }.bind(this));
|
|
|
+ }else if($("input:radio[name='typeSelect']:checked").val() =="1"){
|
|
|
+ var brands = $('.planlinetype option:selected');
|
|
|
+ this.addData.geoType = "1";
|
|
|
+ $(brands).each(function(index, brand){
|
|
|
+ pointAndLineId.push(Number($(brand).attr("data-device_type_id")));
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ if(pointAndLineId.length > 1){
|
|
|
+ this.toast.Show("暂不支持巡检类型多选");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.addData.deviceTypeIds = pointAndLineId.join(",");
|
|
|
this.addData.periodId = parseInt(this.domObj.find('.periodid option:selected').val());
|
|
|
this.addData.intervalDays = this.domObj.find(".periodid option:selected").attr("data-days");
|
|
|
this.addData.intervalDays = parseInt((this.addData.intervalDays == "null" ? "0" : this.addData.intervalDays));
|
|
@@ -408,19 +541,24 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.addData.planMode = this.domObj.find(".radio:checked").val();
|
|
|
|
|
|
|
|
|
- let checkContent = this.domObj.find("ul .active input[type=checkbox]");
|
|
|
- if(checkContent.length ==0){
|
|
|
- checkContent = this.domObj.find("ul .active input[type=radio]");
|
|
|
- }
|
|
|
- var checkContentVal = [];
|
|
|
- for(var i=0;i<checkContent.length;i++){
|
|
|
-
|
|
|
- checkContentVal.push(checkContent[i].getAttribute("value"));
|
|
|
- }
|
|
|
- this.addData.userId = checkContentVal.join(",")
|
|
|
+ var synergyUserIdsVal = [];
|
|
|
+ let checkContent = this.domObj.find(".users option:selected").val();
|
|
|
+ let synergyUser = this.domObj.find(".subUsers option:selected");
|
|
|
+ $(synergyUser).each(function(index, brand){
|
|
|
+ synergyUserIdsVal.push($(this).val());
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.addData.userId = checkContent
|
|
|
+
|
|
|
+ this.addData.synergyUserIds = synergyUserIdsVal.join(",")
|
|
|
+
|
|
|
this.addData.description = this.domObj.find('.plan_name').val();
|
|
|
this.addData.planRate = parseFloat(this.domObj.find('.plan_rate').val());
|
|
|
- this.addData.geoType = this.domObj.find(".plantype option:selected").attr("data-type");
|
|
|
+
|
|
|
if(new Date(this.addData.planEnddate).getTime()- new Date(this.addData.planBegindate).getTime()<0){
|
|
|
this.toast.Show("计划结束时间应大于计划开始时间!");
|
|
|
return ;
|
|
@@ -454,10 +592,10 @@ class MissionSchedule extends BaseWidget {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- if (this.addData.deviceTypeId == 1 || this.addData.deviceTypeId == 2) {
|
|
|
+ if (this.addData.deviceTypeIds == 1 || this.addData.deviceTypeIds == 2) {
|
|
|
this.domObj.empty().append(this.template.split('$$')[4]);
|
|
|
this.initEvent4();
|
|
|
- this.getRegionInfo(this.regionid, this.addData.deviceTypeId);
|
|
|
+ this.getRegionInfo(this.regionid, this.addData.deviceTypeIds);
|
|
|
} else {
|
|
|
this.domObj.empty().append(this.template.split('$$')[2]);
|
|
|
this.initEvent3();
|
|
@@ -521,7 +659,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.addData.gisUrl = undefined;
|
|
|
this.addData.gisInfo = undefined;
|
|
|
|
|
|
- if (this.addData.geoType == '0' && this.addData.deviceTypeId != '1') {
|
|
|
+ if (this.addData.geoType == '0' && this.addData.deviceTypeIds != '1') {
|
|
|
this.domObj.find('.setTime').attr("style", "");
|
|
|
this.domObj.find('.widget-planregion_deviceselect .btn_search').show();
|
|
|
let date = new Date();
|
|
@@ -574,7 +712,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
xjlist.push(itemselect);
|
|
|
}
|
|
|
}
|
|
|
- if (this.addData.deviceTypeId == "1" || this.addData.deviceTypeId == "2") {
|
|
|
+ if (this.addData.deviceTypeIds == "1" || this.addData.deviceTypeIds == "2") {
|
|
|
this.domObj.find(".pointlist-select").each(function () {
|
|
|
if ($(this).prop('checked') == true && _.findIndex(xjlist, function (o: any) { return o.sid == this.id }.bind(this)) == -1) {
|
|
|
let geoData = $(this).data('geometry');
|
|
@@ -635,7 +773,29 @@ class MissionSchedule extends BaseWidget {
|
|
|
}
|
|
|
this.loadWait.show("正在新增巡检计划,请等待...", this.domObj);
|
|
|
this.addData.deptId=this.addData.companyid;
|
|
|
- this.ajaxSend.sendAjax(this, this.addData, this.config.addMissionScheduleInfo, this.ajaxSend.type.post, this.addMissionScheduleInfoCallback.bind(this));
|
|
|
+ this.addData.gisInfoList.push({
|
|
|
+ "gisInfo":this.addData.gisInfo || [],
|
|
|
+ "gisUrl":this.addData.gisUrl,
|
|
|
+ "objectIds":this.addData.objectIds,
|
|
|
+ "regionId":this.addData.regionId,
|
|
|
+ "typeId":Number(this.addData.deviceTypeIds)
|
|
|
+ });
|
|
|
+ var sendData = {
|
|
|
+ companyId:this.AppX.appConfig.companyId,
|
|
|
+ deptId:this.addData.deptId,
|
|
|
+ description:this.addData.description,
|
|
|
+ deviceTypeIds:this.addData.deviceTypeIds,
|
|
|
+ gisInfoList:this.addData.gisInfoList,
|
|
|
+ intervalDays:this.addData.intervalDays,
|
|
|
+ periodId:this.addData.periodId,
|
|
|
+ planBegindate:this.addData.planBegindate,
|
|
|
+ planEnddate:this.addData.planEnddate,
|
|
|
+ planMode:this.addData.planMode,
|
|
|
+ planRate:JSON.stringify(this.addData.planRate),
|
|
|
+ synergyUserIds:this.addData.synergyUserIds || "",
|
|
|
+ userId:Number(this.addData.userId)
|
|
|
+ }
|
|
|
+ this.ajaxSend.sendAjax(this, sendData, this.config.addMissionScheduleInfo, this.ajaxSend.type.post, this.addMissionScheduleInfoCallback.bind(this));
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
@@ -675,7 +835,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
geometry = geometryEngine.intersect(this.currentRegionPolygon, evt.geometry);
|
|
|
this.drawToolbar.deactivate();
|
|
|
var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
|
|
|
- var obj = this.getDeviceType(this.addData.deviceTypeId);
|
|
|
+ var obj = this.getDeviceType(this.addData.deviceTypeIds);
|
|
|
var fields = this.getLayerShowFieldNames(obj.cnContactLayerName);
|
|
|
this.loadWait.show("正在查询选择" + this.current_device_type_name + "信息,请等待...", this.domObj);
|
|
|
var where = obj.sqlfilter;
|
|
@@ -787,7 +947,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
}
|
|
|
this.drawToolbar.deactivate();
|
|
|
var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
|
|
|
- var obj = this.getDeviceType(this.addData.deviceTypeId);
|
|
|
+ var obj = this.getDeviceType(this.addData.deviceTypeIds);
|
|
|
var fields = this.getLayerShowFieldNames(obj.cnContactLayerName);
|
|
|
this.loadWait.show("正在查询删除的选择" + this.current_device_type_name + "信息,请等待...", this.domObj);
|
|
|
var where = obj.sqlfilter;
|
|
@@ -876,7 +1036,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
|
|
|
|
|
|
this.domObj.find('.btn_previous_step').off("click").on("click", function () {
|
|
|
- if (this.addData.deviceTypeId == 1 || this.addData.deviceTypeId == 2) {
|
|
|
+ if (this.addData.deviceTypeIds == 1 || this.addData.deviceTypeIds == 2) {
|
|
|
this.domObj.empty().append(this.template.split('$$')[1]);
|
|
|
this.initEvent2();
|
|
|
} else {
|
|
@@ -1050,7 +1210,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
let startTime = this.domObj.find("#plan_begindate").val();
|
|
|
let endTime = this.domObj.find("#plan_enddate").val();
|
|
|
that.dataTable_all_searchInfo = {
|
|
|
- companyId: this.domObj.find(".department option:selected").val(),
|
|
|
+ deptId: this.domObj.find(".department option:selected").val(),
|
|
|
userId: this.domObj.find(".users option:selected").val(),
|
|
|
"orders[0].asc": false,
|
|
|
"orders[0].column": 'CREATE_TIME',
|
|
@@ -1300,65 +1460,80 @@ class MissionSchedule extends BaseWidget {
|
|
|
strusers = "<option selected value=''>暂无巡检人员</option>"
|
|
|
} else {
|
|
|
$.each(results.result.records, function (index, item) {
|
|
|
- if (this.addData.userId) {
|
|
|
- for(var i = 0;i<this.addData.userId.split(",").length;i++){
|
|
|
- var id = this.addData.userId.split(",")[i];
|
|
|
- if(item.id==id){
|
|
|
- strusers+="<option value='"+item.id+"' selected='selected'>"+item.realName+"</option>";
|
|
|
- break;
|
|
|
- }else if(i == this.addData.userId.split(",").length-1){
|
|
|
- strusers+="<option value='"+item.id+"'>"+item.realName+"</option>";
|
|
|
- break;
|
|
|
- }else{
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ strusers += "<option value='" + item.id + "'>" + item.realName + "</option>";
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- } else {
|
|
|
- if (optionType == selectType.single && index == 0) {
|
|
|
- strusers += "<option value='" + item.id + "'>" + item.realName + "</option>";
|
|
|
- } else {
|
|
|
- strusers += "<option value='" + item.id + "'>" + item.realName + "</option>";
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}.bind(this));
|
|
|
}
|
|
|
|
|
|
this.domObj.find(".users").empty().append(strusers);
|
|
|
- if(optionType == selectType.single){
|
|
|
- var pointType = this.domObj.find(".plantype option:selected").attr("data-type");
|
|
|
- var pointTxt = this.domObj.find(".plantype option:selected").html();
|
|
|
- if(pointType == "0" && pointTxt != "巡检点"){
|
|
|
- this.domObj.find(".users").attr("multiple","multiple");
|
|
|
- }else{
|
|
|
- this.domObj.find(".users").removeAttr("multiple");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (optionType == selectType.single) {
|
|
|
+ this.domObj.find(".subUsers").empty().append(strusers);
|
|
|
+ var selectedUserVal = this.domObj.find(".users option:selected").val();
|
|
|
+ var subUsersOptions = this.domObj.find(".subUsers option");
|
|
|
+ for(var i=0;i<subUsersOptions.length;i++){
|
|
|
+ if($(subUsersOptions[i]).val() == selectedUserVal){
|
|
|
+ subUsersOptions[i].disabled = true;
|
|
|
+ }else{
|
|
|
+ subUsersOptions[i].disabled = false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var selectedTypeVal = this.domObj.find(".planpointtype option:selected").val();
|
|
|
this.domObj.find(".users").multiselect("destroy").multiselect({
|
|
|
maxHeight:200,
|
|
|
inheritClass: false
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if(selectedTypeVal == "1"){
|
|
|
+ this.domObj.find(".subUsers").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ }).multiselect("disable");
|
|
|
+ }else{
|
|
|
+ this.domObj.find(".subUsers").multiselect("destroy").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ inheritClass: false
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}.bind(this));
|
|
|
}
|
|
|
|
|
@@ -1378,24 +1553,50 @@ class MissionSchedule extends BaseWidget {
|
|
|
this.toast.Show(results.message);
|
|
|
return;
|
|
|
}
|
|
|
- var strplantype = "";
|
|
|
+ var strplanpointtype = "";
|
|
|
+ var strplanlinetype = "";
|
|
|
$.each(results.result.records, function (index, item) {
|
|
|
- if (!this.addData.deviceTypeId) {
|
|
|
- if (index == 0) {
|
|
|
- strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
- } else {
|
|
|
- strplantype += "<option value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (item.id == this.addData.deviceTypeId) {
|
|
|
- strplantype += "<option selected value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
- } else {
|
|
|
- strplantype += "<option value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
+ if(item.type == "0"){
|
|
|
+ strplanpointtype += "<option value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
+ }else if(item.type == "1"){
|
|
|
+ if(item.id == 2){
|
|
|
+ strplanpointtype += "<option value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
+ }else{
|
|
|
+ if(item.id != 15){
|
|
|
+ strplanlinetype += "<option value='" + item.id + "' data-type='" + item.type + "' data-device_type_id='" + item.id + "'>" + item.name + "</option>";
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}.bind(this));
|
|
|
- this.domObj.find(".plantype").empty().append(strplantype);
|
|
|
+ this.domObj.find(".planpointtype").empty().append(strplanpointtype);
|
|
|
+ this.domObj.find(".planlinetype").empty().append(strplanlinetype);
|
|
|
+ this.domObj.find(".planpointtype").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ minwidth:238,
|
|
|
+ inheritClass: false
|
|
|
+
|
|
|
+ });
|
|
|
+ this.domObj.find(".planlinetype").multiselect({
|
|
|
+ maxHeight:200,
|
|
|
+ minwidth:238,
|
|
|
+ inheritClass: false
|
|
|
+
|
|
|
+ });
|
|
|
this.getGroup(selectType.single);
|
|
|
}
|
|
|
|
|
@@ -1663,7 +1864,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
var data = {
|
|
|
current: 1,
|
|
|
size: 1000,
|
|
|
- pointTypeId: device_type_id
|
|
|
+ pointTypeIds: device_type_id
|
|
|
};
|
|
|
this.ajaxSend.sendAjax(this, data, this.config.getLayerId, this.ajaxSend.type.get, function (results) {
|
|
|
if (results.code != 1) {
|
|
@@ -1693,43 +1894,42 @@ class MissionSchedule extends BaseWidget {
|
|
|
var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
|
|
|
if (this.deviceTypes == null)
|
|
|
return;
|
|
|
- var devicetype = this.getDeviceType(device_type_id);
|
|
|
- if (devicetype == null) return;
|
|
|
- this.loadWait.show("正在检查片区中是否有" + device_type_name + "信息,请等待...", this.domObj);
|
|
|
- var where = "1=1";
|
|
|
- if (devicetype.sqlfilter != null && devicetype.sqlfilter.length > 0)
|
|
|
- where += " and " + devicetype.sqlfilter;
|
|
|
- var param = { "where": where, "spatialRel": "esriSpatialRelContains", "returnGeometry": true, "geometryType": "esriGeometryPolygon", "geometry": JSON.stringify(polygon), "returnCountOnly": true, "returnIdsOnly": false, "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("查询失败,请联系管理员");
|
|
|
+ var devicetype = this.getDeviceType(device_type_id);
|
|
|
+ if (devicetype == null) return;
|
|
|
+ this.loadWait.show("正在检查片区中是否有" + device_type_name + "信息,请等待...", this.domObj);
|
|
|
+ var where = "1=1";
|
|
|
+ if (devicetype.sqlfilter != null && devicetype.sqlfilter.length > 0)
|
|
|
+ where += " and " + devicetype.sqlfilter;
|
|
|
+ var param = { "where": where, "spatialRel": "esriSpatialRelContains", "returnGeometry": true, "geometryType": "esriGeometryPolygon", "geometry": JSON.stringify(polygon), "returnCountOnly": true, "returnIdsOnly": false, "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;
|
|
|
+ }
|
|
|
+ var count = response.count;
|
|
|
this.loadWait.hide();
|
|
|
- return;
|
|
|
- }
|
|
|
- var count = response.count;
|
|
|
- this.loadWait.hide();
|
|
|
- if (count > 0) {
|
|
|
- this.getPlanDeviceList(polygon);
|
|
|
- this.plan_addpontype_layer.clear();
|
|
|
- var graphic = new Graphic(polygon, this.setSymbol("")[2], "");
|
|
|
- this.plan_addpontype_layer.add(graphic);
|
|
|
- } else {
|
|
|
- this.toast.Show(" 抱歉,该片区内没有" + device_type_name + "信息!");
|
|
|
- }
|
|
|
- }.bind(this),
|
|
|
- error: function (results) {
|
|
|
- this.loadWait.hide();
|
|
|
- this.toast.Show("查询片区巡检信息出错!");
|
|
|
- }.bind(this)
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
+ if (count > 0) {
|
|
|
+ this.getPlanDeviceList(polygon);
|
|
|
+ this.plan_addpontype_layer.clear();
|
|
|
+ var graphic = new Graphic(polygon, this.setSymbol("")[2], "");
|
|
|
+ this.plan_addpontype_layer.add(graphic);
|
|
|
+ } else {
|
|
|
+ this.toast.Show(" 抱歉,该片区内没有" + device_type_name + "信息!");
|
|
|
+ }
|
|
|
+ }.bind(this),
|
|
|
+ error: function (results) {
|
|
|
+ this.loadWait.hide();
|
|
|
+ this.toast.Show("查询片区巡检信息出错!");
|
|
|
+ }.bind(this)
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
* @function 获取巡检片区内巡检信息
|
|
|
* @param region_polygon 片区面
|
|
@@ -1737,11 +1937,11 @@ class MissionSchedule extends BaseWidget {
|
|
|
getPlanDeviceList(region_polygon?) {
|
|
|
var url = this.AppX.appConfig.gisResource.pipe.config[this.config.mapindex].url;
|
|
|
var where = "", cfg = null;
|
|
|
- if (this.addData.deviceTypeId != 1 && this.addData.deviceTypeId != 2) {
|
|
|
- cfg = this.getDeviceType(this.addData.deviceTypeId);
|
|
|
+ if (this.addData.deviceTypeIds != 1 && this.addData.deviceTypeIds != 2) {
|
|
|
+ cfg = this.getDeviceType(this.addData.deviceTypeIds);
|
|
|
where = cfg.where;
|
|
|
}
|
|
|
- switch (this.addData.deviceTypeId) {
|
|
|
+ switch (this.addData.deviceTypeIds) {
|
|
|
default:
|
|
|
var fields = this.getLayerShowFieldNames(cfg.cnContactLayerName);
|
|
|
this.domObj.empty().append(this.template.split('$$')[7]);
|
|
@@ -1812,7 +2012,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
|
|
|
|
|
|
|
|
|
- that.checkExistPlanDeviceByLayer(dom.data("geometry"), that.addData.deviceTypeId + "", that.current_device_type_name);
|
|
|
+ that.checkExistPlanDeviceByLayer(dom.data("geometry"), that.addData.deviceTypeIds + "", that.current_device_type_name);
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -1957,7 +2157,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
|
|
|
this.missionschedule_plandetail_polylinelayer.clear();
|
|
|
|
|
|
- var cfg = this.getDeviceType(this.addData.deviceTypeId);
|
|
|
+ var cfg = this.getDeviceType(this.addData.deviceTypeIds);
|
|
|
var layerid = cfg.contactLayerId;
|
|
|
var fields = this.getLayerShowFieldNames(cfg.cnContactLayerName);
|
|
|
let columns = [];
|
|
@@ -2078,7 +2278,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
if (data.length == 0) {
|
|
|
data.push("无objectId");
|
|
|
}
|
|
|
- var obj = that.getDeviceType(that.addData.deviceTypeId);
|
|
|
+ var obj = that.getDeviceType(that.addData.deviceTypeIds);
|
|
|
var fields = that.getLayerShowFieldNames(obj.cnContactLayerName);
|
|
|
var where = obj.sqlfilter;
|
|
|
let fieldDate = fields.map(e => e.name);
|
|
@@ -2106,7 +2306,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
results.data = [];
|
|
|
that.dataTable_current.currentData = value.features;
|
|
|
$.each(value.features, function (i, item) {
|
|
|
- var obj = that.getDeviceType(that.addData.deviceTypeId);
|
|
|
+ var obj = that.getDeviceType(that.addData.deviceTypeIds);
|
|
|
var fields = that.getLayerShowFieldNames(obj.cnContactLayerName);
|
|
|
let itemdata = {};
|
|
|
for (let el of fields) {
|
|
@@ -2161,9 +2361,9 @@ class MissionSchedule extends BaseWidget {
|
|
|
return;
|
|
|
}
|
|
|
var html_trs_data = "";
|
|
|
- var confobj = this.config.deviceForOther[this.addData.deviceTypeId];
|
|
|
+ var confobj = this.config.deviceForOther[this.addData.deviceTypeIds];
|
|
|
var content = null;
|
|
|
- switch (this.addData.deviceTypeId) {
|
|
|
+ switch (this.addData.deviceTypeIds) {
|
|
|
case 1:
|
|
|
case 2:
|
|
|
results.result.records.forEach((p, itemindx) => {
|
|
@@ -2182,7 +2382,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
+ "' data-address='" + p.address
|
|
|
+ "' data-content='" + JSON.stringify(content)
|
|
|
+ "' data-name='" + p.pointName
|
|
|
- + "' data-device_type_id='" + this.addData.deviceTypeId
|
|
|
+ + "' data-device_type_id='" + this.addData.deviceTypeIds
|
|
|
+ "' data-regionname='" + p.regionName
|
|
|
+ "' /></td><td title='" + p.deviceTypeName + "'>" + p.deviceTypeName
|
|
|
+ "</td><td title='" + this.ajaxSend.verificationHelper.setNullAndUndefined(p.pointName) + "'>" + this.ajaxSend.verificationHelper.setNullAndUndefined(p.pointName)
|
|
@@ -2193,7 +2393,7 @@ class MissionSchedule extends BaseWidget {
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
- this.addRegionInfoGraphic(results, this.addData.deviceTypeId);
|
|
|
+ this.addRegionInfoGraphic(results, this.addData.deviceTypeIds);
|
|
|
this.domObj.find(".pointlist").empty().append(html_trs_data);
|
|
|
|
|
|
this.domObj.off("click").on('click', '.pointlist tr', (e) => {
|