瀏覽代碼

任务列表

zhangjie 1 年之前
父節點
當前提交
9a136895e2

+ 5 - 1
src/assets/style/reset.less

@@ -135,10 +135,14 @@ body {
   .arco-btn {
     height: 20px;
     padding: 0;
-    margin: 0 5px;
     border: none !important;
     outline: none !important;
     line-height: 20px;
+    margin: 0;
+
+    &:not(:first-child) {
+      margin-left: 10px;
+    }
     &:not(.arco-btn-disabled):hover {
       transform: scale(1.1);
     }

+ 0 - 43
src/constants/enumerate.ts

@@ -10,10 +10,6 @@ export const ABLE_TYPE = {
 };
 
 // 基础 -------------->
-// 机构
-export const ORG_TYPE = {
-  PRINTING_HOUSE: '印刷室',
-};
 // 角色
 export const ROLE_TYPE = {
   SCHOOL_ADMIN: '管理员',
@@ -23,42 +19,3 @@ export const ROLE_TYPE = {
   PRINT: '印刷人员',
   CUSTOM: '自定义',
 };
-export const SMS_TYPE = {
-  SCHOOL_ADMIN: '管理员',
-  EXAM_TEACHER: '考务老师',
-};
-export const DATA_PRIVILEGE_TYPE = {
-  SELF: '仅本人数据权限',
-  SELF_ORG: '本部门数据权限',
-  SELF_ORG_BELOW: '本部门及下级部门数据权限',
-  ALL: '全部数据权限',
-};
-
-// 题卡
-// 条码类型
-export const EXAM_NUMBER_STYLE = {
-  PRINT: '印刷条码',
-  PASTE: '粘贴条码',
-  FILL: '考号填涂',
-};
-export const CARD_CREATE_METHOD_TYPE = {
-  UPLOAD: '上传文件',
-  STANDARD: '标准模式',
-  FREE: '自由模式',
-};
-export const CARD_TYPE = {
-  GENERIC: '通卡',
-  CUSTOM: '自定义专卡',
-};
-
-export const PUSH_CARD_TYPE = {
-  GENERIC: '通卡',
-  CUSTOM: '电子题卡',
-};
-
-// 模板类型
-export const TEMPLATE_CLASSIFY = {
-  SIGN: '签到表',
-  PACKAGE: '卷袋贴',
-  CHECK_IN: '考试情况登记表',
-};

+ 1 - 19
src/hooks/dict-option.ts

@@ -1,29 +1,11 @@
 import { ref } from 'vue';
-import {
-  DEFAULT_LABEL,
-  ORG_TYPE,
-  ABLE_TYPE,
-  ROLE_TYPE,
-  SMS_TYPE,
-  DATA_PRIVILEGE_TYPE,
-  EXAM_NUMBER_STYLE,
-  CARD_CREATE_METHOD_TYPE,
-  CARD_TYPE,
-  TEMPLATE_CLASSIFY,
-} from '@/constants/enumerate';
+import { DEFAULT_LABEL, ABLE_TYPE, ROLE_TYPE } from '@/constants/enumerate';
 import { dictToOption } from '@/utils/utils';
 import { Options } from '@/types/global';
 
 const dicts = {
-  ORG_TYPE,
   ABLE_TYPE,
   ROLE_TYPE,
-  SMS_TYPE,
-  DATA_PRIVILEGE_TYPE,
-  EXAM_NUMBER_STYLE,
-  CARD_CREATE_METHOD_TYPE,
-  CARD_TYPE,
-  TEMPLATE_CLASSIFY,
 };
 
 type DictTypeType = keyof typeof dicts;

+ 2 - 1
src/layout/default-layout.vue

@@ -25,7 +25,7 @@
       <a-menu
         v-if="appStore.appMenus && appStore.appMenus.length"
         class="arco-menu-home"
-        :default-selected-keys="[curRouteName]"
+        :selected-keys="[curRouteName]"
         auto-open
         @menu-item-click="toMenuItem"
       >
@@ -113,6 +113,7 @@
 
   function initData() {
     curRouteName.value = route.name;
+    console.log(route.name);
   }
 
   function toMenuItem(val) {

+ 1 - 0
src/mock/index.ts

@@ -1,6 +1,7 @@
 import Mock from 'mockjs';
 
 import './user';
+import './task';
 
 Mock.setup({
   timeout: '600-1000',

+ 24 - 0
src/mock/task.ts

@@ -0,0 +1,24 @@
+import Mock from 'mockjs';
+import setupMock, { pageListResponseWrap } from '@/utils/setup-mock';
+
+setupMock({
+  setup() {
+    // Mock.XHR.prototype.withCredentials = true;
+
+    // 预约任务查询
+    Mock.mock(new RegExp('/api/admin/apply/task/page'), () => {
+      return pageListResponseWrap([
+        {
+          id: '111',
+          name: '任务名称',
+          selfApplyStartTime: Date.now(),
+          selfApplyEndTime: Date.now(),
+          openApplyStartTime: Date.now(),
+          openApplyEndTime: Date.now(),
+          enable: true,
+          updateTime: Date.now(),
+        },
+      ]);
+    });
+  },
+});

+ 11 - 0
src/utils/setup-mock.ts

@@ -12,6 +12,17 @@ export const successResponseWrap = (data: unknown) => {
   };
 };
 
+export const pageListResponseWrap = (records: unknown) => {
+  return {
+    data: {
+      records,
+      total: 10,
+    },
+    message: '请求成功',
+    code: 200,
+  };
+};
+
 export const failResponseWrap = (
   data: unknown,
   message: string,

+ 36 - 21
src/views/order/task-manage/index.vue

@@ -23,9 +23,18 @@
   </div>
   <div class="part-box">
     <a-table :columns="columns" :data="dataList" :pagination="pagination">
-      <!-- <template #roles="{ record }">
-        {{ getRoleLabel(record.roles) }}
-      </template> -->
+      <template #enable="{ record }">
+        {{ getAbleLabel(record.enable) }}
+      </template>
+      <template #selfApplyStartTime="{ record }">
+        {{ timestampFilter(record.selfApplyStartTime) }}
+      </template>
+      <template #openApplyStartTime="{ record }">
+        {{ timestampFilter(record.openApplyStartTime) }}
+      </template>
+      <template #updateTime="{ record }">
+        {{ timestampFilter(record.updateTime) }}
+      </template>
       <template #action="{ record }">
         <a-button type="text" class="btn-primary" @click="toEdit(record)"
           >编辑</a-button
@@ -47,15 +56,15 @@
   import { ableTask, taskListPage } from '@/api/order';
   import { TaskItem } from '@/api/types/order';
   import useTable from '@/hooks/table';
-
-  import { useUserStore } from '@/store';
+  import useDictOption from '@/hooks/dict-option';
+  import { timestampFilter } from '@/utils/filter';
   import { modalConfirm } from '@/utils/arco';
 
   defineOptions({
     name: 'TaskManage',
   });
 
-  const userStore = useUserStore();
+  const { getLabel: getAbleLabel } = useDictOption('ABLE_TYPE');
 
   const searchModel = reactive({
     name: '',
@@ -63,35 +72,41 @@
 
   const columns: TableColumnData[] = [
     {
-      title: '用户名/工号',
-      dataIndex: 'loginName',
+      title: '任务ID',
+      dataIndex: 'id',
     },
     {
-      title: '姓名',
-      dataIndex: 'realName',
+      title: '任务名称',
+      dataIndex: 'name',
     },
     {
-      title: '手机号',
-      dataIndex: 'mobileNumber',
+      title: '开启预约时间',
+      dataIndex: 'selfApplyStartTime',
+      slotName: 'selfApplyStartTime',
+      width: 170,
     },
     {
-      title: '所在机构',
-      dataIndex: 'orgName',
+      title: '自由预约时间',
+      dataIndex: 'openApplyStartTime',
+      slotName: 'openApplyStartTime',
+      width: 170,
     },
     {
-      title: '角色',
-      dataIndex: 'roles',
-      slotName: 'roles',
-    },
-    {
-      title: '状态',
+      title: '任务状态',
       dataIndex: 'enable',
       slotName: 'enable',
+      width: 100,
+    },
+    {
+      title: '更新时间',
+      dataIndex: 'updateTime',
+      slotName: 'updateTime',
+      width: 170,
     },
     {
       title: '操作',
       slotName: 'action',
-      width: 220,
+      width: 120,
       fixed: 'right',
       cellClass: 'action-column',
     },