zhangjie 2 жил өмнө
parent
commit
e50fafbeac

+ 40 - 21
src/views/exam/school-manage.vue

@@ -1,23 +1,38 @@
 <template>
   <div class="school-manage pg-main">
     <div class="pg-title">
-      <span>学校管理</span>
+      <span>学校管理</span>
     </div>
-    <div class="pg-select-infos" style="padding: 20px">
-      <Button
-        style="min-left: 10px"
-        type="primary"
-        icon="md-search"
-        @click="load"
-        >查询</Button
-      >
-      <Button
-        type="primary"
-        icon="md-refresh"
-        :loading="loading"
-        @click="toSyncSchool"
-        >机构同步</Button
-      >
+    <div class="pg-select-infos">
+      <Form ref="user_query_form" :label-width="80" inline>
+        <Row :gutter="20">
+          <Col span="8">
+            <FormItem label="学校" style="width: 100%">
+              <Select v-model="query.schoolId" filterable clearable>
+                <Option v-for="item in schools" :value="item.id" :key="item.id"
+                  >{{ item.name }}
+                </Option>
+              </Select>
+            </FormItem>
+          </Col>
+          <Col span="8">
+            <Button
+              style="min-left: 10px"
+              type="primary"
+              icon="md-search"
+              @click="filterSchool"
+              >查询</Button
+            >
+            <Button
+              type="primary"
+              icon="md-refresh"
+              :loading="loading"
+              @click="toSyncSchool"
+              >机构同步</Button
+            >
+          </Col>
+        </Row>
+      </Form>
     </div>
     <div class="pg-body">
       <Table
@@ -47,10 +62,7 @@ export default {
   data() {
     return {
       query: {
-        pageNo: 1,
-        pageSize: 10,
-        totalElements: 0,
-        totalPages: 0,
+        schoolId: 1,
       },
       columns: [
         {
@@ -126,6 +138,7 @@ export default {
           },
         },
       ],
+      schools: [],
       list: [],
       curRow: {},
       loading: false,
@@ -138,9 +151,15 @@ export default {
     load() {
       axios.post("/system/common/school/list", {}).then((response) => {
         let data = response.data.data;
-        this.list = data || [];
+        this.schools = data || [];
+        this.list = this.schools;
       });
     },
+    filterSchool() {
+      this.list = this.schools.filter(
+        (item) => item.id === this.query.schoolId
+      );
+    },
     toSet(row) {
       this.curRow = row;
       this.$refs.SchoolSetDialog.open();