소스 검색

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

maxiaoxiao 6 달 전
부모
커밋
fe8b09f778

+ 12 - 4
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice.vue

@@ -48,16 +48,16 @@
           <el-tab-pane label="分析记录" name="second">
             <el-row :gutter="10">
               <el-col :span="8">
-                <el-input size="mini" placeholder="请输入项目名称" v-model="input3" class="input-with-select">
+                <el-input size="mini" clearable placeholder="请输入项目名称" @change="getBenchmarkLandPriceListBystart()" v-model="input3" class="input-with-select">
                 </el-input>
               </el-col>
               <el-col :span="12">
-                <el-date-picker size="mini" v-model="datevalue" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
+                <el-date-picker size="mini" v-model="datevalue" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" @change="getBenchmarkLandPriceListBystart()"
                   range-separator="" start-placeholder="开始日期" end-placeholder="结束日期">
                 </el-date-picker>
               </el-col>
               <el-col :span="4">
-                <el-button size="mini" icon="el-icon-search" @click="getBenchmarkLandPriceList()"></el-button>
+                <el-button size="mini" icon="el-icon-search" @click="getBenchmarkLandPriceListBystart()"></el-button>
               </el-col>
             </el-row>
             <el-row>
@@ -191,9 +191,11 @@ export default {
     jzdjfxsmjg
   },
   mounted() {
+    
     this.init();
   },
   methods: {
+
     async init() {
       var date = new Date()
       this.form.ProjectName = "基准地价分析_" + this.formatDateTime(date)
@@ -212,6 +214,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getBenchmarkLandPriceList();
     },
+    getBenchmarkLandPriceListBystart(){
+      this.queryParams.pageNum = 1;
+      this.getBenchmarkLandPriceList();
+    },
     /**
      * 获取基准地价信息
      */
@@ -253,6 +259,7 @@ export default {
       if (this.activeName == "third") {
         this.iSjzdjfxsmjgShow = true;
       } else {
+        this.BenchmarkLandPriceinfo=null;
         this.iSjzdjfxsmjgShow = false;
       }
 
@@ -389,7 +396,8 @@ export default {
                   debugger
                   await addZtBenchmarkLandPriceResults(response);
                 }
-                await that.openAnalyzeResults(data.id);
+                // await that.openAnalyzeResults(data.id);
+                that.activeName='second';
               } else {
                 that.$message.error("分析异常");
                 data.AnalysisStatus = "异常";

+ 53 - 14
src/views/ConstructionApplication3D/ConstructionModelInfo/addConstructionModelInfo.vue

@@ -11,26 +11,65 @@
           :rules="rules"
           label-width="140px"
         >
-          <el-form-item label="模型名称:">
-            <el-input v-model="form.modelname"></el-input>
+          <el-form-item label="模型名称:" size="mini" prop="modelname">
+            <el-input
+              v-model="form.modelname"
+              placeholder="请输入模型名称"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="模型地址:">
-            <el-input v-model="form.url"></el-input>
+          <el-form-item label="模型地址:" size="mini" prop="url">
+            <el-tooltip
+              class="item"
+              effect="dark"
+              content="http://超图服务ip:超图服务端口/iserver/services/模型服务名称/rest/realspace"
+              placement="top-start"
+            >
+              <el-input
+                v-model="form.url"
+                placeholder="请输入模型地址"
+              ></el-input>
+            </el-tooltip>
           </el-form-item>
-          <el-form-item label="模型数据地址:">
-            <el-input v-model="form.dataurl"></el-input>
+          <el-form-item label="模型数据地址:" size="mini" prop="dataurl">
+            <el-tooltip
+              class="item"
+              effect="dark"
+              content="http://超图服务ip:超图服务端口/iserver/services/数据服务名称/rest/data"
+              placement="top-start"
+            >
+              <el-input
+                v-model="form.dataurl"
+                placeholder="请输入模型数据地址"
+              ></el-input>
+            </el-tooltip>
           </el-form-item>
-          <el-form-item label="模型数据数据源:">
-            <el-input v-model="form.datasourcename"></el-input>
+          <el-form-item
+            label="模型数据数据源:"
+            size="mini"
+            prop="datasourcename"
+          >
+            <el-input
+              v-model="form.datasourcename"
+              placeholder="请输入模型数据数据源"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="模型数据数据集:">
-            <el-input v-model="form.datasetname"></el-input>
+          <el-form-item label="模型数据数据集:" size="mini" prop="datasetname">
+            <el-input
+              v-model="form.datasetname"
+              placeholder="请输入模型数据数据集"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="设计单位:">
-            <el-input v-model="form.designunit"></el-input>
+          <el-form-item label="设计单位:" size="mini" prop="designunit">
+            <el-input
+              v-model="form.designunit"
+              placeholder="请输入设计单位"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="描述:">
-            <el-input v-model="form.plandescription"></el-input>
+          <el-form-item label="描述:" size="mini" prop="plandescription">
+            <el-input
+              v-model="form.plandescription"
+              placeholder="请输入描述"
+            ></el-input>
           </el-form-item>
         </el-form>
         <div class="SaveCenter">

+ 3 - 2
src/views/ConstructionApplication3D/Demolition/CQSetInfo.vue

@@ -82,9 +82,9 @@
       </el-table-column>
     </el-table>
     <el-row justify="center" type="flex">
-      <el-button type="primary" @click="save()">保存</el-button>
+      <!-- <el-button type="primary" @click="save()">保存</el-button> -->
       <el-button type="primary" @click="saveAs('ruleForm')">另存为</el-button>
-      <el-button type="primary" @click="reset()">重置</el-button>
+      <!-- <el-button type="primary" @click="reset()">重置</el-button> -->
       <el-button type="primary" @click="delBZ()">删除</el-button>
     </el-row>
     <el-dialog
@@ -470,6 +470,7 @@ export default {
      * 重置
      */
     reset() {
+      debugger;
       // var val = this.bcbz
       this.bcbzList = JSON.parse(JSON.stringify(window.ZSBC.CQBCList));
       var item = this.bcbzList.find((t) => t.id == this.bcbz);

+ 235 - 56
src/views/ConstructionApplication3D/Demolition/DemolitionList.vue

@@ -1,6 +1,6 @@
 <template>
-  <div class="ZTGlobal rootele">
-    <el-tabs v-model="activeName" @tab-click="handleClick">
+  <div class="ZTGlobal rootele" style="width: 100%;">
+    <el-tabs v-model="activeName" @tab-click="handleClick" style="width: 100%;">
       <el-tab-pane label="拆迁补偿预估" name="first">
         <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="8rem" class="demo-ruleForm">
           <el-form-item label="项目范围:" prop="">
@@ -72,17 +72,17 @@
       <el-tab-pane label="分析记录" name="second">
         <el-row>
           <el-col :span="10">
-            <el-input size="mini" placeholder="请输入项目名称" v-model="searchName">
+            <el-input size="mini" clearable placeholder="请输入项目名称" @change="queryProjectBystart" v-model="searchName">
               <!-- <i slot="suffix" class="el-input__icon el-icon-search"></i> -->
             </el-input>
           </el-col>
           <el-col :span="10">
-            <el-date-picker size="mini" v-model="dateVal" type="daterange" range-separator="" start-placeholder="开始日期"
+            <el-date-picker @change="queryProjectBystart" size="mini" v-model="dateVal" type="daterange" range-separator="" start-placeholder="开始日期"
               end-placeholder="结束日期">
             </el-date-picker>
           </el-col>
           <el-col :span="2">
-            <el-button type="primary" size="mini" @click="queryProject">查询</el-button>
+            <el-button type="primary" size="mini"  @click="queryProjectBystart">查询</el-button>
           </el-col>
 
         </el-row>
@@ -117,8 +117,9 @@
           </el-pagination>
         </div>
       </el-tab-pane>
-      <el-tab-pane label="分析结果" name="third">
-        <el-row class="box-card" v-model="curProjectInfo">
+      <el-tab-pane label="分析结果" name="third" style="width: 100%;">
+        <el-empty v-if="curProjectInfo==null" description="暂无数据"></el-empty>
+        <el-row class="box-card" v-model="curProjectInfo" v-if="curProjectInfo!=null">
           <el-col :span="18">
             <span style="font-size: 1rem">{{
               curProjectInfo.name
@@ -127,7 +128,7 @@
             <el-button type="primary" size="mini" @click="exportWord(curProjectInfo)">导出报告</el-button>
           </el-col>
         </el-row>
-        <el-tabs v-model="activePage1" @tab-click="pageClick" style="height: auto;">
+        <el-tabs v-model="activePage1" v-if="curProjectInfo!=null" @tab-click="pageClick" style="height: auto;">
           <el-tab-pane label="国有评估" name="GY">
             <div class="divrow">
               <div class="divCol">
@@ -159,7 +160,23 @@
             </div>
             <el-tabs v-model="activePage2" @tab-click="gyPpageClick" style="height: auto;">
               <el-tab-pane label="国有权属" name="GYQS">
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">权属信息</span>
+                  </el-col>
+                  <el-col :span="2" style="display: flex;  justify-content: center;  align-items: center;">
+                    <i ref="GYQS_button" class="el-icon-closeeyes" @click="Showlayers($event,'GYQSChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="GYQSChart" style="height: 15rem; width: 25rem;"></div>
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">现状情况</span>
+                  </el-col>
+                  <el-col :span="2">
+                    <i ref="GYDL_button" class="el-icon-closeeyes" @click="Showlayers($event,'GYDLChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="GYDLChart" style="height: 15rem; width: 25rem;"></div>
               </el-tab-pane>
               <el-tab-pane label="国有房产" name="GYFC">
@@ -263,8 +280,35 @@
                     </div>
                   </div>
                 </div>
+                <el-row>
+                  <el-col :span="22"></el-col>
+                </el-row>
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">集体所有权信息</span>
+                  </el-col>
+                  <el-col :span="2" style="display: flex;  justify-content: center;  align-items: center;">
+                    <i ref="JTOwner_button" class="el-icon-closeeyes" @click="Showlayers($event,'JTOwnerChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="JTOWNERChart" style="height:12rem; width: 25rem;"></div>
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">集体使用权信息</span>
+                  </el-col>
+                  <el-col :span="2" style="display: flex;  justify-content: center;  align-items: center;">
+                    <i ref="JTUSE_button" class="el-icon-closeeyes" @click="Showlayers($event,'JTUseChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="JTUSEChart" style="height: 12rem; width: 25rem;"></div>
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">现状信息</span>
+                  </el-col>
+                  <el-col :span="2" style="display: flex;  justify-content: center;  align-items: center;">
+                    <i ref="JTDL_button" class="el-icon-closeeyes" @click="Showlayers($event,'JTDLChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="JTDLChart" style="height: 12rem; width: 25rem;"></div>
 
               </el-tab-pane>
@@ -389,7 +433,24 @@
                     </div>
                   </div>
                 </div>
+                <el-row>
+                  <el-col :span="22"></el-col>
+                </el-row>
+                <el-row style="display: flex;  justify-content: center;  align-items: center;">
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">农作物补偿面积</span>
+                  </el-col>
+                  <el-col :span="2" style="display: flex;  justify-content: center;  align-items: center;">
+                    <i ref="QMBC_button" class="el-icon-closeeyes" @click="Showlayers($event,'QMBCChart')"></i>
+                  </el-col>
+                </el-row>
                 <div id="QMMJChart" style="height: 10rem; width: 25rem"></div>
+                <el-row >
+                  <el-col :span="22" style="display: flex;  justify-content: center;  align-items: center;">
+                    <span style="font-size: 1.1rem;font-weight: bold;">农作物补偿费用</span>
+                  </el-col>
+                  
+                </el-row>
                 <div id="QMFYChart" style="height: 10rem; width: 25rem"></div>
               </el-tab-pane>
               <el-tab-pane label="房屋拆迁补偿评估" name="FWCQ">
@@ -528,7 +589,6 @@ export default {
   name: "DemolitionList",
   data() {
     return {
-      
       searchName: "",
       FileList: [],
       localLoading: null,
@@ -1092,8 +1152,40 @@ export default {
       }
     }
     this.initSetting();
+  },
+  mounted() {
+   
   },
   methods: {
+ 
+    Showlayers(dom,name){
+      dom.currentTarget.classList.toggle("el-icon-openeyes") ;
+      dom.currentTarget.classList.toggle("el-icon-closeeyes") ;
+      var isshow=dom.currentTarget.classList.contains("el-icon-openeyes");
+
+      switch (name) {
+        case 'GYQSChart'://国有权属信息
+          this.GYQSChart(isshow);
+          break;
+          case 'GYDLChart'://国有权属现状信息
+          this.GYDLChart(isshow);
+          break;
+          case 'JTOwnerChart'://集体所有权信息
+          this.JTOwnerChart( isshow);
+          break;
+          case 'JTUseChart'://集体使用权信息
+          this.JTUseChart( isshow);
+          break;
+          case 'JTDLChart'://集体现状情况
+          this.JTDLChart( isshow);
+          break;
+          case 'QMBCChart'://农作物补偿
+          this.QMBCChart( isshow);
+          break;
+        
+      }
+
+    },
     formatterArea(area) {
       if (area) {
         return area.toFixed(2);
@@ -1109,8 +1201,15 @@ export default {
      * @param {Object} event
      */
     handleClick(tab, event) {
+      debugger
       if (this.activeName == "third") {
-        this.pageClick();
+        // this.pageClick();
+        this.activePage1='GY';
+        this.activePage2='GYQS';
+      }else{
+        this.clear();
+      this.removePolygonEntity();
+      this.curProjectInfo=null;
       }
     },
     /**
@@ -1175,8 +1274,12 @@ export default {
         endDate = ""
       }
       else {
-        startDate = that.formatDateTime(that.dateVal[0])
-        endDate = that.formatDateTime(that.dateVal[1])
+        debugger
+        startDate = that.formatDateTime(that.dateVal[0]);
+        var dateTime= new Date(that.dateVal[1]);
+        dateTime= dateTime.setDate(that.dateVal[1].getDate()+1);
+        dateTime= new Date(dateTime);
+        endDate = that.formatDateTime(dateTime)
       }
       if (window.isUseDB) {
         var queryParams = {
@@ -1221,7 +1324,12 @@ export default {
         list = list.slice((that.currentPage - 1) * that.pageSize, that.pageSize)
       }
     },
-    onCurrentChange() {
+    queryProjectBystart(){
+      this.currentPage = 1;
+      this.queryProject();
+    },
+    onCurrentChange(val) {
+      this.currentPage = val;
       this.queryProject()
     },
     formatDateTimeToLong(date) {
@@ -1453,6 +1561,9 @@ export default {
     showResult(projectInfo) {
       var that = this
       that.activeName = "third";
+      this.activePage1='GY';
+        this.activePage2='GYQS';
+        this.activePage3='ZDPG';
       debugger
       that.curProjectInfo = projectInfo;
       that.regions = JSON.parse(that.curProjectInfo.regions)
@@ -1499,7 +1610,13 @@ export default {
         popupBox=null;
     }
 
-
+    for (let index in this.$refs) {
+        var element=this.$refs[index];
+         if(element&&element.classList&&element.classList.contains("el-icon-openeyes")){
+          element.classList.remove("el-icon-openeyes");
+          element.classList.add("el-icon-closeeyes");
+        }
+      }
 
       that.entities.forEach((item) => {
         viewer.entities.removeById(item.id);
@@ -1615,7 +1732,10 @@ export default {
           if (res)
             debugger
           that.$layer.close(id)
-          that.$message("数据已删除!");
+          that.$message({
+          message: '数据已删除',
+          type: 'success'
+        });
           that.queryProject();
         }).catch((err) => {
           console.log(err)
@@ -1863,7 +1983,7 @@ export default {
     /**
      *征地补偿chart
      */
-    JTDLChart() {
+    JTDLChart(isLayerShow) {
       var that = this;
       var chartDom = document.getElementById("JTDLChart");
       var myChart = window.echarts.init(chartDom);
@@ -1880,7 +2000,7 @@ export default {
       })
       var option = {
         title: {
-          text: '现状情况',
+          // text: '现状情况',
           subtext: '',
           top: 'top',
           left: 'center',
@@ -1895,7 +2015,7 @@ export default {
           type: "scroll",
           orient: "vertical",
           right: 0,
-          top: '20%',
+          top: '10%',
           bottom: 20,
           radius: "55%",
           // bottom: 20,
@@ -1919,7 +2039,7 @@ export default {
           {
             name: "征地补偿分析",
             type: "pie",
-            center: ["25%", "50%"],
+            center: ["25%", "45%"],
             radius: ["25%", "45%"],
             avoidLabelOverlap: false,
             // itemStyle: {
@@ -1947,13 +2067,16 @@ export default {
       };
       myChart.clear()
       myChart.setOption(option);
-      var showOrHide = false;
+      var showOrHide = isLayerShow!=null?isLayerShow:false;
       that.JTDLLoad(null, showOrHide);
       myChart.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDJTYD');
+        if(that.$refs['JTDL_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDJTYD');
         var name = parmas.name
         showOrHide = parmas.selected[name]
         that.JTDLLoad(name, showOrHide);
+        }
+        
       });
     },
     /**
@@ -2037,7 +2160,7 @@ export default {
     /**
     *国有chart
     */
-    GYDLChart() {
+    GYDLChart(isLayerShow) {
       var that = this;
       var chartDom = document.getElementById("GYDLChart");
       var myChart = window.echarts.init(chartDom);
@@ -2055,7 +2178,7 @@ export default {
       }
       var option = {
         title: {
-          text: '现状情况', //国有所有权信息
+          // text: '现状情况', //国有所有权信息
           subtext: '',
           top: 'top',
           left: 'center',
@@ -2070,7 +2193,7 @@ export default {
           type: "scroll",
           orient: "vertical",
           right: 0,
-          top: '20%',
+          top: '10%',
           bottom: 20,
           radius: "55%",
           // bottom: 20,
@@ -2105,7 +2228,7 @@ export default {
           {
             name: "国有征地权属分析",
             type: "pie",
-            center: ["25%", "50%"],
+            center: ["25%", "45%"],
             radius: ["25%", "45%"],
             avoidLabelOverlap: false,
             // itemStyle: {
@@ -2131,15 +2254,21 @@ export default {
           },
         ],
       };
+      myChart.clear();
       myChart.setOption(option);
 
-      var shaowOrHide = false;
+      var shaowOrHide = isLayerShow!=null?isLayerShow:false;
       that.GYDLLoad(null, shaowOrHide);
+ 
+      debugger
       myChart.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDGYDL');
+        if(that.$refs['GYDL_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDGYDL');
         var name = parmas.name
         shaowOrHide = parmas.selected[name]
         that.GYDLLoad(name, shaowOrHide);
+        }
+        
       });
     },
     /**
@@ -2233,7 +2362,7 @@ export default {
     /**
      * 青苗补偿chart
      */
-    QMBCChart() {
+    QMBCChart(isLayerShow) {
 
       var that = this;
       var chartDom1 = document.getElementById("QMMJChart");
@@ -2262,7 +2391,7 @@ export default {
       }
       var option1 = {
         title: {
-          text: "农作物补偿面积",
+          // text: "农作物补偿面积",
           //   subtext: '',
           left: "center",
           textStyle: {
@@ -2325,15 +2454,17 @@ export default {
           },
         ],
       };
+      myChart1.clear();
       myChart1.setOption(option1);
-      var showOrHide = false;
+      var showOrHide = isLayerShow!=null?isLayerShow:false;
       that.QMBCLoad(null, showOrHide)
       myChart1.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDQMBC');
+        if(that.$refs['QMBC_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDQMBC');
         var name = parmas.name
         showOrHide = parmas.selected[name]
         that.QMBCLoad(name, showOrHide)
-
+        }
       });
       var chartDom2 = document.getElementById("QMFYChart");
       var myChart2 = window.echarts.init(chartDom2);
@@ -2354,7 +2485,7 @@ export default {
       }
       var option2 = {
         title: {
-          text: "农作物补偿费用",
+          // text: "农作物补偿费用",
           subtext: "",
           left: "center",
           textStyle: {
@@ -2418,6 +2549,7 @@ export default {
           },
         ],
       };
+      myChart2.clear();
       myChart2.setOption(option2);
     },
     QMBCLoad(name, showOrHide) {
@@ -2546,7 +2678,7 @@ export default {
     /**
      * 国有权属
      */
-    GYQSChart() {
+    GYQSChart(isLayerShow) {
       var that = this;
       var chartDom = document.getElementById("GYQSChart");
       var myChart = window.echarts.init(chartDom);
@@ -2569,7 +2701,7 @@ export default {
       }
       var option = {
         title: {
-          text: '权属信息', //国有所有权信息
+          // text: '权属信息', //国有所有权信息
           subtext: '',
           top: 'top',
           left: 'center',
@@ -2584,7 +2716,7 @@ export default {
           type: "scroll",
           orient: "vertical",
           right: 0,
-          top: '20%',
+          top: '10%',
           bottom: 20,
           radius: "55%",
           // bottom: 20,
@@ -2625,7 +2757,7 @@ export default {
           {
             name: "",
             type: "pie",
-            center: ["25%", "50%"],
+            center: ["25%", "45%"],
             radius: ["35%", "50%"],
             avoidLabelOverlap: false,
             itemStyle: {
@@ -2655,14 +2787,17 @@ export default {
 
       myChart.clear();
       myChart.setOption(option);
-      that.GYQSLoad(that.gyqsChartdatas, null, false);
+      var showOrHide = isLayerShow!=null?isLayerShow:false;
+      that.GYQSLoad(that.gyqsChartdatas, null, showOrHide);
 
       myChart.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDGYQS');
-        var name = parmas.name
-        var showOrHide = parmas.selected[name]
+        if(that.$refs['GYQS_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDGYQS');
+        var name = parmas.name;
+        var showOrHide = parmas.selected[name];
         // var index = Object.keys(parmas.selected).findIndex(t => t == name)
         that.GYQSLoad(that.gyqsChartdatas, name, showOrHide);
+        }
       });
     },
     GYQSLoad(datas, name, showOrHide) {
@@ -2794,7 +2929,7 @@ export default {
     /**
      * 集体使用权
      */
-    JTUseChart() {
+    JTUseChart(isLayerShow) {
       var that = this;
       var chartDom = document.getElementById("JTUSEChart");
       var myChart = window.echarts.init(chartDom);
@@ -2809,7 +2944,7 @@ export default {
       }
       var option = {
         title: {
-          text: '集体使用权信息',
+          // text: '集体使用权信息',
           subtext: '',
           top: 'top',
           left: 'center',
@@ -2824,7 +2959,7 @@ export default {
           type: "scroll",
           orient: "vertical",
           right: 0,
-          top: '20%',
+          top: '10%',
           bottom: 20,
           radius: "55%",
           itemStyle: {
@@ -2865,7 +3000,7 @@ export default {
           {
             name: "集体使用权信息",
             type: "pie",
-            center: ["25%", "50%"],
+            center: ["25%", "45%"],
             radius: ["25%", "45%"],
             avoidLabelOverlap: false,
             // itemStyle: {
@@ -2892,13 +3027,16 @@ export default {
       };
       myChart.clear();
       myChart.setOption(option);
-      var shaowOrHide = false;
+      var shaowOrHide = isLayerShow!=null?isLayerShow:false;
       that.JTUseLoad(datas, null, shaowOrHide)
       myChart.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDJTUSE');
-        var name = parmas.name
-        shaowOrHide = parmas.selected[name]
-        that.JTUseLoad(datas, name, shaowOrHide)
+        if(that.$refs['JTUSE_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDJTUSE');
+          var name = parmas.name
+          shaowOrHide = parmas.selected[name]
+          that.JTUseLoad(datas, name, shaowOrHide)
+        }
+        
       });
 
     },
@@ -3034,7 +3172,7 @@ export default {
     /**
      * 集体所有权
      */
-    JTOwnerChart() {
+    JTOwnerChart(isLayerShow) {
       var that = this;
       var chartDom = document.getElementById("JTOWNERChart");
       var myChart = window.echarts.init(chartDom);
@@ -3051,7 +3189,7 @@ export default {
       }
       var option = {
         title: {
-          text: '集体所有权信息',
+          // text: '集体所有权信息',
           subtext: '',
           top: 'top',
           left: 'center',
@@ -3066,7 +3204,7 @@ export default {
           type: "scroll",
           orient: "vertical",
           right: 0,
-          top: '20%',
+          top: '10%',
           bottom: 20,
           radius: "55%",
           // bottom: 20,
@@ -3105,7 +3243,7 @@ export default {
           {
             name: "集体所有权属分析",
             type: "pie",
-            center: ["25%", "50%"],
+            center: ["25%", "45%"],
             radius: ["25%", "45%"],
             avoidLabelOverlap: false,
             // itemStyle: {
@@ -3131,15 +3269,18 @@ export default {
           },
         ],
       };
-      var showOrHide = false;
+      var showOrHide = isLayerShow!=null?isLayerShow:false;
       that.JTOwnerLoad(datas, null, showOrHide);
       myChart.clear();
       myChart.setOption(option);
       myChart.on("legendselectchanged", function (parmas) {
-        that.pickEntity('ZDJTOWNER');
+        if(that.$refs['JTOwner_button'].classList.contains("el-icon-openeyes")){
+          that.pickEntity('ZDJTOWNER');
         var name = parmas.name
         showOrHide = parmas.selected[name]
         that.JTOwnerLoad(datas, name, showOrHide);
+        }
+        
       });
     },
     JTOwnerLoad(datas, name, showOrHide) {
@@ -4057,6 +4198,18 @@ export default {
     },
     clear() {
 
+      for (let index in this.$refs) {
+        var element=this.$refs[index];
+        if(element&&element.classList&&element.classList.contains("el-icon-openeyes")){
+          element.classList.remove("el-icon-openeyes");
+          element.classList.add("el-icon-closeeyes");
+        }
+      }
+ 
+      if(popupBox){
+        popupBox.destroy();
+        popupBox=null;
+      }
       this.positions = [];
       this.regions = [];
       this.entities.forEach((item) => {
@@ -4125,6 +4278,7 @@ export default {
    * 清楚临时图元
    */
   beforeDestroy() {
+     
     this.removePolygonEntity();
     if (handlerPolygon) {
       handlerPolygon.deactivate();
@@ -4149,6 +4303,31 @@ export default {
 </script>
 <style lang="scss">
 @import "@/../../zt.scss";
+.el-icon-openeyes {
+  background: url("./眼睛.png") center no-repeat;
+  font-size: 0.7rem;
+  background-size: cover;
+  line-height:1rem;
+}
+.el-icon-openeyes:before {
+  content: "显示";
+  font-size: 0.7rem;
+  visibility: hidden;
+  line-height:1rem;
+}
+.el-icon-closeeyes {
+  background: url("./闭眼睛.png") center no-repeat;
+  font-size: 0.7rem;
+  background-size: cover;
+  line-height:1rem;
+}
+.el-icon-closeeyes:before {
+  content: "隐藏";
+  font-size: 0.7rem;
+  visibility: hidden;
+  line-height:1rem;
+}
+
 </style>
 <style scoped>
 .fileInput {

BIN
src/views/ConstructionApplication3D/Demolition/眼睛.png


BIN
src/views/ConstructionApplication3D/Demolition/闭眼睛.png


+ 4 - 1
src/views/ConstructionApplication3D/MXDBinfo/MXDBinfo.vue

@@ -87,13 +87,16 @@ export default {
       debugger;
     },
     openskylineAnalysis() {
-      this.lyoption.content.parent.openskylineAnalysis();
+      this.removeAll();
+      this.lyoption.content.parent.openskylineAnalysis(this.info);
     },
     openSunlightAnalysis() {
+      this.removeAll();
       this.lyoption.content.parent.openSunlightAnalysis();
     },
     //指标分析
     normAnalysis() {
+      this.removeAll();
       this.$layer.close("BJTC");
       let that = this;
       let tableDataList = [];

+ 34 - 3
src/views/ConstructionApplication3D/SunlightAnalysis/SunlightAnalysis.vue

@@ -275,6 +275,8 @@ export default {
       multiViewportMode: 0,
       radio: 0,
       eids: [],
+      //记录进入页面时的场景参数
+      RecordInitializationScene: {},
     };
   },
   props: {
@@ -311,12 +313,23 @@ export default {
   },
   methods: {
     init() {
+      let scene = viewer.scene;
+      layers = scene.layers.layerQueue;
+
+      debugger;
+      this.RecordInitializationScene.shadows = viewer.shadows;
+      this.RecordInitializationScene.layersshadowType = [];
+      for (let i = 0; i < layers.length; i++) {
+        this.RecordInitializationScene.layersshadowType.push({
+          name: layers[i].name,
+          shadowType: layers[i].shadowType,
+        });
+      }
+
       if (viewer.shadows == false) {
         viewer.shadows = true; //开启场景阴影
-        viewer.terrainShadows = true; //地形阴影
       }
-      let scene = viewer.scene;
-      layers = scene.layers.layerQueue;
+
       //图层模型设置阴影
       for (let i = 0; i < layers.length; i++) {
         // if (layers[i].shadowType !== 2) {
@@ -1099,6 +1112,24 @@ export default {
     }
     handlerPolygon = undefined;
     this.dqSunlight();
+
+    debugger;
+    let scene = viewer.scene;
+    layers = scene.layers.layerQueue;
+    viewer.shadows = this.RecordInitializationScene.shadows;
+    debugger;
+    //图层模型还原阴影
+    for (let i = 0; i < layers.length; i++) {
+      var shadowType = this.RecordInitializationScene.layersshadowType.find(
+        (c) => c.name == layers[i].name
+      );
+      if (shadowType) {
+        if (layers[i].shadowType != shadowType.shadowType) {
+          layers[i].shadowType = shadowType.shadowType;
+          layers[i].refresh();
+        }
+      }
+    }
   },
 };
 </script>

+ 7 - 1
src/views/ConstructionApplication3D/billboard/addBiillboardModel.vue

@@ -507,7 +507,13 @@
         </div>
       </div>
     </div>
-
+    <el-row>
+      <el-col :span="24">
+        <span
+          >注意:当前视角为保存完成后定位显示视角,请确保当前广告牌观察视角为最佳视角,保存即可
+        </span>
+      </el-col>
+    </el-row>
     <el-row>
       <div style="display: inline-flex">
         <el-button size="mini" type="primary" @click="saveMode()"

+ 2 - 0
src/views/ConstructionApplication3D/billboard/billboardDesign.vue

@@ -6,10 +6,12 @@
     <el-row :gutter="10">
       <el-col :span="18">
         <el-input
+          clearable
           size="mini"
           placeholder="请输入内容"
           v-model="input3"
           class="input-with-select"
+          @change="getZtBillboardInfoList()"
         >
           <el-button
             slot="append"

+ 119 - 110
src/views/ConstructionApplication3D/projectManagement/projectManagement.vue

@@ -11,6 +11,7 @@
           v-model="input3"
           class="input-with-select"
           clearable
+          @change="getProjectInfos"
         >
           <el-button
             slot="append"
@@ -251,7 +252,7 @@
                               <el-button
                                 type="primary"
                                 size="mini"
-                                @click.stop="KGAnalysis(itemModel)"
+                                @click.stop="KGAnalysis(item, itemModel)"
                                 >控规分析
                               </el-button>
                             </el-col>
@@ -318,7 +319,7 @@
                               <el-button
                                 type="primary"
                                 size="mini"
-                                @click.stop="occupyAnalysis(itemModel)"
+                                @click.stop="occupyAnalysis(item, itemModel)"
                                 >占压分析
                               </el-button>
                             </el-col>
@@ -559,7 +560,7 @@
                                 <el-button
                                   type="primary"
                                   size="mini"
-                                  @click.stop="KGAnalysis(itemModel)"
+                                  @click.stop="KGAnalysis(item, itemModel)"
                                   >控规分析
                                 </el-button>
                               </el-col>
@@ -626,7 +627,7 @@
                                 <el-button
                                   type="primary"
                                   size="mini"
-                                  @click.stop="occupyAnalysis(itemModel)"
+                                  @click.stop="occupyAnalysis(item, itemModel)"
                                   >占压分析
                                 </el-button>
                               </el-col>
@@ -998,14 +999,16 @@ export default {
           for (let key in this.$refs) {
             if (key.indexOf("Model") !== -1) {
               let item = this.$refs[key][0];
-              item.childNodes.forEach((Citem) => {
-                if (
-                  Citem.className &&
-                  Citem.className.indexOf("status ce") !== -1
-                ) {
-                  Citem.style.display = "none";
-                }
-              });
+              if (item) {
+                item.childNodes.forEach((Citem) => {
+                  if (
+                    Citem.className &&
+                    Citem.className.indexOf("status ce") !== -1
+                  ) {
+                    Citem.style.display = "none";
+                  }
+                });
+              }
             }
           }
           // 添加当前选定样式及待选模型
@@ -1032,7 +1035,7 @@ export default {
           data: { info }, //props
         },
 
-        area: ["30rem", "40rem"], //宽 高
+        area: ["30rem", "32rem"], //宽 高
         title: "添加项目模型详情",
         maxmin: false,
         shade: false, //是否显示遮罩
@@ -1160,6 +1163,7 @@ export default {
     },
     //打开夜景分析弹窗
     openNightscapeAnalysis(info) {
+      this.removeAll(false);
       let w = document.body.offsetWidth;
       //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
       //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
@@ -1186,6 +1190,9 @@ export default {
     },
     //打开天际线分析弹窗
     openskylineAnalysis(info) {
+      if (this.LandPlanningList.length > 0 || this.handler != null) {
+        this.removeAll(false);
+      }
       let w = document.body.offsetWidth;
       //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
       //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
@@ -1212,6 +1219,7 @@ export default {
     },
     //打开日照分析弹窗
     openSunlightAnalysis(info) {
+      this.removeAll(false);
       let w = document.body.offsetWidth;
       //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
       //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
@@ -1379,27 +1387,25 @@ export default {
     },
     //添加多个模型
     async addModels(Minfos, completed) {
+      let that = this;
       await this.yp(Minfos);
       debugger;
       let models = [];
-      Minfos.forEach((element) => {
-        var modelLayer = scene.open(element.url);
-        models.push(modelLayer);
-      });
-      // 为每个 Promise 添加 .catch() 处理程序
-      const modifiedPromises = models.map((promise) => {
-        return promise.otherwise((error) => {
-          // 在这里处理错误,例如记录日志或执行其他操作
-
-          // 返回一个默认值或空值,以便 Cesium.when.all 可以继续处理其他 Promise
-          return null; // 或者其他默认值
+      try {
+        Minfos.forEach((element) => {
+          var modelLayer = scene.open(element.url);
+          models.push(modelLayer);
         });
-      });
-
-      let that = this;
-
-      Cesium.when
-        .all(modifiedPromises, async function (modelLayers) {
+        // // 为每个 Promise 添加 .catch() 处理程序
+        // const modifiedPromises = models.map((promise) => {
+        //   return promise.otherwise((error) => {
+        //     // 在这里处理错误,例如记录日志或执行其他操作
+
+        //     // 返回一个默认值或空值,以便 Cesium.when.all 可以继续处理其他 Promise
+        //     return null; // 或者其他默认值
+        //   });
+        // });
+        Cesium.when.all(models, async function (modelLayers) {
           debugger;
           for (let index = 0; index < modelLayers.length; index++) {
             let modelData = {
@@ -1410,10 +1416,10 @@ export default {
             };
             const Minfo = Minfos[index];
             modelData.Minfo = Minfo;
-            const layer = modelLayers[index];
-
+            var layer = modelLayers[index];
             if (layer) {
               layer.forEach((element) => {
+                element.Minfoid = Minfo.id;
                 // element.shadowType = 2;
                 //不同视口显隐
                 for (let n = 0; n < modelLayers.length; n++) {
@@ -1459,58 +1465,6 @@ export default {
                 });
                 modelData.layerDataList.push(layerData);
               });
-
-              // modelData.layerDataList.forEach((layerData) => {
-              //   // 添加模型楼号
-              //   let SMID = layerData.data.find((c) => c.label == "SMID").value;
-              //   let x = layerData.geometry.position.x;
-              //   let y = layerData.geometry.position.y;
-              //   let z =
-              //     layerData.geometry.boundingBox.upper.z -
-              //     layerData.geometry.boundingBox.lower.z;
-              //   let BUILDNO = layerData.data.find(
-              //     (c) => c.label == "BUILDNO"
-              //   ).value;
-              //   if (
-              //     viewer.entities.getById("MXLH-" + modelData.id + "-" + SMID)
-              //   ) {
-              //     viewer.entities.removeById(
-              //       "MXLH-" + modelData.id + "-" + SMID
-              //     );
-              //   }
-              //   let labeltext = viewer.entities.add({
-              //     id: "MXLH-" + modelData.id + "-" + SMID,
-              //     //点
-              //     position: Cesium.Cartesian3.fromDegrees(x, y, z),
-              //     label: {
-              //       text: BUILDNO, //描述内容
-              //       font: "20px Sans-Serif", //字体大小 类型
-              //       fillColor: new Cesium.Color(
-              //         83 / 255,
-              //         249 / 255,
-              //         255 / 255,
-              //         1
-              //       ), //颜色
-              //       outlineColor: Cesium.Color.GOLD,
-              //       style: Cesium.LabelStyle.CENTER_LABEL,
-              //       // 垂直位置
-              //       verticalOrigin: Cesium.VerticalOrigin.BUTTON,
-              //       // 中心位置
-              //       pixelOffset: new Cesium.Cartesian2(0, -10),
-              //       //设置背景颜色透明
-              //       backgroundColor: new Cesium.Color(
-              //         35 / 255,
-              //         55 / 255,
-              //         75 / 255,
-              //         0
-              //       ),
-              //       //打开背景  打开背景 (不会被线段覆盖)
-              //       showBackground: true,
-              //       heightReference: Cesium.HeightReference.NONE ,
-              //     },
-              //   });
-
-              // });
               that.modelsload.push(modelData);
             } else {
               that.loading = false;
@@ -1534,18 +1488,17 @@ export default {
           if (completed && isFunction(completed)) {
             completed();
           }
-        })
-        .otherwise(function (error) {
-          debugger;
-          that.loading = false;
-          that.$message({
-            message: "加载失败,请联系管理员",
-            type: "warning",
-          });
-          scene.multiViewportMode = Cesium.MultiViewportMode.NONE;
-          that.removeModel();
-          scene.layers.removeAll();
         });
+      } catch (error) {
+        that.loading = false;
+        that.$message({
+          message: "加载失败,请联系管理员",
+          type: "warning",
+        });
+        scene.multiViewportMode = Cesium.MultiViewportMode.NONE;
+        that.removeModel();
+        scene.layers.removeAll();
+      }
     },
     //删除模型图层
     removeModel() {
@@ -1602,6 +1555,7 @@ export default {
 
     //模型对比按钮
     ModelComparison(info) {
+      debugger;
       let that = this;
       if (this.modelsload.length > 0) {
         scene.multiViewportMode = Cesium.MultiViewportMode.NONE;
@@ -1616,7 +1570,7 @@ export default {
           checkedModeinfos.push(modeinfo);
         }
       });
-      if (checkedModeinfos.length > 0 && checkedModeinfos.length < 5) {
+      if (checkedModeinfos.length == 2) {
         switch (checkedModeinfos.length) {
           case 1:
             scene.multiViewportMode = Cesium.MultiViewportMode.NONE;
@@ -1641,26 +1595,22 @@ export default {
           that.openMXDBInfo();
           that.loading = false;
         });
-      } else if (checkedModeinfos.length >= 5) {
+      } else if (checkedModeinfos.length > 2) {
         this.loading = false;
         this.$message({
-          message: "不能多于4个模型。",
+          message: "不能多于2个模型。",
           type: "warning",
         });
       } else {
         this.loading = false;
         this.$message({
-          message: "请点击复选框,选中至少一个模型进行对比。",
+          message: "请点击复选框,选中2个模型进行对比。",
           type: "warning",
         });
       }
     },
     // 获取规划地块
     getGuiHuaDiKuai(completed) {
-      if (this.LandPlanningList.length > 0 || this.handler != null) {
-        this.removeAll();
-      }
-
       let that = this;
       this.handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
       this.handler.setInputAction((evt) => {
@@ -1786,15 +1736,40 @@ export default {
     },
 
     //控规分析
-    KGAnalysis(Minfo) {
+    KGAnalysis(info, Minfo) {
+      this.removeAll();
       let that = this;
+      if (!info.plotnumber) {
+        that.$message({
+          message: "请现在项目信息中补全项目地块编码",
+          type: "warning",
+        });
+        return;
+      }
       this.getGuiHuaDiKuai(function () {
+        for (let index = 0; index < that.LandPlanningList.length; index++) {
+          const LandPlanning = that.LandPlanningList[index];
+          let DKBM = LandPlanning.data.find((c) => c.label == "DKBM")
+            ? LandPlanning.data.find((c) => c.label == "DKBM").value
+            : "";
+          let plotnumbers = info.plotnumber.split(",");
+          let isInclude = plotnumbers.some((element) => element.includes(DKBM));
+          if (!isInclude || !DKBM) {
+            that.removeLandPlanningList();
+            that.$message({
+              message: "请选择项目内的地块进行查询",
+              type: "warning",
+            });
+            return;
+          }
+        }
         that.getBufferTraffic();
         that.getbackLine(Minfo);
       });
     },
     //区位分析
     DistrictAnalysis() {
+      this.removeAll();
       this.getGuiHuaDiKuai();
     },
     /**
@@ -2358,6 +2333,7 @@ export default {
 
     //切换地下模式
     undergroundModeAnalysis() {
+      this.removeAll(false);
       let that = this;
       let w = document.body.offsetWidth;
       let h = document.body.offsetHeight;
@@ -2526,9 +2502,33 @@ export default {
       this.openJZXGInfo(that.layerDataList, that.JZTXlayerDatas, Minfo, DKBM);
     },
     //占压分析
-    occupyAnalysis(Minfo) {
+    occupyAnalysis(info, Minfo) {
+      this.removeAll();
       let that = this;
+      if (!info.plotnumber) {
+        that.$message({
+          message: "请现在项目信息中补全项目地块编码",
+          type: "warning",
+        });
+        return;
+      }
       this.getGuiHuaDiKuai(function () {
+        for (let index = 0; index < that.LandPlanningList.length; index++) {
+          const LandPlanning = that.LandPlanningList[index];
+          let DKBM = LandPlanning.data.find((c) => c.label == "DKBM")
+            ? LandPlanning.data.find((c) => c.label == "DKBM").value
+            : "";
+          let plotnumbers = info.plotnumber.split(",");
+          let isInclude = plotnumbers.some((element) => element.includes(DKBM));
+          if (!isInclude || !DKBM) {
+            that.removeLandPlanningList();
+            that.$message({
+              message: "请选择项目内的地块进行查询",
+              type: "warning",
+            });
+            return;
+          }
+        }
         that.getoccupy(Minfo);
       });
     },
@@ -2667,6 +2667,7 @@ export default {
      * @param Minfo
      */
     normAnalysis(info, Minfo) {
+      this.removeAll();
       let that = this;
       if (!info.plotnumber) {
         that.$message({
@@ -2684,6 +2685,7 @@ export default {
           let plotnumbers = info.plotnumber.split(",");
           let isInclude = plotnumbers.some((element) => element.includes(DKBM));
           if (!isInclude || !DKBM) {
+            that.removeLandPlanningList();
             that.$message({
               message: "请选择项目内的地块进行查询",
               type: "warning",
@@ -2913,6 +2915,7 @@ export default {
         if (that.LandPlanningList.length > 0) {
           ghqk.getPlanning(that.LandPlanningList, Minfo);
         } else {
+          that.removeLandPlanningList();
           that.$message({
             message: "当前位置未找到规划地块,请选择其他位置。",
             type: "warning",
@@ -2924,6 +2927,7 @@ export default {
      * 建筑风貌分析
      */
     async ArchitecturalAnalysis(Minfo) {
+      this.removeAll(false);
       this.openArchitecturaInfo(
         this.layerDataList,
         this.LandPlanningList,
@@ -2934,12 +2938,14 @@ export default {
      * 人视分析
      */
     async RSAnalysis(Minfo) {
+      this.removeAll(false);
       this.openRSInfo();
     },
     /**
      * 车位审查
      */
     async CheckPark(Minfo, isJSPark) {
+      this.removeAll(false);
       var that = this;
       var result = await CheckParkAnalyse.buidAreaAndParksComputer(
         Minfo,
@@ -2983,9 +2989,7 @@ export default {
     BuildingStretchingAnalysis(Minfo) {
       let that = this;
 
-      if (this.handler != null) {
-        this.removeAll();
-      }
+      this.removeAll();
 
       this.handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
       this.handler.setInputAction((evt) => {
@@ -3063,6 +3067,7 @@ export default {
     },
     //取消左键事件
     removeEventHandler() {
+      debugger;
       if (this.handler) {
         this.tooltip.setVisible(false);
         this.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
@@ -3334,6 +3339,7 @@ export default {
      * //打开模型对比弹窗
      */
     openMXDBInfo() {
+      debugger;
       let that = this;
       let modelsloadData = that.modelsload.map((item) => {
         return {
@@ -3475,7 +3481,7 @@ export default {
       });
     },
 
-    removeAll() {
+    removeAll(iscloseBJTC) {
       this.removeEventHandler();
       this.removeLandPlanningList();
       this.removeHighLimit();
@@ -3483,7 +3489,10 @@ export default {
       this.removeJZTXlayerDatas();
       this.removeDLTBlayerDatas();
       ghqk.removeAll();
-      this.$layer.close("BJTC");
+      debugger;
+      if (iscloseBJTC != false) {
+        this.$layer.close("BJTC");
+      }
     },
     DestroyAll() {
       scene.multiViewportMode = Cesium.MultiViewportMode.NONE;

+ 317 - 131
src/views/ConstructionApplication3D/skylineAnalysis/skylineAnalysis.vue

@@ -1,21 +1,45 @@
 <template>
-  <div class="ZTGlobal" style="margin: 1rem;">
+  <div class="ZTGlobal" style="margin: 1rem">
     <el-form>
-      <el-form-item>宽度:
-        <el-input-number min="0" max="5000" :step="1" v-model="faceW" @change="farChange"></el-input-number>
+      <el-form-item
+        >宽度:
+        <el-input-number
+          min="0"
+          max="5000"
+          :step="1"
+          v-model="faceW"
+          @change="farChange"
+        ></el-input-number>
       </el-form-item>
-      <el-form-item>高度:
-        <el-input-number min="0" max="500" :step="1" v-model="faceH" @change="heightChange"></el-input-number>
+      <el-form-item
+        >高度:
+        <el-input-number
+          min="0"
+          max="500"
+          :step="1"
+          v-model="faceH"
+          @change="heightChange"
+        ></el-input-number>
       </el-form-item>
       <el-form-item>
-        <div style="display:flex;">
-          天空颜色: <el-color-picker v-model="skyColor" show-alpha></el-color-picker>
+        <div style="display: flex">
+          天空颜色:
+          <el-color-picker v-model="skyColor" show-alpha></el-color-picker>
         </div>
       </el-form-item>
       <el-form-item>
-        <div style="display:flex;">
-          方向:<el-select v-model="slider" @change="sliderChange" style="width:60%">
-            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+        <div style="display: flex">
+          方向:<el-select
+            v-model="slider"
+            @change="sliderChange"
+            style="width: 60%"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
             </el-option>
           </el-select>
         </div>
@@ -29,97 +53,137 @@
   </div>
 </template>
 <script>
-import TJXResult from './TJXResult.vue'
+import TJXResult from "./TJXResult.vue";
+import TJXResult2 from "./TJXResult.vue";
 var drawHandler;
 var facade;
+var facade2;
 var startPoint;
 var endPoint;
 export default {
   data() {
     return {
-      skyColor: 'rgba(113, 155, 247, 0.5)',
+      skyColor: "rgba(113, 155, 247, 0.5)",
       faceW: 200,
       faceH: 100,
       minH: 0,
       viewW: 0,
-      layerid: null,
-      slider: 'left',
-      options: [{
-        value: 'left',
-        label: '左侧'
-      }, {
-        value: 'right',
-        label: '右侧'
-      },
+      layerid2: null,
+      layerid1: null,
+      slider: "left",
+      options: [
+        {
+          value: "left",
+          label: "左侧",
+        },
+        {
+          value: "right",
+          label: "右侧",
+        },
       ],
       isClear: false,
       tooltip: createTooltip(document.body),
-      polylineId: null
-    }
+      polylineId: null,
+    };
   },
-  mounted() {
-    facade = new Cesium.Facade(scene);
-    facade.build();
-
+  props: {
+    info: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    layerid: {
+      type: String,
+      default: "",
+    },
+    lydata: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    lyoption: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
   },
+  mounted() {},
 
   beforeDestroy() {
-    this.clear()
+    this.clear();
   },
   methods: {
     draw() {
-
       var that = this;
+      that.clear();
       this.isClear = false;
+      facade = new Cesium.Facade(scene);
+      facade.build();
+
       // facade.clear();
-      drawHandler = new Cesium.DrawHandler(
-        viewer,
-        Cesium.DrawMode.Line,
-        0
-      );
-      drawHandler.activate()
-      facade.setBoundByPoints(null, null)
+      drawHandler = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Line, 0);
+      drawHandler.activate();
+      facade.setBoundByPoints(null, null);
       drawHandler.movingEvt.addEventListener(function (windowPosition) {
-
         if (drawHandler.positions.length == 0) {
-          that.tooltip.showAt(windowPosition, '<p>绘制起点</p>');
-        }
-
-        else if (drawHandler.positions.length == 1) {
-          that.tooltip.showAt(windowPosition, '<p>绘制终点</p>');
-        }
-        else {
-          that.tooltip.showAt(windowPosition, '<p>右键结束绘制</p>');
-
+          that.tooltip.showAt(
+            windowPosition,
+            "<p>绘制起点</p><br><p>请绘制一条直线</p>"
+          );
+        } else if (drawHandler.positions.length == 1) {
+          that.tooltip.showAt(
+            windowPosition,
+            "<p>绘制终点</p><br><p>请绘制一条直线</p>"
+          );
+        } else {
+          that.tooltip.setVisible(false);
+          drawHandler.drawEvt.raiseEvent({
+            object: { positions: drawHandler.positions },
+          });
         }
-      })
+      });
 
       drawHandler.drawEvt.addEventListener(function (result) {
         that.polylineId = drawHandler.polyline.id;
 
         that.tooltip.setVisible(false);
-        debugger
+        if (
+          !result ||
+          !result.object ||
+          !result.object.positions ||
+          result.object.positions.length != 2
+        ) {
+          drawHandler.deactivate();
+          if (that.polylineId != null) {
+            viewer.entities.removeById(that.polylineId);
+            that.polylineId = null;
+          }
+          return;
+        }
+        debugger;
         startPoint = result.object.positions[0];
         endPoint = result.object.positions[1];
-        var point1 = that.Cartesian2toDegrees(startPoint)
-        that.minH = point1[2]
-        var point2 = that.Cartesian2toDegrees(endPoint)
-        if (point2[2] < that.minH)
-          that.minH = point2[2]
+        var point1 = that.Cartesian2toDegrees(startPoint);
+        that.minH = point1[2];
+        var point2 = that.Cartesian2toDegrees(endPoint);
+        if (point2[2] < that.minH) that.minH = point2[2];
 
-        that.viewW = Math.sqrt((startPoint.y - endPoint.y) * (startPoint.y - endPoint.y) + (startPoint.x - endPoint.x) * (startPoint.x - endPoint.x))
+        that.viewW = Math.sqrt(
+          (startPoint.y - endPoint.y) * (startPoint.y - endPoint.y) +
+            (startPoint.x - endPoint.x) * (startPoint.x - endPoint.x)
+        );
         if (that.slider == "left") {
           facade.setBoundByPoints(startPoint, endPoint);
-        }
-        else {
+        } else {
           facade.setBoundByPoints(endPoint, startPoint);
         }
 
         facade.maxHeight = parseFloat(that.faceH);
         facade.farDistance = parseFloat(that.faceW);
 
-
-
         // viewer.entities.add(
         //   {
         //     id: "ZDGYQS_",
@@ -130,13 +194,12 @@ export default {
         //       pixelSize: 200,
         //     }
         //   })
-        drawHandler.deactivate()
+        drawHandler.deactivate();
         if (that.polylineId != null) {
-          viewer.entities.removeById(that.polylineId)
-          that.polylineId = null
+          viewer.entities.removeById(that.polylineId);
+          that.polylineId = null;
         }
-
-      })
+      });
     },
     /***
      * 计算相机视角
@@ -146,27 +209,11 @@ export default {
       var point2;
 
       if (this.slider == "left") {
-        point1 = [
-          fromPoint[0],
-          fromPoint[1],
-          fromPoint[2],
-        ];
-        point2 = [
-          toPoint[0],
-          toPoint[1],
-          toPoint[2],
-        ];
+        point1 = [fromPoint[0], fromPoint[1], fromPoint[2]];
+        point2 = [toPoint[0], toPoint[1], toPoint[2]];
       } else {
-        point1 = [
-          [0],
-          toPoint[1],
-          toPoint[2],
-        ];
-        point2 = [
-          fromPoint[0],
-          fromPoint[1],
-          fromPoint[2],
-        ];
+        point1 = [[0], toPoint[1], toPoint[2]];
+        point2 = [fromPoint[0], fromPoint[1], fromPoint[2]];
       }
       var positionA = Cesium.Cartesian3.fromDegrees(
         point1[0],
@@ -178,7 +225,11 @@ export default {
         point2[1],
         point2[2]
       );
-      var midpoint = [(point1[0] + point1[0]) / 2, (point1[1] + point1[1]) / 2, (point1[2] + point1[2]) / 2 + 2];
+      var midpoint = [
+        (point1[0] + point1[0]) / 2,
+        (point1[1] + point1[1]) / 2,
+        (point1[2] + point1[2]) / 2 + 2,
+      ];
       let finalPosition = new Cesium.Cartesian3();
       let matrix4 = Cesium.Transforms.eastNorthUpToFixedFrame(positionA);
       Cesium.Matrix4.inverse(matrix4, matrix4);
@@ -198,12 +249,13 @@ export default {
       });
     },
     sliderChange() {
-      facade.clear();
-      if (this.slider == "left") {
-        facade.setBoundByPoints(startPoint, endPoint);
-      }
-      else {
-        facade.setBoundByPoints(endPoint, startPoint);
+      if (facade) {
+        facade.clear();
+        if (this.slider == "left") {
+          facade.setBoundByPoints(startPoint, endPoint);
+        } else {
+          facade.setBoundByPoints(endPoint, startPoint);
+        }
       }
     },
     Cartesian2toDegrees(position) {
@@ -215,31 +267,149 @@ export default {
     },
     create() {
       var that = this;
-      if (that.isClear)
-        return;
-      facade.build();
-      facade.readyPromise.then(function (base64data) {
-        debugger
-
-        // that.download(base64data)
-        if (that.layerid)
-          that.$layer.close(that.layerid)
-        that.layerid = that.$layer.iframe({
-          content: {
-            content: TJXResult, //传递的组件对象
-            parent: that, //当前的vue对象
-            data: { 'imageData': { 'height': that.faceH, 'width': that.viewW, 'data': base64data, 'minH': that.minH, "rgb": that.skyColor } }, //props
-          },
-          area: ["70rem", "35rem"], //宽 高
-          title: "天际线分析结果",
-          maxmin: true,
-          shade: false, //是否显示遮罩
-          shadeClose: false, //点击遮罩是否关闭
-          cancel: () => {
-            //关闭事件
-          },
+      if (that.isClear) return;
+      if (scene.multiViewportMode == 0) {
+        facade.readyPromise.then(function (base64data) {
+          // that.download(base64data)
+          if (that.layerid1) that.$layer.close(that.layerid1);
+          that.layerid1 = that.$layer.iframe({
+            content: {
+              content: TJXResult, //传递的组件对象
+              parent: that, //当前的vue对象
+              data: {
+                imageData: {
+                  height: that.faceH,
+                  width: that.viewW,
+                  data: base64data,
+                  minH: that.minH,
+                  rgb: that.skyColor,
+                },
+              }, //props
+            },
+            area: ["50%", "80%"], //宽 高
+            title: "天际线分析结果",
+            maxmin: true,
+            shade: false, //是否显示遮罩
+            shadeClose: false, //点击遮罩是否关闭
+            cancel: () => {
+              //关闭事件
+            },
+          });
         });
-      });
+      } else {
+        debugger;
+        if (that.info.modelsloadData) {
+          if (that.layerid1) that.$layer.close(that.layerid1);
+          if (that.layerid2) that.$layer.close(that.layerid2);
+          //左侧模型出图
+          debugger;
+          let mx1 = scene.layers.layerQueue.filter(
+            (c) => c.Minfoid == that.info.modelsloadData[0].Minfo.id
+          );
+          let mx2 = scene.layers.layerQueue.filter(
+            (c) => c.Minfoid == that.info.modelsloadData[1].Minfo.id
+          );
+          try {
+            mx1.forEach((element) => {
+              element.setVisibleInViewport(1, true);
+            });
+            mx2.forEach((element) => {
+              element.setVisibleInViewport(1, false);
+            });
+            let thisendPoint = JSON.parse(JSON.stringify(facade.endPoint));
+            let thisstartPoint = JSON.parse(JSON.stringify(facade.startPoint));
+            facade.clear();
+            facade.build();
+            facade.endPoint = thisendPoint;
+            facade.startPoint = thisstartPoint;
+
+            setTimeout(() => {
+              facade.readyPromise.then(function (base64data) {
+                let w = document.body.offsetWidth;
+                let left = (w * 0.5) / 2;
+                that.layerid1 = that.$layer.iframe({
+                  content: {
+                    content: TJXResult, //传递的组件对象
+                    parent: that, //当前的vue对象
+                    data: {
+                      imageData: {
+                        height: that.faceH,
+                        width: that.viewW,
+                        data: base64data,
+                        minH: that.minH,
+                        rgb: that.skyColor,
+                      },
+                    }, //props
+                  },
+                  offset: [left], //left top
+                  area: ["50%", "80%"], //宽 高
+                  title: "天际线分析结果",
+                  maxmin: true,
+                  shade: false, //是否显示遮罩
+                  shadeClose: false, //点击遮罩是否关闭
+                  cancel: () => {
+                    //关闭事件
+                  },
+                });
+                mx1.forEach((element) => {
+                  element.setVisibleInViewport(1, false);
+                  element.setVisibleInViewport(0, true);
+                });
+                mx2.forEach((element) => {
+                  element.setVisibleInViewport(1, true);
+                });
+                facade.clear();
+                facade.build();
+                facade.endPoint = thisendPoint;
+                facade.startPoint = thisstartPoint;
+                setTimeout(() => {
+                  debugger;
+                  facade.readyPromise.then(function (base64data2) {
+                    let left1 = w - w * 0.5 + (w * 0.5) / 2;
+                    that.layerid2 = that.$layer.iframe({
+                      content: {
+                        content: TJXResult2, //传递的组件对象
+                        parent: that, //当前的vue对象
+                        data: {
+                          imageData: {
+                            height: that.faceH,
+                            width: that.viewW,
+                            data: base64data2,
+                            minH: that.minH,
+                            rgb: that.skyColor,
+                          },
+                        }, //props
+                      },
+                      offset: [left1], //left top
+                      area: ["50%", "80%"], //宽 高
+                      title: "天际线分析结果",
+                      maxmin: true,
+                      shade: false, //是否显示遮罩
+                      shadeClose: false, //点击遮罩是否关闭
+                      cancel: () => {
+                        //关闭事件
+                      },
+                    });
+                  });
+                }, 2000);
+              });
+            }, 1000);
+          } catch (error) {
+            mx1.forEach((element) => {
+              element.setVisibleInViewport(1, false);
+              element.setVisibleInViewport(0, true);
+            });
+            mx2.forEach((element) => {
+              element.setVisibleInViewport(1, true);
+            });
+          }
+        } else {
+          that.$message({
+            message: "模型服务加载失败,请联系管理员",
+            type: "warning",
+          });
+        }
+      }
     },
     convertImageToCanvas(image) {
       var canvas = document.createElement("canvas");
@@ -256,41 +426,57 @@ export default {
       image.onload = function () {
         var canvas = that.convertImageToCanvas(image);
         var url = canvas.toDataURL("image/jpeg");
-        var a = document.createElement('a');
-        var event = new MouseEvent('click');
-        a.download = (new Date()).getTime() + ".jpg"; // 指定下载图片的名称
+        var a = document.createElement("a");
+        var event = new MouseEvent("click");
+        a.download = new Date().getTime() + ".jpg"; // 指定下载图片的名称
         a.href = url;
         a.dispatchEvent(event); // 触发超链接的点击事件
-      }
+      };
     },
     farChange() {
-      facade.farDistance = parseFloat(this.faceW)
+      if (facade && facade.farDistance) {
+        facade.farDistance = parseFloat(this.faceW);
+      }
     },
     heightChange() {
-      facade.maxHeight = parseFloat(this.faceH)
+      if (facade && facade.maxHeight) {
+        facade.maxHeight = parseFloat(this.faceH);
+      }
     },
     clear() {
+      if (this.layerid1) this.$layer.close(this.layerid1);
+      if (this.layerid2) this.$layer.close(this.layerid2);
       this.isClear = true;
-      facade.setBoundByPoints(null, null)
-      facade.clear();
+      if (facade) {
+        facade.setBoundByPoints(null, null);
+        facade.clear();
+      }
+      facade = null;
+      if (facade2) {
+        facade2.setBoundByPoints(null, null);
+        facade2.clear();
+      }
+      facade2 = null;
       // drawHandler.clear();
       // rgba(96, 150, 248, 0.8)
       if (this.polylineId != null) {
-        viewer.entities.removeById(this.polylineId)
-        this.polylineId = null
+        viewer.entities.removeById(this.polylineId);
+        this.polylineId = null;
       }
+      this.tooltip.setVisible(false);
       if (drawHandler) {
-        drawHandler.polyline=null;
-        drawHandler.deactivate()
+        drawHandler.polyline = null;
+        drawHandler.clear();
+        drawHandler.deactivate();
+
         drawHandler = null;
       }
-    }
-
-  }
-}
+    },
+  },
+};
 </script>
 <style scoped>
 .el-color-picker__trigger {
   width: 100px;
 }
-</style>
+</style>