|
@@ -11,7 +11,7 @@
|
11
|
11
|
class="demo-ruleForm"
|
12
|
12
|
>
|
13
|
13
|
<el-form-item label="学期" prop="appName" style="width:30vw">
|
14
|
|
- <el-select v-model="ruleForm.appType" filterable placeholder="请选择">
|
|
14
|
+ <el-select v-model="ruleForm.appType" :remote-method="remoteMethod" filterable remote reserve-keyword :loading="loading" placeholder="请选择">
|
15
|
15
|
<el-option
|
16
|
16
|
v-for="item in options"
|
17
|
17
|
:key="item.value"
|
|
@@ -62,6 +62,9 @@ export default {
|
62
|
62
|
},
|
63
|
63
|
data() {
|
64
|
64
|
return {
|
|
65
|
+ options: [],
|
|
66
|
+ loading: false,
|
|
67
|
+ list: [],
|
65
|
68
|
configId: '',
|
66
|
69
|
gameForm: {
|
67
|
70
|
gameForm: undefined
|
|
@@ -104,7 +107,7 @@ export default {
|
104
|
107
|
|
105
|
108
|
status: [{ required: true, message: '请选择状态', trigger: 'blur' }]
|
106
|
109
|
},
|
107
|
|
- options: [{
|
|
110
|
+ states: [{
|
108
|
111
|
value: '选项1',
|
109
|
112
|
label: '2022年第一学期'
|
110
|
113
|
}, {
|
|
@@ -150,8 +153,23 @@ export default {
|
150
|
153
|
// this.$router.go(-1)
|
151
|
154
|
// })
|
152
|
155
|
}
|
|
156
|
+ this.list = this.states
|
153
|
157
|
},
|
154
|
158
|
methods: {
|
|
159
|
+ remoteMethod(query) {
|
|
160
|
+ console.log(666)
|
|
161
|
+ if (query !== '') {
|
|
162
|
+ this.loading = true
|
|
163
|
+ setTimeout(() => {
|
|
164
|
+ this.loading = false
|
|
165
|
+ this.options = this.list.filter(item => {
|
|
166
|
+ return item.label.indexOf(query) > -1
|
|
167
|
+ })
|
|
168
|
+ }, 200)
|
|
169
|
+ } else {
|
|
170
|
+ this.options = []
|
|
171
|
+ }
|
|
172
|
+ },
|
155
|
173
|
submitForm(formName) {
|
156
|
174
|
this.$refs[formName].validate((valid) => {
|
157
|
175
|
console.log(this.ruleForm)
|