he wei
2025-04-23 b9bd29a1a81f6f7de479e3cc3fdfe3d85fc660bf
src/views/general/log/index.vue
@@ -9,19 +9,22 @@
   import useElement from "@/hooks/useElement.js";
   const { $loading, $message, $confirm } = useElement();
     import useStation from "@/hooks/useStationList.js";
   const { stationName1, stationName2, stationName3, stationName4,
      stationList1, stationList2, stationList3, stationList4, lockList
   } = useStation();
   const tableData = ref([]);
   const ctlUname = ref('');
   const ctlResult = ref('');
   const startTime = ref('');
   const endTime = ref('');
   const lockId = ref('');
   const lockName = ref('');
   const ctlType = ref('');
   const pageNum = ref(1);
   const pageSize = ref(10);
   const total = ref(0);
   const currentAreaId = ref();
   const lockList = ref([]);
   const userList = ref([]);
   const logList = ref([]);
@@ -38,39 +41,21 @@
      'ID开锁'
   ];
   function itemClickHandler(item) {
      console.log(item, '====item', item.data);
      // areaId lockName lockState lockType pageNum pageSize
      currentAreaId.value = item.data.id;
      ctlUname.value = '';
      lockId.value = '';
      getUsers();
      getLockList();
      getList();
   }
   async function getLockList() {
      let res = await getLinfById(currentAreaId.value);
      let { code, data, data2 } = res;
      let _list = [];
      if (code && data) {
         _list = data2;
      }
      lockList.value = _list;
   }
   async function getList() {
      let params = {
         areaId: currentAreaId.value,
         ctlUname: ctlUname.value || undefined,
         ctlResult: ctlResult.value || undefined,
         startTime: startTime.value || undefined,
         endTime: endTime.value || undefined,
         ctlType: ctlType.value || undefined,
         lockId: lockId.value || undefined
         lockName: lockName.value || undefined,
      pageNum: pageNum.value,
      pageSize: pageSize.value
      };
      let res = await getLockLog(pageNum.value, pageSize.value, params);
      let res = await getLockLog(params);
      let { code, data, data2 } = res;
      let _total = 0;
      let _list = [];
@@ -88,15 +73,15 @@
      logList.value = _list;
   }
   async function getUsers() {
      let res = await getUinfById(currentAreaId.value);
      let { code, data, data2 } = res;
      let _list = [];
      if (code && data) {
         _list = data2;
      }
      userList.value = _list;
   }
   // async function getUsers() {
   //    let res = await getUinfById(currentAreaId.value);
   //    let { code, data, data2 } = res;
   //    let _list = [];
   //    if (code && data) {
   //       _list = data2;
   //    }
   //    userList.value = _list;
   // }
   function handleSizeChange(params) {
      pageSize.value = params
@@ -109,7 +94,7 @@
   }
   onMounted(() => {
    getList();
   });
</script>
@@ -117,18 +102,18 @@
<template>
  <div class="page-wrapper">
    <div class="page-header">
      <div class="hdw-card-container">
        <hdw-card title="区域列表" is-full>
      <!-- <div class="hdw-card-container">
        <yc-card title="区域列表" is-full>
          <hdw-tree @item-click="itemClickHandler"></hdw-tree>
        </hdw-card>
      </div>
        </yc-card>
      </div> -->
    </div>
    <div class="page-content">
      <hdw-card is-full>
      <yc-card is-full>
        <div class="page-content-wrapper">
          <div class="page-content-tools">
            <div class="tools-filter">
              <div class="tools-filter-item">
              <!-- <div class="tools-filter-item">
                <div class="filter-label">操作人</div>
                <div class="filter-content">
                  <el-select v-model="ctlUname" clearable placeholder="请选择" size="small" filterable style="width: 180px"
@@ -137,7 +122,7 @@
                      :value="item" />
                  </el-select>
                </div>
              </div>
              </div> -->
              <div class="tools-filter-item">
                <div class="filter-label">操作时间</div>
                <div class="filter-content">
@@ -156,23 +141,61 @@
                </div>
              </div>
              <div class="tools-filter-item">
                <div class="filter-label">锁具</div>
                <div class="filter-label">省:</div>
                <div class="filter-content">
                  <el-select v-model="lockId" @change="getList" clearable filterable placeholder="请选择" size="small"
                  <el-select v-model="stationName1" clearable  placeholder="请选择" @change="() => nextTick(() => sendMessage())" size="small"
                    style="width: 180px">
                    <el-option v-for="item in lockList" :key="'lock_' + item.lockId" :label="item.lockName"
                      :value="item.lockId" />
                    <el-option v-for="(item, idx) in stationList1" :key="'province_' + idx" :label="item" :value="item" />
                  </el-select>
                </div>
              </div>
              <div class="tools-filter-item">
                <div class="filter-label">市:</div>
                <div class="filter-content">
                  <el-select v-model="stationName2" clearable  placeholder="请选择" @change="() => nextTick(() => sendMessage())" size="small"
                    style="width: 180px">
                    <el-option v-for="(item, idx) in stationList2" :key="'city_' + idx" :label="item" :value="item" />
                  </el-select>
                </div>
              </div>
              <div class="tools-filter-item">
                <div class="filter-label">区县:</div>
                <div class="filter-content">
                  <el-select v-model="stationName3" clearable placeholder="请选择" @change="() => nextTick(() => sendMessage())" size="small"
                    style="width: 180px">
                    <el-option v-for="(item, idx) in stationList3" :key="'list2_' + idx" :label="item" :value="item" />
                  </el-select>
                </div>
              </div>
              <div class="tools-filter-item">
                <div class="filter-label">机房:</div>
                <div class="filter-content">
                  <el-select v-model="stationName4" clearable placeholder="请选择" @change="() => nextTick(() => sendMessage())" size="small"
                    style="width: 180px">
                    <el-option v-for="(item, idx) in stationList4" :key="'list3_' + idx" :label="item" :value="item" />
                  </el-select>
                </div>
              </div>
              <div class="tools-filter-item">
                <div class="filter-label">锁具</div>
                <div class="filter-content">
                  <el-select v-model="lockName" @change="getList" clearable filterable placeholder="请选择" size="small"
                    style="width: 180px">
                    <el-option v-for="item in lockList" :key="'lock_' + item.lockId" :label="item.lockName"
                      :value="item.lockName" />
                  </el-select>
                </div>
              </div>
              <div class="tools-filter-item">
                <el-button type="primary" size="small" :icon="Search" @click="getList">查询</el-button>
              </div>
            </div>
            <el-button type="primary" size="small" :icon="Search" @click="getList">查询</el-button>
          </div>
          <div class="page-content-table">
            <div class="pos-rel">
              <div class="pos-abs">
                <el-table :data="logList" border style="width: 100%; height: 100%">
                  <el-table-column type="index" width="50" />
                  <el-table-column type="index" fixed="left" width="50" />
                  <!-- <el-table-column prop="areaName" align="center" label="区域名称" width="180" /> -->
                  <el-table-column prop="ctlUname" align="center" label="操作人" width="120" />
                  <!-- <el-table-column prop="keyName" align="center" label="钥匙名称" width="120" /> -->
@@ -196,7 +219,7 @@
            <div class="page-tool"></div>
          </div>
        </div>
      </hdw-card>
      </yc-card>
    </div>
    <div class="page-footer"></div>
  </div>
@@ -273,6 +296,7 @@
  .tools-filter-item {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    .filter-label {
      display: inline-block;