Эх сурвалжийг харах

地块界面修改,增加新功能

mork 2 сар өмнө
parent
commit
2d57e6602d

+ 6 - 2
public/static/config/config.js

@@ -7,8 +7,12 @@ var loginConfig = {
 
 var webConfig = {
     // authUrl: "http://10.235.245.174:8888/",
-    authUrl: "http://121.43.55.7:10086/",
-    map_url:"https://service-api.onemap.sh.gov.cn/data-service-manage-service/MapProxyApi/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBsaWNhdGlvbl9pZCI6NjEsImFwcGxpY2F0aW9uX25hbWUiOiLpnZLmtabkuozkuInnu7TmnI3liqHns7vnu58iLCJleHAiOjIwNDY2Nzg0MDN9.IKUMdjUX4U1jncIUNren-iotL7duXI90aLECMjpvUX8/shmap_base_web/MapServer"
+    // authUrl: "http://121.43.55.7:10086/",
+    authUrl: "https://kdyjs-proxy.metamaker.cn/proxy_auth/",
+    // DMS_URL: "/proxy_dms",
+    // DMS_URL: "http://121.43.55.7:10081/dms",
+    DMS_URL: "https://kdyjs-proxy.metamaker.cn/proxy_dms/dms",
+    map_url:"https://service-api.onemap.sh.gov.cn/data-service-manage-service/MapProxyApi/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBsaWNhdGlvbl9pZCI6NjEsImFwcGxpY2F0aW9uX25hbWUiOiLpnZLmtabkuozkuInnu7TmnI3liqHns7vnu58iLCJleHAiOjIwNDY2Nzg0MDN9.IKUMdjUX4U1jncIUNren-iotL7duXI90aLECMjpvUX8/shmap_normal_web/MapServer",
 }
 
 var systemConfig = {

+ 171 - 31
src/views/leaflet.vue

@@ -1,5 +1,6 @@
 <template>
   <div style="width: 100%; height: 100%; position: absolute; top: 0; left: 0">
+     <div v-if="isLoading" class="loading"><span style="position: absolute;">加载中...</span></div>
     <div id="map2DViewer" ref="map2DViewer"></div>
     <div class="top">
       <!-- 搜索框容器 -->
@@ -30,10 +31,10 @@
             <img style="width: 20px;" src="../../public/static/image/close.svg" />
           </div>         
            <!-- title -->
-          <div class="building-information-title" @click="sendMessageClick">
+          <div class="building-information-title" @click="sendMessageClick(1)">
             {{ BuildingInformationProperties.c_resource_name || BuildingInformationProperties.c_parcel_number+'地块' }}
           </div>
-          <div style="overflow-y: auto;overflow-x: hidden;max-height: 50vh;padding: 0px 10px;">
+          <div style="overflow-y: auto;overflow-x: hidden;max-height: 80vh;padding: 0px 10px;">
             <!-- <div>
               企业服务专员{{
                 BuildingInformationProperties.c_building_manager_name +
@@ -105,6 +106,20 @@
                 </div>
               </div>
             </div>
+            
+            <div v-if="isDataTypeFlag != 1 && (URLParams.role.includes(38) || URLParams.role.includes(43)) && BuildingInformationProperties.clue_show == true" >
+              <div class="info-item">
+                <span style="color: #656E86;padding-right: 20px;">意向企业</span>
+                <span>{{BuildingInformationProperties.c_enterprise_name}}</span>
+              </div>
+              <div class="info-item">
+                <span style="color: #656E86;padding-right: 20px;">项目状态</span>
+                <span >{{clue_statusArr[BuildingInformationProperties.c_clue_status-1]}}</span>
+              </div>
+              <div class="info-item" style="margin-top: 0px;color: #3165FF;cursor: pointer;" v-if="isMobile == false" @click="sendMessageClick(2)">
+                查看招商详情
+              </div>
+            </div>
             <div class="info-item" style="margin-top: 0px;" v-if="isDataTypeFlag == 1">
               占地面积
             </div>
@@ -277,7 +292,7 @@
             <span :class="isClearCejuFlag == true ? 'measure-text active' : 'measure-text'">测距</span>
           </button>
         </div>
-        <div v-if="showMeasureTip" class="measure-tip">{{ measureTipText }}</div>
+        <div v-if="showMeasureTip" :class="curtipCheck == 2 ? 'measure-tip' : 'buff-tip'" :style="'right:'+tipRightX+'px'">{{ measureTipText }}</div>
         <div v-show="isCheckDraw == true" class="buffTypeShow" :style="'right:'+rightX+'px'" v-on:mousemove="isCheckDraw=true" v-on:mouseout="isCheckDraw=false">
               <div v-for="(item, index) in checkedArr" :key="index"  >
                 <button
@@ -313,7 +328,7 @@
 </template>
 
 <script>
-import { get } from "@/utils/request";
+import { get,post,postform } from "@/utils/request";
 import publicFun from "@/utils/publicFunction.js";
 let baseUrl  = process.env.BASE_URL;
 export default {
@@ -321,6 +336,7 @@ export default {
     return {
       BuildingInformationProperties: {},
       BuildingInformationShow: false,
+      isLoading: true, // 控制加载状态的变量
       // 底图对象
       layer: null,
       //   面对象集合
@@ -342,9 +358,13 @@ export default {
         type:'',
         code:'',
         center:'',
-        industry:''
+        industry:'',
+        role:[],
       },
+      clue_statusArr:["初步接洽","持续跟进","基本成熟(待上四委两局会议)","项目暂缓、终止、流失(说明原因","禁用"],
       rightX:0,
+      tipRightX:0,
+      curtipCheck:null,
 
       //15分钟生活圈数据集合
       lifeDatas: {},
@@ -467,10 +487,16 @@ export default {
       
   },
   methods: {
-    sendMessageClick(){
+    sendMessageClick(param){
       let that = this;
       let info = that.BuildingInformationProperties
-      const message = { type: info.column_name, id: info.id, code: info.c_park_code || info.c_parcel_number };
+      let curType = info.column_name;
+      if(param == 2){ //线索
+          curType = info.clue_type
+      }
+      const message = { type: curType, id: info.id, code: info.c_park_code || info.c_parcel_number,clue_id:info.clue_id, clue_code:info.clue_code};
+      console.log("message")
+      console.log(message)
       window.parent.postMessage(message, '*');
     },
     initIframeInfo (){
@@ -545,23 +571,6 @@ export default {
     },
     getOauthToken() {
       let that = this;
-      // let loginInfo = new FormData();
-      // // loginConfig 在config.js中配置,项目中灵活运用
-      // let keyArr = Object.keys(loginConfig);
-      // let valueArr = Object.values(loginConfig);
-      // keyArr.map(function (field, index) {
-      //   loginInfo.append(field, valueArr[index]);
-      // });
-      // fetch(webConfig.authUrl + "oauth/user/login", {
-      //   method: "POST",
-      //   body: loginInfo,
-      // })
-      //   .then((resp) => resp.json())
-      //   .then((data) => {
-      //     that.oauthToken = data.message;
-      //     that.initMap();
-      //   });
-
       let URLStr = window.location.href.split('#');
       if(URLStr.length>1){
         const paramsStr = URLStr[1].split('?')[1];
@@ -576,14 +585,48 @@ export default {
         that.URLParams.code = params.code;
         that.URLParams.center = params.center;
         that.URLParams.industry = params.industry;
+        that.URLParams.role = params.role;
+        if(params.role != undefined){
+          that.URLParams.role = JSON.parse(params.role);
+        }else{
+          that.URLParams.role = [38,43]
+        }
+        
       }else{
         const params = new URLSearchParams(window.location.search);
         that.URLParams.type = params.get('type');
         that.URLParams.code = params.get('code');
         that.URLParams.center = params.get('center');
         that.URLParams.industry = params.get('industry');
+        if(params.get('role') != undefined){
+          that.URLParams.role = JSON.parse(params.get('role'));
+        }else{
+          that.URLParams.role = [38,43]
+        }
       }
-      that.initMap();
+
+      let loginInfo = new FormData();
+      // loginConfig 在config.js中配置,项目中灵活运用
+      let keyArr = Object.keys(loginConfig);
+      let valueArr = Object.values(loginConfig);
+      keyArr.map(function (field, index) {
+        loginInfo.append(field, valueArr[index]);
+      });
+      fetch(webConfig.authUrl + "oauth/user/login", {
+        method: "POST",
+        body: loginInfo,
+      })
+        .then((resp) => resp.json())
+        .then((data) => {
+          that.oauthToken = data.message;
+          localStorage.setItem("TOKEN",that.oauthToken),
+          that.initMap();
+        });
+     
+      // that.initMap();
+    },
+    isMapLoaded() {
+        return Object.keys(map2DViewer.map._layers).length > 0 && Object.keys(map2DViewer.map._panes).length > 0;
     },
     initMap() {
       let that = this;
@@ -602,6 +645,13 @@ export default {
       this.layer = this.addTiledMapLayer(
         webConfig.map_url
       ).addTo(map2DViewer.map);
+       //地图是否加载完成
+      if (that.isMapLoaded()) {
+        that.isLoading = false; 
+      } else {
+        // 等待地图加载完成
+        setTimeout(that.isMapLoaded, 100); // 可以尝试使用 setTimeout 来轮询,直到地图加载完成
+      }
       // 单击事件:清除所有绘制的元素和筛选结果
       map2DViewer.map.on("click", (e) => {
         // 清除圆圈
@@ -647,6 +697,8 @@ export default {
               this.initIframeInfo(); // 第三方URL引进此工程获取的参数
            }
       })
+
+     
     },
 
     drawCircle(e){
@@ -760,6 +812,10 @@ export default {
           properties.cy_lable = properties.content
         }
         this.BuildingInformationProperties = properties;
+        if(properties.column_name == '地块表' && (this.URLParams.role.includes(38) || this.URLParams.role.includes(43))){
+          this.findSelectContentListInfo(properties.c_parcel_number)
+        }
+        
         // let popupContent = '<div class="custom-popup">';
         // // 遍历属性并生成HTML
         // for (const [key, value] of Object.entries(properties)) {
@@ -785,7 +841,7 @@ export default {
       //   点击点打开弹窗
       polygon.on("click", (e) => {
         // console.log("eeee"+JSON.stringify(e));
-        
+        console.log("eeeeeee")
         this.BuildingInformationShow = true;
         // 创建弹窗内容
         const properties = feature.properties;
@@ -806,6 +862,12 @@ export default {
           properties.cy_lable = properties.content
         }
         this.BuildingInformationProperties = properties;
+        // 政府用户是43和38
+        console.log("eeeeeee")
+        console.log(this.URLParams)
+        if(properties.column_name == '地块表' && (this.URLParams.role.includes(38) || this.URLParams.role.includes(43))){
+          this.findSelectContentListInfo(properties.c_parcel_number)
+        }
         // // 创建弹窗内容
         // const properties = feature.properties;
         // let popupContent = '<div class="custom-popup">';
@@ -1132,6 +1194,9 @@ export default {
           properties.cy_lable = properties.content
       }
       this.BuildingInformationProperties = properties;
+      if(properties.column_name == '地块表' && (this.URLParams.role.includes(38) || this.URLParams.role.includes(43))){
+          this.findSelectContentListInfo(properties.c_parcel_number)
+        }
 
 
       // 地块\楼宇
@@ -1143,6 +1208,45 @@ export default {
         });
       }, 0);
     },
+
+    findSelectContentListInfo(val){
+        let param = {
+          columnId:1576,//重点线索表栏目
+          search:[{"field": "c_intended_parcel_code","searchType": 1,"content": {"value": val}}],
+          pageSize:1,
+          page:0
+        }
+        let formData = new FormData();
+        formData.append("columnId", param.columnId)
+        formData.append("search", JSON.stringify(param.search))
+        formData.append("pageSize", 1)
+        formData.append("page", 0)
+        fetch(webConfig.DMS_URL + "/content/selectContentListInfo", {
+            method: 'POST', // 或者 'PUT', 'DELETE', 等等
+            body: formData, // 直接传递 FormData 对象
+            headers: {
+              // 如果需要设置 Content-Type,通常不需要,因为 fetch 会自动设置,但如果需要可以手动设置
+              // 'Content-Type': 'multipart/form-data',
+              token: localStorage.getItem("TOKEN"),
+            }
+          }).then(response => response.json()) // 假设服务器返回 JSON 数据
+            .then(data => {
+                if(data.code == 200){
+                  if(data.message != "数据不存在"){
+                    let info = data.content[0];
+                    this.BuildingInformationProperties.clue_id=info.id;
+                    this.BuildingInformationProperties.clue_type = "线索";
+                    this.BuildingInformationProperties.clue_code=info.c_clue_code;
+                    this.BuildingInformationProperties.c_clue_name=info.c_clue_name;
+                    this.BuildingInformationProperties.c_enterprise_name=info.c_enterprise_name;
+                    this.BuildingInformationProperties.c_clue_status=info.c_clue_status;
+                    this.BuildingInformationProperties.clue_show = true;
+                  }else{
+                    this.BuildingInformationProperties.clue_show = false
+                  }
+                }
+            })
+    },
     toggleCheckDraw(){
       this.isCheckDraw = !this.isCheckDraw;
     },
@@ -1158,6 +1262,7 @@ export default {
     },
     toggleDraw(){
       this.isDraw = !this.isDraw;
+      this.curtipCheck = 1
       if(this.isDraw == false){
          // 清除圆圈
         if (this.currentCircle) {
@@ -1173,6 +1278,7 @@ export default {
         this.showMeasureTip = false;
         this.measureTipText = "";
       }else{
+        this.tipRightX = this.rightX + 160;
         this.showMeasureTip = true;
         this.measureTipText = "点击地图进行绘制十五分钟圈";
       }
@@ -1197,14 +1303,17 @@ export default {
     },
     // 切换测距模式
     toggleMeasureMode() {
+       this.curtipCheck = 2
       if(this.isClearCejuFlag == true){
         this.clearMeasureData();//清除测距数据
         this.isClearCejuFlag = false;
         this.isMeasuring = false;
+        this.showMeasureTip = false;
       }else{
         this.isMeasuring = !this.isMeasuring;
         const map = this.getMapInstance();
         this.isClearCejuFlag = true
+        this.showMeasureTip = true;
         if (this.isMeasuring && map) {
           this.startMeasuring();
         } else {
@@ -1891,11 +2000,20 @@ export default {
   font-size: 14px;
   color: #3165FF;
 }
-
+.buff-tip[data-v-1c94735a] {
+    position: fixed;
+    top: 20px;
+    background-color: rgba(0, 0, 0, 0.7);
+    color: white !important;
+    padding: 5px 10px;
+    border-radius: 4px;
+    font-size: 12px;
+    white-space: nowrap;
+}
 .measure-tip {
   position: fixed;
   top: 60px;
-  right: 26px;
+  right: 26px !important;
   background-color: rgba(0, 0, 0, 0.7);
   color: white !important;
   padding: 5px 10px;
@@ -2070,9 +2188,14 @@ export default {
     top: 140px !important;
     width: auto !important;
   }
-  .measure-tip{
-    right: auto;
-    top: 66px;
+  .buff-tip {
+    right: auto !important;
+    top: 66px !important;
+  }
+  .measure-tip {
+    right: 95px !important;
+    top: auto;
+    bottom: 60px;
   }
 }
 /* 分段距离标签样式 */
@@ -2170,4 +2293,21 @@ export default {
   top: 0px;
 }
 
+.loading {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 100%; /* 根据需要调整 */
+}
+.loading::after {
+  content: ""; /* 使用伪元素创建动画 */
+  display: block; /* 使伪元素成为块级元素 */
+  width: 80px; /* 宽度 */
+  height: 80px; /* 高度 */
+  border: 10px solid #f3f3f3; /* 边框颜色 */
+  border-top: 10px solid #3498db; /* 上边框颜色 */
+  border-radius: 50%; /* 圆形 */
+  animation: spin 1s linear infinite; /* 应用动画 */
+}
+@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* 定义旋转动画 */
 </style>

+ 12 - 5
vue.config.js

@@ -98,12 +98,19 @@ module.exports = defineConfig({
           "^/oauth": "/proxy_oauth",
         },
       },
-      "/dms": {
-        target: "http://121.43.55.7:2101",
-        changeOrigin: true, // 允许跨域
+      // "/dms": {
+      //   target: "http://121.43.55.7:2101",
+      //   changeOrigin: true, // 允许跨域
+      //   pathRewrite: {
+      //     "^/dms": "/proxy_dms",
+      //   },
+      // },
+      '/proxy_dms': {
+        target: 'http://121.43.55.7:10081/dms',
+        changeOrigin: true,
         pathRewrite: {
-          "^/dms": "/proxy_dms",
-        },
+          '^/proxy_dms': ''
+        }
       },
       "/internalMap": {
         target: "https://szlszxdt.qpservice.org.cn",