yujialong 4 years ago
parent b1d31b8c32
commit 4e9b321312
  1. 3
      src/api/index.js
  2. 72
      src/components/messageBoard/index.vue
  3. 7
      src/components/testPaperDetail/index.vue
  4. 7
      src/layouts/header/index.vue
  5. 4
      src/libs/auth/generateBtnPermission.js
  6. 6
      src/libs/bus.js
  7. 10
      src/libs/random_str.js
  8. 8
      src/libs/route/addRoutes.js
  9. 6
      src/libs/route/generateRoutes.js
  10. 2
      src/libs/route/resetRouter.js
  11. 6
      src/libs/util.cookies.js
  12. 8
      src/libs/util.js
  13. 8
      src/pages/account/login/index.vue
  14. 6
      src/pages/achievement/detail/index.vue
  15. 280
      src/pages/achievement/list/wrongBook.vue
  16. 6
      src/pages/assessment/detail/index.vue
  17. 19
      src/pages/messageBoard/list/index.vue
  18. 8
      src/pages/practice/detail/index.vue
  19. 10
      src/plugins/auth/index.js
  20. 26
      src/store/modules/auth.js
  21. 2
      src/store/modules/practice.js
  22. 4
      src/store/modules/user.js
  23. 0
      src/styles/lib/_background.scss
  24. 0
      src/styles/lib/_border.scss
  25. 0
      src/styles/lib/_box.scss
  26. 0
      src/styles/lib/_cursor.scss
  27. 0
      src/styles/lib/_display.scss
  28. 0
      src/styles/lib/_flex.scss
  29. 0
      src/styles/lib/_float.scss
  30. 0
      src/styles/lib/_font-size.scss
  31. 0
      src/styles/lib/_font-weight.scss
  32. 0
      src/styles/lib/_line-height.scss
  33. 0
      src/styles/lib/_link.scss
  34. 0
      src/styles/lib/_overflow.scss
  35. 0
      src/styles/lib/_position.scss
  36. 0
      src/styles/lib/_size.scss
  37. 0
      src/styles/lib/_text-align.scss
  38. 0
      src/styles/lib/_text-color.scss
  39. 0
      src/styles/lib/_vertical-align.scss
  40. 0
      src/styles/lib/_visibility.scss
  41. 0
      src/styles/lib/_white-space.scss
  42. 3
      src/styles/lib/index.scss
  43. 9
      src/styles/lib/mixin.scss
  44. 24
      src/styles/var.scss
  45. 3
      vue.config.js

@ -188,4 +188,7 @@ export default {
getMineClass:`/management/practise/review/getMineClass`, getMineClass:`/management/practise/review/getMineClass`,
AchievementListByClassId:`/management/practise/review/AchievementListByClassId`, AchievementListByClassId:`/management/practise/review/AchievementListByClassId`,
byClassIdGetPractise:`/management/practise/review/byClassIdGetPractise`, byClassIdGetPractise:`/management/practise/review/byClassIdGetPractise`,
// 错题管理
pageByNameWrong:`/management/wrongTopic/pageByName`,
} }

@ -1,72 +0,0 @@
<template>
<div>
<div class="message" @click="showMessage">
<img src="../../assets/img/message.png">
留言板
</div>
<el-dialog title="留言内容" :visible.sync="messageVisible" width="30%" @close="closeMessage" :close-on-click-modal="false" :modal-append-to-body="false" :modal="true">
<div class="message-wrap">
<div class="people">张三提问于2020-12-11</div>
<el-input type="textarea" rows="3"></el-input>
<div class="btn-wrap">
<el-button type="primary" size="small">回复</el-button>
<el-button type="error" size="small">删除</el-button>
</div>
<!-- <quill :border="true" :height="100"></quill> -->
<el-input type="textarea" rows="3"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="messageVisible = false" size="small">取消</el-button>
<el-button type="primary" size="small">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from '@/setting';
import quill from '@/components/quill';
export default {
data() {
return {
messageVisible: false
};
},
components: {quill},
methods: {
closeMessage(){
},
showMessage(){
this.messageVisible = true
}
},
};
</script>
<style lang="scss" scoped>
.message{
display: inline-flex;
align-items: center;
margin-right: 20px;
color: #666;
font-size: 12px;
cursor: pointer;
&:hover{
opacity: .8;
}
img{
margin-right: 5px;
}
}
.message-wrap{
.people{
margin-bottom: 10px;
font-size: 12px;
color: #333;
}
.btn-wrap{
margin: 10px 0;
text-align: right;
}
}
</style>

@ -176,7 +176,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$mainColor: #e80909;
.box{ .box{
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
@ -223,7 +222,7 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 4px; height: 4px;
background-color: $mainColor; background-color: $main-color;
} }
} }
} }
@ -293,8 +292,8 @@ export default {
cursor: pointer; cursor: pointer;
&.submit{ &.submit{
color: #fff; color: #fff;
background-color: $mainColor; background-color: $main-color;
border-color: $mainColor; border-color: $main-color;
} }
&:hover{ &:hover{
opacity: .8; opacity: .8;

@ -39,13 +39,14 @@ export default {
}, },
methods: { methods: {
...mapActions('user', [
'logout'
]),
toPerson(){ toPerson(){
this.$router.push('/setting/person') this.$router.push('/setting/person')
}, },
loginout() { loginout() {
sessionStorage.removeItem(Setting.usernameKey); this.logout()
sessionStorage.removeItem(Setting.storeKey);
location.reload()
}, },
back(){ back(){
this.$router.back() this.$router.back()

@ -2,7 +2,7 @@
* @description 生成按钮级别权限组 * @description 生成按钮级别权限组
* */ * */
import store from '@/store'; import store from '@/store'
export default function(data){ export default function(data){
let result = [] let result = []
data.map(e => { data.map(e => {
@ -21,6 +21,6 @@ export default function(data){
}) })
} }
}) })
store.commit('addBtnPerData',{btnPermissions: result}) store.auth.commit('addBtnAuth',{btns: result})
// console.log('geneBtn:',result) // console.log('geneBtn:',result)
} }

@ -1,6 +1,6 @@
import Vue from 'vue'; import Vue from 'vue'
// 使用 Event Bus // 使用 Event Bus
const bus = new Vue(); const bus = new Vue()
export default bus; export default bus

@ -1,10 +1,10 @@
// 生成随机字符串 // 生成随机字符串
export default function (len = 32) { export default function (len = 32) {
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
const maxPos = $chars.length; const maxPos = $chars.length
let str = ''; let str = ''
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
str += $chars.charAt(Math.floor(Math.random() * maxPos)); str += $chars.charAt(Math.floor(Math.random() * maxPos))
} }
return str; return str
} }

@ -1,6 +1,6 @@
import store from '@/store'; import store from '@/store'
import router from '@/router'; import router from '@/router'
import generateBtnPermission from '../auth/generateBtnPermission'; import generateBtnPermission from '../auth/generateBtnPermission'
const newRoutes = [] const newRoutes = []
@ -29,6 +29,6 @@ export default function(data,path){
createRoute(data) createRoute(data)
let routes = router.options.routes let routes = router.options.routes
routes[1].children = [...routes[1].children,...newRoutes] routes[1].children = [...routes[1].children,...newRoutes]
store.commit("addRoutesData", { routes }) store.auth.commit("addRoutes", { routes })
router.addRoutes(routes) router.addRoutes(routes)
} }

@ -1,9 +1,9 @@
import store from '@/store'; import store from '@/store'
import router from '@/router'; import router from '@/router'
export default function(){ export default function(){
setTimeout(() => { setTimeout(() => {
let routes = store.state.routes let routes = store.state.auth.routes
routes.forEach(e => { routes.forEach(e => {
if(e.path == '/'){ if(e.path == '/'){
e.component = () => import('@/layouts/home/index.vue') e.component = () => import('@/layouts/home/index.vue')

@ -1,4 +1,4 @@
import router from '@/router'; import router from '@/router'
export default function(){ export default function(){
const newRouter = createRouter() const newRouter = createRouter()

@ -1,7 +1,7 @@
import Cookies from 'js-cookie'; import Cookies from 'js-cookie'
import Setting from '@/setting'; import Setting from '@/setting'
const cookies = {}; const cookies = {}
/** /**
* @description 存储 cookie * @description 存储 cookie

@ -1,5 +1,5 @@
import cookies from './util.cookies'; import cookies from './util.cookies'
import {_local,_session} from './util.db'; import {_local,_session} from './util.db'
const util = { const util = {
cookies, cookies,
@ -73,6 +73,6 @@ const util = {
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
} }
}; }
export default util; export default util

@ -53,7 +53,7 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex'
export default { export default {
data: function() { data: function() {
return { return {
@ -94,11 +94,9 @@ export default {
this.login(data).then(() => { this.login(data).then(() => {
this.$router.replace('/index') this.$router.replace('/index')
}) })
.catch(() => { .catch(() => {})
})
} }
}); })
} }
}, },
}; };

@ -185,7 +185,7 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 4px; height: 4px;
background-color: #e80909; background-color: $main-color;
} }
} }
} }
@ -251,8 +251,8 @@ export default {
cursor: pointer; cursor: pointer;
&.submit{ &.submit{
color: #fff; color: #fff;
background-color: #e80909; background-color: $main-color;
border-color: #e80909; border-color: $main-color;
} }
&:hover{ &:hover{
opacity: .8; opacity: .8;

@ -10,13 +10,18 @@
<div class="flex j-between"> <div class="flex j-between">
<el-form label-width="80px" inline> <el-form label-width="80px" inline>
<el-form-item class="no-mb" label="错题来源"> <el-form-item class="no-mb" label="错题来源">
<el-select v-model="publishStatus" clearable placeholder="请选择错题来源" @change="getData"> <el-select v-model="type" clearable placeholder="请选择错题来源" @change="getName">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="no-mb" label="试卷名称"> <el-form-item class="no-mb" label="练习名称" v-if="type == 2">
<el-select v-model="publishStatus" clearable placeholder="请选择试卷名称" @change="getData"> <el-select v-model="name" clearable placeholder="请选择练习名称" @change="getData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in nameList" :key="index" :label="item.practiseName" :value="item.practiseId"></el-option>
</el-select>
</el-form-item>
<el-form-item class="no-mb" label="考核名称" v-else>
<el-select v-model="name" clearable placeholder="请选择考核名称" @change="getData">
<el-option v-for="(item,index) in nameList" :key="index" :label="item.assessmentName" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -61,18 +66,30 @@
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="name" label="错题来源" align="center"></el-table-column> <el-table-column label="错题来源" align="center">
<el-table-column prop="name" label="试卷名称" align="center"></el-table-column> <template>
<el-table-column prop="name" label="所需知识点" align="center"></el-table-column> {{type == 1 ? '考核试卷' : '练习试卷'}}
<el-table-column prop="name" label="教学班级" align="center"></el-table-column> </template>
<el-table-column prop="name" label="真实姓名" align="center"></el-table-column> </el-table-column>
<el-table-column prop="name" label="学号" align="center"></el-table-column> <el-table-column label="试卷名称" align="center">
<el-table-column prop="name" label="错题数" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="name" label="重做正确率" align="center"></el-table-column>
<el-table-column prop="name" label="知识点掌握程度" align="center"></el-table-column> </template>
</el-table-column>
<el-table-column prop="knowledgePoints" label="所需知识点" align="center"></el-table-column>
<el-table-column label="题干名称" align="center">
<template slot-scope="scope">
<div v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column label="错题人数" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showNum(scope.row)">{{scope.row.wrongNum}}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<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>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -89,22 +106,109 @@
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
<el-dialog title="错题人数" :visible.sync="numVisible" width="50%">
<el-table
:data="numList"
ref="table"
row-key="id"
class="table"
stripe
header-align="center"
>
<el-table-column type="index" width="100" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="paperName" label="姓名" align="center"></el-table-column>
<el-table-column prop="examTime" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="所属班级" align="center"></el-table-column>
<el-table-column prop="score" label="重做正确率" align="center"></el-table-column>
<el-table-column prop="score" label="知识点掌握程度" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@current-change="handleNumCurrentChange"
:current-page="pageNum"
:page-size="pageSizeNum"
layout="total,prev, pager, next"
:total="totalNum"
></el-pagination>
</div>
</el-dialog>
<el-dialog title="错题详情" :visible.sync="detailVisible" width="40%">
<!-- <div class="ques">
<div class="meta">
<p class="key">题干</p>
<p class="val" v-html="item.questionStem"></p>
<div class="media" :id="item.mediaEleId"></div>
</div>
<div class="meta">
<p class="key">选项</p>
<div class="val">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</div>
<div class="meta ans">
<div class="info">
<p class="key">正确答案</p>
<p class="val">{{item.answer}}</p>
</div>
</div>
<div class="meta">
<p class="key">答案解析</p>
<p class="val" v-html="item.answerAnalysis"></p>
</div>
</div> -->
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
listData: [],
keyword: '', keyword: '',
type: 1,
typeList: [
{
id: 1,
name: '考核试卷'
},{
id: 2,
name: '练习试卷'
}
],
name: '',
nameList: [],
listData: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
searchTimer: null, searchTimer: null,
numVisible: false,
numList: [],
pageNum: 0,
pageSizeNum: 10,
totalNum: 0,
detailVisible: false
}; };
}, },
computed: {
...mapState('user', [
'userId','clientId'
]),
},
mounted() { mounted() {
this.getData() this.getName()
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
@ -116,33 +220,71 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
// this.$get(this.api.list, { this.$post(`${this.api.pageByNameWrong}?type=${this.type}&pageNum=${this.page}&pageSize=${this.pageSize}&practiseName=${this.keyword}&userId=${this.userId}&id=${this.name}`)
// page: this.page, .then(res => {
// size: this.pageSize, this.listData = res.data.list.list
// questionStem: this.keyword, this.total = res.data.list.totalCount
// questionType: this.subject })
// }) .catch(err => {})
// .then(res => { },
// this.total = res.page.totalCount; // getName() {
// this.page = res.page.currPage; // if(this.type == 1){
// this.listData = res.page.list; this.$get(this.api.queryAssessment, {
// this.$refs.table.clearSelection() page: 1,
// }) size: 1000,
// .catch(err => {}) type: '',
state: '',
assessmentName: '',
userId: this.userId
})
.then(res => {
this.nameList = res.data.Assessment
this.name = this.nameList[0].id
this.getData()
}).catch(err => {})
}else{
this.$post(`${this.api.pageByName}?pageNum=1&pageSize=1000&practiseName=&userId=${this.userId}`)
.then(res => {
this.nameList = res.data.list.list
this.name = this.nameList[0].practiseId
this.getData()
}).catch(err => {})
}
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getData() this.getData()
}, },
closeTopics() { getNum() {
this.isShowTopics = false this.$post(`${this.api.pageByNameWrong}?type=${this.type}&pageNum=${this.page}&pageSize=${this.pageSize}&practiseName=${this.keyword}&userId=${this.userId}&id=${this.name}`)
this.resetForm() .then(res => {
this.numData = res.data.list.list
this.totalNum = res.data.list.totalCount
})
.catch(err => {})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
},
handleNumCurrentChange(val) {
this.pageNum = val
this.getData()
},
showNum(row){
this.numVisible = true
this.getNum()
},
getDetail() {
this.$post(`${this.api.pageByNameWrong}?type=${this.type}&pageNum=${this.page}&pageSize=${this.pageSize}&practiseName=${this.keyword}&userId=${this.userId}&id=${this.name}`)
.then(res => {
this.numData = res.data.list.list
this.totalNum = res.data.list.totalCount
})
.catch(err => {})
}, },
show(row){ show(row){
this.$router.push('/testPaper/show') this.detailVisible = true
this.getDetail()
}, },
} }
}; };
@ -152,31 +294,47 @@ export default {
/deep/.no-mb.el-form-item{ /deep/.no-mb.el-form-item{
margin-bottom: 0; margin-bottom: 0;
} }
/deep/.el-radio{ .ques{
margin-right: 15px; .key{
} font-weight: bold;
::v-deep .el-checkbox-group{ color: #333;
font-size: 2px; font-size: 14px;
} }
.Upload { .val{
text-align: center; color: #757575;
} font-size: 14px;
.bt { }
margin-bottom: 15px; .answer{
} display: flex;
.flex_around { align-items: center;
display: flex; padding: 15px;
justify-content: space-around; margin: 15px 0;
align-items: center; font-size: 12px;
} border: 1px solid #e8e8e8;
.card_m { background-color: #f3f2f2;
margin: 10px 0 20px 0; .info{
} display: inline-flex;
.input ::v-deep .el-input { align-items: center;
width: 50%; margin-right: 30px;
} }
.radio { }
margin: 0 15px 0 30px; .meta{
font-weight: 600; padding-left: 10px;
margin: 20px 0;
font-size: 12px;
&.ans{
display: flex;
align-items: center;
.info{
margin-right: 20px;
}
}
.key{
margin-bottom: 5px;
}
.media{
margin-top: 10px;
}
}
} }
</style> </style>

@ -185,7 +185,7 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 4px; height: 4px;
background-color: #e80909; background-color: $main-color;
} }
} }
} }
@ -251,8 +251,8 @@ export default {
cursor: pointer; cursor: pointer;
&.submit{ &.submit{
color: #fff; color: #fff;
background-color: #e80909; background-color: $main-color;
border-color: #e80909; border-color: $main-color;
} }
&:hover{ &:hover{
opacity: .8; opacity: .8;

@ -44,7 +44,7 @@
</div> </div>
<div class="action"> <div class="action">
<button v-if="reply.commentUserId != userId" class="btn" @click="showReply(reply)">回复</button> <button v-if="reply.commentUserId != userId" class="btn" @click="showReply(reply)">回复</button>
<button v-else class="btn" @click="delReply(reply)">删除</button> <button v-else class="btn" @click="delReply(reply,i,index)">删除</button>
</div> </div>
<div class="reply" v-if="reply.showReply"> <div class="reply" v-if="reply.showReply">
<quill :border="true" v-model="reply.replyContent" :height="150" /> <quill :border="true" v-model="reply.replyContent" :height="150" />
@ -107,8 +107,7 @@ export default {
.then(res => { .then(res => {
this.listData = this.handleList(res.data.list.list) this.listData = this.handleList(res.data.list.list)
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}) }).catch(err => {})
.catch(err => {})
}, },
handleList(list){ handleList(list){
list.map(n => { list.map(n => {
@ -138,7 +137,6 @@ export default {
replyList = replyList.concat(n.replyList) replyList = replyList.concat(n.replyList)
}) })
children = children.concat(replyList) children = children.concat(replyList)
console.log(11,replyList,children)
row.children = this.handleList(children) row.children = this.handleList(children)
row.showChildren = true row.showChildren = true
}).catch(res => {}) }).catch(res => {})
@ -165,16 +163,16 @@ export default {
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}, },
delReply(row){ delReply(row,i,index){
if(row.identification == 1){ if(row.identification == 1){
this.$post(`${this.api.delComment}?commentId=${row.commentId}`).then(res => { this.$post(`${this.api.delComment}?commentId=${row.commentId}`).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.listData[index].children.splice(i,1)
}).catch(res => {}) }).catch(res => {})
}else{ }else{
this.$post(`${this.api.delReply}?replyId=${row.replyId}`).then(res => { this.$post(`${this.api.delReply}?replyId=${row.replyId}`).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.listData[index].children.splice(i,1)
}).catch(res => {}) }).catch(res => {})
} }
}, },
@ -209,7 +207,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$mainColor: #cc201c;
.list{ .list{
li{ li{
padding-bottom: 10px; padding-bottom: 10px;
@ -234,7 +231,7 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
font-size: 14px; font-size: 14px;
.username{ .username{
color: $mainColor; color: $main-color;
} }
.publish{ .publish{
margin: 0 5px; margin: 0 5px;
@ -256,7 +253,7 @@ export default {
text-align: right; text-align: right;
.btn{ .btn{
padding: 2px 4px; padding: 2px 4px;
color: $mainColor; color: $main-color;
font-size: 12px; font-size: 12px;
background-color: #fff; background-color: #fff;
border: 1px solid; border: 1px solid;
@ -286,7 +283,7 @@ export default {
.toggle{ .toggle{
margin: 10px 0; margin: 10px 0;
text-align: center; text-align: center;
color: $mainColor; color: $main-color;
font-size: 12px; font-size: 12px;
span{ span{
cursor: pointer; cursor: pointer;

@ -115,7 +115,7 @@ export default {
if(i.includes('option')) answer.push(n[i]) if(i.includes('option')) answer.push(n[i])
} }
n.answer = answer.join('|') n.answer = answer.join('|')
n.userAnswer = n.userAnswer.replace(/&lt;&gt;/g,'|') n.userAnswer = n.userAnswer ? n.userAnswer.replace(/&lt;&gt;/g,'|') : ''
} }
}) })
this.list = data.list this.list = data.list
@ -202,7 +202,7 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 4px; height: 4px;
background-color: #e80909; background-color: $main-color;
} }
} }
} }
@ -268,8 +268,8 @@ export default {
cursor: pointer; cursor: pointer;
&.submit{ &.submit{
color: #fff; color: #fff;
background-color: #e80909; background-color: $main-color;
border-color: #e80909; border-color: $main-color;
} }
&:hover{ &:hover{
opacity: .8; opacity: .8;

@ -1,9 +1,9 @@
/** /**
* @description 鉴权指令 * @description 鉴权指令
* 当传入的权限当前用户没有时会移除该组件 * 当传入的权限当前用户没有时会移除该组件
* 用例<Tag v-auth">text</Tag> 或者:<Tag v-auth="'user:编辑'">text</Tag> * 用例<Tag v-auth>text</Tag> <Tag v-auth="'user:'">text</Tag>
* */ * */
import store from '@/store'; import store from '@/store'
export default { export default {
inserted (el, binding, vnode) { inserted (el, binding, vnode) {
@ -13,13 +13,13 @@ export default {
}else{ }else{
btnText = `${vnode.context.$route.name}:${el.innerText}` btnText = `${vnode.context.$route.name}:${el.innerText}`
} }
const btnPermissions = store.state.btnPermissions; const btnPermissions = store.state.auth.btns
// console.log(22,btnText,btnPermissions) // console.log(22,btnText,btnPermissions)
if (btnText && btnPermissions && btnPermissions.length) { if (btnText && btnPermissions && btnPermissions.length) {
const isPermission = btnPermissions.includes(btnText); const isPermission = btnPermissions.includes(btnText)
if (!isPermission) { if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el); el.parentNode && el.parentNode.removeChild(el)
} }
} }
} }

@ -0,0 +1,26 @@
/**
* 权限管理
* */
export default {
namespaced: true,
state: {
btns: [],
routes: []
},
mutations: {
SET_BTN_AUTH: (state, btns) => {
state.btns = btns
},
SET_ROUTE: (state, routes) => {
state.routes = routes
},
},
actions: {
addBtnAuth({ state,commit },btns) {
commit('SET_BTN_AUTH',btns)
},
addRoutes({ state,commit },routes) {
commit('SET_ROUTE',routes)
}
}
}

@ -1,5 +1,5 @@
/** /**
* 考核管理 * 练习管理
* */ * */
export default { export default {
namespaced: true, namespaced: true,

@ -50,7 +50,7 @@ export default {
}, },
SET_CLIENTNAME: (state, clientName) => { SET_CLIENTNAME: (state, clientName) => {
state.clientName = clientName state.clientName = clientName
} },
}, },
actions: { actions: {
login({ state,commit }, userInfo) { login({ state,commit }, userInfo) {
@ -74,7 +74,7 @@ export default {
Setting.dynamicRoute && addRoutes(routes) Setting.dynamicRoute && addRoutes(routes)
util.session.set(Setting.usernameKey, user.userName) util.session.set(Setting.usernameKey, user.userName)
util.session.set(Setting.storeKey, JSON.stringify(state)) util.session.set(Setting.storeKey, JSON.stringify(state))
Message.success('登录成功'); Message.success('登录成功')
resolve() resolve()
}else{ }else{
Message.error('该用户没有权限') Message.error('该用户没有权限')

@ -25,5 +25,4 @@
@import "visibility"; @import "visibility";
@import "white-space"; @import "white-space";
@import "style"; @import "style";
@import "mixin";

@ -1,9 +0,0 @@
@mixin ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis{
@include ellipsis();
}

@ -0,0 +1,24 @@
$main-color: #e80909;
@mixin ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@mixin mul-ellipsis($num) {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: $num;
text-overflow: ellipsis;
overflow: hidden;
}
.ellipsis{
@include ellipsis();
}
.mul-ellipsis2{
@include mul-ellipsis(2);
}
.mul-ellipsis3{
@include mul-ellipsis(3);
}

@ -13,6 +13,9 @@ module.exports = {
lintOnSave: true, lintOnSave: true,
css: { css: {
loaderOptions: { loaderOptions: {
sass: {
prependData: `@import "@/styles/var.scss";`
},
postcss: { postcss: {
plugins: [ plugins: [
postcss postcss

Loading…
Cancel
Save