|
@@ -72,7 +72,7 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
startup() {
|
|
|
this.configure();
|
|
|
this.initHtml();
|
|
|
- this.getPlanLayers();
|
|
|
+
|
|
|
this.initEvent();
|
|
|
}
|
|
|
|
|
@@ -133,7 +133,6 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
this.configTimes();
|
|
|
this.domObj.find(".planslist-title").empty().append(this.template.split('$$')[10]);
|
|
|
this.companyid = this.AppX.appConfig.deptId;
|
|
|
- this.getGroup(selectType.all);
|
|
|
}
|
|
|
|
|
|
planEnddate = {
|
|
@@ -166,26 +165,11 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
*/
|
|
|
initEvent() {
|
|
|
this.initLoginUser();
|
|
|
- this.getAllPlanRegionToMap();
|
|
|
- this.getRegion(selectType.all);
|
|
|
- this.getPlanSearchWithSid();
|
|
|
- var that = this;
|
|
|
-
|
|
|
- this.domObj.find('.department').on("change", function () {
|
|
|
- this.getUser(selectType.all, this.domObj.find(".department").val());
|
|
|
- }.bind(this));
|
|
|
|
|
|
this.domObj.find(".btn-search").off("click").on("click", function () {
|
|
|
- this.clearCurrentTr();
|
|
|
- this.getPlanSearchWithSid();
|
|
|
- }.bind(this));
|
|
|
-
|
|
|
- this.domObj.find(".btn-delete").off("click").on("click", function () {
|
|
|
- this.deletePlanSearchWithSid();
|
|
|
+ this.getPlanInfo()
|
|
|
}.bind(this));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ this.getPlanInfo()
|
|
|
}
|
|
|
|
|
|
|
|
@@ -196,20 +180,20 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
this.initEvent();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * 获取设备类型
|
|
|
- * */
|
|
|
- getPlanLayers() {
|
|
|
- let data = {
|
|
|
- current: 1,
|
|
|
- size: 1000
|
|
|
- }
|
|
|
- this.ajaxSend.sendAjax(this, data, this.config.getLayerId, this.ajaxSend.type.get, function (results) {
|
|
|
- if (results.code != -1) {
|
|
|
- this.deviceTypes = results.result.records
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
setGraphSymbol(type, size?) {
|
|
@@ -324,246 +308,27 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
return symbol;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- * @function 查询所有计划信息
|
|
|
- */
|
|
|
- getPlanSearchWithSid() {
|
|
|
- this.loadWait.show("正在查询数据,请耐心等待...", this.domObj);
|
|
|
- this.clearCurrentTr();
|
|
|
- let that = this;
|
|
|
- let dom = this.domObj.find('#planslist_table .dataTables_scroll');
|
|
|
- let startTime = this.domObj.find("#plan_begindate").val();
|
|
|
- let endTime = this.domObj.find("#plan_enddate").val();
|
|
|
- that.dataTable_all_searchInfo = {
|
|
|
- sidInfo:window.tempSearchXjHalf.searchSid.sid,
|
|
|
- deptId: this.domObj.find(".department option:selected").val(),
|
|
|
- userId: this.domObj.find(".users option:selected").val(),
|
|
|
- regionId: this.domObj.find(".region option:selected").val(),
|
|
|
- createUser:this.domObj.find(".createUser").val(),
|
|
|
- isResultPoint:"1",
|
|
|
- companyId:this.AppX.appConfig.companyId,
|
|
|
- childPlanState: this.domObj.find(".state option:selected").val(),
|
|
|
- "orders[0].asc": false,
|
|
|
- "orders[0].column": 'CREATE_TIME',
|
|
|
- childBeginDate: startTime == "" ? "" : this.ajaxSend.conductAddTime(startTime),
|
|
|
- childEndDate: endTime == "" ? "" : this.ajaxSend.conductAddEndTime(endTime)
|
|
|
- }
|
|
|
- if (dom.length > 0) {
|
|
|
- if (that.dataTable_all) {
|
|
|
- that.dataTable_all.ajax.reload();
|
|
|
- return;
|
|
|
- };
|
|
|
- } else {
|
|
|
- if (that.dataTable_all) {
|
|
|
- that.dataTable_all.destroy();
|
|
|
- that.dataTable_all = null;
|
|
|
- };
|
|
|
- }
|
|
|
- let option = {
|
|
|
- that: this,
|
|
|
- dataTable: that.dataTable_all,
|
|
|
- elementId: "planslist_table",
|
|
|
- url: that.config.getPlanSearchWithSidList,
|
|
|
- searchInfo: that.dataTable_all_searchInfo,
|
|
|
- displayTitle: ["部门", "姓名", "巡检名称", "巡检周期", "巡检类型", "所属片区", "计划开始时间", "计划结束时间", "计划完成率(%)", "完成情况(%)", "状态","审核结果"],
|
|
|
- displayField: ["deptName", "userIdName", "description", "preiodName", "deviceTypeName", "regionName", "childBeginDate", "childEndDate", "planRate", "percent1Tostring", "chilePlanStateName",'planChildAuditStatus'],
|
|
|
- extentDisplayTitle: ['定位查看', '详情'],
|
|
|
- extentDisplayContent: [
|
|
|
- {
|
|
|
- field: "planLocaltion",
|
|
|
- fieldContent: "<a class='planLocaltion'>定位查看</a>"
|
|
|
- }, {
|
|
|
- field: "planInfoLook",
|
|
|
- fieldContent: "<a class='planInfoLook'>详情</a>"
|
|
|
- }],
|
|
|
- beforeTrClickEvent: undefined,
|
|
|
- afterTrClickEvent: function () {
|
|
|
- },
|
|
|
- serachCallBack:data=>{
|
|
|
- data.result.records.forEach(item=>{
|
|
|
- if(!item['planChildAuditStatus']){
|
|
|
- if(!item.planChildAudit){
|
|
|
- item.planChildAuditStatus="/";
|
|
|
- }else{
|
|
|
- let state=item.planChildAudit.auditStatus;
|
|
|
- item['planChildAuditStatus']=(state==2?'/':(state==1?'合格':"不合格"))
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- drawEvent: function () {
|
|
|
- $.each(that.domObj.find("#planslist_table tr[class]"), function (index, item) {
|
|
|
- if (that.dataTable_all.aExtentData.currentAllData.length > 0) {
|
|
|
- $($(item).find('td')[9]).text(that.dataTable_all.aExtentData.currentAllData[index].planRate + "%");
|
|
|
- }
|
|
|
- })
|
|
|
- that.domObj.off('click', '.planInfoLook').on('click', ".planInfoLook", e => {
|
|
|
- that.getPlanInfo(that.dataTable_all.aExtentData.currentTableData);
|
|
|
- });
|
|
|
- that.domObj.off('click', '.planLocaltion').on('click', ".planLocaltion", e => {
|
|
|
- let dataInfo = that.dataTable_all.aExtentData.currentTableData;
|
|
|
- that.ajaxSend.sendAjax(that, {id:dataInfo.id}, that.config.getMissionScheduleById+dataInfo.id, that.ajaxSend.type.get, that.showPlanInfoMap.bind(that));
|
|
|
- });
|
|
|
- that.loadWait.hide();
|
|
|
- }.bind(this),
|
|
|
- errmassage: "巡检计划查询失败",
|
|
|
- nullmessage: undefined,
|
|
|
- exportTitle: "巡检计划导出"
|
|
|
- }
|
|
|
- that.dataTable_all = this.ajaxSend.DataTables_check(option);
|
|
|
- }
|
|
|
-
|
|
|
- showPlanInfoMap(res){
|
|
|
- if(res&&res.result){
|
|
|
- let dataInfo=res.result;
|
|
|
- let that=this;
|
|
|
- if (that.dynamicMapServer) {
|
|
|
- that.map.removeLayer(that.dynamicMapServer);
|
|
|
- that.dynamicMapServer = null;
|
|
|
- }
|
|
|
- that.plan_ptype_layer.clear();
|
|
|
- if (dataInfo.deviceTypeId == 1 || dataInfo.deviceTypeId == 2) {
|
|
|
- let datageo = JSON.parse(dataInfo.pointInfo);
|
|
|
- that.showPlanSearchWithSidListPlans(datageo);
|
|
|
- } else {
|
|
|
- that.loadWait.show("正在查询任务范围,请等待...", that.domObj);
|
|
|
- let url = that.AppX.appConfig.gisResource.pipe.config[that.config.mapindex].url;
|
|
|
- let obj = that.getDeviceType(dataInfo.deviceTypeId);
|
|
|
- that.gp = new Geoprocessor(that.analyzeUrl);
|
|
|
- let fields = that.getLayerShowFieldNames(obj.cnContactLayerName);
|
|
|
- let outfields = fields.map(e => { return e.name })
|
|
|
-
|
|
|
- let layerName = "";
|
|
|
- layerName = obj.cnContactLayerName;
|
|
|
- var options = {
|
|
|
- "layername": layerName,
|
|
|
- "objectids": dataInfo.objectIds,
|
|
|
- "outfields": outfields.join(","),
|
|
|
- usertoken: that.AppX.appConfig.gisToken
|
|
|
- };
|
|
|
- var delayResult = that.gp.submitJob(
|
|
|
- options,
|
|
|
- function (jobinfo) {
|
|
|
- let mapServerUrl = that.mapServerUrl + "/jobs/" + jobinfo.jobId;
|
|
|
- that.dynamicMapServer = new ArcGISDynamicMapServiceLayer(mapServerUrl);
|
|
|
- that.dynamicMapServer.id = that.preLayerId + "dynamicMapServer";
|
|
|
- that.map.addLayer(that.dynamicMapServer);
|
|
|
- $.ajax({
|
|
|
- type: "get",
|
|
|
- dataType: "json",
|
|
|
- url: that.analyzeUrl + "/jobs/" + jobinfo.jobId + "/" + jobinfo.results.summary.paramUrl + "?f=pjson",
|
|
|
- success: function (result) {
|
|
|
- let data = result.value.result.summary;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- that.map.setExtent(new Extent(data.xmin, data.ymin, data.xmax, data.ymax, that.map.spatialReference))
|
|
|
- }.bind(that)
|
|
|
- })
|
|
|
- that.loadWait.hide();
|
|
|
- }.bind(this),
|
|
|
- function (jobinfo) {
|
|
|
- that.jobid = jobinfo.jobId;
|
|
|
- }.bind(this),
|
|
|
- function (jobinfo) {
|
|
|
- that.AppX.runtimeConfig.toast.show("分析失败,请联系管理员");
|
|
|
- that.loadWait.hide();
|
|
|
- console.error(jobinfo);
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- deletePlanSearchWithSid(){
|
|
|
- var senddata = [];
|
|
|
- this.dataTable_all.aExtentData.checkCurrentData.forEach(element => {
|
|
|
- senddata.push(element.id);
|
|
|
- });
|
|
|
- this.ajaxSend.sendAjax(this, senddata, this.config.deleteMainList, this.ajaxSend.type.delete, function (results) {
|
|
|
- if (results.code != 1) {
|
|
|
- this.toast.Show(results.message);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.toast.Show(results.message);
|
|
|
- this.getPlanSearchWithSid();
|
|
|
- }.bind(this))
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 根据编号进行查询
|
|
|
- * @param data 查询的计划
|
|
|
- */
|
|
|
- seachInfoList(onlyCode){
|
|
|
- if(this.dataTable){
|
|
|
- let tempData=[];
|
|
|
- let code=this.domObj.find('.searchCode').val();
|
|
|
- if(onlyCode){
|
|
|
- code=onlyCode
|
|
|
- }
|
|
|
- for(let i=0;i<this.allSearchList.length;i++){
|
|
|
- let tempValue=this.allSearchList[i];
|
|
|
- if(code){
|
|
|
- if(this.allSearchList[i].number.indexOf(code)!=-1){
|
|
|
-
|
|
|
- tempData.push(this.allSearchList[i])
|
|
|
- }
|
|
|
- }else{
|
|
|
-
|
|
|
- tempData.push(this.allSearchList[i])
|
|
|
- }
|
|
|
- }
|
|
|
- this.dataTable.clear();
|
|
|
- this.dataTable.rows.add(tempData);
|
|
|
- this.dataTable.draw();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
* @function 获取巡检计划详情
|
|
|
* @param data 查询的计划
|
|
|
*/
|
|
|
- getPlanInfo(data) {
|
|
|
+ getPlanInfo() {
|
|
|
let senddata = {
|
|
|
- childPlanId: data.id,
|
|
|
+ sid:window.tempSearchXjHalf.searchSid.sid,
|
|
|
+ startTime:this.domObj.find(".plan_begindate").val(),
|
|
|
+ endTime:this.domObj.find(".plan_enddate").val(),
|
|
|
size: 100000,
|
|
|
current: 1
|
|
|
}
|
|
|
this.allSearchList=[];
|
|
|
- debugger
|
|
|
this.ajaxSend.sendAjax(this, senddata, this.config.planInfo, this.ajaxSend.type.get, function (results) {
|
|
|
var that = this;
|
|
|
if (results.code != 1) {
|
|
|
that.toast.Show(results.message);
|
|
|
return;
|
|
|
}
|
|
|
- if (results.result && results.result.length > 0) {
|
|
|
- this.hideOrShowSearch(hideOrShow.hide);
|
|
|
let info = results.result;
|
|
|
- let html = _.template(this.template.split('$$')[1])();
|
|
|
- this.domObj.append(html);
|
|
|
- if(data.childPlanState == "3"){
|
|
|
- this.domObj.find(".btn_exportExcel").show();
|
|
|
- }
|
|
|
-
|
|
|
- this.domObj.find('.returnSearch').off().click(e => {
|
|
|
- this.hideOrShowSearch(hideOrShow.show);
|
|
|
- })
|
|
|
-
|
|
|
- this.domObj.find(".btn_exportExcel").off().click(e => {
|
|
|
- this.domObj.find(".buttons-excel").eq(1).trigger("click");
|
|
|
-
|
|
|
-
|
|
|
- });
|
|
|
- this.domObj.find(".searchCodebutton").off("click").on("click", function () {
|
|
|
- this.seachInfoList();
|
|
|
- this.addSeachInfoEvent(tableDom,isCheck)
|
|
|
- }.bind(this));
|
|
|
- this.domObj.find(".searchCodebuttonByCode").off("click").on("click", function () {
|
|
|
- this.seachInfoList( window.tempSearchXjHalf.searchSid.code);
|
|
|
- this.addSeachInfoEvent(tableDom,isCheck)
|
|
|
- }.bind(this));
|
|
|
-
|
|
|
+ let deviceTypeId=info[0].deviceTypeId
|
|
|
|
|
|
let listHmtl = "";
|
|
|
let mapData = {
|
|
@@ -571,21 +336,34 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
dwObjectGeo: [],
|
|
|
wdwObjectId: [],
|
|
|
wdwObjectGeo: [],
|
|
|
- layerName: this.dataTable_all.aExtentData.currentTableData.layerName,
|
|
|
- layerId: this.dataTable_all.aExtentData.currentTableData.layerId
|
|
|
+
|
|
|
+ layerId:window.tempSearchXjHalf.searchSid.layerId
|
|
|
}
|
|
|
let thHtml = "";
|
|
|
let isCheck = true;
|
|
|
|
|
|
- if (this.dataTable_all.aExtentData.currentTableData.checkContent == null || this.dataTable_all.aExtentData.currentTableData.checkContent == "null") {
|
|
|
- isCheck = false;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.dataTable_plan = info;
|
|
|
let tableData = [];
|
|
|
- console.log(info)
|
|
|
+ let tempTitle=[];
|
|
|
+ let tempField=[];
|
|
|
+ if(deviceTypeId==20){
|
|
|
+ tempTitle=["调压柜运行压力(单位:Kpa)","调压柜放散压力(单位:Kpa)","流量计工作压力(单位:Kpa)"];
|
|
|
+ tempField=["runPressure","diffusePressure","workPressure"]
|
|
|
+ }else if(deviceTypeId==18){
|
|
|
+ tempTitle=["调压箱运行压力(单位:Kpa)","调压箱截断压力(单位:Kpa)"];
|
|
|
+ tempField=["runPressure","truncationPressure"]
|
|
|
+ }else if(deviceTypeId==16){
|
|
|
+ tempTitle=["阀门材质","阀门规格"];
|
|
|
+ tempField=["material","specification"]
|
|
|
+ }else if(deviceTypeId==21){
|
|
|
+ tempTitle=["检测桩编号","标准电位值","检测电位值","检测人员"];
|
|
|
+ tempField=["deviceId","standardPotential","detectionPotential","createUserName"]
|
|
|
+ }
|
|
|
info.forEach((item, index) => {
|
|
|
if (item.checkContent && item.checkContent != "null" && item.checkContent != "") {
|
|
|
-
|
|
|
item.overDate = item.checkDate;
|
|
|
item.isoverName=item.checkStateName;
|
|
|
}
|
|
@@ -624,14 +402,23 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
name: null,
|
|
|
dw: null,
|
|
|
dwsj: null,
|
|
|
- lookInfo: null
|
|
|
+ lookInfo: null,
|
|
|
+ description:null,
|
|
|
+ childBeginDate:null,
|
|
|
+ childEndDate:null
|
|
|
}
|
|
|
+ tempField.forEach(itemT=>{
|
|
|
+ tableDataItem[itemT]= item[itemT]||""
|
|
|
+ })
|
|
|
tableDataItem.index = index;
|
|
|
tableDataItem.number=bh+"";
|
|
|
tableDataItem.bh = "<a class='indexTd' index='" + index + "'>" + bh + "</a>";
|
|
|
tableDataItem.name = name;
|
|
|
tableDataItem.dw = dw;
|
|
|
tableDataItem.dwsj = dwsj;
|
|
|
+ tableDataItem.childBeginDate=item.childBeginDate;
|
|
|
+ tableDataItem.description=item.description;
|
|
|
+ tableDataItem.childEndDate=item.childEndDate
|
|
|
if (isCheck) {
|
|
|
|
|
|
tableDataItem.lookInfo = "<a class='lookInfo' index='" + index + "'>查看检查项目</a>";
|
|
@@ -660,8 +447,8 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
elementId: "PlanSearchWithSidInfo_table",
|
|
|
url: that.config.getEquipmentNormalManagementList,
|
|
|
searchInfo: that.getSearchInfo,
|
|
|
- displayTitle: ["设备编码", "名称 ", "检查情况", "检查时间"],
|
|
|
- displayField: ['bh', 'name', 'dw', 'dwsj'],
|
|
|
+ displayTitle: ["设备编码", "所属巡检计划","计划开始时间","计划结束时间","设备类型 ", "检查情况", "检查时间",...tempTitle],
|
|
|
+ displayField: ['bh', 'description',"childBeginDate","childEndDate",'name', 'dw', 'dwsj',...tempField],
|
|
|
extentDisplayTitle: extendTitle,
|
|
|
extentDisplayContent: extendContent,
|
|
|
beforeTrClickEvent: undefined,
|
|
@@ -682,7 +469,7 @@ class PlanSearchWithSid extends BaseWidget {
|
|
|
|
|
|
|
|
|
this.addSeachInfoEvent(tableDom,isCheck)
|
|
|
- }
|
|
|
+
|
|
|
}.bind(this));
|
|
|
}
|
|
|
|
|
@@ -704,21 +491,21 @@ addSeachInfoEvent(tableDom,isCheck){
|
|
|
let data = this.dataTable_plan[parseInt(dom.attr('index'))];
|
|
|
let url = this.config.xjpage;
|
|
|
let type = null;
|
|
|
- if (this.dataTable_all.aExtentData.currentTableData.deviceTypeId == 18) {
|
|
|
+ if (data.deviceTypeId == 18) {
|
|
|
|
|
|
type = 1;
|
|
|
- } else if (this.dataTable_all.aExtentData.currentTableData.deviceTypeId == 20) {
|
|
|
+ } else if (data.deviceTypeId == 20) {
|
|
|
|
|
|
type = 2;
|
|
|
- }else if(this.dataTable_all.aExtentData.currentTableData.deviceTypeId == 16){
|
|
|
+ }else if(data.deviceTypeId == 16){
|
|
|
|
|
|
type = 3;
|
|
|
- }else if(this.dataTable_all.aExtentData.currentTableData.deviceTypeId == 21){
|
|
|
+ }else if(data.deviceTypeId == 21){
|
|
|
type = 4;
|
|
|
}
|
|
|
let sendPointData = {
|
|
|
typeId:type,
|
|
|
- childPlanId: this.dataTable_all.aExtentData.currentTableData.id,
|
|
|
+ childPlanId: data.childPlanId,
|
|
|
planTempPointId: data.pointId
|
|
|
}
|
|
|
this.ajaxSend.sendAjax(this, sendPointData, url, this.ajaxSend.type.get, function (results) {
|
|
@@ -728,11 +515,11 @@ addSeachInfoEvent(tableDom,isCheck){
|
|
|
return;
|
|
|
}
|
|
|
let info = results.result.records[0];
|
|
|
- type=info.typeId;
|
|
|
if (!info) {
|
|
|
this.toast.show("未查询到巡检登记记录!")
|
|
|
return;
|
|
|
}
|
|
|
+ type=info.typeId;
|
|
|
let setSize = { width: undefined, height: undefined };
|
|
|
let appendHtml = null;
|
|
|
let html = "";
|
|
@@ -934,253 +721,6 @@ addSeachInfoEvent(tableDom,isCheck){
|
|
|
this.planLayer.add(new Graphic(item, wdwSymPoint));
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 显示计划所有内容
|
|
|
- * @param infos
|
|
|
- */
|
|
|
- showPlanSearchWithSidListPlans(infos) {
|
|
|
- if (infos != null) {
|
|
|
- var gxs = {
|
|
|
- "polygon": [],
|
|
|
- "polyline": [],
|
|
|
- "point": []
|
|
|
- };
|
|
|
- let geometrys = [];
|
|
|
- for (var i = 0; i < infos.length; i++) {
|
|
|
- var info = infos[i];
|
|
|
- if (info) {
|
|
|
- var device_type_id = info.device_type_id, color = [0, 255, 255, 1];
|
|
|
- if (device_type_id != "")
|
|
|
- color = this.config.DeviceSymbol[device_type_id];
|
|
|
- var pobj = null, sym = null, graphic = null;
|
|
|
- if (info.geometry == undefined) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (info.geometry.hasOwnProperty("paths")) {
|
|
|
- pobj = new Polyline(info.geometry);
|
|
|
- sym = this.setGraphSymbolByType("polyline", color, 2);
|
|
|
- graphic = new Graphic(pobj, sym);
|
|
|
- gxs.polyline.push(graphic);
|
|
|
- } else if (info.geometry.hasOwnProperty("rings")) {
|
|
|
- pobj = new Polygon(info.geometry);
|
|
|
- sym = this.setGraphSymbolByType("polygon", color, 1);
|
|
|
- graphic = new Graphic(pobj, sym);
|
|
|
- gxs.polygon.push(graphic);
|
|
|
- } else {
|
|
|
- pobj = new Point(info.geometry);
|
|
|
- sym = this.setGraphSymbolByType("point", color, 6);
|
|
|
- graphic = new Graphic(pobj, sym);
|
|
|
- gxs.point.push(graphic);
|
|
|
- }
|
|
|
- geometrys.push(pobj)
|
|
|
- }
|
|
|
- }
|
|
|
- gxs.polygon.forEach((p, index) => {
|
|
|
- this.plan_ptype_layer.add(p);
|
|
|
- });
|
|
|
- gxs.polyline.forEach((p, index) => {
|
|
|
- this.plan_ptype_layer.add(p);
|
|
|
- });
|
|
|
- gxs.point.forEach((p, index) => {
|
|
|
- this.plan_ptype_layer.add(p);
|
|
|
- })
|
|
|
- var geometry = geometryEngine.union(geometrys);
|
|
|
- if(geometry.type&&geometry.type=="point"){
|
|
|
- this.map.centerAt(geometry)
|
|
|
- }else{
|
|
|
- this.map.setExtent(geometry.getExtent());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 清除当前选中列表图层信息
|
|
|
- */
|
|
|
- clearCurrentTr() {
|
|
|
- if (this.dynamicMapServer) {
|
|
|
- this.map.removeLayer(this.dynamicMapServer);
|
|
|
- this.dynamicMapServer = null;
|
|
|
- }
|
|
|
- if (this.plan_ptype_layer) {
|
|
|
- this.plan_ptype_layer.clear();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 获取存在该类型的片区,加载到地图上
|
|
|
- */
|
|
|
- getAllPlanRegionToMap() {
|
|
|
- let data = {
|
|
|
- "current": 1,
|
|
|
- "size": this.config.pagemaxsize,
|
|
|
- };
|
|
|
- this.ajaxSend.sendAjax(this, data, this.config.getPlanRegionList, this.ajaxSend.type.get, function (results) {
|
|
|
- var that = this;
|
|
|
- if (results.code != 1) {
|
|
|
- that.toast.Show(results.message);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.addPolygonGraphic(results);
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 添加片区结果在地图上展示
|
|
|
- */
|
|
|
- addPolygonGraphic(queryResult) {
|
|
|
- this.plan_pontype_layer.clear();
|
|
|
- for (var i = 0, length = queryResult.result.records.length; i < length; i++) {
|
|
|
- var row = queryResult.result.records[i];
|
|
|
- if (row.geometry == undefined || row.geometry == "") { continue; }
|
|
|
- var polygon = new Polygon(JSON.parse(row.geometry));
|
|
|
- var graphic = new Graphic(polygon, this.setSymbol(row.regionname)[2], "");
|
|
|
- graphic.attr("id", "graphic" + i);
|
|
|
- this.plan_pontype_layer.add(graphic);
|
|
|
- if (row.regionname != null && row.regionname != "") {
|
|
|
-
|
|
|
- var point = polygon.getExtent().getCenter();
|
|
|
- var graphictextbg = new Graphic(point, this.setSymbol(row.regionname)[1].setOffset(0, -20), "");
|
|
|
- this.plan_pontype_layer.add(graphictextbg);
|
|
|
-
|
|
|
- var peopleTextSymbol = new TextSymbol(row.regionname);
|
|
|
- peopleTextSymbol.setOffset(0, -25);
|
|
|
- var font = new Font();
|
|
|
- font.setSize("10pt");
|
|
|
- font.setWeight(Font.WEIGHT_BOLD);
|
|
|
- peopleTextSymbol.setFont(font);
|
|
|
- var graphicText = new Graphic(point, peopleTextSymbol, "");
|
|
|
- this.plan_pontype_layer.add(graphicText);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 获取部门列表
|
|
|
- */
|
|
|
- getGroup(selectType: selectType) {
|
|
|
- let data = {
|
|
|
-
|
|
|
- current: 1,
|
|
|
- size: 10000
|
|
|
- }
|
|
|
- this.ajaxSend.sendAjax(this, data, this.config.getGroupList, this.ajaxSend.type.get, this.getGroupListCallback.bind(this, selectType));
|
|
|
- }
|
|
|
-
|
|
|
- getGroupListCallback(optionType, results) {
|
|
|
- if (results.code != 1) {
|
|
|
- this.toast.Show(results.message);
|
|
|
- return;
|
|
|
- }
|
|
|
- let strdepartment = "";
|
|
|
- if (optionType == selectType.all) {
|
|
|
- strdepartment = ("<option selected value=''>全部</option>");
|
|
|
- }
|
|
|
-
|
|
|
- $.each(results.result.records, function (index, item) {
|
|
|
- if (optionType == selectType.single && this.addData.companyid) {
|
|
|
- if (this.addData.companyid == item.id) {
|
|
|
- strdepartment += "<option selected='selected' value='" + item.id + "'>" + item.name + "</option>";
|
|
|
- } else {
|
|
|
- strdepartment += "<option value='" + item.id + "'>" + item.name + "</option>";
|
|
|
- }
|
|
|
- } else {
|
|
|
- strdepartment += "<option value='" + item.id + "'>" + item.name + "</option>";
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- this.domObj.find(".department").empty().append(strdepartment);
|
|
|
- this.getUser(optionType, this.domObj.find(".department").val());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * @function 根据部门id获取用户列表,空代表查询全部
|
|
|
- * @param isall 是否全部
|
|
|
- */
|
|
|
- getUser(optionType: selectType, companyid) {
|
|
|
- let data = {
|
|
|
- "current": 1,
|
|
|
- "size": this.config.pagemaxsize,
|
|
|
-
|
|
|
- "departmentId": companyid
|
|
|
- }
|
|
|
- this.ajaxSend.sendAjax(this, data, this.config.getUserList, this.ajaxSend.type.get, function (results) {
|
|
|
- var that = this;
|
|
|
- if (results.code != 1) {
|
|
|
- that.toast.Show(results.message);
|
|
|
- return;
|
|
|
- }
|
|
|
- let strusers = "";
|
|
|
- if (optionType == selectType.all) {
|
|
|
- strusers = "<option selected value=''>全部</option>";
|
|
|
- }
|
|
|
- if (results.result.records.length == 0) {
|
|
|
- strusers = "<option selected value=''>暂无巡检人员</option>"
|
|
|
- } else {
|
|
|
- $.each(results.result.records, function (index, item) {
|
|
|
- if (optionType == selectType.single && index == 0) {
|
|
|
- strusers += "<option selected value='" + item.id + "'>" + item.realName + "</option>";
|
|
|
- } else {
|
|
|
- strusers += "<option value='" + item.id + "'>" + item.realName + "</option>";
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
- this.domObj.find(".users").empty().append(strusers);
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * @function 获取巡检片区,空代表查询全部
|
|
|
- * @param isall 是否全部
|
|
|
- */
|
|
|
- getRegion(optionType: selectType) {
|
|
|
- let data = {
|
|
|
- "current": 1,
|
|
|
- "size": this.config.pagemaxsize
|
|
|
- }
|
|
|
- this.ajaxSend.sendAjax(this, data, this.config.getPlanRegionList, this.ajaxSend.type.get, function (results) {
|
|
|
- var that = this;
|
|
|
- if (results.code != 1) {
|
|
|
- that.toast.Show(results.message);
|
|
|
- return;
|
|
|
- }
|
|
|
- let strregion = "";
|
|
|
- if (optionType == selectType.all) {
|
|
|
- strregion = "<option selected value=''>全部</option>";
|
|
|
- }
|
|
|
- if (results.result.records.length == 0) {
|
|
|
- strregion = "<option selected value=''>暂无巡检片区</option>"
|
|
|
- } else {
|
|
|
- $.each(results.result.records, function (index, item) {
|
|
|
- if (optionType == selectType.single && index == 0) {
|
|
|
- strregion += "<option selected value='" + item.id + "'>" + item.regionname + "</option>";
|
|
|
- } else {
|
|
|
- strregion += "<option value='" + item.id + "'>" + item.regionname + "</option>";
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
- this.domObj.find(".region").empty().append(strregion);
|
|
|
- }.bind(this));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1208,33 +748,4 @@ addSeachInfoEvent(tableDom,isCheck){
|
|
|
this.domObj.remove();
|
|
|
this.afterDestroy();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- * (方法说明)通过设备类型编号获取设备类型详情
|
|
|
- * @method (方法名)
|
|
|
- * @for (所属类名)
|
|
|
- * @param {(参数类型)} (参数名) (参数说明)
|
|
|
- * @return {(返回值类型)} (返回值说明)
|
|
|
- */
|
|
|
- private getDeviceType(devicetypeID) {
|
|
|
- var index = _.findIndex(this.deviceTypes, function (o) { return (o["pointTypeId"] + "") == devicetypeID; });
|
|
|
- if (index == -1) return null;
|
|
|
- var devicetype = this.deviceTypes[index];
|
|
|
- return devicetype;
|
|
|
- }
|
|
|
-
|
|
|
- private getLayerShowFieldNames(cn_layerName) {
|
|
|
- var layerfields = this.AppX.runtimeConfig.fieldConfig.GetLayerFields(cn_layerName);
|
|
|
- var showFields = layerfields.slice(0, 5);
|
|
|
-
|
|
|
- for (var i = 0; i < 5; i++) {
|
|
|
- var index = _.findIndex(this.config.showfieldnames, function (o: any) { return o == showFields[i].alias });
|
|
|
- if (index == -1) {
|
|
|
- var index2 = _.findIndex(layerfields, function (o: any) { return this.config.showfieldnames[i] == o.alias }.bind(this));
|
|
|
- if (index2 != -1)
|
|
|
- showFields[i] = layerfields[index2];
|
|
|
- }
|
|
|
- }
|
|
|
- return showFields;
|
|
|
- }
|
|
|
}
|