无人机管理后台前端(已迁走)
张含笑
2025-09-15 c1adad71a3823c95c782a298ef30cf23e6abc8a6
feat:事件工单跳转
2 files modified
47 ■■■■ changed files
src/views/tickets/ticket.vue 23 ●●●● patch | view | raw | blame | history
src/views/wel/components/proportionStatic.vue 24 ●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -1191,7 +1191,7 @@
    }
    let curQueryParams = {};
    let isTabProcessed = false;
    if (href.indexOf('?') != -1 && href.split('?').length > 0) {
      curQueryParams = href
        .split('?')[1]
@@ -1204,7 +1204,7 @@
          return pre;
        }, {});
      const { orderNumber = undefined, day = undefined } = curQueryParams;
      const { orderNumber = undefined, day = undefined, tab = undefined } = curQueryParams;
      // 日历传值
      if (day) {
@@ -1233,6 +1233,14 @@
          find && (find.query = {});
        });
      }
        if (tab) {
      const isTabValid = this.filteredTabs.some(t => t.name === tab);
      if (isTabValid) {
        this.activeTab = tab;
        this.handleTabChangeAfterJump();
        isTabProcessed = true;
      }
    }
    }
    this.fetchTabCounts(); // 新增:初始化时获取 tab 数据
@@ -2033,7 +2041,6 @@
    handleTabChange(tab) {
      this.activeTab = tab.props?.name || tab.name;
      const isReview = this.findObject(this.option.column, 'isReview');
      // 根据条件切换显隐
      isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
@@ -2043,7 +2050,15 @@
      this.fetchTableData();
      this.fetchTabCounts(); // 切换 tab 时重新获取数据
    },
    //新增 跳转后触发的Tab切换
handleTabChangeAfterJump() {
    const isReview = this.findObject(this.option.column, 'isReview');
    isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
    this.handleReset();
    this.page.currentPage = 1;
    this.fetchTableData();
    this.fetchTabCounts();
  },
    handleSearch() {
      this.page.currentPage = 1;
      this.fetchTableData();
src/views/wel/components/proportionStatic.vue
@@ -13,7 +13,7 @@
          :key="index"
          @click="timeClick(item, index)"
        >
          {{ timeListStr[index] }}
          {{ timeListStr[index] }}
        </div>
      </div>
    </div>
@@ -21,7 +21,7 @@
      <div class="card-group">
        <div class="main-card">
          <div class="status-grid">
            <div class="status-item" v-for="(item, index) in eventTypeList" :key="index">
            <div class="status-item" v-for="(item, index) in eventTypeList" :key="index" @click="jumpEventDetails(item,index)">
              <div class="statusCon">
                <div class="status-label">{{ item.name }}</div>
                <div class="status-value">{{ item.value }}<span>个</span></div>
@@ -51,6 +51,8 @@
import overviewImg3 from '@/assets/images/workbench/tc3.svg';
import overviewImg4 from '@/assets/images/workbench/tc4.svg';
import overviewImg5 from '@/assets/images/workbench/tc5.svg';
import { useRouter } from 'vue-router'
const router = useRouter()
let checked = ref('CURRENT_YEAR');
let timeListStr = ['本周', '本月', '本年'];
let timeListEnum = ['CURRENT_WEEK', 'CURRENT_MONTH', 'CURRENT_YEAR'];
@@ -62,10 +64,10 @@
});
const dateSelect = ref('CURRENT_YEAR');
const eventTypeList = ref([
  { name: '待审核', value: 0, img: overviewImg2, color: '#FF472F', status: '2', rate: 0 },
  { name: '待处理', value: 0, img: overviewImg3, color: '#FF7411', status: '0', rate: 0 },
  { name: '处理中', value: 0, img: overviewImg4, color: '#FFC300', status: '3', rate: 0 },
  { name: '已完成', value: 0, img: overviewImg5, color: '#0291A1', status: '4', rate: 0 },
  { name: '待审核', value: 0, img: overviewImg2, color: '#FF472F', status: '2', rate: 0 ,tagging:'pending' },
  { name: '待处理', value: 0, img: overviewImg3, color: '#FF7411', status: '0', rate: 0 ,tagging:'processing' },
  { name: '处理中', value: 0, img: overviewImg4, color: '#FFC300', status: '3', rate: 0 ,tagging:'inProgress'},
  { name: '已完成', value: 0, img: overviewImg5, color: '#0291A1', status: '4', rate: 0 ,tagging:'completed'},
]);
//  工单统计
const getTypeData = () => {
@@ -95,6 +97,14 @@
  dateSelect.value = item;
  getTypeData();
};
// 跳转事件工单
const jumpEventDetails = (item,index)=>{
// console.log('tiaozhuan',item);
  router.replace({
    path: `/tickets/ticket`,
    query: { tab: item.tagging }
  });
}
// 图表
const echartsRef = ref(null);
let { chart } = useEchartsResize(echartsRef);
@@ -250,7 +260,7 @@
          width: 144px;
          background: #f6f8fe;
          border-radius: 8px 8px 8px 8px;
          cursor: pointer;
          img {
            width: 26px;
            height: 26px;