无人机管理后台前端(已迁走)
张含笑
2025-05-14 e2264ddf3d031004194ebc787ac8c416573c6be2
src/views/wel/components/backlog.vue
@@ -39,7 +39,6 @@
<script setup>
import st7 from '@/assets/images/workbench/st7.png';
import { getdaiban } from '@/api/home/index';
import { onMounted } from 'vue';
import { useRouter } from 'vue-router';
@@ -49,7 +48,7 @@
const permission = computed(() => store.getters.permission);
const userInfo = computed(() => store.getters.userInfo)
const todos = ref([]);
const loading = ref(false);
const statusMap = {
  0: '待处理',
  2: '待审核',
@@ -95,19 +94,32 @@
    return statusMapColor[statusIndex]?.color || '#999';
  }
};
const getListMatter = async () => {
  // console.log('permission.value.o_and_m_p_jump', permission.value.o_and_m_p_jump);
  if (permission.value.o_and_m_p_jump === true) {
    const res = await getdaiban(0,userInfo.value.detail.areaCode);
    todos.value = res.data.data?.slice(0, 5);
  } else {
    const res = await getdaiban(1,userInfo.value.detail.areaCode);
    todos.value = res.data.data?.slice(0, 5);
const isDataReady = computed(() => {
  return userInfo.value.detail?.areaCode && permission.value.o_and_m_p_jump;
});
const autoFetchData = () => {
  if (isDataReady.value) {
    getListMatter();
  }
};
watch(
  () => [userInfo.value.detail?.areaCode, permission.value.o_and_m_p_jump],
  () => autoFetchData(),
  { immediate: true }
);
const getListMatter = async () => {
  loading.value = true;
  try {
    if (permission.value.o_and_m_p_jump === true) {
      const res = await getdaiban(0, userInfo.value.detail.areaCode);
      todos.value = res.data.data?.slice(0, 5) || [];
      loading.value = false;
    } else {
      const res = await getdaiban(1, userInfo.value.detail.areaCode);
      todos.value = res.data.data?.slice(0, 5) || [];
      loading.value = false;
    }
  } catch (error) {}
};
const jumporder = val => {
  if (permission.value.o_and_m_p_jump === true) {
@@ -129,7 +141,7 @@
  }
};
onMounted(() => {
  getListMatter();
  autoFetchData();
});
</script>