dev-qsh
zcxee 1 year ago
parent ca533e85e3
commit 15622a2e5a
  1. 9
      .env.development
  2. 26
      src/api/question.js
  3. 2
      src/permission.js
  4. 105
      src/router/index.js
  5. 174
      src/views/question/components/QuestionForm.vue
  6. 101
      src/views/question/index.vue
  7. 13
      vue.config.js

@ -1,3 +1,10 @@
###
# @Author: riverQiu
# @Date: 2023-08-16 22:04:23
# @LastEditors: riverQiu
# @LastEditTime: 2023-08-18 23:22:27
# @Description:
###
# 页面标题 # 页面标题
VUE_APP_TITLE = 莳松管理系统 VUE_APP_TITLE = 莳松管理系统
@ -7,5 +14,7 @@ ENV = 'development'
# 莳松管理系统/开发环境 # 莳松管理系统/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
JWL_API = ''
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -0,0 +1,26 @@
/*
* @Author: riverQiu
* @Date: 2023-08-17 20:30:56
* @LastEditors: riverQiu
* @LastEditTime: 2023-08-19 00:26:04
* @Description:
*/
import request from '@/utils/request';
// 获取首页统计信息
export function searchQuestion(param) {
return request({
url: '/driver-api/tdQuestion/duima/list',
method: 'get',
params: param
});
}
export function updateQuestion(data) {
return request({
url: '/driver-api/tdQuestion/duima/update',
method: 'put',
data: data
});
}

@ -16,7 +16,7 @@ NProgress.configure({
showSpinner: false showSpinner: false
}); });
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']; const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/question'];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start();

@ -37,28 +37,33 @@ export const constantRoutes = [{
path: '/redirect/:path(.*)', path: '/redirect/:path(.*)',
component: () => import('@/views/redirect') component: () => import('@/views/redirect')
}] }]
}, },
{ {
path: '/login', path: '/login',
component: () => import('@/views/login'), component: () => import('@/views/login'),
hidden: true hidden: true
}, },
{ {
path: '/register', path: '/register',
component: () => import('@/views/register'), component: () => import('@/views/register'),
hidden: true hidden: true
}, },
{ {
path: '/question',
component: () => import('@/views/question'),
hidden: true
},
{
path: '/404', path: '/404',
component: () => import('@/views/error/404'), component: () => import('@/views/error/404'),
hidden: true hidden: true
}, },
{ {
path: '/401', path: '/401',
component: () => import('@/views/error/401'), component: () => import('@/views/error/401'),
hidden: true hidden: true
}, },
{ {
path: '', path: '',
component: Layout, component: Layout,
redirect: 'index', redirect: 'index',
@ -72,36 +77,36 @@ export const constantRoutes = [{
affix: true affix: true
} }
}] }]
}, },
// { // {
// path: '/demo', // path: '/demo',
// component: Layout, // component: Layout,
// redirect: 'noredirect', // redirect: 'noredirect',
// meta: { // meta: {
// title: 'Demo', // title: 'Demo',
// icon: 'xx' // icon: 'xx'
// }, // },
// children: [{ // children: [{
// path: '/base-page', // path: '/base-page',
// component: () => import('@/views/demo/basePage/index'), // component: () => import('@/views/demo/basePage/index'),
// name: 'BasePage', // name: 'BasePage',
// meta: { // meta: {
// title: 'BasePage', // title: 'BasePage',
// icon: 'xx' // icon: 'xx'
// } // }
// }, // },
// { // {
// path: '/base-components', // path: '/base-components',
// component: () => import('@/views/demo/baseComponents/index'), // component: () => import('@/views/demo/baseComponents/index'),
// name: 'BaseComponents', // name: 'BaseComponents',
// meta: { // meta: {
// title: 'BaseComponents', // title: 'BaseComponents',
// icon: 'xx' // icon: 'xx'
// } // }
// } // }
// ] // ]
// }, // },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
hidden: true, hidden: true,
@ -115,7 +120,7 @@ export const constantRoutes = [{
icon: 'user' icon: 'user'
} }
}] }]
} }
]; ];
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
@ -133,8 +138,8 @@ export const dynamicRoutes = [{
activeMenu: '/system/user' activeMenu: '/system/user'
} }
}] }]
}, },
{ {
path: '/system/role-auth', path: '/system/role-auth',
component: Layout, component: Layout,
hidden: true, hidden: true,
@ -148,8 +153,8 @@ export const dynamicRoutes = [{
activeMenu: '/system/role' activeMenu: '/system/role'
} }
}] }]
}, },
{ {
path: '/system/dict-data', path: '/system/dict-data',
component: Layout, component: Layout,
hidden: true, hidden: true,
@ -163,8 +168,8 @@ export const dynamicRoutes = [{
activeMenu: '/system/dict' activeMenu: '/system/dict'
} }
}] }]
}, },
{ {
path: '/monitor/job-log', path: '/monitor/job-log',
component: Layout, component: Layout,
hidden: true, hidden: true,
@ -178,8 +183,8 @@ export const dynamicRoutes = [{
activeMenu: '/monitor/job' activeMenu: '/monitor/job'
} }
}] }]
}, },
{ {
path: '/zs/clue-form', path: '/zs/clue-form',
component: Layout, component: Layout,
hidden: true, hidden: true,
@ -193,7 +198,7 @@ export const dynamicRoutes = [{
activeMenu: '/zs/clue' activeMenu: '/zs/clue'
} }
}] }]
} }
]; ];
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错

@ -0,0 +1,174 @@
<template>
<el-dialog title="试题" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="800px" @close="closeDialog">
<div>
<el-form ref="dialogForm" :model="dialogForm" :rules="dataRule" label-position="left" @keyup.enter.native="dialogFormSubmit()">
<el-row>
<el-col :span="24">
<el-form-item label="题库" prop="question">
<span>{{ dialogForm.question }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="选项" prop="question">
<span v-if="dialogForm.chooseA">a:{{ dialogForm.chooseA }}<span>
<span v-if="dialogForm.chooseB">b:{{ dialogForm.chooseB }} </span>
<span v-if="dialogForm.chooseC">c:{{ dialogForm.chooseC }} </span>
<span v-if="dialogForm.chooseD">d:{{ dialogForm.chooseD }}</span>
<span v-if="dialogForm.chooseE">e:{{ dialogForm.chooseE }}</span>
<span v-if="dialogForm.chooseF">f:{{ dialogForm.chooseF }}</span>
<span v-if="dialogForm.chooseG">g:{{ dialogForm.chooseG }}</span>
</span></span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="答案" prop="trueAnswer">
<span>{{ dialogForm.trueAnswer }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="科目" prop="subject">
<span v-if="dialogForm.subject == 1">科一</span>
<span v-if="dialogForm.subject == 4">科四</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="精选500题" prop="isVip">
<el-radio-group v-model="dialogForm.isVip" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="精选600题" prop="isVip2">
<el-radio-group v-model="dialogForm.isVip2" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否易错题" prop="isError">
<el-radio-group v-model="dialogForm.isError" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否新规" prop="isNew">
<el-radio-group v-model="dialogForm.isNew" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否密卷1" prop="isExam1">
<el-radio-group v-model="dialogForm.isExam1" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否密卷2" prop="isExam2">
<el-radio-group v-model="dialogForm.isExam2" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="考点" prop="examKeys">
<el-input v-model="dialogForm.examKeys" maxlength="200" placeholder="请输入考点" clearable />
<span style="color:red;">包含多个考点,以英文";"分割</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain @click="(visible=false)">取消</el-button>
<el-button v-jclick type="primary" :disabled="!canSubmit" @click="dialogFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateQuestion } from '@/api/question';
export default {
data () {
return {
visible: false,
canSubmit: true,
dialogForm: {
questionId: undefined,
isVip: 0,
isVip2: 0,
isError: 0,
isNew: 0,
isExam1: 0,
isExam2: 0,
examKeys: undefined
},
dataRule: {
schoolName: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
}
};
},
methods: {
init (info = undefined) {
// debugger
this.visible = true;
this.$nextTick(() => {
this.resetDialogForm();
// this.$refs['dialogForm'].resetFields();
if (info) {
this.dialogForm = this.deepClone(info);
}
});
},
resetDialogForm () {
this.dialogForm = {
questionId: undefined,
isVip: 0,
isVip2: 0,
isError: 0,
isNew: 0,
isExam1: 0,
isExam2: 0,
examKeys: undefined
};
},
closeDialog () {
this.$emit('update:dialogVisible', false);
},
//
dialogFormSubmit () {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
updateQuestion(this.dialogForm).then(response => {
if (response.code == 200) {
this.$modal.msgSuccess('修改成功');
// this.visible = true;
}
});
}
});
}
}
};
</script>

@ -0,0 +1,101 @@
<template>
<div class="app-container" style="text-align:center">
<el-form size="small" :inline="true" label-width="68px">
<el-form-item label="题目">
<el-input v-model="queryParams.question" placeholder="请输入题目" clearable style="width:400px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList" style="width:80%;margin:auto" @row-click="handleEdit">
<el-table-column type="index" width="55" align="center" />
<el-table-column label="题目" align="center" prop="question" min-width="140" />
<el-table-column label="选项" align="center" min-width="140">
<template slot-scope="{row}">
<p v-if="row.chooseA">a:{{ row.chooseA }}</p>
<p v-if="row.chooseB">b:{{ row.chooseB }}</p>
<p v-if="row.chooseC">c:{{ row.chooseC }}</p>
<p v-if="row.chooseD">d:{{ row.chooseD }}</p>
<p v-if="row.chooseE">e:{{ row.chooseE }}</p>
<p v-if="row.chooseF">f:{{ row.chooseF }}</p>
<p v-if="row.chooseG">g:{{ row.chooseG }}</p>
</template>
</el-table-column>
<el-table-column label="答案" align="center" prop="trueAnswer" min-width="100" />
<el-table-column label="科目" align="center" prop="subject" min-width="100">
<template slot-scope="{row}">
<p v-if="row.subject == 1">科一</p>
<p v-if="row.subject == 4">科四</p>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-download" @click="handleEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> -->
<QuestionForm v-if="dialogVisible" ref="dialogForm" :dialog-visible="dialogVisible" @refreshDataList="getList" />
</div>
</template>
<script>
import { searchQuestion } from '@/api/question';
import QuestionForm from './components/QuestionForm.vue';
export default {
name: 'Question',
components: {
QuestionForm
},
data () {
return {
//
loading: false,
//
total: 0,
tableList: [],
//
queryParams: {
question: ''
},
dialogVisible: false
};
},
created () {
// this.getList();
},
methods: {
/** 查询文件列表 */
getList () {
this.loading = true;
searchQuestion(this.queryParams).then(response => {
this.tableList = response.data;
// this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery () {
this.getList();
},
/** 重置按钮操作 */
resetQuery () {
this.queryParams.question = '';
this.handleQuery();
},
handleEdit (item) {
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.dialogForm.init(item);
});
}
}
};
</script>

@ -33,15 +33,24 @@ module.exports = {
port: port, port: port,
open: true, open: true,
proxy: { proxy: {
[process.env.VUE_APP_BASE_API + '/driver-api']: {
// target: `https://xueche.ahduima.com/duima/`,
target: `http://localhost:8888/driver-api/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API + '/driver-api']: ''
}
},
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `https://xueche.ahduima.com/duima/`, target: `https://xueche.ahduima.com/duima/`,
target: `http://localhost:8086`, // target: `http://localhost:8086`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
} }
} }
}, },
disableHostCheck: true disableHostCheck: true
}, },

Loading…
Cancel
Save