Pārlūkot izejas kodu

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

maxiaoxiao 11 mēneši atpakaļ
vecāks
revīzija
eb8c522d48

+ 7 - 0
src/api/cockpitNew.js

@@ -23,3 +23,10 @@ export function GetTableData(params) {
         params
     })
 }
+export function GetTabsData(params) {
+    return request({
+        url: '/apply/tabledata/query/layer',
+        method: 'get',
+        params
+    })
+}

+ 45 - 280
src/components/Query/clickQuery/MultiLevelQuery.vue

@@ -1,39 +1,17 @@
 <template>
-    <el-tabs class="multi_level_query_table" v-model="activeName" @tab-click="handleClick" @tab-remove="removeTab"
-        v-if="store.state.query_pick_last_pane">
+    <el-tabs class="multi_level_query_table" v-model="activeName" @tab-click="handleClick" @tab-remove="removeTab">
+
         <el-tab-pane :label="store.state.query_pick_last_pane.name" name="second">
-            <div class="list_vector_multi" v-for="(item_last, index) in store.state.query_pick_last_pane.value" :key="index"
-                v-if="item_last.filed != 'geom'">
-                <span>{{ item_last.filedZH }}:
-                    {{ item_last.filedZH == '面积' ? item_last.data.toFixed(2) : item_last.data }}</span>
-            </div>
+            {{ store.state.query_pick_last_pane }}
         </el-tab-pane>
 
         <el-tab-pane :closable="item.close" :label="item.name" :name="item.name"
             v-for="(item, index) in store.state.query_pick_pane" :key="index">
-            <pie class="echart" :class="item.name == '权属' ? 'echart1' : ''" unit="亩"
-                @echartClick="(name) => echartClick(name, item.value)" :ref="`echartRef`"></pie>
-            <div>{{ eclickname }}</div>
-            <el-collapse v-for="(value, index_item) in echartList[eclickname]" :key="index_item" @change="handleChange">
-                <el-collapse-item :title="'地块' + (index_item + 1)" name="1">
-                    <div class="list_vector_multi" v-for="(value_field, index_field) in value" :key="index_field"
-                        @click="go(value)" v-if="value_field.filed != 'geom'">
-
-                        <div class="filed_box">
-                            {{ value_field.filedZH }}
-                        </div>
-                        :
-                        <div class="filed_box">
-                            {{ value_field.filedZH == '面积' ? value_field.data.toFixed(2) : value_field.data }}
-                        </div>
-                    </div>
-
-                </el-collapse-item>
-            </el-collapse>
-
+            {{ item.name }}
         </el-tab-pane>
+
         <el-tab-pane label="自定义" name="自定义">
-            <el-input clearable v-model="state" @input="change_witch" class="search" placeholder="请输入内容"></el-input>
+            <!-- <el-input clearable v-model="state" @input="change_witch" class="search" placeholder="请输入内容"></el-input> -->
             <el-checkbox-group v-model="activecheckList">
                 <el-checkbox :label="item.label" v-for="(item, index) in check_list" :key="index"
                     :disabled="item.ckeck"></el-checkbox>
@@ -50,7 +28,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-import { GetTableData } from '@/api/cockpitNew'
+import { GetTabsData } from '@/api/cockpitNew'
 import * as wellknown from "wellknown";
 import * as turf from "@turf/turf";
 import pie from "@/components/echartsTemplate/pie.vue";
@@ -86,25 +64,7 @@ export default {
     //方法集合
     methods: {
         change_witch() {
-            if (word.length == 0) {
-                this.active_dableData = this.tableData;
-                console.log('this.active_dableData: ', this.active_dableData);
-            } else {
-                // console.log('this.tableData: ', this.tableData);
-                // this.active_dableData = this.tableData.filter((item) => {
-                //     item.项目名称.indexOf(word) >= 0
-                // })
-                console.log('this.tableData: ', this.word);
-
-                this.active_dableData = this.tableData.filter((item) => {
-                    console.log('item: ', item);
-                    if (item[this.word] && word) {
-                        return item[this.word].indexOf(word) >= 0;
-                    }
-                    return false;
-                })
 
-            }
         },
         removeTab(targetName) {
             let tabs = store.state.query_pick_pane;
@@ -151,26 +111,7 @@ export default {
 
             })
         },
-        compute(mj) {
-            return mj ? (mj * 0.0015).toFixed(2) : 0;
-        },
-        setEchart(data, type, index) {
-            this.$nextTick(() => {
-                let max = index == 0 ? 3 : 10
-                let legend_right = index == 0 ? "2%" : "10%"
-                this.$refs.echartRef[index].setOptions({ data, type, max, legend_right });
-            });
-        },
-        echartClick(name, datas) {
-            this.eclickname = name
-            // let click = datas.filter((c) => c.name == name);
-            // if (click.length > 0) this.gogeojson(click[0].geom );
-        },
-        switch_show(flag) {
-            pick_entity.entities.values.forEach((res) => {
-                res.show = flag;
-            })
-        },
+
         go(e) {
             const that = this;
             e.forEach(element => {
@@ -249,12 +190,8 @@ export default {
                 },
             });
         },
-        handleChange(val) {
-            // console.log(val);
-        },
-        handleClick(tab, event) {
-            this.eclickname = ''
-            // console.log(tab, event);
+        clear_data() {
+
         },
         init_handler() {
 
@@ -285,20 +222,20 @@ export default {
                     position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
                 }
 
-                manager_multi_level_query.entities.add({
-                    name: "manager_multi_level_query",
-                    position: Cesium.Cartesian3.fromDegrees(longitude, latitude, 40),
-                    billboard: {
-                        // 图像地址,URI或Canvas的属性
-                        image: "./static/images/overview/go.png",
-                        height: 34,
-                        width: 36,
-                        scale: 1.0,
-                        zIndex: 2,
-                        show: true
-                    },
+                // manager_multi_level_query.entities.add({
+                //     name: "manager_multi_level_query",
+                //     position: Cesium.Cartesian3.fromDegrees(longitude, latitude, 40),
+                //     billboard: {
+                //         // 图像地址,URI或Canvas的属性
+                //         image: "./static/images/overview/go.png",
+                //         height: 34,
+                //         width: 36,
+                //         scale: 1.0,
+                //         zIndex: 2,
+                //         show: true
+                //     },
 
-                })
+                // })
 
                 const geojsonPoint = {
                     "type": "Point",
@@ -308,79 +245,36 @@ export default {
                 const wkt = wellknown.stringify(geojsonPoint);
                 // let id = store.state.vectorlayerlist[store.state.vectorlayerlist.length - 1].id
                 let obj = {
-                    // "wkt": 'POINT (109.51207847188947 18.311530254307392)', //单面
-                    // "wkt": 'POINT (109.50728022974468 18.318266593715794)', //多面
-                    "wkt": wkt,
+                    // layerId:id
+                }
+                let data = await GetTabsData(obj);
+                console.log('data: ', data);
+                // data.data.forEach((res) => {
+                //     store.state.query_pick_pane.push({
+                //         name: res.name,
+                //         // value: res.data.data[0],
+                //         close: 'closable'
+                //     });
+                // })
 
-                    "id": 'dd699f839bc04969ae2dc2e1964d0ad1',
-                    // "id": id,
+                for (let index = 0; index < data.data.length; index++) {
+                    const element = data.data[index];
 
-                }
-                GetTableData(obj).then(res => {
-                    if (res.data.data != undefined) {
+                    if (index == 0) {
                         store.state.query_pick_last_pane = {
-                            name: res.data.dataname,
-                            value: res.data.data[0],
-                            close: 'closable'
+                            name: element.name,
+                            // value: res.data.data[0],
                         };
-                    }
-                    if (res.data.child != undefined) {
-                        store.state.query_pick_pane = [];
-                        let index = -1;
-                        res.data.child.forEach(element => {
-                            if (element.data.length > 1) {
-                                index++;
-                                let edata = []
-                                store.state.query_pick_pane.push({
-                                    name: element.dataname,
-                                    value: [],// element.data
-                                    close: 'closable'
-
-                                });
-
-                                element.data.forEach(e => {
-                                    e.forEach((res) => {
-                                        if (res.filed == 'geom') {
-                                            let geojson = wellknown.parse(res.data);
-                                            // that.draw_vector(geojson, e,); 暂时不绘制面
-                                        }
-                                    })
-                                });
-                                // if(element.dataname == '土地现状'){
-                                const countByName = element.data.reduce((acc, e) => {
-                                    let name, value = ''
-                                    e.forEach((res) => {
-                                        if (res.filed == 'dlmc' || res.filed == 'qslx') name = res.data
-                                        if (res.filed == 'siweiarea') value = res.data
-
-                                    })
-                                    acc[name] = (acc[name] || 0) + value;
-                                    if (element.dataname == '权属') {
-                                        if (!this.echartList[name]) this.echartList[name] = []
-                                        this.echartList[name].push(e)
-                                    }
-                                    return acc;
-                                }, {});
-
-                                Object.keys(countByName).forEach((key) => {
-                                    edata.push({ name: key, value: this.compute(countByName[key]) })
-                                });
-                                edata.sort((a, b) => b.value - a.value);
-                                // }
-                                this.setEchart(edata, 'vertical', index)
-
-                                // store.state.query_pick_pane.push({
-                                //     name: element.dataname,
-                                //     value: element.data,
-                                // });
-
-                                // that.draw_vector(e);
-                            }
+                    } else {
+                        store.state.query_pick_pane.push({
+                            name: element.name,
+                            // value: res.data.data[0],
+                            close: 'closable'
                         });
                     }
 
-                })
 
+                }
 
                 // this.highlightResults(longitude, latitude);
 
@@ -463,122 +357,7 @@ export default {
 
 
         },
-        convertCoordinates(coordArray) {
-            return coordArray.map(coord => [coord.x, coord.y]);
-        },
-        calcIserverURI(url) {
-            let uriArr = url.split("/");
-            uriArr[5] = uriArr[5].replace("map-", "data-");
-            uriArr[7] = "data";
-            uriArr[8] = "featureResults.rjson?returnContent=true";
-            return uriArr.join("/");
-        },
-        multiPolygonToPolygons(multiPolygon) {
-            const polygons = [];
-            multiPolygon.coordinates.forEach(polygonCoordinates => {
-                polygons.push({
-                    type: 'Polygon',
-                    coordinates: polygonCoordinates
-                });
-            });
-            return polygons;
-        },
-        clear_data() {
-            const that = this;
-            store.state.query_pick_last_pane = null;
-            store.state.query_pick_pane = [];
-            // 图标
-            var entities = manager_multi_level_query.entities.values;
-            for (var i = entities.length - 1; i >= 0; i--) {
-                manager_multi_level_query.entities.remove(entities[i]);
-            }
-            // 矢量
-
-            manager_multi_level_vector.removeAll();
-            // for (let index = 0; index < manager_multi_level_vector._primitives.length; index++) {
-            //     const element = manager_multi_level_vector._primitives[index];
-            //     console.log('element: ', element);
-            //     viewer.scene.primitives.remove(element);
-
-            // }
-
-            this.remove_query_click_by_iserver();
-        },
-        add_viewer_for_vector(geojson, data) {
 
-            const twoDArray = geojson.coordinates[0];
-            const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
-
-            let polygon = new Cesium.GeometryInstance({
-                // id: JSON.stringify(obj),
-                geometry: new Cesium.PolygonGeometry({
-                    minimum: new Cesium.Cartesian3(0, 0, 0),
-                    maximum: new Cesium.Cartesian3(100000, 100000, 100000),
-                    polygonHierarchy: new Cesium.PolygonHierarchy(
-                        Cesium.Cartesian3.fromDegreesArray(oneDArray)
-                    ),
-                    height: 1,
-                    // extrudedHeight: 10,
-                })
-            })
-
-            let addPolygonGeometry = new Cesium.Primitive({
-                geometryInstances: polygon,
-                appearance: new Cesium.EllipsoidSurfaceAppearance({
-                    material: Cesium.Material.fromType('Color', {
-                        color: Cesium.Color.fromRandom({
-                            alpha: 0.8
-                        })
-                    })
-                }),
-                show: true,
-
-            })
-            manager_multi_level_vector.add(addPolygonGeometry)
-        },
-        draw_vector(geojson, data) {
-            // viewer.dataSources.add(Cesium.GeoJsonDataSource.load(geojson, {
-            //     stroke: Cesium.Color.HOTPINK,
-            //     fill: Cesium.Color.PINK,
-            //     strokeWidth: 3,
-            //     markerSymbol: '?'
-            // }));
-            const that = this;
-            if (geojson.type == 'MultiPolygon') {
-                let polygons = that.multiPolygonToPolygons(geojson);
-
-                polygons.forEach((res) => {
-                    that.add_viewer_for_vector(res, data);
-                })
-            } else {
-                that.add_viewer_for_vector(geojson, data);
-            }
-        },
-        remove_query_click_by_iserver() {
-            for (var i = 0; i < 10; i++) {
-                query_click_by_iserver.entities.values.forEach((res) => {
-
-                    query_click_by_iserver.entities.remove(res);
-
-                })
-            }
-        },
-        isArray2D(arr) {
-            // 首先检查arr是否是数组
-            if (!Array.isArray(arr)) {
-                return false;
-            }
-
-            // 检查数组中的每个元素是否也是数组
-            for (let i = 0; i < arr.length; i++) {
-                if (!Array.isArray(arr[i])) {
-                    return false;
-                }
-            }
-
-            // 如果所有元素都是数组,那么arr是二维数组
-            return true;
-        },
     },
     beforeCreate() { }, //生命周期 - 创建之前
     created() { }, //生命周期 - 创建完成(可以访问当前this实例)
@@ -586,21 +365,7 @@ export default {
     mounted() {
         const that = this;
         this.$nextTick(() => {
-            that.handler_multi_level_query = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
-
-            manager_multi_level_query = new Cesium.CustomDataSource("manager_multi_level_query");
-            viewer.dataSources.add(manager_multi_level_query);
-
-            manager_multi_level_vector = new Cesium.PrimitiveCollection();
-            manager_multi_level_vector.destroyPrimitives = false;
-            viewer.scene.primitives.add(manager_multi_level_vector);
-
-
-            pick_entity = new Cesium.CustomDataSource("pick_entity");
-            viewer.dataSources.add(pick_entity);
 
-            query_click_by_iserver = new Cesium.CustomDataSource("query_click_by_iserver");
-            viewer.dataSources.add(query_click_by_iserver);
         })
 
     }, //生命周期 - 挂在完成

+ 718 - 0
src/components/Query/clickQuery/MultiLevelQuery1.vue

@@ -0,0 +1,718 @@
+<template>
+    <el-tabs class="multi_level_query_table" v-model="activeName" @tab-click="handleClick" @tab-remove="removeTab"
+        v-if="store.state.query_pick_last_pane">
+        <el-tab-pane :label="store.state.query_pick_last_pane.name" name="second">
+            <div class="list_vector_multi" v-for="(item_last, index) in store.state.query_pick_last_pane.value" :key="index"
+                v-if="item_last.filed != 'geom'">
+                <span>{{ item_last.filedZH }}:
+                    {{ item_last.filedZH == '面积' ? item_last.data.toFixed(2) : item_last.data }}</span>
+            </div>
+        </el-tab-pane>
+
+        <el-tab-pane :closable="item.close" :label="item.name" :name="item.name"
+            v-for="(item, index) in store.state.query_pick_pane" :key="index">
+            <pie class="echart" :class="item.name == '权属' ? 'echart1' : ''" unit="亩"
+                @echartClick="(name) => echartClick(name, item.value)" :ref="`echartRef`"></pie>
+            <div>{{ eclickname }}</div>
+            <el-collapse v-for="(value, index_item) in echartList[eclickname]" :key="index_item" @change="handleChange">
+                <el-collapse-item :title="'地块' + (index_item + 1)" name="1">
+                    <div class="list_vector_multi" v-for="(value_field, index_field) in value" :key="index_field"
+                        @click="go(value)" v-if="value_field.filed != 'geom'">
+
+                        <div class="filed_box">
+                            {{ value_field.filedZH }}
+                        </div>
+                        :
+                        <div class="filed_box">
+                            {{ value_field.filedZH == '面积' ? value_field.data.toFixed(2) : value_field.data }}
+                        </div>
+                    </div>
+
+                </el-collapse-item>
+            </el-collapse>
+
+        </el-tab-pane>
+        <el-tab-pane label="自定义" name="自定义">
+            <el-input clearable v-model="state" @input="change_witch" class="search" placeholder="请输入内容"></el-input>
+            <el-checkbox-group v-model="activecheckList">
+                <el-checkbox :label="item.label" v-for="(item, index) in check_list" :key="index"
+                    :disabled="item.ckeck"></el-checkbox>
+
+            </el-checkbox-group>
+            <div style="margin-bottom: 20px;">
+                <el-button size="small" @click="addTab()">
+                    添加
+                </el-button>
+            </div>
+        </el-tab-pane>
+    </el-tabs>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import { GetTableData } from '@/api/cockpitNew'
+import * as wellknown from "wellknown";
+import * as turf from "@turf/turf";
+import pie from "@/components/echartsTemplate/pie.vue";
+
+let manager_multi_level_query = null;
+let pick_entity = null;
+
+let manager_multi_level_vector = null;
+let query_click_by_iserver = null;
+
+export default {
+    components: { pie },
+    data() {
+        return {
+            activeName: 'second',
+            handler_multi_level_query: null,
+            manager_multi_level_query: null,
+            manager_multi_level_vector: null,
+            pick_entity: null,
+            pick_entity_geo: null,
+            eclickname: '',
+            echartList: {},
+            tabIndex: 2,
+            state: '',
+            activecheckList: [],
+            check_list: [{ label: '三调', ckeck: true }, { label: '权属', ckeck: true }, { label: '农用' }, { label: '上映' }]
+        };
+    },
+    //监听属性 类似于data概念
+    computed: {},
+    //监控data中的数据变化
+    watch: {},
+    //方法集合
+    methods: {
+        change_witch() {
+            if (word.length == 0) {
+                this.active_dableData = this.tableData;
+                console.log('this.active_dableData: ', this.active_dableData);
+            } else {
+                // console.log('this.tableData: ', this.tableData);
+                // this.active_dableData = this.tableData.filter((item) => {
+                //     item.项目名称.indexOf(word) >= 0
+                // })
+                console.log('this.tableData: ', this.word);
+
+                this.active_dableData = this.tableData.filter((item) => {
+                    console.log('item: ', item);
+                    if (item[this.word] && word) {
+                        return item[this.word].indexOf(word) >= 0;
+                    }
+                    return false;
+                })
+
+            }
+        },
+        removeTab(targetName) {
+            let tabs = store.state.query_pick_pane;
+            let activeName = this.activeName;
+            if (activeName === targetName) {
+                tabs.forEach((tab, index) => {
+                    if (tab.name === targetName) {
+                        let nextTab = tabs[index + 1] || tabs[index - 1];
+                        if (nextTab) {
+                            activeName = nextTab.name;
+                        }
+                    }
+                });
+            }
+
+            this.activeName = activeName;
+            store.state.query_pick_pane = tabs.filter(tab => tab.name !== targetName);
+        },
+        addTab() {
+            // let newTabName = ++this.tabIndex + '';
+            // store.state.query_pick_pane.push({
+
+            //     name: newTabName,
+            //     value: [1, 2, 3, 4],// element.data
+            //     close: 'closable'
+
+            // });
+            // this.activeName = newTabName;
+
+
+            this.activecheckList.forEach((res) => {
+                console.log('res: ', res);
+
+
+                store.state.query_pick_pane.push({
+
+                    name: res,
+                    value: [1, 2, 3, 4],// element.data
+                    close: 'closable'
+
+                });
+
+                this.activeName = res;
+
+            })
+        },
+        compute(mj) {
+            return mj ? (mj * 0.0015).toFixed(2) : 0;
+        },
+        setEchart(data, type, index) {
+            this.$nextTick(() => {
+                let max = index == 0 ? 3 : 10
+                let legend_right = index == 0 ? "2%" : "10%"
+                this.$refs.echartRef[index].setOptions({ data, type, max, legend_right });
+            });
+        },
+        echartClick(name, datas) {
+            this.eclickname = name
+            // let click = datas.filter((c) => c.name == name);
+            // if (click.length > 0) this.gogeojson(click[0].geom );
+        },
+        switch_show(flag) {
+            pick_entity.entities.values.forEach((res) => {
+                res.show = flag;
+            })
+        },
+        go(e) {
+            const that = this;
+            e.forEach(element => {
+                if (element.filed == "geom") {
+                    this.gogeojson(element.data)
+                }
+            });
+        },
+        gogeojson(data) {
+            let geojson = wellknown.parse(data);
+
+            const twoDArray = geojson.coordinates[0];
+            const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+            this.pick_entity_geo = oneDArray;
+
+            pick_entity.entities.add({
+                polygon: {
+                    // 获取指定属性(positions,holes(图形内需要挖空的区域))
+                    hierarchy: {
+                        positions: Cesium.Cartesian3.fromDegreesArray(oneDArray),
+                    },
+                    // 边框
+                    outline: true,
+                    // 边框颜色
+                    outlineColor: Cesium.Color.RED,
+                    // 边框尺寸
+                    outlineWidth: 2,
+                    // 填充的颜色,withAlpha透明度
+                    material: Cesium.Color.GREEN.withAlpha(0),
+                    // 是否被提供的材质填充
+                    fill: true,
+                    // 恒定高度
+                    height: 1.1,
+                    // 显示在距相机的距离处的属性,多少区间内是可以显示的
+                    // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
+                    // 是否显示
+                    show: true,
+                    // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
+                    zIndex: 10
+                }
+            });
+
+            let flag = true;
+            let time = setInterval(() => {
+                flag = !flag
+                this.switch_show(flag);
+            }, 500);
+            setTimeout(() => {
+                clearInterval(time);
+                pick_entity.entities.values.forEach((res) => {
+
+                    pick_entity.entities.remove(res);
+
+                })
+            }, 6000)
+
+
+            // 注意:polygon首尾坐标要一致
+            var polygon = turf.polygon([geojson.coordinates[0]]);
+
+            var centroid = turf.centroid(polygon).geometry.coordinates;
+
+            viewer.camera.flyTo({
+                duration: 1,
+
+                destination: Cesium.Cartesian3.fromDegrees(centroid[0], centroid[1], 3000),
+                // destination: {
+                //     x: -6283267.004204832,
+                //     y: 28123682.896774407,
+                //     z: 23709669.98539126
+                // },
+                orientation: {
+                    heading: 6.149339593573709,
+                    pitch: -1.539825618847483,
+                    roll: 0
+                },
+            });
+        },
+        handleChange(val) {
+            // console.log(val);
+        },
+        handleClick(tab, event) {
+            this.eclickname = ''
+            // console.log(tab, event);
+        },
+        init_handler() {
+
+
+            const that = this;
+
+            that.clear_data();
+            if (that.handler_multi_level_query == null) {
+                that.handler_multi_level_query = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
+            }
+            that.handler_multi_level_query.setInputAction(async event => {
+                let pickObj = viewer.scene.pick(event.position);
+                var position = viewer.scene.pickPosition(event.position);
+
+                if (!position)//点击到地球之外
+                    return false;
+                var cartographic = Cesium.Cartographic.fromCartesian(position);
+
+
+                let longitude = Cesium.Math.toDegrees(cartographic.longitude);
+                let latitude = Cesium.Math.toDegrees(cartographic.latitude);
+                let height = cartographic.height;
+                let heading = viewer.scene.camera.heading;
+                let pitch = viewer.scene.camera.pitch;
+                // that.addSceneFun()
+
+                if (!position) {
+                    position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
+                }
+
+                manager_multi_level_query.entities.add({
+                    name: "manager_multi_level_query",
+                    position: Cesium.Cartesian3.fromDegrees(longitude, latitude, 40),
+                    billboard: {
+                        // 图像地址,URI或Canvas的属性
+                        image: "./static/images/overview/go.png",
+                        height: 34,
+                        width: 36,
+                        scale: 1.0,
+                        zIndex: 2,
+                        show: true
+                    },
+
+                })
+
+                const geojsonPoint = {
+                    "type": "Point",
+                    "coordinates": [longitude, latitude] // 注意经纬度顺序  
+                };
+
+                const wkt = wellknown.stringify(geojsonPoint);
+                // let id = store.state.vectorlayerlist[store.state.vectorlayerlist.length - 1].id
+                let obj = {
+                    // "wkt": 'POINT (109.51207847188947 18.311530254307392)', //单面
+                    // "wkt": 'POINT (109.50728022974468 18.318266593715794)', //多面
+                    "wkt": wkt,
+
+                    "id": 'dd699f839bc04969ae2dc2e1964d0ad1',
+                    // "id": id,
+
+                }
+                GetTableData(obj).then(res => {
+                    if (res.data.data != undefined) {
+                        store.state.query_pick_last_pane = {
+                            name: res.data.dataname,
+                            value: res.data.data[0],
+                            close: 'closable'
+                        };
+                    }
+                    if (res.data.child != undefined) {
+                        store.state.query_pick_pane = [];
+                        let index = -1;
+                        res.data.child.forEach(element => {
+                            if (element.data.length > 1) {
+                                index++;
+                                let edata = []
+                                store.state.query_pick_pane.push({
+                                    name: element.dataname,
+                                    value: [],// element.data
+                                    close: 'closable'
+
+                                });
+
+                                element.data.forEach(e => {
+                                    e.forEach((res) => {
+                                        if (res.filed == 'geom') {
+                                            let geojson = wellknown.parse(res.data);
+                                            // that.draw_vector(geojson, e,); 暂时不绘制面
+                                        }
+                                    })
+                                });
+                                // if(element.dataname == '土地现状'){
+                                const countByName = element.data.reduce((acc, e) => {
+                                    let name, value = ''
+                                    e.forEach((res) => {
+                                        if (res.filed == 'dlmc' || res.filed == 'qslx') name = res.data
+                                        if (res.filed == 'siweiarea') value = res.data
+
+                                    })
+                                    acc[name] = (acc[name] || 0) + value;
+                                    if (element.dataname == '权属') {
+                                        if (!this.echartList[name]) this.echartList[name] = []
+                                        this.echartList[name].push(e)
+                                    }
+                                    return acc;
+                                }, {});
+
+                                Object.keys(countByName).forEach((key) => {
+                                    edata.push({ name: key, value: this.compute(countByName[key]) })
+                                });
+                                edata.sort((a, b) => b.value - a.value);
+                                // }
+                                this.setEchart(edata, 'vertical', index)
+
+                                // store.state.query_pick_pane.push({
+                                //     name: element.dataname,
+                                //     value: element.data,
+                                // });
+
+                                // that.draw_vector(e);
+                            }
+                        });
+                    }
+
+                })
+
+
+                // this.highlightResults(longitude, latitude);
+
+                that.handler_multi_level_query.destroy();
+                that.handler_multi_level_query = null;
+            }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
+
+
+        },
+        async highlightResults(longitude, latitude) {
+            // 高亮结果
+            let queryByIDParameters = {
+                getFeatureMode: "BUFFER",
+                // getFeatureMode: "SPATIAL",
+                spatialQueryMode: "INTERSECT",
+                datasetNames: store.state.vectorlayerlist[store.state.vectorlayerlist.length - 1].source.split(","),
+                geometry: {
+                    parts: [1],
+                    points: [{ y: latitude, x: longitude }],
+                    type: "POINT",
+                },
+                bufferDistance: 0.00005,
+                hasGeometry: true,
+            };
+
+
+
+            let response = await axios.post(this.calcIserverURI(store.state.vectorlayerlist[store.state.vectorlayerlist.length - 1].url), queryByIDParameters);
+
+
+            const outputCoords = this.convertCoordinates(response.data.features[0].geometry.points);
+            outputCoords.push(outputCoords[0])
+
+            let f = { "type": "Polygon", "coordinates": [outputCoords] };
+            let result = turf.buffer(f, 1 / 99999, {
+                units: "kilometers",
+            });
+            let positions = [];
+            const twoDArray = result.geometry.coordinates[0];
+            const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+
+            positions = oneDArray;
+
+
+            if (this.isArray2D(oneDArray)) {
+                const oneDArray2 = oneDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+                positions = oneDArray2;
+
+            } else {
+
+            }
+
+            query_click_by_iserver.entities.add({
+                polygon: {
+                    // 获取指定属性(positions,holes(图形内需要挖空的区域))
+                    hierarchy: {
+                        positions: Cesium.Cartesian3.fromDegreesArray(positions)
+                    },
+                    // 边框
+                    outline: false,
+                    // 边框颜色
+                    outlineColor: Cesium.Color.RED,
+                    // 边框尺寸
+                    outlineWidth: 10,
+                    // 填充的颜色,withAlpha透明度
+                    material: Cesium.Color.RED,
+
+                    // 是否被提供的材质填充
+                    fill: true,
+                    // 恒定高度
+                    height: 1.1,
+                    // 显示在距相机的距离处的属性,多少区间内是可以显示的
+                    // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
+                    // 是否显示
+                    show: true,
+                    // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
+                    zIndex: 10
+                }
+            });
+
+
+        },
+        convertCoordinates(coordArray) {
+            return coordArray.map(coord => [coord.x, coord.y]);
+        },
+        calcIserverURI(url) {
+            let uriArr = url.split("/");
+            uriArr[5] = uriArr[5].replace("map-", "data-");
+            uriArr[7] = "data";
+            uriArr[8] = "featureResults.rjson?returnContent=true";
+            return uriArr.join("/");
+        },
+        multiPolygonToPolygons(multiPolygon) {
+            const polygons = [];
+            multiPolygon.coordinates.forEach(polygonCoordinates => {
+                polygons.push({
+                    type: 'Polygon',
+                    coordinates: polygonCoordinates
+                });
+            });
+            return polygons;
+        },
+        clear_data() {
+            const that = this;
+            store.state.query_pick_last_pane = null;
+            store.state.query_pick_pane = [];
+            // 图标
+            var entities = manager_multi_level_query.entities.values;
+            for (var i = entities.length - 1; i >= 0; i--) {
+                manager_multi_level_query.entities.remove(entities[i]);
+            }
+            // 矢量
+
+            manager_multi_level_vector.removeAll();
+            // for (let index = 0; index < manager_multi_level_vector._primitives.length; index++) {
+            //     const element = manager_multi_level_vector._primitives[index];
+            //     console.log('element: ', element);
+            //     viewer.scene.primitives.remove(element);
+
+            // }
+
+            this.remove_query_click_by_iserver();
+        },
+        add_viewer_for_vector(geojson, data) {
+
+            const twoDArray = geojson.coordinates[0];
+            const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+
+            let polygon = new Cesium.GeometryInstance({
+                // id: JSON.stringify(obj),
+                geometry: new Cesium.PolygonGeometry({
+                    minimum: new Cesium.Cartesian3(0, 0, 0),
+                    maximum: new Cesium.Cartesian3(100000, 100000, 100000),
+                    polygonHierarchy: new Cesium.PolygonHierarchy(
+                        Cesium.Cartesian3.fromDegreesArray(oneDArray)
+                    ),
+                    height: 1,
+                    // extrudedHeight: 10,
+                })
+            })
+
+            let addPolygonGeometry = new Cesium.Primitive({
+                geometryInstances: polygon,
+                appearance: new Cesium.EllipsoidSurfaceAppearance({
+                    material: Cesium.Material.fromType('Color', {
+                        color: Cesium.Color.fromRandom({
+                            alpha: 0.8
+                        })
+                    })
+                }),
+                show: true,
+
+            })
+            manager_multi_level_vector.add(addPolygonGeometry)
+        },
+        draw_vector(geojson, data) {
+            // viewer.dataSources.add(Cesium.GeoJsonDataSource.load(geojson, {
+            //     stroke: Cesium.Color.HOTPINK,
+            //     fill: Cesium.Color.PINK,
+            //     strokeWidth: 3,
+            //     markerSymbol: '?'
+            // }));
+            const that = this;
+            if (geojson.type == 'MultiPolygon') {
+                let polygons = that.multiPolygonToPolygons(geojson);
+
+                polygons.forEach((res) => {
+                    that.add_viewer_for_vector(res, data);
+                })
+            } else {
+                that.add_viewer_for_vector(geojson, data);
+            }
+        },
+        remove_query_click_by_iserver() {
+            for (var i = 0; i < 10; i++) {
+                query_click_by_iserver.entities.values.forEach((res) => {
+
+                    query_click_by_iserver.entities.remove(res);
+
+                })
+            }
+        },
+        isArray2D(arr) {
+            // 首先检查arr是否是数组
+            if (!Array.isArray(arr)) {
+                return false;
+            }
+
+            // 检查数组中的每个元素是否也是数组
+            for (let i = 0; i < arr.length; i++) {
+                if (!Array.isArray(arr[i])) {
+                    return false;
+                }
+            }
+
+            // 如果所有元素都是数组,那么arr是二维数组
+            return true;
+        },
+    },
+    beforeCreate() { }, //生命周期 - 创建之前
+    created() { }, //生命周期 - 创建完成(可以访问当前this实例)
+    beforeMount() { }, //生命周期 - 挂载之前
+    mounted() {
+        const that = this;
+        this.$nextTick(() => {
+            that.handler_multi_level_query = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
+
+            manager_multi_level_query = new Cesium.CustomDataSource("manager_multi_level_query");
+            viewer.dataSources.add(manager_multi_level_query);
+
+            manager_multi_level_vector = new Cesium.PrimitiveCollection();
+            manager_multi_level_vector.destroyPrimitives = false;
+            viewer.scene.primitives.add(manager_multi_level_vector);
+
+
+            pick_entity = new Cesium.CustomDataSource("pick_entity");
+            viewer.dataSources.add(pick_entity);
+
+            query_click_by_iserver = new Cesium.CustomDataSource("query_click_by_iserver");
+            viewer.dataSources.add(query_click_by_iserver);
+        })
+
+    }, //生命周期 - 挂在完成
+    beforeUpdate() { }, //生命周期 - 更新之前
+    updated() { }, //生命周期 - 更新之后
+    beforeDestroy() { }, //生命周期 - 销毁之前
+    destroy() { },//生命周期 - 销毁完成
+    activated() { }, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
+    deactivated() { } //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。
+};
+</script>
+<style lang="scss" scoped>
+.el-collapse {
+    // width: 95%;
+    border: none;
+    background-color: transparent !important;
+}
+
+.el-scrollbar {
+    border: 1px solid #0f7ac8 !important;
+    // padding: 0 10px;
+}
+
+.el-collapse-item__header {
+    // border-bottom: 1px solid rgba(102, 126, 143, 0.747);
+    background-color: transparent !important;
+    color: rgb(217, 237, 254) !important;
+    border-color: transparent !important;
+}
+
+.el-collapse-item__wrap {
+    background-color: transparent !important;
+    border-color: transparent !important;
+}
+
+.el-collapse-item__content {
+    // background-color: rgba(255, 192, 203, 0.425) !important;
+    background-color: transparent !important;
+    color: rgb(217, 237, 254) !important;
+}
+</style>
+<style lang="scss" scoped>
+.echart {
+    width: 300px;
+    height: 420px;
+}
+
+.echart1 {
+    height: 280px;
+}
+
+.multi_level_query_table {
+    position: absolute;
+    top: 7rem;
+    width: 19rem;
+
+
+}
+
+/* 去掉tabs标签栏下的下划线 */
+::v-deep .el-tabs__nav-wrap::after {
+    position: static !important;
+    /* background-color: #fff; */
+}
+
+/* 下划线切换高亮 */
+::v-deep .el-tabs__active-bar {
+    background-color: #30fdff;
+}
+
+::v-deep .el-collapse-item__header {
+    color: #64daff !important;
+    font-weight: 600;
+}
+
+
+.el-tab-pane {
+    height: 33rem;
+    overflow: auto;
+}
+
+
+.list_vector_multi {
+    background-image: url("/static/images/ghzc/内容框.png");
+
+    width: 18rem;
+    border-top: 1px solid #CCC;
+    font-size: 14px;
+    padding: 0.1rem 0rem 0.1rem 0rem;
+    border-left: 1px solid #CCC;
+
+    border-right: 1px solid #CCC;
+
+    // border-bottom:1px solid #CCC ;
+}
+
+.list_vector_multi:last-child {
+
+    border-bottom: 1px solid #CCC;
+}
+
+.filed_box {
+    display: inline-block;
+}
+
+.el-checkbox {
+    color: white;
+}
+
+.is-disabled {
+    display: inline;
+}
+</style>
+
+

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 381
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice.js


+ 58 - 38
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice.vue

@@ -151,6 +151,9 @@
               </el-col>
             </el-row>
           </el-tab-pane>
+          <el-tab-pane label="分析报告" name="third">
+            <jzdjfxsmjg  v-if="iSjzdjfxsmjgShow" :info="{BenchmarkLandPrice:BenchmarkLandPriceinfo}"></jzdjfxsmjg>
+          </el-tab-pane>
         </el-tabs>
       </el-col>
     </el-row>
@@ -161,7 +164,7 @@ import { v4 as uuidv4 } from "uuid";
 import moment from "moment";
 import jzdjfxsmInfo from "./jzdjfxsmInfo.vue";
 import jzdjfxsmjg from "./jzdjfxsmjg.vue";
-import BenchmarkLandPrice from "./BenchmarkLandPrice.js";
+import BenchmarkLandPrice from "./BenchmarkLandPrice_old.js";
 import {
   cartesian3ToWGS84,
   mapQuery,
@@ -191,7 +194,8 @@ export default {
       activeName: "first",
       //绘制事件
       // handlerPolygon: null,
-
+      iSjzdjfxsmjgShow:false,
+      BenchmarkLandPriceinfo:null,
       form: {
         id: "",
         ProjectScope: [],
@@ -199,7 +203,6 @@ export default {
         ProjectType: "",
         ConstructionUnit: "",
         imageBase64: [],
-        jgData:null
       },
       rules: {
         ProjectName: [
@@ -218,6 +221,9 @@ export default {
       },
     };
   },
+  components: {
+    jzdjfxsmjg
+  },
   mounted() {
     this.init();
   },
@@ -248,7 +254,12 @@ export default {
      * @param {Object} event
      */
     handleClick(tab, event) {
-      console.log(tab, event);
+      if (this.activeName == "third") {
+        this.iSjzdjfxsmjgShow=true;
+      }else{
+        this.iSjzdjfxsmjgShow=false;
+      }
+      
     },
 
     /**
@@ -309,9 +320,12 @@ export default {
       handlerPolygon.drawEvt.addEventListener((result) => {
 
         handlerPolygon.polygon.show = true;
-        handlerPolygon.polyline.show = true;
-        handlerPolygon.polygon.polygon.material.color =
-          Cesium.Color.CHARTREUSE.withAlpha(0.5);
+        handlerPolygon.polyline.show = false;
+        debugger
+        handlerPolygon.polygon.polygon.material.color = Cesium.Color.WHITE.withAlpha(0.3);
+        handlerPolygon.polygon.polygon.outline= true;
+        handlerPolygon.polygon.polygon.outlineColor= Cesium.Color.RED;
+          handlerPolygon.polygon.polygon.outlineWidth= 2.0;
         that.tooltip.setVisible(false);
         var polygon = result.object;
         if (!polygon) {
@@ -351,7 +365,7 @@ export default {
           );
           this.init();
           let data=this.BenchmarkLandPriceList.find(c=>c.id==that.form.id);
-          BenchmarkLandPrice.calculateLandPrice(data,function(response){
+          BenchmarkLandPrice.calculateLandPrice(data,true,function(response){
             if(response){
                 data.AnalysisStatus = "完成";
                 data.AnalysisResults=response;
@@ -416,6 +430,7 @@ export default {
         let res = e.target.result; //ArrayBuffer
         shp(res)
           .then(function (res) {
+            debugger
             // self.addGeometry(res)
             geojson = res;
             console.log(geojson);
@@ -464,10 +479,10 @@ export default {
             new Cesium.Cartesian3.fromDegreesArray(positions)
           ),
           // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
-          material: new Cesium.Color(255 / 255, 211 / 255, 128 / 255, 1),
+          material: Cesium.Color.WHITE.withAlpha(0.3),
           outline: true,
-          outlineColor: Cesium.Color.BLACK,
-          outlineWidth: 1.0,
+          outlineColor: Cesium.Color.RED,
+          outlineWidth: 2.0,
         },
       });
       
@@ -481,33 +496,38 @@ export default {
      * @param BenchmarkLandPrice 基准地价信息
      */
     openAnalyzeResults(BenchmarkLandPrice) {
-      debugger
-      if (this.FXJGInfolayerid) {
-        this.$layer.close(this.FXJGInfolayerid);
-      }
-      let that = this;
-      let w = document.body.offsetWidth;
-      let h = document.body.offsetHeight;
-      //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
-      //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
-      let left = w - 480 + 480 / 2;
-      let top = 830 / 2 + 60;
-      this.FXJGInfolayerid = this.$layer.iframe({
-        content: {
-          content: jzdjfxsmjg, //传递的组件对象
-          parent: this, //当前的vue对象
-          data: { info: { BenchmarkLandPrice } }, //props
-        },
-        offset: [left, top], //left top
-        area: ["480px", "830px"], //宽 高
-        title: "分析结果",
-        maxmin: false,
-        shade: false, //是否显示遮罩
-        shadeClose: false, //点击遮罩是否关闭
-        cancel: () => {
-          // this.init();
-        },
-      });
+      this.BenchmarkLandPriceinfo=JSON.parse(JSON.stringify(BenchmarkLandPrice));
+      this.iSjzdjfxsmjgShow=true;
+      this.activeName = "third";
+      
+
+      // debugger
+      // if (this.FXJGInfolayerid) {
+      //   this.$layer.close(this.FXJGInfolayerid);
+      // }
+      // let that = this;
+      // let w = document.body.offsetWidth;
+      // let h = document.body.offsetHeight;
+      // //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
+      // //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
+      // let left = w - 480 + 480 / 2;
+      // let top = 830 / 2 + 60;
+      // this.FXJGInfolayerid = this.$layer.iframe({
+      //   content: {
+      //     content: jzdjfxsmjg, //传递的组件对象
+      //     parent: this, //当前的vue对象
+      //     data: { info: { BenchmarkLandPrice } }, //props
+      //   },
+      //   offset: [left, top], //left top
+      //   area: ["480px", "830px"], //宽 高
+      //   title: "分析结果",
+      //   maxmin: false,
+      //   shade: false, //是否显示遮罩
+      //   shadeClose: false, //点击遮罩是否关闭
+      //   cancel: () => {
+      //     // this.init();
+      //   },
+      // });
     },
     //切换用地类型时加载用地规划图层
     handleChange() {

+ 397 - 0
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice_old.js

@@ -0,0 +1,397 @@
+import { v4 as uuidv4 } from "uuid";
+import moment from "moment";
+import {
+  cartesian3ToWGS84,
+  mapQuery,
+  flatten,
+  mercator2lonLat,
+  undergroundMode,
+} from "@/utils/MapHelper/MapHelper.js";
+import {
+  area,
+  intersect,
+  polygon,
+  point,
+  midpoint,
+  difference,
+} from "@turf/turf";
+const BenchmarkLandPrice = {
+  /**
+   * 基准地价分析
+   * @param {*} BenchmarkLandPrice {
+        ProjectScope: [],分析范围
+        ProjectName: "",项目名称
+        ConstructionUnit: "",建设单位
+        imageBase64: [],输出图片
+      }
+   * @param {*} isOutputImg 是否输出范围图片 true false 如需输出图片,请确保要输出的范围已在屏幕正确认为
+   * @param {*} Callback 回调
+   */
+  async calculateLandPrice(BenchmarkLandPrice, isOutputImg = false, Callback) {
+    let GHDKList = await this.getGHDKs(BenchmarkLandPrice);
+    await this.GetJZDJ(BenchmarkLandPrice, GHDKList);
+    let data = await this.CalculateJZDJ(BenchmarkLandPrice, GHDKList);
+    if (isOutputImg) {
+      if (data && data.picBase64List) {
+        var promise = scene.outputSceneToFile();
+        Cesium.when(promise, function (base64data) {
+          data.picBase64List.push(base64data);
+          if (Callback) Callback(data);
+        });
+      } else {
+        if (Callback) Callback(false);
+      }
+    } else {
+      if (data) {
+        if (Callback) Callback(data);
+      } else {
+        if (Callback) Callback(false);
+      }
+    }
+  },
+
+  /**
+   * 查询区域内规划地块
+   * @param {*} BenchmarkLandPrice 基准地价信息
+   * @returns {*} 图层返回信息
+   * {
+          id: uuidv4(),
+          layerInfo: layer,
+          data: [],
+          geometry: feature.geometry,
+        }
+   */
+  async getGHDKs(BenchmarkLandPrice) {
+    let featureDataList = [];
+    //查询规划地块
+    let layer = flatten(window.layerTree).find((item) => item.core == "003006");
+    let points = BenchmarkLandPrice.ProjectScope;
+    let geo = {
+      id: 0,
+      style: null,
+      parts: [points.length],
+      points: points,
+      type: "REGION",
+      prjCoordSys: {
+        epsgCode: null,
+      },
+    };
+    let queryByGeometryParameters = {
+      getFeatureMode: "SPATIAL",
+      datasetNames: [
+        layer.date_server.dataSourceName + ":" + layer.date_server.datasetName,
+      ],
+      geometry: geo,
+      spatialQueryMode: "INTERSECT",
+      hasGeometry: "true",
+    };
+    let e = await mapQuery(
+      layer.date_server.url + "/featureResults.json?returnContent=true",
+      queryByGeometryParameters
+    );
+    if (e && e.totalCount > 0) {
+      e.features.forEach((feature) => {
+        let featureData = {
+          id: uuidv4(),
+          layerInfo: layer,
+          data: [],
+          geometry: feature.geometry,
+        };
+
+        feature.fieldNames.forEach((fieldName, i) => {
+          let Field = e.datasetInfos
+            ? e.datasetInfos[0].fieldInfos.find(
+                (c) =>
+                  c.name &&
+                  c.name.toUpperCase() == fieldName.toUpperCase() &&
+                  c.name.toUpperCase().indexOf("SM") == -1
+              )
+            : null;
+          if (Field) {
+            featureData.data.push({
+              label: fieldName,
+              labelCN: Field ? Field.caption : fieldName,
+              value: feature.fieldValues[i],
+            });
+          }
+        });
+        featureDataList.push(featureData);
+      });
+    }
+    return featureDataList;
+  },
+
+  /**
+   * 获取基准地价
+   * @param {*} BenchmarkLandPrice
+   * @param {*} GHDKList
+   * @returns
+   */
+  async GetJZDJ(BenchmarkLandPrice, GHDKList) {
+    for (let GHDKindex = 0; GHDKindex < GHDKList.length; GHDKindex++) {
+      let GHDK = GHDKList[GHDKindex];
+      GHDK.JZDJList = [];
+      let KZXXGYDDM = GHDK.data.find((c) => c.label == "KZXXGYDDM");
+      let landUseNatureRelation = flatten(window.landUseNatureRelation).find(
+        (c) => {
+          let GHDKType = c.GHDKType.find((a) =>
+            KZXXGYDDM.value.startsWith(a.ydxzdl)
+          );
+
+          return GHDKType != null;
+        }
+      );
+      if (landUseNatureRelation) {
+        let layerinfos = landUseNatureRelation.layerinfo;
+        for (let index = 0; index < layerinfos.length; index++) {
+          let layerinfo = layerinfos[index];
+          let layer = flatten(window.layerTree).find(
+            (item) => item.core == layerinfo.layerCore
+          );
+          if (layer && layer.date_server && layer.date_server.url) {
+            let points = BenchmarkLandPrice.ProjectScope;
+            let geo = {
+              id: 0,
+              style: null,
+              parts: [points.length],
+              points: points,
+              type: "REGION",
+              prjCoordSys: {
+                epsgCode: null,
+              },
+            };
+            let queryByGeometryParameters = {
+              getFeatureMode: "SPATIAL",
+              datasetNames: [
+                layer.date_server.dataSourceName +
+                  ":" +
+                  layer.date_server.datasetName,
+              ],
+              geometry: geo,
+              spatialQueryMode: "INTERSECT",
+              hasGeometry: "true",
+            };
+            let e = await mapQuery(
+              layer.date_server.url + "/featureResults.json?returnContent=true",
+              queryByGeometryParameters
+            );
+            if (e && e.totalCount > 0) {
+              e.features.forEach((feature) => {
+                let layerData = {
+                  id: uuidv4(),
+                  layerInfo: layerinfo,
+                  data: [],
+                  geometry: feature.geometry,
+                };
+                feature.fieldNames.forEach((fieldName, i) => {
+                  let Field = e.datasetInfos
+                    ? e.datasetInfos[0].fieldInfos.find(
+                        (c) =>
+                          c.name &&
+                          c.name.toUpperCase() == fieldName.toUpperCase() &&
+                          c.name.toUpperCase().indexOf("SM") == -1
+                      )
+                    : null;
+                  if (Field) {
+                    layerData.data.push({
+                      label: fieldName,
+                      labelCN: Field ? Field.caption : fieldName,
+                      value: feature.fieldValues[i],
+                    });
+                  }
+                });
+                GHDK.JZDJList.push(layerData);
+              });
+            }
+          } else {
+            console.log(
+              "服务编码【" + layerinfo.layerCore + "】配置不正确,请检查后重试"
+            );
+          }
+        }
+      } else {
+        console.log(KZXXGYDDM + "未配置当前土地用途,请联系管理员添加");
+      }
+    }
+  },
+
+  /**
+   * 计算基准地价
+   */
+  async CalculateJZDJ(BenchmarkLandPrice, GHDKList) {
+    //转换成超图格式面
+    let HZgeometry = {
+      partTopo: [1],
+      parts: [BenchmarkLandPrice.ProjectScope.length],
+      points: BenchmarkLandPrice.ProjectScope,
+    };
+    // 循环规划地块区域信息
+    GHDKList.forEach((GHDK) => {
+      GHDK.fromData = [];
+      GHDK.JZDJList.forEach((JZDJ) => {
+        let area = this.calculateIntersectArea(
+          GHDK.geometry,
+          JZDJ.geometry,
+          HZgeometry
+        );
+        if (Number(area) > 0) {
+          let fromData = { data: JZDJ.data, area: Number(area) / 666.66 };
+          //土地级别
+          let tdjb = JZDJ.data.find(
+            (c) => c.label == JZDJ.layerInfo.tdjbField
+          ).value;
+          fromData.tdjb = tdjb;
+          //单价
+          let dj = JZDJ.data.find(
+            (c) => c.label == JZDJ.layerInfo.ydlxPriceField
+          ).value;
+          fromData.dj = (Number(dj) * 666.66) / 10000;
+          //占用面积地价
+          fromData.zdj = Number(area * dj) / 10000;
+          fromData.geometry = JZDJ.geometry;
+          GHDK.fromData.push(fromData);
+        }
+      });
+    });
+
+    //计算分析面积
+    let fxzmj = this.CalculateAnalysisArea(BenchmarkLandPrice);
+    //总地价
+    let zdj = 0;
+    //参与地价计算的面积(规划地块+绘制范围+地价地块范围三者交集)
+    let jszmj = 0;
+    //规划地块详细地价
+    let ghdkDetailedDjList = [];
+    GHDKList.forEach((GHDK) => {
+      let ghdkDetailed = {};
+      ghdkDetailed.id = GHDK.id;
+      ghdkDetailed.geometry = GHDK.geometry;
+      ghdkDetailed.data = GHDK.data;
+      ghdkDetailed.ghyt = GHDK.data.find((c) => c.label == "KZXXGYDMC").value;
+      ghdkDetailed.dkbm = GHDK.data.find((c) => c.label == "DKBM").value;
+      //占用土地
+      ghdkDetailed.zytdList = GHDK.fromData;
+      ghdkDetailedDjList.push(ghdkDetailed);
+      GHDK.fromData.forEach((fromData) => {
+        zdj += fromData.zdj;
+        jszmj += fromData.area;
+      });
+    });
+    ghdkDetailedDjList = ghdkDetailedDjList.filter(
+      (c) => c.zytdList && c.zytdList.length > 0
+    );
+
+    return {
+      projectName: BenchmarkLandPrice.ProjectName, //项目名称
+      analysisDate: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), //分析时间
+      // projectType: BenchmarkLandPrice.ProjectType, //项目类型
+      buildUnit: BenchmarkLandPrice.ConstructionUnit, //建设单位
+      analysisArea: fxzmj, //分析面积(亩)
+      ParticipationArea: jszmj, //参与地价计算的面积(亩)
+      totalLandPrice: zdj, //总地价(万元)  总地价预估合计
+      ghdkDetailedDjList: ghdkDetailedDjList, //规划地块详细地价
+      picBase64List: [], //图片集 分析范围
+    };
+  },
+
+  /**
+   * 计算分析面积
+   * @param {*} BenchmarkLandPrice 基准地价信息
+   * @returns {number} 分析总面积
+   */
+  CalculateAnalysisArea(BenchmarkLandPrice) {
+    let fxzmj = 0;
+    let points = BenchmarkLandPrice.ProjectScope;
+    let DataPs = points.map((item) => [item.x, item.y]);
+    if (DataPs.length > 0) {
+      if (
+        JSON.stringify(DataPs[0]) != JSON.stringify(DataPs[DataPs.length - 1])
+      ) {
+        DataPs.push(DataPs[0]);
+      }
+      debugger;
+      let polygonPs = polygon([DataPs]);
+      let sdsd = area(polygonPs);
+      let areaPs = area(polygonPs) * window.earthRadius;
+      fxzmj = Number(areaPs / 666.66).toFixed(2);
+    }
+    return fxzmj;
+  },
+
+  /**
+   * 计算两个面的交集面积
+   * @param Points1
+   * @param Points2
+   * @param Points3
+   */
+  calculateIntersectArea(Points1, Points2, Points3) {
+    var geometry1;
+    var geometry2;
+    var geometry3;
+    if (Points1) {
+      geometry1 = this.AssemblySurface(Points1);
+    }
+    if (Points2) {
+      geometry2 = this.AssemblySurface(Points2);
+    }
+    if (Points3) {
+      geometry3 = this.AssemblySurface(Points3);
+    }
+    let areaPs;
+    if (geometry1 && geometry2) {
+      areaPs = intersect(geometry1, geometry2);
+    }
+    if (areaPs && geometry3) {
+      areaPs = intersect(areaPs, geometry3);
+    }
+    if (areaPs) {
+      let areadifference = area(areaPs) * window.earthRadius;
+      return Number(areadifference.toFixed(2));
+    } else {
+      return 0;
+    }
+  },
+  /**
+   * 组装带洞和不带洞的面
+   * @param geometry 超图返回的图形数组
+   */
+  AssemblySurface(geometry) {
+    let point3ds = [];
+    let pointholes = [];
+    let startindex = 0;
+    for (let index = 0; index < geometry.parts.length; index++) {
+      let thisps = [];
+      let endindex = startindex + geometry.parts[index];
+      let geometryPoints = geometry.points.slice(startindex, endindex);
+      for (
+        let pointindex = 0;
+        pointindex < geometryPoints.length;
+        pointindex++
+      ) {
+        let point = geometryPoints[pointindex];
+        thisps.push([point.x, point.y]);
+      }
+      if (geometry.partTopo[index] === 1) {
+        point3ds.push(thisps);
+      } else {
+        pointholes.push(thisps);
+      }
+
+      startindex = endindex;
+    }
+
+    // 主多边形
+    var mainPolygon = polygon(point3ds);
+
+    // 岛洞多边形
+    var holePolygon = polygon(pointholes);
+
+    // 计算差集 得到有导洞的图形
+    var getdifference = difference(mainPolygon, holePolygon);
+    return getdifference;
+  },
+};
+/**
+ * 基准地价分析
+ */
+export default BenchmarkLandPrice;

+ 30 - 25
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/jzdjfxsmjg.vue

@@ -1,10 +1,12 @@
 <template>
-  <div
-    class="ZTGlobal"
-    style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
-  >
-    <el-container style="height: 100%">
-      <el-header height="12rem">
+  <div class="ZTGlobal" style="width: 100%; height: 37rem; color: white">
+    <el-empty
+      image=""
+      v-if="info.BenchmarkLandPrice == null"
+      description="暂无数据"
+    ></el-empty>
+    <el-container v-if="info.BenchmarkLandPrice != null" style="height: 100%">
+      <el-header height="12rem" style="padding: 0px">
         <el-row :gutter="10" style="display: flex; align-items: center">
           <el-col :span="18">
             {{ info.BenchmarkLandPrice.ProjectName }}
@@ -109,7 +111,7 @@
           </el-col>
         </el-row>
       </el-header>
-      <el-main>
+      <el-main height="12rem">
         <el-tabs v-model="activeName" class="full-height">
           <el-tab-pane label="总体情况" name="first" style="height: 100%">
             <div id="echartFGY" ref="echartFGY" class="EchartsWH">
@@ -133,7 +135,7 @@
               </el-table-column>
               <el-table-column prop="ghyt" label="地类名称"> </el-table-column>
 
-              <el-table-column prop="area" align="center">
+              <el-table-column prop="area" align="center" width="60">
                 <template slot="header">
                   <div>占用面积</div>
                   <div>(亩)</div>
@@ -187,7 +189,7 @@ export default {
       spanArray: [],
 
       //点查entities事件
-      getEntitiesHandler: {},
+      getEntitiesHandler: null,
       /**
        * tabs 标签
        */
@@ -225,17 +227,21 @@ export default {
   },
   created() {},
   mounted() {
-    const erd = elementResizeDetectorMaker();
-    let that = this;
-    erd.listenTo([this.$refs.echartFGY], () => {
-      //, this.$refs.echartFJT
-      that.$nextTick(() => {
-        //监听到事件后执行的业务逻辑
-        window.echarts.init(this.$refs.GYEcharts).resize();
-        // window.echarts.init(this.$refs.JTEcharts).resize();
+    if (this.info.BenchmarkLandPrice != null) {
+      this.$nextTick(function () {
+        const erd = elementResizeDetectorMaker();
+        let that = this;
+        erd.listenTo([this.$refs.echartFGY], () => {
+          //, this.$refs.echartFJT
+          that.$nextTick(() => {
+            //监听到事件后执行的业务逻辑
+            window.echarts.init(this.$refs.GYEcharts).resize();
+            // window.echarts.init(this.$refs.JTEcharts).resize();
+          });
+        });
+        this.init();
       });
-    });
-    this.init();
+    }
   },
   methods: {
     async init() {
@@ -348,7 +354,7 @@ export default {
           id: "HZFW",
           polygon: {
             hierarchy: Cesium.Cartesian3.fromDegreesArray(points),
-            material: Cesium.Color.CHARTREUSE.withAlpha(0.1), //Cesium.Color.RED.withAlpha(0.4),
+            material: Cesium.Color.WHITE.withAlpha(0.3), //Cesium.Color.RED.withAlpha(0.4),
             outline: true,
             outlineColor: Cesium.Color.RED,
             outlineWidth: 2.0,
@@ -402,7 +408,6 @@ export default {
       );
     },
     objectSpanMethod({ rowIndex, columnIndex }) {
-      debugger;
       if (columnIndex === 0 || columnIndex === 1) {
         let _row = this.spanArray[rowIndex];
         let _col = _row > 0 ? 1 : 0;
@@ -428,7 +433,6 @@ export default {
     },
     rowClick(row) {
       let that = this;
-      debugger;
       if (that.Interval) {
         clearInterval(that.Interval);
         that.Interval = null;
@@ -534,7 +538,6 @@ export default {
         this.info.BenchmarkLandPrice &&
         this.info.BenchmarkLandPrice.AnalysisResults
       ) {
-        debugger;
         await getJZDJWord(this.info.BenchmarkLandPrice.AnalysisResults);
       }
     },
@@ -553,7 +556,7 @@ export default {
           ];
         viewer.entities.removeById(element.id);
       }
-      this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList = [];
+      // this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList = [];
       //删除绘制范围
       viewer.entities.removeById("HZFW");
     },
@@ -725,7 +728,9 @@ export default {
         Cesium.ScreenSpaceEventType.LEFT_CLICK
       );
     }
-    this.clear();
+    if (this.info.BenchmarkLandPrice != null) {
+      this.clear();
+    }
   },
 };
 </script>

+ 51 - 203
src/views/ConstructionApplication3D/Demolition/DemolitionList.vue

@@ -129,7 +129,7 @@
                 </div>
                 <div class="divText">
                   <div>
-                    <span style="color: #fff"> 预计征地面积(亩)</span>
+                    <span style="color: #fff">分析范围(亩)</span>
                   </div>
                   <div>
                     <span color="#2d8cf0">{{ zdResult.totalZDMJ }}</span>
@@ -1423,10 +1423,10 @@ export default {
             new Cesium.Cartesian3.fromDegreesArray(positions)
           ),
           // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
-          material: new Cesium.Color(255 / 255, 211 / 255, 128 / 255, 1),
+          material: Cesium.Color.WHITE.withAlpha(0.3),
           outline: true,
-          outlineColor: Cesium.Color.BLACK,
-          outlineWidth: 1.0,
+          outlineColor: Cesium.Color.RED,
+          outlineWidth: 2.0,
         },
       });
 
@@ -2168,19 +2168,39 @@ export default {
         // window.createTooltip.setVisible(false);
         debugger;
         console.log(result);
-        handlerPolygon.polygon.show = true;
-        handlerPolygon.polyline.show = true;
-        handlerPolygon.polygon.polygon.material.color =
-          Cesium.Color.CHARTREUSE.withAlpha(0.5);
-        that.positions = [];
+        handlerPolygon.polygon.show = false;
+        handlerPolygon.polyline.show = false;
+
+        var nPositions = [];
         for (var pt of result.object.positions) {
           var cartographic = Cesium.Cartographic.fromCartesian(pt);
           var longitude = Cesium.Math.toDegrees(cartographic.longitude);
           var latitude = Cesium.Math.toDegrees(cartographic.latitude);
           var height = cartographic.height;
           that.regions.push({ x: longitude, y: latitude });
+          nPositions.push(longitude)
+          nPositions.push(latitude)
         }
-        that.regions.push(that.regions[0]);
+        viewer.entities.removeById('polygon');
+        polygonEntity = new Cesium.Entity({
+          id: 'polygon',
+          // position: Cesium.Cartesian3.fromDegreesArray([
+          //   centerX,
+          //   centerY,
+          // ]),
+          // classificationType: ClassificationType.TERRAIN,
+          polygon: {
+            hierarchy: new Cesium.PolygonHierarchy(
+              new Cesium.Cartesian3.fromDegreesArray(nPositions)
+            ),
+            // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
+            material: Cesium.Color.WHITE.withAlpha(0.3),
+            outline: true,
+            outlineColor: Cesium.Color.RED,
+            outlineWidth: 2.0,
+          },
+        });
+        viewer.entities.add(polygonEntity)
 
         // that.regions = [];
         // that.regions.push(that.positions);
@@ -2462,196 +2482,9 @@ export default {
           return false;
         }
       });
-      // this.kring();
 
     },
-    kring() {
-
-      //创建阴影查询对象
-      var that = this
-      var shadowQuery = new Cesium.ShadowQueryPoints(scene);
-      var layers = scene.layers._layers
-      // layers[0].selectEnabled = false;
-      // layers[1].selectEnabled = false;
-      // //设置图层的阴影模式
-      // layers[0].shadowType = 2;
-      // layers[1].shadowType = 2;
-
-      var startTime = new Date('2024-07-14');
-      startTime.setHours(10);
-      shadowQuery.startTime = Cesium.JulianDate.fromDate(startTime);
-
-
-      var endTime = new Date('2024-07-14');
-      endTime.setHours(14);
-      shadowQuery.endTime = Cesium.JulianDate.fromDate(endTime);
-
-      shadowQuery.spacing = 10;
-      shadowQuery.timeInterval = 60;
-      var poisnts = [];
-      this.regions.forEach((item) => {
-        poisnts.push(item.x)
-        poisnts.push(item.y)
-      })
-      shadowQuery.qureyRegion({
-        position: poisnts,
-        bottom: 20,
-        extend: 5
-      });
-
-
-      endTime = new Date('2024-07-14');
-      endTime.setHours(14);
-      viewer.clock.currentTime = Cesium.JulianDate.fromDate(endTime);
-      viewer.clock.multiplier = 1;
-      viewer.clock.shouldAnimate = true;
-      shadowQuery.build();
-
-      let params = {
-        maxValue: 100,
-        krigingModel: 'exponential',//model还可选'gaussian','spherical',exponential
-        krigingSigma2: 0,
-        krigingAlpha: 100,
-        canvasAlpha: 0.75,//canvas图层透明度
-        colors: ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
-          "rgb(255,85,0)", "rgb(255,85,0)"]
-        //  ["#0000FF", "#7FFF00", "#FFD700", "#FFA500", "#FF4500", "#ffffbf",
-        // "#fee08b", "#fdae61", "#f46d43", "#d73027", "#a50026"],
-      }
-      var temPoinst = [];
-      var values = [];
-      var lons = [];
-      var lats = [];
-      shadowQuery.queryPointsEvent.addEventListener(function (points) {
-        temPoinst = []
-        var values = [];
-        lons = [];
-        lats = [];
-        debugger
-        for (var i = 0; i < points.length; i++) {
-          var pt = points[i]
-
-          var cartographic = Cesium.Cartographic.fromCartesian(pt.position);
-          var shadowRadio = shadowQuery.getShadowRadio(cartographic);
-          var longitude = Cesium.Math.toDegrees(cartographic.longitude);
-          var latitude = Cesium.Math.toDegrees(cartographic.latitude);
-
-          temPoinst.push({ x: longitude, y: latitude, z: shadowRadio })
-          values.push(shadowRadio)
-          lons.push(longitude)
-          lats.push(latitude)
-        }
 
-        debugger
-        // pointArray.push(point([longitude, latitude], { 'shadowRatio': poisnts[i].shadowRatio }))
-        let variogram = kriging.train(
-          values,
-          lons,
-          lats,
-          params.krigingModel,
-          params.krigingSigma2,
-          params.krigingAlpha
-        )
-        debugger
-        let polygons = [[]];
-
-        var xmin = that.regions[0].x;
-        var xmax = that.regions[0].x;
-        var ymin = that.regions[0].y;
-        var ymax = that.regions[0].y;
-        that.regions.forEach((t) => {
-          if (xmin > t.x)
-            xmin = t.x;
-          if (xmax < t.x)
-            xmax = t.x;
-          if (ymin > t.y)
-            ymin = t.y;
-          if (ymax < t.y)
-            ymax = t.y;
-          polygons[0].push([t.x, t.y])
-        })
-        var extent = [xmin, ymin, xmax, ymax]
-        let grid = kriging.grid(polygons, variogram, (xmax - xmin) / 100);
-
-        //根据scope边界线,生成范围信息
-        var xlim = [xmin, xmax];
-        var ylim = [ymin, ymax];
-        // var canvas = document.getElementById("CVS")
-        // kriging.plot(canvas, grid, xlim, ylim, params.colors)
-        // let fc = that.gridFeatureCollection(grid, xlim, ylim);
-        // var collection = featureCollection(fc);
-        // var breaks = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];
-        // var obands = isobands(collection, breaks, { zProperty: 'value' });
-
-        // // var colors = ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
-        // //   "rgb(255,85,0)", "rgb(255,85,0)"];
-        //   var colors = [Cesium.Color.fromCssColorString("rgb(0,0,255)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,217,255)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,255,245)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,255,128)"),
-        //   Cesium.Color.fromCssColorString("rgb(237,255,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,214,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)")];
-        // viewer.entities.removeAll()
-        // obands.features.forEach((element, index) => {
-        //   // color = colors[index]
-        //   let sd;
-        //   let color;
-        //   if (index > colors.length)
-        //     color = colors.splice(colors.length - 1, 1);
-        //   else
-        //     color = colors[index]
-        //   if (element.geometry.coordinates.length != 0) {
-        //     sd = element.geometry.coordinates[0][0].flat();
-        //     // color = Cesium.Color.BLUE.withAlpha(0.5)
-        //     // if (element.properties.value == "0-0.2")
-        //     //   color = Cesium.Color.BLUE
-        //     // else if (element.properties.value == "0.2-0.4")
-        //     //   color = Cesium.Color.CYAN.withAlpha(0.5)
-        //     // else if (element.properties.value == "0.4-0.6")
-        //     //   color = Cesium.Color.GREENYELLOW
-        //     // else if (element.properties.value == "0.6-0.8")
-        //     //   color = Cesium.Color.ORANGERED
-        //     // else if (element.properties.value == "0.8-1")
-        //     //   color = Cesium.Color.RED
-        //     var entity = new Cesium.Entity({
-        //       polygon: {
-        //         hierarchy: Cesium.Cartesian3.fromDegreesArray(sd),
-        //         material:color,
-        //         outline: true,
-        //         outlineColor: Cesium.Color.BLACK,
-        //         outlineWidth: 0.5,
-        //         // Cesium.Color.fromCssColorString(color)
-        //       },
-        //     })
-        //     viewer.entities.add(entity);
-        //   }
-        // });
-        // that.holePolygon.deactivate()
-        shadowQuery.clear();
-      })
-
-      // console.log(obands)
-    },
-    gridFeatureCollection(grid, xlim, ylim) {
-      var range = grid.zlim[1] - grid.zlim[0];
-      var i, j, x, y, z;
-      var n = grid.length;//列数
-      var m = grid[0].length;//行数
-      var pointArray = [];
-      for (i = 0; i < n; i++)
-        for (j = 0; j < m; j++) {
-          x = (i) * grid.width + grid.xlim[0];
-          y = (j) * grid.width + grid.ylim[0];
-          z = (grid[i][j] - grid.zlim[0]) / range;
-          if (z < 0.0) z = 0.0;
-          if (z > 1.0) z = 1.0;
-          pointArray.push(point([x, y], { value: z }));
-        }
-      return pointArray;
-    },
     /**
      * 征地计算
      */
@@ -2863,7 +2696,7 @@ export default {
       if (ZDBZ) {
 
         //征地面积
-        that.zdResult.totalZDMJ = parseFloat(totalZDMJ.toFixed(2));
+        that.zdResult.totalZDMJ = 0.00;// parseFloat(totalZDMJ.toFixed(2));
         // //总补偿
         // that.zdResult.totalPay = parseFloat(
         //   ((totalZDMJ * ZDBZ.BCBZ.BCHJ) / 10000).toFixed(2)
@@ -2892,9 +2725,24 @@ export default {
       }
       that.zdResult.features = features;
       that.zdResult.fieldInfos = fieldInfos;
+      that.zdResult.totalZDMJ = parseFloat((that.getRegionArea() / 666.66).toFixed(2));
 
       //<--
     },
+    //范围面积
+    getRegionArea() {
+      debugger
+      var points1 = this.regions;
+      var parts1 = [];
+      var poly1;
+      for (var i = 0; i < points1.length; i++) {
+        parts1.push([points1[i].x, points1[i].y]);
+      }
+      poly1 = polygon([parts1]);
+      var textarea = area(poly1) * window.earthRadius;
+      return textarea;
+
+    },
     getfldIndex(fieldInfos, fldName) {
       var fldIndex = -1;
       fieldInfos.forEach((fld, index) => {
@@ -3171,17 +3019,17 @@ export default {
         parts1.push([points1[i].x, points1[i].y]);
       }
       poly1 = polygon([parts1]);
-      var textarea = area(poly1);
+      var textarea = area(poly1) * window.earthRadius;
       console.log("分析范围:" + textarea);
       for (var i = 0; i < points2.length; i++) {
         parts2.push([points2[i].x, points2[i].y]);
       }
       poly2 = polygon([parts2]);
       var isContain = booleanContains(poly1, poly2);
-      if (isContain) return area(poly2);
+      if (isContain) return area(poly2) * window.earthRadius;
       else {
         var intersection = intersect(poly1, poly2);
-        return area(intersection);
+        return area(intersection) * window.earthRadius;
       }
       return 0;
     },
@@ -3191,12 +3039,12 @@ export default {
     calculateIntersectArea(Points1, Points2) {
       const geometry1 = this.AssemblySurface(Points1);
 
-      var textarea = area(geometry1);
+      var textarea = area(geometry1) * window.earthRadius;
       console.log("分析范围:" + textarea);
       const geometry2 = this.AssemblySurface(Points2);
       let areaPs = intersect(geometry1, geometry2);
       if (areaPs) {
-        const areadifference = area(areaPs);
+        const areadifference = area(areaPs) * window.earthRadius;
         return Number(areadifference.toFixed(2));
       } else {
         return 0;

+ 2 - 2
src/views/ConstructionApplication3D/MXDBinfo/MXDBinfo.vue

@@ -177,7 +177,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 xmzmj += areaPs;
               }
             });
@@ -317,7 +317,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 jzjdzmj += areaPs;
               }
             });

+ 1 - 2
src/views/ConstructionApplication3D/ZBFXAnalysisinfo/ZBFXAnalysisinfo.vue

@@ -103,7 +103,6 @@ export default {
   },
   computed: {},
   mounted() {
-    debugger;
     this.init();
   },
   methods: {
@@ -119,7 +118,6 @@ export default {
             DKBM: Data.KG_Data.DKBM,
           };
           let TableData = [];
-          debugger;
           let YDMJrow = {};
           YDMJrow.zbmc = "用地总面积";
           YDMJrow.fazbyg = Number(Data.FA_Data.YDMJ).toFixed(2);
@@ -173,6 +171,7 @@ export default {
           JRJZMJrow.zbmc = "计容建筑面积";
           JRJZMJrow.tjfazb = Number(Data.TJFA_Data.JRJZMJ).toFixed(2);
           JRJZMJrow.fazbyg = Number(Data.FA_Data.JRJZMJ).toFixed(2);
+          debugger;
           if (Data.KG_Data.JRJZMJX && Data.KG_Data.JRJZMJD) {
             JRJZMJrow.kgyq = Data.KG_Data.JRJZMJX + "/" + Data.KG_Data.JRJZMJD;
           } else {

+ 1 - 1
src/views/ConstructionApplication3D/ZYAnalysisinfo/ZYAnalysisinfo.vue

@@ -147,7 +147,7 @@ export default {
       //交集
       let differenceion = intersect(polygon1, polygon2);
       if (differenceion) {
-        const areadifference = area(differenceion);
+        const areadifference = area(differenceion) * window.earthRadius;
         return areadifference.toFixed(2);
       } else {
         return 0;

+ 1 - 1
src/views/ConstructionApplication3D/backLineAnalysis/backLineAnalysisinfo.vue

@@ -196,7 +196,7 @@ export default {
       //差集
       let differenceion = difference(polygon1, polygon2);
       if (differenceion) {
-        const areadifference = area(differenceion);
+        const areadifference = area(differenceion) * window.earthRadius;
         return areadifference.toFixed(2);
       } else {
         return 0;

+ 50 - 1
src/views/ConstructionApplication3D/billboard/billboardDesign.vue

@@ -98,7 +98,13 @@ import billboarddetail from "@/views/ConstructionApplication3D/billboard/billboa
 import billboardCheck from "@/views/ConstructionApplication3D/billboard/billboardCheckList.vue";
 import addBiillboardModel from "@/views/ConstructionApplication3D/billboard/addBiillboardModel.vue";
 import billboarddetailInfo from "@/views/ConstructionApplication3D/billboard/billboarddetailInfo.vue";
-
+import {
+  cartesian3ToWGS84,
+  mapQuery,
+  flatten,
+  mercator2lonLat,
+  undergroundMode,
+} from "@/utils/MapHelper/MapHelper.js";
 import lodash from "lodash-es";
 let entityList = [];
 export default {
@@ -127,6 +133,7 @@ export default {
         that.thislayers.push(element.name);
       });
     });
+    this.yp();
   },
   methods: {
     handleCurrentChange() {},
@@ -496,8 +503,50 @@ export default {
       viewer.entities.removeAll();
       entityList = [];
     },
+    /**
+     * 压平
+     * @param Minfos 模型信息
+     */
+    async yp() {
+      const Minfo = window.billboardModelLT;
+
+      //获取模型信息
+      let queryBySQLParameters = {
+        getFeatureMode: "SQL",
+        datasetNames: [Minfo.dataSourceName + ":项目范围"],
+        queryParameter: {
+          attributeFilter: "1=1",
+        },
+        hasGeometry: true,
+      };
+      let e = await mapQuery(
+        Minfo.dataurl + "/featureResults.json?returnContent=true",
+        queryBySQLParameters
+      );
+
+      if (e && e.totalCount > 0) {
+        e.features.forEach((element) => {
+          let flatPoints = element.geometry.points
+            .map((item) => [item.x, item.y, 6.5])
+            .flat();
+          viewer.scene.layers.layerQueue.forEach((layer) => {
+            let name = "flatten" + Math.random();
+            let istrue = layer.addFlattenRegion({
+              position: flatPoints,
+              name: name,
+            });
+          });
+        });
+      }
+    },
+    qxyp() {
+      viewer.scene.layers.layerQueue.forEach((layer) => {
+        layer.removeAllFlattenRegion();
+      });
+    },
   },
   beforeDestroy() {
+    this.qxyp();
     this.removeAllentities();
     debugger;
     this.thislayers.forEach((element) => {

+ 7 - 10
src/views/ConstructionApplication3D/projectManagement/projectManagement.vue

@@ -1079,6 +1079,7 @@ export default {
     //添加多个模型
     async addModels(Minfos, completed) {
       await this.yp(Minfos);
+      debugger;
       let models = [];
       Minfos.forEach((element) => {
         var modelLayer = scene.open(element.url);
@@ -1098,6 +1099,7 @@ export default {
 
       Cesium.when
         .all(modifiedPromises, async function (modelLayers) {
+          debugger;
           for (let index = 0; index < modelLayers.length; index++) {
             let modelData = {
               id: uuidv4(),
@@ -1233,6 +1235,7 @@ export default {
           }
         })
         .otherwise(function (error) {
+          debugger;
           that.loading = false;
           that.$message({
             message: "加载失败,请联系管理员",
@@ -2193,6 +2196,7 @@ export default {
      * @param Minfo
      */
     async getnorm(Minfo) {
+      debugger;
       //组装指标对象
       let tableDataList = [];
       for (let index = 0; index < this.LandPlanningList.length; index++) {
@@ -2265,7 +2269,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 xmzmj += areaPs;
               }
             });
@@ -2346,7 +2350,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 jzjdzmj += areaPs;
               }
             });
@@ -2372,7 +2376,6 @@ export default {
           var land = result.buildings.find(
             (t) => t.landNo == item.KG_Data.DKBM
           );
-          debugger;
           if (land == null) continue;
           tableDataList[i].FA_Data.JZMJ = land.mj;
           tableDataList[i].FA_Data.JRJZMJ = land.jrmj;
@@ -2381,7 +2384,7 @@ export default {
           ).toFixed(2);
 
           //开发商提交的方案文档指标
-
+          debugger;
           tableDataList[i].TJFA_Data.JZMJ = land.famj;
           tableDataList[i].TJFA_Data.JRJZMJ = land.fajrmj;
           tableDataList[i].infoData = land;
@@ -2506,7 +2509,6 @@ export default {
        */
       var totalJRArea = 0.0;
       var jrFldIndex = -1;
-      debugger;
       var datasetInfos = result.datasetInfos;
       if (datasetInfos == null || datasetInfos.length == 0) {
         that.$message("未查询到停车位和报建分层数据数据,请重新尝试");
@@ -2519,13 +2521,11 @@ export default {
       for (var i = 0; i < datasetInfos.length; i++) {
         start = datasetInfos[i].featureRange.start;
         end = datasetInfos[i].featureRange.end;
-        debugger;
         curFreatures = result.features.filter((item, index) => {
           return index >= start && index <= end;
         });
         if (datasetInfos[i].datasetName.indexOf(tcwLayerName) > -1) {
           layerName = tcwLayerName;
-          debugger;
           JSResult.parks = that.statisticscCarpark(
             datasetInfos[i].fieldInfos,
             curFreatures
@@ -3493,7 +3493,6 @@ export default {
      */
     openMXDBInfo() {
       let that = this;
-      debugger;
       let modelsloadData = that.modelsload.map((item) => {
         return {
           id: item.id,
@@ -3527,7 +3526,6 @@ export default {
         shade: false, //是否显示遮罩
         shadeClose: false, //点击遮罩是否关闭
         cancel: () => {
-          debugger;
           //还原弹窗
           this.$layer.full(that.layerid);
           //关闭事件
@@ -3612,7 +3610,6 @@ export default {
           queryBySQLParameters
         );
 
-        debugger;
         if (e && e.totalCount > 0) {
           e.features.forEach((element) => {
             let flatPoints = element.geometry.points

+ 1 - 0
static/Config/config.js

@@ -3647,3 +3647,4 @@ window.landUseNatureRelation = [
     ],
   },
 ];
+window.earthRadius = 0.994615737;

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels