Browse Source

考点管理

zhangjie 1 year ago
parent
commit
3e1df02842

+ 29 - 0
src/api/base.ts

@@ -3,6 +3,9 @@ import type {
   TeachingListPageParam,
   TeachingListPageRes,
   TeachingUpdateParams,
+  AgentListPageParam,
+  AgentListPageRes,
+  AgentUpdateParams,
 } from './types/base';
 import { AbleParams } from './types/common';
 
@@ -33,3 +36,29 @@ export function teachingTemplate(): Promise<Blob> {
     }
   );
 }
+
+// 考点管理
+// 考点管理-查询
+export function agentListPage(
+  params: AgentListPageParam
+): Promise<AgentListPageRes> {
+  return axios.post('/api/admin/agent/query', {}, { params });
+}
+// 考点管理-新增编辑
+export function updateAgent(datas: AgentUpdateParams): Promise<{ id: string }> {
+  return axios.post('/api/admin/agent/save', datas);
+}
+// 考点管理-启用禁用
+export function ableAgent(params: AbleParams): Promise<boolean> {
+  return axios.post('/api/admin/agent/enable', {}, { params });
+}
+// // 考点管理-导入模板下载
+export function agentTemplate(): Promise<Blob> {
+  return axios.post(
+    '/api/admin/agent/template',
+    {},
+    {
+      responseType: 'blob',
+    }
+  );
+}

+ 11 - 2
src/api/order.ts

@@ -13,13 +13,16 @@ import type {
 } from './types/order';
 import { AbleParams } from './types/common';
 
-// common
+// 通用查询
+// 通用查询-任务查询
 export function taskQuery(): Promise<OptionItem[]> {
   return axios.post('/api/apply/task/list', {});
 }
+// 通用查询-教学点查询
 export function teachingQuery(): Promise<OptionItem[]> {
   return axios.post('/api/apply/teaching/list', {});
 }
+// 通用查询-考点查询
 export function agentQuery(teachingId: string): Promise<OptionItem[]> {
   return axios.post(
     '/api/apply/agent/list',
@@ -28,30 +31,36 @@ export function agentQuery(teachingId: string): Promise<OptionItem[]> {
   );
 }
 
-// task-manage
+// 预约任务管理
+// 预约任务管理-查询
 export function taskListPage(
   params: TaskListPageParam
 ): Promise<TaskListPageRes> {
   return axios.post('/api/admin/apply/task/page', {}, { params });
 }
+// 预约任务管理-详情
 export function taskDetailInfo(id: string): Promise<TaskItemDetail> {
   return axios.post('/api/admin/apply/task/find', {}, { params: { id } });
 }
+// 预约任务管理-新增编辑规则
 export function updateTaskRule(
   datas: TaskRuleUpdateParams
 ): Promise<{ id: string }> {
   return axios.post('/api/admin/apply/task/rule/save', datas);
 }
+// 预约任务管理-编辑时段
 export function updateTaskTime(
   datas: TaskTimeUpdateParams
 ): Promise<{ id: string }> {
   return axios.post('/api/admin/apply/task/time/save', datas);
 }
+// 预约任务管理-编辑说明
 export function updateTaskNotice(
   datas: TaskNoticeUpdateParams
 ): Promise<{ id: string }> {
   return axios.post('/api/admin/apply/task/notice/save', datas);
 }
+// 预约任务管理-启用禁用
 export function ableTask(params: AbleParams): Promise<boolean> {
   return axios.post('/api/admin/apply/task/enable', {}, { params });
 }

+ 31 - 0
src/api/types/base.ts

@@ -27,3 +27,34 @@ export interface TeachingUpdateParams {
   capacity: number;
   enable?: boolean;
 }
+
+export interface AgentListFilter {
+  teachingId: string;
+  name: string;
+  enable: boolean;
+}
+export type AgentListPageParam = PageParams<AgentListFilter>;
+
+export interface AgentItem {
+  id: number;
+  name: string;
+  code: string;
+  address: string;
+  teachingId: number;
+  teachingName: string;
+  capacity: number;
+  guide: string;
+  enable: boolean;
+}
+
+export type AgentListPageRes = PageResult<AgentItem>;
+
+export interface AgentUpdateParams {
+  id?: number;
+  name: string;
+  code: string;
+  address: string;
+  teachingId: number;
+  guide: string;
+  enable?: boolean;
+}

+ 3 - 2
src/api/user.ts

@@ -2,14 +2,15 @@ import axios from 'axios';
 import { UserState } from '@/store/modules/user/types';
 import type { LoginData, UpdatePwdData } from './types/user';
 
+// 登录
 export function login(data: LoginData): Promise<UserState> {
   return axios.post('/api/user/login', data);
 }
-
+// 修改密码
 export function updatePwd(datas: UpdatePwdData): Promise<UserState> {
   return axios.post('/api/admin/sys/user/update_password', datas);
 }
-
+// 退出登录
 export function userLogout() {
   return axios.post('/api/user/logout', {});
 }

+ 2 - 1
src/components/select-agent/index.vue

@@ -9,7 +9,7 @@
     v-bind="attrs"
     @change="onChange"
   >
-    <template #prefix>考点</template>
+    <template v-if="prefix" #prefix>考点</template>
   </a-select>
 </template>
 
@@ -28,6 +28,7 @@
     placeholder?: string;
     multiple?: boolean;
     teachingId: number | string;
+    prefix?: boolean;
   }>();
   const emit = defineEmits(['update:modelValue', 'change']);
   const attrs = useAttrs();

+ 2 - 1
src/components/select-task/index.vue

@@ -9,7 +9,7 @@
     v-bind="attrs"
     @change="onChange"
   >
-    <template #prefix>任务</template>
+    <template v-if="prefix" #prefix>任务</template>
   </a-select>
 </template>
 
@@ -27,6 +27,7 @@
     disabled?: boolean;
     placeholder?: string;
     multiple?: boolean;
+    prefix?: boolean;
   }>();
   const emit = defineEmits(['update:modelValue', 'change']);
   const attrs = useAttrs();

+ 2 - 1
src/components/select-teaching/index.vue

@@ -9,7 +9,7 @@
     v-bind="attrs"
     @change="onChange"
   >
-    <template #prefix>教学点</template>
+    <template v-if="prefix" #prefix>教学点</template>
   </a-select>
 </template>
 
@@ -27,6 +27,7 @@
     disabled?: boolean;
     placeholder?: string;
     multiple?: boolean;
+    prefix?: boolean;
   }>();
   const emit = defineEmits(['update:modelValue', 'change']);
   const attrs = useAttrs();

+ 1 - 1
src/main.ts

@@ -4,7 +4,7 @@ import ArcoVueIcon from '@arco-design/web-vue/es/icon';
 import globalComponents from '@/components';
 import router from './router';
 import store from './store';
-// import './mock';
+import './mock';
 import App from './App.vue';
 // Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details
 // 样式通过 arco-plugin 插件导入。详见目录文件 config/plugin/arcoStyleImport.ts

+ 57 - 3
src/mock/task.ts

@@ -9,7 +9,7 @@ setupMock({
     // Mock.XHR.prototype.withCredentials = true;
 
     // 教学点列表
-    Mock.mock(new RegExp('/api/admin/apply/teaching/list'), () => {
+    Mock.mock(new RegExp('/api/apply/teaching/list'), () => {
       return successResponseWrap([
         {
           id: '111',
@@ -22,7 +22,7 @@ setupMock({
       ]);
     });
     // 考点列表
-    Mock.mock(new RegExp('/api/admin/apply/agent/list'), () => {
+    Mock.mock(new RegExp('/api/apply/agent/list'), () => {
       return successResponseWrap([
         {
           id: '111',
@@ -53,7 +53,7 @@ setupMock({
 
     // 预约名单
     // 预约名单详情分页
-    Mock.mock(new RegExp('/api/admin/apply/std/query'), () => {
+    Mock.mock(new RegExp('/api/apply/std/page'), () => {
       return pageListResponseWrap([
         {
           id: 1,
@@ -69,5 +69,59 @@ setupMock({
         },
       ]);
     });
+
+    // 教学点管理
+    // 教学点管理-查询
+    Mock.mock(new RegExp('/api/admin/teaching/query'), () => {
+      return pageListResponseWrap([
+        {
+          id: 1,
+          name: '教学点01',
+          code: 'jxd01',
+          cityId: 1,
+          cityName: '武汉',
+          capacity: 100,
+          enable: true,
+        },
+        {
+          id: 2,
+          name: '教学点02',
+          code: 'jxd02',
+          cityId: 2,
+          cityName: '长沙',
+          capacity: 100,
+          enable: true,
+        },
+      ]);
+    });
+    // 考点管理
+    // 考点管理-查询
+    Mock.mock(new RegExp('/api/admin/agent/query'), () => {
+      return pageListResponseWrap([
+        {
+          id: 1,
+          name: '考点点01',
+          code: 'kd01',
+          teachingId: 1,
+          teachingName: '教学点01',
+          address: '武汉市洪山区关山大道',
+          capacity: 150,
+          enable: true,
+          guide: '使用带斑马纹的表格,可以更容易区分出不同行的数据。',
+        },
+        {
+          id: 2,
+          name: '考点点02',
+          code: 'kd02',
+          teachingId: 2,
+          teachingName: '教学点02',
+          address: '武汉市洪山区光谷大道',
+          capacity: 100,
+          enable: true,
+          guide:
+            '用于展示多条结构类似的数据,可对数据进行排序、筛选、对比或其他自定义操作。',
+        },
+      ]);
+    });
   },
 });

+ 10 - 10
src/mock/user.ts

@@ -12,9 +12,9 @@ setupMock({
     // Mock.XHR.prototype.withCredentials = true;
 
     // 登录
-    Mock.mock(new RegExp('/api/admin/sys/user/login'), (params: MockParams) => {
-      const { loginName, password } = JSON.parse(params.body);
-      if (!loginName) {
+    Mock.mock(new RegExp('/api/user/login'), (params: MockParams) => {
+      const { account, password } = JSON.parse(params.body);
+      if (!account) {
         return failResponseWrap(null, '用户名不能为空', 50000);
       }
       if (!password) {
@@ -23,19 +23,19 @@ setupMock({
 
       return successResponseWrap({
         id: 1,
-        loginName,
+        account,
         name: '张三',
+        role: 'ADMIN',
         sessionId: '123456',
-        accessToken: 'abcdef',
-        categoryInfo: {
-          name: '教学点名称',
-          categoryId: '教学点id',
-        },
+        token: 'abcdef',
+        orgId: 1,
+        categoryId: 1,
+        applyTaskId: 1,
       });
     });
 
     // 登出
-    Mock.mock(new RegExp('/api/admin/sys/user/logout'), () => {
+    Mock.mock(new RegExp('/api/user/logout'), () => {
       return successResponseWrap(null);
     });
 

+ 9 - 0
src/router/routes/modules/base.ts

@@ -18,6 +18,15 @@ const routes: AppRouteRecordRaw = {
         requiresAuth: true,
       },
     },
+    {
+      path: 'agent-manage',
+      name: 'AgentManage',
+      component: () => import('@/views/base/agent-manage/index.vue'),
+      meta: {
+        title: '考点管理',
+        requiresAuth: true,
+      },
+    },
   ],
 };
 

+ 6 - 3
src/store/modules/app/index.ts

@@ -63,9 +63,12 @@ const useAppStore = defineStore('app', {
       this.$patch(partial);
     },
     fetchServerMenu(type: RoleType) {
-      const userMenus = menus.filter(
-        (menu) => !menu.roles || menu.roles.includes(type)
-      );
+      // const userMenus = menus.filter(
+      //   (menu) => !menu.roles || menu.roles.includes(type)
+      // );
+      // 开发时不管权限
+      console.log(type);
+      const userMenus = menus;
       const { menuList, validRoutes } = getMenu(transformMenu(userMenus));
       this.appMenus = menuList;
       this.validRoutes = validRoutes;

+ 20 - 0
src/store/modules/app/menuData.ts

@@ -67,4 +67,24 @@ export const menus = [
     enable: true,
     roles: [],
   },
+  {
+    id: '13',
+    name: '考点管理',
+    url: 'AgentManage',
+    type: 'MENU',
+    parentId: '11',
+    sequence: 2,
+    enable: true,
+    roles: [],
+  },
+  {
+    id: '14',
+    name: '考场管理',
+    url: 'RoomManage',
+    type: 'MENU',
+    parentId: '11',
+    sequence: 3,
+    enable: true,
+    roles: [],
+  },
 ];

+ 4 - 12
src/utils/setup-mock.ts

@@ -5,21 +5,13 @@ export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
 };
 
 export const successResponseWrap = (data: unknown) => {
-  return {
-    data,
-    message: '请求成功',
-    code: 200,
-  };
+  return data;
 };
 
-export const pageListResponseWrap = (records: unknown) => {
+export const pageListResponseWrap = (result: unknown) => {
   return {
-    data: {
-      records,
-      total: 10,
-    },
-    message: '请求成功',
-    code: 200,
+    result,
+    totalCount: 10,
   };
 };
 

+ 211 - 0
src/views/base/agent-manage/index.vue

@@ -0,0 +1,211 @@
+<template>
+  <div class="part-box is-filter">
+    <a-space class="filter-line" :size="12" wrap>
+      <SelectTeaching
+        v-model="searchModel.teachingId"
+        placeholder="请选择"
+        allow-clear
+        prefix
+      />
+      <a-input v-model.trim="searchModel.name" placeholder="请输入" allow-clear>
+        <template #prefix>考点名称</template>
+      </a-input>
+      <a-select
+        v-model="searchModel.enable"
+        placeholder="请选择"
+        allow-clear
+        :options="ableOptions"
+      >
+        <template #prefix>状态</template>
+      </a-select>
+
+      <a-button type="primary" @click="toPage(1)">查询</a-button>
+    </a-space>
+  </div>
+  <div class="part-box">
+    <a-space class="part-action" :size="6">
+      <a-button type="text" @click="toAdd">
+        <template #icon>
+          <svg-icon name="icon-add" />
+        </template>
+        新增
+      </a-button>
+      <a-divider direction="vertical" />
+      <a-button type="text" @click="toImport">
+        <template #icon>
+          <svg-icon name="icon-import" />
+        </template>
+        导入
+      </a-button>
+    </a-space>
+    <a-table
+      class="page-table"
+      :columns="columns"
+      :data="dataList"
+      :pagination="pagination"
+      :scroll="{ x: 1200 }"
+      :bordered="false"
+    >
+      <template #enable="{ record }">
+        <status-tag type="enable" :value="record.enable" />
+      </template>
+      <template #action="{ record }">
+        <a-button type="text" class="btn-primary" @click="toEdit(record)"
+          >编辑</a-button
+        >
+        <a-button
+          :class="record.enable ? 'btn-danger' : 'btn-primary'"
+          type="text"
+          @click="toEnable(record)"
+          >{{ record.enable ? '禁用' : '启用' }}</a-button
+        >
+        <a-button
+          v-if="!record.cancel"
+          type="text"
+          class="btn-primary"
+          @click="toPlace(record)"
+          >考点指引</a-button
+        >
+        <a-button
+          v-if="!record.cancel"
+          type="text"
+          class="btn-primary"
+          @click="toRoom(record)"
+          >考场</a-button
+        >
+      </template>
+    </a-table>
+
+    <!-- ImportDialog -->
+    <ImportDialog
+      ref="importDialogRef"
+      title="导入考点"
+      upload-url="/api/admin/agent/import"
+      :format="['xls', 'xlsx']"
+      :download-handle="downloadTemplate"
+      download-filename="考点导入模板.xlsx"
+      :auto-upload="false"
+      @upload-success="getList"
+    />
+    <!-- ModifyAgent -->
+    <ModifyAgent ref="modifyAgentRef" :row-data="curRow" @modified="getList" />
+  </div>
+</template>
+
+<script setup lang="ts">
+  import { reactive, ref } from 'vue';
+  import { Message, TableColumnData } from '@arco-design/web-vue';
+  import { agentListPage, agentTemplate, ableAgent } from '@/api/base';
+  import { AgentItem } from '@/api/types/base';
+  import useTable from '@/hooks/table';
+  import useDictOption from '@/hooks/dict-option';
+  import { modalConfirm } from '@/utils/arco';
+  import { downloadByApi } from '@/utils/download';
+  import { useAppStore } from '@/store';
+
+  import ImportDialog from '@/components/import-dialog/index.vue';
+  import ModifyAgent from './modifyAgent.vue';
+
+  defineOptions({
+    name: 'AgentManage',
+  });
+
+  const appStore = useAppStore();
+  appStore.setInfo({ breadcrumbs: ['基础信息管理', '考点管理'] });
+
+  const { optionList: ableOptions } = useDictOption('ABLE_TYPE');
+
+  const searchModel = reactive({
+    teachingId: '',
+    name: '',
+    enable: null,
+  });
+
+  const columns: TableColumnData[] = [
+    {
+      title: '考点代码',
+      dataIndex: 'code',
+      width: 120,
+    },
+    {
+      title: '考点名称',
+      dataIndex: 'name',
+    },
+    {
+      title: '地址',
+      dataIndex: 'address',
+    },
+    {
+      title: '所属教学点',
+      dataIndex: 'teachingName',
+    },
+    {
+      title: '总容量',
+      dataIndex: 'capacity',
+      width: 100,
+    },
+    {
+      title: '状态',
+      slotName: 'enable',
+      width: 100,
+    },
+    {
+      title: '操作',
+      slotName: 'action',
+      width: 210,
+      fixed: 'right',
+      cellClass: 'action-column',
+    },
+  ];
+  const { dataList, pagination, toPage, getList } = useTable<AgentItem[]>(
+    agentListPage,
+    searchModel,
+    true
+  );
+
+  async function downloadTemplate() {
+    const res = await downloadByApi(() => agentTemplate()).catch((e) => {
+      Message.error(e || '下载失败,请重新尝试!');
+    });
+    if (!res) return;
+    Message.success('下载成功!');
+  }
+
+  // table action
+  // 导入
+  const importDialogRef = ref(null);
+  function toImport() {
+    importDialogRef.value?.open();
+  }
+
+  const modifyAgentRef = ref(null);
+  const curRow = ref({});
+  function toAdd() {
+    curRow.value = {};
+    modifyAgentRef.value?.open();
+  }
+  function toEdit(row: AgentItem) {
+    curRow.value = row;
+    modifyAgentRef.value?.open();
+  }
+
+  async function toEnable(row: AgentItem) {
+    const action = row.enable ? '禁用' : '启用';
+    const confirmRes = await modalConfirm(
+      '提示',
+      `确定要${action}任务【${row.name}】吗?`
+    ).catch(() => false);
+    if (confirmRes !== 'confirm') return;
+
+    await ableAgent({ id: row.id, enable: !row.enable });
+    Message.success('操作成功!');
+    getList();
+  }
+
+  function toPlace(row: AgentItem) {
+    console.log(row);
+  }
+  function toRoom(row: AgentItem) {
+    console.log(row);
+  }
+</script>

+ 168 - 0
src/views/base/agent-manage/modifyAgent.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-modal
+    v-model:visible="visible"
+    :width="500"
+    title-align="start"
+    top="10vh"
+    :align-center="false"
+    @before-open="modalBeforeOpen"
+  >
+    <template #title> {{ title }} </template>
+    <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
+      <a-form-item field="name" label="考点名称">
+        <a-input
+          v-model.trim="formData.name"
+          placeholder="请输入"
+          allow-clear
+        ></a-input>
+      </a-form-item>
+      <a-form-item field="code" label="考点代码">
+        <a-input
+          v-model.trim="formData.code"
+          placeholder="请输入"
+          allow-clear
+        ></a-input>
+      </a-form-item>
+      <a-form-item field="address" label="考点地址">
+        <a-input
+          v-model.trim="formData.address"
+          placeholder="请输入"
+          allow-clear
+        ></a-input>
+      </a-form-item>
+      <a-form-item field="teachingId" label="教学点">
+        <SelectTeaching
+          v-model="formData.teachingId"
+          placeholder="请选择"
+          allow-clear
+        />
+      </a-form-item>
+      <a-form-item field="guide" label="考点指引">
+        <a-textarea
+          v-model="formData.guide"
+          placeholder="请输入"
+          :auto-size="{
+            minRows: 4,
+            maxRows: 10,
+          }"
+          :max-length="999"
+        />
+      </a-form-item>
+    </a-form>
+
+    <template #footer>
+      <a-button type="primary" :disabled="loading" @click="confirm"
+        >确认</a-button
+      >
+      <a-button @click="close">取消</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script setup lang="ts">
+  import { computed, reactive, ref } from 'vue';
+  import { Message } from '@arco-design/web-vue';
+  import type { FormInstance } from '@arco-design/web-vue/es/form';
+  import { updateAgent } from '@/api/base';
+  import useLoading from '@/hooks/loading';
+  import useModal from '@/hooks/modal';
+  import { objAssign, objModifyAssign } from '@/utils/utils';
+  import { AgentItem, AgentUpdateParams } from '@/api/types/base';
+  import { FormRules } from '@/types/global';
+
+  defineOptions({
+    name: 'ModifyAgent',
+  });
+
+  /* modal */
+  const { visible, open, close } = useModal();
+  defineExpose({ open, close });
+
+  const defaultFormData = {
+    id: null,
+    name: '',
+    code: '',
+    address: '',
+    teachingId: '',
+    guide: '',
+  };
+
+  const props = defineProps<{
+    rowData: AgentItem;
+  }>();
+  const emit = defineEmits(['modified']);
+
+  const isEdit = computed(() => !!props.rowData.id);
+  const title = computed(() => `${isEdit.value ? '编辑' : '新增'}考点`);
+
+  const formRef = ref<FormInstance>();
+  const formData = reactive<AgentUpdateParams>({ ...defaultFormData });
+  const rules: FormRules<AgentUpdateParams> = {
+    name: [
+      {
+        required: true,
+        message: '请输入名称',
+      },
+      {
+        max: 50,
+        message: '名称不能超过50字符',
+      },
+    ],
+    code: [
+      {
+        required: true,
+        message: '请输入代码',
+      },
+      {
+        max: 50,
+        message: '代码不能超过50字符',
+      },
+    ],
+    address: [
+      {
+        required: true,
+        message: '请输入地址',
+      },
+      {
+        max: 100,
+        message: '地址不能超过100字符',
+      },
+    ],
+    teachingId: [
+      {
+        required: true,
+        message: '请选择教学点',
+      },
+    ],
+    guide: [
+      {
+        required: true,
+        message: '请输入考点指引',
+      },
+    ],
+  };
+
+  /* confirm */
+  const { loading, setLoading } = useLoading();
+  async function confirm() {
+    const err = await formRef.value?.validate();
+    if (err) return;
+
+    setLoading(true);
+    const datas = objAssign(formData, {});
+    const res = await updateAgent(datas).catch(() => false);
+    setLoading(false);
+    if (!res) return;
+    Message.success('修改成功!');
+    emit('modified', datas);
+    close();
+  }
+  /* init modal */
+  function modalBeforeOpen() {
+    if (props.rowData.id) {
+      objModifyAssign(formData, props.rowData);
+    } else {
+      objModifyAssign(formData, defaultFormData);
+    }
+  }
+</script>

+ 3 - 6
src/views/base/teaching-manage/index.vue

@@ -119,32 +119,29 @@
     {
       title: '代码',
       dataIndex: 'code',
-      width: 120,
     },
     {
       title: '教学点名称',
       dataIndex: 'name',
-      width: 200,
     },
     {
       title: '城市',
       dataIndex: 'cityName',
-      width: 160,
     },
     {
       title: '容量',
       dataIndex: 'capacity',
-      width: 160,
+      width: 100,
     },
     {
       title: '状态',
-      slotName: 'status',
+      slotName: 'enable',
       width: 100,
     },
     {
       title: '操作',
       slotName: 'action',
-      width: 180,
+      width: 140,
       fixed: 'right',
       cellClass: 'action-column',
     },

+ 2 - 3
src/views/base/teaching-manage/modifyTeaching.vue

@@ -14,7 +14,6 @@
           v-model.trim="formData.name"
           placeholder="请输入"
           allow-clear
-          :disabled="isEdit"
         ></a-input>
       </a-form-item>
       <a-form-item field="code" label="教学点代码">
@@ -100,7 +99,7 @@
       },
       {
         max: 50,
-        message: '名称不能超过50',
+        message: '名称不能超过50字符',
       },
     ],
     code: [
@@ -110,7 +109,7 @@
       },
       {
         max: 50,
-        message: '代码不能超过50',
+        message: '代码不能超过50字符',
       },
     ],
     capacity: [

+ 6 - 9
src/views/login/login/index.vue

@@ -60,7 +60,7 @@
 </template>
 
 <script lang="ts" setup>
-  import { ref, reactive, onMounted } from 'vue';
+  import { ref, reactive } from 'vue';
   import { useRouter } from 'vue-router';
   import type { FormInstance, FieldRule } from '@arco-design/web-vue/es/form';
   import useLoading from '@/hooks/loading';
@@ -72,11 +72,12 @@
   const appStore = useAppStore();
   const userStore = useUserStore();
   userStore.resetInfo();
+  appStore.resetInfo();
 
   const formRef = ref<FormInstance>();
   const formData = reactive({
-    account: '',
-    password: '',
+    account: 'admin',
+    password: '123456',
   });
   const rules: Record<string, FieldRule[]> = {
     account: [
@@ -104,15 +105,11 @@
     setLoading(false);
     if (!data) return;
 
+    console.log(data);
+
     userStore.setInfo(data);
     router.push({
       name: DEFAULT_ROUTE_NAME,
     });
   }
-
-  // mounted
-  onMounted(() => {
-    userStore.resetInfo();
-    appStore.resetInfo();
-  });
 </script>

+ 3 - 0
src/views/order/order-record-manage/index.vue

@@ -5,16 +5,19 @@
         v-model="searchModel.taskId"
         placeholder="请选择"
         allow-clear
+        prefix
       />
       <SelectTeaching
         v-model="searchModel.teachingId"
         placeholder="请选择"
         allow-clear
+        prefix
       />
       <SelectAgent
         v-model="searchModel.agentId"
         placeholder="请选择"
         allow-clear
+        prefix
         :teaching-id="searchModel.teachingId"
       />
       <a-input v-model.trim="searchModel.name" placeholder="请输入" allow-clear>

+ 3 - 0
src/views/order/student-manage/index.vue

@@ -5,16 +5,19 @@
         v-model="searchModel.taskId"
         placeholder="请选择"
         allow-clear
+        prefix
       />
       <SelectTeaching
         v-model="searchModel.teachingId"
         placeholder="请选择"
         allow-clear
+        prefix
       />
       <SelectAgent
         v-model="searchModel.agentId"
         placeholder="请选择"
         allow-clear
+        prefix
         :teaching-id="searchModel.teachingId"
       />
       <a-input v-model.trim="searchModel.name" placeholder="请输入" allow-clear>

+ 1 - 0
src/views/order/task-manage/noticeForm.vue

@@ -9,6 +9,7 @@
             minRows: 4,
             maxRows: 10,
           }"
+          :max-length="999"
         />
       </a-form-item>
     </a-form>

+ 1 - 1
src/views/order/task-manage/ruleForm.vue

@@ -110,7 +110,7 @@
       },
       {
         max: 50,
-        message: '名称不能超过50',
+        message: '名称不能超过50字符',
       },
     ],
     allowApplyDays: [