yujialong 4 years ago
parent 806dbbec53
commit f66c1d00a0
  1. BIN
      src/assets/template.xlsx
  2. 12
      src/components/quill/index.vue
  3. 9
      src/libs/util.js
  4. 7
      src/pages/client/add/index.vue
  5. 12
      src/pages/client/list/index.vue
  6. 29
      src/pages/quesBank/list/globalQuesBank.vue
  7. 30
      src/pages/quesBank/list/myQuesBank.vue
  8. 69
      src/pages/quesBank/list/quesBankType.vue
  9. 6
      src/pages/quesBank/list/quesDialog.vue
  10. 20
      src/pages/system/list/role.vue
  11. 20
      src/pages/user/list/index.vue
  12. 43
      src/styles/common.scss
  13. 4
      src/styles/pages/tree.scss
  14. BIN
      题库导入模板.xlsx

Binary file not shown.

@ -26,6 +26,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
toTop: {
type: Boolean,
default: true
},
border: { border: {
type: Boolean, type: Boolean,
default: false default: false
@ -112,9 +116,11 @@
this.Quill = new Quill(editor, this.options); this.Quill = new Quill(editor, this.options);
// //
this.Quill.pasteHTML(this.currentValue); this.Quill.pasteHTML(this.currentValue);
this.$nextTick(() => { if(this.toTop){
window.scrollTo(0,0) this.$nextTick(() => {
}) window.scrollTo(0,0)
})
}
// //
this.Quill.on('text-change', (delta, oldDelta, source) => { this.Quill.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML; const html = this.$refs.editor.children[0].innerHTML;

@ -72,7 +72,14 @@ const util = {
isImg(ext) { isImg(ext) {
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true
return false return false
} },
// 循环去除html标签
removeHtmlTag(list,attr) {
list.map(n => {
n[attr] = n[attr].replace(/<\/?.+?>/gi,'')
})
return list
},
} }
export default util export default util

@ -3,7 +3,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex j-between"> <div class="flex j-between a-center">
<div class="per_title" v-throttle @click="goback()"> <div class="per_title" v-throttle @click="goback()">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
@ -15,10 +15,7 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">基本信息</div>
<p class="hr_tag"></p>
<span>基本信息</span>
</div>
<div> <div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex j-center" :disabled="isDetail"> <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex j-center" :disabled="isDetail">

@ -4,10 +4,8 @@
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">筛选</div>
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="6"> <el-col :span="6">
@ -45,10 +43,8 @@
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">客户列表</div>
<p class="hr_tag"></p>
<span>客户列表</span>
</div>
<div> <div>
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button> <el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>

@ -2,10 +2,8 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">筛选</div>
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div> <div>
<div class="flex j-between no-mb"> <div class="flex j-between no-mb">
<div> <div>
@ -34,10 +32,8 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">题目列表</div>
<p class="hr_tag"></p>
<span>题目列表</span>
</div>
<div> <div>
<!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> --> <!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> -->
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button> <el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
@ -46,11 +42,7 @@
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange"> <el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <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 type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="questionStem" label="题干" align="center"> <el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<template slot-scope="scope">
<div v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column> <el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> <el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column> <el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
@ -76,8 +68,9 @@
</template> </template>
<script> <script>
import quesDialog from './quesDialog'; import quesDialog from './quesDialog'
import { mapState,mapActions } from 'vuex'; import { mapState,mapActions } from 'vuex'
import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
@ -126,7 +119,7 @@ export default {
name: this.name name: this.name
}) })
.then(res => { .then(res => {
this.listData = res.data.list.list this.listData = util.removeHtmlTag(res.data.list.list,'questionStem')
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}) })
.catch(err => {}) .catch(err => {})
@ -139,8 +132,8 @@ export default {
.catch(err => {}) .catch(err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val
this.getData(); this.getData()
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val

@ -3,10 +3,8 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">测评题库</div>
<p class="hr_tag"></p>
<span>测评题库</span>
</div>
<div class="flex j-between"> <div class="flex j-between">
<el-form label-width="80px"> <el-form label-width="80px">
<el-form-item class="no-mb" label="试题类型"> <el-form-item class="no-mb" label="试题类型">
@ -31,10 +29,8 @@
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">题目列表</div>
<p class="hr_tag"></p>
<span>题目列表</span>
</div>
<div> <div>
<el-button <el-button
type="primary" type="primary"
@ -89,18 +85,14 @@
slot-scope="scope" slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template> >{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="questionStem" label="题干" align="center"> <el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<template slot-scope="scope">
<div class="ellipsis" v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column> <el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> <el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column> <el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column> <el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> <el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column> <el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="200" align="center"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button> <el-button type="text" @click="edit(scope.row)">修改</el-button>
@ -156,6 +148,7 @@
<script> <script>
import quesDialog from './quesDialog' import quesDialog from './quesDialog'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
@ -211,11 +204,7 @@ export default {
userId: this.userId userId: this.userId
}) })
.then(res => { .then(res => {
let list = res.data.list.list this.listData = util.removeHtmlTag(res.data.list.list,'questionStem')
list.map(n => {
n.questionStem = n.questionStem.replace(/<\/?.+?>/gi,'')
})
this.listData = list
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}) })
.catch(err => {}) .catch(err => {})
@ -354,7 +343,8 @@ export default {
} }
}, },
downLoad() { downLoad() {
location.href = 'http://39.108.250.202:9000/cjEnterprise/questions/getExcel' // location.href = 'http://192.168.31.152:8001/cjEnterprise/questions/getExcel'
location.href = 'http://39.108.250.202/cjEnterprise/题库导入模板.xlsx'
}, },
showimportVisible() { showimportVisible() {
this.importVisible = true this.importVisible = true

@ -2,15 +2,11 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">筛选</div>
<p class="hr_tag"></p>
<span>筛选</span> <div class="flex">
</div> <div>
<div> <el-input placeholder="请输入分类名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<div class="flex">
<div>
<el-input placeholder="请输入分类名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -18,19 +14,18 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">分类管理</div>
<p class="hr_tag"></p>
<span>分类管理</span>
</div>
<div> <div>
<el-button type="primary" size="small" round @click="addFirst" v-auth>添加一级分类</el-button> <el-button type="primary" size="small" round @click="addFirst" v-auth>添加一级分类</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps"> <el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="32">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="typeName" label="分类名称"></el-table-column> <el-table-column prop="typeName" label="分类名称"></el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index}}
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button> <el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button>
<el-button type="text" @click="editType(scope.row)" v-auth>编辑</el-button> <el-button type="text" @click="editType(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
@ -70,7 +65,7 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
@ -116,10 +111,16 @@ export default {
} }
this.$post(this.api.listByPage,data) this.$post(this.api.listByPage,data)
.then(res => { .then(res => {
this.listData = res.data.list.list let list = res.data.list.list
// list.map((n,i) => {
// n.index = i + 1
// n.secondColumn.map((j,i) => {
// j.index = i + 1
// })
// })
this.listData = list
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}) }).catch(err => {})
.catch(err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;
@ -131,9 +132,9 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteById}?cid=${row.cid}`).then(res => { this.$post(`${this.api.deleteById}?cid=${row.cid}`).then(res => {
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) })
.catch(() => {}); .catch(() => {});
}, },
@ -155,9 +156,7 @@ export default {
this.firstVisible = false this.firstVisible = false
this.getData() this.getData()
} }
}) }).catch(err => {})
.catch(err => {
});
}else{ }else{
this.$post(this.api.AddOneLevel, data).then(res => { this.$post(this.api.AddOneLevel, data).then(res => {
if(res.success){ if(res.success){
@ -165,13 +164,10 @@ export default {
this.firstVisible = false this.firstVisible = false
this.getData() this.getData()
} }
}) }).catch(err => {})
.catch(err => {
});
} }
}, },
addSecond(row){ addSecond(row){
console.log(22,row)
this.isAddSecond = true this.isAddSecond = true
this.curRow = row this.curRow = row
this.secondVisible = true this.secondVisible = true
@ -209,18 +205,14 @@ export default {
this.$message.success('添加成功'); this.$message.success('添加成功');
this.secondVisible = false this.secondVisible = false
this.getData() this.getData()
}) }).catch(err => {})
.catch(err => {
});
}else{ }else{
data.cid = this.curRow.cid data.cid = this.curRow.cid
this.$post(this.api.modifyLevel, data).then(res => { this.$post(this.api.modifyLevel, data).then(res => {
this.$message.success('修改成功'); this.$message.success('修改成功');
this.secondVisible = false this.secondVisible = false
this.getData() this.getData()
}) }).catch(err => {})
.catch(err => {
});
} }
}, },
delData(row) { delData(row) {
@ -231,10 +223,13 @@ export default {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => { this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
this.$message.success('删除成功'); this.$message.success('删除成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) }).catch(() => {})
.catch(() => {});
}, },
} }
} }
</script> </script>
<style lang="scss" scoped>
</style>

@ -285,7 +285,8 @@ export default {
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
} }
} }
if(optionCount < 2) return this.$message.warning('请至少添加两个选项!') if((topicForm.typeId == 1 || topicForm.typeId == 3) && optionCount < 2) return this.$message.warning('请至少添加两个选项!')
if(topicForm.typeId == 2 && optionCount < 3) return this.$message.warning('请至少添加三个选项!')
if(!answer) return this.$message.warning('请设置正确答案!') if(!answer) return this.$message.warning('请设置正确答案!')
if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!') if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!')
if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!') if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!')
@ -392,7 +393,7 @@ export default {
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); })
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
@ -403,6 +404,7 @@ export default {
closeTopics() { closeTopics() {
this.$emit('update:visible',false) this.$emit('update:visible',false)
this.$emit('closeTopics') this.$emit('closeTopics')
this.uploadList = []
this.resetForm() this.resetForm()
}, },
closeDialog(){ closeDialog(){

@ -2,15 +2,11 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">筛选</div>
<p class="hr_tag"></p>
<span>筛选</span> <div class="flex">
</div> <div>
<div> <el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<div class="flex">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -18,10 +14,8 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">角色列表</div>
<p class="hr_tag"></p>
<span>角色列表</span>
</div>
<div> <div>
<el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button> <el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button>

@ -2,15 +2,11 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="flex a-center m-b-20"> <div class="p-title m-b-20">筛选</div>
<p class="hr_tag"></p>
<span>筛选</span> <div class="flex">
</div> <div>
<div> <el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<div class="flex">
<div>
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -18,10 +14,8 @@
<el-card shadow="hover"> <el-card shadow="hover">
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="p-title">用户列表</div>
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div> <div>
<el-button type="primary" size="small" round @click="adduser" v-auth>新增用户</el-button> <el-button type="primary" size="small" round @click="adduser" v-auth>新增用户</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button> <el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button>

@ -60,25 +60,32 @@
margin-right: 5px; margin-right: 5px;
color: #F56C6C; color: #F56C6C;
} }
.hr_tag{ .p-title{
background-color: $--color-primary; display: flex;
width: 3px; align-items: center;
height: 15px; &:before{
margin-right: 5px; content: '';
} display: inline-block;
width: 3px;
.per_title span{ height: 15px;
font-size: 16px; margin-right: 5px;
font-weight: bold; background-color: $--color-primary;
} }
.per_back{
margin-left: 5px;
}
.per_school{
margin-left: 30px;
} }
.per_title:hover{ .per_title{
cursor:pointer; span{
font-size: 16px;
font-weight: bold;
}
.per_back{
margin-left: 5px;
}
.per_school{
margin-left: 30px;
}
&:hover{
cursor:pointer;
}
} }
[v-cloak] { [v-cloak] {

@ -1,3 +1,5 @@
@import "../default/index.scss";
$insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色 $insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色
$outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色 $outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色
//混合代码,提取item共同样式 //混合代码,提取item共同样式
@ -59,7 +61,7 @@ $outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色
margin-left:95px margin-left:95px
} }
.item2:hover{ .item2:hover{
color: #cb221c; color: $--color-primary;
} }
.edit{ .edit{
display: inline-block; display: inline-block;

Binary file not shown.
Loading…
Cancel
Save