Browse Source

Add - 添加企业信息分页

yhfu 2 tuần trước cách đây
mục cha
commit
20e1c2cca8

+ 8 - 0
src/api/forest.js

@@ -397,3 +397,11 @@ export function eventHandling(id,eventCode) {
       params:param
       params:param
     })
     })
   }
   }
+  // 获取企业详情
+  export function getRegulatoryinformation(id) {
+    return request({
+      url: `/center-data/regulatoryinformation/${id}`,
+      method: 'get'
+    })
+  }
+

+ 1 - 1
src/components/companyProjectDialog/index.vue

@@ -29,7 +29,7 @@
         <div style="margin-top: 22%;">
         <div style="margin-top: 22%;">
           <span>图片:</span>
           <span>图片:</span>
           <span style="height: 200px;white-space: normal;overflow: hidden scroll;">
           <span style="height: 200px;white-space: normal;overflow: hidden scroll;">
-            <span v-for="(e,idx) in info.imgList" :key="idx" @click="downloadImg(e.name,e.url)" :href="e.url" download>{{ e.name }}</span>
+            <img v-for="(e,idx) in info.attachPaths" :key="idx" :src="e" style="width: 100px;height: 100px;">
           </span>
           </span>
         </div>
         </div>
         <div style="margin-top: 22%;">
         <div style="margin-top: 22%;">

+ 96 - 50
src/views/forest.vue

@@ -230,7 +230,7 @@
           </div>
           </div>
         </div>
         </div>
 
 
-        <!-- 设备列表 -->
+        <!-- 企业信息列表 -->
         <div class="container1">
         <div class="container1">
           <div class="topBar">企业信息</div>
           <div class="topBar">企业信息</div>
           <!-- 输入框 -->
           <!-- 输入框 -->
@@ -239,12 +239,23 @@
           <!-- 菜单 -->
           <!-- 菜单 -->
           <div class="mainContainer">
           <div class="mainContainer">
             <!-- 列表 -->
             <!-- 列表 -->
-            <div class="listItem" v-for="(e,idx) in regulatoryinformation" :key="idx" @click="showTvWall(e)">
+            <div class="listItem" v-for="(e,idx) in regulatoryinformation" :key="idx" @click="showCompanyDialog(e)">
                 <div class="itemArea">
                 <div class="itemArea">
                     <h4>{{ e.infoTitle }}</h4>
                     <h4>{{ e.infoTitle }}</h4>
                 </div>
                 </div>
             </div>
             </div>
           </div>
           </div>
+          
+        </div>
+
+        <!--分页-->
+        <div class="paging comPaging">
+          <el-button type="button" @click="getSelectRegulatoryinformationByEnterpriseId(10,regulatoryinformationQueryParams.pageNum-1)">上一页
+          </el-button>
+          <span style="position: relative;bottom: 10%;">第{{ regulatoryinformationQueryParams.pageNum }}页</span>
+          <el-button type="button" :disabled="companyInfoNextbutton"
+                    @click="getSelectRegulatoryinformationByEnterpriseId(10,regulatoryinformationQueryParams.pageNum+1)">下一页
+          </el-button>
         </div>
         </div>
       </div>
       </div>
       <vBottomMenu ref="bottomMenu" @stopAudio="stopAudio"></vBottomMenu>
       <vBottomMenu ref="bottomMenu" @stopAudio="stopAudio"></vBottomMenu>
@@ -285,7 +296,8 @@
     initByCameras,
     initByCameras,
     enterpriseList,
     enterpriseList,
     enterpriseById,
     enterpriseById,
-    selectRegulatoryinformationByEnterpriseId
+    selectRegulatoryinformationByEnterpriseId,
+    getRegulatoryinformation
   } from '@/api/forest';
   } from '@/api/forest';
   import {
   import {
     getMonitorDeviceAndDataList,
     getMonitorDeviceAndDataList,
@@ -487,6 +499,8 @@
           infoTitle: null,
           infoTitle: null,
           enterpriseId: null,
           enterpriseId: null,
         },
         },
+
+        companyInfoNextbutton:false
       }
       }
     },
     },
     /** ----------------------------------weosocket开始------------------------------------- */
     /** ----------------------------------weosocket开始------------------------------------- */
@@ -504,10 +518,49 @@
     },
     },
     /** ----------------------------------weosocket结束------------------------------------- */
     /** ----------------------------------weosocket结束------------------------------------- */
     methods: {
     methods: {
+      // 获取企业信息列表
+      getSelectRegulatoryinformationByEnterpriseId(pageSize, pageNum) {
+        if (pageNum < 1) {
+          this.$modal.msg('当前已是第一页')
+          return
+        } else if (pageNum > this.totalAllEvent / 10 + 1) {
+          this.$modal.msg('当前已是最后一页')
+          return
+        }
+        this.regulatoryinformationQueryParams.pageSize = pageSize
+        this.regulatoryinformationQueryParams.pageNum = pageNum
+
+        selectRegulatoryinformationByEnterpriseId(this.regulatoryinformationQueryParams).then(res => {
+          if (res.rows !== null && res.rows.length !== 0 && res.rows.length == 10) {
+            this.companyInfoNextbutton = false
+          } else {
+            this.companyInfoNextbutton = true
+          }
+          this.regulatoryinformation = res.rows
+        })
+      },
+      showCompanyDialog(e){
+        getRegulatoryinformation(e.id).then(res => {
+            // 处理图片路径
+            let attachPaths
+            if(res.data.attachPaths){
+              attachPaths = res.data.attachPaths.split(",")
+            }
+            let detailInfo = {
+              title:res.data.infoTitle || '',
+              unit:res.data.infoTitle || '',
+              content:res.data.infoContent || '',
+              attachPaths,
+              videos:[],
+              others:[]
+            }
+            this.$refs.companyProjectDialog.open(detailInfo)
+        })
+      },
       /**
       /**
        * 企业列表接口
        * 企业列表接口
        */
        */
-      enterpriseList(pageSize, pageNum){
+      enterpriseList(pageSize, pageNum=1){
         if (pageNum < 1) {
         if (pageNum < 1) {
           this.$modal.msg('当前已是第一页')
           this.$modal.msg('当前已是第一页')
           return
           return
@@ -522,23 +575,6 @@
           this.totalAllCompany = res.total
           this.totalAllCompany = res.total
         })
         })
       },
       },
-
-      showCompanyDialog(e){
-        let detailInfo = {
-          title:'测试标题',
-          unit:'林业',
-          content:'测试内容测试内容测试内容测试内容测试内容测试内容测试内容测试内容',
-          imgList:[
-            {
-              name:'测试',
-              url:'https://img.picui.cn/free/2025/06/24/685a087ac3880.jpg'
-            }
-          ],
-          videos:[],
-          others:[]
-        }
-        this.$refs.companyProjectDialog.open(detailInfo)
-      },
       // 查询收藏列表
       // 查询收藏列表
       getCompanyList(pageSize, pageNum) {
       getCompanyList(pageSize, pageNum) {
       },
       },
@@ -578,7 +614,12 @@
             that.$refs.supermap.setMarkers(that.cameraMarkersList);
             that.$refs.supermap.setMarkers(that.cameraMarkersList);
           }, 3000);
           }, 3000);
         })
         })
-        that.regulatoryinformationQueryParams.enterpriseId = e.id
+        that.regulatoryinformationQueryParams = {
+          pageNum: 1,
+          pageSize: 10,
+          infoTitle: null,
+          enterpriseId: e.id,
+        },
         selectRegulatoryinformationByEnterpriseId(that.regulatoryinformationQueryParams).then(res => {
         selectRegulatoryinformationByEnterpriseId(that.regulatoryinformationQueryParams).then(res => {
           that.regulatoryinformation = res.rows
           that.regulatoryinformation = res.rows
         })
         })
@@ -903,7 +944,7 @@
     height: 100%;
     height: 100%;
     padding-left:10px;
     padding-left:10px;
     ::v-deep .el-button{
     ::v-deep .el-button{
-      width: 80%;
+      width: 70px;
       height: 100%;
       height: 100%;
       margin-left: 0 !important;
       margin-left: 0 !important;
       >span{
       >span{
@@ -926,39 +967,44 @@
       height: 70%;
       height: 70%;
       cursor: pointer;
       cursor: pointer;
     }
     }
+  }
 
 
-    .paging {
-      height: 4%;
-      padding: 0rem .3rem;
-      display: flex;
-      justify-content: center;
-      align-content: center;
+  .paging {
+    height: 4%;
+    padding: 0rem .3rem;
+    display: flex;
+    justify-content: center;
+    align-content: center;
 
 
-      span {
-        color: #2bacf7;
-        display: flex;
-        align-items: center;
-        padding: 0 1rem;
-      }
+    span {
+      color: #2bacf7;
+      display: flex;
+      align-items: center;
+      padding: 0 1rem;
+    }
 
 
-      button {
-        width: 70px;
-        padding: 0 0.3rem;
-        height: 1.5rem;
-        background-color: #112543;
-        color: #2bacf7;
-        border: 1px solid #33467f;
-      }
+    button {
+      width: 70px;
+      padding: 0 0.3rem;
+      height: 1.5rem;
+      background-color: #112543;
+      color: #2bacf7;
+      border: 1px solid #33467f;
+    }
 
 
-      button:hover {
-        padding: 0 0.3rem;
-        height: 1.5rem;
-        background-color: #112543;
-        color: #0ff7c5;
-        border: 1px solid #1d657f;
-      }
+    button:hover {
+      padding: 0 0.3rem;
+      height: 1.5rem;
+      background-color: #112543;
+      color: #0ff7c5;
+      border: 1px solid #1d657f;
     }
     }
   }
   }
+  .comPaging{
+    position: absolute;
+    bottom: 0%;
+    right: 5%;
+  }
 
 
   .thirdInputModel{
   .thirdInputModel{
     margin-top: 10px;
     margin-top: 10px;