<template>
  <div style="padding-top: 14vw">
    <TopNav navTitle="已处理任务" :showRight="false" :showLeft="true" />
    <div class="rw_list_box" v-for="item in list" :key="item.id">
      <SwiperCell :item="item" :dict="{ D_BZ_GRRWZT }"></SwiperCell>
    </div>
    <van-empty description="暂无信息" image="default" v-if="showEmpty" />
  </div>
</template>

<script setup>
import SwiperCell from "../../components/swiperCell.vue";
import TopNav from "../../components/topNav.vue";
import { getYclTaskList } from "../../api/ldjsc.js";
import { onMounted, ref } from "vue";
import { getDictList } from "../../utils/dict";
const { D_BZ_GRRWZT } = getDictList("D_BZ_GRRWZT");
const list = ref([]);
const showEmpty = ref(false);
const queryLsit = ref({
  pageCurrent: 1,
  pageSize: 20,
});
function getList() {
  getYclTaskList(queryLsit.value)
    .then((res) => {
      if (res && res.records.length > 0) {
        list.value = res.records;
      } else {
        showEmpty.value = true;
      }
    })
    .catch((err) => {
      showEmpty.value = true;
    });
}
onMounted(() => {
  getList();
});
</script>

<style lang="scss" scoped>
@import "../../assets/styles/mixin.scss";
.rw_list_box {
  padding: 3vw 0;
  margin: 0 3vw;
  @include font_size($font_medium_s);
  @include font_color($font-color-theme);
  @include item_bottom_color($bottom-border-top-clore-theme);
}
</style>