无人机管理后台前端(已迁走)
rain
2025-04-24 21ac8d20cba37f588d593316839224a5038e5cb7
修改工单状态样式
1 files modified
30 ■■■■■ changed files
src/views/tickets/ticket.vue 30 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -50,8 +50,10 @@
              </template>
            </template>
            <template #status="{ row }">
              <el-tag :type="getStatusTagType(row.status)">{{ mapStatus(row.status) }}</el-tag>
            </template>
  <span :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''">
    {{ mapStatus(row.status) }}
  </span>
</template>
            <template #keyData="{ row }">
              <span>{{ row.address }}</span>
            </template>
@@ -579,7 +581,7 @@
          },
          { label: "创建人", prop: "creator", width: 100 },
          { label: "处理人", prop: "handler", width: 100 },
          { label: "工单状态", prop: "status", slot: true, width: 100 }
          { label: "工单状态", prop: "status", slot: true, width: 90 }
        ],
      },
      page: {
@@ -1205,16 +1207,18 @@
    },
    getStatusTagType(status) {
      const statusMap = {
        "-1": "info",    // 为草稿状态添加样式
        "2": "warning",
        "0": "danger",
        "3": "primary",
        "4": "success",
        "5": "danger",
      };
      return statusMap[status] || "info";
    },
  // 草稿不加颜色
  if (status === -1 || status === "-1") return '';
  // 状态颜色映射
  const colorMap = {
    "0": "#ffb6b6",    // 待处理-淡红
    "3": "#e57373",    // 处理中-更淡红
    "2": "#faad14",    // 待审核-橙色
    "4": "#a0cfff",    // 已完成-淡蓝
    "5": "#67c23a",    // 已完结-绿色
  };
  return colorMap[String(status)] || '';
},
    async fetchTabCounts() {
      try {