master
xy 1 year ago
parent aa4006cbf5
commit 295a40397e

@ -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'
})
})
}

@ -16,6 +16,21 @@
<section>
<div class="select-panel">
<el-input style="width: 120px;" v-model="select['filter[1][value]']" placeholder="学校名称.." size="small"></el-input>
<el-select
v-model="select['type']"
clearable
placeholder="请选择学校类型"
multiple
collapse-tags
size="small"
>
<el-option
v-for="(option, optionIndex) in schoolType"
:key="optionIndex"
:label="option['label']"
:value="option['value']"
></el-option>
</el-select>
<el-select style="width: 100px;" clearable v-model="select['filter[0][value]']" placeholder="区域.." size="small">
<el-option v-for="item in area" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
@ -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();
},
}

Loading…
Cancel
Save