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. 32
      src/pages/quesBank/list/myQuesBank.vue
  8. 71
      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,
default: false
},
toTop: {
type: Boolean,
default: true
},
border: {
type: Boolean,
default: false
@ -112,9 +116,11 @@
this.Quill = new Quill(editor, this.options);
//
this.Quill.pasteHTML(this.currentValue);
this.$nextTick(() => {
window.scrollTo(0,0)
})
if(this.toTop){
this.$nextTick(() => {
window.scrollTo(0,0)
})
}
//
this.Quill.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;

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

@ -3,7 +3,7 @@
<el-row :gutter="20">
<el-col :span="24">
<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()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
@ -15,10 +15,7 @@
<el-card shadow="hover">
<div>
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>基本信息</span>
</div>
<div class="p-title m-b-20">基本信息</div>
<div>
<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-card shadow="hover" class="m-b-20">
<div>
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div class="p-title m-b-20">筛选</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
@ -45,10 +43,8 @@
<el-col :span="24">
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="flex a-center">
<p class="hr_tag"></p>
<span>客户列表</span>
</div>
<div class="p-title">客户列表</div>
<div>
<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>

@ -2,10 +2,8 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div class="p-title m-b-20">筛选</div>
<div>
<div class="flex j-between no-mb">
<div>
@ -34,10 +32,8 @@
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="flex a-center">
<p class="hr_tag"></p>
<span>题目列表</span>
</div>
<div class="p-title">题目列表</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>
@ -46,11 +42,7 @@
<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="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="questionStem" label="题干" align="center">
<template slot-scope="scope">
<div v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" 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="typeName" label="所属题库" width="140" align="center"></el-table-column>
@ -76,8 +68,9 @@
</template>
<script>
import quesDialog from './quesDialog';
import { mapState,mapActions } from 'vuex';
import quesDialog from './quesDialog'
import { mapState,mapActions } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
@ -126,7 +119,7 @@ export default {
name: this.name
})
.then(res => {
this.listData = res.data.list.list
this.listData = util.removeHtmlTag(res.data.list.list,'questionStem')
this.total = res.data.list.totalCount
})
.catch(err => {})
@ -139,8 +132,8 @@ export default {
.catch(err => {})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val

@ -3,10 +3,8 @@
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>测评题库</span>
</div>
<div class="p-title m-b-20">测评题库</div>
<div class="flex j-between">
<el-form label-width="80px">
<el-form-item class="no-mb" label="试题类型">
@ -31,10 +29,8 @@
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between m-b-20">
<div class="flex a-center">
<p class="hr_tag"></p>
<span>题目列表</span>
</div>
<div class="p-title">题目列表</div>
<div>
<el-button
type="primary"
@ -89,18 +85,14 @@
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" label="题干" align="center">
<template slot-scope="scope">
<div class="ellipsis" v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" 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="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="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 label="操作" width="200" align="center">
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button>
@ -156,6 +148,7 @@
<script>
import quesDialog from './quesDialog'
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
@ -211,11 +204,7 @@ export default {
userId: this.userId
})
.then(res => {
let list = res.data.list.list
list.map(n => {
n.questionStem = n.questionStem.replace(/<\/?.+?>/gi,'')
})
this.listData = list
this.listData = util.removeHtmlTag(res.data.list.list,'questionStem')
this.total = res.data.list.totalCount
})
.catch(err => {})
@ -352,9 +341,10 @@ export default {
}else{
this.$message.error('请先选择数据!')
}
},
},
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() {
this.importVisible = true

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

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

@ -2,15 +2,11 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<div class="flex">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>
@ -18,10 +14,8 @@
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="flex a-center">
<p class="hr_tag"></p>
<span>角色列表</span>
</div>
<div class="p-title">角色列表</div>
<div>
<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>

@ -2,15 +2,11 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="flex a-center m-b-20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<div class="flex">
<div>
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>
@ -18,10 +14,8 @@
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="flex a-center">
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div class="p-title">用户列表</div>
<div>
<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>

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

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

Binary file not shown.
Loading…
Cancel
Save