123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- /**
- * 管线图层映照方法,本方法获取图层的Id做好是通过图层的name,如果图层管线顺序有变化则需要调整此处,
- * 必须保证此处与发布图层的内容一致
- */
- class PipeInfo {
- type = {
- company: 'company',
- client: 'client'
- }
- currentType="";
- constructor(){
- //本地环境
- // this.currentType=this.type.company;
- //客户环境
- this.currentType=this.type.client;
- }
- /**
- * 管线图层的映照管线,
- */
- pipeData = [
- {
- "id": 0,
- "name": "供水管网",
- "isPipe": false,
- },
- {
- "id": 1,
- "field":"waterinhead",
- "name": "取水头部",
- "isPipe": true,//是否属于管网
- },
- {
- "id": 2,
- "field":"waterintake",
- "name": "取水口",
- "isPipe": true
- },
- {
- "id": 3,
- "field":"waterspeak",
- "name": "水厂送水口",
- "isPipe": true
- },
- {
- "id": 4,
- "field":"waterhead",
- "name": "水厂",
- "isPipe": true
- },
- {
- "id": 5,
- "field":"waterpump",
- "name": "加压站",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 6,
- "field":"watermeter",
- "name": "水表",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 7,
- "field":"collectsite",
- "name": "水质取样点",
- "isPipe": true
- },
- {
- "id": 8,
- "field":"station",
- "name": "监测点",
- "isPipe": true
- },
- {
- "id": 9,
- "field":"valve",
- "name": "控制阀门",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 10,
- "field":"nonvalve",
- "name": "非控制阀",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 11,
- "field":"hydrant",
- "name": "消防栓",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 12,
- "field":"manhole",
- "name": "检查井",
- "isPipe": true,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 13,
- "field":"inspectsite",
- "name": "排污点",
- "isPipe": true
- },
- {
- "id": 14,
- "field":"pipenode",
- "name": "节点",
- "isPipe": true
- },
- {
- "id": 15,
- "field":"standpipe",
- "name": "立管",
- "isPipe": true,
- "isLine":true,//是否属于线
- },
- {
- "id": 16,
- "field":"pipe",
- "name": "管线",
- "isPipe": true,
- "isLine":true,//是否属于线
- },
- {
- "id": 17,
- "field":"region",
- "name": "管网片区",
- },
- {
- "id": 18,
- "name": "井盖",
- "field":"wellvover",
- "isPipe": false,
- "isEquipment":true,//是否属于设备
- },
- {
- "id": 19,
- "name": "图幅框",
- "isPipe": false
- },
- {
- "id": 20,
- "name": "其他分布",
- "isPipe": false
- },
- {
- "id": 21,
- "name": "地图注记",
- "isPipe": false
- },
- {
- "id": 22,
- "name": "道路面",
- "isPipe": false
- },
- {
- "id": 23,
- "name": "绿化区",
- "isPipe": false
- },
- {
- "id": 24,
- "name": "居民区",
- "isPipe": false
- },
- {
- "id": 25,
- "name": "水库",
- "isPipe": false
- },
- {
- "id": 26,
- "name": "河流",
- "isPipe": false
- },
- {
- "id": 27,
- "name": "行政区",
- "isPipe": false
- }
- ]
- /**
- * 根据KeyValue获取图层(获取管网和设备)
- */
- getPipeIdByKeyValue(key,value) {
- const tempData = [];
- for (let i = 0; i < this.pipeData.length; i++) {
- if (this.pipeData[i][key] == value) {
- tempData.push(this.pipeData[i].id)
- }
- };
- return tempData
- };
- /**
- * 根据isPipe获取数据(获取管网和设备)
- */
- getPipeIdByIsPipe(data) {
- const tempData = [];
- for (let i = 0; i < this.pipeData.length; i++) {
- if (this.pipeData[i].isPipe == data) {
- tempData.push(this.pipeData[i].id)
- }
- };
- return tempData
- };
- /**
- * 根据IsEquipment获取数据(获取设备)
- */
- getPipeIdByIsEquipment(data) {
- if(!data){
- data=true
- }
- const tempData = [];
- for (let i = 0; i < this.pipeData.length; i++) {
- if (this.pipeData[i].isEquipment == data) {
- tempData.push(this.pipeData[i].id)
- }
- };
- return tempData
- };
- /**
- * 根据isLine获取数据(获取管线)
- */
- getPipeIdByisLine(data) {
- if(!data){
- data=true
- }
- const tempData = [];
- for (let i = 0; i < this.pipeData.length; i++) {
- if (this.pipeData[i].isLine == data) {
- tempData.push(this.pipeData[i].id)
- }
- };
- return tempData
- };
- }
- const pipeInfo = new PipeInfo();
- export default pipeInfo;
|