无人机管理后台前端(已迁走)
chenyao
2025-09-15 fb93d63d984a98d10e186c9507547b8e65d6bd38
feat:更新删除和飞行日志
4 files modified
1 files renamed
132 ■■■■■ changed files
src/api/logs.js 8 ●●●● patch | view | raw | blame | history
src/views/airspace/airspaceType.vue 26 ●●●● patch | view | raw | blame | history
src/views/dataCenter/dataCenter.vue 4 ●●● patch | view | raw | blame | history
src/views/flightLog/flightLog.vue 92 ●●●● patch | view | raw | blame | history
src/views/operatingIncome/operatingIncome.vue 2 ●●● patch | view | raw | blame | history
src/api/logs.js
@@ -64,14 +64,10 @@
};
// 历史轨迹记录
export const getHistoryTrack = (workspaceId, page, page_size) => {
export const getHistoryTrack = (params) => {
  return request({
    url: '/drone-device-core/log/droneFlightLog/page',
    method: 'get',
    params: {
      page,
      page_size,
      workspaceId,
    },
    params
  })
}
src/views/airspace/airspaceType.vue
@@ -73,7 +73,7 @@
</template>
<script setup>
import { getAirSpaceTypeList, airSpaceTypeEdit, airSpaceTypeAdd, airSpaceTypeDelete } from '@/api/airspace/airspace';
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
const total = ref(0)
const params = ref({
@@ -126,19 +126,21 @@
  rowView.value = row
}
function handleDelete (row) {
  // 确定要删除么?
  ElMessage({
    message: '确定要删除么?',
  ElMessageBox.confirm('确定将选择数据删除?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
    showClose: true,
    onClose: () => {
      airSpaceTypeDelete(row.id).then(res => {
        ElMessage.success('删除成功')
        getList()
      })
    }
  }).then(() => {
    airSpaceTypeDelete(row.id).then(res => {
      ElMessage.success('删除成功')
      getList()
    })
  }).catch(() => {
    ElMessage({
      type: 'info',
      message: '已取消删除'
    })
  })
}
function handleAdd() {
  titleTxt.value = '新增'
src/views/dataCenter/dataCenter.vue
@@ -145,7 +145,7 @@
              <span>{{ resultTypeMap[row?.resultType] }}</span>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="200" align="center">
          <el-table-column label="操作" width="240" align="center">
            <template #default="scope">
              <el-button icon="el-icon-view" type="text" @click="lookDetail(scope.row)"
                >查看</el-button
@@ -164,6 +164,8 @@
              >
                <img :src="positionicon" class="custom-icon" />定位</el-button
              >
              <el-button type="text" @click="handleStart"><el-icon><Star /></el-icon>收藏</el-button>
              <el-button type="text" @click="handleShare"><el-icon><Share /></el-icon>分享</el-button>
            </template>
          </el-table-column>
        </el-table>
src/views/flightLog/flightLog.vue
File was renamed from src/views/monitor/log/flight.vue
@@ -3,11 +3,15 @@
  <div class="flight">
    <div class="search-box">
      <el-form :model="params" inline>
        <el-form-item label="类型名称:">
          <el-input v-model="params.algName" placeholder="请输入空域名称" clearable />
        </el-form-item>
        <el-form-item label="创建人:">
          <el-input v-model="params.algName" placeholder="请输入空域名称" clearable />
        <el-form-item label="日期:">
          <!-- <el-picker v-model="params.start_time" type="date" placeholder="开始日期" value-format="yyyy-MM-dd"></el-picker> -->
          <el-date-picker
            v-model="params.start_time"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getList">搜索</el-button>
@@ -15,31 +19,43 @@
        </el-form-item>
      </el-form>
      <div>
        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增类型</el-button>
        <el-button :type="tabType === '全部'?'primary':'default'" @click="handleAll"><el-icon><Folder /></el-icon>全部</el-button>
        <el-button :type="tabType === '收藏'?'primary':'default'" @click="handleStartList"><el-icon><Star /></el-icon>我的收藏</el-button>
      </div>
    </div>
    <div class="mange-table">
            <el-table border :data="tableList" class="custom-header">
                <el-table-column label="序号" type="index" width="60"></el-table-column>
        <el-table-column prop="model_name" label="类型名称" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="alg_type" label="创建时间" align="center"></el-table-column>
        <el-table-column prop="alg_type" label="创建人" align="center"></el-table-column>
                <el-table-column label="操作" width="180" align="center">
        <el-table-column prop="title" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="device_name" label="无人机" align="center"></el-table-column>
        <el-table-column prop="start_time" label="开始时间" align="center">
          <template #default="scope">
            {{ timeFormatConvert(scope.row.start_time) }}
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="结束时间" align="center">
          <template #default="scope">
            {{ timeFormatConvert(scope.row.end_time) }}
          </template>
        </el-table-column>
                <el-table-column label="操作" width="200" align="center">
                    <template #default="scope">
            <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button>
                        <el-button icon="el-icon-delete" type="text" @click="handleDelete">删除</el-button>
            <!-- <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button> -->
                        <!-- <el-button icon="el-icon-delete" type="text" @click="handleDelete">删除</el-button> -->
            <el-button type="text" @click="handleStart"><el-icon><Star /></el-icon>收藏</el-button>
            <el-button type="text" @click="handleExport"><el-icon><Download /></el-icon>导出</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div class="pagination">
            <el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" background
                :page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="params.current"
                v-model:page-size="params.size" layout="total, sizes, prev, pager, next, jumper" :total="total"
                :page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="params.page"
                v-model:page-size="params.page_size" layout="total, sizes, prev, pager, next, jumper" :total="total"
                @size-change="handleSizeChange" @current-change="handleCurrentChange" />
        </div>
  </div>
  <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看"
  <!-- <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看"
        :width="pxToRem(600)" :close-on-click-modal="false" :destroy-on-close="true">
        <div class="content">
      <table class="view-table" border>
@@ -65,17 +81,16 @@
        </div>
      </el-form>
    </div>
    </el-dialog>
    </el-dialog> -->
</template>
<script setup>
// import { getHistoryTrack } from '@/api/log';
import { getHistoryTrack } from '@/api/logs';
const total = ref(0)
const params = ref({
  current: 1,
  size: 10,
  algName: '',
  algTypeCode: '',
  workspaceId: '6566662f-17c5-44f1-89d2-f09b37b81794',
  page: '1',
  page_size: '10',
});
let tableList = ref([])
@@ -86,7 +101,7 @@
let isShowEditView = ref(false)
let sfTypes = ref([])
let tabType = ref('全部')
const ruleFormRef = ref()
let editParams = ref({
  model_name: '',
@@ -138,18 +153,24 @@
  ],
})
function timeFormatConvert(time) {
  const date = new Date(time);
  return date.toLocaleString();
}
function cancelSearch() {
  params.value = {
    algName: '',
    algTypeCode: '',
    workspaceId: '',
    page: '1',
    page_size: '10',
  }
  getList()
}
function getList() {
  getAlgorithmManageList(params.value).then(res => {
    tableList.value = res.data.data.records || []
    total.value = res.data.data.total || 0
  getHistoryTrack(params.value).then(res => {
    tableList.value = res.data.data.list || []
    total.value = res.data.data.pagination.total || 0
  })
}
function handleDetail(row) {
@@ -164,6 +185,14 @@
  // editParams.value = { ...row }
}
function handleAll() {
  tabType.value = '全部'
}
function handleStartList() {
  tabType.value = '收藏'
}
async function submit(formValidate) {
  if (!formValidate) return
  await formValidate.validate((valid, fields) => {
@@ -176,6 +205,15 @@
  })
}
function handleSizeChange(val) {
  params.value.page_size = val
  getList()
}
function handleCurrentChange(val) {
  params.value.page = val
  getList()
}
onMounted(() => {
  getList()
})
src/views/operatingIncome/operatingIncome.vue
@@ -82,7 +82,7 @@
    </el-dialog>
</template>
<script setup>
import { getAlgorithmManageList, algorithmManageEdit } from '@/api/operatingIncome/operatingIncome';
import { getAlgorithmManageList, algorithmManageEdit } from '@/api/airspace/airspace';
import { getDictionaryByCode } from '@/api/system/dictbiz';
const total = ref(0)