实现后台对未交作业人员的查询

This commit is contained in:
F嘉阳
2018-02-22 22:05:56 +08:00
parent 355c1c171f
commit 3abbd49f65
9 changed files with 119 additions and 11 deletions

View File

@@ -1,6 +1,9 @@
var Main = {
data() {
return {
restaurants: [],
state1: '',
state2: '',
activeIndex: '1',
formInline: {
user: '',
@@ -61,8 +64,40 @@ var Main = {
}
})
},
handleSelect(key, keyPath) {
console.log(key, keyPath);
querySearch(queryString, cb) {
var restaurants = this.restaurants;
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
loadAll() {
return [
{ "value": "三全鲜食(北新泾店)", "address": "长宁区新渔路144号" },
{ "value": "Hot honey 首尔炸鸡(仙霞路)", "address": "上海市长宁区淞虹路661号" },
{ "value": "南拳妈妈龙虾盖浇饭", "address": "普陀区金沙江路1699号鑫乐惠美食广场A13" }
];
},
querySearchAsync(queryString, cb) {
var restaurants = this.restaurants;
var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
cb(results);
}, 1000 * Math.random());
},
createStateFilter(queryString) {
return (state) => {
return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
handleSelect(item) {
console.log(item);
},
ClickToJump(targe){
window.location.href="http://localhost:8080/cms/home/" + targe;
@@ -83,6 +118,20 @@ var Main = {
onSubmit() {
console.log('submit!');
}
},
mounted() {
/*this.restaurants = this.loadAll();*/
this.restaurants=this.$nextTick(() => {
var that = this;
axios.get('http://localhost:8080/cms/home/findvcourse')
.then(function (response) {
console.log(response.data);
that.logData = response.data;
})
.catch(function (error) {
console.log(error);
});
})
}
}
var Ctor = Vue.extend(Main)