浏览代码

feat: 基础信息管理接口调试

zhangjie 1 年之前
父节点
当前提交
25d9427e7a

二进制
favicon.ico


+ 1 - 2
index.html

@@ -3,8 +3,7 @@
 
 <head>
   <meta charset="UTF-8" />
-  <link rel="shortcut icon" type="image/x-icon"
-    href="https://unpkg.byted-static.com/latest/byted/arco-config/assets/favicon.ico">
+  <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico">
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>
     预约管理系统

+ 1 - 1
src/api/base.ts

@@ -95,7 +95,7 @@ export function ableRoom(params: AbleParams): Promise<boolean> {
 // 考场管理-导入模板下载
 export function roomTemplate(): Promise<AxiosResponse<Blob>> {
   return axios.post(
-    '/api/admin/import/template',
+    '/api/admin/room/import/template',
     {},
     {
       responseType: 'blob',

+ 10 - 10
src/api/order.ts

@@ -19,16 +19,16 @@ import { AbleParams, PageParams } from './types/common';
 // 通用查询
 // 通用查询-任务查询
 export function taskQuery(): Promise<OptionItem[]> {
-  return axios.post('/api/apply/task/list', {});
+  return axios.post('/api/admin/apply/task/list', {});
 }
 // 通用查询-教学点查询
 export function teachingQuery(): Promise<OptionItem[]> {
-  return axios.post('/api/apply/teaching/list', {});
+  return axios.post('/api/admin/apply/teaching/list', {});
 }
 // 通用查询-考点查询
 export function agentQuery(teachingId: number): Promise<OptionItem[]> {
   return axios.post(
-    '/api/apply/agent/list',
+    '/api/admin/apply/agent/list',
     {},
     { params: { id: teachingId } }
   );
@@ -99,22 +99,22 @@ export function studentInfoTemplate(): Promise<AxiosResponse<Blob>> {
 export function orderRecordListPage(
   params: OrderRecordListPageParam
 ): Promise<OrderRecordListPageRes> {
-  return axios.post('/api/apply/std/page', params);
+  return axios.post('/api/admin/apply/std/page', params);
 }
 // 预约名单详情-取消预约
 export function orderRecordCancel(id: number): Promise<boolean> {
-  return axios.post('/api/apply/std/cancel', {}, { params: { id } });
+  return axios.post('/api/admin/apply/std/cancel', {}, { params: { id } });
 }
 // 预约名单详情-一键自动分配
 export function orderRecordAutoAssign(params: {
   taskId: number;
 }): Promise<boolean> {
-  return axios.post('/api/apply/std/auto/assign', {}, { params });
+  return axios.post('/api/admin/apply/std/auto/assign', {}, { params });
 }
 // 预约名单详情-导入模板下载
 export function orderRecordTemplate(): Promise<AxiosResponse<Blob>> {
   return axios.post(
-    '/api/apply/imp/template',
+    '/api/admin/apply/imp/template',
     {},
     {
       responseType: 'blob',
@@ -126,14 +126,14 @@ export function orderRecordTemplate(): Promise<AxiosResponse<Blob>> {
 export function orderRecordPrintTimeListPage(): Promise<
   OrderRecordPrintTimeItem[]
 > {
-  return axios.post('/api/apply/sign/in/date', {});
+  return axios.post('/api/admin/apply/sign/in/date', {});
 }
 // 预约名单详情-打印签到表
 export function orderRecordPrint(
   params: OrderRecordPrintParam
 ): Promise<AxiosResponse<Blob>> {
   return axios.post(
-    '/api/apply/std/auto/sign/in/print',
+    '/api/admin/apply/std/auto/sign/in/print',
     {},
     {
       responseType: 'blob',
@@ -146,7 +146,7 @@ export function exportOrderRecordDetail(
   params: ExportOrderRecordDetailParam
 ): Promise<AxiosResponse<Blob>> {
   return axios.post(
-    '/api/apply/std/auto/sign/in/apply',
+    '/api/admin/apply/export/teaching/available',
     {},
     {
       responseType: 'blob',

+ 0 - 1
src/api/types/order.ts

@@ -111,5 +111,4 @@ export interface OrderRecordPrintParam {
 }
 export interface ExportOrderRecordDetailParam {
   teachingId: number | null;
-  agentId: number | null;
 }

+ 15 - 0
src/assets/style/arco-custom.less

@@ -121,3 +121,18 @@
     }
   }
 }
+
+// .arco-select
+.arco-select-dropdown {
+  .arco-select-option {
+    &.arco-select-option-selected {
+      color: var(--color-primary);
+
+      &.arco-select-option-active {
+        &:hover {
+          color: var(--color-primary);
+        }
+      }
+    }
+  }
+}

+ 20 - 19
src/components/select-agent/index.vue

@@ -23,21 +23,16 @@
   });
   type ValueType = number | Array<number> | null;
 
-  const props = withDefaults(
-    defineProps<{
-      modelValue: ValueType;
-      clearable?: boolean;
-      disabled?: boolean;
-      placeholder?: string;
-      multiple?: boolean;
-      teachingId: number | null;
-      cascade?: boolean;
-      prefix?: boolean;
-    }>(),
-    {
-      cascade: true,
-    }
-  );
+  const props = defineProps<{
+    modelValue: ValueType;
+    clearable?: boolean;
+    disabled?: boolean;
+    placeholder?: string;
+    multiple?: boolean;
+    teachingId: number | null;
+    prefix?: boolean;
+  }>();
+
   const emit = defineEmits(['update:modelValue', 'change']);
   const attrs = useAttrs();
 
@@ -57,6 +52,16 @@
     optionList.value = (resData || []).map((item) => {
       return { ...item, value: item.id, label: item.name };
     });
+
+    if (selected.value) {
+      const targetOption = optionList.value.find(
+        (item) => item.value === selected.value
+      );
+      if (!targetOption) {
+        emit('update:modelValue', null);
+        emit('change', null);
+      }
+    }
   };
 
   const onChange = () => {
@@ -84,10 +89,6 @@
     (val, oldval) => {
       if (val !== oldval) {
         search();
-        if (props.cascade) {
-          emit('update:modelValue', null);
-          emit('change', null);
-        }
       }
     },
     {

+ 1 - 1
src/store/modules/app/menuData.ts

@@ -65,7 +65,7 @@ export const menus = [
     parentId: 11,
     sequence: 1,
     enable: true,
-    roles: ['ADMIN', 'TEACHING'],
+    roles: ['ADMIN'],
   },
   {
     id: 13,

+ 6 - 0
src/store/modules/user/index.ts

@@ -21,6 +21,12 @@ const useUserStore = defineStore('user', {
     userInfo(state: UserState): UserState {
       return { ...state };
     },
+    isAdmin(state: UserState): boolean {
+      return state.role === 'ADMIN';
+    },
+    isExamTeacher(state: UserState): boolean {
+      return state.role === 'EXAM_TEACHER';
+    },
   },
 
   actions: {

+ 18 - 10
src/views/base/agent-manage/index.vue

@@ -24,7 +24,7 @@
     </a-space>
   </div>
   <div class="part-box">
-    <a-space class="part-action" :size="6">
+    <a-space v-if="userStore.isAdmin" class="part-action" :size="6">
       <a-button type="text" @click="toAdd">
         <template #icon>
           <svg-icon name="icon-add" />
@@ -51,20 +51,21 @@
         <status-tag type="enable" :value="record.enable" />
       </template>
       <template #action="{ record }">
-        <a-button type="text" class="btn-primary" @click="toEdit(record)"
+        <a-button
+          v-if="userStore.isAdmin"
+          type="text"
+          class="btn-primary"
+          @click="toEdit(record)"
           >编辑</a-button
         >
         <a-button
+          v-if="userStore.isAdmin"
           :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="toGuide(record)"
+        <a-button type="text" class="btn-primary" @click="toGuide(record)"
           >考点指引</a-button
         >
         <!-- <a-button
@@ -78,6 +79,7 @@
 
     <!-- ImportDialog -->
     <ImportDialog
+      v-if="userStore.isAdmin"
       ref="importDialogRef"
       title="导入考点"
       upload-url="/api/admin/site/import"
@@ -88,9 +90,14 @@
       @upload-success="getList"
     />
     <!-- ModifyAgent -->
-    <ModifyAgent ref="modifyAgentRef" :row-data="curRow" @modified="getList" />
+    <ModifyAgent
+      v-if="userStore.isAdmin"
+      ref="modifyAgentRef"
+      :row-data="curRow"
+      @modified="getList"
+    />
     <!-- ModifyGuide -->
-    <ModifyGuide ref="modifyGuideRef" :row-data="curRow" @modified="getList" />
+    <ModifyGuide ref="modifyGuideRef" :row-data="curRow" />
   </div>
 </template>
 
@@ -103,7 +110,7 @@
   import useDictOption from '@/hooks/dict-option';
   import { modalConfirm } from '@/utils/arco';
   import { downloadByApi } from '@/utils/download';
-  import { useAppStore } from '@/store';
+  import { useAppStore, useUserStore } from '@/store';
 
   import ImportDialog from '@/components/import-dialog/index.vue';
   import ModifyAgent from './modifyAgent.vue';
@@ -115,6 +122,7 @@
 
   const appStore = useAppStore();
   appStore.setInfo({ breadcrumbs: ['基础信息管理', '考点管理'] });
+  const userStore = useUserStore();
 
   const { optionList: ableOptions } = useDictOption('ABLE_TYPE');
 

+ 0 - 6
src/views/base/room-manage/modifyRoom.vue

@@ -50,7 +50,6 @@
           v-model="formData.teachingId"
           placeholder="请选择"
           allow-clear
-          @change="teachingChange"
         />
       </a-form-item>
       <a-form-item field="examSiteId" label="考点">
@@ -58,7 +57,6 @@
           v-model="formData.examSiteId"
           placeholder="请选择"
           allow-clear
-          :cascade="false"
           :teaching-id="formData.teachingId"
         />
       </a-form-item>
@@ -163,10 +161,6 @@
     ],
   };
 
-  function teachingChange() {
-    formData.examSiteId = null;
-  }
-
   /* confirm */
   const { loading, setLoading } = useLoading();
   async function confirm() {

+ 1 - 0
src/views/base/teaching-manage/index.vue

@@ -146,6 +146,7 @@
       cellClass: 'action-column',
     },
   ];
+
   const { dataList, pagination, toPage, getList } = useTable<TeachingItem>(
     teachingListPage,
     searchModel,

+ 4 - 5
src/views/order/order-record-manage/index.vue

@@ -56,7 +56,7 @@
         导入预考
       </a-button>
       <a-button
-        v-if="isAdmin"
+        v-if="userStore.isAdmin"
         type="text"
         :loading="assginLoading"
         @click="toAssgin"
@@ -70,7 +70,7 @@
       </a-button>
       <a-button type="text" @click="toExportOrderDetail">
         <template #icon> <svg-icon name="icon-print" /> </template>
-        导出考场预约情况表
+        导出预约情况表
       </a-button>
     </a-space>
     <a-table
@@ -105,7 +105,7 @@
     <ImportDialog
       ref="importStudentDialogRef"
       title="导入预考"
-      upload-url="/api/apply/import"
+      upload-url="/api/admin/apply/import"
       :format="['xls', 'xlsx']"
       :download-handle="downloadTemplate"
       download-filename="预考导入模板.xlsx"
@@ -120,7 +120,7 @@
 </template>
 
 <script setup lang="ts">
-  import { computed, reactive, ref } from 'vue';
+  import { reactive, ref } from 'vue';
   import { Message, TableColumnData } from '@arco-design/web-vue';
   import {
     orderRecordCancel,
@@ -150,7 +150,6 @@
   const appStore = useAppStore();
   appStore.setInfo({ breadcrumbs: ['考试预约管理', '预约明细'] });
   const userStore = useUserStore();
-  const isAdmin = computed(() => userStore.role === 'ADMIN');
 
   const preDate = getBeforeWeek();
   const searchModel = reactive<OrderRecordListFilter>({

+ 1 - 16
src/views/order/order-record-manage/orderDetailDialog.vue

@@ -9,7 +9,7 @@
     :esc-to-close="false"
     @before-open="modalBeforeOpen"
   >
-    <template #title> 导出考场预约情况表 </template>
+    <template #title> 导出预约情况表 </template>
     <a-form ref="formRef" :model="formData" :rules="rules" auto-label-width>
       <a-form-item field="teachingId" label="教学点">
         <SelectTeaching
@@ -18,14 +18,6 @@
           allow-clear
         />
       </a-form-item>
-      <a-form-item label="考点">
-        <SelectAgent
-          v-model="formData.agentId"
-          placeholder="请选择"
-          allow-clear
-          :teaching-id="formData.teachingId"
-        />
-      </a-form-item>
     </a-form>
 
     <template #footer>
@@ -59,7 +51,6 @@
 
   const defaultFormData = {
     teachingId: null,
-    agentId: null,
   };
 
   const formRef = ref<FormInstance>();
@@ -73,12 +64,6 @@
         message: '请选择教学点',
       },
     ],
-    agentId: [
-      {
-        required: true,
-        message: '请选择考点',
-      },
-    ],
   };
 
   /* confirm */