|
|
|
|
@ -22,15 +22,30 @@
|
|
|
|
|
@click="isShowAdd = true"
|
|
|
|
|
>新增</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="isHasAuth('search')"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="getList(true)"
|
|
|
|
|
<template v-if="isHasAuth('search')">
|
|
|
|
|
<el-date-picker v-model="select['filter[1][value]']" size="small" style="width: 110px;" type="year" value-format="yyyy" placeholder="年份.."></el-date-picker>
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="select['filter[0][value]']"
|
|
|
|
|
:options="school"
|
|
|
|
|
:props="{
|
|
|
|
|
emitPath: false,
|
|
|
|
|
value: 'id',
|
|
|
|
|
label: 'name',
|
|
|
|
|
}"></el-cascader>
|
|
|
|
|
<!-- <el-select style="width: 140px;" clearable v-model="select['filter[0][value]']" placeholder="学校.." size="small">-->
|
|
|
|
|
<!-- <el-option v-for="item in school" :key="item.id" :label="item.name" :value="item.id"></el-option>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="getList(true)"
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
>
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
</slot>
|
|
|
|
|
@ -95,7 +110,7 @@
|
|
|
|
|
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
field="school_id"
|
|
|
|
|
field="school.name"
|
|
|
|
|
width="180"
|
|
|
|
|
title="所属学校"
|
|
|
|
|
:edit-render="{
|
|
|
|
|
@ -104,7 +119,19 @@
|
|
|
|
|
props: { multiple: false },
|
|
|
|
|
optionProps: { value: 'id', label: 'name' },
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="row['school_id']"
|
|
|
|
|
:options="school"
|
|
|
|
|
:props="{
|
|
|
|
|
emitPath: false,
|
|
|
|
|
value: 'id',
|
|
|
|
|
label: 'name',
|
|
|
|
|
}"></el-cascader>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
@ -247,7 +274,7 @@ import AddScore from "./components/AddScore.vue";
|
|
|
|
|
import ShowScore from "./components/ShowScore.vue";
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
|
|
|
|
|
import { index as areaIndex } from "@/api/area/area";
|
|
|
|
|
import { index as schoolIndex } from "@/api/school/school";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
@ -270,7 +297,13 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 20,
|
|
|
|
|
keyword: "",
|
|
|
|
|
show_relation: [],
|
|
|
|
|
show_relation: ['school'],
|
|
|
|
|
"filter[0][key]": 'school_id',
|
|
|
|
|
"filter[0][op]": 'eq',
|
|
|
|
|
"filter[0][value]": '',
|
|
|
|
|
"filter[1][key]": 'year',
|
|
|
|
|
"filter[1][op]": 'eq',
|
|
|
|
|
"filter[1][value]": ''
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
allAlign: null,
|
|
|
|
|
@ -295,6 +328,7 @@ export default {
|
|
|
|
|
validRules: {},
|
|
|
|
|
|
|
|
|
|
school: [],
|
|
|
|
|
area: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
@ -312,6 +346,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getArea();
|
|
|
|
|
this.getSchool();
|
|
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
@ -387,6 +422,20 @@ export default {
|
|
|
|
|
this.isShowDetail = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getArea() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await areaIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.area = res.data;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getSchool() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await schoolIndex(
|
|
|
|
|
@ -396,7 +445,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.school = res.data;
|
|
|
|
|
|
|
|
|
|
this.school = this.area.map(area => ({
|
|
|
|
|
...area,
|
|
|
|
|
children: res.data.filter(school => school.area_id === area.id)
|
|
|
|
|
}))
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
@ -526,6 +579,9 @@ export default {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .vxe-buttons--wrapper > * + * {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-card__header {
|
|
|
|
|
padding: 6px 20px;
|
|
|
|
|
}
|
|
|
|
|
|