无人机管理后台前端(已迁走)
rain
2025-04-19 d0f544fdcbc492af02dacb360c7a8c6c3b230420
优化流程和文字高亮状态
1 files modified
43 ■■■■■ changed files
src/views/tickets/ticket.vue 43 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -160,11 +160,13 @@
        <div class="custom-steps-container">
          <!-- 标题行 -->
          <div class="steps-titles">
            <div class="step-title" :class="{ active: true }">
              {{ workType === 1 ? '发起工单' : '发起任务' }}
            <div class="step-title active">
              {{ workType === 1 ? '发起工单' : '发起任务' }}
            </div>
            <div v-for="(status, index) in stepStatusList" :key="index"
              :class="{ active: Number(currentDetail.status) >= Number(status) }" class="step-title">
            <div v-for="(status, index) in stepStatusList" :key="index" :class="{
              'step-title': true,
              'active': index <= stepStatusList.indexOf(String(currentDetail.status))
            }">
              {{ mapStatus(status) }}
            </div>
          </div>
@@ -178,11 +180,11 @@
                </span>
                <div class="step-description">
                  <template v-if="workType === 0">
          {{ currentDetail.job_create_time || currentDetail.startTime || '未知时间' }}
        </template>
        <template v-else>
          {{ currentDetail.startTime || '未知时间' }}
        </template>
                    {{ currentDetail.job_create_time || currentDetail.startTime || '未知时间' }}
                  </template>
                  <template v-else>
                    {{ currentDetail.startTime || '未知时间' }}
                  </template>
                </div>
              </template>
            </el-step>
@@ -192,7 +194,8 @@
                  {{ getStepHandler(status) }}
                </span>
                <div class="step-description" v-if="getStepTime(status)">
                  <span style="position: absolute; right: 80%; top: 50%; transform: translateY(-50%); width: 100px; margin-left: 4px; color: #666; font-size: 12px;">
                  <span
                    style="position: absolute; right: 80%; top: 50%; transform: translateY(-50%); width: 100px; margin-left: 4px; color: #666; font-size: 12px;">
                    耗时:{{ getStepTime(status) }}
                  </span>
                </div>
@@ -210,7 +213,7 @@
          <el-table-column>
            <template #default="{ row }">
              <!-- 修复工单名称可编辑 -->
              <template v-if="currentDetail.status === 0 && row.label1 === '工单名称'&&hasProcessingBtnPermission()">
              <template v-if="currentDetail.status === 0 && row.label1 === '工单名称' && hasProcessingBtnPermission()">
                <el-input v-model="currentDetail.orderName" placeholder="请输入工单名称" />
              </template>
              <!-- 修复任务接收单位为下拉框 -->
@@ -226,7 +229,7 @@
          <el-table-column>
            <template #default="{ row }">
              <!-- 修复工单内容可编辑 -->
              <template v-if="currentDetail.status === 0 && row.label2 === '工单内容'&&hasProcessingBtnPermission()">
              <template v-if="currentDetail.status === 0 && row.label2 === '工单内容' && hasProcessingBtnPermission()">
                <el-input type="textarea" v-model="currentDetail.content" placeholder="请输入工单内容" />
              </template>
              <!-- 修复工单类型为下拉框 -->
@@ -714,9 +717,9 @@
      return formattedFields;
    },
    dynamicFixedStatuses() {
  // 直接使用接口返回的 stepInfos
  return this.stepInfos.map(step => String(step.status));
},
      // 直接使用接口返回的 stepInfos
      return this.stepInfos.map(step => String(step.status));
    },
    ...mapGetters(['userInfo', 'permission']),
    // 动态过滤tabs,保证isShow为true/false
    filteredTabs() {
@@ -911,7 +914,7 @@
          ai_type: this.filters.algorithm || undefined, // 添加算法参数
          // 添加 is_draft 参数,仅在"我发起的"标签页时设置为1
          is_draft: currentTab?.name === 'myTickets' ? 1 : undefined,
          user_id: currentTab?.name === 'myTickets' ? this.userInfo.user_id : undefined,
        };
@@ -956,8 +959,8 @@
            processing_details: item.processing_details || '', // 添加处理详情字段
            update_photo_url: item.update_photo_url || '', // 添加处理图片字段
            work_type: item.work_type !== undefined ? Number(item.work_type) : 0, // 保留work_type字段并转为数字
            job_name: item.job_name || '',
            job_create_time: item.job_create_time || '',
            job_name: item.job_name || '',
            job_create_time: item.job_create_time || '',
          };
        });
@@ -1314,7 +1317,7 @@
      // 步骤索引适配
      const arr = this.stepStatusList;
      const index = arr.indexOf(String(this.currentDetail.status));
      return index !== -1 ? index + 1 : 1;
      return index !== -1 ? index + 2 : 1;
    },
    openMap() {
@@ -2458,6 +2461,7 @@
  color: #409eff;
  font-weight: bold;
}
.event-title-center {
  text-align: center;
  font-size: 20px;
@@ -2465,6 +2469,7 @@
  margin-bottom: 12px;
  color: #333;
}
.custom-steps {
  margin-top: -20px;