From 295a40397e565d421ba1cacb0fb82f2e5c754808 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Mon, 24 Mar 2025 13:05:19 +0800 Subject: [PATCH] init --- src/api/school/school.js | 7 +++- .../BatchSub/components/SchoolPicker.vue | 40 ++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/api/school/school.js b/src/api/school/school.js index 347527b..f6019c0 100644 --- a/src/api/school/school.js +++ b/src/api/school/school.js @@ -1,11 +1,14 @@ import request from '@/utils/request' - +import qs from 'qs' export function index(params,isLoading = true) { return request({ method: 'get', url: '/api/admin/school/index', params, -isLoading + isLoading, + paramsSerializer: params => qs.stringify(params, { + arrayFormat: 'indices' + }) }) } diff --git a/src/views/BatchSub/components/SchoolPicker.vue b/src/views/BatchSub/components/SchoolPicker.vue index 9a8bfa5..ac05566 100644 --- a/src/views/BatchSub/components/SchoolPicker.vue +++ b/src/views/BatchSub/components/SchoolPicker.vue @@ -16,6 +16,21 @@
+ + + @@ -155,6 +170,7 @@ import { PopupManager } from "element-ui/lib/utils/popup"; import { defaultModalSize } from "@/settings"; import { index as areaIndex } from "@/api/area/area"; import { index } from "@/api/school/school"; +import {getparameter} from "@/api/system/dictionary"; export default { props: { @@ -185,12 +201,14 @@ export default { 'filter[2][key]': 'star', 'filter[2][op]': 'like', 'filter[2][value]': '', + 'type': [], }, total: 0, allAlign: null, tableData: [], area: [], + schoolType: [] } }, methods: { @@ -239,6 +257,22 @@ export default { return acc; }, []); }, + async getSchoolType() { + try { + const { detail } = await getparameter( + { + number: 'school_type' + }, + false + ); + this.schoolType = detail?.map(i => ({ + value: i.value, + label: i.value + })); + } catch (err) { + console.error(err); + } + }, async getArea() { try { const res = await areaIndex( @@ -272,6 +306,7 @@ export default { }, toggleDefault() { this.$nextTick(_ => { + this.$refs['table']?.clearCheckboxReserve() this.$refs['table']?.clearCheckboxRow() this.$refs['table']?.setCheckboxRow(this.tableData.filter(i => !!this.defaultValue.find(j => j.id === i.id)), true) }) @@ -281,6 +316,9 @@ export default { if ($table) { console.log(this.uniqueArr($table.getCheckboxReserveRecords(true), $table.getCheckboxRecords(true), this.defaultValue).map(i => ({ id: i.id, code: i.code, name: i.name }))) this.$emit('confirm', this.uniqueArr($table.getCheckboxReserveRecords(true), $table.getCheckboxRecords(true), this.defaultValue).map(i => ({ id: i.id, code: i.code, name: i.name }))) + this.setDefaultValue() + this.$refs['table']?.clearCheckboxReserve() + this.$refs['table']?.clearCheckboxRow() this.$emit('update:isShow', false) } } @@ -300,7 +338,7 @@ export default { }, created() { this.getArea(); - + this.getSchoolType(); this.getList(); }, }