提交 75194a47 authored 作者: wangjialong209's avatar wangjialong209

功能完善

上级 9515b188
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"driver.js": "0.9.5", "driver.js": "0.9.5",
"dropzone": "5.5.1", "dropzone": "5.5.1",
"echarts": "4.2.1", "echarts": "^4.2.1",
"element-ui": "2.13.2", "element-ui": "2.13.2",
"file-saver": "2.0.1", "file-saver": "2.0.1",
"fuse.js": "3.4.4", "fuse.js": "3.4.4",
......
...@@ -130,6 +130,16 @@ export function updata_examination_questions(id, data) { ...@@ -130,6 +130,16 @@ export function updata_examination_questions(id, data) {
data data
}) })
} }
//试题信息管理-试题发布(状态修改)
export function updata_examination_questions_status(id, params) {
return request({
url: `/api/examination_questions/publish/${id}`,
method: 'get',
params
})
}
//试题信息管理-详情 //试题信息管理-详情
export function get_examination_questions_detail(id, params) { export function get_examination_questions_detail(id, params) {
return request({ return request({
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
</el-card> </el-card>
</div> </div>
<el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%" :before-close="handleClose"> <el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%" :before-close="handleClose"
:close-on-click-modal="false">
<div> <div>
</div> </div>
......
<!-- --> <!-- -->
<template> <template>
<div> <div>
<!-- <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<menu-item v-for="(item, index) in permission_routes" :key="index" :item_data="item"
:base_path="item.path"></menu-item>
</el-menu> -->
<el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleSelect"> <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="/dashboard">首页</el-menu-item> <menu-item v-for="(item, index) in trends_routers" :key="index" :item_data="item" :base_path="item.path" class="menu_unit"></menu-item>
</el-menu>
<!-- <el-menu :default-active="activeMenu" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="/dashboard">处理中心</el-menu-item>
<el-submenu index="/student"> <el-submenu index="/student">
<template slot="title">学员考试</template> <template slot="title">学员考试</template>
<el-menu-item index="/student/examination_questions/list">试题管理配置</el-menu-item> <el-menu-item index="/student/examination_questions_list">试题管理配置</el-menu-item>
<el-menu-item index="/student/test_results/list">考试结果</el-menu-item> <el-menu-item index="/student/test_results_list">考试结果</el-menu-item>
<el-menu-item index="/student/personnel">学员管理</el-menu-item> <el-menu-item index="/student/personnel">学员管理</el-menu-item>
<el-menu-item index="/student/area_breed">烟草区域与品种</el-menu-item> <el-menu-item index="/student/area_breed">烟草区域与品种</el-menu-item>
<el-menu-item index="/student/tobacco_grades">烟草等级</el-menu-item> <el-menu-item index="/student/tobacco_grades">烟草等级</el-menu-item>
</el-submenu> </el-submenu>
<!-- <el-submenu index="/business">
<template slot="title">工商交接</template>
<el-menu-item index="/business/display_board">展板统计</el-menu-item>
<el-menu-item index="/business/raw_data">原始数据</el-menu-item>
<el-menu-item index="/business/road">渠道管理</el-menu-item>
</el-submenu> -->
<el-submenu index="/system"> <el-submenu index="/system">
<template slot="title">系统管理</template> <template slot="title">系统管理</template>
<el-menu-item index="/system/administrators">管理员</el-menu-item> <el-menu-item index="/system/administrators">管理员</el-menu-item>
...@@ -29,7 +22,7 @@ ...@@ -29,7 +22,7 @@
<el-menu-item index="/system/department">部门区域</el-menu-item> <el-menu-item index="/system/department">部门区域</el-menu-item>
<el-menu-item index="/system/log">系统日志</el-menu-item> <el-menu-item index="/system/log">系统日志</el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </el-menu> -->
</div> </div>
</template> </template>
...@@ -37,6 +30,9 @@ ...@@ -37,6 +30,9 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import MenuItem from './MenuItem.vue'; import MenuItem from './MenuItem.vue';
import path from 'path'
import { isExternal } from '@/utils/validate'
export default { export default {
data() { data() {
return { return {
...@@ -49,7 +45,8 @@ export default { ...@@ -49,7 +45,8 @@ export default {
computed: { computed: {
...mapGetters([ ...mapGetters([
'permission_routes', 'permission_routes',
'sidebar' 'sidebar',
'trends_routers'
]), ]),
activeMenu() { activeMenu() {
const route = this.$route; const route = this.$route;
...@@ -62,7 +59,8 @@ export default { ...@@ -62,7 +59,8 @@ export default {
}, },
mounted() { mounted() {
console.log('动态路由数据');
console.log(this.trends_routers);
}, },
methods: { methods: {
...@@ -72,9 +70,23 @@ export default { ...@@ -72,9 +70,23 @@ export default {
this.$router.push({ this.$router.push({
path: key, path: key,
}) })
},
resolvePath(routePath) {
if (isExternal(routePath)) {
return routePath
}
if (isExternal(routePath)) {
return routePath
}
return path.resolve(routePath, routePath)
} }
} }
} }
</script> </script>
<style scoped></style> <style scoped>
.menu_unit {
display: inline-block;
}
</style>
...@@ -6,13 +6,12 @@ ...@@ -6,13 +6,12 @@
--> -->
<!-- --> <!-- -->
<template> <template>
<div v-if="!item_data.hidden" :class="item_data.children ? 'single_menu' : ''"> <div v-if="item_data.is_show">
<template <el-menu-item
v-if="hasOneShowingChild(item_data.children, item_data) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item_data.alwaysShow"> v-if="hasOneShowingChild(item_data.children, item_data) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item_data.alwaysShow"
<el-menu-item :index="resolvePath(onlyOneChild.path)"> :index="resolvePath(onlyOneChild.path)">
{{ onlyOneChild.meta.title }} {{ onlyOneChild.meta.title }}
</el-menu-item> </el-menu-item>
</template>
<el-submenu v-else :index="resolvePath(item_data.path)"> <el-submenu v-else :index="resolvePath(item_data.path)">
<template slot="title">{{ item_data.meta.title }}</template> <template slot="title">{{ item_data.meta.title }}</template>
<menu-item v-for="(item, index) in item_data.children" :key="index" :item_data="item" <menu-item v-for="(item, index) in item_data.children" :key="index" :item_data="item"
...@@ -75,8 +74,7 @@ export default { ...@@ -75,8 +74,7 @@ export default {
return false return false
}, },
resolvePath(routePath) {; resolvePath(routePath) {
if (isExternal(routePath)) { if (isExternal(routePath)) {
return routePath return routePath
} }
......
差异被折叠。
...@@ -18,5 +18,6 @@ const getters = { ...@@ -18,5 +18,6 @@ const getters = {
permission_routes: state => state.permission.routes, permission_routes: state => state.permission.routes,
errorLogs: state => state.errorLog.logs, errorLogs: state => state.errorLog.logs,
hasUser: state => state.user.hasUser, hasUser: state => state.user.hasUser,
trends_routers: state => state.permission.trends_routers,
} }
export default getters export default getters
...@@ -38,45 +38,29 @@ export function filterAsyncRoutes(routes, roles) { ...@@ -38,45 +38,29 @@ export function filterAsyncRoutes(routes, roles) {
const state = { const state = {
routes: [], routes: [],
addRoutes: [] addRoutes: [],
trends_routers: [],//
} }
const mutations = { const mutations = {
SET_ROUTES: (state, routes) => { SET_ROUTES: (state, routes) => {
state.addRoutes = routes state.addRoutes = routes
state.routes = constantRoutes.concat(routes) state.routes = constantRoutes.concat(routes)
},
SET_TRENDS_ROUTES: (state, routes) => {
state.trends_routers = routes;
} }
} }
/*
1. // component: (resolve) => require([`${element.component}`], resolve) // // 变量component: '@/pages/drawSvg/index.vue', // 会报错
2.// component: (resolve) => require([`@/pages/${element.component}/index.vue`], resolve)//变量 component: 'drawSvg',//ok
*/
//处理路由地址 不能用 import。使用require,异步 //处理路由地址 不能用 import。使用require,异步
function routerCom(view_path) {//不支持全路径,支持拼接路径 function routerCom(view_path) {//不支持全路径,支持拼接路径
return (resolve) => require([`@/${view_path}`], resolve); return (resolve) => require([`@/${view_path}`], resolve);
} }
//过滤数据 /转为树结构 //过滤数据 /转为树结构
function filterRouterData(list) { function transListToTreeData(list, rootValue) {
console.log('路由处理的原始数据@@@'); let arr = []
console.log(list);
let result = []
let map = {}
if (!Array.isArray(list)) return [];
list.forEach(item => { list.forEach(item => {
map[item.id] = { let elememt = {
id: item.id,
father_id: item.father_id,
is_show: item.is_show,
path: item.path,
name: item.name,
component: routerCom(item.view_path),
meta: { title: item.name_zh }
}
});
list.forEach(item => {
let parent = map[item.father_id], elememt = {
id: item.id, id: item.id,
father_id: item.father_id, father_id: item.father_id,
is_show: item.is_show, is_show: item.is_show,
...@@ -85,34 +69,41 @@ function filterRouterData(list) { ...@@ -85,34 +69,41 @@ function filterRouterData(list) {
component: routerCom(item.view_path), component: routerCom(item.view_path),
meta: { title: item.name_zh } meta: { title: item.name_zh }
}; };
if (parent) { if (item.father_id === rootValue) {
// console.log('进入判断'); const children = transListToTreeData(list, item.id)
// console.log((parent.children || (parent.children = []))); if (children.length > 0) {
(parent.children || (parent.children = [])).push(elememt) elememt.children = children
} else { }
result.push(elememt) arr.push(elememt)
} }
}) })
return result return arr
} }
const actions = { const actions = {
generateRoutes({ commit }) { generateRoutes({ commit }) {
return new Promise(async resolve => { return new Promise(async resolve => {
let response = await get_permission_btn_menu() let response = await get_permission_btn_menu();
console.log('从接口获取的路由数据');
console.log(response);
/* route_tree_all(permission); //转为树结构 */ /* route_tree_all(permission); //转为树结构 */
// let route_list = filterRouterData(response.permission); let route_list = transListToTreeData(response.permission, -1);
// console.log('<<<<<<<<<<<<<组装好的路由列表>>>>>>>>>>>>>'); console.log('<<<<<<<<<<<<<组装好的路由列表>>>>>>>>>>>>>');
// console.log(route_list); console.log(route_list);
// console.log('权限菜单数据>>>>>>>>>>'); console.log('权限菜单数据>>>>>>>>>>');
// console.log(response); console.log(response);
// console.log('本地路由数据@@@@@@@@@@'); console.log('本地路由数据@@@@@@@@@@');
// console.log(asyncRoutes); console.log(asyncRoutes);
// asyncRoutes[0].children = route_list; /**
* //layout为统一的视图入口,在asyncRoutes[0]下,
* 具体可查看router/index.js
*/
asyncRoutes[0].children = route_list;
let accessedRoutes = asyncRoutes || []; let accessedRoutes = asyncRoutes || [];
console.log('处理好的路由数据'); console.log('处理好的路由数据');
console.log(accessedRoutes); console.log(accessedRoutes);
commit('SET_ROUTES', accessedRoutes) commit('SET_ROUTES', accessedRoutes)//存储路由数据
commit('SET_TRENDS_ROUTES', route_list);
resolve(accessedRoutes) resolve(accessedRoutes)
}) })
} }
......
...@@ -121,6 +121,17 @@ ...@@ -121,6 +121,17 @@
box-sizing: content-box; box-sizing: content-box;
} }
:export {
menuText: #bfcbd9;
menuActiveText: #409EFF;
subMenuActiveText: #f4f4f5;
menuBg: #304156;
menuHover: #263445;
subMenuBg: #1f2d3d;
subMenuHover: #001528;
sideBarWidth: 210px;
}
#app .main-container { #app .main-container {
min-height: 100%; min-height: 100%;
transition: margin-left .28s; transition: margin-left .28s;
...@@ -687,19 +698,19 @@ aside a:hover { ...@@ -687,19 +698,19 @@ aside a:hover {
.module_container { .module_container {
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100% - 50px); height: calc(100% - 55px);
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto;
} }
.module_container .module_container_left { .module_container .module_container_left {
position: absolute; position: absolute;
left: 0; left: 0;
top: -50px; top: 0;
bottom: 0; bottom: -5px;
width: 300px; width: 300px;
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
padding: 15px;
} }
.crumbs_box { .crumbs_box {
...@@ -746,3 +757,21 @@ aside a:hover { ...@@ -746,3 +757,21 @@ aside a:hover {
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow-y: auto;
} }
/* 菜单组件 */
.el-menu--horizontal .menu_unit > .el-submenu.is-active .el-submenu__title {
border-bottom: 2px solid #038D6E;
color: #303133;
}
.el-menu--horizontal .menu_unit > .el-menu-item.is-active {
border-bottom: 2px solid #038D6E;
color: #303133;
}
.el-menu--horizontal .menu_unit > .el-submenu .el-submenu__icon-arrow {
position: static;
vertical-align: middle;
margin-left: 8px;
margin-top: -3px;
}
差异被折叠。
...@@ -234,18 +234,19 @@ aside { ...@@ -234,18 +234,19 @@ aside {
.module_container { .module_container {
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100% - 50px); //减去面包屑的高度 height: calc(100% - 55px); //减去面包屑的高度
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto;
.module_container_left { .module_container_left {
position: absolute; position: absolute;
left: 0; left: 0;
top: -50px; top: 0;
bottom: 0; bottom: -5px;
width: 300px; width: 300px;
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
padding: 15px; // padding: 15px;
} }
} }
...@@ -299,3 +300,22 @@ aside { ...@@ -299,3 +300,22 @@ aside {
overflow-y: auto; overflow-y: auto;
} }
} }
/* 菜单组件 */
.el-menu--horizontal .menu_unit>.el-submenu.is-active .el-submenu__title {
border-bottom: 2px solid #038D6E;
color: #303133;
}
.el-menu--horizontal .menu_unit>.el-menu-item.is-active {
border-bottom: 2px solid #038D6E;
color: #303133;
}
.el-menu--horizontal .menu_unit>.el-submenu .el-submenu__icon-arrow {
position: static;
vertical-align: middle;
margin-left: 8px;
margin-top: -3px;
}
\ No newline at end of file
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="module_container_left"> <el-card class="module_container_left">
<el-tree :data="left_terr_data" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" <el-tree :data="left_terr_data" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode"
ref="tree" :default-expand-all="false" @node-click="handleNodeClick" style="margin-top: 45px;" /> ref="tree" :default-expand-all="false" @node-click="handleNodeClick" />
</div> </el-card>
<div class="right_container"> <div class="right_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
...@@ -18,11 +18,18 @@ ...@@ -18,11 +18,18 @@
@btnClick="btnClick"></table-head> @btnClick="btnClick"></table-head>
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="650"> <el-table v-loading="is_loading" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="650">
<el-table-column prop="id" label="编号"> <el-table-column prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="name" label="烟草产地">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.tobacco_breed_place" :key="index">
{{ item.place_of_production }};
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="品种名称"> <el-table-column prop="name" label="品种名称" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="appearance_characteristics" label="外观特征"> <el-table-column prop="appearance_characteristics" label="外观特征" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(e, key, i) in scope.row.appearance_characteristics" :key="i"> <div v-for="(e, key, i) in scope.row.appearance_characteristics" :key="i">
<span>{{ key }}</span> <span>{{ key }}</span>
...@@ -30,7 +37,7 @@ ...@@ -30,7 +37,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="image" label="图片信息"> <el-table-column prop="image" label="图片信息" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<div class="amplify_img_box"> <div class="amplify_img_box">
......
...@@ -54,10 +54,15 @@ ...@@ -54,10 +54,15 @@
<el-dialog :title="is_updata_type == 'add' ? '新增' : '修改'" :visible.sync="is_dialogVisible" width="60%" <el-dialog :title="is_updata_type == 'add' ? '新增' : '修改'" :visible.sync="is_dialogVisible" width="60%"
:before-close="handleClose"> :before-close="handleClose">
<div> <div>
<table-moudel v-if="is_dialogVisible" ref="detail_info" :table_data="detailed_information" <table-moudel v-if="is_dialogVisible && Object.keys(province_data).length == 3" ref="detail_info"
:position_datas="position_data" :province_datas="province_data" :tobacco_all_lists="tobacco_all_lists" :table_data="detailed_information" :position_datas="position_data" :province_datas="province_data"
:tobacco_grades_all_lists="tobacco_grades_all_lists" :is_updata_type="is_updata_type" :tobacco_all_lists="tobacco_all_lists" :tobacco_grades_all_lists="tobacco_grades_all_lists"
:is_updata_type="is_updata_type"
:examination_questions_all_lists="examination_questions_all_list"></table-moudel> :examination_questions_all_lists="examination_questions_all_list"></table-moudel>
<div v-else style="text-align: center;">
<p><i class="el-icon-loading"></i></p>
<p>加载中...</p>
</div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button> <el-button @click="handleClose">取 消</el-button>
......
...@@ -51,12 +51,29 @@ ...@@ -51,12 +51,29 @@
<!-- <el-button size="mini" type="text" style="color: #000;" @click="commentJump(scope.row)">配置</el-button> --> <!-- <el-button size="mini" type="text" style="color: #000;" @click="commentJump(scope.row)">配置</el-button> -->
<el-button size="mini" type="text" style="color: #000;" title="试题复制" <el-button size="mini" type="text" style="color: #000;" title="试题复制"
@click="examinationQuestionsCopy(scope.row)">复制</el-button> @click="examinationQuestionsCopy(scope.row)">复制</el-button>
<el-button v-if="scope.row.status != '6'" size="mini" type="text" style="color: #000;" <el-button v-if="scope.row.status != '6'" size="mini" type="text" style="color: #000;margin-right: 15px;"
@click="createAnswerCard(scope.row)" title="生成答题卡">下载</el-button> @click="createAnswerCard(scope.row)" title="生成答题卡">下载</el-button>
<el-button v-if="scope.row.status == '1'" size="mini" type="text" style="color: #000;" <!-- <el-button v-if="scope.row.status == '1'" size="mini" type="text" style="color: #000;"
@click="examinationQuestionsPublish(scope.row)" title="试题发布">发布</el-button> @click="examinationQuestionsPublish(scope.row)" title="试题发布">发布</el-button>
<el-button v-if="scope.row.status != '6'" size="mini" type="text" style="color: #F56C6C;" <el-button v-if="scope.row.status != '6'" size="mini" type="text" style="color: #F56C6C;"
@click="deleteInformation(scope.row)">停用</el-button> @click="deleteInformation(scope.row)">停用</el-button> -->
<el-popover placement="right" width="160">
<div>
<el-radio-group v-model="status_params.status">
<el-radio label="1" style="margin: 5px 0;">试题配置中</el-radio>
<el-radio label="2" style="margin: 5px 0;">试题配置完成</el-radio>
<el-radio label="3" style="margin: 5px 0;">开始考试</el-radio>
<el-radio label="4" style="margin: 5px 0;">考试完成</el-radio>
<el-radio label="5" style="margin: 5px 0;">已点评</el-radio>
<el-radio label="6" style="margin: 5px 0;">停止使用</el-radio>
</el-radio-group>
</div>
<div style="text-align: right; margin: 0">
<el-button type="primary" size="mini" @click="updataExaminationQuestionsStatus">确定</el-button>
</div>
<el-button slot="reference" type="text" size="mini" @click="setStatusParams(scope.row)">设置状态</el-button>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -178,7 +195,7 @@ ...@@ -178,7 +195,7 @@
<script> <script>
import TableHead from '@/components/TableHead/index'; import TableHead from '@/components/TableHead/index';
import { get_examination_questions_list, add_examination_questions, updata_examination_questions, create_answer_card, examination_questions_copy, examination_questions_publish, delete_examination_questions, get_examination_questions_all, get_student_all, examination_reservation, examination_batch_reservation } from '@/api/student'; import { get_examination_questions_list, add_examination_questions, updata_examination_questions, create_answer_card, examination_questions_copy, examination_questions_publish, delete_examination_questions, get_examination_questions_all, get_student_all, examination_reservation, examination_batch_reservation, updata_examination_questions_status } from '@/api/student';
import { exportText } from '@/utils/tool'; import { exportText } from '@/utils/tool';
const standard_template = { const standard_template = {
title: "河南把烟测试2", title: "河南把烟测试2",
...@@ -213,10 +230,7 @@ export default { ...@@ -213,10 +230,7 @@ export default {
text: '预约', text: '预约',
event: 'reservation', event: 'reservation',
}, },
// {
// text: '批量预约',
// event: 'batch_reservation',
// }
], ],
}, },
//初始化请求参数 //初始化请求参数
...@@ -248,6 +262,13 @@ export default { ...@@ -248,6 +262,13 @@ export default {
}, },
//批量预约文件 //批量预约文件
batch_reservation_file: {}, batch_reservation_file: {},
is_popover_show: false,
status_params: {
id: null,
status: null,
},
}; };
}, },
...@@ -370,7 +391,7 @@ export default { ...@@ -370,7 +391,7 @@ export default {
commentJump(item) { commentJump(item) {
let id = item.id; let id = item.id;
this.$router.push({ this.$router.push({
path: "/student/examination_questions/detail", path: "/student/examination_questions_detail",
query: { id: id }, query: { id: id },
}); });
}, },
...@@ -413,6 +434,30 @@ export default { ...@@ -413,6 +434,30 @@ export default {
} }
}) })
}, },
//点击修改状态
setStatusParams(item) {
console.log('点击');
console.log(item);
let data = JSON.parse(JSON.stringify(item));
const { id, status } = data;
this.status_params = { id, status };
},
//修改状态
updataExaminationQuestionsStatus() {
let id = this.status_params.id;
let params = {
status: this.status_params.status
}
updata_examination_questions_status(id, params).then(res => {
console.log('修改状态');
if (res.code == 200) {
this.$message.success(res.message);
document.body.click();
this.getListData();
}
})
},
//预约点击 //预约点击
......
<!-- -->
<template>
<div class="analyse_container">
<div class="header_box">易错题分析</div>
<div class="content_container">
<table class="table_box">
<tr>
<th>序号</th>
<th>题目(编号)</th>
<th>结果</th>
<th>错误率</th>
<th>错误结果</th>
</tr>
<tr v-for="(item, index) in 5" :key="index">
<td>1</td>
<td>34</td>
<td>C4F</td>
<td>14%</td>
<td>c4d(10人)</td>
</tr>
</table>
</div>
<div class="content_container" id="charts_container">
</div>
</div>
</template>
<script>
import echarts from 'echarts';
export default {
data() {
return {
};
},
components: {},
computed: {},
mounted() {
this.initChart();
},
methods: {
initChart() {
let dom = document.getElementById('charts_container');
let myChart = echarts.init(dom, null, {
renderer: 'canvas',
useDirtyRect: false
});
let app = {};
let option;
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true,
areaStyle: {}
},
{
data: [1290, 1330, 1320, 820, 932, 901, 934,],
type: 'line',
smooth: true,
areaStyle: {}
},
]
};
if (option && typeof option === 'object') {
myChart.setOption(option);
}
window.addEventListener('resize', myChart.resize);
},
}
}
</script>
<style lang="scss" scoped>
.analyse_container {
border-radius: 6px;
border: 1px solid #F56C6C;
overflow: hidden;
.header_box {
height: 40px;
line-height: 40px;
background-color: #F56C6C;
padding: 0 10px;
color: #fff;
}
.content_container {
width: 100%;
height: 285px;
margin: 0;
padding: 0;
overflow-y: auto;
.table_box {
width: 100%;
min-height: 100%;
text-align: center;
}
}
}
.table_box {
font-size: 14px;
border-top: 1px solid #E4E7ED;
border-left: 1px solid #E4E7ED;
border-collapse: collapse;
th,
td {
margin: 0;
padding: 0;
font-size: 14px;
border-bottom: 1px solid #E4E7ED;
border-right: 1px solid #E4E7ED;
}
th {
color: #909399;
}
td {
color: #303133;
}
}
</style>
\ No newline at end of file
<!--
* @Author: czj
* @Date: 2023-03-14 17:41:55
* @Description:
* @FilePath: \AdministrationHome\src\views\student\test_results\components\AnswerCard.vue
-->
<!-- -->
<template>
<div class="table_container">
<div class="header_box">
<div class="row_box" v-for="(item, index) in 5" :key="index">
<div class="left">序号</div>
<div class="right">结果</div>
</div>
</div>
<div class="lin_box" v-for="(items, index) in questions_list" :key="index">
<div class="row_box" v-for="(e, i) in items" :key="i">
<div class="left">{{ e.index_number + 1 }}</div>
<div class="right" :class="e.grades_code && test_results_list[e.id] != e.grades_code ? 'wrong_answer' : ''">
<el-popover placement="right" trigger="click">
<div class="table_box">
<table border="1" cellspacing="0">
<tr>
<td class="title_box">
<div class="left_box">
我的结果
</div>
</td>
<td>
<div class="right_box"
:class="e.grades_code && test_results_list[e.id] != e.grades_code ? 'wrong_answer' : ''">
{{ test_results_list[e.id] || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草区域
</div>
</td>
<td>
<div class="right_box">{{ e.place_of_production || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
试题结论
</div>
</td>
<td>
<div class="right_box">{{ e.grades_code || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草品种
</div>
</td>
<td>
<div class="right_box">{{ e.breed_name || "暂无" }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
试题详解
</div>
</td>
<td>
<div class="right_box">{{ e.explain_in_detail || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草实物
</div>
</td>
<td>
<div class="right_box">
<div v-if="e.image && e.image != '/'" class="image_box">
<img :src="IP + e.image" alt="">
</div>
<div v-else>暂无</div>
</div>
</td>
</tr>
</table>
</div>
<!-- <span slot="reference"> {{ e.grades_code || '暂无' }}</span> -->
<span slot="reference"> {{ test_results_list[e.id] || '暂无' }}</span>
</el-popover>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['questions_lists', 'test_results_lists'],
data() {
return {
IP: process.env.VUE_APP_BASE_API,
questions_list: [],
test_results_list: [],
};
},
components: {},
computed: {},
created() {
this.questions_list = [...this.questions_lists];
this.test_results_list = [...this.test_results_lists];
},
mounted() { },
methods: {}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.table_container {
width: 80%;
margin: 0 auto;
border: 1px solid #EBEEF5;
border-radius: 8px;
overflow: hidden;
.header_box {
background-color: $themeColor;
.row_box {
.left,
.right {
color: #fff !important;
}
}
}
.lin_box {
border-bottom: 1px solid #EBEEF5;
}
.row_box {
width: 20%;
float: left;
display: flex;
font-size: 14px;
color: #303133;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
border-right: 1px solid #EBEEF5;
.left {
width: 60px;
text-align: center;
padding: 15px 0;
}
.right {
width: calc(100% - 60px);
text-align: center;
padding: 15px 0;
border-right: 1px solid #EBEEF5;
}
}
}
.header_box::after,
.lin_box::after {
display: block;
content: "";
clear: both;
}
.lin_box .row_box .left {
border-right: 1px solid #EBEEF5;
}
.table_container .lin_box:last-child,
.lin_box .row_box:last-child,
.header_box .row_box:last-child {
border: none;
}
.table_box {
width: 100%;
table {
width: 100%;
border-top: 1px solid #E4E7ED;
border-left: 1px solid #E4E7ED;
border-collapse: collapse;
td {
margin: 0;
padding: 0;
border-bottom: 1px solid #E4E7ED;
border-right: 1px solid #E4E7ED;
}
.title_box {
width: 100px;
}
}
}
.left_box {
padding: 10px 10px;
color: #606266;
text-align: center;
}
.right_box {
width: 400px;
padding: 10px 10px;
color: #303133;
}
.image_box {
width: 100%;
height: 400px;
img {
max-width: 100%;
max-height: 100%;
}
}
.wrong_answer {
background-color: #fdf0f0;
}
</style>
\ No newline at end of file
...@@ -2,102 +2,44 @@ ...@@ -2,102 +2,44 @@
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card" style="margin-bottom: 10px;"> <el-card class="box-card">
<examination-header v-if="student_brief_introduction" :examination_questions="student_brief_introduction" <examination-header v-if="student_brief_introduction" :examination_questions="student_brief_introduction"
:key="new Date().getTime()"></examination-header> :key="new Date().getTime()"></examination-header>
</el-card> </el-card>
<el-card class="box-card" v-if="questions_list.length > 0"> <el-card class="box-card" v-if="questions_list.length > 0">
<div class="table_container"> <answer-card :questions_lists="questions_list" :test_results_lists="test_results_list"></answer-card>
<div class="header_box"> </el-card>
<div class="row_box" v-for="(item, index) in 5" :key="index"> <el-card class="box-card">
<div class="left">序号</div> <div>
<div class="right">结果</div> <div class="line_header">易错、对等级分析</div>
</div> <el-row>
</div> <el-col :span="12">
<div class="lin_box" v-for="(items, index) in questions_list" :key="index"> <div style="width: calc(100% - 20px);">
<div class="row_box" v-for="(e, i) in items" :key="i"> <analyse-module></analyse-module>
<div class="left">{{ e.index_number + 1 }}</div> </div>
<div class="right" </el-col>
:class="e.grades_code && detailed_information.test_results[e.id] != e.grades_code ? 'wrong_answer' : ''"> <el-col :span="12">
<el-popover placement="right" trigger="click"> <analyse-module></analyse-module>
<div class="table_box"> </el-col>
<table border="1" cellspacing="0"> </el-row>
<tr> </div>
<td class="title_box"> <div>
<div class="left_box"> <div class="line_header">易错、对等级分析</div>
我的结果 <el-row>
</div> <el-col :span="8">
</td> <div style="width: calc(100% - 20px);">
<td> <analyse-module></analyse-module>
<div class="right_box"
:class="e.grades_code && detailed_information.test_results[e.id] != e.grades_code ? 'wrong_answer' : ''">
{{ detailed_information.test_results[e.id] || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草区域
</div>
</td>
<td>
<div class="right_box">{{ e.place_of_production || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
试题结论
</div>
</td>
<td>
<div class="right_box">{{ e.grades_code || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草品种
</div>
</td>
<td>
<div class="right_box">{{ e.breed_name || "暂无" }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
试题详解
</div>
</td>
<td>
<div class="right_box">{{ e.explain_in_detail || '暂无' }}</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">
烟草实物
</div>
</td>
<td>
<div class="right_box">
<div v-if="e.image && e.image != '/'" class="image_box">
<img :src="IP + e.image" alt="">
</div>
<div v-else>暂无</div>
</div>
</td>
</tr>
</table>
</div>
<!-- <span slot="reference"> {{ e.grades_code || '暂无' }}</span> -->
<span slot="reference"> {{ detailed_information.test_results[e.id] || '暂无' }}</span>
</el-popover>
</div> </div>
</div> </el-col>
</div> <el-col :span="16">
<analyse-module></analyse-module>
</el-col>
</el-row>
</div>
<div>
<div class="line_header">老师点评</div>
<el-input type="textarea" :rows="6" placeholder="请输入内容" v-model="test_text" style="widows: 100%;">
</el-input>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -117,6 +59,8 @@ ...@@ -117,6 +59,8 @@
<script> <script>
import ExaminationHeader from '@/components/ExaminationHeader/index'; import ExaminationHeader from '@/components/ExaminationHeader/index';
import AnswerCard from '../components/AnswerCard.vue';
import AnalyseModule from '../components/AnalyseModule.vue';
import { get_test_results_detail } from '@/api/student'; import { get_test_results_detail } from '@/api/student';
import { array_conversion } from '@/utils/tool'; import { array_conversion } from '@/utils/tool';
const standard_template = { const standard_template = {
...@@ -157,11 +101,14 @@ export default { ...@@ -157,11 +101,14 @@ export default {
//试题结果 //试题结果
questions_list: [], questions_list: [],//试题列表
test_results_list: [],//答题列表
test_text: '针对你在本次烟草知识考试中的表现,我认为你已经做得非常出色。你的答案准确地回答了考试中的问题,而且展现出了对烟草知识的全面了解。'
}; };
}, },
components: { ExaminationHeader }, components: { ExaminationHeader, AnswerCard, AnalyseModule },
computed: {}, computed: {},
created() { created() {
...@@ -196,19 +143,13 @@ export default { ...@@ -196,19 +143,13 @@ export default {
], ],
}; };
this.questions_list = []; this.questions_list = [];
// if (res.examination_questions) this.questions_list = || [];
res.examination_questions.examination_question_detail.forEach((element, index) => { res.examination_questions.examination_question_detail.forEach((element, index) => {
let obj = JSON.parse(JSON.stringify(element)) let obj = JSON.parse(JSON.stringify(element))
element['index_number'] = index;//用来记录在原始数据中的索引 element['index_number'] = index;//用来记录在原始数据中的索引
}); });
console.log('表格数据源');
console.log(res.examination_questions.examination_question_detail);
let new_arr = array_conversion(res.examination_questions.examination_question_detail, 5); let new_arr = array_conversion(res.examination_questions.examination_question_detail, 5);
console.log('二维数据@@@'); this.test_results_list = res.test_results;
console.log(new_arr);
this.questions_list = new_arr; this.questions_list = new_arr;
this.detailed_information = res;
}) })
}, },
...@@ -219,123 +160,15 @@ export default { ...@@ -219,123 +160,15 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
.table_container { .box-card {
width: 80%; margin-bottom: 15px;
margin: 0 auto;
border: 1px solid #EBEEF5;
border-radius: 8px;
overflow: hidden;
.header_box {
background-color: $themeColor;
.row_box {
.left,
.right {
color: #fff !important;
}
}
}
.lin_box {
border-bottom: 1px solid #EBEEF5;
}
.row_box {
width: 20%;
float: left;
display: flex;
font-size: 14px;
color: #303133;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
border-right: 1px solid #EBEEF5;
.left {
width: 60px;
text-align: center;
padding: 15px 0;
}
.right {
width: calc(100% - 60px);
text-align: center;
padding: 15px 0;
border-right: 1px solid #EBEEF5;
}
}
} }
.header_box::after, .card_container {
.lin_box::after { margin-bottom: 50px;
display: block;
content: "";
clear: both;
}
.lin_box .row_box .left {
border-right: 1px solid #EBEEF5;
}
.table_container .lin_box:last-child,
.lin_box .row_box:last-child,
.header_box .row_box:last-child {
border: none;
}
.table_box {
width: 100%;
table {
width: 100%;
border-top: 1px solid #E4E7ED;
border-left: 1px solid #E4E7ED;
border-collapse: collapse;
td {
margin: 0;
padding: 0;
border-bottom: 1px solid #E4E7ED;
border-right: 1px solid #E4E7ED;
}
.title_box {
width: 100px;
}
}
}
.left_box {
padding: 10px 10px;
color: #606266;
text-align: center;
}
.right_box {
width: 400px;
padding: 10px 10px;
color: #303133;
}
.image_box {
width: 100%;
height: 400px;
img {
max-width: 100%;
max-height: 100%;
}
} }
.wrong_answer { .line_header {
background-color: #fdf0f0; padding: 15px 0;
} }
</style> </style>
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
console.log('跳转详情'); console.log('跳转详情');
let id = item.id; let id = item.id;
this.$router.push({ this.$router.push({
path: '/student/test_results/detail', path: '/student/test_results_detail',
query: { query: {
id: id id: id
}, },
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="部位+颜色(二等级)"> <el-form-item label="组别">
<el-input v-model="tobacco_grades_info.grade2"></el-input> <el-input v-model="tobacco_grades_info.grade2"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<el-table-column prop="price3" label="三价区" width="100"> <el-table-column prop="price3" label="三价区" width="100">
<template slot-scope="scope"><span>¥{{ scope.row.price3 }}</span></template> <template slot-scope="scope"><span>¥{{ scope.row.price3 }}</span></template>
</el-table-column> </el-table-column>
<el-table-column prop="grade2" label="组别">
</el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="remark" label="备注">
</el-table-column> </el-table-column>
<el-table-column prop="adjacent_grade" label="同组别紧邻等级"> <el-table-column prop="adjacent_grade" label="同组别紧邻等级">
...@@ -70,7 +72,7 @@ ...@@ -70,7 +72,7 @@
</el-card> </el-card>
</div> </div>
<el-dialog :title="is_updata_type == 'add' ? '新增烟草品级' : '修改烟草品级'" :visible.sync="is_dialogVisible" width="60%" <el-dialog :title="is_updata_type == 'add' ? '新增烟草等级' : '修改烟草等级'" :visible.sync="is_dialogVisible" width="60%"
top="50px" :before-close="handleClose"> top="50px" :before-close="handleClose">
<div> <div>
<Dialog v-if="is_dialogVisible" :tobacco_grades_infos="tobacco_grades_info" @handleClose="handleClose" <Dialog v-if="is_dialogVisible" :tobacco_grades_infos="tobacco_grades_info" @handleClose="handleClose"
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论