support filter by problemId or displayId in adding problems to contest

This commit is contained in:
zema1 2018-08-27 21:09:43 +08:00
parent f2fb19b032
commit 45df89ca6f
2 changed files with 18 additions and 5 deletions

View File

@ -11,9 +11,9 @@ export const m = {
Problem_List: '问题列表',
Create_Problem: '增加题目',
Export_Import_Problem: '导入导出题目',
Contest: '测试&练习',
Contest_List: '测试列表',
Create_Contest: '创建测试',
Contest: '比赛&练习',
Contest_List: '比赛列表',
Create_Contest: '创建比赛',
// User.vue
User_User: '用户',
Import_User: '导入用户',

View File

@ -1,5 +1,10 @@
<template>
<div>
<el-input
v-model="keyword"
placeholder="Keywords"
prefix-icon="el-icon-search">
</el-input>
<el-table :data="problems" v-loading="loading">
<el-table-column
label="ID"
@ -49,7 +54,8 @@
total: 0,
loading: false,
problems: [],
contest: {}
contest: {},
keyword: ''
}
},
mounted () {
@ -63,6 +69,7 @@
getPublicProblem (page) {
this.loading = true
let params = {
keyword: this.keyword,
offset: (page - 1) * this.limit,
limit: this.limit,
rule_type: this.contest.rule_type
@ -83,10 +90,16 @@
}
api.addProblemFromPublic(data).then(() => {
this.$emit('on-change')
}, () => {})
}, () => {
})
}, () => {
})
}
},
watch: {
'keyword' () {
this.getPublicProblem(this.page)
}
}
}
</script>