riku
2025-02-13 660021a28de9b84b4362c171fdbbf89587f0c5af
src/components/mission/MissionManage.vue
@@ -1,13 +1,17 @@
<template>
  <el-button
  <!-- <el-button
    type="primary"
    icon="Memo"
    class="el-button-custom p-events-auto"
    @click="dialogVisible = !dialogVisible"
  >
    任务管理
  </el-button>
  <CardDialog v-model="dialogVisible" title="走航任务管理">
  </el-button> -->
  <CardDialog
    :model-value="modelValue"
    @changed="handleChange"
    title="走航任务管理"
  >
    <el-row class="mission-table">
      <el-col :span="20">
        <el-table
@@ -17,7 +21,7 @@
          :show-overflow-tooltip="true"
          border
          height="64vh"
          row-class-name="t-row"
          row-class-name="t-row-normal"
          cell-class-name="t-cell"
          header-row-class-name="t-header-row"
          header-cell-class-name="t-header-cell"
@@ -34,43 +38,54 @@
            label="开始时间"
            align="center"
            :formatter="timeFormatter"
            width="150"
          />
          <el-table-column
            prop="endTime"
            label="结束时间"
            align="center"
            :formatter="timeFormatter"
            width="150"
          />
          <el-table-column label="管理" width="70" align="center">
          <el-table-column label="管理" width="160" align="center">
            <template #default="{ row }">
              <MissionEdit mode="update"></MissionEdit>
              <el-button
                type="primary"
                size="small"
                icon="Delete"
                class="el-button-custom"
                @click="deleteMission(row)"
                >删除</el-button
              >
              ></el-button>
              <el-button
                :loading="row.downloadLoading"
                type="primary"
                size="small"
                icon="Document"
                class="el-button-custom"
                @click="downloadReport(row)"
              ></el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
      <el-col :span="4" class="flex-col">
        <div>
          <!-- <el-button type="primary" class="el-button-custom">
        <!-- <div> -->
        <!-- <el-button type="primary" class="el-button-custom">
                新建任务
              </el-button> -->
          <MissionCreate></MissionCreate>
        </div>
        <div>
        <MissionEdit></MissionEdit>
        <!-- </div> -->
        <!-- <div>
          <el-button type="primary" class="el-button-custom">
            数据导入
          </el-button>
        </div>
        <div>
        </div> -->
        <!-- <div>
          <el-button type="primary" class="el-button-custom">
            下载模板
          </el-button>
        </div>
        </div> -->
      </el-col>
    </el-row>
  </CardDialog>
@@ -84,6 +99,7 @@
</template>
<script>
import moment from 'moment';
import missionApi from '@/api/missionApi';
import { mapStores } from 'pinia';
import { useMissionStore } from '@/stores/mission';
import { useFetchData } from '@/composables/fetchData';
@@ -93,7 +109,10 @@
    const { loading, fetchData } = useFetchData();
    return { loading, fetchData };
  },
  props: {},
  props: {
    modelValue: Boolean
  },
  emits: ['update:modelValue'],
  data() {
    return {
      dialogVisible: false,
@@ -105,12 +124,22 @@
    ...mapStores(useMissionStore)
  },
  methods: {
    handleChange(value) {
      this.$emit('update:modelValue', value);
    },
    deleteMission(row) {
      this.onConfirm = () => {
        this.missionStore.deleteMission(row.missionCode);
      };
      this.msgBoxVisible = true;
    },
    downloadReport(row) {
      row.downloadLoading = true;
      missionApi
        .downloadReport(row.missionCode)
        .finally(() => (row.downloadLoading = false));
    },
    // eslint-disable-next-line no-unused-vars
    timeFormatter(row, col, cellValue, index) {
      return moment(cellValue).format('YYYY-MM-DD HH:mm:ss');
    }
@@ -138,6 +167,10 @@
}
.mission-table {
  height: 60vh;
  /* height: 60vh; */
}
:deep(.t-row-normal) {
  background-color: transparent !important;
}
</style>