Răsfoiți Sursa

feat: 飞行任务/飞行任务分解

wanggaokun 11 luni în urmă
părinte
comite
f151adf476

+ 121 - 0
src/api/interface/als/flightSplitTask.ts

@@ -0,0 +1,121 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface FlightSplitTaskVO extends BaseEntity {
+  /**
+   * 机型
+   */
+  aircraftModel: string
+
+  /**
+   * 机组
+   */
+  aircraftGroup: string
+
+  /**
+   * 时长
+   */
+  duration: string
+
+  /**
+   * 设备
+   */
+  device: string
+
+  /**
+   * 数量
+   */
+  deviceCount: number
+
+  /**
+   * 单位
+   */
+  unit: string
+
+  /**
+   * 备注
+   */
+  remark: string
+}
+
+export interface FlightSplitTaskForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 飞行编号
+   */
+  flightId?: string | number
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 机组
+   */
+  aircraftGroup?: string
+
+  /**
+   * 时长
+   */
+  duration?: string
+
+  /**
+   * 设备
+   */
+  device?: string
+
+  /**
+   * 数量
+   */
+  deviceCount?: number
+
+  /**
+   * 单位
+   */
+  unit?: string
+
+  /**
+   * 备注
+   */
+  remark?: string
+}
+
+export interface FlightSplitTaskQuery extends PageQuery {
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 机组
+   */
+  aircraftGroup?: string
+
+  /**
+   * 时长
+   */
+  duration?: string
+
+  /**
+   * 设备
+   */
+  device?: string
+
+  /**
+   * 数量
+   */
+  deviceCount?: number
+
+  /**
+   * 单位
+   */
+  unit?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 131 - 0
src/api/interface/als/flightTask.ts

@@ -0,0 +1,131 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface FlightTaskVO extends BaseEntity {
+  /**
+   * 架次号
+   */
+  sortieNo: number
+
+  /**
+   * 机型
+   */
+  aircraftModel: string
+
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 起飞时间
+   */
+  startTime: string
+
+  /**
+   * 降落时间
+   */
+  endTime: string
+
+  /**
+   * 飞行课目
+   */
+  trainExercise: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface FlightTaskForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 架次号
+   */
+  sortieNo?: number
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 起飞时间
+   */
+  startTime?: string
+
+  /**
+   * 降落时间
+   */
+  endTime?: string
+
+  /**
+   * 飞行课目
+   */
+  trainExercise?: string
+}
+
+export interface FlightTaskQuery extends PageQuery {
+  /**
+   * 架次号
+   */
+  sortieNo?: number
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 起飞时间
+   */
+  startTime?: string
+
+  /**
+   * 降落时间
+   */
+  endTime?: string
+
+  /**
+   * 飞行课目
+   */
+  trainExercise?: string
+
+  /**
+   * 状态
+   */
+  status?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 70 - 0
src/api/modules/als/flightSplitTask.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { FlightSplitTaskVO, FlightSplitTaskForm, FlightSplitTaskQuery } from '@/api/interface/als/flightSplitTask'
+/**
+ * @name 查询飞行分解任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listFlightSplitTaskApi = (query: FlightSplitTaskQuery) => {
+  return http.get<FlightSplitTaskVO[]>('/als/flightSplitTask/list', query, { loading: true })
+}
+
+/**
+ * @name 查询飞行分解任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getFlightSplitTaskApi = (id: string | number) => {
+  return http.get<FlightSplitTaskVO>(`/als/flightSplitTask/${id}`)
+}
+
+/**
+ * @name 新增飞行分解任务
+ * @param data data
+ * @returns returns
+ */
+export const addFlightSplitTaskApi = (data: FlightSplitTaskForm) => {
+  return http.post<any>('/als/flightSplitTask', data, { loading: false })
+}
+
+/**
+ * @name 修改飞行分解任务
+ * @param data data
+ * @returns returns
+ */
+export const updateFlightSplitTaskApi = (data: FlightSplitTaskForm) => {
+  return http.put<any>('/als/flightSplitTask', data, { loading: false })
+}
+
+/**
+ * @name 删除飞行分解任务
+ * @param id id
+ * @returns returns
+ */
+export const delFlightSplitTaskApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/flightSplitTask/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/als/flightSplitTask/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importFlightSplitTaskDataApi = (data: any) => {
+  return http.post('/als/flightSplitTask/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportFlightSplitTaskApi = (data: any) => {
+  return http.post('/als/flightSplitTask/export', data)
+}

+ 70 - 0
src/api/modules/als/flightTask.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { FlightTaskVO, FlightTaskForm, FlightTaskQuery } from '@/api/interface/als/flightTask'
+/**
+ * @name 查询飞行任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listFlightTaskApi = (query: FlightTaskQuery) => {
+  return http.get<FlightTaskVO[]>('/als/flightTask/list', query, { loading: true })
+}
+
+/**
+ * @name 查询飞行任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getFlightTaskApi = (id: string | number) => {
+  return http.get<FlightTaskVO>(`/als/flightTask/${id}`)
+}
+
+/**
+ * @name 新增飞行任务
+ * @param data data
+ * @returns returns
+ */
+export const addFlightTaskApi = (data: FlightTaskForm) => {
+  return http.post<any>('/als/flightTask', data, { loading: false })
+}
+
+/**
+ * @name 修改飞行任务
+ * @param data data
+ * @returns returns
+ */
+export const updateFlightTaskApi = (data: FlightTaskForm) => {
+  return http.put<any>('/als/flightTask', data, { loading: false })
+}
+
+/**
+ * @name 删除飞行任务
+ * @param id id
+ * @returns returns
+ */
+export const delFlightTaskApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/flightTask/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/als/flightTask/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importFlightTaskDataApi = (data: any) => {
+  return http.post('/als/flightTask/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportFlightTaskApi = (data: any) => {
+  return http.post('/als/flightTask/export', data)
+}

+ 235 - 0
src/views/als/flightSplitTask/index.vue

@@ -0,0 +1,235 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listFlightSplitTaskApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:flightSplitTask:add']" icon="CirclePlus" @click="openDialog(1, '飞行分解任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:flightSplitTask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['als:flightSplitTask:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:flightSplitTask:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:flightSplitTask:query']" @click="openDialog(3, '飞行分解任务查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:flightSplitTask:edit']" @click="openDialog(2, '飞行分解任务编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:flightSplitTask:remove']" @click="deleteFlightSplitTask(scope.row)">
+          删除
+        </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <ImportExcel ref="dialogRef" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="FlightSplitTask">
+import { useHandleData } from '@/hooks/useHandleData'
+import { ElMessageBox } from 'element-plus'
+import ImportExcel from '@/components/ImportExcel/index.vue'
+import TaskDialog from '@/components/TaskDialog/index.vue'
+import FormDialog from '@/components/FormDialog/index.vue'
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+import {
+  listFlightSplitTaskApi,
+  delFlightSplitTaskApi,
+  addFlightSplitTaskApi,
+  updateFlightSplitTaskApi,
+  importTemplateApi,
+  importFlightSplitTaskDataApi,
+  exportFlightSplitTaskApi,
+  getFlightSplitTaskApi
+} from '@/api/modules/als/flightSplitTask'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除飞行分解任务信息
+const deleteFlightSplitTask = async (params: any) => {
+  await useHandleData(delFlightSplitTaskApi, params.id, '删除【' + params.id + '】飞行分解任务')
+  proTable.value?.getTableList()
+}
+
+// 批量删除飞行分解任务信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delFlightSplitTaskApi, ids, '删除所选飞行分解任务信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出飞行分解任务列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出飞行分解任务数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportFlightSplitTaskApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+// 批量添加飞行分解任务
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '飞行分解任务',
+    tempApi: importTemplateApi,
+    importApi: importFlightSplitTaskDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getFlightSplitTaskApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addFlightSplitTaskApi : updateFlightSplitTaskApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'aircraftModel',
+    label: '机型',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftGroup',
+    label: '机组',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'duration',
+    label: '时长',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'device',
+    label: '设备',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'deviceCount',
+    label: '数量',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'unit',
+    label: '单位',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '机型',
+      prop: 'aircraftModel',
+      rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机型'
+      }
+    },
+    {
+      label: '机组',
+      prop: 'aircraftGroup',
+      rules: [{ required: true, message: '机组不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机组'
+      }
+    },
+    {
+      label: '时长',
+      prop: 'duration',
+      rules: [{ required: true, message: '时长不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入时长'
+      }
+    },
+    {
+      label: '设备',
+      prop: 'device',
+      rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入设备'
+      }
+    },
+    {
+      label: '数量',
+      prop: 'deviceCount',
+      rules: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入数量'
+      }
+    },
+    {
+      label: '单位',
+      prop: 'unit',
+      rules: [{ required: true, message: '单位不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入单位'
+      }
+    },
+    {
+      label: '备注',
+      prop: 'remark',
+      compOptions: {
+        placeholder: '请输入备注'
+      }
+    }
+  ]
+}
+</script>

+ 244 - 0
src/views/als/flightTask/index.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listFlightTaskApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:flightTask:add']" icon="CirclePlus" @click="openDialog(1, '飞行任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:flightTask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['als:flightTask:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:flightTask:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:flightTask:query']" @click="openDialog(3, '飞行任务查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:flightTask:edit']" @click="openDialog(2, '飞行任务编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:flightTask:remove']" @click="deleteFlightTask(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <ImportExcel ref="dialogRef" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="FlightTask">
+import { useHandleData } from '@/hooks/useHandleData'
+import { ElMessageBox } from 'element-plus'
+import ImportExcel from '@/components/ImportExcel/index.vue'
+import TaskDialog from '@/components/TaskDialog/index.vue'
+import FormDialog from '@/components/FormDialog/index.vue'
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+import {
+  listFlightTaskApi,
+  delFlightTaskApi,
+  addFlightTaskApi,
+  updateFlightTaskApi,
+  importTemplateApi,
+  importFlightTaskDataApi,
+  exportFlightTaskApi,
+  getFlightTaskApi
+} from '@/api/modules/als/flightTask'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除飞行任务信息
+const deleteFlightTask = async (params: any) => {
+  await useHandleData(delFlightTaskApi, params.id, '删除【' + params.id + '】飞行任务')
+  proTable.value?.getTableList()
+}
+
+// 批量删除飞行任务信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delFlightTaskApi, ids, '删除所选飞行任务信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出飞行任务列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出飞行任务数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportFlightTaskApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+// 批量添加飞行任务
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '飞行任务',
+    tempApi: importTemplateApi,
+    importApi: importFlightTaskDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getFlightTaskApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addFlightTaskApi : updateFlightTaskApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'sortieNo',
+    label: '架次号',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftModel',
+    label: '机型',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'startTime',
+    label: '起飞时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'endTime',
+    label: '降落时间',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'trainExercise',
+    label: '飞行课目',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'createBy',
+    label: '创建人',
+    width: 120
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    width: 120
+  },
+  {
+    prop: 'updateBy',
+    label: '更新人',
+    width: 120
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间',
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '架次号',
+      prop: 'sortieNo',
+      rules: [{ required: true, message: '架次号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入架次号'
+      }
+    },
+    {
+      label: '机型',
+      prop: 'aircraftModel',
+      rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机型'
+      }
+    },
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '起飞时间',
+      prop: 'startTime',
+      rules: [{ required: true, message: '起飞时间不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择起飞时间'
+      }
+    },
+    {
+      label: '降落时间',
+      prop: 'endTime',
+      rules: [{ required: true, message: '降落时间不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入降落时间'
+      }
+    },
+    {
+      label: '飞行课目',
+      prop: 'trainExercise',
+      rules: [{ required: true, message: '飞行课目不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入飞行课目'
+      }
+    }
+  ]
+}
+</script>

+ 2 - 0
tsconfig.json

@@ -23,6 +23,8 @@
     "esModuleInterop": true,
     "lib": ["ESNext", "DOM"],
     "skipLibCheck": true,
+    "allowJs": true,
+    "removeComments": true,
     "noEmit": true,
     "baseUrl": "./",
     "paths": {