刘洋 10 месяцев назад
Родитель
Сommit
14bc115e7e

+ 9 - 9
postcss.config.cjs

@@ -2,14 +2,14 @@ module.exports = {
   plugins: {
     tailwindcss: {},
     autoprefixer: {},
-    "postcss-pxtorem": {
-      rootValue: 12.8,
-      unitPrecision: 5,
-      propList: ["*"],
-      selectorBlackList: [],
-      replace: true,
-      mediaQuery: false,
-      minPixelValue: 0,
-    },
+    // "postcss-pxtorem": {
+    //   rootValue: 12.8,
+    //   unitPrecision: 5,
+    //   propList: ["*"],
+    //   selectorBlackList: [],
+    //   replace: true,
+    //   mediaQuery: false,
+    //   minPixelValue: 0,
+    // },
   },
 };

+ 51 - 14
src/pages/exam-manage/index.vue

@@ -3,19 +3,27 @@
     <Block class="header-block tw-flex tw-items-center tw-justify-between">
       <a-form layout="inline">
         <a-form-item label="学校名称">
-          <a-select
+          <!-- <a-select
             v-model:value="query.schoolId"
             show-search
             :filterOption="false"
             @search="(name:string) => querySchoolList(name, 'list')"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="query.schoolId"
+            show-search
+            placeholder="学校名称"
+            :options="schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次">
@@ -58,11 +66,7 @@
         :data-source="examTableData.result"
         emptyText="暂无考试信息"
         :loading="tableLoading"
-        :pagination="{
-          total: examTableData.totalCount,
-          pageSize: query.pageSize,
-          showTotal:(total:any) => `共 ${total} 条`
-        }"
+        :pagination="pagination"
         @change="currentPageChange"
         :row-class-name="
           (_:any, index:number) => (index % 2 === 1 ? 'table-striped' : null)
@@ -98,20 +102,28 @@
     >
       <a-form :labelCol="{ span: 6 }">
         <a-form-item label="学校名称" v-bind="validateInfos.schoolId">
-          <a-select
+          <!-- <a-select
             v-model:value="examInfo.schoolId"
             show-search
             :disabled="!!examInfo.id"
             @search="(name: string) => querySchoolList(name,'form')"
             :filterOption="false"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="examInfo.schoolId"
+            show-search
+            placeholder="学校名称"
+            :options="examInfo.schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in examInfo.schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次" v-bind="validateInfos.name">
@@ -143,7 +155,7 @@
 </template>
 
 <script setup lang="ts" name="PageExam">
-import { reactive, ref, watch, unref, markRaw, toRaw } from "vue";
+import { reactive, ref, watch, unref, markRaw, toRaw, computed } from "vue";
 import { PlusCircleOutlined } from "@ant-design/icons-vue";
 import { getSchoolListHttp } from "@/apis/school";
 import {
@@ -234,7 +246,7 @@ const querySchoolList = throttle(
     try {
       const { result = [], totalCount } = await getSchoolListHttp({
         pageNumber: 1,
-        pageSize: 10,
+        pageSize: 1000,
         name,
       });
       Object.assign(isList ? schoolTableData : examInfo.schoolTableData, {
@@ -274,6 +286,13 @@ const queryExamList = async () => {
 };
 
 watch(() => query.pageNumber, queryExamList);
+watch(
+  () => query.pageSize,
+  () => {
+    query.pageNumber = 1;
+    queryExamList();
+  }
+);
 
 /** 编辑考试 */
 const onEdit = (record: ExamListInfo) => {
@@ -300,8 +319,16 @@ const onAddNewExam = () => {
   });
 };
 
-const currentPageChange = ({ current }: { current: number }) => {
+const currentPageChange = ({
+  current,
+  pageSize,
+}: {
+  current: number;
+  pageSize: number;
+}) => {
+  console.log(current, pageSize);
   query.pageNumber = current;
+  query.pageSize = pageSize;
 };
 
 /** 同步考试数据 */
@@ -318,6 +345,16 @@ querySchoolList();
 if (query.schoolId) {
   queryExamList();
 }
+
+const pagination = computed(() => {
+  return {
+    showSizeChanger: true,
+    total: examTableData.totalCount,
+    pageSize: query.pageSize,
+    current: query.pageNumber,
+    showTotal: (total: any) => `共 ${total} 条`,
+  };
+});
 </script>
 
 <style scoped lang="less">

+ 27 - 7
src/pages/school-manage/index.vue

@@ -36,11 +36,7 @@
         :data-source="schoolTableData.result"
         emptyText="暂无学校信息"
         @change="currentPageChange"
-        :pagination="{
-          total: schoolTableData.totalCount,
-          pageSize: query.pageSize,
-          showTotal: (total:any) => `共 ${total} 条`,
-        }"
+        :pagination="pagination"
         :row-class-name="
           (_:any, index:number) => (index % 2 === 1 ? 'table-striped' : null)
         "
@@ -148,7 +144,7 @@
 </template>
 
 <script setup lang="ts" name="PageSchool">
-import { reactive, ref, watch } from "vue";
+import { reactive, ref, watch, computed } from "vue";
 import {
   PlusCircleOutlined,
   CheckCircleFilled,
@@ -226,8 +222,16 @@ const toggleAddSchoolModal = (show: boolean = true) => {
   showModal.value = show;
 };
 
-const currentPageChange = ({ current }: { current: number }) => {
+const currentPageChange = ({
+  current,
+  pageSize,
+}: {
+  current: number;
+  pageSize: number;
+}) => {
+  console.log(current, pageSize);
   query.pageNumber = current;
+  query.pageSize = pageSize;
 };
 
 /** 查询学校列表 */
@@ -241,6 +245,13 @@ const querySchoolList = async () => {
 };
 
 watch(() => query.pageNumber, querySchoolList);
+watch(
+  () => query.pageSize,
+  () => {
+    query.pageNumber = 1;
+    querySchoolList();
+  }
+);
 
 /* 启用/禁用 */
 const updateSchoolStatus = (record: SchoolListInfo) => {
@@ -278,6 +289,15 @@ const onAddNewSchool = () => {
 
 /** effect */
 querySchoolList();
+const pagination = computed(() => {
+  return {
+    current: query.pageNumber,
+    total: schoolTableData.totalCount,
+    pageSize: query.pageSize,
+    showSizeChanger: true,
+    showTotal: (total: any) => `共 ${total} 条`,
+  };
+});
 </script>
 
 <style scoped lang="less">

+ 51 - 14
src/pages/subjects-manage/index.vue

@@ -3,19 +3,27 @@
     <Block class="header-block tw-flex tw-items-end">
       <a-form layout="inline" class="tw-flex-1">
         <a-form-item label="学校名称">
-          <a-select
+          <!-- <a-select
             v-model:value="query.schoolId"
             show-search
             :filterOption="false"
             @search="(name:string) => querySchoolList(name, 'list')"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="query.schoolId"
+            show-search
+            placeholder="学校名称"
+            :options="schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次">
@@ -119,11 +127,7 @@
       <a-table
         :columns="columns"
         :data-source="subjectsTableData.result"
-        :pagination="{
-          total: subjectsTableData.totalCount,
-          pageSize: query.pageSize,
-          showTotal: (total:any) => `共 ${total} 条`,
-        }"
+        :pagination="pagination"
         @change="currentPageChange"
         :row-class-name="
           (_:any, index:number) => (index % 2 === 1 ? 'table-striped' : null)
@@ -168,19 +172,27 @@
     >
       <a-form :labelCol="{ span: 6 }">
         <a-form-item label="学校名称" v-bind="validateInfos.schoolId">
-          <a-select
+          <!-- <a-select
             v-model:value="uploadQuery.schoolId"
             show-search
             :filterOption="false"
             @search="(name: string) => querySchoolList(name,'form')"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="uploadQuery.schoolId"
+            show-search
+            placeholder="学校名称"
+            :options="uploadQuery.schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in uploadQuery.schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次" v-bind="validateInfos.examId">
@@ -227,7 +239,7 @@
 </template>
 
 <script setup lang="ts" name="PageSubjects">
-import { onBeforeMount, reactive, ref, watch } from "vue";
+import { onBeforeMount, reactive, ref, watch, computed } from "vue";
 import {
   UploadOutlined,
   CheckCircleFilled,
@@ -376,7 +388,7 @@ const querySchoolList = throttle(
       const { result = [], totalCount } = await getSchoolListHttp({
         name,
         pageNumber: 1,
-        pageSize: 10,
+        pageSize: 1000,
       });
       Object.assign(isList ? schoolTableData : uploadQuery.schoolTableData, {
         result,
@@ -431,6 +443,13 @@ const querySubjectsList = async () => {
 };
 
 watch(() => query.pageNumber, querySubjectsList);
+watch(
+  () => query.pageSize,
+  () => {
+    query.pageNumber = 1;
+    querySubjectsList();
+  }
+);
 
 let modalParamsActive = ref(false);
 
@@ -459,8 +478,16 @@ watch(
   }
 );
 
-const currentPageChange = ({ current }: { current: number }) => {
+const currentPageChange = ({
+  current,
+  pageSize,
+}: {
+  current: number;
+  pageSize: number;
+}) => {
+  console.log(current, pageSize);
   query.pageNumber = current;
+  query.pageSize = pageSize;
 };
 
 /** 导出主观题 */
@@ -550,6 +577,16 @@ onBeforeMount(async () => {
     console.error(error);
   }
 });
+
+const pagination = computed(() => {
+  return {
+    current: query.pageNumber,
+    showSizeChanger: true,
+    total: subjectsTableData.totalCount,
+    pageSize: query.pageSize,
+    showTotal: (total: any) => `共 ${total} 条`,
+  };
+});
 </script>
 
 <style scoped lang="less">

+ 51 - 14
src/pages/user-manage/index.vue

@@ -3,19 +3,27 @@
     <Block class="header-block tw-flex tw-items-center">
       <a-form layout="inline">
         <a-form-item label="学校名称">
-          <a-select
+          <!-- <a-select
             v-model:value="query.schoolId"
             show-search
             :filterOption="false"
             @search="(name:string) => querySchoolList(name,'list')"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="query.schoolId"
+            show-search
+            placeholder="学校名称"
+            :options="schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="登录名">
@@ -67,11 +75,7 @@
       <a-table
         :columns="columns"
         :data-source="userTableData.result"
-        :pagination="{
-          total: userTableData.totalCount,
-          pageSize: query.pageSize,
-          showTotal: (total:any) => `共 ${total} 条`,
-        }"
+        :pagination="pagination"
         @change="currentPageChange"
         :row-class-name="
           (_:any, index:number) => (index % 2 === 1 ? 'table-striped' : null)
@@ -129,20 +133,28 @@
     >
       <a-form :labelCol="{ span: 6 }">
         <a-form-item label="学校" v-bind="validateInfos.schoolId">
-          <a-select
+          <!-- <a-select
             v-model:value="userInfo.schoolId"
             show-search
             :disabled="!!userInfo.id"
             :filterOption="false"
             @search="(name:string) => querySchoolList(name,'form')"
             placeholder="学校名称"
+          > -->
+          <a-select
+            v-model:value="userInfo.schoolId"
+            show-search
+            placeholder="学校"
+            :options="userInfo.schoolTableData.result"
+            :fieldNames="{ label: 'name', value: 'id' }"
+            optionFilterProp="name"
           >
-            <a-select-option
+            <!-- <a-select-option
               v-for="school in userInfo.schoolTableData.result"
               :key="school.id"
               :value="school.id"
               >{{ school.name }}</a-select-option
-            >
+            > -->
           </a-select>
         </a-form-item>
         <a-form-item label="角色" v-bind="validateInfos.role">
@@ -262,7 +274,7 @@
 </template>
 
 <script setup lang="ts" name="PageUsers">
-import { nextTick, reactive, ref, watch, markRaw } from "vue";
+import { nextTick, reactive, ref, watch, markRaw, computed } from "vue";
 import {
   PlusCircleOutlined,
   CheckCircleFilled,
@@ -434,7 +446,7 @@ const querySchoolList = throttle(
       const { result = [], totalCount } = await getSchoolListHttp({
         name,
         pageNumber: 1,
-        pageSize: 10,
+        pageSize: 1000,
       });
       Object.assign(
         isList
@@ -483,6 +495,13 @@ const queryUserList = async () => {
 };
 
 watch(() => query.pageNumber, queryUserList);
+watch(
+  () => query.pageSize,
+  () => {
+    query.pageNumber = 1;
+    queryUserList();
+  }
+);
 
 /* 启用/禁用 */
 const updateUserStatus = (record: UserInfo) => {
@@ -617,8 +636,16 @@ const onUpdateUserPwd = () => {
   });
 };
 
-const currentPageChange = ({ current }: { current: number }) => {
+const currentPageChange = ({
+  current,
+  pageSize,
+}: {
+  current: number;
+  pageSize: number;
+}) => {
+  console.log(current, pageSize);
   query.pageNumber = current;
+  query.pageSize = pageSize;
 };
 
 querySchoolList();
@@ -627,6 +654,16 @@ querySchoolList();
 if (query.schoolId) {
   queryUserList();
 }
+
+const pagination = computed(() => {
+  return {
+    current: query.pageNumber,
+    total: userTableData.totalCount,
+    pageSize: query.pageSize,
+    showSizeChanger: true,
+    showTotal: (total: any) => `共 ${total} 条`,
+  };
+});
 </script>
 
 <style scoped lang="less">

+ 2 - 2
vite.config.ts

@@ -56,8 +56,8 @@ export default defineConfig({
     proxy: {
       "^/api": {
         // target: "http://192.168.10.39:7100",
-        target: "http://192.168.11.28:7101",
-        // target: "http://test.markingtool.cn",
+        // target: "http://192.168.11.28:7101",
+        target: "http://test.markingtool.cn",
       },
     },
   },