Ver Fonte

fix: 驿站工作人员外出地图

zhangying há 3 meses atrás
pai
commit
11dda980ac

+ 2 - 0
src/main/java/com/hz/employmentsite/vo/signin/SigninVo.java

@@ -12,6 +12,8 @@ import java.util.Date;
 public class SigninVo {
     private String siteUserID;
 
+    private String signinId;
+
     private Date signinTime;
 
     private Integer signinType;

+ 1 - 0
src/main/resources/mapping/cquery/SiteUserCQuery.xml

@@ -162,6 +162,7 @@
     <select id="getSiteUserSigninList" resultType="com.hz.employmentsite.vo.signin.SigninVo">
         SELECT
             siteUser.SiteUserID,
+            signin.SigninId,
             signin.SigninTime,
             signin.SigninType,
             signin.Content,

Diff do ficheiro suprimidas por serem muito extensas
+ 2 - 0
vue/src/utils/imageUtils.ts


+ 47 - 9
vue/src/views/dataMap/siteUserWorkDataMap.vue

@@ -47,7 +47,6 @@
               :field-names="{ label: 'siteName', value: 'siteID' }"
               :allow-clear="true"
               :bordered="false"
-              :disabled="searchType == 'site'"
               placeholder="所属驿站"
               @change="onSearch"
             >
@@ -62,7 +61,7 @@
                  :key="siteIndex"
                  @click="checkSiteUser(siteUser)"
                  @mouseenter="siteUserMouseenter(siteUser)"
-                 @mouseleave="siteUserMouseenter({siteUserID:null})"
+                 @mouseleave="siteUserMouseenter({siteUserID: -1})"
             >
               <p class="site-name">
                 {{ siteUser.siteUserName }}
@@ -78,7 +77,7 @@
               </p>
             </div>
             <div
-              v-if="searchType == 'siteUser' && siteUserList.length == 0"
+              v-if="siteUserList.length == 0"
               class="empty-box">
               <a-empty/>
             </div>
@@ -93,14 +92,14 @@
         </div>
       </div>
       <!-- 驿站人员信息详情 -->
-      <div class="site-user-info-box" v-if="nowCheckSiteUser.siteUserID != null">
+      <div class="site-user-info-box" v-if="nowCheckSiteUser.siteUserID">
         <div class="user-info-box margin-bottom-10">
           <p class="font-size-18 margin-bottom-8" style="font-weight: 600; text-align: center">
             {{ nowCheckSiteUser.siteUserName }}
           </p>
         </div>
         <!-- 服务记录时间轴 -->
-        <div v-if="nowCheckSiteUser.signinList.length > 0" class="serviceRecords-list">
+        <div v-if="nowCheckSiteUser.signinList && nowCheckSiteUser.signinList.length > 0" class="serviceRecords-list">
           <p class="margin-bottom-10">服务记录</p>
           <a-timeline>
             <a-timeline-item v-for="(service, key) in nowCheckSiteUser.signinList" :key="key" position="left">
@@ -108,6 +107,20 @@
               <p v-if="service.signinType == 1">走访{{ service.companyName }}</p>
               <p v-if="service.signinType == 2">走访{{ service.jobUserName }}人员信息</p>
               <p v-if="service.signinType == 3">外出走访({{ service.content }})</p>
+              <div class="flex-box" style="flex-wrap: wrap">
+                <!--                <b-preview-visible-file v-for="(item, index) in service.fileList" :key="index"-->
+                <!--                                        :file-id="item.fileId"></b-preview-visible-file>-->
+                <div v-for="(item, index) in service.fileList" :key="index"
+                     style="width: 60px; height: 60px; margin-right: 5px; margin-bottom: 5px">
+                  <a-image
+                    v-if="item.previewUrl"
+                    width="100%"
+                    height="100%"
+                    :src="item.previewUrl"
+                    :fallback="errorImage"
+                  ></a-image>
+                </div>
+              </div>
             </a-timeline-item>
           </a-timeline>
         </div>
@@ -129,6 +142,8 @@ import {getRegionCodeList} from "@/api/system/area/index";
 import redTh from "@/assets/images/redTh.png"
 import dayjs from "dayjs";
 import {getDataMapListBySiteUserWorkMap} from "@/api/baseSettings/userInfo";
+import {getFileBase64, getList} from "@/api/system/file";
+import {base64ToBlob, errorImage} from "@/utils/imageUtils";
 
 const T = (window as any).T;
 const zoom = 9;
@@ -198,7 +213,7 @@ async function onSearch() {
       if (siteUser.signinList.length > 0) {
         const points = new Array<any>();
 
-        siteUser.signinList.forEach((signin) => {
+        siteUser.signinList.forEach((signin: any) => {
           if (signin.longitude && signin.latitude) {
             // 保存坐标点
             points.push(new T.LngLat(signin.longitude, signin.latitude))
@@ -241,7 +256,6 @@ const changeRegion = async function () {
 
 // 选择站点人员
 async function checkSiteUser(siteUser: any) {
-  nowCheckSiteUser.value = JSON.parse(JSON.stringify(siteUser));
   // 清除地图标其他记点
   delMapInfo();
   if (siteUser.signinList.length >= 0) {
@@ -253,7 +267,7 @@ async function checkSiteUser(siteUser: any) {
       iconSize: new T.Point(20, 20)
     })
     const points = new Array<any>();
-    siteUser.signinList.forEach((signin) => {
+    siteUser.signinList.forEach((signin: any) => {
       if (signin.longitude && signin.latitude) {
         // 保存坐标点
         points.push(new T.LngLat(signin.longitude, signin.latitude))
@@ -273,11 +287,26 @@ async function checkSiteUser(siteUser: any) {
     (map as any).addOverLay(line); //向地图上添加线
     lineList.value.push(line);
   }
+  nowCheckSiteUser.value = JSON.parse(JSON.stringify(siteUser));
+  nowCheckSiteUser.value.signinList.forEach((signin: any) => {
+    // 查询服务记录的图片数据
+    getList({fileRefID: signin.signinId}).then((result: any) => {
+      if (result && result.length > 0) {
+        signin.fileList = result;
+        signin.fileList.forEach((image: any) => {
+          getFileBase64({fileId: image.fileId}).then((result: any) => {
+            image.previewUrl = URL.createObjectURL(base64ToBlob("data:image/png;base64," + result));
+            console.log(image.previewUrl);
+          })
+        })
+      }
+    })
+  })
 }
 
 // 站点人员鼠标经过事件
 function siteUserMouseenter(siteUser: any) {
-  nowMouseenterSite.value = siteUser;
+  nowMouseenterSiteUser.value = JSON.parse(JSON.stringify(siteUser));
 }
 
 // 清空地图标点
@@ -399,6 +428,7 @@ export default {
     border-radius: 10px;
     background-color: white;
     padding: 15px;
+    overflow: hidden;
   }
 
   .pagination-box {
@@ -418,6 +448,14 @@ export default {
     align-items: center;
   }
 
+  .serviceRecords-list {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    overflow-y: auto;
+    background-color: white;
+  }
+
   .ant-btn, .ant-input, .ant-picker, .ant-picker-input, .ant-picker-focused {
     border: none !important;
     box-shadow: none !important;