|
@@ -0,0 +1,751 @@
|
|
|
+import BaseWidget = require('core/BaseWidget.class');
|
|
|
+import Functions = require('core/Functions.module');
|
|
|
+import Extent = require('esri/geometry/Extent');
|
|
|
+import Point = require("esri/geometry/Point");
|
|
|
+import GraphicsLayer = require("esri/layers/GraphicsLayer");
|
|
|
+import Graphic = require("esri/graphic");
|
|
|
+import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol");
|
|
|
+import TextSymbol = require("esri/symbols/TextSymbol");
|
|
|
+import Font = require("esri/symbols/Font");
|
|
|
+import ScreenPoint = require('esri/geometry/ScreenPoint');
|
|
|
+import Draw = require('esri/toolbars/draw');
|
|
|
+import SimpleMarkerSymbol = require('esri/symbols/SimpleMarkerSymbol');
|
|
|
+import Color = require("esri/Color");
|
|
|
+import Polygon = require('esri/geometry/Polygon');
|
|
|
+import SimpleLineSymbol = require('esri/symbols/SimpleLineSymbol');
|
|
|
+import SimpleFillSymbol = require('esri/symbols/SimpleFillSymbol');
|
|
|
+import Geoprocessor = require("esri/tasks/Geoprocessor");
|
|
|
+import Polyline = require('esri/geometry/Polyline');
|
|
|
+import geometryEngine = require("esri/geometry/geometryEngine");
|
|
|
+import MapSet = require("common/MapSet.class");
|
|
|
+import AjaxSend = require("common/AjaxSend.class")
|
|
|
+import ArcGISDynamicMapServiceLayer = require('esri/layers/ArcGISDynamicMapServiceLayer');
|
|
|
+enum selectType {
|
|
|
+ all, single
|
|
|
+}
|
|
|
+enum hideOrShow {
|
|
|
+ hide, show
|
|
|
+}
|
|
|
+export = PlanSearchWithSid;
|
|
|
+declare var Date;
|
|
|
+class PlanSearchWithSid extends BaseWidget {
|
|
|
+ baseClass = "widget-PlanSearchWithSid";
|
|
|
+
|
|
|
+ preLayerId = 'HalfPanel' + this.baseClass;
|
|
|
+ map = null;
|
|
|
+ toast = null;
|
|
|
+ popup = null;
|
|
|
+ loadWait = null;
|
|
|
+ plan_pontype_layer: GraphicsLayer;
|
|
|
+ planLayer: GraphicsLayer;
|
|
|
+ plan_ptype_layer: GraphicsLayer;
|
|
|
+ selectLayer: GraphicsLayer;
|
|
|
+ dynamicMapServer: ArcGISDynamicMapServiceLayer
|
|
|
+ ajaxSend = null;
|
|
|
+ mapSet = null
|
|
|
+ distanceInfo = 50;
|
|
|
+ allSearchList = [];
|
|
|
+ companyid = "";
|
|
|
+ regionid = "";
|
|
|
+ regionname = "";
|
|
|
+
|
|
|
+ copyPopup = null;
|
|
|
+ currentRegionPolygon = null;
|
|
|
+ dataTable_r = null;
|
|
|
+ dataTable_current = null;
|
|
|
+ private deviceTypes = null;
|
|
|
+ gp = null;
|
|
|
+ analyzeUrl = "";
|
|
|
+ datalength = 0;
|
|
|
+ mapServerUrl = "";
|
|
|
+ objectids = [];
|
|
|
+ jobid = "";
|
|
|
+ dataTable_all = null;
|
|
|
+ dataTable_all_searchInfo = {};
|
|
|
+ dataTable_plan = null;
|
|
|
+ dataTable_planInfo = null;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * @function 启动初始化
|
|
|
+ */
|
|
|
+ startup() {
|
|
|
+ this.configure();
|
|
|
+ this.initHtml();
|
|
|
+
|
|
|
+ this.initEvent();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 配置初始化
|
|
|
+ */
|
|
|
+ configure() {
|
|
|
+ this.toast = this.AppX.runtimeConfig.toast;
|
|
|
+ this.popup = this.AppX.runtimeConfig.popup;
|
|
|
+ this.map = this.AppX.runtimeConfig.map;
|
|
|
+ this.ajaxSend = new AjaxSend();
|
|
|
+ this.loadWait = this.AppX.runtimeConfig.loadWait;
|
|
|
+ this.mapSet = new MapSet();
|
|
|
+ if (this.AppX.appConfig.gisResource.filterMapRQ.config.length > 0) {
|
|
|
+ this.analyzeUrl = this.AppX.appConfig.gisResource.filterMapRQ.config[0].url;
|
|
|
+ this.mapServerUrl = this.AppX.appConfig.gisResource.filterMapRQ.config[1].url;
|
|
|
+ } else {
|
|
|
+ this.toast.show("图层过滤服务未配置");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.plan_pontype_layer) {
|
|
|
+
|
|
|
+ this.plan_pontype_layer = new GraphicsLayer();
|
|
|
+ this.plan_pontype_layer.id = this.preLayerId + "plan_pontype_layer";
|
|
|
+ this.map.addLayer(this.plan_pontype_layer);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.plan_ptype_layer) {
|
|
|
+ this.plan_ptype_layer = new GraphicsLayer();
|
|
|
+ this.plan_ptype_layer.id = this.preLayerId + "plan_ptype_layer";
|
|
|
+ this.map.addLayer(this.plan_ptype_layer);
|
|
|
+ }
|
|
|
+ if (!this.planLayer) {
|
|
|
+ this.planLayer = new GraphicsLayer();
|
|
|
+ this.planLayer.id = this.preLayerId + "planLayer";
|
|
|
+ this.map.addLayer(this.planLayer);
|
|
|
+ }
|
|
|
+ if (!this.selectLayer) {
|
|
|
+ this.selectLayer = new GraphicsLayer();
|
|
|
+ this.selectLayer.id = this.preLayerId + "selectLayer";
|
|
|
+ this.map.addLayer(this.selectLayer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 初始化页面
|
|
|
+ */
|
|
|
+ initHtml() {
|
|
|
+ var html = _.template(this.template.split('$$')[0] + "</div>")();
|
|
|
+ this.setHtml(html);
|
|
|
+ this.ready();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 根据登录账号(集团公司账号、子公司账号、部门账号)初始化
|
|
|
+ */
|
|
|
+ initLoginUser() {
|
|
|
+ this.configTimes();
|
|
|
+ this.domObj.find(".planslist-title").empty().append(this.template.split('$$')[10]);
|
|
|
+ this.companyid = this.AppX.appConfig.deptId;
|
|
|
+ }
|
|
|
+
|
|
|
+ planEnddate = {
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
+ isinitVal: false,
|
|
|
+ minDate: "2017-08-28"
|
|
|
+ }
|
|
|
+
|
|
|
+ planBegindate = {
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
+ isinitVal: false,
|
|
|
+ okfun: function (obj) {
|
|
|
+ var dt = new Date(obj.val.replace(/-/g, "/"));
|
|
|
+ this.planEnddate.minDate = Functions.DateFormat(dt, "yyyy-MM-dd");
|
|
|
+ this.domObj.find(".plan_enddate").val(this.planEnddate.minDate);
|
|
|
+ }.bind(this)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 配置时间控件
|
|
|
+ */
|
|
|
+ configTimes() {
|
|
|
+ $.jeDate("." + this.baseClass + " .plan_begindate", this.planBegindate);
|
|
|
+ $.jeDate("." + this.baseClass + " .plan_enddate", this.planEnddate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 初始化相关事件
|
|
|
+ * 时间控件、部门与人员列表、部门变化事件
|
|
|
+ */
|
|
|
+ initEvent() {
|
|
|
+ this.initLoginUser();
|
|
|
+
|
|
|
+ this.domObj.find(".btn-search").off("click").on("click", function () {
|
|
|
+ this.getPlanInfo()
|
|
|
+ }.bind(this));
|
|
|
+ this.getPlanInfo()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 初始化巡检计划列页面值
|
|
|
+ */
|
|
|
+ initEventVal() {
|
|
|
+ this.domObj.empty().append(this.template.split('$$')[0] + "</div>");
|
|
|
+ this.initEvent();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ setGraphSymbol(type, size?) {
|
|
|
+ var symbol = {
|
|
|
+ "SimpleMarkerSymbol": null,
|
|
|
+ "SimpleLineSymbol": null,
|
|
|
+ "SimpleFillSymbol": null,
|
|
|
+ };
|
|
|
+ switch (type) {
|
|
|
+ case "point":
|
|
|
+ symbol.SimpleMarkerSymbol = new SimpleMarkerSymbol(
|
|
|
+ {
|
|
|
+ color: new Color(this.config.color),
|
|
|
+ style: "diamond",
|
|
|
+ outline: {
|
|
|
+ color: new Color(this.config.color),
|
|
|
+ width: 0.2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ case "polyline":
|
|
|
+ symbol.SimpleLineSymbol = new SimpleLineSymbol({
|
|
|
+ color: new Color(this.config.color),
|
|
|
+ style: "solid",
|
|
|
+ width: size ? size : 3
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "polygon":
|
|
|
+ symbol.SimpleFillSymbol = new SimpleFillSymbol({
|
|
|
+ color: new Color([0, 0, 255, 0.5]),
|
|
|
+ style: "solid",
|
|
|
+ outline: {
|
|
|
+ color: new Color(this.config.color),
|
|
|
+ width: 1
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (symbol.SimpleMarkerSymbol != null) {
|
|
|
+ return symbol.SimpleMarkerSymbol;
|
|
|
+ } else if (symbol.SimpleLineSymbol != null) {
|
|
|
+ return symbol.SimpleLineSymbol;
|
|
|
+ } else {
|
|
|
+ return symbol.SimpleFillSymbol;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 设置渲染符号
|
|
|
+ * @param type(point,polyline,polygon)
|
|
|
+ * @param color颜色([0,0,0,1])
|
|
|
+ * @param size
|
|
|
+ */
|
|
|
+ setGraphSymbolByType(type, color, size) {
|
|
|
+ var symbol = {
|
|
|
+ "SimpleMarkerSymbol": null,
|
|
|
+ "SimpleLineSymbol": null,
|
|
|
+ "SimpleFillSymbol": null,
|
|
|
+ };
|
|
|
+ switch (type) {
|
|
|
+ case "point":
|
|
|
+ symbol.SimpleMarkerSymbol = new SimpleMarkerSymbol(
|
|
|
+ {
|
|
|
+ color: new Color(color),
|
|
|
+ style: "diamond",
|
|
|
+ outline: {
|
|
|
+ color: new Color(color),
|
|
|
+ width: size
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ case "polyline":
|
|
|
+ symbol.SimpleLineSymbol = new SimpleLineSymbol({
|
|
|
+ color: new Color(color),
|
|
|
+ style: "solid",
|
|
|
+ width: size
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "polygon":
|
|
|
+ symbol.SimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
|
|
|
+ new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
|
|
|
+ new Color(color), size), new Color([0, 0, 0, 0.1]));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (symbol.SimpleMarkerSymbol != null) {
|
|
|
+ return symbol.SimpleMarkerSymbol.setSize(size);
|
|
|
+ } else if (symbol.SimpleLineSymbol != null) {
|
|
|
+ return symbol.SimpleLineSymbol;
|
|
|
+ } else {
|
|
|
+ return symbol.SimpleFillSymbol;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ setSymbol(txt?) {
|
|
|
+ var symbol = [];
|
|
|
+ var fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255, 0, 0]), 2), new Color([0, 0, 0, 0.1]));
|
|
|
+ var fillSymbol2 = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 0]), 2), new Color([255, 255, 255, 0.3]));
|
|
|
+ var peopleSymbol = new PictureMarkerSymbol(this.config.MarkPictureSymbol, 24, 24);
|
|
|
+
|
|
|
+ var peopletextSymbol = new PictureMarkerSymbol(this.config.TextbgSymbol, txt == null ? 0 : txt.length * 90 / 6, 18);
|
|
|
+ var warnSymbol = new PictureMarkerSymbol(this.config.WarnMarkPictureSymbol, 24, 24);
|
|
|
+ var lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 3);
|
|
|
+ symbol.push(peopleSymbol);
|
|
|
+ symbol.push(peopletextSymbol);
|
|
|
+ symbol.push(fillSymbol);
|
|
|
+ symbol.push(fillSymbol2);
|
|
|
+ symbol.push(warnSymbol);
|
|
|
+ symbol.push(lineSymbol);
|
|
|
+ return symbol;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 获取巡检计划详情
|
|
|
+ * @param data 查询的计划
|
|
|
+ */
|
|
|
+ getPlanInfo() {
|
|
|
+ let senddata = {
|
|
|
+ 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 = [];
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ let info = results.result;
|
|
|
+ let deviceTypeId = info[0].deviceTypeId
|
|
|
+
|
|
|
+ let listHmtl = "";
|
|
|
+ let mapData = {
|
|
|
+ dwObjectId: [],
|
|
|
+ dwObjectGeo: [],
|
|
|
+ wdwObjectId: [],
|
|
|
+ wdwObjectGeo: [],
|
|
|
+
|
|
|
+ layerId: window.tempSearchXjHalf.searchSid.layerId
|
|
|
+ }
|
|
|
+ let thHtml = "";
|
|
|
+ let isCheck = true;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.dataTable_plan = info;
|
|
|
+ let tableData = [];
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ if (isCheck) {
|
|
|
+ if (item.checkState == "1") {
|
|
|
+ mapData.dwObjectId.push(item.pointId)
|
|
|
+ mapData.dwObjectGeo.push(item.geometry)
|
|
|
+ } else {
|
|
|
+ mapData.wdwObjectId.push(item.pointId)
|
|
|
+ mapData.wdwObjectGeo.push(item.geometry)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item.isover == "1") {
|
|
|
+ mapData.dwObjectId.push(item.pointId)
|
|
|
+ mapData.dwObjectGeo.push(item.geometry)
|
|
|
+ } else {
|
|
|
+ mapData.wdwObjectId.push(item.pointId)
|
|
|
+ mapData.wdwObjectGeo.push(item.geometry)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let name = item.deviceTypeName;
|
|
|
+ let bh = item.code || item.id;
|
|
|
+ let dw = item.isoverName;
|
|
|
+ let dwsj = this.ajaxSend.verificationHelper.setNullAndUndefined(item.overDate);
|
|
|
+ listHmtl += "<tr index='" + index + "'><td title='" + bh + "'>" + bh + "</td>"
|
|
|
+ + "<td title='" + name + "'>" + name + "</td>"
|
|
|
+ + "<td title='" + dw + "'>" + dw + "</td>"
|
|
|
+ + "<td title='" + dwsj + "'>" + dwsj + "</td>"
|
|
|
+
|
|
|
+
|
|
|
+ let tableDataItem = {
|
|
|
+ number: null,
|
|
|
+ index: null,
|
|
|
+ bh: null,
|
|
|
+ name: null,
|
|
|
+ dw: null,
|
|
|
+ dwsj: 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>";
|
|
|
+ } else {
|
|
|
+ listHmtl += "</tr>";
|
|
|
+ }
|
|
|
+ this.allSearchList.push(tableDataItem);
|
|
|
+
|
|
|
+ })
|
|
|
+ tableData = this.allSearchList
|
|
|
+
|
|
|
+ let extendTitle = [];
|
|
|
+ let extendContent = [];
|
|
|
+ if (isCheck) {
|
|
|
+ extendTitle = ['查看检查项目'];
|
|
|
+ extendContent = [
|
|
|
+ {
|
|
|
+ field: "lookInfo",
|
|
|
+ fieldContent: "<a class='lookInfo'>查看检查项目</a>"
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ let tableDom = this.domObj.find("#PlanSearchWithSidInfo_table");
|
|
|
+ let option = {
|
|
|
+ that: this,
|
|
|
+ dataTable: that.dataTable,
|
|
|
+ elementId: "PlanSearchWithSidInfo_table",
|
|
|
+ url: that.config.getEquipmentNormalManagementList,
|
|
|
+ searchInfo: that.getSearchInfo,
|
|
|
+ displayTitle: ["设备编码", "所属巡检计划", "计划开始时间", "计划结束时间", "设备类型 ", "检查情况", "检查时间", ...tempTitle],
|
|
|
+ displayField: ['bh', 'description', "childBeginDate", "childEndDate", 'name', 'dw', 'dwsj', ...tempField],
|
|
|
+ extentDisplayTitle: extendTitle,
|
|
|
+ extentDisplayContent: extendContent,
|
|
|
+ beforeTrClickEvent: undefined,
|
|
|
+ afterTrClickEvent: undefined,
|
|
|
+ drawEvent: e => {
|
|
|
+ this.addSeachInfoEvent(tableDom, isCheck)
|
|
|
+ },
|
|
|
+ errmassage: "计划详情信息查询失败",
|
|
|
+ nullmessage: undefined,
|
|
|
+ exportTitle: "计划详情信息",
|
|
|
+ ordering: true,
|
|
|
+ data: tableData
|
|
|
+ }
|
|
|
+ that.dataTable = this.ajaxSend.DataTables_all(option);
|
|
|
+ this.domObj.find("#PlanSearchWithSidInfo_table thead").hide();
|
|
|
+ this.domObj.find(".buttons-excel").hide();
|
|
|
+ this.renderGeo(mapData);
|
|
|
+
|
|
|
+
|
|
|
+ this.addSeachInfoEvent(tableDom, isCheck)
|
|
|
+
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+
|
|
|
+ *
|
|
|
+ * @param tableDom添加表单事件
|
|
|
+ * @param isCheck
|
|
|
+ */
|
|
|
+ addSeachInfoEvent(tableDom, isCheck) {
|
|
|
+ tableDom.find("tbody tr").off().click(e => {
|
|
|
+ let dom = $(e.currentTarget);
|
|
|
+ tableDom.find("tbody tr.currentTr").removeClass("currentTr");
|
|
|
+ dom.addClass("currentTr");
|
|
|
+ let data = this.dataTable_plan[parseInt(dom.find(".indexTd").attr('index'))];
|
|
|
+ this.goToGeo(data);
|
|
|
+ })
|
|
|
+ if (isCheck) {
|
|
|
+ tableDom.find('.lookInfo').off().click(e => {
|
|
|
+ let dom = $(e.currentTarget);
|
|
|
+ let data = this.dataTable_plan[parseInt(dom.attr('index'))];
|
|
|
+ let url = this.config.xjpage;
|
|
|
+ let type = null;
|
|
|
+ if (data.deviceTypeId == 18) {
|
|
|
+
|
|
|
+ type = 1;
|
|
|
+ } else if (data.deviceTypeId == 20) {
|
|
|
+
|
|
|
+ type = 2;
|
|
|
+ } else if (data.deviceTypeId == 16) {
|
|
|
+
|
|
|
+ type = 3;
|
|
|
+ } else if (data.deviceTypeId == 21) {
|
|
|
+ type = 4;
|
|
|
+ }
|
|
|
+ let sendPointData = {
|
|
|
+ typeId: type,
|
|
|
+ childPlanId: data.childPlanId,
|
|
|
+ planTempPointId: data.pointId
|
|
|
+ }
|
|
|
+ this.ajaxSend.sendAjax(this, sendPointData, url, this.ajaxSend.type.get, function (results) {
|
|
|
+ var that = this;
|
|
|
+ if (results.code != 1) {
|
|
|
+ that.toast.Show(results.message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let info = results.result.records[0];
|
|
|
+ if (!info) {
|
|
|
+ this.toast.show("未查询到巡检登记记录!")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ type = info.typeId;
|
|
|
+ let setSize = { width: undefined, height: undefined };
|
|
|
+ let appendHtml = null;
|
|
|
+ let html = "";
|
|
|
+ let imgHtml = '';
|
|
|
+ let infoBox = '';
|
|
|
+ if (info.xjConList && info.content) {
|
|
|
+ appendHtml = this.template.split('$$')[3];
|
|
|
+ setSize.width = 800;
|
|
|
+ setSize.height = 750;
|
|
|
+ info.xjConList.forEach(item => {
|
|
|
+ for (var j = 0; j < info.content.length; j++) {
|
|
|
+ var element = info.content[j];
|
|
|
+ if (item.menuId == element.id) {
|
|
|
+ html += "<tr>";
|
|
|
+ html += "<td title='" + element.name + "'>" + element.name + "</td>";
|
|
|
+ if (item.choose === "1") {
|
|
|
+ html += "<td title=''><label>是<input type='checkbox' checked onclick='return false;'/></label><label>否<input type='checkbox' onclick='return false;'/></label><label>无<input type='checkbox' onclick='return false;'/></td>";
|
|
|
+ } else if (item.choose === "0") {
|
|
|
+ html += "<td title=''><label>是<input type='checkbox' onclick='return false;'/></label><label>否<input type='checkbox' checked onclick='return false;'/></label><label>无<input type='checkbox' onclick='return false;'/></td>";
|
|
|
+ } else {
|
|
|
+ html += "<td title=''><label>是<input type='checkbox' onclick='return false;'/></label><label>否<input type='checkbox' onclick='return false;'/></label><label>无<input type='checkbox' checked onclick='return false;'/></td>";
|
|
|
+ }
|
|
|
+ html += "</tr>";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ html = "<span class='sTitle'>检查项目:</span><span>" + info.contentName + "</span>";
|
|
|
+ appendHtml = this.template.split('$$')[2];
|
|
|
+ setSize.width = 500;
|
|
|
+ setSize.height = 450;
|
|
|
+ }
|
|
|
+
|
|
|
+ let time = info.createDate;
|
|
|
+ let user = info.createUserName;
|
|
|
+ let repairContent = info.contentName;
|
|
|
+ infoBox += "<div><span class='sTitle'>创建时间:</span><span class='sInfo'>" + (time || "") + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>创建人:</span><span class='sInfo'>" + (user || "") + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>检查时间:</span><span class='sInfo'>" + (info.checkDate || "") + "</span></div>";
|
|
|
+ if (type == 1) {
|
|
|
+ infoBox += "<div><span class='sTitle'>调压箱运行压力(单位:Kpa):</span><span class='sInfo'>" + info.runPressure + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>调压箱截断压力(单位:Kpa):</span><span class='sInfo'>" + info.truncationPressure + "</span></div>";
|
|
|
+ } else if (type == 2) {
|
|
|
+ infoBox += "<div><span class='sTitle'>调压柜运行压力(单位:Kpa):</span><span class='sInfo'>" + info.runPressure + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>调压柜放散压力(单位:Kpa):</span><span class='sInfo'>" + info.diffusePressure + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>流量计工作压力(单位:Kpa):</span><span class='sInfo'>" + info.workPressure + "</span></div>";
|
|
|
+ } else if (type == 3) {
|
|
|
+ infoBox += "<div><span class='sTitle'>阀门材质:</span><span class='sInfo'>" + info.material + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>阀门规格:</span><span class='sInfo'>" + info.specification + "</span></div>";
|
|
|
+ } else if (type == 4) {
|
|
|
+ infoBox += "<div><span class='sTitle'>检测桩编号:</span><span class='sInfo'>" + info.deviceId + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>标准电位值:</span><span class='sInfo'>" + info.standardPotential + 'V' + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>检测电位值:</span><span class='sInfo'>" + info.detectionPotential + 'V' + "</span></div>";
|
|
|
+ infoBox += "<div><span class='sTitle'>检测人员:</span><span class='sInfo'>" + (info.createUserName ? info.createUserName : '/') + "</span></div>";
|
|
|
+ }
|
|
|
+ infoBox += "<div><span class='sTitle'>备注:</span><div class='noteOverflow' title='" + info.note + "'>" + (info.note ? info.note : '/') + "</div></div>";
|
|
|
+ if (info.contentName) {
|
|
|
+ infoBox += "<div><span class='sTitle'>维修内容:</span><div class='noteOverflow' title='" + repairContent + "'>" + repairContent + "</div></div>";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (info.photos) {
|
|
|
+ info.photos.forEach(img => {
|
|
|
+ imgHtml += "<li><img src='" + this.ajaxSend.getIamgeAddress(that, img.path) + "'></li>";
|
|
|
+ })
|
|
|
+ infoBox += "<div class='fileInfoList'><span class='photo sTitle'>照片:</span><div class='fileItemUl'><ul class='fileInfoListItem' id='planImgs'>" + imgHtml + "</ul></div></div>";
|
|
|
+ }
|
|
|
+ this.popup.setSize(setSize.width, setSize.height);
|
|
|
+ var Obj = this.popup.Show("检查内容", appendHtml);
|
|
|
+ Obj.conObj.find('.checkContent .checkContentInfo').empty().append(html);
|
|
|
+
|
|
|
+ Obj.conObj.find('.checkContent').append("<div class='infoBox'></div>");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Obj.conObj.find('.infoBox').append(infoBox);
|
|
|
+ Obj.conObj.find("#planImgs").viewer();
|
|
|
+ Obj.submitObj.off("click").on("click", function () {
|
|
|
+ this.popup.close();
|
|
|
+ }.bind(this))
|
|
|
+ }.bind(this))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 暂时屏蔽查询页面
|
|
|
+ * @param infos
|
|
|
+ */
|
|
|
+ hideOrShowSearch(action) {
|
|
|
+
|
|
|
+ if (this.dynamicMapServer) {
|
|
|
+ this.map.removeLayer(this.dynamicMapServer);
|
|
|
+ this.dynamicMapServer = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (action == hideOrShow.hide) {
|
|
|
+ this.domObj.find(".PlanSearchWithSid_toolbar").addClass('hide');
|
|
|
+ this.domObj.find(".PlanSearchWithSid_content").addClass('hide');
|
|
|
+ } else {
|
|
|
+ this.domObj.find(".PlanSearchWithSid_toolbar").removeClass('hide');
|
|
|
+ this.domObj.find(".PlanSearchWithSid_content").removeClass('hide');
|
|
|
+ this.domObj.find('.widget-PlanSearchWithSid-Info').remove();
|
|
|
+ this.selectLayer.clear();
|
|
|
+ this.planLayer.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 定位并显示图形
|
|
|
+ * @param 定位数据
|
|
|
+ */
|
|
|
+ goToGeo(data) {
|
|
|
+ this.selectLayer.clear();
|
|
|
+ let geoJson = JSON.parse(data.geometry);
|
|
|
+ let geo = null;
|
|
|
+ let sym = null;
|
|
|
+ if (geoJson.hasOwnProperty("paths")) {
|
|
|
+ sym = this.mapSet.setGraphSymbol('polyline', '#FFD700');
|
|
|
+ geo = new Polyline(geoJson);
|
|
|
+ } else {
|
|
|
+ sym = this.mapSet.setGraphSymbol('point', '#FFD700');
|
|
|
+ geo = new Point(geoJson);
|
|
|
+ }
|
|
|
+ geo.setSpatialReference(this.map.spatialReference);
|
|
|
+ let graphic = new Graphic(geo, sym);
|
|
|
+ this.selectLayer.add(graphic);
|
|
|
+ if (graphic.geometry && graphic.geometry.type && graphic.geometry.type != "point" && graphic["_extent"]) {
|
|
|
+ this.map.setExtent(graphic["_extent"]);
|
|
|
+ this.map.setZoom(6);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.map.setZoom(9);
|
|
|
+ this.map.setExtent(graphic["_extent"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * @function 熏染已完成和未完成管线或者设备
|
|
|
+ * @param data 渲染数据
|
|
|
+ */
|
|
|
+ renderGeo(data) {
|
|
|
+ this.planLayer.clear();
|
|
|
+ let dwPathGeo = {
|
|
|
+ "paths": [],
|
|
|
+ "spatialReference": { "wkid": this.map.spatialReference }
|
|
|
+ };
|
|
|
+ let dwPointGeo = [];
|
|
|
+ let wdwPathGeo = {
|
|
|
+ "paths": [],
|
|
|
+ "spatialReference": { "wkid": this.map.spatialReference }
|
|
|
+ };
|
|
|
+ let wdwPointGeo = [];
|
|
|
+ if (data.dwObjectGeo.length > 0) {
|
|
|
+ data.dwObjectGeo.forEach(item => {
|
|
|
+ let geo = JSON.parse(item);
|
|
|
+ if (geo.hasOwnProperty("paths")) {
|
|
|
+ dwPathGeo.paths.push(geo.paths[0])
|
|
|
+ } else {
|
|
|
+ let point = new Point(geo);
|
|
|
+ point.setSpatialReference(this.map.spatialReference);
|
|
|
+ dwPointGeo.push(point)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (data.wdwObjectGeo.length > 0) {
|
|
|
+ data.wdwObjectGeo.forEach(item => {
|
|
|
+ let geo = JSON.parse(item);
|
|
|
+ if (geo.hasOwnProperty("paths")) {
|
|
|
+ wdwPathGeo.paths.push(geo.paths[0]);
|
|
|
+ } else {
|
|
|
+ let point = new Point(geo);
|
|
|
+ point.setSpatialReference(this.map.spatialReference);
|
|
|
+ wdwPointGeo.push(point);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let wdwColor = "#FF0000";
|
|
|
+ let dwColor = "#008000";
|
|
|
+ let dwSymLine = this.mapSet.setGraphSymbol('polyline', dwColor);
|
|
|
+ let wdwSymLine = this.mapSet.setGraphSymbol('polyline', wdwColor);
|
|
|
+ let dwSymPoint = this.mapSet.setGraphSymbol('point', dwColor);
|
|
|
+ let wdwSymPoint = this.mapSet.setGraphSymbol('point', wdwColor);
|
|
|
+ if (dwPathGeo.paths.length > 0) {
|
|
|
+ this.planLayer.add(new Graphic(new Polyline(dwPathGeo), dwSymLine));
|
|
|
+ }
|
|
|
+ if (wdwPathGeo.paths.length > 0) {
|
|
|
+ this.planLayer.add(new Graphic(new Polyline(wdwPathGeo), wdwSymLine))
|
|
|
+ }
|
|
|
+ if (dwPointGeo.length > 0) {
|
|
|
+ dwPointGeo.forEach(item => {
|
|
|
+ this.planLayer.add(new Graphic(item, dwSymPoint));
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (wdwPointGeo.length > 0) {
|
|
|
+ wdwPointGeo.forEach(item => {
|
|
|
+ this.planLayer.add(new Graphic(item, wdwSymPoint));
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 销毁对象
|
|
|
+ */
|
|
|
+ destroy() {
|
|
|
+ if (this.jobid) {
|
|
|
+ this.gp.cancelJob(this.jobid);
|
|
|
+ }
|
|
|
+ if (this.selectLayer) {
|
|
|
+ this.map.removeLayer(this.selectLayer);
|
|
|
+ }
|
|
|
+ if (this.planLayer) {
|
|
|
+ this.map.removeLayer(this.planLayer);
|
|
|
+ }
|
|
|
+ if (this.plan_ptype_layer) {
|
|
|
+ this.map.removeLayer(this.plan_ptype_layer);
|
|
|
+ }
|
|
|
+ if (this.plan_pontype_layer) {
|
|
|
+ this.map.removeLayer(this.plan_pontype_layer);
|
|
|
+ }
|
|
|
+ if (this.dynamicMapServer) {
|
|
|
+ this.map.removeLayer(this.dynamicMapServer);
|
|
|
+ }
|
|
|
+ this.domObj.remove();
|
|
|
+ this.afterDestroy();
|
|
|
+ }
|
|
|
+}
|