|
@@ -2,7 +2,8 @@
|
|
|
import MiniMap from '../../../../MapView/miniMap/index';
|
|
|
import { GeoJSON } from "ol/format";
|
|
|
import Feature from 'ol/Feature';
|
|
|
-import { Point, LineString, Polygon}from 'ol/geom';
|
|
|
+import { Point, LineString, Polygon } from 'ol/geom';
|
|
|
+import { getLength, getDistance } from 'ol/sphere';
|
|
|
import elementResizeDetectorMaker from "element-resize-detector"
|
|
|
|
|
|
import echarts from 'echarts'
|
|
@@ -12,6 +13,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ miniMap:null,
|
|
|
datasetNames: [],
|
|
|
pipeLineTypes: [],
|
|
|
pipePointTypes:[],
|
|
@@ -21,8 +23,9 @@ export default {
|
|
|
{ value: "4", label: '电力管线' },
|
|
|
{ value: "5", label: '通信管线' },
|
|
|
{ value: "6", label: '综合管线' }],
|
|
|
- pipeLineType: "请选择",
|
|
|
- selectType: '1',
|
|
|
+ pipeLineType: "",
|
|
|
+ pipePointType: "",
|
|
|
+ selectType: '1',
|
|
|
staCondition: [],
|
|
|
optionFields:[{value: 'buildingNo',label: '楼盘编号'},
|
|
|
{value: 'buildingNum',label: '幢号'},
|
|
@@ -42,30 +45,38 @@ export default {
|
|
|
{ value: 'or', label: '或者'}
|
|
|
],
|
|
|
statisticData: [],
|
|
|
- activeName:'line'
|
|
|
+ activeName: 'line',
|
|
|
+ material:[],
|
|
|
+ adjunct: [],
|
|
|
+ buryType: [],
|
|
|
+ diameter: [],
|
|
|
+ subType:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- console.log('创建管线统计分析');
|
|
|
+ let { material, adjunct, buryType, diameter, subType } = this.$store.state.permission.sysDics;
|
|
|
+ this.material = material;
|
|
|
+ this.adjunct = adjunct;
|
|
|
+ this.buryType = buryType;
|
|
|
+ this.diameter = diameter;
|
|
|
+ this.subType = subType;
|
|
|
},
|
|
|
watch: {
|
|
|
staCondition(newValue, oldValue) {
|
|
|
console.log("改变", newValue, oldValue);
|
|
|
this.statisticCondition = newValue;
|
|
|
},
|
|
|
+ pipeLineType(newValue, oldValue) {
|
|
|
+ this.lineClassifyStatistic();
|
|
|
+ },
|
|
|
+
|
|
|
+ pipePointType(newValue, oldValue) {
|
|
|
+ this.pointClassifyStatistic();
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.statisticMode = '';
|
|
|
this.staCondition.push({ id: 0, fieldName: '', symbol: '', value: '', connect: '' });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.$nextTick(() => {
|
|
|
-
|
|
|
- this.classifyStatistic();
|
|
|
- this.pointClassifyStatistic();
|
|
|
- });
|
|
|
},
|
|
|
|
|
|
destroyed() {
|
|
@@ -115,6 +126,8 @@ export default {
|
|
|
item.type == 'point' ? this.pipePointTypes.push({ value: index + 1 + '', label: item.label }) :
|
|
|
'';
|
|
|
});
|
|
|
+ if (this.pipeLineTypes.length > 0) this.pipeLineType = this.pipeLineTypes[0].value;
|
|
|
+ if (this.pipePointTypes.length > 0) this.pipePointType = this.pipePointTypes[0].value;
|
|
|
},
|
|
|
|
|
|
|
|
@@ -137,9 +150,18 @@ export default {
|
|
|
if (data.statisticCount <= data.times) {
|
|
|
console.log('返回数据', this.statisticData);
|
|
|
this.getOverviewData(this.statisticData);
|
|
|
+ this.lineClassifyStatistic();
|
|
|
+ this.pointClassifyStatistic();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ * 条件查询
|
|
|
+ */
|
|
|
+ conditionQuery() {
|
|
|
+ console.log('条件查询');
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
* 获取总览统计数据
|
|
|
*/
|
|
@@ -231,31 +253,151 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- classifyStatistic() {
|
|
|
- let dataName = []
|
|
|
+
|
|
|
+ * 分类统计
|
|
|
+ */
|
|
|
+ lineClassifyStatistic() {
|
|
|
+
|
|
|
+ let lineType = this.pipeLineTypes.find(pipeLineType => pipeLineType.value == this.pipeLineType);
|
|
|
+ if (this.statisticData.length > 0 && lineType) {
|
|
|
+ let staData = this.statisticData.find(statisticData => statisticData.dataSetInfo.label == lineType.label);
|
|
|
+ this.statisticDiameter(staData);
|
|
|
+ this.statisticMaterial(staData);
|
|
|
+ this.statisticCharact(staData);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 按照管径统计
|
|
|
+ */
|
|
|
+ statisticDiameter(data) {
|
|
|
+ let text = '按管径统计';
|
|
|
+ if (this.diameter.length < 1) {
|
|
|
+ this.diameter = [{ value: "200-400" }, { value: "400-600" }, { value: "600-800" }, { value: "800-1000" }];
|
|
|
+ }
|
|
|
+ let dataName = ['200-400', '400-600', '600-800','800-1000']
|
|
|
+ let dataValue = [820, 932, 901,1200];
|
|
|
+ let option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ echarts.init(this.$refs.lineTypeStatistic).setOption(option);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 按照材料统计
|
|
|
+ */
|
|
|
+ statisticMaterial(datas) {
|
|
|
+ let text = '按材料统计';
|
|
|
+ let dataName = [];
|
|
|
let dataValue = [];
|
|
|
- let text = '';
|
|
|
- let option = null;
|
|
|
- setTimeout(() => {
|
|
|
- dataName = ['200-400', '400-600', '600-800','800-1000']
|
|
|
- dataValue = [820, 932, 901,1200];
|
|
|
- text = '按管径统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
- echarts.init(this.$refs.lineTypeStatistic).setOption(option);
|
|
|
- dataName = ['筋混凝土管', '石棉水泥管', '玻璃钢管', '塑料管', '水球墨铸铁管', '钢管']
|
|
|
- dataValue = [1234, 932, 456, 671, 234, 981];
|
|
|
- text = '按材料统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
- echarts.init(this.$refs.lineMaterialStatistic).setOption(option);
|
|
|
- dataName = ['白色硅胶管', '灰色软管', '黑色塑料管', '灰色塑料管']
|
|
|
- dataValue = [890, 932, 1231, 2341];
|
|
|
- text = '按特征统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
- echarts.init(this.$refs.lineDiamStatistic).setOption(option);
|
|
|
- }, 200);
|
|
|
+ if (this.material.length > 0) {
|
|
|
+ this.material.forEach(item => {
|
|
|
+ dataName.push(item.value);
|
|
|
+ });
|
|
|
+ dataName.forEach(item => {
|
|
|
+ if (datas) {
|
|
|
+ if (datas.result.featureCount == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let fea = datas.result.features.features.filter(
|
|
|
+ feature => {
|
|
|
+ if (item != '其它')
|
|
|
+ return feature.properties.hasOwnProperty('MATERIAL') ? feature.properties.MATERIAL == item : false;
|
|
|
+ else
|
|
|
+ return feature.properties.hasOwnProperty('MATERIAL') ? feature.properties.MATERIAL == '' : false;
|
|
|
+ }
|
|
|
+ )
|
|
|
+ if (fea && fea.length > 0) {
|
|
|
+ let length = this.getFeaturesLength(fea);
|
|
|
+ dataValue.push(length);
|
|
|
+ } else if (fea.length == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ echarts.init(this.$refs.lineMaterialStatistic).setOption(option);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 按照埋设方式统计
|
|
|
+ */
|
|
|
+ statisticCharact(datas) {
|
|
|
+
|
|
|
+ let text = '按埋设方式统计';
|
|
|
+ let dataName = [];
|
|
|
+ let dataValue = [];
|
|
|
+ if (this.buryType.length > 0) {
|
|
|
+ this.buryType.forEach(item => {
|
|
|
+ dataName.push(item.value);
|
|
|
+ });
|
|
|
+ dataName.forEach(item => {
|
|
|
+ if (datas) {
|
|
|
+ if (datas.result.featureCount == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let fea = datas.result.features.features.filter(
|
|
|
+ feature =>
|
|
|
+ {
|
|
|
+ if (item != '其它')
|
|
|
+ return feature.properties.hasOwnProperty('BURYTYPE') ? feature.properties.BURYTYPE == item : false;
|
|
|
+ else
|
|
|
+ return feature.properties.hasOwnProperty('BURYTYPE') ? feature.properties.BURYTYPE == '' : false;
|
|
|
+ }
|
|
|
+ )
|
|
|
+ if (fea && fea.length > 0) {
|
|
|
+ let length = this.getFeaturesLength(fea);
|
|
|
+ dataValue.push(length);
|
|
|
+ } else if (fea.length == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ echarts.init(this.$refs.lineDiamStatistic).setOption(option);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 计算长度
|
|
|
+ */
|
|
|
+ getFeaturesLength(features) {
|
|
|
+
|
|
|
+ let length = 0;
|
|
|
+ if (features) {
|
|
|
+ if (features.length == 0) return 0;
|
|
|
+ features.forEach(fea => {
|
|
|
+
|
|
|
+ let feature = new Feature({
|
|
|
+ geometry: new GeoJSON().readGeometry(fea.geometry)
|
|
|
+ });
|
|
|
+ if (feature.getGeometry() instanceof LineString) {
|
|
|
+ length = length + feature.getGeometry().getLength();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ return (length * 1000).toFixed(2);
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* 总览显示-管点统计
|
|
|
* @dataName 数组,统计类型名称
|
|
@@ -271,6 +413,9 @@ export default {
|
|
|
fontSize:'2.8rem'
|
|
|
}
|
|
|
},
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
data: dataName
|
|
@@ -322,15 +467,17 @@ export default {
|
|
|
fontSize: '3.2rem',
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
|
|
|
|
|
|
- axisLabel: {
|
|
|
- interval:0,
|
|
|
- rotate:40
|
|
|
- } ,
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
data: dataName
|
|
|
},
|
|
|
|
|
@@ -370,44 +517,124 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
pointClassifyStatistic() {
|
|
|
- let dataName = []
|
|
|
+ let pointType = this.pipePointTypes.find(pipeLineType => pipeLineType.value == this.pipePointType);
|
|
|
+ if (this.statisticData.length > 0 && pointType) {
|
|
|
+ let staData = this.statisticData.find(statisticData => statisticData.dataSetInfo.label == pointType.label);
|
|
|
+ this.pointDiamStatistic(staData);
|
|
|
+ this.pointMaterialStatistic(staData);
|
|
|
+ this.pointTypeStatistic();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 管点特征统计
|
|
|
+ */
|
|
|
+ pointDiamStatistic(datas) {
|
|
|
+ let dataName = [];
|
|
|
let dataValue = [];
|
|
|
- let text = '';
|
|
|
- let option = null;
|
|
|
- dataName = ['弯管', '直管', '三通管']
|
|
|
- dataValue = [820, 932, 901];
|
|
|
- text = '按特征统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ let text = '按特征统计';
|
|
|
+ if (this.subType.length > 0) {
|
|
|
+ this.subType.forEach(item => {
|
|
|
+ dataName.push(item.value);
|
|
|
+ });
|
|
|
+ dataName.forEach(item => {
|
|
|
+ if (datas) {
|
|
|
+ if (datas.result.featureCount == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let fea = datas.result.features.features.filter(
|
|
|
+ feature =>
|
|
|
+ {
|
|
|
+ return feature.properties.hasOwnProperty('SUBTYPE') ? feature.properties.SUBTYPE == item : false;
|
|
|
+ }
|
|
|
+ )
|
|
|
+ if (fea)
|
|
|
+ dataValue.push(fea.length)
|
|
|
+ else
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
let pointDiam = echarts.init(this.$refs.pointDiamStatistic);
|
|
|
pointDiam.setOption(option);
|
|
|
- dataName = ['筋混凝土管', '石棉水泥管', '玻璃钢管', '塑料管', '水球墨铸铁管', '钢管']
|
|
|
- dataValue = [1234, 932, 456, 671, 234, 981];
|
|
|
- text = '按附属物统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
- let pointMaterial = echarts.init(this.$refs.pointMaterialStatistic);
|
|
|
- pointMaterial.setOption(option);
|
|
|
- dataName = ['白色硅胶管', '灰色软管', '黑色塑料管', '灰色塑料管']
|
|
|
- dataValue = [890, 932, 1231, 2341];
|
|
|
- text = '按类型统计';
|
|
|
- option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
- let pointType = echarts.init(this.$refs.pointTypeStatistic);
|
|
|
- pointType.setOption(option)
|
|
|
-
|
|
|
elementResizeDetectorMaker().listenTo(this.$refs.pointDiamStatistic, () => {
|
|
|
this.$nextTick(pointDiam.resize)
|
|
|
});
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * 附属物统计
|
|
|
+ */
|
|
|
+ pointMaterialStatistic(datas) {
|
|
|
+ let dataName = [];
|
|
|
+ let dataValue = [];
|
|
|
+ let text = '按附属物统计';
|
|
|
+ if (this.adjunct.length > 0) {
|
|
|
+ this.adjunct.forEach(item => {
|
|
|
+ dataName.push(item.value);
|
|
|
+ });
|
|
|
+ dataName.forEach(item => {
|
|
|
+ if (datas) {
|
|
|
+ if (datas.result.featureCount == 0) {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let fea = datas.result.features.features.filter(
|
|
|
+ feature =>
|
|
|
+ {
|
|
|
+ return feature.properties.hasOwnProperty('ADJUNCT') ? feature.properties.ADJUNCT == item : false;
|
|
|
+ }
|
|
|
+ )
|
|
|
+ if (fea)
|
|
|
+ dataValue.push(fea.length)
|
|
|
+ else
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ dataValue.push(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ let pointMaterial = echarts.init(this.$refs.pointMaterialStatistic);
|
|
|
+ pointMaterial.setOption(option);
|
|
|
|
|
|
elementResizeDetectorMaker().listenTo(this.$refs.pointMaterialStatistic, () => {
|
|
|
this.$nextTick(pointMaterial.resize)
|
|
|
});
|
|
|
-
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ pointTypeStatistic(datas) {
|
|
|
+ let dataName = [];
|
|
|
+ let dataValue = [];
|
|
|
+ let text = '';
|
|
|
+ let option = null;
|
|
|
+ dataName = ['白色硅胶管', '灰色软管', '黑色塑料管', '灰色塑料管']
|
|
|
+ dataValue = [890, 932, 1231, 2341];
|
|
|
+ text = '按类型统计';
|
|
|
+ option = this.getClassifyoption(text,dataName,dataValue);
|
|
|
+ let ePointType = echarts.init(this.$refs.pointTypeStatistic);
|
|
|
+ ePointType.setOption(option)
|
|
|
elementResizeDetectorMaker().listenTo(this.$refs.pointTypeStatistic, () => {
|
|
|
- this.$nextTick(pointType.resize)
|
|
|
+ this.$nextTick(ePointType.resize)
|
|
|
});
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|