提交 c3c52e1e authored 作者: lihuihui's avatar lihuihui

update

上级 dea23161
...@@ -29,5 +29,5 @@ export function uploadFile(data) { ...@@ -29,5 +29,5 @@ export function uploadFile(data) {
} }
// 获取可访问的所有项目 // 获取可访问的所有项目
export function getPermissionProject() { export function getPermissionProject() {
return httpRequest.get('/qbs/admin/v1/projects') return httpRequest.get('/api/qbs/admin/v1/projects')
} }
...@@ -4,25 +4,31 @@ import httpRequest from '@/utils/axios' ...@@ -4,25 +4,31 @@ import httpRequest from '@/utils/axios'
* 获取应用列表 * 获取应用列表
*/ */
export function getAppList(params) { export function getAppList(params) {
return httpRequest.get('/qbs/admin/v1/questions', { params }) return httpRequest.get('/api/qbs/admin/v1/questions', { params })
} }
/** /**
* 获取题目分类树形结构 * 获取题目分类树形结构
*/ */
export function getQuestionCategory(params) { export function getQuestionCategory(params) {
return httpRequest.get(`/qbs/admin/v1/question-category/tree/${params}`) return httpRequest.get(`/api/qbs/admin/v1/question-category/tree/${params}`)
} }
/** /**
* 添加试题分类 * 添加试题分类
*/ */
export function addQuestionCategory(data) { export function addQuestionCategory(data) {
return httpRequest.post('/qbs/admin/v1/question-category', data) return httpRequest.post('/api/qbs/admin/v1/question-category', data)
} }
/** /**
* 更新应用 * 更新应用
*/ */
export function updateQuestionCategory(id, data) { export function updateQuestionCategory(id, data) {
return httpRequest.put(`/qbs/admin/v1/question-category/${id}`, data) return httpRequest.put(`/api/qbs/admin/v1/question-category/${id}`, data)
}
/**
* 获取应用列表
*/
export function searchTag(params) {
return httpRequest.get('/api/qbs/admin/v1/knowledge-point/search/x1', { params })
} }
/** /**
......
...@@ -111,5 +111,5 @@ export default { ...@@ -111,5 +111,5 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
</style> </style>
<template> <template>
<app-card> <app-card>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list">
<!-- <template #header-aside> <template v-slot:radio-filter>
<el-button type="primary" icon="el-icon-plus" @click="visible = true">新建试题</el-button> <el-radio v-model="radio" label="1">我的题库</el-radio>
<el-button type="primary" icon="el-icon-plus" @click="visible = true">批量导入试题</el-button> <el-radio v-model="radio" label="2">公共题库</el-radio>
<el-button type="primary" icon="el-icon-plus" @click="visible = true">批量删除</el-button> </template>
</template> --> <template v-slot:input-filter>
<div class="filter-input">
<el-input v-model="filterInput" placeholder="请选择"></el-input>
<div class="pop"></div>
</div>
</template>
<div class="operate-btn"> <div class="operate-btn">
<el-button type="primary" icon="el-icon-plus" @click="$router.push({ path: '/question/create' })" <el-button type="primary" icon="el-icon-plus" @click="$router.push({ path: '/question/create' })"
>新建试题</el-button >新建试题</el-button
...@@ -28,39 +33,73 @@ import { getAppList, getQuestionCategory } from '../api' ...@@ -28,39 +33,73 @@ import { getAppList, getQuestionCategory } from '../api'
export default { export default {
data() { data() {
return { return {
visible: false visible: false,
radio: '1',
filterInput: ''
} }
}, },
computed: { computed: {
tableOptions() { tableOptions() {
return { return {
filters: [ filters: [
{
slots: 'radio-filter',
prop: 'permission',
label: '题库范围:'
},
{ {
type: 'select', type: 'select',
label: '题目类型:' label: '题目类型:',
prop: 'question_type',
options: [
{ label: '单选题', value: 1 },
{ label: '多选题', value: 2 },
{ label: '简答题', value: 3 },
{ label: '案例题', value: 5 },
{ label: '判断题', value: 6 },
{ label: '实操题', value: 7 },
{ label: '情景题', value: 8 }
]
}, },
{ {
prop: 'question_title',
type: 'input', type: 'input',
label: '题目标题:' label: '题目标题:'
}, },
{ {
prop: 'question_content',
type: 'input', type: 'input',
label: '题内容:' label: '题内容:'
}, },
{ {
prop: 'question_difficulty',
type: 'select', type: 'select',
label: '难度等级:' label: '难度等级:',
options: [
{ label: '易', value: '1' },
{ label: '中', value: '2' },
{ label: '难', value: '3' }
]
}, },
{ {
type: 'select', slots: 'input-filter',
prop: 'question_category',
type: 'input',
label: '试题分类:' label: '试题分类:'
}, },
{ {
type: 'input', type: 'input',
label: '知识点标签:' prop: 'question_tag',
label: '知识点/标签:'
} }
], ],
remote: { httpRequest: getAppList }, remote: {
httpRequest: getAppList,
params: {
permission: this.radio,
project_prefix: 'x1'
}
},
columns: [ columns: [
{ label: '序号', prop: 'order' }, { label: '序号', prop: 'order' },
{ label: '题目类型', prop: 'type' }, { label: '题目类型', prop: 'type' },
...@@ -91,6 +130,13 @@ export default { ...@@ -91,6 +130,13 @@ export default {
// tan ~~~~~ // tan ~~~~~
this.$router.push({ path: '/settings/users', query: { appid: row.id } }) this.$router.push({ path: '/settings/users', query: { appid: row.id } })
} }
},
watch: {
radio: {
handler() {
this.$refs.list.refetch()
}
}
} }
} }
</script> </script>
...@@ -100,4 +146,14 @@ export default { ...@@ -100,4 +146,14 @@ export default {
display: flex; display: flex;
padding-bottom: 10px; padding-bottom: 10px;
} }
.filter-input {
position: relative;
.pop {
position: absolute;
top: 0;
right: 0;
width: 200px;
height: 100%;
}
}
</style> </style>
...@@ -24,12 +24,12 @@ export default defineConfig({ ...@@ -24,12 +24,12 @@ export default defineConfig({
// '/api': 'https://app.ezijing.com' // '/api': 'https://app.ezijing.com'
// } // }
proxy: { proxy: {
'/api': 'https://app.ezijing.com', '/api/qbs': {
'/qbs': {
target: 'https://question-api.ezijing.com', target: 'https://question-api.ezijing.com',
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/qbs/, '') rewrite: path => path.replace(/^\/api\/qbs/, '')
} },
'/api': 'https://app.ezijing.com'
} }
}, },
resolve: { resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论