riku
2025-08-20 a09f984cbe2369e13d8694e91c4f8165ec6c2ba9
src/components/mission/MissionManage.vue
@@ -7,11 +7,7 @@
  >
    任务管理
  </el-button> -->
  <CardDialog
    :model-value="modelValue"
    @changed="handleChange"
    title="走航任务管理"
  >
  <CardDialog v-bind="$attrs" title="走航任务管理">
    <el-row class="mission-table">
      <el-col :span="20">
        <el-table
@@ -21,7 +17,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"
@@ -38,41 +34,57 @@
            label="开始时间"
            align="center"
            :formatter="timeFormatter"
            width="150"
          />
          <el-table-column
            prop="endTime"
            label="结束时间"
            align="center"
            :formatter="timeFormatter"
            width="150"
          />
          <el-table-column label="管理" width="140" align="center">
          <el-table-column label="管理" width="160" align="center">
            <template #default="{ row }">
              <!-- <MissionEdit mode="update"></MissionEdit> -->
              <el-button
                type="primary"
                size="small"
                icon="EditPen"
                class="el-button-custom"
                @click="updateMission(row)"
              ></el-button>
              <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
              > -->
              ></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>
        <el-button
          type="primary"
          class="el-button-custom"
          @click="createMission"
        >
          新建任务
        </el-button>
        <!-- </div> -->
        <!-- <div>
          <el-button type="primary" class="el-button-custom">
            数据导入
@@ -93,6 +105,12 @@
    msg="确认是否删除该走航任务"
    confirmText="删除"
  ></MessageBox>
  <MissionEdit
    v-model="dialogVisible"
    width="30%"
    :mode="editMode"
    :mission="selectedMission"
  ></MissionEdit>
</template>
<script>
import moment from 'moment';
@@ -107,22 +125,35 @@
    return { loading, fetchData };
  },
  props: {
    modelValue: Boolean
    // modelValue: Boolean
  },
  emits: ['update:modelValue'],
  // emits: ['update:modelValue'],
  data() {
    return {
      dialogVisible: false,
      msgBoxVisible: false,
      onConfirm: undefined
      onConfirm: undefined,
      // 任务编辑模式,create:创建新任务,update:编辑已有任务
      editMode: 'create',
      // 选中的待编辑任务
      selectedMission: undefined
    };
  },
  computed: {
    ...mapStores(useMissionStore)
  },
  methods: {
    handleChange(value) {
      this.$emit('update:modelValue', value);
    // handleChange(value) {
    //   this.$emit('update:modelValue', value);
    // },
    createMission() {
      this.editMode = 'create';
      this.dialogVisible = true;
    },
    updateMission(row) {
      this.editMode = 'update';
      this.selectedMission = row;
      this.dialogVisible = true;
    },
    deleteMission(row) {
      this.onConfirm = () => {
@@ -166,4 +197,8 @@
.mission-table {
  /* height: 60vh; */
}
:deep(.t-row-normal) {
  background-color: transparent !important;
}
</style>