2545307760@qq.com 4 місяців тому
батько
коміт
618dd8d0d2
2 змінених файлів з 69 додано та 25 видалено
  1. 3 2
      web/src/api/device.js
  2. 66 23
      web/src/view/parking/parkingInfo.vue

+ 3 - 2
web/src/api/device.js

@@ -35,10 +35,11 @@ export const obtainDeviceCode = (code) => {
 }
 
 // 获取设备列表
-export const obtainDeviceList = () => {
+export const obtainDeviceList = (params) => {
     return service({
         url: '/parking/device/list',
-        method: 'get'
+        method: 'get',
+        params
     })
 }
 

+ 66 - 23
web/src/view/parking/parkingInfo.vue

@@ -47,7 +47,7 @@
               <el-button icon="Refresh" text type="primary">刷新</el-button>
             </el-form-item>
           </el-form>
-          <el-table size="small" :data="positionList" height="680px">
+          <el-table size="small" :data="positionList" height="605">
             <el-table-column label="编码" align="center" width="100" prop="booth_code"></el-table-column>
             <el-table-column label="名称" align="center" width="250" prop="booth_name"></el-table-column>
             <el-table-column label="IP地址" align="center" width="250" prop="ip_address"></el-table-column>
@@ -72,16 +72,16 @@
             </el-table-column>
           </el-table>
           <div style="width: 100%;display: flex;justify-content: end">
-<!--            <el-pagination-->
-<!--                :current-page="obtainData.page"-->
-<!--                :page-size="obtainData.pageSize"-->
-<!--                :page-sizes="[10, 30, 50, 100]"-->
-<!--                :total="carOwnerTotal"-->
-<!--                layout="total, sizes, prev, pager, next, jumper"-->
-<!--                @current-change="handleCurrentChange"-->
-<!--                @size-change="handleSizeChange"-->
-<!--                style="padding-right: 10px"-->
-<!--            />-->
+            <el-pagination
+                :current-page="searchGuardBooth.page"
+                :page-size="searchGuardBooth.page_size"
+                :page-sizes="[10, 30, 50, 100]"
+                :total="guardTotal"
+                layout="total, sizes, prev, pager, next, jumper"
+                @current-change="handleCurrentChange"
+                @size-change="handleSizeChange"
+                style="padding-right: 10px"
+            />
           </div>
         </el-tab-pane>
         <el-tab-pane
@@ -102,7 +102,7 @@
               <el-button icon="Refresh" text type="primary">刷新</el-button>
             </el-form-item>
           </el-form>
-          <el-table size="small" :data="channelList">
+          <el-table size="small" :data="channelList" height="605">
             <el-table-column label="编码" align="center" width="100"></el-table-column>
             <el-table-column label="名称" align="center" width="250"></el-table-column>
             <el-table-column label="进出方向" align="center" width="150"></el-table-column>
@@ -113,6 +113,18 @@
               <el-button type="primary" icon="delete" text>删除</el-button>
             </el-table-column>
           </el-table>
+          <div style="width: 100%;display: flex;justify-content: end">
+            <el-pagination
+                :current-page="queryChannelData.page"
+                :page-size="queryChannelData.page_size"
+                :page-sizes="[10, 30, 50, 100]"
+                :total="guardTotal"
+                layout="total, sizes, prev, pager, next, jumper"
+                @current-change="handleCurrentChannel"
+                @size-change="handleSizeChannel"
+                style="padding-right: 10px"
+            />
+          </div>
         </el-tab-pane>
         <el-tab-pane
             label="设备"
@@ -132,7 +144,7 @@
               <el-button icon="Refresh" text type="primary">刷新</el-button>
             </el-form-item>
           </el-form>
-          <el-table size="small" :data="deviceList">
+          <el-table size="small" :data="deviceList" height="605">
             <el-table-column label="编码" align="center" width="100" prop="device_code"></el-table-column>
             <el-table-column label="名称" align="center" width="250" prop="device_name"></el-table-column>
             <el-table-column label="类别" align="center" width="150" prop="device_type"></el-table-column>
@@ -281,6 +293,7 @@ const positionData = reactive({
   ip_address:'',
   description:''
 })
+const guardTotal = ref(0)
 
 const positionList = reactive([])
 const addPosition = () => {
@@ -320,10 +333,23 @@ const openPosition = (head,data) => {
   }
 }
 const searchGuardBooth = reactive({
-
+  booth_code: '',
+  booth_name: '',
+  page: 1,
+  page_size: 10
 })
+const handleCurrentChange = (val) => {
+  searchGuardBooth.page = val
+  getGuardBoothList()
+}
+
+const handleSizeChange = (val) => {
+  searchGuardBooth.page_size = val
+  searchGuardBooth.page = 1
+  getGuardBoothList()
+}
 const getGuardBoothList = () => {
-  obtainGuardBoothList().then(res => {
+  obtainGuardBoothList(searchGuardBooth).then(res => {
     if (res.code === 0) {
       positionList.length = 0
       positionList.push(...res.data.list)
@@ -389,6 +415,7 @@ const channelTitle = ref('通道新增')
 
 const channelList = reactive([])
 
+
 const openChannel = (head,data) => {
   channelTitle.value = head
   channelShow.value = true
@@ -426,12 +453,20 @@ const channelOperation = () => {
     })
   }
 }
+const handleCurrentChannel = (val) => {
+  queryChannelData.page = val
+  getChannelList()
+}
 
+const handleSizeChannel = (val) => {
+  queryChannelData.page_size = val
+  queryChannelData.page = 1
+  getChannelList()
+}
 const getChannelList = () => {
   obtainChannelList(queryChannelData).then(res => {
     if (res.code === 0) {
       channelList.length = 0
-      console.log('数据', res.data)
       channelList.push(...res.data.list)
     }
   })
@@ -472,14 +507,22 @@ const confirmType = () => {
   }
 }
 
+const searchDeviceData = reactive({
+  device_code: '',
+  device_name: '',
+  device_type: '',
+  status: '',
+  page: 1,
+  page_size: 10
+})
 const getDeviceList = async () => {
-  await obtainDeviceList().then(res => {
-    if (res.code === 0) {
-      console.log('设备列表', res.data.list)
-      deviceList.length = 0
-      deviceList.push(...res.data.list)
-    }
-  })
+  // await obtainDeviceList(searchDeviceData).then(res => {
+  //   if (res.code === 0) {
+  //     console.log('设备列表', res.data.list)
+  //     deviceList.length = 0
+  //     deviceList.push(...res.data.list)
+  //   }
+  // })
 }
 
 onMounted(() => {