无人机管理后台前端(已迁走)
张含笑
2025-11-22 41d1f2c058ff2802f7df15e181c9eaf1c280ecf8
feat:删除无用按钮
1 files modified
52 ■■■■■ changed files
src/views/tickets/ticket.vue 52 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -514,7 +514,6 @@
})
 // 动态过滤tabs,保证isShow为true/false
 const filteredTabs = computed(() => {
  const tabStatus = permission.value?.tickets_tab_status === true
  const tabPending = permission.value?.tickets_tab_pending === true//待审核
  const tabMyTickets = permission.value?.tickets_tab_mytickets === true  //我的工单
  const tabALL = permission.value?.tickets_allWorkOrders === true //全部工单
@@ -578,12 +577,12 @@
});
const stepStatusList = computed(() => {
// “我发起的工单”tab用默认流程,其它tab用接口返回的stepInfos
  if (activeTab.value === 'myTickets') {
    if (workType.value === 1) {
      return ['3', '4']
    }
    return fixedStatuses.value
  }
  // if (activeTab.value === 'myTickets') {
  //   if (workType.value === 1) {
  //     return ['3', '4']
  //   }
  //   return fixedStatuses.value
  // }
   // 其它tab直接用接口返回的stepInfos
  return stepInfos.value.map(step => String(step.status))
})
@@ -979,29 +978,42 @@
    const steps = Array.isArray(stepResponse.data.data)
      ? stepResponse.data.data
      : stepResponse.data.data?.steps || []
    console.log('steps',steps);
    
    const finishedStep = steps.find(s => String(s.status) === '4')
    totalTime.value = finishedStep && finishedStep.total_time ? finishedStep.total_time : ''
    
    if (activeTab.value !== 'myTickets') {
    // if (activeTab.value !== 'myTickets') {
    //   stepInfos.value = steps.map(step => ({
    //     status: String(step.status),
    //     name: step.name,
    //     time: step.time,
    //     create_time: step.create_time,
    //   }))
    // } else {
      // const statusArr = workType.value === 1 ? ['3', '4'] : fixedStatuses.value
      // stepInfos.value = statusArr.map(status => {
      //   const step = steps.find(s => String(s.status) === String(status))
      //   return {
      //     status,
      //     name: step ? step.name : '',
      //     time: step ? step.time : null,
      //     create_time: step ? step.create_time : null,
      //   }
      // })
    //     stepInfos.value = steps.map(step => ({
    //     status: String(step.status),
    //     name: step.name,
    //     time: step.time,
    //     create_time: step.create_time,
    //   }))
    // }
      stepInfos.value = steps.map(step => ({
        status: String(step.status),
        name: step.name,
        time: step.time,
        create_time: step.create_time,
      }))
    } else {
      const statusArr = workType.value === 1 ? ['3', '4'] : fixedStatuses.value
      stepInfos.value = statusArr.map(status => {
        const step = steps.find(s => String(s.status) === String(status))
        return {
          status,
          name: step ? step.name : '',
          time: step ? step.time : null,
          create_time: step ? step.create_time : null,
        }
      })
    }
    return true
  } catch (error) {
    console.error('获取步骤信息失败:', error)