|
@@ -0,0 +1,123 @@
|
|
|
+<template>
|
|
|
+ <!-- <div class="part-box is-filter">
|
|
|
+ <a-space class="filter-line" :size="12" wrap> -->
|
|
|
+ <!-- <a-select
|
|
|
+ v-model="searchModel.type"
|
|
|
+ :allow-clear="true"
|
|
|
+ :options="taskList"
|
|
|
+ popup-container="body"
|
|
|
+ >
|
|
|
+ <template #prefix>任务类型</template>
|
|
|
+ </a-select> -->
|
|
|
+ <!-- <a-select
|
|
|
+ v-model="searchModel.status"
|
|
|
+ :allow-clear="true"
|
|
|
+ :options="[
|
|
|
+ { value: 'SUCCESS', label: '成功' },
|
|
|
+ { value: 'ERROR', label: '失败' },
|
|
|
+ ]"
|
|
|
+ popup-container="body"
|
|
|
+ >
|
|
|
+ <template #prefix>任务状态</template>
|
|
|
+ </a-select> -->
|
|
|
+ <!-- <a-button type="primary" @click="toPage(1)">查询</a-button> -->
|
|
|
+ <!-- </a-space>
|
|
|
+ </div> -->
|
|
|
+ <div class="part-box">
|
|
|
+ <a-table
|
|
|
+ class="page-table"
|
|
|
+ :columns="columns"
|
|
|
+ :data="dataList"
|
|
|
+ :pagination="false"
|
|
|
+ :scroll="{ x: 1200 }"
|
|
|
+ :bordered="false"
|
|
|
+ >
|
|
|
+ <template #type="{ record }">{{ taskTypeEnum[record.type] }}</template>
|
|
|
+ <template #status="{ record }">{{
|
|
|
+ taskStatusEnum[record.status]
|
|
|
+ }}</template>
|
|
|
+ <template #result="{ record }">{{
|
|
|
+ taskResultEnum[record.result]
|
|
|
+ }}</template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+ import { reactive, ref, computed, onMounted, watch } from 'vue';
|
|
|
+ import { Message, TableColumnData } from '@arco-design/web-vue';
|
|
|
+ import { getMyTasks, getTaskTypes } from '@/api/order';
|
|
|
+ import { TaskItem } from '@/api/types/order';
|
|
|
+ import useTable from '@/hooks/table';
|
|
|
+ import { useAppStore } from '@/store';
|
|
|
+ import { modalConfirm } from '@/utils/arco';
|
|
|
+
|
|
|
+ defineOptions({
|
|
|
+ name: 'MyTask',
|
|
|
+ });
|
|
|
+
|
|
|
+ const taskList = ref([]);
|
|
|
+ const taskTypeEnum = reactive<any>({});
|
|
|
+ const taskStatusEnum = reactive<any>({
|
|
|
+ INIT: '初始化',
|
|
|
+ RUNNING: '进行中',
|
|
|
+ FINISH: '已完成',
|
|
|
+ });
|
|
|
+ const taskResultEnum = reactive<any>({
|
|
|
+ SUCCESS: '成功',
|
|
|
+ ERROR: '失败',
|
|
|
+ });
|
|
|
+ onMounted(() => {
|
|
|
+ getTaskTypes().then((res: any) => {
|
|
|
+ taskList.value = (res || []).map((item: any) => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.type,
|
|
|
+ }));
|
|
|
+ taskList.value.forEach((item: any) => {
|
|
|
+ taskTypeEnum[item.value] = item.label;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ const appStore = useAppStore();
|
|
|
+ appStore.setInfo({ breadcrumbs: ['系统设置', '我的任务'] });
|
|
|
+
|
|
|
+ const searchModel = reactive({
|
|
|
+ type: '',
|
|
|
+ // status: '',
|
|
|
+ });
|
|
|
+ const computedModel = computed(() => {
|
|
|
+ return { type: searchModel.type ? searchModel.type : null };
|
|
|
+ });
|
|
|
+ const columns = computed<TableColumnData[]>(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '任务类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ slotName: 'type',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '任务状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ slotName: 'status',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '任务结果',
|
|
|
+ dataIndex: 'result',
|
|
|
+ slotName: 'result',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '创建人',
|
|
|
+ dataIndex: 'operator',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '创建时间',
|
|
|
+ dataIndex: 'operator',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ const { dataList, pagination, toPage, getList } = useTable<any>(
|
|
|
+ getMyTasks,
|
|
|
+ computedModel,
|
|
|
+ true
|
|
|
+ );
|
|
|
+</script>
|