理论考试系统列表、题库管理

dev_review
yujialong 5 months ago
parent 300e917d1e
commit 2669f15962
  1. 7
      src/assets/css/main.css
  2. 574
      src/router/index.js
  3. 158
      src/views/theoreticalCourse/list/buildPlatform/index.vue
  4. 10
      src/views/theoreticalCourse/list/index.vue
  5. 57
      src/views/theoryExam/list/index.vue
  6. 139
      src/views/theoryExam/list/program.vue
  7. 321
      src/views/theoryExam/list/system.vue
  8. 357
      src/views/theoryExam/quesBank.vue

@ -442,12 +442,15 @@ li {
.el-switch__label span { .el-switch__label span {
font-size: 12px; font-size: 12px;
} }
.m-b-20 { .m-r-5 {
margin-bottom: 20px; margin-right: 5px;
} }
.m-r-10 { .m-r-10 {
margin-right: 10px; margin-right: 10px;
} }
.m-b-20 {
margin-bottom: 20px;
}
@media (max-width: 720px) { @media (max-width: 720px) {
.el-message { .el-message {
min-width: auto !important; min-width: auto !important;

@ -4,293 +4,301 @@ import Router from 'vue-router';
Vue.use(Router); Vue.use(Router);
let router = new Router({ let router = new Router({
mode: 'hash', mode: 'hash',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes: [ routes: [
{ {
path: '/', path: '/',
redirect: '/login' redirect: '/login'
}, },
{ {
path: '/', path: '/',
component: () => import('../views/Home.vue'), component: () => import('../views/Home.vue'),
meta: { title: '自述文件' }, meta: { title: '自述文件' },
children: [ children: [
{ {
path: '/customer', path: '/customer',
component: () => import( '../views/customer/customer.vue'), component: () => import('../views/customer/customer.vue'),
// meta: { title: '客户管理' } // meta: { title: '客户管理' }
}, },
{ {
path: '/addcustomer', path: '/addcustomer',
component: () => import( '../views/customer/AddCustomer.vue'), component: () => import('../views/customer/AddCustomer.vue'),
// meta: { title: '新增客户' } // meta: { title: '新增客户' }
}, },
{ {
path: '/bmOrder', path: '/bmOrder',
component: () => import( '../views/customer/Order.vue'), component: () => import('../views/customer/Order.vue'),
// meta: { title: '新增客户' } // meta: { title: '新增客户' }
}, },
{ {
path: '/user', path: '/user',
component: () => import( '../views/user/User.vue'), component: () => import('../views/user/User.vue'),
// meta: { title: '用户管理' } // meta: { title: '用户管理' }
}, },
{ {
path: '/adduser', path: '/adduser',
component: () => import( '../views/user/AddUser.vue'), component: () => import('../views/user/AddUser.vue'),
// meta: { title: '新增用户' } // meta: { title: '新增用户' }
}, },
{ {
path: '/info', path: '/info',
component: () => import( '../views/user/Info.vue'), component: () => import('../views/user/Info.vue'),
// meta: { title: '新增用户' } // meta: { title: '新增用户' }
}, },
{ {
path: '/order', path: '/order',
component: () => import( '../views/order/Order.vue'), component: () => import('../views/order/Order.vue'),
// meta: { title: '订单管理' } // meta: { title: '订单管理' }
}, },
{ {
path: '/addorder', path: '/addorder',
component: () => import( '../views/order/AddOrder.vue'), component: () => import('../views/order/AddOrder.vue'),
// meta: { title: '新增订单' } // meta: { title: '新增订单' }
}, },
{ {
path: '/selectClient', path: '/selectClient',
component: () => import( '../views/order/selectClient.vue'), component: () => import('../views/order/selectClient.vue'),
// meta: { title: '选择订单客户' } // meta: { title: '选择订单客户' }
}, },
{ {
path: '/configure', path: '/configure',
component: () => import( '../views/serve/Configure.vue'), component: () => import('../views/serve/Configure.vue'),
// meta: { title: '服务配置' } // meta: { title: '服务配置' }
}, },
{ {
path: '/backstage', path: '/backstage',
component: () => import( '../views/serve/backstage'), component: () => import('../views/serve/backstage'),
// meta: { title: '服务配置' } // meta: { title: '服务配置' }
}, },
{ {
path: '/addModel', path: '/addModel',
component: () => import( '../views/serve/addModel'), component: () => import('../views/serve/addModel'),
// meta: { title: '服务配置' } // meta: { title: '服务配置' }
}, },
{ {
path: '/addconfigure', path: '/addconfigure',
component: () => import( '../views/serve/AddConfigure.vue'), component: () => import('../views/serve/AddConfigure.vue'),
// meta: { title: '新增配置' } // meta: { title: '新增配置' }
}, },
{ {
path: '/projectList', path: '/projectList',
component: () => import( '../views/serve/projectList.vue'), component: () => import('../views/serve/projectList.vue'),
// meta: { title: '项目管理' } // meta: { title: '项目管理' }
}, },
{ {
path: '/projectAdd', path: '/projectAdd',
component: () => import( '../views/serve/projectAdd.vue'), component: () => import('../views/serve/projectAdd.vue'),
// meta: { title: '项目配置' } // meta: { title: '项目配置' }
}, },
{ {
path: '/curriculum', path: '/curriculum',
component: () => import( '../views/course/Curriculum.vue'), component: () => import('../views/course/Curriculum.vue'),
// meta: { title: '课程管理' } // meta: { title: '课程管理' }
}, },
{ {
path: '/addcurriculum', path: '/addcurriculum',
component: () => import( '../views/course/AddCurriculum.vue'), component: () => import('../views/course/AddCurriculum.vue'),
// meta: { title: '新建课程' } // meta: { title: '新建课程' }
}, },
{ {
path: '/contentSettings', path: '/contentSettings',
component: () => import( '../views/course/contentSettings.vue'), component: () => import('../views/course/contentSettings.vue'),
// meta: { title: '内容设置' } // meta: { title: '内容设置' }
}, },
{ {
path: '/addlink', path: '/addlink',
component: () => import( '../views/course/AddLink.vue'), component: () => import('../views/course/AddLink.vue'),
// meta: { title: '添加环节' } // meta: { title: '添加环节' }
}, },
{ {
path: '/data', path: '/data',
component: () => import( '../views/data/Data.vue'), component: () => import('../views/data/Data.vue'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/match', path: '/match',
component: () => import( '../views/match/list'), component: () => import('../views/match/list'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/addMatch', path: '/addMatch',
component: () => import( '../views/match/add'), component: () => import('../views/match/add'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/matchManage', path: '/matchManage',
component: () => import( '../views/match/manage'), component: () => import('../views/match/manage'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/noticeDetail', path: '/noticeDetail',
component: () => import( '../views/match/manage/noticeDetail'), component: () => import('../views/match/manage/noticeDetail'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/matchArchList', path: '/matchArchList',
component: () => import( '../views/match/manage/matchArchList'), component: () => import('../views/match/manage/matchArchList'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/matchRank', path: '/matchRank',
component: () => import( '../views/match/manage/matchRank'), component: () => import('../views/match/manage/matchRank'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/matchReport', path: '/matchReport',
component: () => import( '../views/match/manage/matchReport'), component: () => import('../views/match/manage/matchReport'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/matchInfo', path: '/matchInfo',
component: () => import( '../views/match/manage/matchInfo'), component: () => import('../views/match/manage/matchInfo'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: `/theoreticalCourse`, path: `/theoreticalCourse`,
component: () => import("../views//theoreticalCourse/list"), component: () => import("../views//theoreticalCourse/list"),
meta: { title: "理论课程" } meta: { title: "理论课程" }
}, },
{ {
path: `/addTheoreticalCourse`, path: `/addTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/add"), component: () => import("../views//theoreticalCourse/add"),
meta: { title: "理论课程详情" } meta: { title: "理论课程详情" }
}, },
{ {
path: `/previewTheoreticalCourse`, path: `/previewTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/preview"), component: () => import("../views//theoreticalCourse/preview"),
meta: { title: "理论课程预览" } meta: { title: "理论课程预览" }
}, },
{ {
path: `/setTheoreticalCourse`, path: `/setTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/contentSettings"), component: () => import("../views//theoreticalCourse/contentSettings"),
meta: { title: "理论课程内容设置" } meta: { title: "理论课程内容设置" }
}, },
{ {
path: `/information`, path: `/information`,
component: () => import("../views//information/list"), component: () => import("../views//information/list"),
meta: { title: "资讯管理" } meta: { title: "资讯管理" }
}, },
{ {
path: `/addArticle`, path: `/addArticle`,
component: () => import("../views//information/addArticle"), component: () => import("../views//information/addArticle"),
meta: { title: "新增文章" } meta: { title: "新增文章" }
}, },
{ {
path: '/system', path: '/system',
component: () => import( '../views/system'), component: () => import('../views/system'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/manageLog', path: '/manageLog',
component: () => import( '../views/system/manageLog'), component: () => import('../views/system/manageLog'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/addLog', path: '/addLog',
component: () => import( '../views/system/addLog'), component: () => import('../views/system/addLog'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{ {
path: '/permission', path: '/permission',
component: () => import('../views/customer/Permission.vue'), component: () => import('../views/customer/Permission.vue'),
// meta: { title: '应用权限', permission: true } // meta: { title: '应用权限', permission: true }
}, },
{ {
path: '/person', path: '/person',
component: () => import('../views/setting'), component: () => import('../views/setting'),
// meta: { title: '个人中心' } // meta: { title: '个人中心' }
}, },
{ {
path: '/parner', path: '/parner',
component: () => import('../views/parner'), component: () => import('../views/parner'),
// meta: { title: '个人中心' } // meta: { title: '个人中心' }
}, },
{ {
path: '/parnerOperation', path: '/parnerOperation',
component: () => import('../views/parnerOperation'), component: () => import('../views/parnerOperation'),
}, },
{ {
path: '/learnMg', path: '/learnMg',
component: () => import('../views/parnerOperation/learnMg'), component: () => import('../views/parnerOperation/learnMg'),
}, },
{ {
path: '/schemeSet', path: '/schemeSet',
component: () => import('../views/parnerOperation/schemeSet'), component: () => import('../views/parnerOperation/schemeSet'),
}, },
{ {
path: '/shop', path: '/shop',
component: () => import('../views/shop/list'), component: () => import('../views/shop/list'),
}, },
{ {
path: '/shop/addProduct', path: '/shop/addProduct',
component: () => import('../views/shop/addProduct'), component: () => import('../views/shop/addProduct'),
}, },
{ {
path: '/404', path: '/theoryExam/list',
component: () => import('../views/404.vue'), component: () => import('../views/theoryExam/list/index'),
// meta: { title: '404' } },
}, {
{ path: '/theoryExam/quesBank',
path: '/403', component: () => import('../views/theoryExam/quesBank'),
component: () => import('../views/403.vue'), },
// meta: { title: '403' } {
} path: '/404',
] component: () => import('../views/404.vue'),
}, // meta: { title: '404' }
{ },
path: '/login', {
component: () => import('../views/Login.vue'), path: '/403',
meta: { title: '登录' } component: () => import('../views/403.vue'),
}, // meta: { title: '403' }
{
path: '/devLogin',
component: () => import('../views/devLogin.vue'),
meta: { title: '开发者登录' }
},
{
path: '/join',
component: () => import('../views/join'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '/matchPreview',
component: () => import( '../views/match/preview'),
// meta: { title: '数据管理' }
},
{
path: '/success',
component: () => import('../views/join/success'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '*',
redirect: '/404'
} }
] ]
},
{
path: '/login',
component: () => import('../views/Login.vue'),
meta: { title: '登录' }
},
{
path: '/devLogin',
component: () => import('../views/devLogin.vue'),
meta: { title: '开发者登录' }
},
{
path: '/join',
component: () => import('../views/join'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '/matchPreview',
component: () => import('../views/match/preview'),
// meta: { title: '数据管理' }
},
{
path: '/success',
component: () => import('../views/join/success'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '*',
redirect: '/404'
}
]
}); });
router.beforeEach(function(to, from, next) { router.beforeEach(function (to, from, next) {
// 根据路由元信息设置文档标题 // 根据路由元信息设置文档标题
window.document.title = to.meta.title || '中台'; window.document.title = to.meta.title || '中台';
//使用钩子函数对路由进行权限跳转 //使用钩子函数对路由进行权限跳转
const login = location.href.includes('dev.huorantech.cn') ? '/devLogin' : '/login' const login = location.href.includes('dev.huorantech.cn') ? '/devLogin' : '/login'
if (!sessionStorage.getItem('token') && to.path !== login && to.path !== '/join' && to.path !== '/success') { if (!sessionStorage.getItem('token') && to.path !== login && to.path !== '/join' && to.path !== '/success') {
next(login); next(login);
} else { } else {
next(); next();
} }
}); });
export default router; export default router;

@ -2,162 +2,88 @@
<!-- 平台自建 --> <!-- 平台自建 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <div class="tool">
<ul class="filter" <ul class="filter" style="align-items: flex-start">
style="align-items: flex-start">
<li> <li>
<label>可见范围</label> <label>可见范围</label>
<el-select v-model="form.visibleRange" <el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData">
clearable <el-option v-for="(item, index) in regions" :key="index" :label="item.name" :value="item.id"></el-option>
placeholder="请选择可见范围"
@change="getData">
<el-option v-for="(item,index) in regions"
:key="index"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>课程分类</label> <label>课程分类</label>
<el-select v-model="form.categoryId" <el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
clearable <el-option label="不限" value=""></el-option>
placeholder="请选择课程分类" <el-option label="暂无分类" value="0"></el-option>
@change="getData"> <el-option v-for="(item, index) in classificationList" :key="index" :label="item.classificationName"
<el-option label="不限" :value="item.id"></el-option>
value=""></el-option>
<el-option label="暂无分类"
value="0"></el-option>
<el-option v-for="(item,index) in classificationList"
:key="index"
:label="item.classificationName"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>课程类型</label> <label>课程类型</label>
<el-select v-model="form.courseType" <el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData">
clearable <el-option v-for="(item, index) in types" :key="index" :label="item.name" :value="item.id"></el-option>
placeholder="请选择课程类型"
@change="getData">
<el-option v-for="(item,index) in types"
:key="index"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>搜索</label> <label>搜索</label>
<el-input placeholder="请输入理论课程名称/创建人" <el-input placeholder="请输入理论课程名称/创建人" suffix-icon="el-icon-search" v-model="form.keyWord" clearable
suffix-icon="el-icon-search" size="small"></el-input>
v-model="form.keyWord"
clearable
size="small"></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button v-auth="'平台自建:新增'" <el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button>
type="primary" <el-button v-auth="'平台自建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button>
round
@click="addCourse">新增</el-button>
<el-button v-auth="'平台自建:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="list" <el-table :data="list" class="table" ref="table" stripe header-align="center"
class="table" @selection-change="handleSelectionChange" row-key="id">
ref="table" <el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
stripe <el-table-column type="index" width="100" label="序号" align="center">
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseName" <el-table-column prop="courseName" label="课程名称" align="center">
label="课程名称"
align="center">
</el-table-column> </el-table-column>
<el-table-column label="可见范围" <el-table-column label="可见范围" align="center">
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }} {{ regionName[scope.row.visibleRange] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime" label="创建时间" align="center">
label="创建时间"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" <el-table-column prop="courseClassification" label="课程类型" align="center">
label="课程类型"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.courseType == 1 ? '付费' : '免费' }} {{ scope.row.courseType == 1 ? '付费' : '免费' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="founder" <el-table-column prop="founder" label="创建人" align="center">
label="创建人"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" <el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip>
label="课程分类"
align="center"
show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center" width="250">
align="center"
width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'平台自建:编辑信息'" <el-button v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button>
type="text" <el-divider v-auth="'平台自建:编辑信息'" direction="vertical"></el-divider>
@click="editCourse(scope.row)">编辑信息</el-button> <el-button v-auth="'平台自建:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'平台自建:编辑信息'" <el-divider v-auth="'平台自建:内容设置'" direction="vertical"></el-divider>
direction="vertical"></el-divider> <el-button v-auth="'平台自建:预览'" type="text" @click="preview(scope.row)">预览</el-button>
<el-button v-auth="'平台自建:内容设置'" <el-divider v-auth="'平台自建:预览'" direction="vertical"></el-divider>
type="text" <el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'平台自建:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'平台自建:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可授权状态" <el-table-column label="可授权状态" align="center" width="120">
align="center"
width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-auth="'平台自建:禁用'" <el-switch v-auth="'平台自建:禁用'" v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1"
v-model="scope.row.ztOpen" style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'"
:active-value="0" @change="switchOff($event, scope.row, scope.$index)"></el-switch>
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
layout="total, prev, pager, next" :current-page="page">
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
@ -349,10 +275,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .tool { /deep/ .tool {
.filter { .filter {
.el-input { .el-input {
min-width: 215px; min-width: 215px;
}
} }
}
} }
</style> </style>

@ -2,11 +2,8 @@
<!-- 理论课程管理 --> <!-- 理论课程管理 -->
<div class="page"> <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item" <a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{ item
v-for="(item, i) in tabs" }}</a>
:key="i"
:class="{active: i == active}"
@click="tabChange(i)">{{ item }}</a>
</div> </div>
<div class="page-content"> <div class="page-content">
<!-- 平台自建 --> <!-- 平台自建 -->
@ -61,5 +58,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -0,0 +1,57 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" content="理论考试系统程序"></el-page-header>
</div>
</el-card>
<div class="page">
<div class="tabs m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{
item
}}</a>
</div>
<System v-if="active == 'tab1'" />
<Program v-if="active == 'tab2'" />
</div>
</div>
</template>
<script>
import System from './system'
import Program from './program'
export default {
components: {
System,
Program,
},
data () {
return {
active: 'tab1',
tabs: {
tab1: '系统列表',
tab2: '程序后台',
},
};
},
mounted () {
},
methods: {
tabChange (i) {
this.active = i
},
back () {
this.$router.back()
},
}
};
</script>
<style scoped>
.card {
min-height: calc(100vh - 300px);
}
</style>

@ -0,0 +1,139 @@
<template>
<div>
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="程序名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="供应商" align="center"></el-table-column>
<el-table-column prop="userName" label="程序类型" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="程序归属" align="center"></el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</template>
<script>
import qs from 'qs'
export default {
data () {
return {
list: [],
form: {
curriculumName: this.$route.query.curriculumName || ''
},
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loading: false,
searchTimer: null
};
},
watch: {
"form.curriculumName": function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
//
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.curriculumList, data).then(res => {
this.list = res.page.records
this.total = res.page.total
this.loading = false
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
//
addcourse () {
this.setReferrer()
this.$router.push("/addcurriculum");
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config (row) {
this.setReferrer()
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.list.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
}
};
</script>
<style scoped></style>

@ -0,0 +1,321 @@
<template>
<div>
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入系统名称" suffix-icon="el-icon-search" v-model="curriculumName" clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" round @click="add">新增系统</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="系统分类" align="center"></el-table-column>
<el-table-column prop="userName" label="系统描述" align="center"></el-table-column>
<el-table-column label="创建时间" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="创建人" align="center"></el-table-column>
<el-table-column prop="expectedCourse" label="系统后台" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">进入</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<!-- 新增编辑系统 -->
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '系统'" :visible.sync="systemVisible" width="400px"
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item prop="workNumber" label="关联程序">
<el-input value="理论考试系统程序" disabled class="m-r-10" style="width: 240px;" />
<el-button type="text" @click="showProgram">查看</el-button>
</el-form-item>
<el-form-item prop="userName" label="系统名称">
<el-input v-model.trim="form.userName" placeholder="请输入系统名称"></el-input>
</el-form-item>
<el-form-item prop="account" label="系统分类">
<el-select v-model="form.operator" class="m-r-10" style="width: 230px;">
<!-- <el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option> -->
</el-select>
<el-button type="text" @click="customType">自定义</el-button>
</el-form-item>
<el-form-item prop="email" label="系统描述">
<el-input v-model.trim="form.email" type="textarea" :rows="4" placeholder="请输入系统描述"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="systemVisible = false">取消</el-button>
<el-button type="primary" @click="submitSystem">确定</el-button>
</span>
</el-dialog>
<!-- 程序列表 -->
<el-dialog title="程序列表" :visible.sync="programVisible" width="600px" :close-on-click-modal="false">
<Program />
<span slot="footer" class="dialog-footer">
<el-button @click="programVisible = false">关闭</el-button>
</span>
</el-dialog>
<!-- 系统分类设置 -->
<el-dialog title="系统分类设置" :visible.sync="typeVisible" width="600px" :close-on-click-modal="false"
class="manage-dia">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click="addClass"></i>
</div>
<el-table :data="types" ref="table" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130">
<template slot-scope="scope">
<el-input v-if="scope.row.edit" placeholder="请输入分类名称" v-model="scope.row.classificationName" clearable
maxlength="30"></el-input>
<span v-else>{{ scope.row.classificationName }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime1" label="已引用系统数量" align="center" min-width="60"></el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check action m-r-10" @click="submitClass(scope.row)"></i>
<i v-else class="el-icon-edit action m-r-10" @click="editClass(scope.row)"></i>
<i class="el-icon-delete action" @click="delClass(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer">
<el-button @click="closeClass">返回</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Program from './program'
export default {
components: {
Program,
},
data () {
return {
list: [],
curriculumName: this.$route.query.curriculumName || '',
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loading: false,
searchTimer: null,
systemVisible: false,
form: {},
rules: {
roleList: [
{ required: true, message: '请输入系统名称', trigger: 'blur' }
],
type: [
{ required: true, message: '请选择系统分类', trigger: 'change' }
],
},
programVisible: false,
types: [],
typeVisible: false,
};
},
watch: {
curriculumName: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
// this.getData()
},
methods: {
//
getData () {
let data = {
curriculumName: this.curriculumName,
pageNum: this.page,
pageSize: this.pageSize,
};
this.$post(this.api.curriculumList, data).then(res => {
this.list = res.page.records
this.total = res.page.total
this.loading = false
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
//
add () {
this.systemVisible = true
},
//
edit (row) {
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config (row) {
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.list.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
//
showProgram () {
this.programVisible = true
},
//
customType () {
this.typeVisible = true
},
//
getType (detail) {
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => {
this.types = data
// id
if (detail) {
const id = this.form.classificationId
if (!data.find(e => e.id == id)) this.form.classificationId = ''
setTimeout(() => {
this.updateTime = 0
}, 500)
}
}).catch(err => { })
},
//
addClass () {
this.types.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.types.push({
edit: true,
id: '',
classificationName: ''
})
},
//
editClass (row) {
this.types.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.$set(row, 'edit', 1)
},
//
delClass (row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getType()
}).catch(res => { })
}).catch(() => { })
} else {
this.types.splice(i, 1)
}
},
//
submitClass (row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName,
typeId: this.typeId, // (1.2.)
id: row.id,
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getType()
}).catch(res => { })
}).catch(res => { })
},
//
submitSystem () {
},
}
};
</script>
<style lang="scss" scoped>
.plus {
margin-bottom: 10px;
font-size: 18px;
color: #9278ff;
text-align: right;
cursor: pointer;
}
.action {
cursor: pointer;
}
</style>

@ -0,0 +1,357 @@
<template>
<div class="page">
<div class="side">
<div class="m-b-20">
<h6 class="p-title">题库分类</h6>
<el-radio-group v-model="type" @change="typeChange">
<div class="m-b-20">
<el-radio :label="1">所有题库</el-radio>
</div>
<div>
<el-radio :label="2">未加入分类的题库</el-radio>
</div>
</el-radio-group>
</div>
<el-divider></el-divider>
<div>
<el-input class="m-b-10" placeholder="请输入题库分类" prefix-icon="el-icon-search" size="small" clearable></el-input>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree :data="orgList" default-expand-all ref="orgTree" node-key="id" highlight-current
:expand-on-click-node="false" @node-click="handleNodeClick"
:props="{ children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf' }"></el-tree>
</div>
</div>
</div>
<div class="right">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<label>状态</label>
<el-select v-model="filter.status" clearable placeholder="请选择状态" @change="getList">
<el-option v-for="(item, i) in status" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" @click="add">创建题库</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="题库名称" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="描述" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="题库分类" align="center" min-width="120"></el-table-column>
<el-table-column prop="invitationAccount" label="题目数量" align="center" min-width="120"></el-table-column>
<el-table-column prop="loginNumber" label="创建时间" align="center" width="120"></el-table-column>
<el-table-column prop="lastLoginTime" label="创建人" align="center" width="120"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">试题管理</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">复制</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-dialog :title="!form.id ? '创建题库' : '编辑题库'" :visible.sync="quesBankVisible" width="400px"
:close-on-click-modal="false">
<el-form label-width="80px">
<el-form-item prop="userName" label="分类">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择题库分类">
<el-option v-for="(item, i) in types" :key="i" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="userName" label="题库名称">
<el-input placeholder="请输入题库名称" v-model="form.name"></el-input>
</el-form-item>
<el-form-item prop="userName" label="题库描述">
<el-input placeholder="请输入题库描述" type="textarea" :rows="3" v-model="form.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="quesBankVisible = false"> </el-button>
<el-button type="primary" @click="quesBankSubmit"> </el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import Util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
export default {
components: { OrgTree },
data () {
return {
type: 1,
orgList: [],
status: [
{
id: 1,
name: '启用'
},
{
id: 2,
name: '禁用'
},
],
filter: {
status: '',
keyWord: '',
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
types: [],
form: {
userName: '',
provinceId: '',
cityId: '',
roleList: []
},
rules: {
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
],
provinceId: [
{ required: true, message: '请选择省份', trigger: "change" }
],
cityId: [
{ required: true, message: '请选择城市', trigger: "change" }
],
roleList: [
{ required: true, message: '请选择角色', trigger: "change" }
],
},
quesBankVisible: false,
submiting: false, //
setKey: '',
transferVisible: false,
chooseVisible: false,
members: [],
choosePartnerId: '',
curRow: '',
provinces: [],
cities: [],
editVisible: false
};
},
watch: {
keyWord: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.initData, 500);
}
},
mounted () {
this.getOrg()
},
methods: {
//
async getOrg () {
const res = await this.$post(this.api.listParner)
const list = res.treeList
// children
const handleLeaf = (list, ids) => {
list.map(e => {
e.ids = ids ? [...ids, e.id] : [e.id]
if (e.children.length) {
if (e.isTeam) {
delete e.children
} else {
handleLeaf(e.children, e.ids)
}
} else {
delete e.children
}
})
}
handleLeaf(list)
this.orgList = list
//
this.setKey && this.$nextTick(() => {
this.$refs.orgTree.setCurrentKey(this.setKey)
})
this.getList()
},
//
typeChange () {
this.$refs.orgTree.setCurrentKey(null)
this.curTeamId = ''
this.initData()
},
// id
getTeamId (list) {
for (const i in list) {
const e = list[i]
if (e.isTeam && !this.curTeamId) {
this.curTeamId = e.id
break
} else {
this.getTeamId(e.children)
}
}
},
//
handleNodeClick (data) {
this.type = ''
this.curTeamId = ''
if (data.isTeam) {
this.curTeamId = data.id
} else {
// this.getTeamId(data.children)
}
if (!this.curTeamId) this.curTeamId = data.id
this.initData()
this.$refs.table.clearSelection()
},
//
getAll () {
this.curTeamId = ''
this.getList()
},
//
getList () {
this.$post(this.api[this.type ? 'partnerAccountMergeList' : 'partnerAccountList'], {
type: this.type || 1,
partnerClassificationId: this.curTeamId,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.list = pageList.records
this.total = pageList.total
}).catch(err => { })
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleSelectionChange (val) { //
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
del (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delPartnerAccount}?accountId=${row.accountId}`).then(res => {
Util.successMsg("删除成功")
this.getList()
}).catch(res => { })
}).catch(() => { })
},
async switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
Util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
//
edit (row) {
if (!row.provinceId) row.provinceId = ''
if (!row.cityId) row.cityId = ''
row.roleList = row.roleId.split(',').map(e => +e)
this.editVisible = true
this.form = JSON.parse(JSON.stringify(row))
},
//
submitEdit () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
const form = JSON.parse(JSON.stringify(this.form))
form.classificationId = form.partnerClassificationId
this.$post(this.api.editProvinceCity, form).then(res => {
this.getList()
Util.successMsg("编辑成功!")
this.editVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
})
},
//
add () {
this.quesBankVisible = true
},
//
quesBankSubmit () {
},
}
};
</script>
<style lang="scss" scoped>
.org-name {
margin-right: 20px;
}
.w-100 {
width: 100%;
}
.page {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 324px);
padding: 24px 0;
}
}
</style>
Loading…
Cancel
Save