|
@@ -53,19 +53,13 @@
|
|
|
<el-select
|
|
|
v-model="ruleForm.school"
|
|
|
filterable
|
|
|
- clearable
|
|
|
- @clear="clearSchoolList"
|
|
|
- :allow-create="false"
|
|
|
- remote
|
|
|
placeholder="请输入学校"
|
|
|
- :remote-method="remoteMethod"
|
|
|
- :loading="loading"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -174,9 +168,6 @@ export default {
|
|
|
},
|
|
|
tx: require("../assets/avatar2.png"),
|
|
|
options: [],
|
|
|
- list: [],
|
|
|
- loading: false,
|
|
|
- schoolList: [],
|
|
|
num: "",
|
|
|
dialogVisibleSuccess: false,
|
|
|
copyText: "",
|
|
@@ -205,22 +196,6 @@ export default {
|
|
|
}
|
|
|
this.ruleForm.region = "广东省" + loc;
|
|
|
},
|
|
|
- remoteMethod(query) {
|
|
|
- if (query !== "") {
|
|
|
- this.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- this.options = this.list.filter((item) => {
|
|
|
- return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
|
- });
|
|
|
- }, 200);
|
|
|
- } else {
|
|
|
- this.options = [];
|
|
|
- }
|
|
|
- },
|
|
|
- clearSchoolList() {
|
|
|
- this.options = [];
|
|
|
- },
|
|
|
getSchool() {
|
|
|
let params = {
|
|
|
n: "",
|
|
@@ -228,10 +203,8 @@ export default {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "getSchool", params)
|
|
|
.then((res) => {
|
|
|
- this.schoolList = res.data[0];
|
|
|
- this.list = this.schoolList.map((item) => {
|
|
|
- return { value: item.id, label: item.name };
|
|
|
- });
|
|
|
+ debugger;
|
|
|
+ this.options = res.data[0];
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|