riku
2025-07-29 056ea576d820729878ffd62cd54cd7598e72d07e
src/views/overlay-clue/list/ClueManage.vue
@@ -13,11 +13,20 @@
        >拉取线索</el-button
      >
    </div>
    <el-scrollbar height="70vh" class="p-h-1">
      <ClueList
        :dataList="clueList"
        @itemSelected="selectClue"
      ></ClueList>
    <el-scrollbar height="70vh" class="p-h-1" v-loading="loading">
      <ClueList :dataList="clueList" @itemSelected="selectClue">
      </ClueList>
    </el-scrollbar>
    <el-scrollbar v-show="showPage" class="p-8">
      <el-pagination
        size="small"
        v-model:current-page="currentPage"
        v-model:page-size="pageSize"
        :page-sizes="[10, 20, 50, 100]"
        :background="true"
        layout="total, sizes, pager"
        :total="total"
      />
    </el-scrollbar>
  </div>
</template>
@@ -28,7 +37,7 @@
import clueApi from '@/api/clue/clueApi';
import { onMapMounted } from '@/components/map/baseMap';
import moment from 'moment';
import { ref, onMounted } from 'vue';
import { ref, onMounted, reactive, watch } from 'vue';
const emits = defineEmits('itemSelected');
@@ -36,11 +45,24 @@
const updateTime = ref();
// 线索清单
const clueList = ref([]);
const currentPage = ref(1);
const pageSize = ref(50);
const total = ref(0);
const showPage = ref(true);
const loading = ref(false);
watch([currentPage, pageSize], (nV, oV) => {
  if (nV[0] != oV[0] || nV[1] != oV[1]) {
    getClues();
  }
});
/**
 * 查询已下发的线索清单
 */
const getClues = function () {
  showPage.value = true;
  loading.value = true;
  let sTime;
  let eTime;
  if (updateTime.value) {
@@ -49,18 +71,32 @@
    eTime = now.add(1, 'month').format('YYYY-MM-DD HH:mm:ss');
  }
  onMapMounted(() => {
    clueApi.getClue({ sTime, eTime }).then((res) => {
      clueList.value = res;
    });
    clueApi
      .getClue({
        sTime,
        eTime,
        pageNum: currentPage.value,
        pageSize: pageSize.value
      })
      .then((res) => {
        total.value = res.head.totalCount;
        clueList.value = res.data;
      })
      .finally(() => (loading.value = false));
  });
};
function fetchRemoteClue() {
  showPage.value = false;
  loading.value = true;
  const time = moment(updateTime.value).format('YYYY-MM-DD HH:mm:ss');
  onMapMounted(() => {
    clueApi.fetchRemoteClue(time).then((res) => {
      clueList.value = res;
    });
    clueApi
      .fetchRemoteClue(time)
      .then((res) => {
        clueList.value = res;
      })
      .finally(() => (loading.value = false));
  });
}
@@ -75,6 +111,4 @@
  getClues();
});
</script>
<style scoped>
</style>
<style scoped></style>