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