ソースを参照

feat: 企业可视化地图调整

zhangying 10 ヶ月 前
コミット
fa1e1cbf2c

+ 3 - 2
src/main/java/com/hz/employmentsite/controller/companyService/CompanyController.java

@@ -15,6 +15,7 @@ import com.hz.employmentsite.util.DateUtils;
 import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.vo.companyService.AppCompanyPostVo;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
+import com.hz.employmentsite.vo.dataMap.CompanyPostMapVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -219,7 +220,7 @@ public class CompanyController {
                                        @RequestParam(required = false) Integer companyModel, @RequestParam(required = false) Integer recordStatus,
                                        @RequestParam(required = false) String regionCode, @RequestParam(required = false) String siteID,
                                        @RequestParam Double latitude, @RequestParam Double longitude) {
-        PageInfo<CompanyVo> result = companyService.getDataMapList(pageIndex, pageSize, companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
+        PageInfo<CompanyPostMapVo> result = companyService.getDataMapList(pageIndex, pageSize, companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
         return RespGenerstor.success(result);
     }
 
@@ -235,7 +236,7 @@ public class CompanyController {
                                                  @RequestParam(required = false) Integer companyModel, @RequestParam(required = false) Integer recordStatus,
                                                  @RequestParam(required = false) String regionCode, @RequestParam(required = false) String siteID,
                                                  @RequestParam Double latitude, @RequestParam Double longitude) {
-        PageInfo<CompanyVo> result = companyService.getDataMapListByPostName(pageIndex, pageSize, companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
+        PageInfo<CompanyPostMapVo> result = companyService.getDataMapListByPostName(pageIndex, pageSize, companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
         return RespGenerstor.success(result);
     }
 

+ 9 - 8
src/main/java/com/hz/employmentsite/mapper/cquery/CompanyCQuery.java

@@ -2,6 +2,7 @@ package com.hz.employmentsite.mapper.cquery;
 
 import com.hz.employmentsite.model.PcFirm;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
+import com.hz.employmentsite.vo.dataMap.CompanyPostMapVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
@@ -28,10 +29,10 @@ public interface CompanyCQuery {
      * @param siteID       所属驿站
      * @return 企业VO列表
      */
-    List<CompanyVo> getDataMapList(@Param("companyName") String companyName, @Param("maxDistance") Integer maxDistance,
-                                   @Param("companyModel") Integer companyModel, @Param("recordStatus") Integer recordStatus,
-                                   @Param("regionCode") String regionCode, @Param("siteID") String siteID,
-                                   @Param("latitude") Double latitude, @Param("longitude") Double longitude);
+    List<CompanyPostMapVo> getDataMapList(@Param("companyName") String companyName, @Param("maxDistance") Integer maxDistance,
+                                          @Param("companyModel") Integer companyModel, @Param("recordStatus") Integer recordStatus,
+                                          @Param("regionCode") String regionCode, @Param("siteID") String siteID,
+                                          @Param("latitude") Double latitude, @Param("longitude") Double longitude);
 
     /**
      * 企业可视化地图查询企业-按岗位名称反向查询
@@ -46,8 +47,8 @@ public interface CompanyCQuery {
      * @param longitude    定点经度
      * @return 企业信息列表
      */
-    List<CompanyVo> getDataMapListByPostName(@Param("postName") String postName, @Param("maxDistance") Integer maxDistance,
-                                             @Param("companyModel") Integer companyModel, @Param("recordStatus") Integer recordStatus,
-                                             @Param("regionCode") String regionCode, @Param("siteID") String siteID,
-                                             @Param("latitude") Double latitude, @Param("longitude") Double longitude);
+    List<CompanyPostMapVo> getDataMapListByPostName(@Param("postName") String postName, @Param("maxDistance") Integer maxDistance,
+                                                    @Param("companyModel") Integer companyModel, @Param("recordStatus") Integer recordStatus,
+                                                    @Param("regionCode") String regionCode, @Param("siteID") String siteID,
+                                                    @Param("latitude") Double latitude, @Param("longitude") Double longitude);
 }

+ 13 - 12
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -14,6 +14,7 @@ import com.hz.employmentsite.services.service.system.DictionaryService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.companyService.AppCompanyPostVo;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
+import com.hz.employmentsite.vo.dataMap.CompanyPostMapVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -650,13 +651,13 @@ public class CompanyServiceImpl implements CompanyService {
      * @return 企业VO列表
      */
     @Override
-    public PageInfo<CompanyVo> getDataMapList(int pageIndex, int pageSize,
-                                              String companyName, Integer maxDistance, Integer companyModel,
-                                              Integer recordStatus, String regionCode, String siteID,
-                                              Double latitude, Double longitude) {
+    public PageInfo<CompanyPostMapVo> getDataMapList(int pageIndex, int pageSize,
+                                                     String companyName, Integer maxDistance, Integer companyModel,
+                                                     Integer recordStatus, String regionCode, String siteID,
+                                                     Double latitude, Double longitude) {
         PageHelper.startPage(pageIndex, pageSize);
-        List<CompanyVo> dataMapList = companyCQuery.getDataMapList(companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
-        PageInfo<CompanyVo> result = new PageInfo(dataMapList);
+        List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapList(companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
+        PageInfo<CompanyPostMapVo> result = new PageInfo(dataMapList);
         return result;
     }
 
@@ -676,13 +677,13 @@ public class CompanyServiceImpl implements CompanyService {
      * @return 企业VO列表
      */
     @Override
-    public PageInfo<CompanyVo> getDataMapListByPostName(int pageIndex, int pageSize, String postName,
-                                                        Integer maxDistance, Integer companyModel, Integer recordStatus,
-                                                        String regionCode, String siteID, Double latitude,
-                                                        Double longitude) {
+    public PageInfo<CompanyPostMapVo> getDataMapListByPostName(int pageIndex, int pageSize, String postName,
+                                                               Integer maxDistance, Integer companyModel, Integer recordStatus,
+                                                               String regionCode, String siteID, Double latitude,
+                                                               Double longitude) {
         PageHelper.startPage(pageIndex, pageSize);
-        List<CompanyVo> dataMapList = companyCQuery.getDataMapListByPostName(postName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
-        PageInfo<CompanyVo> result = new PageInfo(dataMapList);
+        List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapListByPostName(postName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
+        PageInfo<CompanyPostMapVo> result = new PageInfo(dataMapList);
         return result;
     }
 }

+ 11 - 10
src/main/java/com/hz/employmentsite/services/service/companyService/CompanyService.java

@@ -6,6 +6,7 @@ import com.hz.employmentsite.model.PcFirm;
 import com.hz.employmentsite.model.PcSite;
 import com.hz.employmentsite.vo.companyService.AppCompanyPostVo;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
+import com.hz.employmentsite.vo.dataMap.CompanyPostMapVo;
 
 import java.util.Date;
 import java.util.List;
@@ -48,11 +49,11 @@ public interface CompanyService {
      * @param siteID       所属驿站
      * @return 企业VO列表
      */
-    PageInfo<CompanyVo> getDataMapList(int pageIndex, int pageSize,
-                                       String companyName, Integer maxDistance,
-                                       Integer companyModel, Integer recordStatus,
-                                       String regionCode, String siteID,
-                                       Double latitude, Double longitude);
+    PageInfo<CompanyPostMapVo> getDataMapList(int pageIndex, int pageSize,
+                                              String companyName, Integer maxDistance,
+                                              Integer companyModel, Integer recordStatus,
+                                              String regionCode, String siteID,
+                                              Double latitude, Double longitude);
 
     /**
      * 企业可视化地图查询企业-按岗位名称反向查询
@@ -65,9 +66,9 @@ public interface CompanyService {
      * @param siteID       所属驿站
      * @return 企业VO列表
      */
-    PageInfo<CompanyVo> getDataMapListByPostName(int pageIndex, int pageSize,
-                                                 String postName, Integer maxDistance,
-                                                 Integer companyModel, Integer recordStatus,
-                                                 String regionCode, String siteID,
-                                                 Double latitude, Double longitude);
+    PageInfo<CompanyPostMapVo> getDataMapListByPostName(int pageIndex, int pageSize,
+                                                        String postName, Integer maxDistance,
+                                                        Integer companyModel, Integer recordStatus,
+                                                        String regionCode, String siteID,
+                                                        Double latitude, Double longitude);
 }

+ 54 - 0
src/main/java/com/hz/employmentsite/vo/dataMap/CompanyPostMapVo.java

@@ -0,0 +1,54 @@
+package com.hz.employmentsite.vo.dataMap;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class CompanyPostMapVo {
+    private String postID;
+
+    private String professionName;
+
+    private Double minSalary;
+
+    private Double maxSalary;
+
+    private Integer recruitCount;
+
+    private String contactName;
+
+    private String contactMobile;
+
+    private String cultureLevelName;
+
+    private Date startTime;
+
+    private Date EndTime;
+
+    private String welfare;
+
+    private String postDesc;
+
+    private String companyID;
+
+    private String companyName;
+
+    private String CompanyAddress;
+
+    private String companyModelType;
+
+    private String recordStatusName;
+
+    private String Longitude;
+
+    private String Latitude;
+
+    private Double distance;
+
+    private String companyLabelList;
+
+    private String postLabelList;
+
+    private String postList;
+}

+ 27 - 32
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -89,7 +89,7 @@
         LIMIT 30
     </select>
 
-    <select id="getDataMapList" resultType="com.hz.employmentsite.vo.companyService.CompanyVo">
+    <select id="getDataMapList" resultType="com.hz.employmentsite.vo.dataMap.CompanyPostMapVo">
         SELECT
         company.CompanyID,
         company.CompanyName,
@@ -121,7 +121,7 @@
         WHERE
         label_company.CompanyID = company.CompanyID
         ) AS labelTemp
-        ) AS labelList,
+        ) AS companyLabelList,
         (
         SELECT
         JSON_ARRAYAGG( JSON_OBJECT( 'postID', postTemp.PostID, 'professionName', postTemp.ProfessionName ) )
@@ -168,8 +168,20 @@
         distance
     </select>
 
-    <select id="getDataMapListByPostName" resultType="com.hz.employmentsite.vo.companyService.CompanyVo">
+    <select id="getDataMapListByPostName" resultType="com.hz.employmentsite.vo.dataMap.CompanyPostMapVo">
         SELECT
+        post.PostID,
+        prof.ProfessionName,
+        post.MinSalary,
+        post.MaxSalary,
+        post.RecruitCount,
+        post.ContactName,
+        post.ContactMobile,
+        post_culture.`Name` AS cultureLevelName,
+        post.StartTime,
+        post.EndTime,
+        post.welfare,
+        post.postDesc,
         company.CompanyID,
         company.CompanyName,
         company.CompanyAddress,
@@ -180,15 +192,16 @@
         (
         6371 * ACOS(
         COS(
-        RADIANS( 23.116236 )) * COS(
+        RADIANS( #{latitude} )) * COS(
         RADIANS( company.Latitude )) * COS(
-        RADIANS( company.Longitude ) - RADIANS( 114.420244 )) + SIN(
-        RADIANS( 23.116236 )) * SIN(
+        RADIANS( company.Longitude ) - RADIANS( #{longitude} )) + SIN(
+        RADIANS( #{latitude} )) * SIN(
         RADIANS( company.Latitude ))
         )) AS distance,
         (
         SELECT
-        JSON_ARRAYAGG( JSON_OBJECT( 'labelID', labelTemp.LabelID, 'labelName', labelTemp.LabelName ) )
+        JSON_ARRAYAGG(
+        JSON_OBJECT( 'labelID', labelTemp.LabelID, 'labelName', labelTemp.LabelName ))
         FROM
         (
         SELECT
@@ -196,30 +209,11 @@
         label.LabelName
         FROM
         pc_label label
-        LEFT JOIN pc_label_company label_company ON label.LabelID = label_company.LabelID
+        LEFT JOIN pc_label_post label_post ON label.LabelID = label_post.LabelID
         WHERE
-        label_company.CompanyID = company.CompanyID
+        label_post.PostID = post.PostID
         ) AS labelTemp
-        ) AS labelList,
-        (
-        SELECT
-        JSON_ARRAYAGG( JSON_OBJECT( 'postID', postTemp.PostID, 'professionName', postTemp.ProfessionName ) )
-        FROM
-        (
-        SELECT
-        post1.PostID,
-        profession1.ProfessionName
-        FROM
-        pc_post post1
-        LEFT JOIN pc_profession profession1 ON post1.ProfessionID = profession1.ProfessionID
-        WHERE
-        post1.CompanyID = company.CompanyID
-        <if test="postName!='' and postName!=null">
-            and profession1.ProfessionName like Concat('%',#{postName},'%')
-        </if>
-        LIMIT 4
-        ) AS postTemp
-        ) AS postList
+        ) AS postLabelList
         FROM
         pc_post post
         LEFT JOIN pc_profession prof ON post.ProfessionID = prof.ProfessionID
@@ -228,6 +222,8 @@
         AND cmodel.DictionaryCode = 'CompanyModel'
         LEFT JOIN sys_dictionary_item com_status ON company.RecordStatus = com_status.`Value`
         AND com_status.DictionaryCode = 'CompanyStatus'
+        LEFT JOIN sys_dictionary_item post_culture ON post.CultureRank = post_culture.`Value`
+        AND post_culture.DictionaryCode = 'CultureLevel'
         WHERE 1=1
         <if test="postName!='' and postName!=null">
             and prof.ProfessionName like Concat('%',#{postName},'%')
@@ -244,13 +240,12 @@
         <if test="siteID!='' and siteID!=null">
             and company.siteID = #{siteID}
         </if>
-        GROUP BY
-        company.CompanyID
         <if test="maxDistance!=null">
             HAVING
             distance <![CDATA[ <= ]]> #{maxDistance}
         </if>
         ORDER BY
-        distance
+        distance,
+        CompanyID
     </select>
 </mapper>

+ 184 - 82
vue/src/views/dataMap/companyDataMap.vue

@@ -14,6 +14,7 @@
             <a-select
               v-model:value="searchType"
               style="width: 30%"
+              @change="searchTypeChange"
             >
               <a-select-option value="company">找企业</a-select-option>
               <a-select-option value="post">找岗位</a-select-option>
@@ -72,8 +73,10 @@
         </div>
         <!-- 企业数据列表 -->
         <div class="list-box">
+          <!--  查询类型为企业,主要展示企业数据 -->
           <div class="company-data-box" :class="{'check-company':nowCheckCompany.companyID == company.companyID}"
-               v-if="companyList.length > 0" v-for="(company,index) in companyList" :key="index"
+               v-if="companyList.length > 0 && searchType == 'company'" v-for="(company,index) in companyList"
+               :key="index"
                @click="checkCompanyChange(company)">
             <p class="company-name">
               {{ company.companyName }}
@@ -96,9 +99,9 @@
               <span v-if="company.postList.length == 0" style="width: 25px;flex: 0 0 auto">暂无</span>
             </div>
             <!-- 标签 -->
-            <div class="company-label-box" v-if="company.labelList && company.labelList.length > 0"
+            <div class="company-label-box" v-if="company.companyLabelList && company.companyLabelList.length > 0"
                  :ref="el => companyLabelBoxRef[index] = el" :class="{'label-box-max-height': company.labelExpanded}">
-              <a-tag v-for="(label, labelIndex) in company.labelList" :key="labelIndex">
+              <a-tag v-for="(label, labelIndex) in company.companyLabelList" :key="labelIndex">
                 {{ label.labelName }}
               </a-tag>
               <div v-if="showLaunchBtnBox(companyLabelBoxRef,index,50)">
@@ -108,7 +111,38 @@
               </div>
             </div>
           </div>
-          <div v-else class="empty-box">
+          <!-- 查询类型为岗位时,主要展示岗位数据 -->
+          <div v-if="companyList.length>0 && searchType == 'post'"
+               v-for="(postCompany, postCompanyIndex) in companyList" :key="postCompanyIndex"
+               class="company-data-box"
+               @click="checkCompanyChange(postCompany)">
+            <div class="post-title">
+              <span>{{ postCompany.professionName }}({{ postCompany.recruitCount }}人)</span>
+              <span>{{ showSalary(postCompany.minSalary, postCompany.maxSalary) }}</span>
+            </div>
+            <p class="label-text">
+              招聘企业:{{ postCompany.companyName }}
+            </p>
+            <p class="label-text">
+              工作地点:{{ postCompany.companyAddress }}
+            </p>
+            <!-- 标签 -->
+            <div class="company-label-box"
+                 v-if="postCompany.postLabelList && postCompany.postLabelList.length > 0"
+                 :ref="el => companyPostLabelBoxRef[postCompanyIndex] = el"
+                 :class="{'label-box-max-height': postCompany.labelExpanded}">
+              <a-tag v-for="(label, labelIndex) in postCompany.postLabelList" :key="labelIndex">
+                {{ label.labelName }}
+              </a-tag>
+              <div v-if="showLaunchBtnBox(companyPostLabelBoxRef,postCompanyIndex,50)">
+                <span class="launch-btn" v-if="postCompany.labelExpanded"
+                      @click.stop="postCompany.labelExpanded = false">展开</span>
+                <span class="launch-btn" v-else @click.stop="postCompany.labelExpanded = true">收起</span>
+              </div>
+            </div>
+          </div>
+          <!-- 空数据状态 -->
+          <div v-if="companyList.length == 0" class="empty-box">
             <a-empty/>
           </div>
         </div>
@@ -121,85 +155,136 @@
       </div>
       <!-- 岗位信息 -->
       <div class="post-box" v-if="nowCheckCompany.companyID">
-        <p class="title label-text">企业详情</p>
-        <!-- 企业信息 -->
-        <div class="post-company-box">
-          <p class="company-name">
-            {{ nowCheckCompany.companyName }}
-          </p>
-          <p class="label-text">
-            工作地点:{{ nowCheckCompany.companyAddress }}
-          </p>
-          <p class="label-text">
-            企业规模:{{ nowCheckCompany.companyModelType }}
-          </p>
-          <p class="label-text">
-            企业状态:{{ nowCheckCompany.recordStatusName }}
-          </p>
-          <!-- 标签 -->
-          <div class="company-label-box" v-if="nowCheckCompany.labelList && nowCheckCompany.labelList.length > 0"
-               :ref="el => postBoxCompanyLabelBoxRef = el"
-               :class="{'label-box-max-height': postBoxCompanyLabelExpanded}">
-            <a-tag v-for="(label, index) in nowCheckCompany.labelList" :key="index">
-              {{ label.labelName }}
-            </a-tag>
-            <div v-if="showLaunchBtnBox(postBoxCompanyLabelBoxRef, null, 50)">
+        <div v-if="searchType == 'company'" style="width: 100%; height: 100%;">
+          <p class="title label-text">企业详情</p>
+          <!-- 企业信息 -->
+          <div class="post-company-box">
+            <p class="company-name">
+              {{ nowCheckCompany.companyName }}
+            </p>
+            <p class="label-text">
+              工作地点:{{ nowCheckCompany.companyAddress }}
+            </p>
+            <p class="label-text">
+              企业规模:{{ nowCheckCompany.companyModelType }}
+            </p>
+            <p class="label-text">
+              企业状态:{{ nowCheckCompany.recordStatusName }}
+            </p>
+            <!-- 标签 -->
+            <div class="company-label-box"
+                 v-if="nowCheckCompany.companyLabelList && nowCheckCompany.companyLabelList.length > 0"
+                 :ref="el => postBoxCompanyLabelBoxRef = el"
+                 :class="{'label-box-max-height': postBoxCompanyLabelExpanded}">
+              <a-tag v-for="(label, index) in nowCheckCompany.companyLabelList" :key="index">
+                {{ label.labelName }}
+              </a-tag>
+              <div v-if="showLaunchBtnBox(postBoxCompanyLabelBoxRef, null, 50)">
               <span class="launch-btn" v-if="postBoxCompanyLabelExpanded"
                     @click.stop="postBoxCompanyLabelExpanded = false">展开</span>
-              <span class="launch-btn" v-else @click.stop="postBoxCompanyLabelExpanded = true">收起</span>
+                <span class="launch-btn" v-else @click.stop="postBoxCompanyLabelExpanded = true">收起</span>
+              </div>
+            </div>
+          </div>
+          <!-- 岗位列表 -->
+          <div class="list-box">
+            <div class="list-post-box" v-if="postList.length > 0" v-for="(post, postIndex) in postList"
+                 :key="postIndex">
+              <div class="post-title">
+                <span>{{ post.professionName }}</span>
+                <span>{{ showSalary(post.minSalary, post.maxSalary) }}</span>
+              </div>
+              <p class="label-text">
+                招聘人数:{{ post.recruitCount }}
+              </p>
+              <p class="label-text">
+                招聘日期:
+                {{ dayjs(post.startTime).format("YYYY-MM-DD") }}
+                至
+                {{ dayjs(post.endTime).format("YYYY-MM-DD") }}
+              </p>
+              <!-- 岗位要求 -->
+              <div class="post-desc-box">
+                <div class="label-text post-desc" :ref="el => postDescBoxRef[postIndex] = el"
+                     :class="{'post-desc-max-height': post.descExpanded}">
+                  岗位要求:{{ post.postDesc }}
+                </div>
+                <div v-if="showLaunchBtnBox(postDescBoxRef,postIndex,35)">
+                <span class="launch-btn" v-if="post.descExpanded"
+                      @click.stop="post.descExpanded = false">展开</span>
+                  <span class="launch-btn " v-else @click.stop="post.descExpanded = true">收起</span>
+                </div>
+              </div>
+              <!-- 标签 -->
+              <div class="company-label-box" v-if="post.labelList && post.labelList.length > 0"
+                   :ref="el => postLabelBoxRef[postIndex] = el" :class="{'label-box-max-height': post.labelExpanded}">
+                <a-tag v-for="(label, labelIndex) in post.labelList" :key="labelIndex">
+                  {{ label.labelName }}
+                </a-tag>
+                <div v-if="showLaunchBtnBox(postLabelBoxRef,postIndex,50)">
+                <span class="launch-btn" v-if="post.labelExpanded"
+                      @click.stop="post.labelExpanded = false">展开</span>
+                  <span class="launch-btn" v-else @click.stop="post.labelExpanded = true">收起</span>
+                </div>
+              </div>
             </div>
+            <div v-else class="empty-box">
+              <a-empty/>
+            </div>
+          </div>
+          <!-- 分页控件 -->
+          <div class="pagination-box">
+            <a-pagination v-model:current="postSearchParams.pageIndex" :total="postTotal"
+                          v-model:pageSize="postSearchParams.pageSize"
+                          show-less-items @change="postPaginationChange" simple :show-size-changer="false"/>
           </div>
         </div>
-        <!-- 岗位列表 -->
-        <div class="list-box">
-          <div class="list-post-box" v-if="postList.length > 0" v-for="(post, postIndex) in postList" :key="postIndex">
+        <div v-if="searchType == 'post'" style="width: 100%; height: 100%;">
+          <p class="title label-text">岗位详情</p>
+          <div class="post-company-box" style="max-height: 100%">
             <div class="post-title">
-              <span>{{ post.professionName }}</span>
-              <span>{{ showSalary(post.minSalary, post.maxSalary) }}</span>
+              <span>{{ nowCheckCompany.professionName }}</span>
+              <span>{{ showSalary(nowCheckCompany.minSalary, nowCheckCompany.maxSalary) }}</span>
             </div>
             <p class="label-text">
-              招聘人数:{{ post.recruitCount }}
+              招聘企业:{{ nowCheckCompany.companyName }}
+            </p>
+            <p class="label-text">
+              工作地点:{{ nowCheckCompany.companyAddress }}
+            </p>
+            <p class="label-text">
+              联系人:{{ nowCheckCompany.contactName }}
+            </p>
+            <p class="label-text">
+              联系电话:{{ nowCheckCompany.contactMobile }}
+            </p>
+            <p class="label-text">
+              学历要求:{{ nowCheckCompany.cultureLevelName }}
+            </p>
+            <p class="label-text">
+              招聘人数:{{ nowCheckCompany.recruitCount }}人
             </p>
             <p class="label-text">
               招聘日期:
-              {{ dayjs(post.startTime).format("YYYY-MM-DD") }}
+              {{ dayjs(nowCheckCompany.startTime).format("YYYY-MM-DD") }}
-              {{ dayjs(post.endTime).format("YYYY-MM-DD") }}
+              {{ dayjs(nowCheckCompany.EndTime).format("YYYY-MM-DD") }}
+            </p>
+            <p class="label-text">
+              福利待遇:{{ nowCheckCompany.welfare }}
+            </p>
+            <p class="label-text">
+              其他要求:{{ nowCheckCompany.postDesc }}
             </p>
-            <!-- 岗位要求 -->
-            <div class="post-desc-box">
-              <div class="label-text post-desc" :ref="el => postDescBoxRef[postIndex] = el"
-                   :class="{'post-desc-max-height': post.descExpanded}">
-                岗位要求:{{ post.postDesc }}
-              </div>
-              <div v-if="showLaunchBtnBox(postDescBoxRef,postIndex,35)">
-                <span class="launch-btn" v-if="post.descExpanded"
-                      @click.stop="post.descExpanded = false">展开</span>
-                <span class="launch-btn " v-else @click.stop="post.descExpanded = true">收起</span>
-              </div>
-            </div>
             <!-- 标签 -->
-            <div class="company-label-box" v-if="post.labelList && post.labelList.length > 0"
-                 :ref="el => postLabelBoxRef[postIndex] = el" :class="{'label-box-max-height': post.labelExpanded}">
-              <a-tag v-for="(label, labelIndex) in post.labelList" :key="labelIndex">
+            <div class="company-label-box"
+                 v-if="nowCheckCompany.postLabelList && nowCheckCompany.postLabelList.length > 0"
+            >
+              <a-tag v-for="(label, index) in nowCheckCompany.postLabelList" :key="index">
                 {{ label.labelName }}
               </a-tag>
-              <div v-if="showLaunchBtnBox(postLabelBoxRef,postIndex,50)">
-                <span class="launch-btn" v-if="post.labelExpanded"
-                      @click.stop="post.labelExpanded = false">展开</span>
-                <span class="launch-btn" v-else @click.stop="post.labelExpanded = true">收起</span>
-              </div>
             </div>
           </div>
-          <div v-else class="empty-box">
-            <a-empty/>
-          </div>
-        </div>
-        <!-- 分页控件 -->
-        <div class="pagination-box">
-          <a-pagination v-model:current="postSearchParams.pageIndex" :total="postTotal"
-                        v-model:pageSize="postSearchParams.pageSize"
-                        show-less-items @change="postPaginationChange" simple :show-size-changer="false"/>
         </div>
       </div>
     </div>
@@ -243,14 +328,7 @@ const companyList = ref<Array<any>>([])
 // 企业分页条数
 const companyTotal = ref(0);
 // 当前选中的企业
-const nowCheckCompany = ref({
-  companyID: "",
-  companyName: "",
-  companyAddress: "",
-  companyModelType: "",
-  recordStatusName: "",
-  labelList: new Array<any>()
-})
+const nowCheckCompany = ref<any>({})
 // 岗位查询条件
 const postSearchParams = reactive({
   pageIndex: 1,
@@ -277,6 +355,8 @@ const regionList = ref<SelectProps['options']>();
 const searchLoading = ref(false);
 // 企业信息标签box ref
 const companyLabelBoxRef = ref<Array<any>>([]);
+// 企业信息-岗位标签box ref
+const companyPostLabelBoxRef = ref<Array<any>>([])
 // 岗位面板企业信息的标签盒子ref
 const postBoxCompanyLabelBoxRef = ref<any>(null);
 // 岗位面板企业信息的标签展开与收起开关
@@ -330,7 +410,7 @@ function searchAll() {
   companySearchParam.regionCode = undefined;
   companySearchParam.maxDistance = null;
   companySearchParam.pageIndex = 1;
-  companySearchParam.pageSize = 5;
+  companySearchParam.pageSize = 50;
   onSearch();
 }
 
@@ -339,7 +419,8 @@ function findFuncThen(result: any) {
   companyList.value = result.list;
   // 处理标签和岗位JSON数据
   companyList.value.forEach((item: any) => {
-    item.labelList = JSON.parse(item.labelList || '[]')
+    item.companyLabelList = JSON.parse(item.companyLabelList || '[]')
+    item.postLabelList = JSON.parse(item.postLabelList || '[]')
     item.postList = JSON.parse(item.postList || '[]')
     item.labelExpanded = true;
   });
@@ -413,8 +494,22 @@ function setCompanyMarker() {
       iconSize: new T.Point(30, 30),
       iconAnchor: new T.Point(15, 30)
     })
+    let uniqueCompanyList = companyList.value;
+    if (searchType.value == 'post') {
+      // 岗位查询时,会出现多个岗位相同公司,按公司的ID去重
+      const processedCompanyIDs = new Set();
+      // 过滤出唯一的公司列表
+      uniqueCompanyList = companyList.value.filter((item: any) => {
+        if (!processedCompanyIDs.has(item.companyID)) {
+          processedCompanyIDs.add(item.companyID);
+          return true;
+        }
+        return false;
+      });
+    }
+
     // 解析企业数据,在地图中标记
-    companyList.value.forEach((item: any) => {
+    uniqueCompanyList.forEach((item: any) => {
       if (item.longitude && item.latitude) {
         const point = new T.LngLat(item.longitude, item.latitude)
         const marker = new T.Marker(point, {
@@ -498,6 +593,12 @@ function showLaunchBtnBox(refValue: any, index: any, scrollHeight: any) {
   }
 }
 
+// 查询类型切换事件
+function searchTypeChange() {
+  // 清空数据
+  onSearch();
+}
+
 onMounted(() => {
   initMap();
   getCompanyModelList();
@@ -607,6 +708,13 @@ export default {
     border-right: 1px solid rgba(173, 173, 173, 0.8);
   }
 
+  .post-title {
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    margin-bottom: 3px;
+  }
+
   .company-box {
     left: 0;
     right: 300px;
@@ -669,12 +777,6 @@ export default {
         padding: 8px;
         border-bottom: 1px solid rgba(173, 173, 173, 0.8);
 
-        .post-title {
-          display: flex;
-          justify-content: space-between;
-          flex-wrap: wrap;
-        }
-
         .post-desc-box {
           position: relative;
 

+ 12 - 1
vue/src/views/dataMap/siteDataMap.vue

@@ -145,7 +145,7 @@ function onSearch() {
 // 查询全部
 function searchAll() {
   siteSearchParam.pageIndex = 1
-  siteSearchParam.pageSize = 5
+  siteSearchParam.pageSize = 50
   siteSearchParam.siteName = ""
   siteSearchParam.regionCode = null
   siteSearchParam.streetCode = null
@@ -186,9 +186,20 @@ function setSiteMarker() {
       if (item.siteLongitude && item.siteLatitude) {
         const point = new T.LngLat(item.siteLongitude, item.siteLatitude)
         const marker = new T.Marker(point, {icon: icon}); // 创建标注
+
+        // 创建一个信息窗口
+        // const content = `
+        //   <div>
+        //     <p>${item.siteName}</p>
+        //     <p>${item.siteCode}</p>
+        //   </div>
+        // `;
+        // const infoWindow = new T.InfoWindow(content, {offset: new T.Point(0, -30)});
+
         // 给每个地图标点添加点击事件,打印item
         marker.addEventListener('click', () => {
           checkSite(item);
+          // (map as any).openInfoWindow(infoWindow, point);
         });
         (map as any).addOverLay(marker);// 将标注添加到地图中
         markerList.push(marker);