无人机管理后台前端(已迁走)
chenyao
2025-09-30 4809afba10333e1e911c795d28b8c68fb364d593
src/views/flightLog/flightLog.vue
@@ -68,9 +68,10 @@
            </el-select>
          </template>
        </el-table-column>
            <el-table-column label="操作" width="300" align="center">
            <el-table-column label="操作" width="340" align="center">
               <template #default="scope">
            <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button>
            <el-button icon="el-icon-view" type="text" v-if="!scope.row.isHL" @click="handleWarnInfo(scope.row)">警告</el-button>
                  <el-button icon="el-icon-delete" type="text" @click="handleDelete(scope.row)">删除</el-button> 
            <el-button type="text" @click="handleStar(scope.row)">
              <el-icon><Star /></el-icon>
@@ -108,6 +109,18 @@
    <!-- </div> -->
    </div>
   </el-dialog>
  <el-dialog class="ztzf-dialog" append-to-body v-model="isShowWarnView" title="查看警告信息" :width="pxToRem(1000)" :close-on-click-modal="false" :destroy-on-close="true">
    <el-table border :data="warningList" height="300">
      <el-table-column label="序号" type="index" width="60"></el-table-column>
      <el-table-column prop="warn_info" label="内容" align="center" show-overflow-tooltip></el-table-column>
    </el-table>
    <template #footer>
        <span class="dialog-footer">
          <el-button @click="isShowWarnView = false">取 消</el-button>
          <el-button type="primary" @click="hlSubmit">忽略</el-button>
        </span>
    </template>
  </el-dialog>
</template>
<script setup>
import { getHistoryTrack, cancelStar, addStar, updateDroneFlight, droneFlightLogInfoPage } from '@/api/logs';
@@ -115,6 +128,7 @@
import { downloadXls } from '@/utils/util';
import { exportBlob } from '@/api/common'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
import { dateNow } from '@/utils/date';
const total = ref(0)
let rangTime = ref([])
@@ -131,6 +145,8 @@
let tableList = ref([])
let isShowView = ref(false)
let isShowWarnView = ref(false)
let warningList = ref([])
let tabType = ref('全部')
@@ -163,8 +179,24 @@
    23, 59, 59
  ).getTime() : ''
  getHistoryTrack(params.value).then(res => {
    tableList.value = res.data.data.list || []
    tableList.value = res.data.data.list.map(item => {
      return {
        ...item,
        isHL: false,
        children: [{
          id: item.id,
          time: timeFormatConvert(dateNow()),
          warn_info: '您今天误操作,今后请注意!'
        },
          {
            id: item.id,
            time: timeFormatConvert(dateNow()),
            warn_info: '您今天误操作,今后请注意!'
          }],
      }
    })
    total.value = res.data.data.pagination.total || 0
  })
}
@@ -192,6 +224,22 @@
    detailTotal.value = res.data.data.total
  })
}
// 警告信息
let saveId = ref('')
function handleWarnInfo(row) {
  isShowWarnView.value = true
  saveId.value = row.id
  warningList.value = tableList.value.find(item => item.id === row.id).children
}
function hlSubmit() {
  // 设置isHL为true
  tableList.value.map(item => {
    if (item.id === saveId.value) {
      item.isHL = true
      isShowWarnView.value = false
    }
  })
}
// 分页
function handleSizeChangeDetails(val) {
  detailParams.value.size = val