无人机管理后台前端(已迁走)
张含笑
2025-05-12 2ce9bd5adcd6ffd054f7c5148ab480b36ff6f56a
个人工作台待办事项,综合统计分析
6 files modified
1234 ■■■■■ changed files
src/api/home/index.js 11 ●●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue 944 ●●●●● patch | view | raw | blame | history
src/views/wel/components/backlog.vue 158 ●●●●● patch | view | raw | blame | history
src/views/wel/components/flyratio.vue 100 ●●●●● patch | view | raw | blame | history
src/views/wel/components/statistics.vue 2 ●●● patch | view | raw | blame | history
src/views/wel/index.vue 19 ●●●● patch | view | raw | blame | history
src/api/home/index.js
@@ -64,3 +64,14 @@
    data,
  });
};
// 待办事项
export const getdaiban = type => {
  return request({
    url: '/drone-device-core/jobEvent/getOrderOrEventFive',
    method: 'get',
    params: {
      type,
    },
  });
};
src/views/tickets/orderLog.vue
@@ -11,60 +11,107 @@
<template>
  <basic-container>
    <el-tabs v-model="activeTab" @tab-click="handleTabChange">
      <el-tab-pane v-for="tab in filteredTabs" :key="tab.name" :label="`${tab.label} (${tab.count})`" :name="tab.name">
      <el-tab-pane
        v-for="tab in filteredTabs"
        :key="tab.name"
        :label="`${tab.label} (${tab.count})`"
        :name="tab.name"
      >
        <div class="tab-content">
          <!-- 查询条件筛选栏 -->
          <div class="filter-bar">
            <div class="search-bar-box">
              <div class="search-bar-box-item">
                <el-input v-model="filters.key_word" placeholder="输入工单编号/名称/内容/姓名" clearable
                  @keyup.enter="handleSearch" />
                <el-input
                  v-model="filters.key_word"
                  placeholder="输入工单编号/名称/内容/姓名"
                  clearable
                  @keyup.enter="handleSearch"
                />
              </div>
              <div class="search-bar-box-item">
                <el-select placeholder="请选择所属单位" v-model="filters.create_dept" @change="handleDepartmentChange"
                  clearable>
                  <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />
                <el-select
                  placeholder="请选择所属单位"
                  v-model="filters.create_dept"
                  clearable
                >
                  <el-option
                    v-for="dept in departments"
                    :key="dept.value"
                    :label="dept.label"
                    :value="dept.value"
                  />
                </el-select>
              </div>
              <div class="search-bar-box-item">
                <el-date-picker v-model="filters.dateRange" type="daterange" range-separator="至"
                  start-placeholder="开始日期" end-placeholder="结束日期" :default-value="datePickerDefaultVal" />
                <el-date-picker
                  v-model="filters.dateRange"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-value="datePickerDefaultVal"
                />
              </div>
              <div class="search-bar-box-item">
                <el-select v-model="filters.file_id" placeholder="请选择关联航线" clearable>
                  <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                    :value="item.wayline_id" />
                  <el-option
                    v-for="item in wayLineList"
                    :key="item.wayline_id"
                    :label="item.name"
                    :value="item.wayline_id"
                  />
                </el-select>
              </div>
              <div class="search-bar-box-item">
                <el-select v-model="filters.ai_types" placeholder="关联算法" clearable>
                  <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                  <el-option
                    v-for="item in ai_types"
                    :key="item.dictKey"
                    :label="item.dictValue"
                    :value="item.dictKey"
                  />
                </el-select>
              </div>
              <div class="search-bar-box-item">
                <el-select v-model="filters.type" placeholder="请选择工单类型" clearable>
                  <el-option v-for="item in types" :key="item.dictValue" :label="item.dictValue"
                    :value="item.dictKey" />
                  <el-option
                    v-for="item in types"
                    :key="item.dictValue"
                    :label="item.dictValue"
                    :value="item.dictKey"
                  />
                </el-select>
              </div>
              <div class="search-bar-box-item">
                <el-select v-model="filters.status" placeholder="请选择工单状态" clearable>
                  <el-option v-for="item in statuses" :key="item.value" :label="item.label" :value="item.value" />
                  <el-option
                    v-for="item in statuses"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </div>
            </div>
            <div class="search-bar-box">
              <div class="search-bar-box-item flex-2">
                <el-date-picker v-model="filters.cycleDateRange" type="daterange" range-separator="至"
                  start-placeholder="工单周期开始日期" end-placeholder="工单周期结束日期" :default-value="datePickerDefaultVal" />
                <el-date-picker
                  v-model="filters.cycleDateRange"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="工单周期开始日期"
                  end-placeholder="工单周期结束日期"
                  :default-value="datePickerDefaultVal"
                />
              </div>
              <div class="search-bar-box-item">
@@ -74,56 +121,98 @@
              </div>
              <div class="search-bar-box-item">
                <el-time-picker v-model="filters.deal_time" placeholder="请选择执行时间" prop="deal_time" value-format="HH:mm"
                <el-time-picker
                  v-model="filters.deal_time"
                  placeholder="请选择执行时间"
                  prop="deal_time"
                  value-format="HH:mm"
                  :picker-options="{
                    selectableRange: '00:00 - 23:59',
                  }" />
                  }"
                />
              </div>
              <div class="search-bar-box-item"></div>
              <div class="search-bar-box-item"></div>
              <div class="search-bar-box-item search-btn">
                <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                <el-button type="primary" icon="el-icon-search" @click="handleSearch"
                  >搜索</el-button
                >
                <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button>
              </div>
            </div>
          </div>
          <!-- 表格部分 -->
          <avue-crud :data="tableData" :option="option" v-model:page="page" ref="crud" :table-loading="loading"
            @current-change="currentChange" @refresh-change="refreshChange" @on-load="onLoad"
            @search-change="searchChange" @size-change="sizeChange">
          <avue-crud
            :data="tableData"
            :option="option"
            v-model:page="page"
            ref="crud"
            :table-loading="loading"
            @current-change="currentChange"
            @refresh-change="refreshChange"
            @on-load="onLoad"
            @search-change="searchChange"
            @size-change="sizeChange"
          >
            <template #menu-left>
              <el-button v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'" type="primary" icon="el-icon-plus"
                @click="handleAdd">新建工单</el-button>
              <el-button type="success" plain icon="el-icon-download" @click="exportData">导出</el-button>
              <el-button
                v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'"
                type="primary"
                icon="el-icon-plus"
                @click="handleAdd"
                >新建工单</el-button
              >
              <el-button type="success" plain icon="el-icon-download" @click="exportData"
                >导出</el-button
              >
            </template>
            <template #menu="{ row }">
              <div class="menu-custom-box">
                <template v-if="row.status == 1">
                  <el-button v-if="hasPaddingBtnPermission()" type="text" icon="el-icon-view"
                    @click="handleCheckDetail(row)">审核</el-button>
                  <el-button
                    v-if="hasPaddingBtnPermission()"
                    type="text"
                    icon="el-icon-view"
                    @click="handleCheckDetail(row)"
                    >审核</el-button
                  >
                </template>
                <template v-if="
                  (userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) &&
                  row.status == 1
                ">
                <template
                  v-if="
                    (userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) &&
                    row.status == 1
                  "
                >
                  <!--待审核状态-->
                  <el-button type="text" icon="el-icon-warning" @click="orderLogRecall(row.id)">撤回</el-button>
                  <el-button type="text" icon="el-icon-warning" @click="orderLogRecall(row.id)"
                    >撤回</el-button
                  >
                </template>
                <!--已驳回-->
                <template v-if="row.status == 2">
                  <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)">驳回原因</el-button>
                  <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)"
                    >驳回原因</el-button
                  >
                </template>
                <!--草稿-->
                <el-button type="text" icon="el-icon-edit" @click="handleViewDetail(row)">编辑</el-button>
                <el-button type="text" icon="el-icon-position" @click="userPublishPush(row.id)">发起</el-button>
                <el-button type="text" icon="el-icon-delete" @click="deleteOrderLog(row.id)">删除</el-button>
                <el-button type="text" icon="el-icon-edit" @click="handleViewDetail(row)"
                  >编辑</el-button
                >
                <el-button type="text" icon="el-icon-position" @click="userPublishPush(row.id)"
                  >发起</el-button
                >
                <el-button type="text" icon="el-icon-delete" @click="deleteOrderLog(row.id)"
                  >删除</el-button
                >
                <template v-if="row.status == 3 || row.status == 1 || row.status == 2">
                  <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button>
                  <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)"
                    >详情</el-button
                  >
                </template>
              </div>
            </template>
@@ -141,19 +230,34 @@
    </el-tabs>
    <!-- 新建工单对话框 -->
    <el-dialog v-model="dialogVisible" title="新建工单" width="70%" :close-on-click-modal="false" @close="resetForm">
    <el-dialog
      v-model="dialogVisible"
      title="新建工单"
      width="70%"
      :close-on-click-modal="false"
      @close="resetForm"
    >
      <el-form :model="form" :rules="rules" ref="testform" label-width="100px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单名称" prop="name">
              <el-input v-model="form.name" placeholder="请输入工单名称" maxlength="100" show-word-limit></el-input>
              <el-input
                v-model="form.name"
                placeholder="请输入工单名称"
                maxlength="100"
                show-word-limit
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="form.file_id" placeholder="请选择航线" @change="getFlyingNestBy">
                <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                  :value="item.wayline_id" />
                <el-option
                  v-for="item in wayLineList"
                  :key="item.wayline_id"
                  :label="item.name"
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -162,15 +266,24 @@
          <el-col :span="12">
            <el-form-item label="关联机巢" prop="device_sns">
              <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple>
                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                  :value="item.device_sn" />
                <el-option
                  v-for="item in device_sns"
                  :key="item.device_sn"
                  :label="item.nickname"
                  :value="item.device_sn"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联算法" prop="ai_types">
              <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple>
                <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
                <el-option
                  v-for="item in ai_types"
                  :key="item.dictKey"
                  :label="item.dictValue"
                  :value="item.dictKey"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -179,15 +292,26 @@
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单内容" prop="content">
              <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容" maxlength="255"
                show-word-limit></el-input>
              <el-input
                type="textarea"
                v-model="form.content"
                rows="4"
                placeholder="请输入工单内容"
                maxlength="255"
                show-word-limit
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="周期频次" prop="date_range">
              <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
                end-placeholder="结束日期" />
              <el-date-picker
                v-model="form.date_range"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
@@ -198,10 +322,15 @@
                </el-select>
              </div>
              <div class="flex-1">
                <el-time-picker style="width: 100px" v-model="form.deal_time" prop="deal_time" value-format="HH:mm"
                <el-time-picker
                  style="width: 100px"
                  v-model="form.deal_time"
                  prop="deal_time"
                  value-format="HH:mm"
                  :picker-options="{
                    selectableRange: '00:00 - 23:59',
                  }" />
                  }"
                />
              </div>
            </div>
          </el-col>
@@ -223,15 +352,24 @@
    </el-dialog>
    <!-- 工单详情对话框 -->
    <el-dialog v-model="detailVisible" :title="detailTitle" width="70%" :close-on-click-modal="false"
      @close="resetForm">
    <el-dialog
      v-model="detailVisible"
      :title="detailTitle"
      width="70%"
      :close-on-click-modal="false"
      @close="resetForm"
    >
      <div class="event-title-center">{{ form.name }}</div>
      <el-form :model="form" ref="testform" label-width="100px">
        <div class="custom-steps-container">
          <!-- 标题行 -->
          <div class="steps-titles">
            <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }" :key="index"
              class="step-title">
            <div
              v-for="(record, index) in form.record_list"
              :class="{ active: record.user_id >= 0 }"
              :key="index"
              class="step-title"
            >
              {{ record.status_str }}
            </div>
          </div>
@@ -243,7 +381,8 @@
                <span class="step-description" style="position: relative; display: inline-block">
                  {{ record.user_name }}
                </span>
                <span style="
                <span
                  style="
                    position: absolute;
                    left: 80%;
                    top: 50%;
@@ -252,7 +391,8 @@
                    margin-left: 4px;
                    color: #666;
                    font-size: 12px;
                  ">
                  "
                >
                  {{ record.interval_time_str }}
                </span>
                <div class="step-description">
@@ -272,8 +412,12 @@
          <el-col :span="12">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="form.file_id" placeholder="请选择航线" @change="getFlyingNestBy">
                <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                  :value="item.wayline_id" />
                <el-option
                  v-for="item in wayLineList"
                  :key="item.wayline_id"
                  :label="item.name"
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -282,15 +426,24 @@
          <el-col :span="12">
            <el-form-item label="关联机巢" prop="device_sns">
              <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple>
                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                  :value="item.device_sn" />
                <el-option
                  v-for="item in device_sns"
                  :key="item.device_sn"
                  :label="item.nickname"
                  :value="item.device_sn"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联算法" prop="ai_types">
              <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple>
                <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
                <el-option
                  v-for="item in ai_types"
                  :key="item.dictKey"
                  :label="item.dictValue"
                  :value="item.dictKey"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -305,8 +458,13 @@
          <el-col :span="6">
            <el-form-item label="周期频次" prop="date_range">
              <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
                end-placeholder="结束日期" />
              <el-date-picker
                v-model="form.date_range"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>
          </el-col>
@@ -317,18 +475,29 @@
          </el-col>
          <el-col :span="3">
            <el-time-picker style="width: 100px" v-model="form.deal_time" prop="deal_time" value-format="HH:mm"
            <el-time-picker
              style="width: 100px"
              v-model="form.deal_time"
              prop="deal_time"
              value-format="HH:mm"
              :picker-options="{
                selectableRange: '00:00 - 23:59',
              }" />
              }"
            />
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单内容" prop="content">
              <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容" maxlength="255"
                show-word-limit></el-input>
              <el-input
                type="textarea"
                v-model="form.content"
                rows="4"
                placeholder="请输入工单内容"
                maxlength="255"
                show-word-limit
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
@@ -341,30 +510,51 @@
        <el-row>
          <div class="add-box-btns">
            <el-button type="danger"
            <el-button
              type="danger"
              v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
              @click="submitForm(1)">发布</el-button>
              @click="submitForm(1)"
              >发布</el-button
            >
            <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
                            @click="submitForm(0)">保存</el-button> -->
            <el-button type="primary" v-if="form.status == 1 && this.permission.orderLogpass"
              @click="orderLogPass(form.id)">通过</el-button>
            <el-button type="danger" v-if="form.status == 1 && hasRejectionBtnPermission()"
              @click="orderLogReject(form.id)">驳回</el-button>
            <el-button
              type="primary"
              v-if="form.status == 1 && this.permission.orderLogpass"
              @click="orderLogPass(form.id)"
              >通过</el-button
            >
            <el-button
              type="danger"
              v-if="form.status == 1 && hasRejectionBtnPermission()"
              @click="orderLogReject(form.id)"
              >驳回</el-button
            >
          </div>
        </el-row>
      </el-form>
    </el-dialog>
    <!-- 工单详情 -->
    <el-dialog v-model="detailVisibleCopy" title="工单详情" width="70%" :close-on-click-modal="false" @close="resetForm">
    <el-dialog
      v-model="detailVisibleCopy"
      title="工单详情"
      width="70%"
      :close-on-click-modal="false"
      @close="resetForm"
    >
      <div class="event-title-center">{{ form.name }}</div>
      <el-form :model="form" ref="testform" label-width="100px">
        <div class="custom-steps-container">
          <!-- 标题行 -->
          <div class="steps-titles">
            <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }" :key="index"
              class="step-title">
            <div
              v-for="(record, index) in form.record_list"
              :class="{ active: record.user_id >= 0 }"
              :key="index"
              class="step-title"
            >
              {{ record.status_str }}
            </div>
          </div>
@@ -376,7 +566,8 @@
                <span class="step-description" style="position: relative; display: inline-block">
                  {{ record.user_name }}
                </span>
                <span style="
                <span
                  style="
                    position: absolute;
                    left: 80%;
                    top: 50%;
@@ -385,7 +576,8 @@
                    margin-left: 4px;
                    color: #666;
                    font-size: 12px;
                  ">
                  "
                >
                  {{ record.interval_time_str }}
                </span>
                <div class="step-description">
@@ -399,14 +591,22 @@
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单名称" prop="name">
              <el-input v-model="form.name" placeholder="请输入工单名称" :disabled="true"></el-input>
              <el-input
                v-model="form.name"
                placeholder="请输入工单名称"
                :disabled="true"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
                <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                  :value="item.wayline_id" />
                <el-option
                  v-for="item in wayLineList"
                  :key="item.wayline_id"
                  :label="item.name"
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -415,16 +615,35 @@
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="关联机巢" prop="device_sns">
              <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="true">
                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                  :value="item.device_sn" />
              <el-select
                v-model="form.device_sns"
                placeholder="请选择机巢"
                multiple
                :disabled="true"
              >
                <el-option
                  v-for="item in device_sns"
                  :key="item.device_sn"
                  :label="item.nickname"
                  :value="item.device_sn"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联算法" prop="ai_types">
              <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple :disabled="true">
                <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
              <el-select
                v-model="form.ai_types"
                placeholder="请选择关联算法"
                multiple
                :disabled="true"
              >
                <el-option
                  v-for="item in ai_types"
                  :key="item.dictKey"
                  :label="item.dictValue"
                  :value="item.dictKey"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -439,8 +658,14 @@
          <el-col :span="6">
            <el-form-item label="周期频次" prop="date_range">
              <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
                end-placeholder="结束日期" :disabled="true" />
              <el-date-picker
                v-model="form.date_range"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
          <el-col :span="3">
@@ -450,18 +675,32 @@
          </el-col>
          <el-col :span="3">
            <el-time-picker style="width: 100px" v-model="form.deal_time" prop="deal_time" :disabled="true"
              value-format="HH:mm" :picker-options="{
            <el-time-picker
              style="width: 100px"
              v-model="form.deal_time"
              prop="deal_time"
              :disabled="true"
              value-format="HH:mm"
              :picker-options="{
                selectableRange: '00:00 - 23:59',
              }" />
              }"
            />
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单内容" prop="content">
              <el-input type="textarea" v-model="form.content" rows="2" placeholder="请输入工单内容" maxlength="255"
                show-word-limit :readonly="true" :disabled="true"></el-input>
              <el-input
                type="textarea"
                v-model="form.content"
                rows="2"
                placeholder="请输入工单内容"
                maxlength="255"
                show-word-limit
                :readonly="true"
                :disabled="true"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
@@ -474,16 +713,27 @@
        <el-row>
          <div class="add-box-btns">
            <el-button type="danger"
            <el-button
              type="danger"
              v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
              @click="submitForm(1)">发布</el-button>
              @click="submitForm(1)"
              >发布</el-button
            >
            <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
                            @click="submitForm(0)">保存</el-button> -->
            <el-button type="primary" v-if="form.status == 1 && this.permission.orderLogpass"
              @click="orderLogPass(form.id)">通过</el-button>
            <el-button type="danger" v-if="form.status == 1 && hasRejectionBtnPermission()"
              @click="orderLogReject(form.id)">驳回</el-button>
            <el-button
              type="primary"
              v-if="form.status == 1 && this.permission.orderLogpass"
              @click="orderLogPass(form.id)"
              >通过</el-button
            >
            <el-button
              type="danger"
              v-if="form.status == 1 && hasRejectionBtnPermission()"
              @click="orderLogReject(form.id)"
              >驳回</el-button
            >
            <el-button @click="detailVisibleCopy = false">取消</el-button>
          </div>
        </el-row>
@@ -493,7 +743,7 @@
</template>
<script>
import { calculateDefaultRange } from '@/utils/util'
import { calculateDefaultRange } from '@/utils/util';
import {
  getList,
  saveUpdateOrderLog,
@@ -505,21 +755,21 @@
  jobStatusNum,
  userPublish,
  deleteOrderLog,
} from '@/api/tickets/orderLog'
import { getTicketInfo } from '@/api/tickets/ticket'
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getWaylineFileListByArea } from '@/api/resource/wayline'
import { export_json_to_excel } from '@/utils/exportExcel'
import { getFlyingNestBy } from '@/api/device/device'
import { mapGetters } from 'vuex'
import NProgress from 'nprogress'
import { downloadXls } from '@/utils/util'
import 'nprogress/nprogress.css'
import { analyzeKmzFile, removeTextKey, XMLToJSON } from '@/utils/cesium/kmz'
} from '@/api/tickets/orderLog';
import { getTicketInfo } from '@/api/tickets/ticket';
import { getDictionaryByCode } from '@/api/system/dictbiz';
import { getWaylineFileListByArea } from '@/api/resource/wayline';
import { export_json_to_excel } from '@/utils/exportExcel';
import { getFlyingNestBy } from '@/api/device/device';
import { mapGetters } from 'vuex';
import NProgress from 'nprogress';
import { downloadXls } from '@/utils/util';
import 'nprogress/nprogress.css';
import { analyzeKmzFile, removeTextKey, XMLToJSON } from '@/utils/cesium/kmz';
export default {
  name: 'TicketPage',
  data () {
  data() {
    return {
      activeTab: 'all',
@@ -638,119 +888,125 @@
      // 配置时间选择器默认配置
      datePickerDefaultVal: calculateDefaultRange(),
    }
    };
  },
  async created () {
    var response = await getDictionaryByCode('SF')
    var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE')
    this.ai_types = response.data.data['SF']
    this.types = word_order_typeResponse.data.data['WORK_ORDER_TYPE']
  async created() {
    var response = await getDictionaryByCode('SF');
    var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE');
    this.ai_types = response.data.data['SF'];
    this.types = word_order_typeResponse.data.data['WORK_ORDER_TYPE'];
    //获取航线
    this.asyncgetWaylineFileListByArea()
    const response2 = await getTicketInfo()
    const { dept_data, event_type, ai_type } = response2.data.data
    this.asyncgetWaylineFileListByArea();
    const response2 = await getTicketInfo();
    const { dept_data, event_type, ai_type } = response2.data.data;
    this.departments = dept_data.map(item => ({
      label: item.dept_name,
      value: item.id,
    }))
    }));
  },
  mounted () {
    this.fetchTableData()
  mounted() {
    this.fetchTableData();
    const id = this.$route.query.id;
   if (id) { // 确保 id 存在
    this.handleViewDetail({ id });
  } else {
    console.error('工单ID不存在!');
  }
  },
  computed: {
    ...mapGetters(['userInfo', 'permission']),
    filteredTabs () {
    filteredTabs() {
      // rejection_and_draft 权限控制“已驳回”和“草稿”tab
      const canShowRejectAndDraft = this.permission?.rejection_and_draft === true
      const canShowRejectAndDraft = this.permission?.rejection_and_draft === true;
      return this.tabs
        .map(tab => {
          if (tab.name === 'DRAFT') {
            return { ...tab, isShow: canShowRejectAndDraft }
            return { ...tab, isShow: canShowRejectAndDraft };
          }
          if (tab.name === 'REJECTED') {
            return { ...tab, isShow: canShowRejectAndDraft }
            return { ...tab, isShow: canShowRejectAndDraft };
          }
          return { ...tab, isShow: true }
          return { ...tab, isShow: true };
        })
        .filter(tab => tab.isShow)
        .filter(tab => tab.isShow);
    },
  },
  methods: {
    searchChange (params, done) {
      console.log('searchChange')
      this.query = params
      this.parentId = ''
      this.page.currentPage = 1
      this.onLoad(this.page, params)
      done()
    searchChange(params, done) {
      // console.log('searchChange')
      this.query = params;
      this.parentId = '';
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    async onLoad (page, params = {}) {
      this.loading = true
    async onLoad(page, params = {}) {
      this.loading = true;
      getList(
        null,
        this.page.currentPage,
        this.page.pageSize,
        Object.assign(params, this.query)
      ).then(res => {
        this.tableData = res.data.data
        this.loading = false
        this.selectionClear()
      })
        this.tableData = res.data.data;
        this.loading = false;
        this.selectionClear();
      });
    },
    selectionClear () {
      this.selectionList = []
      this.$refs.crud.toggleSelection()
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    async loadAMapScripts () {
    async loadAMapScripts() {
      try {
        // await loadAMap();
        // await loadAMapUI();
        this.mapLoaded = true
        this.mapLoaded = true;
      } catch (error) {
        console.error('Failed to load AMap scripts:', error)
        this.$message.error('地图加载失败,请检查网络或API Key配置')
        console.error('Failed to load AMap scripts:', error);
        this.$message.error('地图加载失败,请检查网络或API Key配置');
      }
    },
    formatCycleTime (row) {
      return `${row.cycle_time_value}`
    formatCycleTime(row) {
      return `${row.cycle_time_value}`;
    },
    async fetchTableData () {
      this.loading = true
    async fetchTableData() {
      this.loading = true;
      try {
        let params = this.getQueryParam()
        console.log('发送的参数:', params)
        const response = await getList(params, this.page.currentPage, this.page.pageSize)
        let params = this.getQueryParam();
        // console.log('发送的参数:', params)
        const response = await getList(params, this.page.currentPage, this.page.pageSize);
        if (!response?.data?.data?.records) {
          throw new Error('接口返回数据格式不正确')
          throw new Error('接口返回数据格式不正确');
        }
        const { total, records } = response.data.data
        const { total, records } = response.data.data;
        this.tableData = records.map(item => {
          return item
        })
          return item;
        });
        console.log('权限检查:', this.permission)
        this.page.total = total || 0
        this.updateGlobalCounts()
        // console.log('权限检查:', this.permission)
        this.page.total = total || 0;
        this.updateGlobalCounts();
      } catch (error) {
        console.error('获取数据失败:', error)
        this.$message.error(error.message || '获取数据失败')
        this.tableData = []
        this.page.total = 0
        // console.error('获取数据失败:', error)
        this.$message.error(error.message || '获取数据失败');
        this.tableData = [];
        this.page.total = 0;
      } finally {
        this.loading = false
        this.loading = false;
      }
    },
    getQueryParam () {
      const currentTab = this.tabs.find(tab => tab.name === this.activeTab)
    getQueryParam() {
      const currentTab = this.tabs.find(tab => tab.name === this.activeTab);
      if (this.filters.dateRange) {
        console.log(
          'this.formatDate(this.filters.dateRange[0])',
          this.formatDate(this.filters.dateRange[0])
        )
        // console.log(
        //   'this.formatDate(this.filters.dateRange[0])',
        //   this.formatDate(this.filters.dateRange[0])
        // )
      }
      const params = {
@@ -780,43 +1036,43 @@
        deal_time: this.filters.deal_time || undefined,
        current: this.page.currentPage,
        size: this.page.pageSize,
      }
      return params
      };
      return params;
    },
    sizeChange (pageSize) {
      this.page.pageSize = pageSize
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    async submitForm (status) {
    async submitForm(status) {
      this.$refs.testform.validate(async valid => {
        if (valid) {
          let dateRange = this.form.date_range
          console.log('dateRange' + dateRange)
          let dateRange = this.form.date_range;
          // console.log('dateRange' + dateRange)
          this.form.begin_time = this.formatDate(dateRange[0])
          this.form.end_time = this.formatDate(dateRange[1])
          this.form.begin_time = this.formatDate(dateRange[0]);
          this.form.end_time = this.formatDate(dateRange[1]);
          const submitData = {
            ...this.form,
            status: status,
          }
          await saveUpdateOrderLog(submitData)
          let id = this.form.id
          };
          await saveUpdateOrderLog(submitData);
          let id = this.form.id;
          if (id) {
            this.$message.success('工单发布成功')
            this.$message.success('工单发布成功');
          } else {
            this.$message.success('工单创建成功')
            this.$message.success('工单创建成功');
          }
          this.dialogVisible = false
          this.dialogVisible = false;
          this.detailVisible = false;
          (this.device_sns = []), (this.wayLineList = []), this.fetchTableData()
          (this.device_sns = []), (this.wayLineList = []), this.fetchTableData();
        }
      })
      });
    },
    //驳回原因显示
    async rejectDetail (id) {
      const response = await orderLogDetails(id)
      let data = response.data.data
    async rejectDetail(id) {
      const response = await orderLogDetails(id);
      let data = response.data.data;
      this.$confirm(data.remark, '驳回原因', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -824,93 +1080,93 @@
      }).then(() => {
        this.form = {
          ...response.data.data,
        }
        this.detailVisible = true
      })
        };
        this.detailVisible = true;
      });
    },
    formatDate (date) {
      if (!date) return undefined
      const d = new Date(date)
    formatDate(date) {
      if (!date) return undefined;
      const d = new Date(date);
      return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
        d.getDate()
      ).padStart(2, '0')} 00:00:00`
      ).padStart(2, '0')} 00:00:00`;
    },
    mapStatus (status) {
    mapStatus(status) {
      const statusTextMap = {
        0: '草稿',
        1: '待审核',
        2: '已驳回',
        3: '已通过',
      }
      return statusTextMap[status] || '未知状态'
      };
      return statusTextMap[status] || '未知状态';
    },
    getStatusTagType (status) {
    getStatusTagType(status) {
      const statusMap = {
        1: 'warning',
        2: 'info',
        3: 'primary',
        4: 'success',
        5: 'danger',
      }
      return statusMap[status] || 'info'
      };
      return statusMap[status] || 'info';
    },
    handleTabChange (tab) {
      this.activeTab = tab.props?.name || tab.name
      this.filters.status = ''
      this.page.currentPage = 1
      this.fetchTableData()
    handleTabChange(tab) {
      this.activeTab = tab.props?.name || tab.name;
      this.filters.status = '';
      this.page.currentPage = 1;
      this.fetchTableData();
    },
    handleSearch () {
      this.page.currentPage = 1
      this.fetchTableData()
    handleSearch() {
      this.page.currentPage = 1;
      this.fetchTableData();
    },
    handleReset () {
    handleReset() {
      this.filters = {
        keyword: '',
        department: '',
        type: '',
        dateRange: [],
        status: '',
      }
      this.page.currentPage = 1
      this.fetchTableData()
      };
      this.page.currentPage = 1;
      this.fetchTableData();
    },
    currentChange (currentPage) {
      this.page.currentPage = currentPage
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    async updateGlobalCounts () {
    async updateGlobalCounts() {
      const counts = {
        all: 0,
        DRAFT: 0,
        WAIT_AUDIT: 0,
        REJECTED: 0,
        PASS: 0,
      }
      var reponse = await jobStatusNum()
      console.log('统计' + reponse.data.data)
      };
      var reponse = await jobStatusNum();
      // console.log('统计' + reponse.data.data)
      reponse.data.data.forEach(item => {
        const tab = this.tabs.find(t => t.name === item.dict_key)
        const tab = this.tabs.find(t => t.name === item.dict_key);
        if (tab) {
          tab.count = item.num
          tab.count = item.num;
        }
      })
      });
    },
    handleAdd () {
      this.form = {}
      this.dialogVisible = true
    handleAdd() {
      this.form = {};
      this.dialogVisible = true;
      //航线列表
      this.asyncgetWaylineFileListByArea()
      this.asyncgetWaylineFileListByArea();
    },
    resetForm () {
    resetForm() {
      this.form = {
        name: '',
        type: '',
@@ -920,227 +1176,223 @@
        address: '',
        content: '',
        photos: [],
      }
      };
      if (this.$refs.testform) {
        this.$refs.testform.resetFields()
        this.$refs.testform.resetFields();
      }
    },
    formatLocation (location) {
    formatLocation(location) {
      if (!Array.isArray(location)) {
        return '未知位置'
        return '未知位置';
      }
      return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`
      return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`;
    },
    async handleViewDetail (row) {
      const response = await orderLogDetails(row.id)
      const data = response.data.data
    async handleViewDetail(row) {
      const response = await orderLogDetails(row.id);
      const data = response.data.data;
      this.form = {
        ...data,
      }
      };
      // 更新机巢列表
      this.device_sns = data.device_list
      this.device_sns = data.device_list;
      this.permission &&
        (this.permission.order_log_review || this.permission.order_log_recall) &&
        (data.status == 1 || data.status == 3 || data.status == 2)
      (this.permission.order_log_review || this.permission.order_log_recall) &&
      (data.status == 1 || data.status == 3 || data.status == 2)
        ? (this.detailTitle = '工单详情')
        : (this.detailTitle = '编辑工单')
        : (this.detailTitle = '编辑工单');
      this.detailVisible = true
      this.detailVisible = true;
      this.initMapLine(data.device_map_infos)
      this.initMapLine(data.device_map_infos);
    },
    async handleCheckDetail (row) {
      const response = await orderLogDetails(row.id)
      const data = response.data.data
    async handleCheckDetail(row) {
      const response = await orderLogDetails(row.id);
      const data = response.data.data;
      this.form = {
        ...data,
      }
      };
      // 更新机巢列表
      this.device_sns = data.device_list
      this.detailVisibleCopy = true
      this.initMapLine(data.device_map_infos)
      this.device_sns = data.device_list;
      this.detailVisibleCopy = true;
      this.initMapLine(data.device_map_infos);
    },
    //导出
    async exportData () {
    async exportData() {
      this.$confirm('是否智飞工单数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        NProgress.start()
        let params = this.getQueryParam()
        NProgress.start();
        let params = this.getQueryParam();
        orderLogExport(params).then(res => {
          downloadXls(res.data, `智飞工单${this.$dayjs().format('YYYY-MM-DD')}.xlsx`)
          NProgress.done()
        })
      })
          downloadXls(res.data, `智飞工单${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
          NProgress.done();
        });
      });
    },
    hasAddBtnPermission () {
    hasAddBtnPermission() {
      // undefined 或 false 都返回 false,只有 true 返回 true
      console.log('this.permission.order_log_add :', this.permission.order_log_add)
      return this.permission && this.permission.order_log_add === true
      // console.log('this.permission.order_log_add :', this.permission.order_log_add)
      return this.permission && this.permission.order_log_add === true;
    },
    hasPaddingBtnPermission () {
    hasPaddingBtnPermission() {
      // undefined 或 false 都返回 false,只有 true 返回 true
      console.log('权限检查:', this.permission)
      return this.permission && this.permission.order_log_review === true
      // console.log('权限检查:', this.permission)
      return this.permission && this.permission.order_log_review === true;
    },
    hasRecallPaddingBtnPermission () {
    hasRecallPaddingBtnPermission() {
      // undefined 或 false 都返回 false,只有 true 返回 true
      console.log('权限检查:', this.permission)
      return this.permission && this.permission.order_log_recall === true
      // console.log('权限检查:', this.permission)
      return this.permission && this.permission.order_log_recall === true;
    },
    //驳回按钮权限
    hasRejectionBtnPermission () {
    hasRejectionBtnPermission() {
      // undefined 或 false 都返回 false,只有 true 返回 true
      console.log('权限检查:', this.permission)
      return this.permission && this.permission.rejection_btn === true
      // console.log('权限检查:', this.permission)
      return this.permission && this.permission.rejection_btn === true;
    },
    //自己点发布
    userPublishPush (id) {
    userPublishPush(id) {
      this.$confirm('确定发布吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        let response = userPublish(id)
        this.$message.success('发布成功')
        this.fetchTableData()
      })
        let response = userPublish(id);
        this.$message.success('发布成功');
        this.fetchTableData();
      });
    },
    //删除
    deleteOrderLog (id) {
    deleteOrderLog(id) {
      this.$confirm('确定删除吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        let response = deleteOrderLog(id)
        this.$message.success('删除')
        this.fetchTableData()
      })
        let response = deleteOrderLog(id);
        this.$message.success('删除');
        this.fetchTableData();
      });
    },
    refreshChange () {
      this.fetchTableData()
    refreshChange() {
      this.fetchTableData();
    },
    //获取航线列表
    async asyncgetWaylineFileListByArea (name) {
      var wayLineListResponse = await getWaylineFileListByArea(this.userInfo.detail.areaCode)
      this.wayLineList = wayLineListResponse.data.data
    async asyncgetWaylineFileListByArea(name) {
      var wayLineListResponse = await getWaylineFileListByArea(this.userInfo.detail.areaCode);
      this.wayLineList = wayLineListResponse.data.data;
      this.initMapLine()
      this.initMapLine();
    },
    initMapLine (infos = {}) {
      let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id)
    initMapLine(infos = {}) {
      let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id);
      if (!currentLine) return
      if (!currentLine) return;
      // 异步解析kmz文件
      const analysis = async url => {
        return new Promise(async resolve => {
          const res = await analyzeKmzFile(`${url}?_t=${new Date().getTime()}`)
          const templateXML = await res.fileInfoObj['wpmz/template.kml']
          const templateXMLJSON = XMLToJSON(templateXML)?.['Document']
          const templateXMLObj = removeTextKey(templateXMLJSON.Folder)
          resolve(templateXMLObj)
        })
      }
          const res = await analyzeKmzFile(`${url}?_t=${new Date().getTime()}`);
          const templateXML = await res.fileInfoObj['wpmz/template.kml'];
          const templateXMLJSON = XMLToJSON(templateXML)?.['Document'];
          const templateXMLObj = removeTextKey(templateXMLJSON.Folder);
          resolve(templateXMLObj);
        });
      };
      const drawLine = async () => {
        let prexUrl = ref(import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key)
        const res = await analysis(prexUrl.value)
        if (!res.Placemark.length) return
        renderingLine(res)
      }
        let prexUrl = ref(import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key);
        const res = await analysis(prexUrl.value);
        if (!res.Placemark.length) return;
        renderingLine(res);
      };
      const renderingLine = lineObj => {
        const positions = lineObj.Placemark.map(item => {
          return item.Point.coordinates.split(',')
        })
          return item.Point.coordinates.split(',');
        });
        if (JSON.stringify(infos) != '{}') positions.unshift([
          infos[0].longitude,
          infos[0].latitude,
        ])
        if (JSON.stringify(infos) != '{}')
          positions.unshift([infos[0].longitude, infos[0].latitude]);
        this.$nextTick(() => {
          if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
            this.$refs.MapContainer.initAddEntity('polyline', positions)
            this.$refs.MapContainer.initAddEntity('polyline', positions);
          }
        })
      }
        });
      };
      drawLine()
      drawLine();
    },
    //可飞行机巢列表
    async getFlyingNestBy (waylineId) {
      this.initMapLine()
    async getFlyingNestBy(waylineId) {
      this.initMapLine();
      //按照航线来
      const params = {
        type: 0,
        waylineId: waylineId,
      }
      var wayLineListResponse = await getFlyingNestBy(params)
      this.device_sns = wayLineListResponse.data.data
      };
      var wayLineListResponse = await getFlyingNestBy(params);
      this.device_sns = wayLineListResponse.data.data;
    },
    //撤回
    async orderLogRecall (id) {
    async orderLogRecall(id) {
      this.$confirm('确定撤回则到草稿箱。', '是否撤回?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(async () => {
        let reposne = await orderLogRecall(id)
        this.handleSearch()
      })
        let reposne = await orderLogRecall(id);
        this.handleSearch();
      });
    },
    onLoad () {
      this.fetchTableData()
    onLoad() {
      this.fetchTableData();
    },
    /**
     * 通过
     */
    async orderLogPass (id) {
      let response = await orderLogPass(id)
      let data = response.data.data
      this.$message.success('审核通过')
      this.detailVisibleCopy = false
    async orderLogPass(id) {
      let response = await orderLogPass(id);
      let data = response.data.data;
      this.$message.success('审核通过');
      this.detailVisibleCopy = false;
    },
    /**
     * 驳回
     */
    async orderLogReject (id) {
    async orderLogReject(id) {
      this.$prompt('', '驳回原因', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(async ({ value }) => {
        let response = await orderLogReject(id, value)
        let data = response.data.data
        this.$message.success('驳回成果')
        this.detailVisibleCopy = false
      })
        let response = await orderLogReject(id, value);
        let data = response.data.data;
        this.$message.success('驳回成果');
        this.detailVisibleCopy = false;
      });
    },
  },
  watch: {
    tableData: {
      handler () {
      handler() {
        // this.updateTabCounts()
      },
      deep: true,
    },
  },
}
};
</script>
<style></style>
<style lang="scss" scoped>
@@ -1170,7 +1422,7 @@
    &-item {
      flex: 1;
      &> ::v-deep(.el-date-editor) {
      & > ::v-deep(.el-date-editor) {
        width: 100%;
        box-sizing: border-box;
      }
@@ -1303,7 +1555,7 @@
    justify-content: center;
    flex-wrap: wrap;
    &> ::v-deep(.el-button) {
    & > ::v-deep(.el-button) {
      flex: 1;
      max-width: 44px;
@@ -1327,7 +1579,7 @@
.flex-1 {
  flex: 1;
  &> ::v-deep(div) {
  & > ::v-deep(div) {
    width: 100% !important;
  }
}
src/views/wel/components/backlog.vue
@@ -8,20 +8,27 @@
          v-for="(item, index) in todos"
          :key="index"
          class="todo-item"
          :class="`status-${item.status}`"
          :style="getStatusStyle(item.status)"
          @click="jumporder(item)"
        >
          <div class="status-indicator"></div>
          <div
            class="status-indicator"
            :style="{ backgroundColor: getStatusColor(item.status) }"
          ></div>
          <div class="content-wrapper">
            <div class="main-content">
              <span class="status-tag">{{ statusMap[item.status] }}</span>
              <span class="todo-text">{{ item.event_name || item.dept_name}}</span>
              <span class="status-tag" :style="{ color: getStatusColor(item.status) }">{{
                permission.o_and_m_p_jump === true
                  ? zfstatusMap[item.status]
                  : statusMap[item.status]
              }}</span>
              <span class="todo-text">{{ item.name }}</span>
            </div>
            <div class="action-area">
              <img :src="st7" alt="" />
              <span class="todo-date">{{ item.job_create_time?.slice(0, 10) || item.begin_time?.slice(0, 10)}}</span>
              <span class="todo-date">{{ item.date?.slice(0, 10).replace(/-/g, '.') }}</span>
            </div>
          </div>
        </div>
@@ -32,47 +39,86 @@
<script setup>
import st7 from '@/assets/images/workbench/st7.png';
import { getList } from '@/api/tickets/ticket';
import { getList as getListLog } from '@/api/tickets/orderLog';
import { getdaiban } from '@/api/home/index';
import { onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
const router = useRouter();
const store = useStore();
const permission = computed(() => store.getters.permission);
console.log(permission.value.o_and_m_p_jump, 'permission');
const todos = ref([]);
const jumporder = val => {
  console.log('tiao', val);
  console.log('orderNumber', orderNumber);
const statusMap = {
  0: '待处理',
  2: '待审核',
  3: '处理中',
};
const statusMapColor = {
  0: { color: '#FF7411', background: '#FF7411', borderLeftColor: '#FF7411' },
  2: { color: '#FF472F', background: '#FF472F', borderLeftColor: '#FF472F' },
  3: { color: '#FFC300', background: '#FFC300', borderLeftColor: '#FFC300' },
};
const zfstatusMap = {
  1: '待审核',
};
const zfstatusMapColor = {
  1: { color: '#FF472F', background: '#FF472F', borderLeftColor: '#FF472F' },
};
const getStatusStyle = statusIndex => {
  if (permission.value.o_and_m_p_jump === true) {
    const orderNumber = val.job_info_num;
    const style = zfstatusMapColor[statusIndex] || {
      color: '#999',
      borderLeftColor: '#999',
    };
    return {
      color: style.color,
      borderLeft: `3px solid ${style.borderLeftColor}`,
    };
  } else {
    const style = statusMapColor[statusIndex] || {
      color: '#999',
      borderLeftColor: '#999',
    };
    return {
      color: style.color,
      borderLeft: `3px solid ${style.borderLeftColor}`,
    };
  }
};
// 获取状态对应的文字颜色
const getStatusColor = statusIndex => {
  if (permission.value.o_and_m_p_jump === true) {
    return zfstatusMapColor[statusIndex]?.color || '#999';
  } else {
    return statusMapColor[statusIndex]?.color || '#999';
  }
};
const getListMatter = async () => {
  console.log('permission.value.o_and_m_p_jump', permission.value.o_and_m_p_jump);
  if (permission.value.o_and_m_p_jump === true) {
    const res = await getdaiban(0);
    todos.value = res.data.data?.slice(0, 5);
  } else {
    const res = await getdaiban(1);
    todos.value = res.data.data?.slice(0, 5);
  }
};
const jumporder = val => {
  if (permission.value.o_and_m_p_jump === true) {
    const id = val.id;
    router.push({
      path: `/tickets/orderLog?orderNumber=${orderNumber}`,
      path: `/tickets/orderLog?id=${id}`,
      query: {
        id: id,
      },
    });
  } else {
    const orderNumber = val.event_num;
    router.push({
      path: `/tickets/ticket?orderNumber=${orderNumber}`,
    });
  }
};
const statusMap = {
  2: '待审核',
  3: '处理中',
  0: '待处理',
  4: '已完成',
};
const getListMatter = async () => {
  if (permission.value.o_and_m_p_jump === true) {
    const res = await getListLog({});
    console.log('2222', res.data.data.records);
    todos.value = res.data.data.records?.slice(0, 5);
  } else {
    const res = await getList({});
    todos.value = res.data.data.records?.slice(0, 5);
  }
};
onMounted(() => {
@@ -98,7 +144,7 @@
    .todo-items {
      display: grid;
      gap: 0.8rem;
      gap: 0.6rem;
      margin-top: 10px;
    }
@@ -165,58 +211,30 @@
    }
    // 状态颜色方案
    .status-2 {
      border-left-color: #ff6560;
      color: #ff6560;
    .status-0 {
      border-left-color: #ff7411;
      color: #ff7411;
      .status-indicator {
        background: #ff6560;
        background: #ff7411;
      }
    }
    .status-0 {
      border-left-color: #5d77fb;
      color: #5d77fb;
    .status-2 {
      border-left-color: #ff472f;
      color: #ff472f;
      .status-indicator {
        background: #5d77fb;
        background: #ff472f;
      }
    }
    .status-3 {
      border-left-color: #ff8b26;
      color: #ff8b26;
      border-left-color: #ffc300;
      color: #ffc300;
      .status-indicator {
        background: #ff8b26;
        background: #ffc300;
      }
    }
  }
  //   @media (max-width: 768px) {
  //     .todo-list-container {
  //       padding: 1rem;
  //       .content-wrapper {
  //         flex-direction: column;
  //         align-items: flex-start !important;
  //         gap: 0.5rem !important;
  //       }
  //       .action-area {
  //         width: 100%;
  //         justify-content: space-between;
  //       }
  //     }
  //   }
  //   @media (max-width: 480px) {
  //     .main-content {
  //       flex-direction: column;
  //       align-items: flex-start !important;
  //     }
  //     .status-tag {
  //       margin-bottom: 0.3rem;
  //     }
  //   }
}
</style>
src/views/wel/components/flyratio.vue
@@ -61,27 +61,31 @@
  { immediate: true }
);
const pieInit = resList => {
  // 处理数据,过滤掉没有name的项
  const validData = resList.filter(item => item.name);
  // 1. 过滤无效数据并排序
  const validData = resList
    .filter(item => item.name)
    .sort((a, b) => b.value - a.value); // 从大到小排序
  const colors = [
  '#F87E04',
  '#FFC400',
  '#08BC44',
  '#07B5FF',
  '#A98DFF',
  '#9ABFFF'
];
    '#F87E04',  // 橙色
    '#FFC400',  // 黄色
    '#08BC44',  // 绿色
    '#07B5FF',  // 蓝色
    '#A98DFF',  // 紫色
    '#9ABFFF'   // 浅蓝
  ];
  // 2. 准备图表数据
  const optionData = {
    yAxisData: validData.map(item => item.name),
    seriesData: validData.map(item => item.value),
  };
  // 3. ECharts配置项
  const option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow',
      },
      axisPointer: { type: 'shadow' },
      formatter: '{b}: {c}',
    },
    grid: {
@@ -92,60 +96,44 @@
    },
    xAxis: {
      type: 'value',
      splitLine: {
        lineStyle: {
          color: '#E5E5E5',
        },
      },
      axisLabel: {
        color: '#35455aa6',
      },
      splitLine: { lineStyle: { color: '#E5E5E5' } },
      axisLabel: { color: '#35455aa6' },
      boundaryGap: [0, 0.01],
    },
    yAxis: {
      type: 'category',
      data: optionData.yAxisData, // 使用处理后的分类数据
      axisLabel: {
        color: '#35455aa6',
      },
      axisLine: {
        lineStyle: {
          color: '#D1D1D1',
        },
      },
      axisTick: {
        show: false,
      },
      data: optionData.yAxisData,
      axisLabel: { color: '#35455aa6' },
      axisLine: { lineStyle: { color: '#D1D1D1' } },
      axisTick: { show: false },
      // 4. 确保排序后的数据从上到下显示(最大值在顶部)
      inverse: true
    },
    series: [
      {
        type: 'bar',
        data: optionData.seriesData, // 使用处理后的数值数据
        itemStyle: {
          // 修改为根据索引返回不同颜色
    series: [{
      type: 'bar',
      data: optionData.seriesData,
      itemStyle: {
        color: (params) => {
          if (params.dataIndex < 5) {
            // 前5条使用固定颜色
            return colors[params.dataIndex % colors.length];
          }
          // 第6条及之后保持原渐变
          return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
            { offset: 0, color: '#93BAFF' },
            { offset: 1, color: '#C5DEFF' }
          ]);
          // 前6项使用固定颜色循环,之后使用渐变
          return params.dataIndex < colors.length
            ? colors[params.dataIndex]
            : new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                { offset: 0, color: '#93BAFF' },
                { offset: 1, color: '#C5DEFF' }
              ]);
        }
        },
        barWidth: '30%',
        label: {
          show: true,
          position: 'right',
          formatter: '{c}',
        },
      },
    ],
      barWidth: '30%',
      label: {
        show: true,
        position: 'right',
        formatter: '{c}',
      },
    }]
  };
  jcchart.value.setOption(option);
  // 5. 设置图表选项
  jcchart.value.setOption(option, true); // true表示不合并选项
};
onMounted(() => {
  getIndustryJobNumPieChart();
src/views/wel/components/statistics.vue
@@ -202,7 +202,7 @@
}
const getStaticsList = () => {
  getStatics(userInfo.value.detail.areaCode,).then(res => {
  console.log(permission, 111)
  // console.log(permission, 111)
    if (permission.value?.device_statistics_six) {
      newtitleData.value = res.data.data
      return
src/views/wel/index.vue
@@ -116,16 +116,16 @@
import flyImg2 from '@/assets/images/workbench/fy3.png';
import flyImg3 from '@/assets/images/workbench/fy4.png';
import statistics from './components/statistics.vue';
let checked = ref('CURRENT_WEEK');
let checked = ref('CURRENT_YEAR');
let timeListStr = ['本周', '本月', '本年'];
let timeListEnum = ['CURRENT_WEEK', 'CURRENT_MONTH', 'CURRENT_YEAR'];
const params = ref({
  date_enum: 'CURRENT_WEEK',
  date_enum: 'CURRENT_YEAR',
  device_sn: '',
  end_date: undefined,
  start_date: undefined,
});
const dateSelect = ref('CURRENT_WEEK');
const dateSelect = ref('CURRENT_YEAR');
let timeClick = (item, index) => {
  checked.value = item;
  params.value.date_enum = item;
@@ -138,9 +138,9 @@
// 跳转
const jumpshebei= ()=>{}
const eventTypeList = ref([
  { name: '待审核', value: 0, img: overviewImg2, color: '#FF6560', status: '2', rate: 0 },
  { name: '待处理', value: 0, img: overviewImg3, color: '#5D77FB', status: '0', rate: 0 },
  { name: '处理中', value: 0, img: overviewImg4, color: '#FF8B26', status: '3', rate: 0 },
  { 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 },
]);
const keyMapping = {
@@ -214,7 +214,7 @@
  };
  const echartsOption = {
    color: ['#FF6560', '#5D77FB', '#FF8B26', '#0291A1'],
    color: ['#FF472F', '#FF7411', '#FFC300', '#0291A1'],
    tooltip: {
      trigger: 'item',
      padding: 0,
@@ -306,8 +306,9 @@
          hasDuration = true;
          break;
        case '飞行里程':
          // 转换为万公里 (假设原始单位是米)
          flight_distance.push((parseFloat(item.value) / 1000000 || 0).toFixed(2));
          // 转换为万公 (假设原始单位是米)
          // flight_distance.push((parseFloat(item.value) / 10 || 0));
          flight_distance.push((parseFloat(item.value)  || 0));
          hasDistance = true;
          break;
        case '任务成果':