riku
2024-05-09 75aeb4e63339b60f9559af984c7d9f87a7cba24a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <el-button
    type="primary"
    icon="Memo"
    class="el-button-custom p-events-auto"
    @click="dialogVisible = !dialogVisible"
  >
    任务管理
  </el-button>
  <el-dialog v-model="dialogVisible" :show-close="false" align-center>
    <template #header="{ close, titleId, titleClass }">
      <BaseCard direction="top-left" borderless="t">
        <template #content>
          <el-row justify="space-between" align="middle">
            <el-row align="middle">
              <font-awesome-icon icon="fa fa-list" class="m-r-4" />
              <span :id="titleId" :class="titleClass">走航任务管理</span>
            </el-row>
            <font-awesome-icon
              icon="fa fa-times"
              class="cursor-p m-r-4"
              @click="close"
            />
          </el-row>
        </template>
      </BaseCard>
    </template>
    <BaseCard size="medium">
      <template #content>
        <el-row class="mission-table">
          <el-col :span="20">
            <el-table
              :data="missionList"
              table-layout="fixed"
              size="small"
              :show-overflow-tooltip="true"
              border
              row-class-name="t-row"
              cell-class-name="t-cell"
              header-row-class-name="t-header-row"
              header-cell-class-name="t-header-cell"
            >
              <el-table-column
                type="index"
                label="序号"
                align="center"
                width="50"
              />
              <el-table-column
                prop="missionCode"
                label="任务编号"
                align="center"
              />
              <el-table-column
                prop="startTime"
                label="开始时间"
                align="center"
                :formatter="timeFormatter"
              />
              <el-table-column
                prop="endTime"
                label="结束时间"
                align="center"
                :formatter="timeFormatter"
              />
              <el-table-column label="管理" width="70" align="center">
                <template #default="{ row }">
                  <el-button
                    type="primary"
                    size="small"
                    class="el-button-custom"
                    @click="deleteMission(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">
                新建任务
              </el-button>
            </div>
            <div>
              <el-button type="primary" class="el-button-custom">
                数据导入
              </el-button>
            </div>
            <div>
              <el-button type="primary" class="el-button-custom">
                下载模板
              </el-button>
            </div>
          </el-col>
        </el-row>
      </template>
    </BaseCard>
  </el-dialog>
</template>
<script>
import moment from 'moment';
import { mapState } from 'pinia';
import { useMissionStore } from '@/stores/mission';
 
export default {
  props: {},
  data() {
    return {
      dialogVisible: false
    };
  },
  computed: {
    ...mapState(useMissionStore, ['missionList'])
  },
  methods: {
    createMission() {},
    deleteMission(row) {},
    timeFormatter(row, col, cellValue, index) {
      return moment(cellValue).format('YYYY-MM-DD HH:mm:ss');
    }
  }
};
</script>
<style>
.el-dialog {
  --el-dialog-bg-color: transparent !important;
  --el-dialog-title-font-size: var(--el-font-size-medium);
  --el-dialog-content-font-size: 14px;
  --el-dialog-padding-primary: 0px !important;
}
 
.el-dialog__title {
  color: var(--font-color);
}
</style>
<style scoped>
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
 
.mission-table {
  height: 60vh;
}
</style>