无人机管理后台前端(已迁走)
rain
2025-04-17 8a670dd22edef28d9c598712dfc88f4bd9a4dbed
优化tab栏我发起的数据交给后端处理,优化分页展示
1 files modified
18 ■■■■■ changed files
src/views/tickets/ticket.vue 18 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -601,7 +601,6 @@
    this.fetchTabCounts(); // 新增:初始化时获取 tab 数据
    console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn);
    console.log('permission', this.permission.tickets_tab_pending);
    console.log('权限检查:', this.permission);
  },
  mounted() {
    this.fetchTableData();
@@ -900,7 +899,8 @@
          size: Number(this.page.pageSize),       // 使用每页条数
          ai_type: this.filters.algorithm || undefined, // 添加算法参数
          // 添加 is_draft 参数,仅在"我发起的"标签页时设置为1
          is_draft: currentTab?.name === 'myTickets' ? 1 : undefined
          is_draft: currentTab?.name === 'myTickets' ? 1 : undefined,
          user_id: currentTab?.name === 'myTickets' ? this.userInfo.user_id : undefined,
        };
        const response = await getList(params);
@@ -912,11 +912,11 @@
        let filteredRecords = records;
        // 如果是"我发起的"tab,过滤数据
        if (currentTab?.name === 'myTickets') {
          filteredRecords = records.filter(item =>
            String(item.create_user_id) === String(item.user_id)
          );
        }
        // if (currentTab?.name === 'myTickets') {
        //   filteredRecords = records.filter(item =>
        //     String(item.create_user_id) === String(item.user_id)
        //   );
        // }
        this.tableData = filteredRecords.map(item => {
          const longitude = Number(item.longitude) || 0;
@@ -948,11 +948,7 @@
        });
        // 更新总数显示
        if (currentTab?.name === 'myTickets') {
          this.page.total = filteredRecords.length;
        } else {
          this.page.total = total || 0;
        }
        await this.fetchTabCounts();
      } catch (error) {